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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fe7edd2b1f7dbd4598b7aee1b0a336cfbf44839c
| 190
|
py
|
Python
|
common/GetObject.py
|
micv-dev/DeepKubeGPUCluster
|
b1f674ea3c251a5287ee83d582b193248e04f9d6
|
[
"Apache-2.0"
] | 2
|
2021-01-22T05:56:40.000Z
|
2021-07-03T17:50:49.000Z
|
common/GetObject.py
|
micv-dev/DeepKubeGPUCluster
|
b1f674ea3c251a5287ee83d582b193248e04f9d6
|
[
"Apache-2.0"
] | null | null | null |
common/GetObject.py
|
micv-dev/DeepKubeGPUCluster
|
b1f674ea3c251a5287ee83d582b193248e04f9d6
|
[
"Apache-2.0"
] | null | null | null |
from clusterManagement.tensorflow.TensorflowCluster import TensorflowCluster
def get_ml_object(cluster_type):
if cluster_type == "TENSORFLOW-GPU":
return TensorflowCluster()
| 21.111111
| 76
| 0.784211
| 19
| 190
| 7.631579
| 0.736842
| 0.151724
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147368
| 190
| 8
| 77
| 23.75
| 0.895062
| 0
| 0
| 0
| 0
| 0
| 0.074468
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
fe7f9444dfe72c93171761fd2137709e8e03e867
| 219
|
py
|
Python
|
pergamum/bibloi/apps.py
|
joyinsky/pergamum
|
384a218162ba14a812c1bfcf0a0dc54aea959e4b
|
[
"BSD-2-Clause"
] | null | null | null |
pergamum/bibloi/apps.py
|
joyinsky/pergamum
|
384a218162ba14a812c1bfcf0a0dc54aea959e4b
|
[
"BSD-2-Clause"
] | null | null | null |
pergamum/bibloi/apps.py
|
joyinsky/pergamum
|
384a218162ba14a812c1bfcf0a0dc54aea959e4b
|
[
"BSD-2-Clause"
] | null | null | null |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class BibloiConfig(AppConfig): # Our app config class
name = 'pergamum.bibloi'
verbose_name = _("Articles Database")
| 24.333333
| 55
| 0.762557
| 27
| 219
| 6.037037
| 0.777778
| 0.122699
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164384
| 219
| 8
| 56
| 27.375
| 0.89071
| 0.091324
| 0
| 0
| 0
| 0
| 0.163265
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
fe8f9adcd8bb5cb5149a57bf029b6794074afca0
| 935
|
py
|
Python
|
extraPackages/Pillow-6.0.0/Tests/test_image_getdata.py
|
dolboBobo/python3_ios
|
877f8c2c5890f26292ddd14909bea62a04fe2889
|
[
"BSD-3-Clause"
] | 130
|
2018-02-03T10:25:54.000Z
|
2022-03-25T22:27:22.000Z
|
extraPackages/Pillow-6.0.0/Tests/test_image_getdata.py
|
doc22940/python3_ios
|
877f8c2c5890f26292ddd14909bea62a04fe2889
|
[
"BSD-3-Clause"
] | 9
|
2018-12-14T07:31:42.000Z
|
2020-12-09T20:29:28.000Z
|
extraPackages/Pillow-6.0.0/Tests/test_image_getdata.py
|
doc22940/python3_ios
|
877f8c2c5890f26292ddd14909bea62a04fe2889
|
[
"BSD-3-Clause"
] | 64
|
2018-04-25T08:51:57.000Z
|
2022-01-29T14:13:57.000Z
|
from .helper import PillowTestCase, hopper
class TestImageGetData(PillowTestCase):
def test_sanity(self):
data = hopper().getdata()
len(data)
list(data)
self.assertEqual(data[0], (20, 20, 70))
def test_roundtrip(self):
def getdata(mode):
im = hopper(mode).resize((32, 30))
data = im.getdata()
return data[0], len(data), len(list(data))
self.assertEqual(getdata("1"), (0, 960, 960))
self.assertEqual(getdata("L"), (16, 960, 960))
self.assertEqual(getdata("I"), (16, 960, 960))
self.assertEqual(getdata("F"), (16.0, 960, 960))
self.assertEqual(getdata("RGB"), ((11, 13, 52), 960, 960))
self.assertEqual(getdata("RGBA"), ((11, 13, 52, 255), 960, 960))
self.assertEqual(getdata("CMYK"), ((244, 242, 203, 0), 960, 960))
self.assertEqual(getdata("YCbCr"), ((16, 147, 123), 960, 960))
| 31.166667
| 73
| 0.567914
| 117
| 935
| 4.521368
| 0.384615
| 0.255198
| 0.332703
| 0.277883
| 0.383743
| 0.277883
| 0
| 0
| 0
| 0
| 0
| 0.145092
| 0.248128
| 935
| 29
| 74
| 32.241379
| 0.607397
| 0
| 0
| 0
| 0
| 0
| 0.02139
| 0
| 0
| 0
| 0
| 0
| 0.45
| 1
| 0.15
| false
| 0
| 0.05
| 0
| 0.3
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fe9e3446ba75729f7666d449e05291eae5cf0970
| 130
|
py
|
Python
|
exerc/Estrutura Condicional/IF_exerc06.py
|
honeythisa/LPI
|
3950daa56304335cdb3838c5d6cab55a27c3c8fa
|
[
"MIT"
] | null | null | null |
exerc/Estrutura Condicional/IF_exerc06.py
|
honeythisa/LPI
|
3950daa56304335cdb3838c5d6cab55a27c3c8fa
|
[
"MIT"
] | null | null | null |
exerc/Estrutura Condicional/IF_exerc06.py
|
honeythisa/LPI
|
3950daa56304335cdb3838c5d6cab55a27c3c8fa
|
[
"MIT"
] | null | null | null |
valor1 = 16
valor2 = 61
if valor1 > valor2:
print('{} é maior.'.format(valor1))
else:
print('{} é maior.'.format(valor2))
| 18.571429
| 39
| 0.615385
| 18
| 130
| 4.444444
| 0.555556
| 0.15
| 0.275
| 0.425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 0.192308
| 130
| 7
| 40
| 18.571429
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0.167939
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
feb3f6147a7b3415d80a680e7c0d58c2e82355c6
| 154
|
py
|
Python
|
src/organizations/apps.py
|
chiliseed/hub
|
83f29fbdd12e2260397e18e635f508459fa4990e
|
[
"Apache-2.0"
] | null | null | null |
src/organizations/apps.py
|
chiliseed/hub
|
83f29fbdd12e2260397e18e635f508459fa4990e
|
[
"Apache-2.0"
] | 4
|
2021-04-08T20:10:15.000Z
|
2021-06-10T20:18:17.000Z
|
src/organizations/apps.py
|
chiliseed/hub
|
83f29fbdd12e2260397e18e635f508459fa4990e
|
[
"Apache-2.0"
] | null | null | null |
"""Django app configuration."""
from django.apps import AppConfig
class OrganizationsConfig(AppConfig):
"""App conf."""
name = "organizations"
| 17.111111
| 37
| 0.701299
| 15
| 154
| 7.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162338
| 154
| 8
| 38
| 19.25
| 0.837209
| 0.227273
| 0
| 0
| 0
| 0
| 0.12037
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
22c7c7a320003dea2e9defaf33aea204739dc79f
| 55
|
py
|
Python
|
challenge_1/python/carter010/reverse.py
|
rchicoli/2017-challenges
|
44f0b672e5dea34de1dde131b6df837d462f8e29
|
[
"Apache-2.0"
] | 271
|
2017-01-01T22:58:36.000Z
|
2021-11-28T23:05:29.000Z
|
challenge_1/python/carter010/reverse.py
|
AakashOfficial/2017Challenges
|
a8f556f1d5b43c099a0394384c8bc2d826f9d287
|
[
"Apache-2.0"
] | 283
|
2017-01-01T23:26:05.000Z
|
2018-03-23T00:48:55.000Z
|
challenge_1/python/carter010/reverse.py
|
AakashOfficial/2017Challenges
|
a8f556f1d5b43c099a0394384c8bc2d826f9d287
|
[
"Apache-2.0"
] | 311
|
2017-01-01T22:59:23.000Z
|
2021-09-23T00:29:12.000Z
|
# python3 --3.5
message = "Hello"
print(message[::-1]
| 11
| 19
| 0.618182
| 8
| 55
| 4.25
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 0.145455
| 55
| 4
| 20
| 13.75
| 0.638298
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
fe06211fe6dd8f63a49201f071fd5065fe0a89e2
| 5,422
|
py
|
Python
|
tests/test_call_wasm_contract/test.py
|
uuosio/python-contract-demos
|
7d56ba371f2115b0ab895fca3e71092c2523f25d
|
[
"MIT"
] | 2
|
2020-12-08T13:15:06.000Z
|
2020-12-29T10:06:44.000Z
|
tests/test_call_wasm_contract/test.py
|
uuosio/python-contract-demos
|
7d56ba371f2115b0ab895fca3e71092c2523f25d
|
[
"MIT"
] | null | null | null |
tests/test_call_wasm_contract/test.py
|
uuosio/python-contract-demos
|
7d56ba371f2115b0ab895fca3e71092c2523f25d
|
[
"MIT"
] | null | null | null |
'''
Example for call wasm contract.
'''
from uuoskit import chainapi, config, wallet
from uuoskit import test_helper
wasm_abi = {
"version": "eosio::abi/1.0",
"types": [],
"structs": [],
"actions": [],
"tables": [],
"ricardian_clauses": [],
"error_messages": [],
"abi_extensions": []
}
'''c++ code
#include <eosio/eosio.hpp>
#include <eosio/action.hpp>
#include <eosio/print.hpp>
extern "C" {
__attribute__((eosio_wasm_import))
int call_contract_get_args(void* args, size_t size1);
__attribute__((eosio_wasm_import))
int call_contract_set_results(void* result, size_t size1);
void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
if (receiver == code) {
uint64_t args[2];
int args_size = ::call_contract_get_args(&args, sizeof(args));
eosio::print("+++++++++++call: arg size:", args_size, "\n");
eosio::check(args_size == 16, "bad args size");
if (args[0] == eosio::name("calltest1").value) {
eosio::print("+++++++++++call: args[1]:", args[1], "\n");
args[1] += 1;
::call_contract_set_results(&args[1], sizeof(uint64_t));
}
}
}
}
'''
wasm_code = b'\x00asm\x01\x00\x00\x00\x01)\x08`\x02\x7f\x7f\x01\x7f`\x01\x7f\x00`\x01~\x00`\x02\x7f\x7f\x00`\x03\x7f\x7f\x7f\x01\x7f`\x00\x00`\x01\x7f\x01\x7f`\x03~~~\x00\x02\x86\x01\x07\x03env\x16call_contract_get_args\x00\x00\x03env\x06prints\x00\x01\x03env\x06printi\x00\x02\x03env\x0ceosio_assert\x00\x03\x03env\x07printui\x00\x02\x03env\x19call_contract_set_results\x00\x00\x03env\x06memset\x00\x04\x03\x07\x06\x05\x06\x05\x01\x07\x00\x04\x05\x01p\x01\x01\x01\x05\x03\x01\x00\x01\x06\x16\x03\x7f\x01A\x80\xc0\x00\x0b\x7f\x00A\xfc\xc1\x00\x0b\x7f\x00A\xfc\xc1\x00\x0b\x07\t\x01\x05apply\x00\x0b\n\xcc\x06\x06\x04\x00\x10\t\x0b\xad\x01\x01\x03\x7f \x00!\x01\x02@\x02@\x02@ \x00A\x03qE\r\x00 \x00-\x00\x00E\r\x01 \x00A\x01j!\x01\x03@ \x01A\x03qE\r\x01 \x01-\x00\x00!\x02 \x01A\x01j"\x03!\x01 \x02\r\x00\x0b \x03A\x7fj \x00k\x0f\x0b \x01A|j!\x01\x03@ \x01A\x04j"\x01(\x02\x00"\x02A\x7fs \x02A\xff\xfd\xfbwjqA\x80\x81\x82\x84xqE\r\x00\x0b \x02A\xff\x01qE\r\x01\x03@ \x01-\x00\x01!\x02 \x01A\x01j"\x03!\x01 \x02\r\x00\x0b \x03 \x00k\x0f\x0b \x00 \x00k\x0f\x0b \x01 \x00k\x0b6\x01\x01\x7f#\x00A\x10k"\x00A\x006\x02\x0cA\x00 \x00(\x02\x0c(\x02\x00A\x07jAxq"\x006\x02\x84@A\x00 \x006\x02\x80@A\x00?\x006\x02\x8c@\x0b\x02\x00\x0b\xc1\x01\x01\x02\x7f#\x00A0k"\x03$\x00\x10\x07\x02@ \x00 \x01R\r\x00 \x03A jA\x10\x10\x00!\x04A\x90\xc0\x00\x10\x01 \x04\xac\x10\x02A\xab\xc0\x00\x10\x01\x02@ \x04A\x10F\r\x00A\x00A\xad\xc0\x00\x10\x03\x0b \x03)\x03 !\x00 \x03A\xbb\xc0\x006\x02\x10 \x03A\xbb\xc0\x00\x10\x086\x02\x14 \x03 \x03)\x03\x107\x03\x08 \x03A\x18j \x03A\x08j\x10\x0c\x1a \x00B\x80\x80\xa0\xc8\xb1\x95\xc7\xd1\xc1\x00R\r\x00A\xc5\xc0\x00\x10\x01 \x03)\x03(\x10\x04A\xab\xc0\x00\x10\x01 \x03 \x03)\x03(B\x01|7\x03( \x03A jA\x08rA\x08\x10\x05\x1a\x0bA\x00\x10\n \x03A0j$\x00\x0b\x98\x03\x03\x02\x7f\x01~\x03\x7f \x00B\x007\x03\x00\x02@\x02@\x02@\x02@\x02@ \x01(\x02\x04"\x02A\x0eI\r\x00A\x00A\xdf\xc0\x00\x10\x03A\x0c!\x03\x0c\x01\x0b \x02E\r\x03 \x02A\x0c \x02A\x0cI\x1b"\x03E\r\x01\x0b \x00)\x03\x00!\x04 \x01(\x02\x00!\x05A\x00!\x06\x03@ \x00 \x04B\x05\x86"\x047\x03\x00\x02@\x02@ \x05 \x06j-\x00\x00"\x07A.G\r\x00A\x00!\x07\x0c\x01\x0b\x02@ \x07AOjA\xff\x01qA\x04K\r\x00 \x07APj!\x07\x0c\x01\x0b\x02@ \x07A\x9f\x7fjA\xff\x01qA\x19K\r\x00 \x07A\xa5\x7fj!\x07\x0c\x01\x0bA\x00!\x07A\x00A\xc8\xc1\x00\x10\x03 \x00)\x03\x00!\x04\x0b \x00 \x04 \x07\xadB\xff\x01\x83\x84"\x047\x03\x00 \x06A\x01j"\x06 \x03I\r\x00\x0c\x02\x0b\x0b \x00)\x03\x00!\x04A\x00!\x03\x0b \x00 \x04A\x0c \x03kA\x05lA\x04j\xad\x867\x03\x00 \x02A\rG\r\x00B\x00!\x04\x02@ \x01(\x02\x00-\x00\x0c"\x06A.F\r\x00\x02@ \x06AOjA\xff\x01qA\x04K\r\x00 \x06APj\xadB\xff\x01\x83!\x04\x0c\x01\x0b\x02@ \x06A\x9f\x7fjA\xff\x01qA\x1aO\r\x00 \x06A\xa5\x7fj"\x06\xadB\xff\x01\x83!\x04 \x06A\xff\x01qA\x10I\r\x01A\x00A\x85\xc1\x00\x10\x03\x0c\x01\x0bA\x00A\xc8\xc1\x00\x10\x03\x0b \x00 \x00)\x03\x00 \x04\x847\x03\x00\x0b \x00\x0b\x0b\xae\x02\t\x00A\x90\xc0\x00\x0b\x1b+++++++++++call: arg size:\x00\x00A\xab\xc0\x00\x0b\x02\n\x00\x00A\xad\xc0\x00\x0b\x0ebad args size\x00\x00A\xbb\xc0\x00\x0b\ncalltest1\x00\x00A\xc5\xc0\x00\x0b\x1a+++++++++++call: args[1]:\x00\x00A\xdf\xc0\x00\x0b&string is too long to be a valid name\x00\x00A\x85\xc1\x00\x0bCthirteenth character in name cannot be a letter that comes after j\x00\x00A\xc8\xc1\x00\x0b4character is not in allowed character set for names\x00\x00A\x00\x0b\x04\x00!\x00\x00'
src, abi = test_helper.load_code()
test_account1 = test_helper.test_account1
test_account2 = test_helper.test_account2
async def run_test():
uuosapi = chainapi.ChainApiAsync(config.network_url)
code = uuosapi.mp_compile(test_account1, src)
print(test_account1, test_account2)
try:
r = await uuosapi.deploy_contract(test_account2, wasm_code, wasm_abi, vm_type=0)
except chainapi.ChainException as e:
print('+++deploy error:', e.json['message'])
r = await uuosapi.deploy_python_contract(test_account1, code, abi)
args = 'hello,world'
try:
r = await uuosapi.push_action(test_account1, 'sayhello', args, {test_account1: 'active'})
test_helper.print_console(r)
except chainapi.ChainException as e:
print('+++test error:', e)
| 74.273973
| 3,373
| 0.68554
| 983
| 5,422
| 3.706002
| 0.244151
| 0.029646
| 0.017293
| 0.013176
| 0.119133
| 0.088389
| 0.048312
| 0.026901
| 0.014823
| 0
| 0
| 0.236386
| 0.105865
| 5,422
| 72
| 3,374
| 75.305556
| 0.515058
| 0.005717
| 0
| 0.129032
| 0
| 0.032258
| 0.787043
| 0.612643
| 0
| 0
| 0
| 0
| 0.032258
| 1
| 0
| false
| 0
| 0.064516
| 0
| 0.064516
| 0.16129
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fe1b8a7335e46649e357f10361d28b3b80e6a6bd
| 1,060
|
py
|
Python
|
Validation/Configuration/python/hgcalSimValid_cff.py
|
NTrevisani/cmssw
|
a212a27526f34eb9507cf8b875c93896e6544781
|
[
"Apache-2.0"
] | 3
|
2018-08-24T19:10:26.000Z
|
2019-02-19T11:45:32.000Z
|
Validation/Configuration/python/hgcalSimValid_cff.py
|
NTrevisani/cmssw
|
a212a27526f34eb9507cf8b875c93896e6544781
|
[
"Apache-2.0"
] | 7
|
2016-07-17T02:34:54.000Z
|
2019-08-13T07:58:37.000Z
|
Validation/Configuration/python/hgcalSimValid_cff.py
|
NTrevisani/cmssw
|
a212a27526f34eb9507cf8b875c93896e6544781
|
[
"Apache-2.0"
] | 5
|
2018-08-21T16:37:52.000Z
|
2020-01-09T13:33:17.000Z
|
import FWCore.ParameterSet.Config as cms
from Validation.HGCalValidation.simhitValidation_cff import *
from Validation.HGCalValidation.digiValidation_cff import *
from Validation.HGCalValidation.rechitValidation_cff import *
from Validation.HGCalValidation.hgcalHitValidation_cfi import *
from Validation.HGCalValidation.HGCalValidator_cfi import hgcalValidator
hgcalValidatorSequence = cms.Sequence(hgcalValidator)
hgcalValidation = cms.Sequence(hgcalSimHitValidationEE
+ hgcalSimHitValidationHEF
+ hgcalSimHitValidationHEB
+ hgcalDigiValidationEE
+ hgcalDigiValidationHEF
+ hgcalDigiValidationHEB
+ hgcalRecHitValidationEE
+ hgcalRecHitValidationHEF
+ hgcalRecHitValidationHEB
+ hgcalHitValidationSequence
+ hgcalValidatorSequence)
| 46.086957
| 72
| 0.613208
| 55
| 1,060
| 11.727273
| 0.509091
| 0.108527
| 0.224806
| 0.217054
| 0.176744
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.354717
| 1,060
| 22
| 73
| 48.181818
| 0.942982
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 1
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fe1d4fa2551ca29c2c4fa968ed0627c71cae0947
| 77
|
py
|
Python
|
conftest.py
|
jonaraphael/skytruth
|
2b69e37b51a5f335b575772d9c1dcfe334d6ba8e
|
[
"MIT"
] | 6
|
2021-04-26T15:50:00.000Z
|
2022-01-11T16:46:35.000Z
|
conftest.py
|
jonaraphael/skytruth
|
2b69e37b51a5f335b575772d9c1dcfe334d6ba8e
|
[
"MIT"
] | null | null | null |
conftest.py
|
jonaraphael/skytruth
|
2b69e37b51a5f335b575772d9c1dcfe334d6ba8e
|
[
"MIT"
] | 1
|
2021-11-12T02:05:33.000Z
|
2021-11-12T02:05:33.000Z
|
"""This empty file is added to help pytest find other modules in the repo."""
| 77
| 77
| 0.74026
| 14
| 77
| 4.071429
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168831
| 77
| 1
| 77
| 77
| 0.890625
| 0.922078
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a3e48f2ca2715798e9c76daf8fc22979838d939f
| 189
|
py
|
Python
|
others/webscraping2e/chapter1.py
|
1067511899/tornado-learn
|
497cc8f7816f15e2eab834a758f192d50704fe05
|
[
"Apache-2.0"
] | 1
|
2017-12-27T09:05:23.000Z
|
2017-12-27T09:05:23.000Z
|
others/webscraping2e/chapter1.py
|
1067511899/tornado-learn
|
497cc8f7816f15e2eab834a758f192d50704fe05
|
[
"Apache-2.0"
] | null | null | null |
others/webscraping2e/chapter1.py
|
1067511899/tornado-learn
|
497cc8f7816f15e2eab834a758f192d50704fe05
|
[
"Apache-2.0"
] | null | null | null |
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen('http://www.pythonscraping.com/pages/page1.html')
bs = BeautifulSoup(html.read(), 'html.parser')
print(bs.h1)
| 37.8
| 64
| 0.777778
| 27
| 189
| 5.444444
| 0.703704
| 0.231293
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017241
| 0.079365
| 189
| 5
| 65
| 37.8
| 0.827586
| 0
| 0
| 0
| 0
| 0
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0.2
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
a3fca5ab002c5d33e691217f5eacaecc7d70f7af
| 567
|
py
|
Python
|
flask_site/controllers/redirects.py
|
wcpr740/wcpr.org
|
6a9120122d45a9721a7140fcc594ba5634b91f90
|
[
"Apache-2.0"
] | 2
|
2019-09-10T15:53:20.000Z
|
2020-10-06T20:51:06.000Z
|
flask_site/controllers/redirects.py
|
wcpr740/wcpr.org
|
6a9120122d45a9721a7140fcc594ba5634b91f90
|
[
"Apache-2.0"
] | 8
|
2020-12-18T22:13:17.000Z
|
2022-03-11T23:14:13.000Z
|
flask_site/controllers/redirects.py
|
wcpr740/wcpr.org
|
6a9120122d45a9721a7140fcc594ba5634b91f90
|
[
"Apache-2.0"
] | 1
|
2018-09-19T22:58:19.000Z
|
2018-09-19T22:58:19.000Z
|
from flask import url_for
from flask_site import app
from flask_site.libraries.html_redirect_gen import html_redirect
@app.route('/mobile_unit/')
def mobile_unit_alt():
return html_redirect(url_for('mobile_unit'))
@app.route('/showsignup/')
def show_signup_form():
return html_redirect('https://docs.google.com/forms/d/e/'
'1FAIpQLScmrvmnkk50c257_xoojpww7C7S4B95B8IQ7zIHywCeNIUZPQ/viewform')
@app.route('/agreement/')
def member_agreement():
return html_redirect(url_for('static', filename='docs/WCPRMemberAgreement.pdf'))
| 27
| 93
| 0.749559
| 71
| 567
| 5.71831
| 0.521127
| 0.147783
| 0.133005
| 0.103448
| 0.118227
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026316
| 0.128748
| 567
| 20
| 94
| 28.35
| 0.795547
| 0
| 0
| 0
| 0
| 0
| 0.31746
| 0.164021
| 0
| 0
| 0
| 0
| 0
| 1
| 0.230769
| true
| 0
| 0.230769
| 0.230769
| 0.692308
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
4309e409c6087ffc4ecb4056496cc8422b70b40c
| 153
|
py
|
Python
|
Gate/config.py
|
micbelgique/DevCamp2016-Team9
|
aa69a8d79dcb491c9c2b27a036db7cd2855a6b52
|
[
"MIT"
] | null | null | null |
Gate/config.py
|
micbelgique/DevCamp2016-Team9
|
aa69a8d79dcb491c9c2b27a036db7cd2855a6b52
|
[
"MIT"
] | null | null | null |
Gate/config.py
|
micbelgique/DevCamp2016-Team9
|
aa69a8d79dcb491c9c2b27a036db7cd2855a6b52
|
[
"MIT"
] | null | null | null |
class Config:
gateId = 0
route = ""
port = "COM3"
def __init__(self, gateId, route):
self.gateId=gateId
self.route=route
| 19.125
| 38
| 0.568627
| 18
| 153
| 4.611111
| 0.555556
| 0.240964
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019231
| 0.320261
| 153
| 7
| 39
| 21.857143
| 0.778846
| 0
| 0
| 0
| 0
| 0
| 0.026144
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0
| 0
| 0.714286
| 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
| 0
| 0
| 1
| 0
|
0
| 4
|
4a2ad1fffad3b28295e60db4f32540232e30c6dd
| 5,870
|
py
|
Python
|
AppServer/lib/django-1.4/tests/modeltests/validation/test_error_messages.py
|
loftwah/appscale
|
586fc1347ebc743d7a632de698f4dbfb09ae38d6
|
[
"Apache-2.0"
] | 790
|
2015-01-03T02:13:39.000Z
|
2020-05-10T19:53:57.000Z
|
AppServer/lib/django-1.4/tests/modeltests/validation/test_error_messages.py
|
nlake44/appscale
|
6944af660ca4cb772c9b6c2332ab28e5ef4d849f
|
[
"Apache-2.0"
] | 1,361
|
2015-01-08T23:09:40.000Z
|
2020-04-14T00:03:04.000Z
|
AppServer/lib/django-1.4/tests/modeltests/validation/test_error_messages.py
|
nlake44/appscale
|
6944af660ca4cb772c9b6c2332ab28e5ef4d849f
|
[
"Apache-2.0"
] | 155
|
2015-01-08T22:59:31.000Z
|
2020-04-08T08:01:53.000Z
|
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.unittest import TestCase
class ValidationMessagesTest(TestCase):
def test_autofield_field_raises_error_message(self):
f = models.AutoField(primary_key=True)
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages, [u"'foo' value must be an integer."])
# primary_key must be True. Refs #12467.
self.assertRaises(AssertionError, models.AutoField, 'primary_key', False)
try:
models.AutoField(primary_key=False)
except AssertionError, e:
self.assertEqual(str(e), "AutoFields must have primary_key=True.")
def test_integer_field_raises_error_message(self):
f = models.IntegerField()
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages, [u"'foo' value must be an integer."])
def test_boolean_field_raises_error_message(self):
f = models.BooleanField()
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages,
[u"'foo' value must be either True or False."])
def test_float_field_raises_error_message(self):
f = models.FloatField()
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages, [u"'foo' value must be a float."])
def test_decimal_field_raises_error_message(self):
f = models.DecimalField()
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages,
[u"'foo' value must be a decimal number."])
def test_null_boolean_field_raises_error_message(self):
f = models.NullBooleanField()
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages,
[u"'foo' value must be either None, True or False."])
def test_date_field_raises_error_message(self):
f = models.DateField()
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'foo' value has an invalid date format. "
u"It must be in YYYY-MM-DD format."])
self.assertRaises(ValidationError, f.clean, 'aaaa-10-10', None)
try:
f.clean('aaaa-10-10', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'aaaa-10-10' value has an invalid date format. "
u"It must be in YYYY-MM-DD format."])
self.assertRaises(ValidationError, f.clean, '2011-13-10', None)
try:
f.clean('2011-13-10', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'2011-13-10' value has the correct format (YYYY-MM-DD) "
u"but it is an invalid date."])
self.assertRaises(ValidationError, f.clean, '2011-10-32', None)
try:
f.clean('2011-10-32', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'2011-10-32' value has the correct format (YYYY-MM-DD) "
u"but it is an invalid date."])
def test_datetime_field_raises_error_message(self):
f = models.DateTimeField()
# Wrong format
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'foo' value has an invalid format. It must be "
u"in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."])
# Correct format but invalid date
self.assertRaises(ValidationError, f.clean, '2011-10-32', None)
try:
f.clean('2011-10-32', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'2011-10-32' value has the correct format "
u"(YYYY-MM-DD) but it is an invalid date."])
# Correct format but invalid date/time
self.assertRaises(ValidationError, f.clean, '2011-10-32 10:10', None)
try:
f.clean('2011-10-32 10:10', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'2011-10-32 10:10' value has the correct format "
u"(YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]) "
u"but it is an invalid date/time."])
def test_time_field_raises_error_message(self):
f = models.TimeField()
# Wrong format
self.assertRaises(ValidationError, f.clean, 'foo', None)
try:
f.clean('foo', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'foo' value has an invalid format. It must be in "
u"HH:MM[:ss[.uuuuuu]] format."])
# Correct format but invalid time
self.assertRaises(ValidationError, f.clean, '25:50', None)
try:
f.clean('25:50', None)
except ValidationError, e:
self.assertEqual(e.messages, [
u"'25:50' value has the correct format "
u"(HH:MM[:ss[.uuuuuu]]) but it is an invalid time."])
| 39.931973
| 81
| 0.583986
| 714
| 5,870
| 4.729692
| 0.12605
| 0.053302
| 0.047972
| 0.069292
| 0.840095
| 0.770506
| 0.727273
| 0.649689
| 0.594907
| 0.567367
| 0
| 0.033382
| 0.300852
| 5,870
| 146
| 82
| 40.205479
| 0.789474
| 0.027939
| 0
| 0.572581
| 0
| 0
| 0.210951
| 0.011934
| 0
| 0
| 0
| 0
| 0.266129
| 0
| null | null | 0
| 0.024194
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4a61ade723a3c8c393d8d9d399304ad1e73930ce
| 132
|
py
|
Python
|
tests/test_len.py
|
gtors/lambdaz
|
870ed4d4bca5a7e813363452dbfbb2ee04229bd6
|
[
"MIT"
] | 1
|
2022-03-18T15:27:23.000Z
|
2022-03-18T15:27:23.000Z
|
tests/test_len.py
|
gtors/lambdaz
|
870ed4d4bca5a7e813363452dbfbb2ee04229bd6
|
[
"MIT"
] | null | null | null |
tests/test_len.py
|
gtors/lambdaz
|
870ed4d4bca5a7e813363452dbfbb2ee04229bd6
|
[
"MIT"
] | null | null | null |
from lambdaz import a0
def test_len():
l = (a0._len_() > 3)._
assert next(filter(l, [(), (1,2), (1,2,3,4)])) == (1,2,3,4)
| 18.857143
| 63
| 0.507576
| 25
| 132
| 2.52
| 0.6
| 0.095238
| 0.095238
| 0.126984
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0.212121
| 132
| 6
| 64
| 22
| 0.480769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4a6bf9815e2767b086f64eebf36c74fb60059614
| 1,219
|
py
|
Python
|
test_str_divide.py
|
PrimeNumbers/primes_search
|
11ebc8591a0643913af3aee699ceeb3668bd49df
|
[
"MIT"
] | 1
|
2020-07-17T03:35:05.000Z
|
2020-07-17T03:35:05.000Z
|
test_str_divide.py
|
PrimeNumbers/primes_search
|
11ebc8591a0643913af3aee699ceeb3668bd49df
|
[
"MIT"
] | 1
|
2020-07-16T19:50:05.000Z
|
2020-07-16T19:52:40.000Z
|
test_str_divide.py
|
PrimeNumbers/primes_research
|
11ebc8591a0643913af3aee699ceeb3668bd49df
|
[
"MIT"
] | null | null | null |
import unittest
from str_divide import divide
class TestDivideStrings(unittest.TestCase):
#cases to test
# divide by 0 error
# divide by 1
# 0 divided by
#
def test_obvious_small(self):
self.assertEqual(divide('10','2'), '5')
self.assertEqual(divide('2','3'), '0')
self.assertEqual(divide('123','2'), '61')
self.assertEqual(divide('2','123'), '0')
self.assertEqual(divide('999','999'), '1')
self.assertEqual(divide('2','99'), '0')
self.assertEqual(divide('567','765'), '0')
self.assertEqual(divide('500','100'), '5')
self.assertEqual(divide('10000','1000'), '10')
# self.assertEqual(divide('',''), '')
def test_edge(self):
#should be if either is 0
self.assertEqual(divide('0','123'), '0')
self.assertEqual(divide('456','0'), '0')
#negative should find it based on either being negative
self.assertEqual(divide('-123','1234'), '-')
self.assertEqual(divide('123','-456'), '-')
#large divide
self.assertEqual(divide('987654321987654321987654321','123456789123456789123456789'), '8')
if __name__ == '__main__':
unittest.main()
| 32.078947
| 98
| 0.587367
| 140
| 1,219
| 5.028571
| 0.392857
| 0.319602
| 0.447443
| 0.1875
| 0.071023
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144374
| 0.227235
| 1,219
| 37
| 99
| 32.945946
| 0.602972
| 0.155865
| 0
| 0
| 0
| 0
| 0.141176
| 0.052941
| 0
| 0
| 0
| 0
| 0.666667
| 1
| 0.095238
| false
| 0
| 0.095238
| 0
| 0.238095
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4a701ee496aff0a81ac6d11a1acf6a8b53e1e7b1
| 1,130
|
py
|
Python
|
resources/panels/seeds/period_noun.py
|
exposit/pythia-oracle
|
60e4e806c9ed1627f2649822ab1901d28933daac
|
[
"MIT"
] | 32
|
2016-08-27T01:31:42.000Z
|
2022-03-21T08:59:28.000Z
|
resources/panels/seeds/period_noun.py
|
exposit/pythia-oracle
|
60e4e806c9ed1627f2649822ab1901d28933daac
|
[
"MIT"
] | 3
|
2016-08-27T00:51:47.000Z
|
2019-08-26T13:23:04.000Z
|
resources/panels/seeds/period_noun.py
|
exposit/pythia-oracle
|
60e4e806c9ed1627f2649822ab1901d28933daac
|
[
"MIT"
] | 10
|
2016-08-28T14:14:41.000Z
|
2021-03-18T03:24:22.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# a tale of two cities
chart = ["abode", "accomplishments", "annihilation", "anxiety", "ball", "banquets", "barber", "boxes", "buildings", "card-towers", "causes", "chosen", "confidence", "construction", "contention", "contrivances", "conversation", "copy", "counterweight", "criminals", "damages", "date", "death", "degree", "discreet", "disguise", "dissimulation", "dissolution", "embraces", "exaltation", "execrations", "fancy", "felons", "flood", "forger", "gloom", "hanging", "hiding", "hilt", "hole", "horrors", "injuries", "intrigue", "judges", "labour", "lamp", "level", "lightning", "magic", "menacing", "movement", "nails", "odds", "opposite", "originality", "paces", "patrols", "pikes", "prevention", "punishment", "rattling", "rents", "retribution", "reveals", "sadness", "screw", "scruple", "season", "selves", "setting", "spies", "splendour", "staircases", "stand", "struggle", "surface", "suspicion", "swing", "sympathy", "system", "tale", "tall", "tavern", "temper", "thieves", "thoroughfare", "towers", "traps", "types", "vagabond", "wailing", "waking", "wretches"],
| 282.5
| 1,060
| 0.640708
| 107
| 1,130
| 6.766355
| 0.981308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.000978
| 0.095575
| 1,130
| 4
| 1,060
| 282.5
| 0.707436
| 0.056637
| 0
| 0
| 0
| 0
| 0.638158
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4a9d947c0cc5f672a4fed7e63783f04002abbd2e
| 173
|
py
|
Python
|
BootCRUDApp/forms.py
|
cs-fullstack-2019-spring/django-bootstrapcrud-cw-MelaatiJ
|
c6c6c3ed332fa664059dc93524a201dc9647933a
|
[
"Apache-2.0"
] | null | null | null |
BootCRUDApp/forms.py
|
cs-fullstack-2019-spring/django-bootstrapcrud-cw-MelaatiJ
|
c6c6c3ed332fa664059dc93524a201dc9647933a
|
[
"Apache-2.0"
] | null | null | null |
BootCRUDApp/forms.py
|
cs-fullstack-2019-spring/django-bootstrapcrud-cw-MelaatiJ
|
c6c6c3ed332fa664059dc93524a201dc9647933a
|
[
"Apache-2.0"
] | null | null | null |
from .models import GarageSaleModel
from django import forms
class GarageSaleForm(forms.ModelForm):
class Meta:
model=GarageSaleModel
fields= "__all__"
| 21.625
| 38
| 0.734104
| 18
| 173
| 6.833333
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208092
| 173
| 7
| 39
| 24.714286
| 0.89781
| 0
| 0
| 0
| 0
| 0
| 0.040462
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4aa28d142a86804cbb2d3c838fe03054b95c42eb
| 234
|
py
|
Python
|
mindapp/admin.py
|
isha27255/mindersnatch
|
9c775141327d17f09518da5227763da45bf8ce4f
|
[
"BSD-3-Clause"
] | 5
|
2020-04-01T14:40:06.000Z
|
2020-10-22T19:13:13.000Z
|
mindapp/admin.py
|
rishav4101/mindersnatch
|
afb2be1830106175e1317ea6596ec28bdbf20df4
|
[
"BSD-3-Clause"
] | 8
|
2021-03-19T09:28:07.000Z
|
2022-03-12T00:21:11.000Z
|
mindapp/admin.py
|
rishav4101/mindersnatch
|
afb2be1830106175e1317ea6596ec28bdbf20df4
|
[
"BSD-3-Clause"
] | 9
|
2020-04-01T09:12:58.000Z
|
2021-08-07T11:59:29.000Z
|
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(option)
admin.site.register(Situation)
admin.site.register(Config)
admin.site.register(Player)
admin.site.register(SituationTimer)
| 29.25
| 35
| 0.820513
| 32
| 234
| 6
| 0.46875
| 0.234375
| 0.442708
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07265
| 234
| 8
| 35
| 29.25
| 0.884793
| 0.111111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.285714
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4aa70377327c8c923816a2898c5d674876200ccb
| 389
|
py
|
Python
|
products/views.py
|
thisishaykins/PyShop
|
12de0665357d6dad9dda3ce0fd0d6a85a2347b46
|
[
"MIT"
] | 17
|
2019-07-31T15:29:22.000Z
|
2022-02-16T20:03:09.000Z
|
products/views.py
|
thisishaykins/PyShop
|
12de0665357d6dad9dda3ce0fd0d6a85a2347b46
|
[
"MIT"
] | null | null | null |
products/views.py
|
thisishaykins/PyShop
|
12de0665357d6dad9dda3ce0fd0d6a85a2347b46
|
[
"MIT"
] | 13
|
2019-08-04T07:09:58.000Z
|
2021-08-28T04:17:22.000Z
|
from django.http import HttpResponse
from django.shortcuts import render
from .models import Product
# Create your views here.
def index(request):
# return HttpResponse('Hello World')
products = Product.objects.all()
return render(request, 'index.html',
{'products': products})
def new(request):
return HttpResponse('Welcome to PyShop New Arrivals')
| 22.882353
| 57
| 0.70437
| 46
| 389
| 5.956522
| 0.608696
| 0.072993
| 0.182482
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.200514
| 389
| 16
| 58
| 24.3125
| 0.881029
| 0.1491
| 0
| 0
| 0
| 0
| 0.146789
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.333333
| 0.111111
| 0.777778
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
|
0
| 4
|
4abeb087e1b8e714ae647fd1c2fcaefd31affb6c
| 704
|
py
|
Python
|
src/python/pants/backend/experimental/codegen/thrift/apache/java/register.py
|
wimax-grapl/pants
|
0aabd417a772ea4e39999c4415c67db40de679a4
|
[
"Apache-2.0"
] | null | null | null |
src/python/pants/backend/experimental/codegen/thrift/apache/java/register.py
|
wimax-grapl/pants
|
0aabd417a772ea4e39999c4415c67db40de679a4
|
[
"Apache-2.0"
] | 28
|
2021-12-27T15:53:46.000Z
|
2022-03-23T11:01:42.000Z
|
src/python/pants/backend/experimental/codegen/thrift/apache/java/register.py
|
riisi/pants
|
b33327389fab67c47b919710ea32f20ca284b1a6
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.codegen.thrift.apache.java.rules import rules as apache_thrift_java_rules
from pants.backend.codegen.thrift.apache.rules import rules as apache_thrift_rules
from pants.backend.codegen.thrift.rules import rules as thrift_rules
from pants.backend.codegen.thrift.target_types import (
ThriftSourcesGeneratorTarget,
ThriftSourceTarget,
)
def target_types():
return [ThriftSourcesGeneratorTarget, ThriftSourceTarget]
def rules():
return [
*thrift_rules(),
*apache_thrift_rules(),
*apache_thrift_java_rules(),
]
| 32
| 92
| 0.771307
| 85
| 704
| 6.223529
| 0.341176
| 0.10397
| 0.120983
| 0.173913
| 0.395085
| 0.395085
| 0.151229
| 0
| 0
| 0
| 0
| 0.01
| 0.147727
| 704
| 21
| 93
| 33.52381
| 0.871667
| 0.178977
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.133333
| true
| 0
| 0.266667
| 0.133333
| 0.533333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
43669bd00c6aadb09a63bce8df81b6bc6ef96652
| 350
|
py
|
Python
|
tests/test_api_example_api.py
|
SomeoneLixin/api-dock
|
3958a3a3286ae7f8802df9aba5ece2908ca4361e
|
[
"MIT"
] | 4
|
2018-05-07T15:39:17.000Z
|
2019-07-03T21:28:10.000Z
|
tests/test_api_example_api.py
|
SomeoneLixin/api-dock
|
3958a3a3286ae7f8802df9aba5ece2908ca4361e
|
[
"MIT"
] | 4
|
2020-09-05T10:57:19.000Z
|
2021-05-09T16:01:22.000Z
|
tests/test_api_example_api.py
|
SomeoneLixin/api-dock
|
3958a3a3286ae7f8802df9aba5ece2908ca4361e
|
[
"MIT"
] | 1
|
2018-05-09T07:57:03.000Z
|
2018-05-09T07:57:03.000Z
|
import unittest
from tests.base import BaseTestCase
class ApiExampleApiTestCase(BaseTestCase):
def test_get_api_examples(self):
pass
def test_new_api_example(self):
pass
def test_edit_api_example(self):
pass
def test_delete_api_example(self):
pass
if __name__ == '__main__':
unittest.main()
| 16.666667
| 42
| 0.691429
| 43
| 350
| 5.162791
| 0.511628
| 0.126126
| 0.148649
| 0.202703
| 0.225225
| 0.225225
| 0
| 0
| 0
| 0
| 0
| 0
| 0.24
| 350
| 20
| 43
| 17.5
| 0.834586
| 0
| 0
| 0.307692
| 0
| 0
| 0.022857
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.307692
| false
| 0.307692
| 0.153846
| 0
| 0.538462
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
437660ac68c3d7a97457855631871dcb2b184cfe
| 59
|
py
|
Python
|
work6.py
|
panwuying/homework
|
44d75b0abf64628846a3fe213e883d2c6ba11a82
|
[
"Apache-2.0"
] | null | null | null |
work6.py
|
panwuying/homework
|
44d75b0abf64628846a3fe213e883d2c6ba11a82
|
[
"Apache-2.0"
] | null | null | null |
work6.py
|
panwuying/homework
|
44d75b0abf64628846a3fe213e883d2c6ba11a82
|
[
"Apache-2.0"
] | null | null | null |
v0,v1,t=eval(input("enter v0,v1,t:"))
a=(v1-v0)/t
print(a)
| 14.75
| 37
| 0.610169
| 15
| 59
| 2.4
| 0.533333
| 0.222222
| 0.277778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109091
| 0.067797
| 59
| 3
| 38
| 19.666667
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0.237288
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
43a26b45d568b91ce63b407f1c1e436d3a172cd3
| 211
|
py
|
Python
|
lux/__init__.py
|
justinyiwang/lux
|
22f886d2c2591cb665eb63f976ea425afd0ac3e1
|
[
"Apache-2.0"
] | null | null | null |
lux/__init__.py
|
justinyiwang/lux
|
22f886d2c2591cb665eb63f976ea425afd0ac3e1
|
[
"Apache-2.0"
] | null | null | null |
lux/__init__.py
|
justinyiwang/lux
|
22f886d2c2591cb665eb63f976ea425afd0ac3e1
|
[
"Apache-2.0"
] | null | null | null |
# Register the commonly used modules (similar to how pandas does it: https://github.com/pandas-dev/pandas/blob/master/pandas/__init__.py)
from lux.vis.Clause import Clause
from lux.core.frame import LuxDataFrame
| 70.333333
| 137
| 0.810427
| 34
| 211
| 4.911765
| 0.794118
| 0.083832
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094787
| 211
| 3
| 138
| 70.333333
| 0.874346
| 0.63981
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
43cc228ece199d902f7617cd58c1b11da6010a5e
| 154
|
py
|
Python
|
mmcv/runner/hooks/sampler_seed.py
|
XinYangDong/mmcv-0.2.10
|
527388ea7c5daf7149a88b3dc833373d5a5fb850
|
[
"Apache-2.0"
] | 384
|
2021-03-19T11:12:31.000Z
|
2022-03-31T01:59:16.000Z
|
mmcv/runner/hooks/sampler_seed.py
|
innerlee/mmcv
|
12f065ac516c476720bc946bdc7343ae234fa3eb
|
[
"Apache-2.0"
] | 22
|
2021-04-06T14:28:12.000Z
|
2022-03-22T18:02:00.000Z
|
mmcv/runner/hooks/sampler_seed.py
|
innerlee/mmcv
|
12f065ac516c476720bc946bdc7343ae234fa3eb
|
[
"Apache-2.0"
] | 73
|
2021-03-20T06:23:26.000Z
|
2022-03-16T08:00:21.000Z
|
from .hook import Hook
class DistSamplerSeedHook(Hook):
def before_epoch(self, runner):
runner.data_loader.sampler.set_epoch(runner.epoch)
| 19.25
| 58
| 0.746753
| 20
| 154
| 5.6
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162338
| 154
| 7
| 59
| 22
| 0.868217
| 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 | 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
| 0
| 1
| 0
|
0
| 4
|
43cd1d6484f44ff4db03748ce7e36a2510c0429f
| 1,431
|
py
|
Python
|
jax/scipy/stats/__init__.py
|
VolodyaCO/jax
|
4d148999404a572ebac6dd1b58f2d93f73245360
|
[
"Apache-2.0"
] | 1
|
2020-12-07T14:55:41.000Z
|
2020-12-07T14:55:41.000Z
|
jax/scipy/stats/__init__.py
|
VolodyaCO/jax
|
4d148999404a572ebac6dd1b58f2d93f73245360
|
[
"Apache-2.0"
] | 10
|
2022-01-03T23:12:58.000Z
|
2022-03-29T11:09:35.000Z
|
jax/scipy/stats/__init__.py
|
SaturdayGenfo/jax
|
84dcfcd7e52471f1ac1955d108255467e7950820
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# flake8: noqa: F401
from jax.scipy.stats import bernoulli as bernoulli
from jax.scipy.stats import beta as beta
from jax.scipy.stats import cauchy as cauchy
from jax.scipy.stats import dirichlet as dirichlet
from jax.scipy.stats import expon as expon
from jax.scipy.stats import gamma as gamma
from jax.scipy.stats import geom as geom
from jax.scipy.stats import laplace as laplace
from jax.scipy.stats import logistic as logistic
from jax.scipy.stats import multivariate_normal as multivariate_normal
from jax.scipy.stats import nbinom as nbinom
from jax.scipy.stats import norm as norm
from jax.scipy.stats import pareto as pareto
from jax.scipy.stats import poisson as poisson
from jax.scipy.stats import t as t
from jax.scipy.stats import uniform as uniform
from jax.scipy.stats import chi2 as chi2
from jax.scipy.stats import betabinom as betabinom
| 42.088235
| 74
| 0.798742
| 239
| 1,431
| 4.774059
| 0.376569
| 0.110429
| 0.189308
| 0.268186
| 0.36284
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011485
| 0.148148
| 1,431
| 33
| 75
| 43.363636
| 0.924528
| 0.396226
| 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
| 0
| 0
|
0
| 4
|
43dd325936418325be13b3420c0d98a3a7721f61
| 85
|
py
|
Python
|
bulma/apps.py
|
makiolo/django-bulma
|
243bb680bb62aa54e88829a00f8afb05197b15a2
|
[
"MIT"
] | 330
|
2017-09-01T19:54:30.000Z
|
2022-03-24T10:31:20.000Z
|
bulma/apps.py
|
makiolo/django-bulma
|
243bb680bb62aa54e88829a00f8afb05197b15a2
|
[
"MIT"
] | 57
|
2017-10-10T00:02:55.000Z
|
2022-03-09T09:19:56.000Z
|
bulma/apps.py
|
makiolo/django-bulma
|
243bb680bb62aa54e88829a00f8afb05197b15a2
|
[
"MIT"
] | 54
|
2017-09-01T19:54:37.000Z
|
2022-03-18T06:33:48.000Z
|
from django.apps import AppConfig
class BulmaConfig(AppConfig):
name = 'bulma'
| 14.166667
| 33
| 0.741176
| 10
| 85
| 6.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 85
| 5
| 34
| 17
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
43dd702c2e8b75ec0880e2a7b56638ce099c333c
| 6,367
|
py
|
Python
|
main.py
|
Helloat123/crawler
|
839805692f32046ce8c9c0fadc56ea5718609d48
|
[
"Unlicense"
] | 1
|
2020-10-07T08:19:05.000Z
|
2020-10-07T08:19:05.000Z
|
main.py
|
Helloat123/crawler
|
839805692f32046ce8c9c0fadc56ea5718609d48
|
[
"Unlicense"
] | null | null | null |
main.py
|
Helloat123/crawler
|
839805692f32046ce8c9c0fadc56ea5718609d48
|
[
"Unlicense"
] | null | null | null |
import requests,re
import time
import random
from bs4 import BeautifulSoup
a=[11458,11460,11462,11463,11466,11481,11482,11483,11488,11495,11498,11504,11505,11508,11510,11517,11522,11524,11527,11528,11532,11535,11538,11540,11545,11546,11548,11551,11556,11557,11560,11600,11607,11629,11632,11641,11646,11647,11653,11654,11656,11658,11660,11664,11688,11726,11733,11736,11765,11775,11785,11796,11798,11799,11800,11802,11810,11819,11821,11823,11824,11825,11831,11832,11833,11834,11835,11837,11842,11843,11846,11903,11908,11916,11956,11959,11961,11964,11965,11967,11968,12026,12034,12036,12040,12044,12047,12048,12049,12050,12051,12052,12053,12054,12055,12056,12058,12059,12061,12062,12064,12070,12072,12078,12104,12106,12121,12219,12300,12301,12302,12303,12308,12309,12310,12317,12324,12328,12332,12336,12343,12347,12354,12362,12364,12369,12397,12401,12425,12440,12453,12484,12487,12493,12495,12497,12498,12499,12510,12544,12560,12564,12565,12566,12568,12576,12583,12584,12586,12587,12588,12596,12597,12599,12600,12601,12604,12605,12609,12616,12618,12631,12636,12645,12647,12649,12650,12651,12652,12657,12658,12660,12661,12662,12679,12682,12684,12687,12688,12689,12702,12703,12709,12710,12712,12713,12714,12715,12719,12720,12721,12722,12723,12727,12732,12733,12734,12735,12737,12738,12739,12740,12744,12747,12752,12758,12759,12761,12763,12764,12766,12768,12773,12776,12784,12786,12788,12789,12790,12791,12792,12795,12798,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12816,12821,12830,12844,12851,12861,12862,12863,12864,12865,12866,12867,12868,12869,12870,12871,12872,12874,12875,12876,12877,12878,12882,12883,12895,12899,12901,12903,12907,12912,12913,12914,12915,12918,12919,12920,12921,12922,12923,12929,12930,12932,12933,12936,12938,12939,12940,12941,12942,12943,12944,12947,12952,12964,12969,12977,12978,12980,12982,12983,12984,12986,12988,12989,12990,12991,13001,13002,13003,13006,13010,13011,13014,13015,13017,13021,13022,13023,13025,13026,13027,13028,13029,13030,13031,13032,13043,13044,13045,13058,13059,13071,13074,13100,13101,13102,13103,13104,13105,13106,13107,13108,13110,13112,13113,13114,13121,13123,13125,13177,13188,13198,13201,13207,13208,13212,13218,13220,13234,13235,13236,13238,13239,13240,13241,13242,13245,13247,13248,13249,13250,13251,13262,13264,13265,13266,13275,13276,13277,13279,13280,13282,13283,13284,13285,13286,13287,13288,13289,13290,13291,13292,13294,13296,13298,13299,13300,13304,13307,13320,13321,13322,13324,13325,13326,13328,13330,13332,13336,13339,13340,13356,13378,13383,13386,13387,13389,13391,13392,13397,13402,13404,13414,13415,13417,13418,13419,13420,13421,13422,13423,13425,13429,13431,13432,13433,13434,13435,13436,13437,13438,13440,13441,13447,13448,13468,13469,13470,13471,13472,13499,13500,13501,13507,13508,13511,13514,13515,13524,13534,13535,13538,13548,13558,13560,13561,13569,13571,13575,13576,13577,13578,13584,13588,13590,13592,13593,13596,13599,13600,13601,13602,13603,13604,13605,13606,13607,13609,13611,13612,13614,13615,13617,13618,13619,13622,13623,13625,13626,13627,13629,13630,13631,13632,13635,13636,13637,13638,13639,13640,13641,13643,13644,13645,13646,13648,13649,13654,13655,13657,13658,13660,13661,13662,13663,13664,13665,13666,13668,13669,13670,13671,13672,13673,13675,13677,13678,13679,13680,13681,13682,13684,13686,13688,13700,13702,13703,13705,13706,13714,13728,13730,13738,13739,13742,13746,13747,13748,13749,13750,13751,13753,13754,13762,13766,13773,13774,13775,13776,13780,13782,13785,13787,13791,13796,13798,13799,13800,13801,13802,13811,13819,13829,13830,13831,13836,13842,13843,13844,13845,13846,13849,13853,13854,13863,13867,13869,13870,13871,13872,13873,13875,13891,13892,13893,13894,13895,13896,13897,13898,13899,13900,13901,13903,13904,13905,13906,13917,13921,13924,13931,13938,13939,13940,13941,13942,13943,13945,13948,13962,13963,13964,13967,13979,13980,13982,13983,13984,13985,13986,13987,13988,13989,13990,13991,13993,13994,13995,13997,13998,13999,14002,14008,14009,14018,14021,14022,14025,14026,14034,14035,14037,14038,14039,14041,14042,14043,14046,14052,14056,14061,14080,14086,14087,14088,14089,14090,14099,14101,14127,14138,14139,14163,14167,14168,14170,14177,14178,14180,14190,14201,14202,14206,14207,14211,14213,14223,14250,14256,14269,14275,14293,14295,14296,14300,14309,14312,14322,14325,14327,14329,14353,14357,14358,14359,14360,14366,14389,14394,14406,14410,14422,14423,14425,14430,14431,14432,14434,14440,14465,14467,14472,14475,14476,14481,14492,14494,14504,14506,14508,14515,14528,14535,14537,14541,14542,14544,14553,14555,14560,14568,14571,14574,14575,14589,14590,14591,14599,14602,14604,14605,14606,14608,14612,15496,16301,16302,16401,16404,16405,16407,16408,16410,18127,19001,19002,19004,19013,19141,19145,19213,19246,19248,19335,19359,19414,19422,19614,50084,50559,50870,51721,81002,81006,91002,91002,91004,91004,91005,91005,91006,91006,91007,91007,91009,91009,91010,91010,91011,91011,91012,91012,91013,91013,91014,91014,91016,91016,91017,91017,91018,91018,91019,91019,91020,91020,91024,91024,91025,91025,91026,91026,91030,91030,91034,91034,91036,91036,91037,91037,91039,91039,91040,91040,91041,91041]
path="d://programing//PY//crawlerdata//"
head={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36'}
def getHTMLText(url):
try:
r=requests.get(url,headers=head,timeout=30)
r.raise_for_status() #如果状态码不是200,产生异常
r.encoding='utf-8-sig' #字符编码格式改成 utf-8
return r.text
except:
#异常处理
return "get html text error"
def single(url,inde):
try:
# print(url)
htmltext=getHTMLText(url)
except:
throw("Nothing here!")
try:
soup=BeautifulSoup(htmltext,"html.parser")
#con=soup.find_all('',class_="")
#for i in range(len(con)):
# print(con[i].text)
except:
print("Failed soup")
try:
htm=open(path+"htmdata//"+"htmdata"+str(inde)+".txt",'w+')
htm.write(str(soup))
htm.close()
print("Got it!")
except Exception as e:
print(str(e))
#main part
log=open(path+"log.txt",'w+')
for i in range(len(a)):
#ranges=itertools.chain(xrange(10001,10734),xrange())
# for i in ranges:
try:
print(a[i])
single("http://zt.zjzs.net/xk2020/"+str(a[i])+".html",a[i])
time.sleep(random.randint(5,7))
log.write("http://zt.zjzs.net/xk2020/"+str(a[i])+".html\n")
except:
log.write("There's nothing in",i)
time.sleep(random.randint(2,4))
log.close()
| 107.915254
| 5,037
| 0.798963
| 1,058
| 6,367
| 4.804348
| 0.876181
| 0.001574
| 0.003541
| 0.004328
| 0.025575
| 0.011017
| 0.011017
| 0.011017
| 0.011017
| 0
| 0
| 0.6863
| 0.0267
| 6,367
| 59
| 5,038
| 107.915254
| 0.133936
| 0.030941
| 0
| 0.214286
| 0
| 0.02381
| 0.055186
| 0.005356
| 0
| 0
| 0
| 0
| 0
| 1
| 0.047619
| false
| 0
| 0.095238
| 0
| 0.190476
| 0.095238
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
78d93d7773698365afe70777b16b0a56ace4bfe2
| 118
|
py
|
Python
|
fusion/architecture/projection_head/__init__.py
|
Mrinal18/fusion
|
34e563f2e50139385577c3880c5de11f8a73f220
|
[
"BSD-3-Clause"
] | 14
|
2021-04-05T01:25:12.000Z
|
2022-02-17T19:44:28.000Z
|
fusion/architecture/projection_head/__init__.py
|
Mrinal18/fusion
|
34e563f2e50139385577c3880c5de11f8a73f220
|
[
"BSD-3-Clause"
] | 1
|
2021-07-05T08:32:49.000Z
|
2021-07-05T12:34:57.000Z
|
fusion/architecture/projection_head/__init__.py
|
Mrinal18/fusion
|
34e563f2e50139385577c3880c5de11f8a73f220
|
[
"BSD-3-Clause"
] | 1
|
2022-02-01T21:56:11.000Z
|
2022-02-01T21:56:11.000Z
|
from .conv_head import ConvHead
from .latent_head import LatentHead
__all__ = [
'ConvHead',
'LatentHead',
]
| 14.75
| 35
| 0.70339
| 13
| 118
| 5.923077
| 0.615385
| 0.25974
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20339
| 118
| 8
| 36
| 14.75
| 0.819149
| 0
| 0
| 0
| 0
| 0
| 0.151261
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
78e7c26a539fa357ce45dc3393f149cd89a37850
| 20
|
py
|
Python
|
tests/__init__.py
|
jeeftor/pysunpower
|
585b08a8a02c097790f42bc44849b66defe75f79
|
[
"MIT"
] | 2
|
2022-01-17T00:07:56.000Z
|
2022-02-08T21:38:46.000Z
|
tests/__init__.py
|
jeeftor/pysunpower
|
585b08a8a02c097790f42bc44849b66defe75f79
|
[
"MIT"
] | 16
|
2020-11-26T09:41:51.000Z
|
2021-12-19T23:31:19.000Z
|
tests/test_package/__init__.py
|
ericziethen/ci-github-actions-python
|
a2abeff76e11e849380160c70ee3686fe841e57c
|
[
"MIT"
] | 3
|
2022-02-03T09:44:10.000Z
|
2022-02-26T08:05:15.000Z
|
"""Test Package."""
| 10
| 19
| 0.55
| 2
| 20
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 20
| 1
| 20
| 20
| 0.611111
| 0.65
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
78f6203dcbff5413cc6dae5184ca3029925c8416
| 264
|
py
|
Python
|
mysite/forms.py
|
dresl/python_web_grayscale_bootstrap_theme
|
4dedea655c99be5589f814547bc9d62bfeb587f7
|
[
"Apache-2.0"
] | 1
|
2015-12-19T12:12:22.000Z
|
2015-12-19T12:12:22.000Z
|
mysite/forms.py
|
dresl/python_web_grayscale_bootstrap_theme
|
4dedea655c99be5589f814547bc9d62bfeb587f7
|
[
"Apache-2.0"
] | null | null | null |
mysite/forms.py
|
dresl/python_web_grayscale_bootstrap_theme
|
4dedea655c99be5589f814547bc9d62bfeb587f7
|
[
"Apache-2.0"
] | null | null | null |
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class ContactForm(forms.Form):
subject = forms.CharField()
email = forms.EmailField(required=False)
message = forms.CharField()
| 33
| 54
| 0.780303
| 33
| 264
| 6.242424
| 0.575758
| 0.145631
| 0.165049
| 0.203884
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132576
| 264
| 8
| 55
| 33
| 0.899563
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6029b828d9f99fb17cd7c887940be1d12a0166bd
| 117
|
py
|
Python
|
src/setup.py
|
tapilab/is-odutfoy
|
ae7c05ff10d9ea001221706ce54a68929ecbebc0
|
[
"MIT"
] | null | null | null |
src/setup.py
|
tapilab/is-odutfoy
|
ae7c05ff10d9ea001221706ce54a68929ecbebc0
|
[
"MIT"
] | 2
|
2016-01-14T20:47:44.000Z
|
2016-08-12T16:12:13.000Z
|
src/setup.py
|
tapilab/is-odutfoy
|
ae7c05ff10d9ea001221706ce54a68929ecbebc0
|
[
"MIT"
] | null | null | null |
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules=cythonize("model.pyx"),
)
| 19.5
| 39
| 0.777778
| 16
| 117
| 5.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128205
| 117
| 6
| 40
| 19.5
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0.076271
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
606de45563ca66a6b496db5d6c00f00140cc0149
| 219
|
py
|
Python
|
clientes/forms.py
|
WesGtoX/gestao-clientes
|
851b1c89e7b86f6d0b60d9b8d9c2bed3b629d8bf
|
[
"MIT"
] | null | null | null |
clientes/forms.py
|
WesGtoX/gestao-clientes
|
851b1c89e7b86f6d0b60d9b8d9c2bed3b629d8bf
|
[
"MIT"
] | 3
|
2021-04-07T01:58:51.000Z
|
2021-04-07T01:59:01.000Z
|
clientes/forms.py
|
WesGtoX/gestao-clientes
|
851b1c89e7b86f6d0b60d9b8d9c2bed3b629d8bf
|
[
"MIT"
] | null | null | null |
from django.forms import ModelForm
from clientes.models import Person
class PersonForm(ModelForm):
class Meta:
model = Person
fields = ['first_name', 'last_name', 'age', 'salary', 'bio', 'photo']
| 21.9
| 77
| 0.666667
| 26
| 219
| 5.538462
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210046
| 219
| 9
| 78
| 24.333333
| 0.83237
| 0
| 0
| 0
| 0
| 0
| 0.164384
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
607d3fe768db7876a47670c062a0018ead6370af
| 215
|
py
|
Python
|
tftpy/packet/factory/__init__.py
|
jcarswell/tftpy
|
9c171c7e969b80f2c00728df21d5534b3191620a
|
[
"MIT"
] | null | null | null |
tftpy/packet/factory/__init__.py
|
jcarswell/tftpy
|
9c171c7e969b80f2c00728df21d5534b3191620a
|
[
"MIT"
] | null | null | null |
tftpy/packet/factory/__init__.py
|
jcarswell/tftpy
|
9c171c7e969b80f2c00728df21d5534b3191620a
|
[
"MIT"
] | null | null | null |
"""This module implements the TftpPacketFactory class, which can take a binary
buffer, and return the appropriate TftpPacket object to represent it, via the
parse() method."""
from .factory import PacketFactory
| 43
| 79
| 0.786047
| 29
| 215
| 5.827586
| 0.931034
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153488
| 215
| 5
| 80
| 43
| 0.928571
| 0.786047
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
607d446514c4c94b38663f393d1da864dc267b61
| 264
|
py
|
Python
|
name_function1.py
|
AmitSuresh/learning-python
|
f1ea5b9f3659f21504b1b0e452c03239b03cde85
|
[
"MIT"
] | null | null | null |
name_function1.py
|
AmitSuresh/learning-python
|
f1ea5b9f3659f21504b1b0e452c03239b03cde85
|
[
"MIT"
] | null | null | null |
name_function1.py
|
AmitSuresh/learning-python
|
f1ea5b9f3659f21504b1b0e452c03239b03cde85
|
[
"MIT"
] | null | null | null |
def get_formatted_name(first, middle, last):
"""Generate a neatly formatted full name"""
full_name=f"{first} {middle} {last}"
return full_name.title()
"""this version works for people with middle name but breaks for people with only first and last names"""
| 52.8
| 106
| 0.738636
| 41
| 264
| 4.658537
| 0.609756
| 0.125654
| 0.157068
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 264
| 5
| 106
| 52.8
| 0.852679
| 0.140152
| 0
| 0
| 1
| 0
| 0.20354
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
609028aca0ca715c805337e08f0d1981fda56430
| 197
|
py
|
Python
|
tests/tools/test_stylecheck.py
|
buildntest/buildtest
|
d371048631cdd33ae7bf66f795f5afed83491a90
|
[
"MIT"
] | 29
|
2017-10-20T02:47:10.000Z
|
2020-03-26T17:24:03.000Z
|
tests/tools/test_stylecheck.py
|
shahzebsiddiqui/testgen-HPC
|
e69d9334cf2939af4fca59e75f397b0b1edbbfaf
|
[
"MIT"
] | 219
|
2017-08-25T13:21:53.000Z
|
2020-04-18T19:07:05.000Z
|
tests/tools/test_stylecheck.py
|
shahzebsiddiqui/BuildTest
|
5a04641f37ba588c906112b3848249b241061a9c
|
[
"MIT"
] | 5
|
2017-08-24T11:20:30.000Z
|
2020-02-21T04:28:40.000Z
|
from buildtest.tools.stylecheck import run_style_checks
def test_run_style_check():
run_style_checks(
no_black=False, no_isort=False, no_pyflakes=False, apply_stylechecks=False
)
| 24.625
| 82
| 0.77665
| 28
| 197
| 5.071429
| 0.642857
| 0.169014
| 0.197183
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152284
| 197
| 7
| 83
| 28.142857
| 0.850299
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.2
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6092e7ca8ff2dec95acf6f96d7b5977f9b9a38f5
| 66
|
py
|
Python
|
tests/__init__.py
|
dem4ply/chibi_nginx
|
abf442262c5065be8b03aee39c5a19ad25bf2d4c
|
[
"WTFPL"
] | null | null | null |
tests/__init__.py
|
dem4ply/chibi_nginx
|
abf442262c5065be8b03aee39c5a19ad25bf2d4c
|
[
"WTFPL"
] | null | null | null |
tests/__init__.py
|
dem4ply/chibi_nginx
|
abf442262c5065be8b03aee39c5a19ad25bf2d4c
|
[
"WTFPL"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Unit test package for chibi_nginx."""
| 16.5
| 40
| 0.590909
| 9
| 66
| 4.222222
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018182
| 0.166667
| 66
| 3
| 41
| 22
| 0.672727
| 0.863636
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
609562345d1e52dd18e8ee24cf9e851d099193ac
| 126
|
py
|
Python
|
suites/DatabaseApi/SideChainEthereum.py
|
dbulka/pytests
|
d2658cff3832293cb1b8abcd970f7df83a2b5035
|
[
"MIT"
] | null | null | null |
suites/DatabaseApi/SideChainEthereum.py
|
dbulka/pytests
|
d2658cff3832293cb1b8abcd970f7df83a2b5035
|
[
"MIT"
] | null | null | null |
suites/DatabaseApi/SideChainEthereum.py
|
dbulka/pytests
|
d2658cff3832293cb1b8abcd970f7df83a2b5035
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
import lemoncheesecake.api as lcc
@lcc.suite("SideChainEthereum")
class SideChainEthereum:
pass
| 15.75
| 33
| 0.714286
| 14
| 126
| 6.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009346
| 0.150794
| 126
| 7
| 34
| 18
| 0.831776
| 0.166667
| 0
| 0
| 0
| 0
| 0.165049
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
60cb2f12d33b75a99a9480138c8a8e06f9b89b6c
| 178
|
py
|
Python
|
HackerRank/Arithmatic operators/solution.py
|
diya-beep/Hacktoberfest-Hack-Codes
|
abf5fb6695561dbf053d155b73673d56b4f46c96
|
[
"MIT"
] | 15
|
2021-10-06T07:34:15.000Z
|
2022-01-25T06:58:59.000Z
|
HackerRank/Arithmatic operators/solution.py
|
diya-beep/Hacktoberfest-Hack-Codes
|
abf5fb6695561dbf053d155b73673d56b4f46c96
|
[
"MIT"
] | 55
|
2021-10-01T19:23:51.000Z
|
2021-10-06T04:29:41.000Z
|
HackerRank/Arithmatic operators/solution.py
|
diya-beep/Hacktoberfest-Hack-Codes
|
abf5fb6695561dbf053d155b73673d56b4f46c96
|
[
"MIT"
] | 41
|
2021-10-01T19:30:51.000Z
|
2021-10-05T19:36:15.000Z
|
# Author: Senuri Fernando
a = int(input()) # take user input
b = int(input()) # take user input
print(a+b) # addition
print(a-b) # subtraction
print(a*b) # multiplication
| 19.777778
| 35
| 0.662921
| 27
| 178
| 4.37037
| 0.481481
| 0.152542
| 0.177966
| 0.271186
| 0.355932
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.191011
| 178
| 8
| 36
| 22.25
| 0.819444
| 0.511236
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.6
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
60e1eee1a7f5c0842f31042a2fa631d1e82854c5
| 129
|
py
|
Python
|
src/cars/CarHuman.py
|
remi2257/little-car-ai
|
006f2f515d46dd9e94457c191f017a9f3d749fa8
|
[
"MIT"
] | 2
|
2020-11-07T15:29:42.000Z
|
2022-01-18T08:59:00.000Z
|
src/cars/CarHuman.py
|
remi2257/little-car-ai
|
006f2f515d46dd9e94457c191f017a9f3d749fa8
|
[
"MIT"
] | null | null | null |
src/cars/CarHuman.py
|
remi2257/little-car-ai
|
006f2f515d46dd9e94457c191f017a9f3d749fa8
|
[
"MIT"
] | null | null | null |
from src.cars.Car import Car
class CarHuman(Car):
def __init__(self, track):
super(CarHuman, self).__init__(track)
| 18.428571
| 45
| 0.689922
| 18
| 129
| 4.5
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.193798
| 129
| 6
| 46
| 21.5
| 0.778846
| 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 | 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
| 0
| 1
| 0
|
0
| 4
|
60ed60b241c0948659fd8225ff8b882da9801f3a
| 784
|
py
|
Python
|
setup.py
|
mochic/neuroglia
|
14f776811c6f5f3823784c48663e1c279e569c5c
|
[
"BSD-3-Clause"
] | null | null | null |
setup.py
|
mochic/neuroglia
|
14f776811c6f5f3823784c48663e1c279e569c5c
|
[
"BSD-3-Clause"
] | null | null | null |
setup.py
|
mochic/neuroglia
|
14f776811c6f5f3823784c48663e1c279e569c5c
|
[
"BSD-3-Clause"
] | null | null | null |
import setuptools
setuptools.setup(
name="neuroglia",
version="0.1.0",
url="https://github.com/AllenInstitute/neuroglia",
author="Justin Kiggins",
author_email="justink@alleninstitute.org",
description="scikit-learn compatible transformers for neural data science",
packages=setuptools.find_packages(),
install_requires=[
'pandas',
'xarray',
'scikit-learn',
],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
)
| 25.290323
| 79
| 0.609694
| 75
| 784
| 6.333333
| 0.626667
| 0.24
| 0.315789
| 0.164211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020374
| 0.248724
| 784
| 30
| 80
| 26.133333
| 0.786078
| 0
| 0
| 0.083333
| 0
| 0
| 0.544643
| 0.033163
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.041667
| 0
| 0.041667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
714807affbaaae85d27506aeb7f552ccc58af616
| 765
|
py
|
Python
|
Week 1 In-out, int and bool/Task04.py
|
retverd/python_hse
|
cb9bfb092c1cf68ae0c53b9919ca24a71a8cbf88
|
[
"MIT"
] | null | null | null |
Week 1 In-out, int and bool/Task04.py
|
retverd/python_hse
|
cb9bfb092c1cf68ae0c53b9919ca24a71a8cbf88
|
[
"MIT"
] | null | null | null |
Week 1 In-out, int and bool/Task04.py
|
retverd/python_hse
|
cb9bfb092c1cf68ae0c53b9919ca24a71a8cbf88
|
[
"MIT"
] | null | null | null |
# Теперь вам опять нужно сдать на проверку программу, которая будет печатать "123424242143132324326922342152 +
# 213732174232497412039472189472409 = x" (без кавычек), где x - результат вычисления, посчитанный прямо в программе.
#
# Эта задача предназначена для того, чтобы вы научились различать числа и строки, состоящие из цифр, а также научились
# выводить несколько значений разного типа в одном print, правильно работая с разделителями.
#
# Чтобы вам было интереснее, мы сделали пример неправильным, так что не стоит пытаться его скопировать в текст программы
# и сдать, он отражает только формат вывода :)
print("123424242143132324326922342152 + 213732174232497412039472189472409 =", 123424242143132324326922342152 +
213732174232497412039472189472409)
| 63.75
| 120
| 0.814379
| 84
| 765
| 7.416667
| 0.845238
| 0.303371
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.286364
| 0.137255
| 765
| 11
| 121
| 69.545455
| 0.657576
| 0.777778
| 0
| 0
| 0
| 0
| 0.42236
| 0.391304
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
714ad129a04fa9e150227f1ea57de1d7e08c9489
| 28
|
py
|
Python
|
xbox/handlers/__init__.py
|
rako77/xbox-smartglass-core-python
|
e01a5413c788bbbbd62a631b170a789fe19d77dc
|
[
"MIT"
] | 66
|
2018-05-05T01:41:32.000Z
|
2022-03-07T05:34:04.000Z
|
xbox/handlers/__init__.py
|
rako77/xbox-smartglass-core-python
|
e01a5413c788bbbbd62a631b170a789fe19d77dc
|
[
"MIT"
] | 47
|
2018-05-06T17:33:13.000Z
|
2021-08-21T17:25:25.000Z
|
xbox/handlers/__init__.py
|
rako77/xbox-smartglass-core-python
|
e01a5413c788bbbbd62a631b170a789fe19d77dc
|
[
"MIT"
] | 19
|
2018-06-12T23:20:35.000Z
|
2021-06-17T15:00:03.000Z
|
"""
CLI script handlers
"""
| 7
| 19
| 0.607143
| 3
| 28
| 5.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178571
| 28
| 3
| 20
| 9.333333
| 0.73913
| 0.678571
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
71715e899c1eb828c65aa9f9ff8be62b4f335a17
| 334
|
py
|
Python
|
data/serverdata.py
|
MCTH2065/YandexWebProject
|
0cba0066957998ed90a8c93fc6ca232516b1acfe
|
[
"MIT"
] | null | null | null |
data/serverdata.py
|
MCTH2065/YandexWebProject
|
0cba0066957998ed90a8c93fc6ca232516b1acfe
|
[
"MIT"
] | null | null | null |
data/serverdata.py
|
MCTH2065/YandexWebProject
|
0cba0066957998ed90a8c93fc6ca232516b1acfe
|
[
"MIT"
] | null | null | null |
import sqlalchemy
from .db_session import SqlAlchemyBase
from sqlalchemy_serializer import SerializerMixin
class ServerData(SqlAlchemyBase, SerializerMixin):
__tablename__ = 'serverdata'
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, autoincrement=True)
current_jobs = sqlalchemy.Column(sqlalchemy.String)
| 33.4
| 84
| 0.820359
| 34
| 334
| 7.823529
| 0.617647
| 0.120301
| 0.195489
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113772
| 334
| 9
| 85
| 37.111111
| 0.898649
| 0
| 0
| 0
| 0
| 0
| 0.02994
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
719b681c184315aa85e762eb839add36cadfb76c
| 84
|
py
|
Python
|
Algorithms/07. Greedy/002. Marc's Cakewalk.py
|
stonehengee/HackerrankPractice
|
ec052e7447391e40d1919cf0b641ff5023da3da3
|
[
"MIT"
] | null | null | null |
Algorithms/07. Greedy/002. Marc's Cakewalk.py
|
stonehengee/HackerrankPractice
|
ec052e7447391e40d1919cf0b641ff5023da3da3
|
[
"MIT"
] | null | null | null |
Algorithms/07. Greedy/002. Marc's Cakewalk.py
|
stonehengee/HackerrankPractice
|
ec052e7447391e40d1919cf0b641ff5023da3da3
|
[
"MIT"
] | null | null | null |
# Problem: https://www.hackerrank.com/challenges/marcs-cakewalk/problem
# Score: 15
| 28
| 71
| 0.77381
| 11
| 84
| 5.909091
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025641
| 0.071429
| 84
| 2
| 72
| 42
| 0.807692
| 0.940476
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
71b26c74c67caca82d72e85256fb20b90c87d37c
| 569
|
py
|
Python
|
app/modelo/views.py
|
HarXwelL/TECSUP-DAE-2021-2-B
|
f770f2dec53e819a7ad7f9eac1efda4b2d42c33f
|
[
"MIT"
] | null | null | null |
app/modelo/views.py
|
HarXwelL/TECSUP-DAE-2021-2-B
|
f770f2dec53e819a7ad7f9eac1efda4b2d42c33f
|
[
"MIT"
] | null | null | null |
app/modelo/views.py
|
HarXwelL/TECSUP-DAE-2021-2-B
|
f770f2dec53e819a7ad7f9eac1efda4b2d42c33f
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
def index(request):
return HttpResponse("SUMAS")
def suma(request):
return HttpResponse("SUMA DE DIGITOS")
def num1(request, num1):
response = "Los numeros son %s"
return HttpResponse(response % num1)
def num2(request, num1, num2):
resp = "Los numeros son %a"
return HttpResponse(resp % num2)
def votar(request, num1, num2):
suma = int(num1) + int(num2)
respuesta = "LA RESPUESTA ES: " + str(suma)
return HttpResponse(respuesta)
| 27.095238
| 47
| 0.699473
| 74
| 569
| 5.378378
| 0.459459
| 0.226131
| 0.125628
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023965
| 0.193322
| 569
| 20
| 48
| 28.45
| 0.843137
| 0.040422
| 0
| 0
| 0
| 0
| 0.134438
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3125
| false
| 0
| 0.125
| 0.125
| 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
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
71c34a15cda8d09f9cf57a640df8d7be6bc61734
| 207
|
py
|
Python
|
cleancommands.py
|
ErikWegner/backupkeeper
|
fd0eff5dd7baaa25d20cbbfe7578b0810c56a8df
|
[
"BSD-2-Clause"
] | null | null | null |
cleancommands.py
|
ErikWegner/backupkeeper
|
fd0eff5dd7baaa25d20cbbfe7578b0810c56a8df
|
[
"BSD-2-Clause"
] | null | null | null |
cleancommands.py
|
ErikWegner/backupkeeper
|
fd0eff5dd7baaa25d20cbbfe7578b0810c56a8df
|
[
"BSD-2-Clause"
] | null | null | null |
#!/usr/bin/env python3
import os
import sys
from backupkeeper import walker, cmdbuilder
existing_backups = walker.walker('.')
cmds = cmdbuilder.cmdbuilder(existing_backups)
for cmd in cmds:
print(cmd)
| 18.818182
| 46
| 0.768116
| 28
| 207
| 5.607143
| 0.642857
| 0.229299
| 0.318471
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005587
| 0.135266
| 207
| 10
| 47
| 20.7
| 0.871508
| 0.101449
| 0
| 0
| 0
| 0
| 0.005405
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 0
| 0.428571
| 0.142857
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
71c6dc9bb96075e7b65b4e2ebb32adb560f91e4d
| 7,912
|
py
|
Python
|
gewittergefahr/gg_utils/smoothing_via_iterative_averaging.py
|
dopplerchase/GewitterGefahr
|
4415b08dd64f37eba5b1b9e8cc5aa9af24f96593
|
[
"MIT"
] | 26
|
2018-10-04T01:07:35.000Z
|
2022-01-29T08:49:32.000Z
|
gewittergefahr/gg_utils/smoothing_via_iterative_averaging.py
|
liuximarcus/GewitterGefahr
|
d819874d616f98a25187bfd3091073a2e6d5279e
|
[
"MIT"
] | 4
|
2017-12-25T02:01:08.000Z
|
2018-12-19T01:54:21.000Z
|
gewittergefahr/gg_utils/smoothing_via_iterative_averaging.py
|
liuximarcus/GewitterGefahr
|
d819874d616f98a25187bfd3091073a2e6d5279e
|
[
"MIT"
] | 11
|
2017-12-10T23:05:29.000Z
|
2022-01-29T08:49:33.000Z
|
"""Implements the SIA algorithm from Mansouryar and Hedayati (2012).
--- DEFINITIONS ---
SIA = smoothing via iterative averaging
--- REFERENCES ---
Mansouryar, Mohsen, and Amin Hedayati. "Smoothing via iterative averaging (SIA)
a basic technique for line smoothing." International Journal of Computer and
Electrical Engineering 4.3 (2012): 307.
"""
import copy
import numpy
from gewittergefahr.gg_utils import shape_utils
from gewittergefahr.gg_utils import polygons
from gewittergefahr.gg_utils import error_checking
MIN_VERTICES_IN_POLYGON_OR_LINE = 4
NUM_VERTICES_IN_HALF_WINDOW_DEFAULT = 1
NUM_ITERATIONS_DEFAULT = 3
def _sia_one_iteration(vertex_x_coords_padded, vertex_y_coords_padded,
num_vertices_in_half_window):
"""Runs SIA for one iteration.
V_u = number of unique vertices
V_p = number of vertices after padding
:param vertex_x_coords_padded: numpy array (length V_p) with x-coordinates
of vertices.
:param vertex_y_coords_padded: numpy array (length V_p) with y-coordinates
of vertices.
:param num_vertices_in_half_window: Number of vertices in smoothing half-
window.
:return: vertex_x_coords_smoothed: numpy array (length V_u) with smoothed
x-coordinates of vertices.
:return: vertex_y_coords_smoothed: numpy array (length V_u) with smoothed
y-coordinates of vertices.
"""
num_vertices_padded = len(vertex_x_coords_padded)
vertex_x_coords_smoothed = numpy.full(num_vertices_padded, numpy.nan)
vertex_y_coords_smoothed = numpy.full(num_vertices_padded, numpy.nan)
start_index = num_vertices_in_half_window
end_index = len(vertex_x_coords_padded) - num_vertices_in_half_window
for i in range(start_index, end_index):
vertex_x_coords_smoothed[i] = numpy.mean(
vertex_x_coords_padded[
(i - num_vertices_in_half_window):
(i + num_vertices_in_half_window + 1)])
vertex_y_coords_smoothed[i] = numpy.mean(
vertex_y_coords_padded[
(i - num_vertices_in_half_window):
(i + num_vertices_in_half_window + 1)])
vertex_x_coords_smoothed = (
vertex_x_coords_smoothed[
num_vertices_in_half_window:-num_vertices_in_half_window])
vertex_y_coords_smoothed = (
vertex_y_coords_smoothed[
num_vertices_in_half_window:-num_vertices_in_half_window])
return vertex_x_coords_smoothed, vertex_y_coords_smoothed
def sia_for_closed_polygon(
polygon_object,
num_vertices_in_half_window=NUM_VERTICES_IN_HALF_WINDOW_DEFAULT,
num_iterations=NUM_ITERATIONS_DEFAULT, check_input_args=True):
"""Implements the SIA algorithm for a closed polygon.
This method smooths only the exterior of the polygon, ignoring the interior
(holes).
V = number of exterior vertices
:param polygon_object: Instance of `shapely.geometry.Polygon`.
:param num_vertices_in_half_window: Number of vertices in smoothing half-
window. Number of vertices in full window =
2 * num_vertices_in_half_window + 1.
:param num_iterations: Number of iterations.
:param check_input_args: Boolean flag. If True, will error-check input
arguments. If False, will not.
:return: vertex_x_coords_smoothed: length-V numpy array with smoothed
x-coordinates of vertices.
:return: vertex_y_coords_smoothed: length-V numpy array with smoothed
y-coordinates of vertices.
"""
num_vertices = len(polygon_object.exterior.xy[0]) - 1
if check_input_args:
error_checking.assert_is_geq(
num_vertices, MIN_VERTICES_IN_POLYGON_OR_LINE)
error_checking.assert_is_integer(num_vertices_in_half_window)
error_checking.assert_is_geq(num_vertices_in_half_window, 1)
error_checking.assert_is_integer(num_iterations)
error_checking.assert_is_geq(num_iterations, 1)
num_vertices_in_half_window = numpy.min(
numpy.array([num_vertices_in_half_window, num_vertices - 1]))
for i in range(num_iterations):
if i == 0:
this_polygon_object = copy.deepcopy(polygon_object)
else:
this_polygon_object = polygons.vertex_arrays_to_polygon_object(
vertex_x_coords_smoothed, vertex_y_coords_smoothed)
vertex_x_coords_padded, vertex_y_coords_padded = (
shape_utils.pad_closed_polygon(
this_polygon_object,
num_padding_vertices=num_vertices_in_half_window,
check_input_args=False))
vertex_x_coords_smoothed, vertex_y_coords_smoothed = _sia_one_iteration(
vertex_x_coords_padded, vertex_y_coords_padded,
num_vertices_in_half_window)
vertex_x_coords_smoothed = numpy.concatenate((
vertex_x_coords_smoothed, numpy.array([vertex_x_coords_smoothed[0]])))
vertex_y_coords_smoothed = numpy.concatenate((
vertex_y_coords_smoothed, numpy.array([vertex_y_coords_smoothed[0]])))
return vertex_x_coords_smoothed, vertex_y_coords_smoothed
def sia_for_polyline(
vertex_x_coords, vertex_y_coords,
num_vertices_in_half_window=NUM_VERTICES_IN_HALF_WINDOW_DEFAULT,
num_iterations=NUM_ITERATIONS_DEFAULT, check_input_args=True):
"""Implements the SIA algorithm for a polyline (not a closed polygon).
V = number of vertices
:param vertex_x_coords: length-V numpy array with x-coordinates of vertices.
:param vertex_y_coords: length-V numpy array with y-coordinates of vertices.
:param num_vertices_in_half_window: Number of vertices in smoothing half-
window. Number of vertices in full window =
2 * num_vertices_in_half_window + 1.
:param num_iterations: Number of iterations.
:param check_input_args: Boolean flag. If True, will error-check input
arguments. If False, will not.
:return: vertex_x_coords_smoothed: length-V numpy array with smoothed
x-coordinates of vertices.
:return: vertex_y_coords_smoothed: length-V numpy array with smoothed
y-coordinates of vertices.
"""
num_vertices = vertex_x_coords.size
if check_input_args:
error_checking.assert_is_geq(
num_vertices, MIN_VERTICES_IN_POLYGON_OR_LINE)
error_checking.assert_is_numpy_array_without_nan(vertex_x_coords)
error_checking.assert_is_numpy_array(vertex_x_coords, num_dimensions=1)
error_checking.assert_is_numpy_array_without_nan(vertex_y_coords)
error_checking.assert_is_numpy_array(
vertex_y_coords, exact_dimensions=numpy.array([num_vertices]))
error_checking.assert_is_integer(num_vertices_in_half_window)
error_checking.assert_is_geq(num_vertices_in_half_window, 1)
error_checking.assert_is_integer(num_iterations)
error_checking.assert_is_geq(num_iterations, 1)
num_vertices_in_half_window = numpy.min(
numpy.array([num_vertices_in_half_window, num_vertices - 1]))
for i in range(num_iterations):
if i == 0:
vertex_x_coords_padded, vertex_y_coords_padded = (
shape_utils.pad_polyline(
vertex_x_coords, vertex_y_coords,
num_padding_vertices=num_vertices_in_half_window,
check_input_args=False))
else:
vertex_x_coords_padded, vertex_y_coords_padded = (
shape_utils.pad_polyline(
vertex_x_coords_smoothed, vertex_y_coords_smoothed,
num_padding_vertices=num_vertices_in_half_window,
check_input_args=False))
vertex_x_coords_smoothed, vertex_y_coords_smoothed = _sia_one_iteration(
vertex_x_coords_padded, vertex_y_coords_padded,
num_vertices_in_half_window)
return vertex_x_coords_smoothed, vertex_y_coords_smoothed
| 40.994819
| 80
| 0.726871
| 1,073
| 7,912
| 4.905871
| 0.117428
| 0.091945
| 0.083967
| 0.109802
| 0.8144
| 0.758549
| 0.714856
| 0.701748
| 0.646467
| 0.585866
| 0
| 0.005629
| 0.214105
| 7,912
| 192
| 81
| 41.208333
| 0.840946
| 0.310035
| 0
| 0.56
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14
| 1
| 0.03
| false
| 0
| 0.05
| 0
| 0.11
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
71c8dc9ed00518007a1d74e1ca7672a8853f27af
| 169
|
py
|
Python
|
7_kyu/All_Star_Code_Challenge_20.py
|
UlrichBerntien/Codewars-Katas
|
bbd025e67aa352d313564d3862db19fffa39f552
|
[
"MIT"
] | null | null | null |
7_kyu/All_Star_Code_Challenge_20.py
|
UlrichBerntien/Codewars-Katas
|
bbd025e67aa352d313564d3862db19fffa39f552
|
[
"MIT"
] | null | null | null |
7_kyu/All_Star_Code_Challenge_20.py
|
UlrichBerntien/Codewars-Katas
|
bbd025e67aa352d313564d3862db19fffa39f552
|
[
"MIT"
] | null | null | null |
def add_arrays(array1, array2):
if len(array1) != len(array2):
raise "Input arguments are not of equal length"
return [a+b for a,b in zip(array1,array2)]
| 42.25
| 55
| 0.668639
| 28
| 169
| 4
| 0.75
| 0.214286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045113
| 0.213018
| 169
| 4
| 56
| 42.25
| 0.796992
| 0
| 0
| 0
| 0
| 0
| 0.229412
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
71ce2708c270533799c23bb903cdd06a6ee49c69
| 7,370
|
py
|
Python
|
attest/tests/asserts.py
|
dag/attest
|
b1ad455a7bef86b073a46fbc1dffae4b1aac8338
|
[
"BSD-2-Clause"
] | 27
|
2015-01-24T06:10:59.000Z
|
2021-05-18T21:15:52.000Z
|
attest/tests/asserts.py
|
dag/attest
|
b1ad455a7bef86b073a46fbc1dffae4b1aac8338
|
[
"BSD-2-Clause"
] | null | null | null |
attest/tests/asserts.py
|
dag/attest
|
b1ad455a7bef86b073a46fbc1dffae4b1aac8338
|
[
"BSD-2-Clause"
] | 5
|
2015-03-19T16:05:31.000Z
|
2017-07-08T20:39:41.000Z
|
from __future__ import with_statement
from attest import Tests, Assert
suite = Tests()
@suite.test
def raises():
"""Assert.raises"""
try:
with Assert.raises(RuntimeError):
pass
except AssertionError, e:
Assert(e).__str__() == "didn't raise RuntimeError"
else:
raise AssertionError("didn't fail for missing exception")
# Groups of allowed exceptions
try:
with Assert.raises(RuntimeError, ValueError):
pass
except AssertionError, e:
Assert(e).__str__() == "didn't raise (RuntimeError, ValueError)"
else:
raise AssertionError("didn't fail for missing exception")
with Assert.raises(RuntimeError, ValueError) as error:
raise RuntimeError
error.__class__.is_(RuntimeError)
with Assert.raises(RuntimeError, ValueError) as error:
raise ValueError('invaluable')
error.__class__.is_(ValueError)
error.__str__() == 'invaluable'
with Assert.raises(AssertionError):
error.args == ('valuable',)
@suite.test
def not_raising():
"""Assert.not_raising"""
with Assert.raises(AssertionError):
with Assert.not_raising(RuntimeError):
raise RuntimeError
try:
with Assert.not_raising(RuntimeError):
pass
except Exception:
raise AssertionError('failed despite not raising RuntimeError')
@suite.test
def equality():
"""Assert() == and !="""
Assert(1) == 1
Assert(1) != 0
with Assert.raises(AssertionError):
Assert(1) == 0
with Assert.raises(AssertionError):
Assert(1) != 1
@suite.test
def compare():
"""Assert() comparisons"""
Assert(1) > 0
Assert(0) < 1
Assert(1) >= 0
Assert(1) >= 1
Assert(0) <= 0
Assert(0) <= 1
with Assert.raises(AssertionError):
Assert(0) > 1
with Assert.raises(AssertionError):
Assert(1) < 0
with Assert.raises(AssertionError):
Assert(0) >= 1
with Assert.raises(AssertionError):
Assert(0) >= 1
with Assert.raises(AssertionError):
Assert(1) <= 0
with Assert.raises(AssertionError):
Assert(1) <= 0
@suite.test
def contains():
"""Assert() membership"""
1 in Assert([0,1,2])
Assert(1).in_([0,1,2])
Assert(3).not_in([0,1,2])
with Assert.raises(AssertionError):
3 in Assert([0,1,2])
with Assert.raises(AssertionError):
Assert(3).in_([0,1,2])
with Assert.raises(AssertionError):
Assert(1).not_in([0,1,2])
@suite.test
def identity():
"""Assert() object identity"""
Assert(True).is_(True)
Assert(False).is_not(True)
Assert(True).is_(Assert(True))
Assert(False).is_not(Assert(True))
Assert([]).is_not([])
with Assert.raises(AssertionError):
Assert(False).is_(True)
with Assert.raises(AssertionError):
Assert(True).is_not(True)
with Assert.raises(AssertionError):
Assert(False).is_(Assert(True))
with Assert.raises(AssertionError):
Assert(True).is_not(Assert(True))
with Assert.raises(AssertionError):
Assert([]).is_([])
@suite.test
def proxy():
"""Assert().remote_attribute"""
hello = Assert('hello')
hello == 'hello'
hello.upper() == 'HELLO'
hello.attr('upper').attr('__name__') == 'upper'
with Assert.raises(AssertionError):
hello.upper() == 'hello'
with Assert.raises(AssertionError):
Assert(3).__str__() == '4'
with Assert.raises(AssertionError):
hello.attr('upper').attr('__name__') == 'lower'
@suite.test
def boolean():
"""Assert() in boolean context"""
bool(Assert(1))
with Assert.raises(AssertionError):
bool(Assert(0))
@suite.test
def nested_assert():
"""Assert(Assert(var)) is Assert(var)"""
Assert(Assert('hello')).__class__.is_(str)
@suite.test
def isinstance():
"""Assert.isinstance"""
with Assert.raises(AssertionError) as error:
Assert.isinstance('hello', (int, float))
error.__str__() == "not isinstance('hello', (int, float))"
with Assert.raises(AssertionError) as error:
Assert.isinstance('hello', int)
error.__str__() == "not isinstance('hello', int)"
Assert.isinstance('hello', basestring)
@suite.test
def not_isinstance():
"""Assert.not_isinstance"""
with Assert.raises(AssertionError) as error:
Assert.not_isinstance(1, (int, float))
error.__str__() == "isinstance(1, (int, float))"
with Assert.raises(AssertionError) as error:
Assert.not_isinstance(1, int)
error.__str__() == "isinstance(1, int)"
Assert.not_isinstance('hello', int)
@suite.test
def issubclass():
"""Assert.issubclass"""
with Assert.raises(AssertionError) as error:
Assert.issubclass(str, (int, float))
error.__str__() == "not issubclass(str, (int, float))"
with Assert.raises(AssertionError) as error:
Assert.issubclass(str, int)
error.__str__() == "not issubclass(str, int)"
Assert.issubclass(str, str)
@suite.test
def not_issubclass():
"""Assert.not_issubclass"""
with Assert.raises(AssertionError) as error:
Assert.not_issubclass(int, (int, float))
error.__str__() == "issubclass(int, (int, float))"
with Assert.raises(AssertionError) as error:
Assert.not_issubclass(int, int)
error.__str__() == "issubclass(int, int)"
Assert.not_issubclass(int, str)
@suite.test
def json():
"""Assert.json"""
Assert('{"works": true}').json == dict(works=True)
Assert('{"works": true}').json != dict(works=False)
with Assert.raises(AssertionError):
Assert('{"works": true}').json != dict(works=True)
with Assert.raises(AssertionError):
Assert('{"works": true}').json == dict(works=False)
try:
import lxml
except ImportError:
lxml = None
@suite.test_if(lxml)
def css():
"""Assert.css"""
html = Assert("""
<div id="maincontent">
<div class="container">
<p>Hello World</p>
</div>
</div>
""")
html.css('#maincontent .container p')[0].text == 'Hello World'
with Assert.raises(AssertionError):
html.css('#maincontent .container p')[0].text != 'Hello World'
@suite.test_if(lxml)
def xpath():
"""Assert.xpath"""
xml = Assert("""
<div id="maincontent">
<div class="container">
<p>Hello World</p>
</div>
</div>
""")
path = '/div[@id="maincontent"]/div[@class="container"]/p'
xml.xpath(path)[0].text == 'Hello World'
with Assert.raises(AssertionError):
xml.xpath(path)[0].text != 'Hello World'
@suite.test
def passed_to():
"""Assert.passed_to"""
Assert([1, 2, 3]).passed_to(len) == 3
Assert(1).passed_to(str) == '1'
Assert('a').passed_to(int, 16) == 10
Assert('a').passed_to(int, base=16) == 10
with Assert.raises(AssertionError):
Assert([1, 2, 3]).passed_to(len) != 3
with Assert.raises(AssertionError):
Assert(1).passed_to(str) != '1'
with Assert.raises(AssertionError):
Assert('a').passed_to(int, 16) != 10
with Assert.raises(AssertionError):
Assert('a').passed_to(int, base=16) != 10
@suite.test
def predicate():
with Assert.raises(AssertionError):
Assert(bool, 0)
Assert(bool, 1)
| 22.676923
| 72
| 0.612619
| 866
| 7,370
| 5.077367
| 0.120092
| 0.102343
| 0.15647
| 0.266091
| 0.6932
| 0.578349
| 0.524903
| 0.44735
| 0.355015
| 0.264499
| 0
| 0.017196
| 0.22673
| 7,370
| 324
| 73
| 22.746914
| 0.754343
| 0.003799
| 0
| 0.446602
| 0
| 0
| 0.142589
| 0.007086
| 0
| 0
| 0
| 0
| 0.57767
| 0
| null | null | 0.058252
| 0.019417
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
e09a703143f7d5923f87f10e8d65dd8de0e2e3f4
| 80
|
py
|
Python
|
higher-dim-graphing.py
|
some-skill/dimensional-graphing-tool
|
d1c9cf3090e54593dc442bdc2c2b9b581ee55122
|
[
"MIT"
] | null | null | null |
higher-dim-graphing.py
|
some-skill/dimensional-graphing-tool
|
d1c9cf3090e54593dc442bdc2c2b9b581ee55122
|
[
"MIT"
] | null | null | null |
higher-dim-graphing.py
|
some-skill/dimensional-graphing-tool
|
d1c9cf3090e54593dc442bdc2c2b9b581ee55122
|
[
"MIT"
] | null | null | null |
import cmdInterface
cmd = cmdInterface.cmdInterface()
cmd.newProject()
| 11.428571
| 34
| 0.725
| 7
| 80
| 8.285714
| 0.571429
| 0.517241
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 80
| 6
| 35
| 13.333333
| 0.892308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e09aee735fc7dec365b011d0fd695397a85f5ce5
| 6,261
|
py
|
Python
|
config/addproj.py
|
KimAyssaLiu/chandaopms
|
18ae2e7c076a3a0be27d52cb6eae5c992ef34561
|
[
"Unlicense"
] | 1
|
2020-04-17T11:29:19.000Z
|
2020-04-17T11:29:19.000Z
|
config/addproj.py
|
KimAyssaLiu/chandaonew
|
031adef35cd57a05bce8eeefd45fed8c4afd335c
|
[
"Unlicense"
] | null | null | null |
config/addproj.py
|
KimAyssaLiu/chandaonew
|
031adef35cd57a05bce8eeefd45fed8c4afd335c
|
[
"Unlicense"
] | null | null | null |
import os
import requests
headers = {"Cache-Control": "max-age=0",
"Origin": "http://web", "Upgrade-Insecure-Requests": "1",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"Referer": "http://web/zentao/product-create.html", "Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8", "Connection": "close"}
def login1():
url = "http://web:80/zentao/user-login-L3plbnRhby9pbmRleC5odG1s.html"
cookies = {"lang": "zh-cn", "theme": "default", "windowWidth": "1536", "windowHeight": "722", "sid": "e52t2obj21ll5trk6gt16lgna3"}
data = {"account": "admin", "password": "e10adc3949ba59abbe56e057f20f883e", "referer": "http://web:80/zentao/user-login-L3plbnRhby9pbmRleC5odG1s.html"}
r = requests.post(url, headers=headers, cookies=cookies, data=data)
def login2():
url = "http://web:80/zentao/index.html"
cookies = {"lang": "zh-cn", "theme": "default", "windowWidth": "1536", "windowHeight": "722", "sid": "e52t2obj21ll5trk6gt16lgna3"}
data = {"account": "admin", "password": "e10adc3949ba59abbe56e057f20f883e", "referer": "http://web:80/zentao/index.html"}
r = requests.post(url, headers=headers, cookies=cookies, data=data)
def addproduct():
url = "http://web:80/zentao/product-create.html"
cookies = {"lang": "zh-cn", "theme": "default", "windowHeight": "722", "windowWidth": "1536",
"sid": "e52t2obj21ll5trk6gt16lgna3"}
data = {"name": "咪咕视频", "code": "001", "PO": "admin", "QD": "man1", "RD": "man2", "type": "normal",
"desc": "中国移动旗下视频播放软件", "acl": "custom", "whitelist[]": "1", "whitelist[]": "2", "whitelist[]": "6",
"whitelist[]": "7", "whitelist[]": "8", "whitelist[]": "9"}
r = requests.post(url, headers=headers, cookies=cookies, data=data)
print(r.content)
def addbug():
url = "http://web:80/zentao/bug-create-1-0-moduleID=0.html"
cookies = {"lang": "zh-cn", "theme": "default", "lastProduct": "1", "preProductID": "1", "preBranch": "0", "storyModule": "0", "productStoryOrder": "id_desc", "lastProject": "1", "preProjectID": "1", "moduleBrowseParam": "0", "productBrowseParam": "0", "projectTaskOrder": "status%2Cid_desc", "qaBugOrder": "id_desc", "projectStoryOrder": "pri", "windowHeight": "722", "windowWidth": "1519", "sid": "e52t2obj21ll5trk6gt16lgna3"}
headers = {"Accept": "application/json, text/javascript, */*; q=0.01", "X-Requested-With": "XMLHttpRequest", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36", "Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryyBAlWobdLJ4epTHZ", "Origin": "http://web", "Referer": "http://web/zentao/bug-create-1-0-moduleID=0.html", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8", "Connection": "close"}
data = "------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"product\"\r\n\r\n1\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"module\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"project\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"openedBuild[]\"\r\n\r\ntrunk\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"assignedTo\"\r\n\r\nman1\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\ncodeerror\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"os\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"browser\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"color\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\n咪咕视频存在代码执行漏洞\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"severity\"\r\n\r\n3\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"pri\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"steps\"\r\n\r\n<p><br />\n</p>\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"story\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"task\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"mailto[]\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"mailto[]\"\r\n\r\nman1\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"mailto[]\"\r\n\r\nman2\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"keywords\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"files[]\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"labels[]\"\r\n\r\n\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"case\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"caseVersion\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"result\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ\r\nContent-Disposition: form-data; name=\"testtask\"\r\n\r\n0\r\n------WebKitFormBoundaryyBAlWobdLJ4epTHZ--\r\n"
r = requests.post(url, headers=headers, cookies=cookies, data=data.encode("utf-8").decode("latin1"))
print(r.content)
print(r.status_code)
if (r.status_code == 200):
print("Config success")
else:
print("Config fail")
if __name__ == '__main__':
login1()
login2()
addproduct()
addbug()
| 85.767123
| 2,714
| 0.685993
| 786
| 6,261
| 5.447837
| 0.236641
| 0.028024
| 0.023821
| 0.315273
| 0.699673
| 0.691266
| 0.685427
| 0.656469
| 0.614666
| 0.503503
| 0
| 0.048802
| 0.093436
| 6,261
| 72
| 2,715
| 86.958333
| 0.705603
| 0
| 0
| 0.155556
| 0
| 0.666667
| 0.718076
| 0.390443
| 0
| 0
| 0
| 0
| 0
| 1
| 0.088889
| false
| 0.044444
| 0.044444
| 0
| 0.133333
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e0a27e37c94e24811f057ea7a6f5c31c679ffa2b
| 287
|
py
|
Python
|
TooL.py
|
Kfk13/Tgx22-2-
|
5ef719e240fd7f2a3ccda102c04e4d806e677c76
|
[
"Apache-2.0"
] | 2
|
2022-01-26T22:39:09.000Z
|
2022-02-17T19:46:41.000Z
|
TooL.py
|
Kfk13/Tgx22-2-
|
5ef719e240fd7f2a3ccda102c04e4d806e677c76
|
[
"Apache-2.0"
] | null | null | null |
TooL.py
|
Kfk13/Tgx22-2-
|
5ef719e240fd7f2a3ccda102c04e4d806e677c76
|
[
"Apache-2.0"
] | 1
|
2022-02-17T19:47:52.000Z
|
2022-02-17T19:47:52.000Z
|
# Tgx22-2-
import os
import time
time.sleep(3.5)
print("")
time.sleep(2.5)
print("Welcome To All Freindes .. ")
print("")
print("Can You Go To MY GitHub And Give My a Start.. ")
time.sleep(2.5)
print("")
print("Thank you ..❤❤")
time.sleep(3.5)
print("")
time.sleep(2.5)
print("By ^_^")
| 16.882353
| 55
| 0.637631
| 53
| 287
| 3.471698
| 0.471698
| 0.244565
| 0.163043
| 0.179348
| 0.434783
| 0.347826
| 0.347826
| 0.347826
| 0.347826
| 0.347826
| 0
| 0.052419
| 0.135889
| 287
| 16
| 56
| 17.9375
| 0.681452
| 0.027875
| 0
| 0.6
| 0
| 0
| 0.33574
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.133333
| 0
| 0.133333
| 0.533333
| 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
| 0
| 0
| 0
| 1
|
0
| 4
|
e0dd5a9bfe23c8c485cf497bb4cad03918f962be
| 201
|
py
|
Python
|
app/user/api/create_user.py
|
EgehanGundogdu/drf-test-driven-development-exercies
|
6cf1570f573cbc270ea2856b101727664c6843e4
|
[
"MIT"
] | null | null | null |
app/user/api/create_user.py
|
EgehanGundogdu/drf-test-driven-development-exercies
|
6cf1570f573cbc270ea2856b101727664c6843e4
|
[
"MIT"
] | null | null | null |
app/user/api/create_user.py
|
EgehanGundogdu/drf-test-driven-development-exercies
|
6cf1570f573cbc270ea2856b101727664c6843e4
|
[
"MIT"
] | null | null | null |
from rest_framework import generics
from ..serializers import UserSerializer
class CreateUser(generics.CreateAPIView):
"""Create a new user in the system"""
serializer_class = UserSerializer
| 25.125
| 41
| 0.78607
| 23
| 201
| 6.782609
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149254
| 201
| 7
| 42
| 28.714286
| 0.912281
| 0.154229
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1ca6a40834beb5fa128a39480678eed2b6e72d13
| 507
|
py
|
Python
|
backend/handlers/errors.py
|
redhatcat/vueblog
|
8731960f04adb69324dd74808b2abff4143c611a
|
[
"MIT"
] | 1
|
2019-05-22T00:37:37.000Z
|
2019-05-22T00:37:37.000Z
|
backend/handlers/errors.py
|
redhatcat/vueblog
|
8731960f04adb69324dd74808b2abff4143c611a
|
[
"MIT"
] | null | null | null |
backend/handlers/errors.py
|
redhatcat/vueblog
|
8731960f04adb69324dd74808b2abff4143c611a
|
[
"MIT"
] | null | null | null |
from app import app
from flask import jsonify
def json_error(message):
payload = {
'msg': message,
}
return jsonify(payload)
@app.errorhandler(401)
def error_401(error):
return json_error('unauthorized'), 401
@app.errorhandler(403)
def error_403(error):
return json_error('access denied'), 403
@app.errorhandler(404)
def error_404(error):
return json_error('not found'), 404
@app.errorhandler(500)
def error_500(error):
return json_error('internal server error'), 500
| 20.28
| 51
| 0.714004
| 70
| 507
| 5.042857
| 0.342857
| 0.127479
| 0.169972
| 0.226629
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085308
| 0.167653
| 507
| 24
| 52
| 21.125
| 0.751185
| 0
| 0
| 0
| 0
| 0
| 0.114398
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.263158
| false
| 0
| 0.105263
| 0.210526
| 0.631579
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
1cb7ee00d503f535b9ddc201f923e670bb8a58ff
| 26
|
py
|
Python
|
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/test/coding20731.py
|
brianherrera/lumberyard
|
f85344403c1c2e77ec8c75deb2c116e97b713217
|
[
"AML"
] | 1,738
|
2017-09-21T10:59:12.000Z
|
2022-03-31T21:05:46.000Z
|
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/test/coding20731.py
|
ArchitectureStudios/lumberyard
|
f85344403c1c2e77ec8c75deb2c116e97b713217
|
[
"AML"
] | 427
|
2017-09-29T22:54:36.000Z
|
2022-02-15T19:26:50.000Z
|
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/test/coding20731.py
|
ArchitectureStudios/lumberyard
|
f85344403c1c2e77ec8c75deb2c116e97b713217
|
[
"AML"
] | 671
|
2017-09-21T08:04:01.000Z
|
2022-03-29T14:30:07.000Z
|
#coding:latin1
| 5.2
| 16
| 0.461538
| 2
| 26
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0.461538
| 26
| 4
| 17
| 6.5
| 0.785714
| 0.5
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1cb8edbdb6f7935ab7f9a96442269f172caeba59
| 192
|
py
|
Python
|
tests/test_connection.py
|
chrisimcevoy/purepyodbc
|
3c53e5d434033e5ffc1a74fa59c4850cea2a70af
|
[
"MIT"
] | null | null | null |
tests/test_connection.py
|
chrisimcevoy/purepyodbc
|
3c53e5d434033e5ffc1a74fa59c4850cea2a70af
|
[
"MIT"
] | 1
|
2022-01-05T15:52:17.000Z
|
2022-01-05T15:52:17.000Z
|
tests/test_connection.py
|
chrisimcevoy/purepyodbc
|
3c53e5d434033e5ffc1a74fa59c4850cea2a70af
|
[
"MIT"
] | null | null | null |
import pytest
@pytest.mark.xfail
def test_set_encoding(connection):
connection.setencoding("utf-16")
@pytest.mark.xfail
def test_set_decoding(connection):
connection.setdecoding()
| 16
| 36
| 0.776042
| 24
| 192
| 6.041667
| 0.583333
| 0.137931
| 0.206897
| 0.248276
| 0.344828
| 0.344828
| 0
| 0
| 0
| 0
| 0
| 0.011765
| 0.114583
| 192
| 11
| 37
| 17.454545
| 0.841176
| 0
| 0
| 0.285714
| 0
| 0
| 0.03125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0
| 0.428571
| 0
| 1
| 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
| 0
| 0
| 0
|
0
| 4
|
1cc1ea75c44bcb801d30ac22b82bfa45a6c1b1e4
| 729
|
py
|
Python
|
dynamic_models/exceptions.py
|
wieczorek1990/django-dynamic-models
|
25787bf80eeec1560df33f3a0a26ea8272964619
|
[
"MIT"
] | 122
|
2018-11-09T02:20:20.000Z
|
2022-03-11T13:49:33.000Z
|
dynamic_models/exceptions.py
|
wieczorek1990/django-dynamic-models
|
25787bf80eeec1560df33f3a0a26ea8272964619
|
[
"MIT"
] | 34
|
2019-03-10T00:36:01.000Z
|
2022-03-12T15:36:10.000Z
|
dynamic_models/exceptions.py
|
wieczorek1990/django-dynamic-models
|
25787bf80eeec1560df33f3a0a26ea8272964619
|
[
"MIT"
] | 38
|
2019-01-02T13:53:25.000Z
|
2022-03-31T12:08:50.000Z
|
"""Provide exceptions to be raised by the `dynamic_models` app.
All exceptions inherit from a `DynamicModelError` base class.
"""
class DynamicModelError(Exception):
"""Base exception for use in dynamic models."""
class OutdatedModelError(DynamicModelError):
"""Raised when a model's schema is outdated on save."""
class NullFieldChangedError(DynamicModelError):
"""Raised when a field is attempted to be change from NULL to NOT NULL."""
class InvalidFieldNameError(DynamicModelError):
"""Raised when a field name is invalid."""
class UnsavedSchemaError(DynamicModelError):
"""
Raised when a model schema has not been saved to the db and a dynamic model
is attempted to be created.
"""
| 26.035714
| 79
| 0.733882
| 92
| 729
| 5.804348
| 0.5
| 0.172285
| 0.202247
| 0.209738
| 0.247191
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179698
| 729
| 27
| 80
| 27
| 0.892977
| 0.58299
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 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
| 0
| 0
| 1
| 0
|
0
| 4
|
1cd0786cf3ebb69e2ce25affb807c0672cf7931e
| 1,662
|
py
|
Python
|
tests/sdk/test_describe.py
|
cupcicm/substra
|
19eeec1dda02cce0e10ef6ed285636e974a6e77a
|
[
"Apache-2.0"
] | null | null | null |
tests/sdk/test_describe.py
|
cupcicm/substra
|
19eeec1dda02cce0e10ef6ed285636e974a6e77a
|
[
"Apache-2.0"
] | null | null | null |
tests/sdk/test_describe.py
|
cupcicm/substra
|
19eeec1dda02cce0e10ef6ed285636e974a6e77a
|
[
"Apache-2.0"
] | null | null | null |
import pytest
import substra
from .. import datastore
from .utils import mock_requests, mock_requests_response
@pytest.mark.parametrize(
'asset_name', ['dataset', 'algo', 'objective']
)
def test_describe_asset(asset_name, client, mocker):
item = getattr(datastore, asset_name.upper())
asset_response = mock_requests_response(item)
description_response = mock_requests_response('foo')
m = mocker.patch('substra.sdk.rest_client.requests.get',
side_effect=[asset_response, description_response])
method = getattr(client, f'describe_{asset_name}')
response = method("magic-key")
assert response == 'foo'
assert m.is_called()
@pytest.mark.parametrize(
'asset_name', ['dataset', 'algo', 'objective']
)
def test_describe_asset_not_found(asset_name, client, mocker):
m = mock_requests(mocker, "get", status=404)
with pytest.raises(substra.sdk.exceptions.NotFound):
method = getattr(client, f'describe_{asset_name}')
method('foo')
assert m.call_count == 1
@pytest.mark.parametrize(
'asset_name', ['dataset', 'algo', 'objective']
)
def test_describe_description_not_found(asset_name, client, mocker):
item = getattr(datastore, asset_name.upper())
asset_response = mock_requests_response(item)
description_response = mock_requests_response('foo', 404)
m = mocker.patch('substra.sdk.rest_client.requests.get',
side_effect=[asset_response, description_response])
method = getattr(client, f'describe_{asset_name}')
with pytest.raises(substra.sdk.exceptions.NotFound):
method("key")
assert m.call_count == 2
| 28.169492
| 72
| 0.705174
| 201
| 1,662
| 5.577114
| 0.258706
| 0.088314
| 0.089206
| 0.099911
| 0.789474
| 0.789474
| 0.756467
| 0.728814
| 0.639607
| 0.639607
| 0
| 0.005801
| 0.170277
| 1,662
| 58
| 73
| 28.655172
| 0.807107
| 0
| 0
| 0.487179
| 0
| 0
| 0.151625
| 0.081227
| 0
| 0
| 0
| 0
| 0.102564
| 1
| 0.076923
| false
| 0
| 0.102564
| 0
| 0.179487
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1ce179d6a418e6b4ee457d4d1b15cf8ec19ced69
| 21
|
py
|
Python
|
getmodisdata/__init__.py
|
bucricket/projectMASgetmodis
|
9262c3c52e05f3174241a356c2da1a6a9686a94c
|
[
"BSD-3-Clause"
] | null | null | null |
getmodisdata/__init__.py
|
bucricket/projectMASgetmodis
|
9262c3c52e05f3174241a356c2da1a6a9686a94c
|
[
"BSD-3-Clause"
] | null | null | null |
getmodisdata/__init__.py
|
bucricket/projectMASgetmodis
|
9262c3c52e05f3174241a356c2da1a6a9686a94c
|
[
"BSD-3-Clause"
] | null | null | null |
__version__='0.2.0'
| 7
| 19
| 0.666667
| 4
| 21
| 2.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 0.095238
| 21
| 2
| 20
| 10.5
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1cff66bd3268ba22b2c0b862ddf82b69a0317d6d
| 236
|
py
|
Python
|
pylimit/const_error.py
|
hey-bruce/pylimit2
|
64bd70f8c10f61f2864726bb054531e34c88ee49
|
[
"Apache-2.0"
] | 4
|
2018-09-27T07:46:19.000Z
|
2018-11-22T03:53:27.000Z
|
pylimit/const_error.py
|
bbruceyuan/pylimit2
|
64bd70f8c10f61f2864726bb054531e34c88ee49
|
[
"Apache-2.0"
] | null | null | null |
pylimit/const_error.py
|
bbruceyuan/pylimit2
|
64bd70f8c10f61f2864726bb054531e34c88ee49
|
[
"Apache-2.0"
] | 1
|
2018-11-22T02:38:33.000Z
|
2018-11-22T02:38:33.000Z
|
#!/usr/bin/env python
# created by Bruce Yuan on 17-11-27
class ConstError(Exception):
def __init__(self, message):
self._message = str(message)
def __str__(self):
return self._message
__repr__ = __str__
| 18.153846
| 36
| 0.661017
| 31
| 236
| 4.451613
| 0.709677
| 0.23913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.237288
| 236
| 12
| 37
| 19.666667
| 0.733333
| 0.228814
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.166667
| 0.833333
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
e8088619f9b04703ac9502b9d53074987f09d0d0
| 46
|
py
|
Python
|
subtraction/subtraction.py
|
sridevimarudhachalamoorthy/team-nito
|
e0a77cc1b0e98cffaba64ece94cb1706baafb620
|
[
"MIT"
] | null | null | null |
subtraction/subtraction.py
|
sridevimarudhachalamoorthy/team-nito
|
e0a77cc1b0e98cffaba64ece94cb1706baafb620
|
[
"MIT"
] | null | null | null |
subtraction/subtraction.py
|
sridevimarudhachalamoorthy/team-nito
|
e0a77cc1b0e98cffaba64ece94cb1706baafb620
|
[
"MIT"
] | null | null | null |
a=10
b=20
print(b-a)
print("SUBTRACTED b-a")
| 7.666667
| 23
| 0.652174
| 11
| 46
| 2.727273
| 0.545455
| 0.133333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 0.130435
| 46
| 5
| 24
| 9.2
| 0.65
| 0
| 0
| 0
| 0
| 0
| 0.311111
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
e8097d45651176dc49554a89b08f8d0af2ad32ae
| 180
|
py
|
Python
|
setup.py
|
cmick/sklearn-rri
|
0ac056e8f4c59597c3e26ab1670f9179dc92990a
|
[
"BSD-3-Clause"
] | null | null | null |
setup.py
|
cmick/sklearn-rri
|
0ac056e8f4c59597c3e26ab1670f9179dc92990a
|
[
"BSD-3-Clause"
] | null | null | null |
setup.py
|
cmick/sklearn-rri
|
0ac056e8f4c59597c3e26ab1670f9179dc92990a
|
[
"BSD-3-Clause"
] | null | null | null |
import setuptools
# main project configurations is loaded from setup.cfg by setuptools
assert setuptools.__version__ > '30.3', "setuptools > 30.3 is required"
setuptools.setup()
| 25.714286
| 71
| 0.783333
| 24
| 180
| 5.708333
| 0.666667
| 0.043796
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038462
| 0.133333
| 180
| 6
| 72
| 30
| 0.839744
| 0.366667
| 0
| 0
| 0
| 0
| 0.294643
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e810aee8379fc80079d7e9920a97dfc8fd7083a5
| 13
|
py
|
Python
|
megumin/utils/types.py
|
davitudoplugins1234/WhiterKang
|
f4779d2c440849fa97e7014cd856f885b0abbc87
|
[
"MIT"
] | 2
|
2022-02-01T17:55:44.000Z
|
2022-03-27T17:21:55.000Z
|
megumin/utils/types.py
|
davitudoplugins1234/WhiterKang
|
f4779d2c440849fa97e7014cd856f885b0abbc87
|
[
"MIT"
] | null | null | null |
megumin/utils/types.py
|
davitudoplugins1234/WhiterKang
|
f4779d2c440849fa97e7014cd856f885b0abbc87
|
[
"MIT"
] | 3
|
2022-01-29T20:04:03.000Z
|
2022-02-01T18:17:40.000Z
|
# nada ainda
| 6.5
| 12
| 0.692308
| 2
| 13
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.230769
| 13
| 1
| 13
| 13
| 0.9
| 0.769231
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e81f297b083ef2da99a17d5a448d62f74b7a6e55
| 61
|
py
|
Python
|
Codewars/8kyu/return-negative/Python/test.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | 7
|
2017-09-20T16:40:39.000Z
|
2021-08-31T18:15:08.000Z
|
Codewars/8kyu/return-negative/Python/test.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | null | null | null |
Codewars/8kyu/return-negative/Python/test.py
|
RevansChen/online-judge
|
ad1b07fee7bd3c49418becccda904e17505f3018
|
[
"MIT"
] | null | null | null |
# Python - 3.6.0
Test.assert_equals(make_negative(42), -42)
| 15.25
| 42
| 0.704918
| 11
| 61
| 3.727273
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12963
| 0.114754
| 61
| 3
| 43
| 20.333333
| 0.62963
| 0.229508
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1c03b498fb0dde46ad63f96d0ce8ccd08371f81b
| 488
|
py
|
Python
|
cryptokit/otp.py
|
istommao/cryptok
|
9630e3744d9ca8c25c58122a5027ece7d93ff40a
|
[
"MIT"
] | 25
|
2016-10-22T03:23:56.000Z
|
2021-05-24T12:36:05.000Z
|
cryptokit/otp.py
|
istommao/cryptok
|
9630e3744d9ca8c25c58122a5027ece7d93ff40a
|
[
"MIT"
] | null | null | null |
cryptokit/otp.py
|
istommao/cryptok
|
9630e3744d9ca8c25c58122a5027ece7d93ff40a
|
[
"MIT"
] | 6
|
2017-03-23T05:25:06.000Z
|
2019-10-24T12:03:32.000Z
|
# coding: utf-8
"""OTP TOTP"""
from __future__ import unicode_literals
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.twofactor.hotp import HOTP
from cryptography.hazmat.primitives.hashes import SHA1
key = os.urandom(20)
def generate_htop(length=6, salt=0):
hotp = HOTP(key, length, SHA1(), backend=default_backend())
hotp_value = hotp.generate(salt)
# hotp.verify(hotp_value, 0)
return hotp_value.decode()
| 22.181818
| 63
| 0.756148
| 67
| 488
| 5.343284
| 0.522388
| 0.134078
| 0.184358
| 0.178771
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019048
| 0.139344
| 488
| 21
| 64
| 23.238095
| 0.833333
| 0.104508
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.1
| false
| 0
| 0.5
| 0
| 0.7
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1c64acaa36e854d1e670a1c63fdf5d2f004c6b48
| 163
|
py
|
Python
|
modularodm/fields/integerfield.py
|
felliott/modular-odm
|
8a34891892b8af69b21fdc46701c91763a5c1cf9
|
[
"Apache-2.0"
] | 4
|
2018-09-21T18:57:03.000Z
|
2020-10-19T05:38:14.000Z
|
modularodm/fields/integerfield.py
|
cos-archives/modular-odm
|
8a34891892b8af69b21fdc46701c91763a5c1cf9
|
[
"Apache-2.0"
] | null | null | null |
modularodm/fields/integerfield.py
|
cos-archives/modular-odm
|
8a34891892b8af69b21fdc46701c91763a5c1cf9
|
[
"Apache-2.0"
] | null | null | null |
from . import Field
from ..validators import validate_integer
class IntegerField(Field):
# default = None
validate = validate_integer
data_type = int
| 20.375
| 41
| 0.736196
| 19
| 163
| 6.157895
| 0.684211
| 0.25641
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.202454
| 163
| 8
| 42
| 20.375
| 0.9
| 0.08589
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 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
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1c72dd19e43215147a30ca728466f4bfb75f2494
| 62
|
py
|
Python
|
robocode-python-ls-core/tests/conftest.py
|
emanlove/robotframework-lsp
|
b0d8862d24e3bc1b72d8ce9412a671571520e7d9
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
robocode-python-ls-core/tests/conftest.py
|
emanlove/robotframework-lsp
|
b0d8862d24e3bc1b72d8ce9412a671571520e7d9
|
[
"ECL-2.0",
"Apache-2.0"
] | 1
|
2021-09-30T15:40:29.000Z
|
2021-09-30T15:40:29.000Z
|
robocode-python-ls-core/tests/conftest.py
|
emanlove/robotframework-lsp
|
b0d8862d24e3bc1b72d8ce9412a671571520e7d9
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
pytest_plugins = ["robocode_ls_core.unittest_tools.fixtures"]
| 31
| 61
| 0.83871
| 8
| 62
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.048387
| 62
| 1
| 62
| 62
| 0.813559
| 0
| 0
| 0
| 0
| 0
| 0.645161
| 0.645161
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 4
|
98d63f9521a4535cbf021138af64b67572658060
| 172
|
py
|
Python
|
core/export_to.py
|
dayvagrant/avitoparser
|
6d68b8e772e35455eb40ef671fc88bdea9135be3
|
[
"MIT"
] | 1
|
2021-11-03T16:05:16.000Z
|
2021-11-03T16:05:16.000Z
|
core/export_to.py
|
dayvagrant/avitoparser
|
6d68b8e772e35455eb40ef671fc88bdea9135be3
|
[
"MIT"
] | null | null | null |
core/export_to.py
|
dayvagrant/avitoparser
|
6d68b8e772e35455eb40ef671fc88bdea9135be3
|
[
"MIT"
] | null | null | null |
def save_to_file(data: list, filename: str):
"""Save to file."""
with open(f"{filename}", "w") as f:
for item_ in data:
f.write("%s\n" % item_)
| 28.666667
| 44
| 0.534884
| 27
| 172
| 3.259259
| 0.703704
| 0.136364
| 0.227273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.27907
| 172
| 5
| 45
| 34.4
| 0.709677
| 0.075581
| 0
| 0
| 0
| 0
| 0.098039
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.25
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
98e020a4c2633c7999f262804de9a8fe23675947
| 14,774
|
py
|
Python
|
dogs/migrations/0020_auto__del_field_testimonial_related_dog__add_field_testimonial_dog.py
|
brenolf/myfriend
|
fc43f9a8dd5a4aba5beb233f1e934ce88657e6cf
|
[
"Apache-2.0"
] | 1
|
2015-08-07T02:40:50.000Z
|
2015-08-07T02:40:50.000Z
|
dogs/migrations/0020_auto__del_field_testimonial_related_dog__add_field_testimonial_dog.py
|
brenolf/myfriend
|
fc43f9a8dd5a4aba5beb233f1e934ce88657e6cf
|
[
"Apache-2.0"
] | null | null | null |
dogs/migrations/0020_auto__del_field_testimonial_related_dog__add_field_testimonial_dog.py
|
brenolf/myfriend
|
fc43f9a8dd5a4aba5beb233f1e934ce88657e6cf
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: 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):
# Deleting field 'Testimonial.related_dog'
db.delete_column(u'dogs_testimonial', 'related_dog_id')
# Adding field 'Testimonial.dog'
db.add_column(u'dogs_testimonial', 'dog',
self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='dog', to=orm['dogs.Dog']),
keep_default=False)
def backwards(self, orm):
# Adding field 'Testimonial.related_dog'
db.add_column(u'dogs_testimonial', 'related_dog',
self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='dog', to=orm['dogs.Dog']),
keep_default=False)
# Deleting field 'Testimonial.dog'
db.delete_column(u'dogs_testimonial', 'dog_id')
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'dogs.address': {
'Meta': {'object_name': 'Address'},
'apartment': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'neighbourhood': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '9', 'null': 'True', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}),
'street': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
},
u'dogs.answer': {
'Meta': {'object_name': 'Answer'},
'allergy': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'apartment': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'backyard': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'calmness': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'havemoney': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'insidehouse': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'kids': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'likeaggressiveness': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'likebarks': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'likewalking': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'manyguests': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'otheranimals': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'physicallyactive': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'priorexperience': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'smallanimals': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'smalldogs': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'time': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'training': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
},
u'dogs.breed': {
'Meta': {'object_name': 'Breed'},
'breed_name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
u'dogs.characteristics': {
'Meta': {'object_name': 'Characteristics'},
'active': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'aggressive': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'barker': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'calm': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'expensive': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'hairfall': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'hunter': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'jealousanimal': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'jealousperson': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'likeinside': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'likekids': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'likeoutside': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'longhair': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'medicalcare': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'needexercise': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
'stubborn': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
},
u'dogs.dog': {
'Meta': {'object_name': 'Dog'},
'abandoned': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'adopted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'adopted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adopted_by'", 'null': 'True', 'to': u"orm['dogs.Person']"}),
'birth_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
'breed': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dogs.Breed']", 'null': 'True'}),
'characteristics': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['dogs.Characteristics']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'color': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'description': ('django.db.models.fields.TextField', [], {}),
'gender': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'in_adoption_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'in_adoption_by'", 'to': u"orm['dogs.Person']"}),
'in_adoption_process': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
'photo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'size': ('django.db.models.fields.CharField', [], {'max_length': '2'})
},
u'dogs.message': {
'Meta': {'object_name': 'Message'},
'content': ('django.db.models.fields.TextField', [], {'max_length': '500'}),
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'sender': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sender'", 'to': u"orm['dogs.Person']"}),
'thread': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dogs.MessageThread']"})
},
u'dogs.messagethread': {
'Meta': {'object_name': 'MessageThread'},
'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'person1': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'person1'", 'to': u"orm['dogs.Person']"}),
'person2': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'person2'", 'to': u"orm['dogs.Person']"}),
'related_dog': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'related_dog'", 'null': 'True', 'to': u"orm['dogs.Dog']"}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'dogs.person': {
'Meta': {'object_name': 'Person'},
'address': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dogs.Address']", 'null': 'True', 'blank': 'True'}),
'answers': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['dogs.Answer']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'birth_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'emaildog': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
'gender': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'tel': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['auth.User']", 'unique': 'True'})
},
u'dogs.testimonial': {
'Meta': {'object_name': 'Testimonial'},
'adopter': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adopter'", 'null': 'True', 'to': u"orm['dogs.Person']"}),
'content': ('django.db.models.fields.TextField', [], {'max_length': '500'}),
'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'dog': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'dog'", 'to': u"orm['dogs.Dog']"}),
'giver': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'giver'", 'null': 'True', 'to': u"orm['dogs.Person']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'title': ('django.db.models.fields.TextField', [], {'max_length': '50'})
}
}
complete_apps = ['dogs']
| 80.293478
| 187
| 0.557737
| 1,518
| 14,774
| 5.343215
| 0.117918
| 0.113426
| 0.19677
| 0.2811
| 0.77623
| 0.750955
| 0.732462
| 0.656023
| 0.58846
| 0.331525
| 0
| 0.006183
| 0.189928
| 14,774
| 184
| 188
| 80.293478
| 0.671541
| 0.011168
| 0
| 0.12426
| 0
| 0
| 0.574363
| 0.309984
| 0
| 0
| 0
| 0
| 0
| 1
| 0.011834
| false
| 0.005917
| 0.023669
| 0
| 0.053254
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
98fa11c09c9830e8c28c7bc6fd330d4c028b79f4
| 147
|
py
|
Python
|
wolo/__init__.py
|
AKuederle/RAC
|
9984fccdd21698e290b469e2b78e54eff7adcab2
|
[
"MIT"
] | 4
|
2016-05-11T07:56:59.000Z
|
2017-04-28T13:23:53.000Z
|
wolo/__init__.py
|
AKuederle/python-WoLo
|
9984fccdd21698e290b469e2b78e54eff7adcab2
|
[
"MIT"
] | 6
|
2016-05-08T19:04:53.000Z
|
2016-06-06T19:01:29.000Z
|
wolo/__init__.py
|
AKuederle/RAC
|
9984fccdd21698e290b469e2b78e54eff7adcab2
|
[
"MIT"
] | null | null | null |
from .parameters import Parameter, File, Source, Self
from .task import Task, cmd
from .workflow import Workflow, set_Threads
from .log import Log
| 29.4
| 53
| 0.795918
| 22
| 147
| 5.272727
| 0.590909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 147
| 4
| 54
| 36.75
| 0.920635
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
98fdc827316ccc616ec8f18211d19a5b83d5a573
| 24,282
|
py
|
Python
|
tests/test_data_structures.py
|
proudzhu/algorithms
|
636a4519832849dcb6516f2ef78428872b3bb81c
|
[
"BSD-3-Clause"
] | 2,545
|
2015-01-01T17:11:49.000Z
|
2022-03-26T04:51:28.000Z
|
tests/test_data_structures.py
|
proudzhu/algorithms
|
636a4519832849dcb6516f2ef78428872b3bb81c
|
[
"BSD-3-Clause"
] | 90
|
2015-03-15T11:34:35.000Z
|
2018-10-27T13:47:53.000Z
|
tests/test_data_structures.py
|
proudzhu/algorithms
|
636a4519832849dcb6516f2ef78428872b3bb81c
|
[
"BSD-3-Clause"
] | 787
|
2015-01-01T19:24:44.000Z
|
2022-02-21T01:24:55.000Z
|
from random import shuffle
import unittest
from algorithms.data_structures import (
binary_search_tree,
digraph,
queue,
singly_linked_list,
stack,
undirected_graph,
union_find,
union_find_by_rank,
union_find_with_path_compression,
lcp_array
)
class TestBinarySearchTree(unittest.TestCase):
"""
Test Binary Search Tree Implementation
"""
key_val = [
("a", 1), ("b", 2), ("c", 3),
("d", 4), ("e", 5), ("f", 6),
("g", 7), ("h", 8), ("i", 9)
]
def shuffle_list(self, ls):
shuffle(ls)
return ls
def test_size(self):
# Size starts at 0
self.bst = binary_search_tree.BinarySearchTree()
self.assertEqual(self.bst.size(), 0)
# Doing a put increases the size to 1
self.bst.put("one", 1)
self.assertEqual(self.bst.size(), 1)
# Putting a key that is already in doesn't change size
self.bst.put("one", 1)
self.assertEqual(self.bst.size(), 1)
self.bst.put("one", 2)
self.assertEqual(self.bst.size(), 1)
self.bst = binary_search_tree.BinarySearchTree()
size = 0
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
size += 1
self.assertEqual(self.bst.size(), size)
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
size = 0
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
size += 1
self.assertEqual(self.bst.size(), size)
def test_is_empty(self):
self.bst = binary_search_tree.BinarySearchTree()
self.assertTrue(self.bst.is_empty())
self.bst.put("a", 1)
self.assertFalse(self.bst.is_empty())
def test_get(self):
self.bst = binary_search_tree.BinarySearchTree()
# Getting a key not in BST returns None
self.assertEqual(self.bst.get("one"), None)
# Get with a present key returns proper value
self.bst.put("one", 1)
self.assertEqual(self.bst.get("one"), 1)
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.get(k), v)
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.get(k), v)
def test_contains(self):
self.bst = binary_search_tree.BinarySearchTree()
self.assertFalse(self.bst.contains("a"))
self.bst.put("a", 1)
self.assertTrue(self.bst.contains("a"))
def test_put(self):
self.bst = binary_search_tree.BinarySearchTree()
# When BST is empty first put becomes root
self.bst.put("bbb", 1)
self.assertEqual(self.bst.root.key, "bbb")
self.assertEqual(self.bst.root.left, None)
# Adding a key greater than root doesn't update the left tree
# but does update the right
self.bst.put("ccc", 2)
self.assertEqual(self.bst.root.key, "bbb")
self.assertEqual(self.bst.root.left, None)
self.assertEqual(self.bst.root.right.key, "ccc")
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("bbb", 1)
# Adding a key less than root doesn't update the right tree
# but does update the left
self.bst.put("aaa", 2)
self.assertEqual(self.bst.root.key, "bbb")
self.assertEqual(self.bst.root.right, None)
self.assertEqual(self.bst.root.left.key, "aaa")
self.bst = binary_search_tree.BinarySearchTree()
size = 0
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
size += 1
self.assertEqual(self.bst.get(k), v)
self.assertEqual(self.bst.size(), size)
self.bst = binary_search_tree.BinarySearchTree()
shuffled = self.shuffle_list(self.key_val[:])
size = 0
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
size += 1
self.assertEqual(self.bst.get(k), v)
self.assertEqual(self.bst.size(), size)
def test_min_key(self):
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val[::-1]:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.min_key(), k)
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.min_key(), "a")
def test_max_key(self):
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.max_key(), k)
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.max_key(), "i")
def test_floor_key(self):
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("a", 1)
self.bst.put("c", 3)
self.bst.put("e", 5)
self.bst.put("g", 7)
self.assertEqual(self.bst.floor_key("a"), "a")
self.assertEqual(self.bst.floor_key("b"), "a")
self.assertEqual(self.bst.floor_key("g"), "g")
self.assertEqual(self.bst.floor_key("h"), "g")
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("c", 3)
self.bst.put("e", 5)
self.bst.put("a", 1)
self.bst.put("g", 7)
self.assertEqual(self.bst.floor_key("a"), "a")
self.assertEqual(self.bst.floor_key("b"), "a")
self.assertEqual(self.bst.floor_key("g"), "g")
self.assertEqual(self.bst.floor_key("h"), "g")
def test_ceiling_key(self):
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("a", 1)
self.bst.put("c", 3)
self.bst.put("e", 5)
self.bst.put("g", 7)
self.assertEqual(self.bst.ceiling_key("a"), "a")
self.assertEqual(self.bst.ceiling_key("b"), "c")
self.assertEqual(self.bst.ceiling_key("g"), "g")
self.assertEqual(self.bst.ceiling_key("f"), "g")
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("c", 3)
self.bst.put("e", 5)
self.bst.put("a", 1)
self.bst.put("g", 7)
self.assertEqual(self.bst.ceiling_key("a"), "a")
self.assertEqual(self.bst.ceiling_key("b"), "c")
self.assertEqual(self.bst.ceiling_key("g"), "g")
self.assertEqual(self.bst.ceiling_key("f"), "g")
def test_select_key(self):
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.select_key(0), "a")
self.assertEqual(self.bst.select_key(1), "b")
self.assertEqual(self.bst.select_key(2), "c")
def test_rank(self):
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.rank("a"), 0)
self.assertEqual(self.bst.rank("b"), 1)
self.assertEqual(self.bst.rank("c"), 2)
self.assertEqual(self.bst.rank("d"), 3)
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
self.assertEqual(self.bst.rank("a"), 0)
self.assertEqual(self.bst.rank("b"), 1)
self.assertEqual(self.bst.rank("c"), 2)
self.assertEqual(self.bst.rank("d"), 3)
def test_delete_min(self):
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
for i in range(self.bst.size() - 1):
self.bst.delete_min()
self.assertEqual(self.bst.min_key(), self.key_val[i+1][0])
self.bst.delete_min()
self.assertEqual(self.bst.min_key(), None)
shuffled = self.shuffle_list(self.key_val[:])
self.bst = binary_search_tree.BinarySearchTree()
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
for i in range(self.bst.size() - 1):
self.bst.delete_min()
self.assertEqual(self.bst.min_key(), self.key_val[i+1][0])
self.bst.delete_min()
self.assertEqual(self.bst.min_key(), None)
def test_delete_max(self):
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
for i in range(self.bst.size() - 1, 0, -1):
self.bst.delete_max()
self.assertEqual(self.bst.max_key(), self.key_val[i-1][0])
self.bst.delete_max()
self.assertEqual(self.bst.max_key(), None)
shuffled = self.shuffle_list(self.key_val[:])
for pair in shuffled:
k, v = pair
self.bst.put(k, v)
for i in range(self.bst.size() - 1, 0, -1):
self.bst.delete_max()
self.assertEqual(self.bst.max_key(), self.key_val[i-1][0])
self.bst.delete_max()
self.assertEqual(self.bst.max_key(), None)
def test_delete(self):
# delete key from an empty bst
self.bst = binary_search_tree.BinarySearchTree()
self.bst.delete("a")
self.assertEqual(self.bst.root, None)
self.assertEqual(self.bst.size(), 0)
# delete key not present in bst
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("a", 1)
self.bst.delete("b")
self.assertEqual(self.bst.root.key, "a")
self.assertEqual(self.bst.size(), 1)
# delete key when bst only contains one key
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("a", 1)
self.assertEqual(self.bst.root.key, "a")
self.bst.delete("a")
self.assertEqual(self.bst.root, None)
self.assertEqual(self.bst.size(), 0)
# delete parent key when it only has a left child
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("b", 2)
self.bst.put("a", 1)
self.assertEqual(self.bst.root.left.key, "a")
self.bst.delete("b")
self.assertEqual(self.bst.root.key, "a")
self.assertEqual(self.bst.size(), 1)
# delete parent key when it only has a right child
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("a", 1)
self.bst.put("b", 2)
self.assertEqual(self.bst.root.right.key, "b")
self.bst.delete("a")
self.assertEqual(self.bst.root.key, "b")
self.assertEqual(self.bst.size(), 1)
# delete left child key
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("b", 2)
self.bst.put("a", 1)
self.assertEqual(self.bst.root.left.key, "a")
self.bst.delete("a")
self.assertEqual(self.bst.root.key, "b")
self.assertEqual(self.bst.size(), 1)
# delete right child key
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("a", 1)
self.bst.put("b", 2)
self.assertEqual(self.bst.root.right.key, "b")
self.bst.delete("b")
self.assertEqual(self.bst.root.key, "a")
self.assertEqual(self.bst.size(), 1)
# delete parent key when it has a left and right child
self.bst = binary_search_tree.BinarySearchTree()
self.bst.put("b", 2)
self.bst.put("a", 1)
self.bst.put("c", 3)
self.bst.delete("b")
self.assertEqual(self.bst.root.key, "c")
self.assertEqual(self.bst.size(), 2)
def test_keys(self):
self.bst = binary_search_tree.BinarySearchTree()
for pair in self.key_val:
k, v = pair
self.bst.put(k, v)
self.assertEqual(
self.bst.keys(),
["a", "b", "c", "d", "e", "f", "g", "h", "i"]
)
class TestDirectedGraph(unittest.TestCase):
"""
Test Undirected Graph Implementation
"""
def test_directed_graph(self):
# init
self.dg0 = digraph.Digraph()
self.dg1 = digraph.Digraph()
self.dg2 = digraph.Digraph()
self.dg3 = digraph.Digraph()
# populating
self.dg1.add_edge(1, 2)
self.dg1_rev = self.dg1.reverse() # reverse
self.dg2.add_edge(1, 2)
self.dg2.add_edge(1, 2)
self.dg3.add_edge(1, 2)
self.dg3.add_edge(1, 2)
self.dg3.add_edge(3, 1)
# test adj
self.assertTrue(2 in self.dg1.adj(1))
self.assertEqual(len(self.dg1.adj(1)), 1)
self.assertTrue(1 not in self.dg1.adj(2))
self.assertEqual(len(self.dg1.adj(2)), 0)
self.assertTrue(1 in self.dg1_rev.adj(2))
self.assertEqual(len(self.dg1_rev.adj(2)), 1)
self.assertTrue(2 not in self.dg1_rev.adj(1))
self.assertEqual(len(self.dg1_rev.adj(1)), 0)
self.assertTrue(2 in self.dg2.adj(1))
self.assertEqual(len(self.dg2.adj(1)), 2)
self.assertTrue(1 not in self.dg2.adj(2))
self.assertEqual(len(self.dg2.adj(2)), 0)
self.assertTrue(2 in self.dg3.adj(1))
self.assertTrue(1 in self.dg3.adj(3))
self.assertEqual(len(self.dg3.adj(1)), 2)
self.assertTrue(1 not in self.dg3.adj(2))
self.assertEqual(len(self.dg3.adj(2)), 0)
self.assertTrue(3 not in self.dg3.adj(1))
self.assertEqual(len(self.dg3.adj(3)), 1)
# test degree
self.assertEqual(self.dg1.outdegree(1), 1)
self.assertEqual(self.dg1.outdegree(2), 0)
self.assertEqual(self.dg1_rev.outdegree(2), 1)
self.assertEqual(self.dg1_rev.outdegree(1), 0)
self.assertEqual(self.dg2.outdegree(1), 2)
self.assertEqual(self.dg2.outdegree(2), 0)
self.assertEqual(self.dg3.outdegree(1), 2)
self.assertEqual(self.dg3.outdegree(2), 0)
self.assertEqual(self.dg3.outdegree(3), 1)
# test vertices
self.assertEqual(list(self.dg0.vertices()), [])
self.assertEqual(len(self.dg0.vertices()), 0)
self.assertTrue(1 in self.dg1.vertices())
self.assertTrue(2 in self.dg1.vertices())
self.assertEqual(len(self.dg1.vertices()), 2)
self.assertTrue(2 in self.dg1_rev.vertices())
self.assertTrue(1 in self.dg1_rev.vertices())
self.assertEqual(len(self.dg1_rev.vertices()), 2)
self.assertTrue(1 in self.dg2.vertices())
self.assertTrue(2 in self.dg2.vertices())
self.assertEqual(len(self.dg2.vertices()), 2)
self.assertTrue(1 in self.dg3.vertices())
self.assertTrue(2 in self.dg3.vertices())
self.assertTrue(3 in self.dg3.vertices())
self.assertEqual(len(self.dg3.vertices()), 3)
# test vertex_count
self.assertEqual(self.dg0.vertex_count(), 0)
self.assertEqual(self.dg1.vertex_count(), 2)
self.assertEqual(self.dg1_rev.vertex_count(), 2)
self.assertEqual(self.dg2.vertex_count(), 2)
self.assertEqual(self.dg3.vertex_count(), 3)
# test edge_count
self.assertEqual(self.dg0.edge_count(), 0)
self.assertEqual(self.dg1.edge_count(), 1)
self.assertEqual(self.dg1_rev.edge_count(), 1)
self.assertEqual(self.dg2.edge_count(), 2)
self.assertEqual(self.dg3.edge_count(), 3)
class TestQueue(unittest.TestCase):
"""
Test Queue Implementation
"""
def test_queue(self):
self.que = queue.Queue()
self.que.add(1)
self.que.add(2)
self.que.add(8)
self.que.add(5)
self.que.add(6)
self.assertEqual(self.que.remove(), 1)
self.assertEqual(self.que.size(), 4)
self.assertEqual(self.que.remove(), 2)
self.assertEqual(self.que.remove(), 8)
self.assertEqual(self.que.remove(), 5)
self.assertEqual(self.que.remove(), 6)
self.assertEqual(self.que.is_empty(), True)
class TestSinglyLinkedList(unittest.TestCase):
"""
Test Singly Linked List Implementation
"""
def test_singly_linked_list(self):
self.sl = singly_linked_list.SinglyLinkedList()
self.sl.add(10)
self.sl.add(5)
self.sl.add(30)
self.sl.remove(30)
self.assertEqual(self.sl.size, 2)
self.assertEqual(self.sl.search(30), False)
self.assertEqual(self.sl.search(5), True)
self.assertEqual(self.sl.search(10), True)
self.assertEqual(self.sl.remove(5), True)
self.assertEqual(self.sl.remove(10), True)
self.assertEqual(self.sl.size, 0)
class TestStack(unittest.TestCase):
"""
Test Stack Implementation
"""
def test_stack(self):
self.sta = stack.Stack()
self.sta.add(5)
self.sta.add(8)
self.sta.add(10)
self.sta.add(2)
self.assertEqual(self.sta.remove(), 2)
self.assertEqual(self.sta.is_empty(), False)
self.assertEqual(self.sta.size(), 3)
class TestUndirectedGraph(unittest.TestCase):
"""
Test Undirected Graph Implementation
"""
def test_undirected_graph(self):
# init
self.ug0 = undirected_graph.Undirected_Graph()
self.ug1 = undirected_graph.Undirected_Graph()
self.ug2 = undirected_graph.Undirected_Graph()
self.ug3 = undirected_graph.Undirected_Graph()
# populating
self.ug1.add_edge(1, 2)
self.ug2.add_edge(1, 2)
self.ug2.add_edge(1, 2)
self.ug3.add_edge(1, 2)
self.ug3.add_edge(1, 2)
self.ug3.add_edge(3, 1)
# test adj
self.assertTrue(2 in self.ug1.adj(1))
self.assertEqual(len(self.ug1.adj(1)), 1)
self.assertTrue(1 in self.ug1.adj(2))
self.assertEqual(len(self.ug1.adj(1)), 1)
self.assertTrue(2 in self.ug2.adj(1))
self.assertEqual(len(self.ug2.adj(1)), 2)
self.assertTrue(1 in self.ug2.adj(2))
self.assertEqual(len(self.ug2.adj(1)), 2)
self.assertTrue(2 in self.ug3.adj(1))
self.assertTrue(3 in self.ug3.adj(1))
self.assertEqual(len(self.ug3.adj(1)), 3)
self.assertTrue(1 in self.ug3.adj(2))
self.assertEqual(len(self.ug3.adj(2)), 2)
self.assertTrue(1 in self.ug3.adj(3))
self.assertEqual(len(self.ug3.adj(3)), 1)
# test degree
self.assertEqual(self.ug1.degree(1), 1)
self.assertEqual(self.ug1.degree(2), 1)
self.assertEqual(self.ug2.degree(1), 2)
self.assertEqual(self.ug2.degree(2), 2)
self.assertEqual(self.ug3.degree(1), 3)
self.assertEqual(self.ug3.degree(2), 2)
self.assertEqual(self.ug3.degree(3), 1)
# test vertices
self.assertEqual(list(self.ug0.vertices()), [])
self.assertEqual(len(self.ug0.vertices()), 0)
self.assertTrue(1 in self.ug1.vertices())
self.assertTrue(2 in self.ug1.vertices())
self.assertEqual(len(self.ug1.vertices()), 2)
self.assertTrue(1 in self.ug2.vertices())
self.assertTrue(2 in self.ug2.vertices())
self.assertEqual(len(self.ug2.vertices()), 2)
self.assertTrue(1 in self.ug3.vertices())
self.assertTrue(2 in self.ug3.vertices())
self.assertTrue(3 in self.ug3.vertices())
self.assertEqual(len(self.ug3.vertices()), 3)
# test vertex_count
self.assertEqual(self.ug0.vertex_count(), 0)
self.assertEqual(self.ug1.vertex_count(), 2)
self.assertEqual(self.ug2.vertex_count(), 2)
self.assertEqual(self.ug3.vertex_count(), 3)
# test edge_count
self.assertEqual(self.ug0.edge_count(), 0)
self.assertEqual(self.ug1.edge_count(), 1)
self.assertEqual(self.ug2.edge_count(), 2)
self.assertEqual(self.ug3.edge_count(), 3)
class TestUnionFind(unittest.TestCase):
"""
Test Union Find Implementation
"""
def test_union_find(self):
self.uf = union_find.UnionFind(4)
self.uf.make_set(4)
self.uf.union(1, 0)
self.uf.union(3, 4)
self.assertEqual(self.uf.find(1), 0)
self.assertEqual(self.uf.find(3), 4)
self.assertEqual(self.uf.is_connected(0, 1), True)
self.assertEqual(self.uf.is_connected(3, 4), True)
class TestUnionFindByRank(unittest.TestCase):
"""
Test Union Find Implementation
"""
def test_union_find_by_rank(self):
self.uf = union_find_by_rank.UnionFindByRank(6)
self.uf.make_set(6)
self.uf.union(1, 0)
self.uf.union(3, 4)
self.uf.union(2, 4)
self.uf.union(5, 2)
self.uf.union(6, 5)
self.assertEqual(self.uf.find(1), 1)
self.assertEqual(self.uf.find(3), 3)
# test tree is created by rank
self.uf.union(5, 0)
self.assertEqual(self.uf.find(2), 3)
self.assertEqual(self.uf.find(5), 3)
self.assertEqual(self.uf.find(6), 3)
self.assertEqual(self.uf.find(0), 3)
self.assertEqual(self.uf.is_connected(0, 1), True)
self.assertEqual(self.uf.is_connected(3, 4), True)
self.assertEqual(self.uf.is_connected(5, 3), True)
class TestUnionFindWithPathCompression(unittest.TestCase):
"""
Test Union Find Implementation
"""
def test_union_find_with_path_compression(self):
self.uf = (
union_find_with_path_compression
.UnionFindWithPathCompression(5)
)
self.uf.make_set(5)
self.uf.union(0, 1)
self.uf.union(2, 3)
self.uf.union(1, 3)
self.uf.union(4, 5)
self.assertEqual(self.uf.find(1), 0)
self.assertEqual(self.uf.find(3), 0)
self.assertEqual(self.uf.parent(3), 2)
self.assertEqual(self.uf.parent(5), 4)
self.assertEqual(self.uf.is_connected(3, 5), False)
self.assertEqual(self.uf.is_connected(4, 5), True)
self.assertEqual(self.uf.is_connected(2, 3), True)
# test tree is created by path compression
self.uf.union(5, 3)
self.assertEqual(self.uf.parent(3), 0)
self.assertEqual(self.uf.is_connected(3, 5), True)
class TestLCPSuffixArrays(unittest.TestCase):
def setUp(self):
super(TestLCPSuffixArrays, self).setUp()
self.case_1 = "aaaaaa"
self.s_array_1 = [5, 4, 3, 2, 1, 0]
self.rank_1 = [5, 4, 3, 2, 1, 0]
self.lcp_1 = [1, 2, 3, 4, 5, 0]
self.case_2 = "abcabcdd"
self.s_array_2 = [0, 2, 4, 1, 3, 5, 7, 6]
self.rank_2 = [0, 3, 1, 4, 2, 5, 7, 6]
self.lcp_2 = [3, 0, 2, 0, 1, 0, 1, 0]
self.case_3 = "kmckirrrmppp"
self.s_array_3 = [3, 4, 0, 2, 1, 11, 10, 9, 5, 8, 7, 6]
self.rank_3 = [2, 4, 3, 0, 1, 8, 11, 10, 9, 7, 6, 5]
self.lcp_3 = [0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0]
def test_lcp_array(self):
lcp = lcp_array.lcp_array(self.case_1, self.s_array_1, self.rank_1)
self.assertEqual(lcp, self.lcp_1)
lcp = lcp_array.lcp_array(self.case_2, self.s_array_2, self.rank_2)
self.assertEqual(lcp, self.lcp_2)
lcp = lcp_array.lcp_array(self.case_3, self.s_array_3, self.rank_3)
self.assertEqual(lcp, self.lcp_3)
def test_suffix_array(self):
s_array, rank = lcp_array.suffix_array(self.case_1)
self.assertEqual(s_array, self.s_array_1)
self.assertEqual(rank, self.rank_1)
s_array, rank = lcp_array.suffix_array(self.case_2)
self.assertEqual(s_array, self.s_array_2)
self.assertEqual(rank, self.rank_2)
s_array, rank = lcp_array.suffix_array(self.case_3)
self.assertEqual(s_array, self.s_array_3)
self.assertEqual(rank, self.rank_3)
| 33.818942
| 75
| 0.592702
| 3,445
| 24,282
| 4.077794
| 0.05312
| 0.09916
| 0.210991
| 0.129983
| 0.821327
| 0.719248
| 0.578517
| 0.509966
| 0.455937
| 0.426039
| 0
| 0.033981
| 0.261922
| 24,282
| 717
| 76
| 33.866109
| 0.749861
| 0.051025
| 0
| 0.470037
| 0
| 0
| 0.008132
| 0
| 0
| 0
| 0
| 0
| 0.430712
| 1
| 0.050562
| false
| 0
| 0.005618
| 0
| 0.078652
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c7121c76de9630194ceff836f2819450a147d0aa
| 69
|
py
|
Python
|
myMath/area.py
|
Streamerbtw2006/PythonClass
|
da8a27b8b7968d2d83ec2d5b8c0a3b23d75cb753
|
[
"MIT"
] | null | null | null |
myMath/area.py
|
Streamerbtw2006/PythonClass
|
da8a27b8b7968d2d83ec2d5b8c0a3b23d75cb753
|
[
"MIT"
] | null | null | null |
myMath/area.py
|
Streamerbtw2006/PythonClass
|
da8a27b8b7968d2d83ec2d5b8c0a3b23d75cb753
|
[
"MIT"
] | null | null | null |
class Geometric:
def Area(self, x, y):
return x * y
| 13.8
| 25
| 0.507246
| 10
| 69
| 3.5
| 0.8
| 0.114286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.391304
| 69
| 4
| 26
| 17.25
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
c7212f3327ae55cc087fe574fc0e163372de48cf
| 88
|
py
|
Python
|
jetson/tests/sound_record.py
|
lonerlin/SelfDrivingCVCar
|
8757e5eff62391e28d2fc530100b27fafafdc788
|
[
"Apache-2.0"
] | 2
|
2021-07-03T02:37:58.000Z
|
2021-07-10T07:33:19.000Z
|
jetson/tests/sound_record.py
|
lurending711/SelfDrivingCVCar
|
18aa6b120e05e478ac51e0311a2ebe8638129a04
|
[
"Apache-2.0"
] | null | null | null |
jetson/tests/sound_record.py
|
lurending711/SelfDrivingCVCar
|
18aa6b120e05e478ac51e0311a2ebe8638129a04
|
[
"Apache-2.0"
] | 1
|
2021-07-10T07:33:21.000Z
|
2021-07-10T07:33:21.000Z
|
import sys
sys.path.append("..")
from audio.audio import record
record("voice.wav", 5)
| 14.666667
| 30
| 0.715909
| 14
| 88
| 4.5
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012821
| 0.113636
| 88
| 5
| 31
| 17.6
| 0.794872
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
c722ae909fe9094339e151e9e78e779b4de23d0f
| 940
|
py
|
Python
|
sentinel/discovery/layers/domain/adapter/version_18_03.py
|
alhassane/sentinel
|
f87ff610d9a3062bda2c5cb4afefebd767edabf3
|
[
"MIT"
] | null | null | null |
sentinel/discovery/layers/domain/adapter/version_18_03.py
|
alhassane/sentinel
|
f87ff610d9a3062bda2c5cb4afefebd767edabf3
|
[
"MIT"
] | null | null | null |
sentinel/discovery/layers/domain/adapter/version_18_03.py
|
alhassane/sentinel
|
f87ff610d9a3062bda2c5cb4afefebd767edabf3
|
[
"MIT"
] | 1
|
2019-12-17T23:26:31.000Z
|
2019-12-17T23:26:31.000Z
|
from discovery.layers.domain.adapter.docker import DockerAdapter
from discovery.layers.domain.adapter.swarm import SwarmAdapter
class DockerVersionAdapter(DockerAdapter):
"""DockerVersionAdapter for docker server version 18.03.*
No method in this class because all is in base
To Create an adapter for another version :
- create file adapters.docker_version.py
- create class DockerVersionAdapter inherited DockerAdapter
- redifine methods if method in DockerAdapter not compatible
"""
pass
class SwarmVersionAdapter(SwarmAdapter):
"""SwarmVersionAdapter for docker server version 18.03.*
No method in this class because all is in base
To Create an adapter for another version :
- create file adapters.swarm_version.py
- create class SwarmVersionAdapter inherited SwarmAdapter
- redifine methods if method in DockerAdapter not compatible
"""
pass
| 34.814815
| 68
| 0.744681
| 110
| 940
| 6.345455
| 0.363636
| 0.045845
| 0.054441
| 0.071633
| 0.578797
| 0.487106
| 0.487106
| 0.487106
| 0.487106
| 0.329513
| 0
| 0.010753
| 0.208511
| 940
| 26
| 69
| 36.153846
| 0.927419
| 0.675532
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
c723d8baf991a3bab51772bd7cef05fd15329556
| 769
|
py
|
Python
|
config_loader.py
|
mokeeqian/ZhengFangJiaoWu
|
7ac697ed9c1914f7f4aba47d51ba40a60eec1ebd
|
[
"MIT"
] | 6
|
2019-10-08T02:01:50.000Z
|
2020-07-09T11:49:15.000Z
|
config_loader.py
|
mokeeqian/ZhengFangJiaoWu
|
7ac697ed9c1914f7f4aba47d51ba40a60eec1ebd
|
[
"MIT"
] | null | null | null |
config_loader.py
|
mokeeqian/ZhengFangJiaoWu
|
7ac697ed9c1914f7f4aba47d51ba40a60eec1ebd
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# encoding=utf-8
# Copyright: Qian Jipeng(C) 2019
"""
加载配置文件
"""
import configparser
cf = configparser.ConfigParser()
cf.read("config.conf")
section = cf.sections() # a list
# print(section)
# print(cf.options('user'))
def getUserId():
return str(cf.get('user', 'userid'))
def getUserPassword():
return str(cf.get('user', 'password'))
def getIndexUrl():
return str(cf.get('web', 'index'))
def getLoginUrl():
return str(cf.get('web', 'loginurl'))
def getCheckcodeUrl():
return str(cf.get('web', 'checkcodeurl'))
def getCheckcodeFilename():
return str(cf.get('result', 'checkcodefilename'))
def getResultDirname():
return str(cf.get('result', 'resultdirname'))
def getDataTableName():
return str(cf.get('data', 'datatablename'))
| 19.717949
| 50
| 0.694408
| 97
| 769
| 5.505155
| 0.505155
| 0.134831
| 0.164794
| 0.209738
| 0.237828
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008798
| 0.113134
| 769
| 39
| 51
| 19.717949
| 0.774194
| 0.158648
| 0
| 0
| 0
| 0
| 0.198425
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0.1
| 0.05
| 0.4
| 0.85
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
|
0
| 4
|
c7270f82b76471af967701dfe56273ce4caac204
| 69
|
py
|
Python
|
cli.py
|
GeorgeStambulyants/pytra
|
9c9d424be511bf086a8a792687460a3c6f8b55d9
|
[
"MIT"
] | null | null | null |
cli.py
|
GeorgeStambulyants/pytra
|
9c9d424be511bf086a8a792687460a3c6f8b55d9
|
[
"MIT"
] | null | null | null |
cli.py
|
GeorgeStambulyants/pytra
|
9c9d424be511bf086a8a792687460a3c6f8b55d9
|
[
"MIT"
] | null | null | null |
from src.pytra import pytra
if __name__ == '__main__':
pytra()
| 11.5
| 27
| 0.666667
| 9
| 69
| 4.222222
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.217391
| 69
| 5
| 28
| 13.8
| 0.703704
| 0
| 0
| 0
| 0
| 0
| 0.115942
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
c72da463b520caacfd4eede57efc10e2e35201ee
| 770
|
py
|
Python
|
web/models.py
|
cogerk/ARTBot
|
f02bc6ecffe81aea2df2e0ea1f6012ff8179bea5
|
[
"MIT"
] | null | null | null |
web/models.py
|
cogerk/ARTBot
|
f02bc6ecffe81aea2df2e0ea1f6012ff8179bea5
|
[
"MIT"
] | null | null | null |
web/models.py
|
cogerk/ARTBot
|
f02bc6ecffe81aea2df2e0ea1f6012ff8179bea5
|
[
"MIT"
] | null | null | null |
#models.py - Defines the database tables used in the website.
from web import db
#Stores all submitted art and allows it to be referenced later by the robot interface
class artpieces(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String())
email = db.Column(db.String())
submit_date = db.Column(db.DateTime())
art = db.Column(db.String())
status = db.Column(db.String())
picture = db.Column(db.LargeBinary())
def __repr__(self):
return '<%r: %r>' % (self.id, self.title)
#Tracks some ongoing website variables
class site_vars(db.Model):
var = db.Column(db.String(), primary_key=True)
val = db.Column(db.Integer())
def __repr__(self):
return '<%r: %r>' % (self.var, self.val)
| 30.8
| 85
| 0.663636
| 115
| 770
| 4.33913
| 0.504348
| 0.144289
| 0.180361
| 0.160321
| 0.092184
| 0.092184
| 0.092184
| 0
| 0
| 0
| 0
| 0
| 0.192208
| 770
| 24
| 86
| 32.083333
| 0.802251
| 0.235065
| 0
| 0.125
| 0
| 0
| 0.027304
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0.0625
| 0.125
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
c743bf5d636ef484d2f147dc86552bc786ce5286
| 207
|
py
|
Python
|
parameters.py
|
Mateus-Toni/Exemplo-Login-Cadastro
|
3c00d7de883c3d558376dfe9e7bce6fdfc63c2b8
|
[
"MIT"
] | 2
|
2022-02-18T15:38:55.000Z
|
2022-03-08T14:11:45.000Z
|
parameters.py
|
Mateus-Toni/Exemplo-Login-Cadastro
|
3c00d7de883c3d558376dfe9e7bce6fdfc63c2b8
|
[
"MIT"
] | null | null | null |
parameters.py
|
Mateus-Toni/Exemplo-Login-Cadastro
|
3c00d7de883c3d558376dfe9e7bce6fdfc63c2b8
|
[
"MIT"
] | null | null | null |
import os
from dotenv import load_dotenv
load_dotenv()
NAME = os.environ.get('DB_USER_NAME')
PASSWORD = os.environ.get('DB_PASSWORD')
HOST = os.environ.get('DB_HOST')
DB_NAME = os.environ.get('DB_NAME')
| 18.818182
| 41
| 0.743961
| 35
| 207
| 4.171429
| 0.342857
| 0.246575
| 0.328767
| 0.383562
| 0.246575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 207
| 10
| 42
| 20.7
| 0.793478
| 0
| 0
| 0
| 0
| 0
| 0.179612
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.142857
| 0.285714
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
c76f51a4141e1b68fa21597cf51fd7f8c40ba869
| 494
|
py
|
Python
|
framework/sessions/utils.py
|
fabmiz/osf.io
|
8d86af3f0a6e5388bd5b18383e68e27b65a66247
|
[
"Apache-2.0"
] | null | null | null |
framework/sessions/utils.py
|
fabmiz/osf.io
|
8d86af3f0a6e5388bd5b18383e68e27b65a66247
|
[
"Apache-2.0"
] | 5
|
2017-09-14T18:04:12.000Z
|
2017-10-03T17:43:55.000Z
|
framework/sessions/utils.py
|
fabmiz/osf.io
|
8d86af3f0a6e5388bd5b18383e68e27b65a66247
|
[
"Apache-2.0"
] | 1
|
2019-07-16T00:14:49.000Z
|
2019-07-16T00:14:49.000Z
|
# -*- coding: utf-8 -*-
from modularodm import Q
def remove_sessions_for_user(user):
"""
Permanently remove all stored sessions for the user from the DB.
:param user: User
:return:
"""
from osf.models import Session
Session.remove(Q('data.auth_user_id', 'eq', user._id))
def remove_session(session):
"""
Remove a session from database
:param session: Session
:return:
"""
from osf.models import Session
Session.remove_one(session)
| 19
| 68
| 0.65587
| 65
| 494
| 4.861538
| 0.446154
| 0.177215
| 0.189873
| 0.120253
| 0.28481
| 0.28481
| 0.28481
| 0.28481
| 0
| 0
| 0
| 0.002646
| 0.234818
| 494
| 25
| 69
| 19.76
| 0.833333
| 0.364372
| 0
| 0.285714
| 0
| 0
| 0.071161
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.428571
| 0
| 0.714286
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c7c1717b45ba66fa9944a35f364ccd17e44f5b42
| 191
|
py
|
Python
|
python_client/setup.py
|
girder/slicer-extension-manager
|
3aa563d24ed4cedff94a375381a2cf7fd31f3e64
|
[
"Apache-2.0"
] | 2
|
2018-02-22T18:33:16.000Z
|
2018-02-28T03:55:22.000Z
|
python_client/setup.py
|
girder/slicer-extension-manager
|
3aa563d24ed4cedff94a375381a2cf7fd31f3e64
|
[
"Apache-2.0"
] | 15
|
2018-02-20T23:44:25.000Z
|
2018-03-01T02:55:46.000Z
|
python_client/setup.py
|
girder/slicer-extension-manager
|
3aa563d24ed4cedff94a375381a2cf7fd31f3e64
|
[
"Apache-2.0"
] | 1
|
2018-02-16T18:16:58.000Z
|
2018-02-16T18:16:58.000Z
|
# -*- coding: utf-8 -*-
from setuptools import setup
# This file is required to support editable install
# See https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
setup()
| 21.222222
| 74
| 0.748691
| 27
| 191
| 5.259259
| 0.925926
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006024
| 0.13089
| 191
| 8
| 75
| 23.875
| 0.849398
| 0.753927
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
c7d863108e925b53444156a87d044609f6e8465f
| 273
|
py
|
Python
|
otp/login/LoginBase.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 81
|
2018-04-08T18:14:24.000Z
|
2022-01-11T07:22:15.000Z
|
otp/login/LoginBase.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 4
|
2018-09-13T20:41:22.000Z
|
2022-01-08T06:57:00.000Z
|
otp/login/LoginBase.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 26
|
2018-05-26T12:49:27.000Z
|
2021-09-11T09:11:59.000Z
|
class LoginBase():
freeTimeExpires = -1
def __init__(self, cr):
self.cr = cr
def sendLoginMsg(self, loginName, password, createFlag):
pass
def getErrorCode(self):
return 0
def needToSetParentPassword(self):
return 0
| 17.0625
| 60
| 0.615385
| 28
| 273
| 5.857143
| 0.607143
| 0.073171
| 0.134146
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015707
| 0.300366
| 273
| 16
| 61
| 17.0625
| 0.842932
| 0
| 0
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0.3
| 0
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
|
0
| 4
|
1bea4f9170d93c869c69aa3eaf4ff1dbd4272e44
| 202
|
py
|
Python
|
science_data_structure/test_config.py
|
woutervanveen/science_data_structure
|
90a7438d65020f0e7c3be1df7f9e72f54e97f119
|
[
"MIT"
] | null | null | null |
science_data_structure/test_config.py
|
woutervanveen/science_data_structure
|
90a7438d65020f0e7c3be1df7f9e72f54e97f119
|
[
"MIT"
] | null | null | null |
science_data_structure/test_config.py
|
woutervanveen/science_data_structure
|
90a7438d65020f0e7c3be1df7f9e72f54e97f119
|
[
"MIT"
] | null | null | null |
import unittest
import config
class TestConfig(unittest.TestCase):
def setUp(self):
pass
def test_config_loading(self):
pass
if __name__ == "__main__":
unittest.main()
| 12.625
| 36
| 0.658416
| 23
| 202
| 5.347826
| 0.652174
| 0.130081
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.252475
| 202
| 15
| 37
| 13.466667
| 0.81457
| 0
| 0
| 0.222222
| 0
| 0
| 0.039604
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.222222
| 0.222222
| 0
| 0.555556
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
1bed79b8052bb8fab5865735f7b81a646e0e2689
| 89
|
py
|
Python
|
centers/apps.py
|
ChristianJStarr/sbs-website
|
db891f0a67f46cc9cdadc95714304b2ea91a162a
|
[
"MIT"
] | 1
|
2022-01-09T18:54:32.000Z
|
2022-01-09T18:54:32.000Z
|
centers/apps.py
|
ChristianJStarr/sbs-website
|
db891f0a67f46cc9cdadc95714304b2ea91a162a
|
[
"MIT"
] | null | null | null |
centers/apps.py
|
ChristianJStarr/sbs-website
|
db891f0a67f46cc9cdadc95714304b2ea91a162a
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class CentersConfig(AppConfig):
name = 'centers'
| 14.833333
| 33
| 0.752809
| 10
| 89
| 6.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1bf85c0291f5897e3bb159145ca9ab09b5a8ce44
| 39
|
py
|
Python
|
bob/db/swan/config_protocol_licit_p1_face_f4.py
|
bioidiap/bob.db.swan
|
676510d47cb08b65be04f51d45746127c36bf2ce
|
[
"BSD-3-Clause"
] | null | null | null |
bob/db/swan/config_protocol_licit_p1_face_f4.py
|
bioidiap/bob.db.swan
|
676510d47cb08b65be04f51d45746127c36bf2ce
|
[
"BSD-3-Clause"
] | null | null | null |
bob/db/swan/config_protocol_licit_p1_face_f4.py
|
bioidiap/bob.db.swan
|
676510d47cb08b65be04f51d45746127c36bf2ce
|
[
"BSD-3-Clause"
] | null | null | null |
database.protocol = 'licit_p1_face_f4'
| 19.5
| 38
| 0.820513
| 6
| 39
| 4.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0.076923
| 39
| 1
| 39
| 39
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.410256
| 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
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
40357f693b71f1c592ef012fd0ff065b04aa357d
| 3,399
|
py
|
Python
|
tests/test_api/test_drone.py
|
OrderAndCh4oS/drone_squadron_api_prototype
|
4d7c22cebb03576986d443634b17910cb460a60f
|
[
"MIT"
] | 1
|
2020-05-20T09:44:37.000Z
|
2020-05-20T09:44:37.000Z
|
tests/test_api/test_drone.py
|
sarcoma/drone_squadron_api_prototype
|
4d7c22cebb03576986d443634b17910cb460a60f
|
[
"MIT"
] | 1
|
2021-06-01T22:30:10.000Z
|
2021-06-01T22:30:10.000Z
|
tests/test_api/test_drone.py
|
OrderAndCh4oS/drone_squadron_api_prototype
|
4d7c22cebb03576986d443634b17910cb460a60f
|
[
"MIT"
] | null | null | null |
from sqlalchemy.engine import ResultProxy
from drone_squadron.crud.drone_crud import DroneCrud
from drone_squadron.crud.squadron_crud import SquadronCrud
class TestDrone:
def test_post(self, log_in, test_client):
with SquadronCrud() as crud:
result = crud.insert(name="Squad Test", user=1) # type: ResultProxy
last_id = result.inserted_primary_key[0]
response = test_client.post(
'/drone',
json={"name": "Drone One", "squadron": last_id},
content_type="application/json"
)
data = response.get_json()
assert response.status_code == 200
assert 'id' in data
assert 'name' in data
assert 'kills' in data
assert 'missions' in data
assert 'value' in data
assert 'weapon_name' in data
assert 'gimbal_name' in data
assert 'thruster_name' in data
assert 'steering_name' in data
assert 'scanner_name' in data
def test_post_unauthorized(self, log_out, test_client):
response = test_client.post(
'/drone',
json={"name": "Drone One"},
content_type="application/json"
)
assert response.status_code == 401
def test_get(self, log_in, test_client):
with SquadronCrud() as crud:
result = crud.insert(name="Squad Test", user=1) # type: ResultProxy
last_squadron_id = result.inserted_primary_key[0]
with DroneCrud() as crud:
result = crud.insert(
name="Drone One",
squadron=last_squadron_id,
) # type: ResultProxy # type: ResultProxy
last_drone_id = result.inserted_primary_key[0]
response = test_client.get('/drone/%d' % last_drone_id)
data = response.get_json()
assert response.status_code == 200
assert last_drone_id == data['id']
assert 'id' in data
assert 'name' in data
assert 'kills' in data
assert 'missions' in data
assert 'value' in data
assert 'weapon_name' in data
assert 'gimbal_name' in data
assert 'thruster_name' in data
assert 'steering_name' in data
assert 'scanner_name' in data
def test_get_by_squadron(self, log_in, test_client):
response = test_client.get('/squadron/1/drone')
data = response.get_json()[0]
assert response.status_code == 200
assert 1 == data['id']
assert 'id' in data
assert 'name' in data
assert 'kills' in data
assert 'missions' in data
assert 'value' in data
assert 'weapon_name' in data
assert 'gimbal_name' in data
assert 'thruster_name' in data
assert 'steering_name' in data
assert 'scanner_name' in data
def test_put(self, log_in, test_client):
response = test_client.put(
'/drone/1',
json={"name": "Drone Two", "squadron": 1},
content_type="application/json"
)
data = response.get_json()
assert response.status_code == 200
assert {'id_1': '1', 'name': 'Drone Two'} == data
def test_delete(self, log_in, test_client):
response = test_client.delete('/drone/1')
data = response.get_json()
assert response.status_code == 200
assert 1 == data['deleted_rows']
| 35.778947
| 80
| 0.60253
| 419
| 3,399
| 4.696897
| 0.150358
| 0.091463
| 0.164634
| 0.121951
| 0.764736
| 0.729167
| 0.702236
| 0.702236
| 0.626016
| 0.545732
| 0
| 0.013485
| 0.301853
| 3,399
| 94
| 81
| 36.159574
| 0.815845
| 0.021477
| 0
| 0.588235
| 0
| 0
| 0.142126
| 0
| 0
| 0
| 0
| 0
| 0.470588
| 1
| 0.070588
| false
| 0
| 0.035294
| 0
| 0.117647
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
405fe259212af617e762192749f6179bbf440a8a
| 229
|
py
|
Python
|
scieio/conditions/serializers.py
|
arnelimperial/scieio
|
279a25766f20d074a3df824c0fbc8b2d8e35f272
|
[
"MIT"
] | null | null | null |
scieio/conditions/serializers.py
|
arnelimperial/scieio
|
279a25766f20d074a3df824c0fbc8b2d8e35f272
|
[
"MIT"
] | 8
|
2021-03-19T01:56:44.000Z
|
2022-03-12T00:24:21.000Z
|
scieio/conditions/serializers.py
|
arnelimperial/scieio
|
279a25766f20d074a3df824c0fbc8b2d8e35f272
|
[
"MIT"
] | null | null | null |
from rest_framework import serializers
from . import models
class ConditionSerializer(serializers.ModelSerializer):
class Meta:
model = models.Condition
fields = ('id', 'name', 'slug', 'created', 'updated')
| 25.444444
| 61
| 0.69869
| 23
| 229
| 6.913043
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.19214
| 229
| 8
| 62
| 28.625
| 0.859459
| 0
| 0
| 0
| 0
| 0
| 0.104803
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
407d091b57554e758108e85c9db8dd403692073c
| 15,972
|
py
|
Python
|
tests/test_m3u_dump.py
|
sturmianseq/m3u-dump
|
1ec3eeedb4c650af76c6c66859375ca2d2a6e1bc
|
[
"MIT"
] | 1
|
2021-02-20T20:46:11.000Z
|
2021-02-20T20:46:11.000Z
|
tests/test_m3u_dump.py
|
sturmianseq/m3u-dump
|
1ec3eeedb4c650af76c6c66859375ca2d2a6e1bc
|
[
"MIT"
] | null | null | null |
tests/test_m3u_dump.py
|
sturmianseq/m3u-dump
|
1ec3eeedb4c650af76c6c66859375ca2d2a6e1bc
|
[
"MIT"
] | 2
|
2021-08-05T10:32:00.000Z
|
2021-08-17T02:35:52.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_m3u_dump
----------------------------------
Tests for `m3u_dump` module.
"""
import os
import pytest
from click.testing import CliRunner
from m3u_dump import cli
from m3u_dump.m3u_dump import M3uDump
@pytest.fixture(scope='session')
def music_dir(tmpdir_factory):
return tmpdir_factory.mktemp('music')
@pytest.fixture(scope='session')
def music_files(music_dir):
d = music_dir
d.join('dummy001.mp3').write('dummy')
d.mkdir('sub').join('dummy002.mp3').write('dummy')
d.mkdir('sub4').join('dummy002.mp3').write('dummy')
d.mkdir('sub2').mkdir('sub3').join('あいう えお.mp3').write('dummy')
d.mkdir('sub3').mkdir('かきく けこ').join('あいう えお.mp3').write('dummy')
return d
# noinspection PyShadowingNames
@pytest.fixture(scope='session')
def multi_playlist_music_files(music_dir):
d = music_dir
d.join('aaaa.m3u').write('dummy')
d.mkdir('sub7').join('multi-dummy001.mp3').write('dummy')
d.mkdir('sub8').mkdir('sub2').join('multi-dummy002.mp3').write('dummy')
d.mkdir('sub9').join('multi-あいう えお.mp3').write('dummy')
d.mkdir('sub10').join('multi-あいう えお.mp3').write('dummy')
d.mkdir('sub11').join('multi-dummy004.mp3').write('dummy')
d.mkdir('sub12').join('hello hello.mp3').write('dummy')
return d
@pytest.fixture
def playlist_dir(tmpdir_factory):
return tmpdir_factory.mktemp('playlist')
# noinspection PyShadowingNames
@pytest.fixture
def playlist_current(playlist_dir):
f = playlist_dir.join('playlist.m3u')
f.write("""#EXTM3U
#EXTINF:409,artist - music_name
/full/path/dummy001.mp3
#EXTINF:281,artist - music_name
/full/path/dummy002.mp3
#EXTINF:275,artist - music_name
music/あいう えお.mp3
#EXTINF:263,artist - music_name
/full/path/music/あいう えお.mp3
#EXTINF:288,artist - music_name
/full/path/aaa/dummy002.mp3
#EXTINF:222,artist = music_name
../../hello.mp3""")
return f
@pytest.fixture(scope='session')
def already_exists_playlist(tmpdir_factory):
d = tmpdir_factory.mktemp('already-dir')
music_path = str(d.mkdir('music').join('already_path.mp3').write('dummy'))
playlist_content = """#EXTM3U
#EXTINF:409,artist - music_name
{}""".format(os.path.join(str(d), 'music', 'already_path.mp3'))
playlist_path = str(d.join('playlist.m3u').write(playlist_content))
return d
# noinspection PyShadowingNames
@pytest.fixture
def playlist_current2(playlist_dir):
f = playlist_dir.join('playlist2.m3u8')
f.write("""#EXTM3U
#EXTINF:409,artist - music_name
/full/path/multi-dummy001.mp3
#EXTINF:282,artist - music_name
/full/path/multi-dummy001.mp3
#EXTINF:281,artist - music_name
/full/path/multi-dummy002.mp3
#EXTINF:275,artist - music_name
music/multi-あいう えお.mp3
#EXTINF:263,artist - music_name
/full/path/music/multi-あいう えお.mp3
#EXTINF:288,artist - music_name
/full/path/aaa/multi-dummy004.mp3
#EXTINF:222,artist = music_name
../../multi-hello.mp3""")
return f
@pytest.fixture(scope='session')
def dump_music_path(tmpdir_factory):
d = tmpdir_factory.mktemp('dst')
return str(d)
def test_command_line_interface():
runner = CliRunner()
result = runner.invoke(cli.main)
assert result.exit_code == 2 # must arguments
assert 'Error: Missing argument' in result.output
help_result = runner.invoke(cli.main, ['--help'])
assert help_result.exit_code == 0
assert '--help' in help_result.output
assert 'Show this message and exit.' in help_result.output
# noinspection PyShadowingNames
def test_command_line_dryrun(playlist_current, tmpdir_factory, music_files):
dst_dir = str(tmpdir_factory.mktemp('no-dump-music'))
runner = CliRunner()
result = runner.invoke(cli.main, ['--dry-run', str(playlist_current),
dst_dir, '--fix-search-path',
str(music_files)])
assert 'Welcome m3u-dump' in result.output
assert 'copy was completed(successful' in result.output
assert result.exit_code == 0 # must arguments
# copy できていないこと
assert os.path.exists(os.path.join(dst_dir, 'dummy001.mp3')) is False
assert os.path.exists(os.path.join(dst_dir, 'dummy002.mp3')) is False
assert os.path.exists(os.path.join(dst_dir, 'あいう えお.mp3')) is False
assert os.path.exists(os.path.join(dst_dir, 'あいう えお.mp3')) is False
assert os.path.exists(os.path.join(dst_dir, 'hello.mp3')) is False
playlist_name = os.path.basename(str(playlist_current))
playlist_path = os.path.join(dst_dir, playlist_name)
assert os.path.exists(playlist_path) is False
# noinspection PyShadowingNames
def test_command_line_start(playlist_current, tmpdir_factory, music_files):
dst_dir = str(tmpdir_factory.mktemp('dump-music'))
runner = CliRunner()
result = runner.invoke(cli.main, [str(playlist_current), dst_dir,
'--fix-search-path', str(music_files)])
for line in result.output.split('\n'):
print(line)
assert 'Welcome m3u-dump' in result.output
assert 'copy was completed(successful' in result.output
assert result.exit_code == 0 # must arguments
# copy できているか確認する
assert os.path.exists(os.path.join(dst_dir, 'dummy001.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'dummy002.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'あいう えお.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'あいう えお.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'hello.mp3')) is False
playlist_name = os.path.basename(str(playlist_current))
playlist_path = os.path.join(dst_dir, playlist_name)
assert os.path.exists(playlist_path) is True
with open(playlist_path, 'r') as f:
assert '#EXTM3U' == f.readline().rstrip('\n')
assert '#EXTINF:409,artist - music_name' == f.readline().rstrip('\n')
assert 'dummy001.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:281,artist - music_name' == f.readline().rstrip('\n')
assert 'dummy002.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:275,artist - music_name' == f.readline().rstrip('\n')
assert 'あいう えお.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:263,artist - music_name' == f.readline().rstrip('\n')
assert 'あいう えお.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:288,artist - music_name' == f.readline().rstrip('\n')
assert 'dummy002.mp3' == f.readline().rstrip('\n')
assert '' == f.readline().rstrip('\n')
# noinspection PyShadowingNames
def test_command_line_no_fix_start(playlist_current, tmpdir_factory, music_files):
dst_dir = str(tmpdir_factory.mktemp('dump-music'))
runner = CliRunner()
result = runner.invoke(cli.main, [str(playlist_current), dst_dir])
for line in result.output.split('\n'):
print(line)
assert 'Welcome m3u-dump' in result.output
assert 'copy was completed(successful' in result.output
assert result.exit_code == 0 # must arguments
# noinspection PyShadowingNames
def test_command_line_already_playlist(already_exists_playlist):
music_path = os.path.join(str(already_exists_playlist), 'music')
dst_dir = os.path.join(str(already_exists_playlist), 'dst')
os.mkdir(dst_dir)
playlist_path = os.path.join(str(already_exists_playlist), 'playlist.m3u')
runner = CliRunner()
result = runner.invoke(cli.main, [playlist_path, dst_dir,
'--fix-search-path', str(music_path)])
for line in result.output.split('\n'):
print(line)
assert 'Welcome m3u-dump' in result.output
assert 'copy was completed(successful' in result.output
assert result.exit_code == 0 # must arguments
# copy できているか確認する
assert os.path.exists(os.path.join(dst_dir, 'already_path.mp3')) is True
playlist_path = os.path.join(dst_dir, 'playlist.m3u')
assert os.path.exists(playlist_path) is True
with open(playlist_path, 'r') as f:
assert '#EXTM3U' == f.readline().rstrip('\n')
assert '#EXTINF:409,artist - music_name' == f.readline().rstrip('\n')
assert 'already_path.mp3' == f.readline().rstrip('\n')
# noinspection PyShadowingNames
def test_command_line_multi_playlist(playlist_current, playlist_current2,
tmpdir_factory, music_files, multi_playlist_music_files):
playlist_dir = os.path.dirname(str(playlist_current))
dst_dir = str(tmpdir_factory.mktemp('dump-music'))
runner = CliRunner()
result = runner.invoke(cli.main, [playlist_dir, dst_dir,
'--fix-search-path',
str(music_files)])
for line in result.output.split('\n'):
print(line)
assert 'Welcome m3u-dump' in result.output
assert 'copy was completed(successful' in result.output
assert result.exit_code == 0 # must arguments
# copy できているか確認する
assert os.path.exists(os.path.join(dst_dir, 'dummy001.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'dummy002.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'あいう えお.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'あいう えお.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'hello.mp3')) is False
assert os.path.exists(os.path.join(dst_dir, 'multi-dummy001.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'multi-dummy002.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'multi-あいう えお.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'multi-あいう えお.mp3')) is True
assert os.path.exists(os.path.join(dst_dir, 'multi-dummy004.mp3')) is True
playlist_name = os.path.basename(str(playlist_current))
playlist_path = os.path.join(dst_dir, playlist_name)
assert os.path.exists(playlist_path) is True
with open(playlist_path, 'r') as f:
assert '#EXTM3U' == f.readline().rstrip('\n')
assert '#EXTINF:409,artist - music_name' == f.readline().rstrip(
'\n')
assert 'dummy001.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:281,artist - music_name' == f.readline().rstrip(
'\n')
assert 'dummy002.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:275,artist - music_name' == f.readline().rstrip(
'\n')
assert 'あいう えお.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:263,artist - music_name' == f.readline().rstrip(
'\n')
assert 'あいう えお.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:288,artist - music_name' == f.readline().rstrip(
'\n')
assert 'dummy002.mp3' == f.readline().rstrip('\n')
assert '' == f.readline().rstrip('\n')
playlist_name = os.path.basename(str(playlist_current2))
playlist_path = os.path.join(dst_dir, playlist_name)
assert os.path.exists(playlist_path) is True
with open(playlist_path, 'r') as f:
assert '#EXTM3U' == f.readline().rstrip('\n')
assert '#EXTINF:409,artist - music_name' == f.readline().rstrip(
'\n')
assert 'multi-dummy001.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:282,artist - music_name' == f.readline().rstrip(
'\n')
assert 'multi-dummy001.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:281,artist - music_name' == f.readline().rstrip(
'\n')
assert 'multi-dummy002.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:275,artist - music_name' == f.readline().rstrip(
'\n')
assert 'multi-あいう えお.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:263,artist - music_name' == f.readline().rstrip(
'\n')
assert 'multi-あいう えお.mp3' == f.readline().rstrip('\n')
assert '#EXTINF:288,artist - music_name' == f.readline().rstrip(
'\n')
assert 'multi-dummy004.mp3' == f.readline().rstrip('\n')
assert '' == f.readline().rstrip('\n')
# noinspection PyShadowingNames
def test_parse_playlist(playlist_current):
playlist_path = str(playlist_current)
files = list(M3uDump.parse_playlist(playlist_path))
assert files[2] == '/full/path/dummy001.mp3'
assert files[4] == '/full/path/dummy002.mp3'
assert files[6] == 'music/あいう えお.mp3'
assert files[8] == '/full/path/music/あいう えお.mp3'
assert len(files) == 13
# noinspection PyShadowingNames
def test_get_search_path_files(music_files):
search_path_files = M3uDump.get_search_path_files(str(music_files))
assert 'tmp/music0' in search_path_files['dummy001.mp3'][0]
assert 'tmp/music0/sub' in search_path_files['dummy002.mp3'][0]
assert 'tmp/music0/sub2/sub3' in search_path_files['あいう えお.mp3'][0]
assert 'tmp/music0/sub3/かきく けこ' in search_path_files['あいう えお.mp3'][0]
assert len(search_path_files.keys()) == 11
# noinspection PyShadowingNames
def test_fix_playlist(playlist_current, music_files):
playlist_path = str(playlist_current)
files = list(M3uDump.parse_playlist(playlist_path))
search_path_files = M3uDump.get_search_path_files(str(music_files))
p = M3uDump.fix_playlist(search_path_files, files)
assert 'tmp/music0/dummy001.mp3' in p[2]
assert 'tmp/music0/sub/dummy002.mp3' in p[4]
assert 'tmp/music0/sub2/sub3/あいう えお.mp3' in p[6]
assert 'tmp/music0/sub3/かきく けこ/あいう えお.mp3' in p[8]
assert len(p) == 11
# noinspection PyShadowingNames
def test_copy_music_dryrun(playlist_current, music_files, dump_music_path):
playlist_path = str(playlist_current)
files = list(M3uDump.parse_playlist(playlist_path))
search_path_files = M3uDump.get_search_path_files(str(music_files))
playlist = M3uDump.fix_playlist(search_path_files, files)
M3uDump.copy_music(playlist, dump_music_path, True)
assert os.path.exists(
os.path.join(dump_music_path, 'dummy001.mp3')) is False
assert os.path.exists(
os.path.join(dump_music_path, 'dummy002.mp3')) is False
assert os.path.exists(os.path.join(dump_music_path, 'あいう えお.mp3')) is False
assert os.path.exists(os.path.join(dump_music_path, 'あいう えお.mp3')) is False
# noinspection PyShadowingNames
def test_copy_music_nodryrun(playlist_current, music_files, dump_music_path):
playlist_path = str(playlist_current)
files = list(M3uDump.parse_playlist(playlist_path))
search_path_files = M3uDump.get_search_path_files(str(music_files))
playlist = M3uDump.fix_playlist(search_path_files, files)
M3uDump.copy_music(playlist, dump_music_path, False)
assert os.path.exists(os.path.join(dump_music_path, 'dummy001.mp3'))
assert os.path.exists(os.path.join(dump_music_path, 'dummy002.mp3'))
assert os.path.exists(os.path.join(dump_music_path, 'あいう えお.mp3'))
assert os.path.exists(os.path.join(dump_music_path, 'あいう えお.mp3'))
# noinspection PyShadowingNames
def test_copy_music_override(playlist_current, music_files, dump_music_path):
playlist_path = str(playlist_current)
files = list(M3uDump.parse_playlist(playlist_path))
search_path_files = M3uDump.get_search_path_files(str(music_files))
playlist = M3uDump.fix_playlist(search_path_files, files)
M3uDump.copy_music(playlist, dump_music_path, False)
M3uDump.copy_music(playlist, dump_music_path, False)
assert os.path.exists(os.path.join(dump_music_path, 'dummy001.mp3'))
assert os.path.exists(os.path.join(dump_music_path, 'dummy002.mp3'))
assert os.path.exists(os.path.join(dump_music_path, 'あいう えお.mp3'))
assert os.path.exists(os.path.join(dump_music_path, 'あいう えお.mp3'))
# noinspection PyShadowingNames
def test_load_from_playlist_path(playlist_dir, playlist_current2, playlist_current):
playlist_path = str(playlist_dir)
allowed_pattern = ['*.m3u', '*.m3u8']
path_list = M3uDump.load_from_playlist_path(playlist_path, allowed_pattern)
# os.walk は順序が分からない
assert 'playlist.m3u' in path_list[0]
assert 'playlist2.m3u8' in path_list[1]
assert len(path_list) == 2
| 39.830424
| 94
| 0.681818
| 2,255
| 15,972
| 4.665188
| 0.07051
| 0.048479
| 0.039924
| 0.062357
| 0.839164
| 0.80827
| 0.722529
| 0.689829
| 0.665875
| 0.620722
| 0
| 0.032081
| 0.168608
| 15,972
| 400
| 95
| 39.93
| 0.760148
| 0.046394
| 0
| 0.578595
| 0
| 0
| 0.21782
| 0.02369
| 0
| 0
| 0
| 0
| 0.391304
| 1
| 0.070234
| false
| 0
| 0.016722
| 0.006689
| 0.113712
| 0.013378
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
409ad892b54f662f9ef75840d97b7a5944b94210
| 61
|
py
|
Python
|
AtCoder/ABC/000-159/ABC155_A.py
|
sireline/PyCode
|
8578467710c3c1faa89499f5d732507f5d9a584c
|
[
"MIT"
] | null | null | null |
AtCoder/ABC/000-159/ABC155_A.py
|
sireline/PyCode
|
8578467710c3c1faa89499f5d732507f5d9a584c
|
[
"MIT"
] | null | null | null |
AtCoder/ABC/000-159/ABC155_A.py
|
sireline/PyCode
|
8578467710c3c1faa89499f5d732507f5d9a584c
|
[
"MIT"
] | null | null | null |
print('No' if len(set(input().split())) in [1,3] else 'Yes')
| 30.5
| 60
| 0.590164
| 12
| 61
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.037037
| 0.114754
| 61
| 1
| 61
| 61
| 0.62963
| 0
| 0
| 0
| 0
| 0
| 0.081967
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
40bfac5da45c8bf5f8701adddf78534cf2973036
| 134
|
py
|
Python
|
src/screwdrivercd/screwdriver/templates/__init__.py
|
boborot/python-screwdrivercd
|
c4f1165741c8af7a47c126ee4abc5504c350a77f
|
[
"Apache-2.0"
] | 6
|
2019-12-31T21:49:07.000Z
|
2021-06-22T21:50:32.000Z
|
src/screwdrivercd/screwdriver/templates/__init__.py
|
boborot/python-screwdrivercd
|
c4f1165741c8af7a47c126ee4abc5504c350a77f
|
[
"Apache-2.0"
] | 24
|
2019-11-19T00:35:14.000Z
|
2021-03-27T16:55:37.000Z
|
src/screwdrivercd/screwdriver/templates/__init__.py
|
boborot/python-screwdrivercd
|
c4f1165741c8af7a47c126ee4abc5504c350a77f
|
[
"Apache-2.0"
] | 10
|
2019-12-09T19:14:54.000Z
|
2021-10-03T06:17:52.000Z
|
# Copyright 2019, Oath Inc.
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
| 44.666667
| 105
| 0.761194
| 24
| 134
| 4.25
| 0.791667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0.19403
| 134
| 2
| 106
| 67
| 0.888889
| 0.962687
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
40c4c9de90fca80240c7e19d6e6bc48e679fac34
| 303
|
py
|
Python
|
bagua/torch_api/contrib/__init__.py
|
Youhe-Jiang/bagua
|
b404eda6574b48e0642b9a3160f1cc49c3f91737
|
[
"MIT"
] | null | null | null |
bagua/torch_api/contrib/__init__.py
|
Youhe-Jiang/bagua
|
b404eda6574b48e0642b9a3160f1cc49c3f91737
|
[
"MIT"
] | null | null | null |
bagua/torch_api/contrib/__init__.py
|
Youhe-Jiang/bagua
|
b404eda6574b48e0642b9a3160f1cc49c3f91737
|
[
"MIT"
] | null | null | null |
from .fused_optimizer import FusedOptimizer # noqa: F401
from .load_balancing_data_loader import ( # noqa: F401
LoadBalancingDistributedSampler,
LoadBalancingDistributedBatchSampler,
)
from .cache_loader import CacheLoader # noqa: F401
from .cached_dataset import CachedDataset # noqa: F401
| 37.875
| 57
| 0.805281
| 31
| 303
| 7.677419
| 0.580645
| 0.134454
| 0.10084
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.046154
| 0.141914
| 303
| 7
| 58
| 43.285714
| 0.869231
| 0.141914
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.571429
| 0
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
40c57c2d2f688b27bc3a73523fd01b6c5f8c04ec
| 244
|
py
|
Python
|
models/models.py
|
kashifpk/pyckapps.file_manager
|
2d7b7105133efb91935af41821ad0cccc1826961
|
[
"Apache-2.0"
] | null | null | null |
models/models.py
|
kashifpk/pyckapps.file_manager
|
2d7b7105133efb91935af41821ad0cccc1826961
|
[
"Apache-2.0"
] | null | null | null |
models/models.py
|
kashifpk/pyckapps.file_manager
|
2d7b7105133efb91935af41821ad0cccc1826961
|
[
"Apache-2.0"
] | null | null | null |
from sqlalchemy import Column, Unicode
from . import db, Base
class Place(Base):
__tablename__ = 'places'
path = Column(Unicode(1000), primary_key=True)
name = Column(Unicode(100), unique=True)
description = Column(Unicode(1000))
| 24.4
| 49
| 0.721311
| 31
| 244
| 5.516129
| 0.645161
| 0.304094
| 0.19883
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.053922
| 0.163934
| 244
| 9
| 50
| 27.111111
| 0.784314
| 0
| 0
| 0
| 0
| 0
| 0.02459
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.285714
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
40c89078b0fd4bcca4fe39acf06dbdc315d11f2b
| 67
|
py
|
Python
|
ptsr/config/__init__.py
|
prateek-77/rcan-it
|
587904556d8127bca83690deaaa26e34e051a576
|
[
"MIT"
] | 57
|
2022-01-28T04:44:42.000Z
|
2022-03-31T13:26:35.000Z
|
ptsr/config/__init__.py
|
chisyliu/rcan-it
|
eb1794777ffef4eadd8a6a06f4419380a0b17435
|
[
"MIT"
] | 6
|
2022-02-08T11:17:19.000Z
|
2022-03-27T07:40:18.000Z
|
ptsr/config/__init__.py
|
chisyliu/rcan-it
|
eb1794777ffef4eadd8a6a06f4419380a0b17435
|
[
"MIT"
] | 10
|
2022-01-28T07:31:12.000Z
|
2022-03-15T01:35:03.000Z
|
from .defaults import get_cfg_defaults
from .utils import load_cfg
| 33.5
| 39
| 0.850746
| 11
| 67
| 4.909091
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119403
| 67
| 2
| 40
| 33.5
| 0.915254
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
40ccf972a567c3de145b1e44cc26f79e0706fc6d
| 67
|
py
|
Python
|
challenge16.py
|
ritobanrc/project-euler
|
56fd42204299636a98e48d3ab4d524aa54748ba4
|
[
"MIT"
] | null | null | null |
challenge16.py
|
ritobanrc/project-euler
|
56fd42204299636a98e48d3ab4d524aa54748ba4
|
[
"MIT"
] | null | null | null |
challenge16.py
|
ritobanrc/project-euler
|
56fd42204299636a98e48d3ab4d524aa54748ba4
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
print(sum([int(d) for d in str(2**1000)]))
| 16.75
| 42
| 0.626866
| 14
| 67
| 3
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101695
| 0.119403
| 67
| 3
| 43
| 22.333333
| 0.610169
| 0.313433
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
904bdb3aa5caa560afb723f57fecb8c3d9c77ebd
| 77
|
py
|
Python
|
asap_essay_scoring/conf.py
|
zkurtz/ASAP-AES-workbench
|
77842592d3c5f99db78c01486778d1c6f431cce3
|
[
"MIT"
] | 2
|
2019-12-16T07:11:12.000Z
|
2021-07-13T22:23:38.000Z
|
asap_essay_scoring/conf.py
|
zkurtz/ASAP-AES-workbench
|
77842592d3c5f99db78c01486778d1c6f431cce3
|
[
"MIT"
] | null | null | null |
asap_essay_scoring/conf.py
|
zkurtz/ASAP-AES-workbench
|
77842592d3c5f99db78c01486778d1c6f431cce3
|
[
"MIT"
] | 3
|
2019-02-17T04:31:40.000Z
|
2019-11-22T14:52:29.000Z
|
import os
DATA_PATH = os.path.expanduser('~/.kaggle/competitions/asap-aes')
| 19.25
| 65
| 0.753247
| 11
| 77
| 5.181818
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.077922
| 77
| 4
| 65
| 19.25
| 0.802817
| 0
| 0
| 0
| 0
| 0
| 0.402597
| 0.402597
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
905da7814fb141239bba1210d487a0c75ff90817
| 4,916
|
py
|
Python
|
models/counters/SANet.py
|
MagazzuGaetano/Crowd-Counting-DEMO
|
a765072d2ce924a8ef756941f10e1013fc8a9f71
|
[
"MIT"
] | 1
|
2022-03-25T14:47:56.000Z
|
2022-03-25T14:47:56.000Z
|
models/counters/SANet.py
|
MagazzuGaetano/Crowd-Counting-DEMO
|
a765072d2ce924a8ef756941f10e1013fc8a9f71
|
[
"MIT"
] | null | null | null |
models/counters/SANet.py
|
MagazzuGaetano/Crowd-Counting-DEMO
|
a765072d2ce924a8ef756941f10e1013fc8a9f71
|
[
"MIT"
] | null | null | null |
import torch
import torch.nn as nn
import torch.nn.functional as F
from misc.utils import initialize_weights
class BasicConv(nn.Module):
def __init__(self, in_channels, out_channels, use_bn=False, **kwargs):
super(BasicConv, self).__init__()
self.use_bn = use_bn
self.conv = nn.Conv2d(in_channels, out_channels, bias=not self.use_bn, **kwargs)
self.bn = nn.InstanceNorm2d(out_channels, affine=True) if self.use_bn else None
def forward(self, x):
x = self.conv(x)
if self.use_bn:
x = self.bn(x)
return F.relu(x, inplace=True)
class BasicDeconv(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, use_bn=False):
super(BasicDeconv, self).__init__()
self.use_bn = use_bn
self.tconv = nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=stride, bias=not self.use_bn)
self.bn = nn.InstanceNorm2d(out_channels, affine=True) if self.use_bn else None
def forward(self, x):
# pdb.set_trace()
x = self.tconv(x)
if self.use_bn:
x = self.bn(x)
return F.relu(x, inplace=True)
class SAModule_Head(nn.Module):
def __init__(self, in_channels, out_channels, use_bn):
super(SAModule_Head, self).__init__()
branch_out = out_channels // 4
self.branch1x1 = BasicConv(in_channels, branch_out, use_bn=use_bn,
kernel_size=1)
self.branch3x3 = BasicConv(in_channels, branch_out, use_bn=use_bn,
kernel_size=3, padding=1)
self.branch5x5 = BasicConv(in_channels, branch_out, use_bn=use_bn,
kernel_size=5, padding=2)
self.branch7x7 = BasicConv(in_channels, branch_out, use_bn=use_bn,
kernel_size=7, padding=3)
def forward(self, x):
branch1x1 = self.branch1x1(x)
branch3x3 = self.branch3x3(x)
branch5x5 = self.branch5x5(x)
branch7x7 = self.branch7x7(x)
out = torch.cat([branch1x1, branch3x3, branch5x5, branch7x7], 1)
return out
class SAModule(nn.Module):
def __init__(self, in_channels, out_channels, use_bn):
super(SAModule, self).__init__()
branch_out = out_channels // 4
self.branch1x1 = BasicConv(in_channels, branch_out, use_bn=use_bn,
kernel_size=1)
self.branch3x3 = nn.Sequential(
BasicConv(in_channels, 2*branch_out, use_bn=use_bn,
kernel_size=1),
BasicConv(2*branch_out, branch_out, use_bn=use_bn,
kernel_size=3, padding=1),
)
self.branch5x5 = nn.Sequential(
BasicConv(in_channels, 2*branch_out, use_bn=use_bn,
kernel_size=1),
BasicConv(2*branch_out, branch_out, use_bn=use_bn,
kernel_size=5, padding=2),
)
self.branch7x7 = nn.Sequential(
BasicConv(in_channels, 2*branch_out, use_bn=use_bn,
kernel_size=1),
BasicConv(2*branch_out, branch_out, use_bn=use_bn,
kernel_size=7, padding=3),
)
def forward(self, x):
branch1x1 = self.branch1x1(x)
branch3x3 = self.branch3x3(x)
branch5x5 = self.branch5x5(x)
branch7x7 = self.branch7x7(x)
out = torch.cat([branch1x1, branch3x3, branch5x5, branch7x7], 1)
return out
class SANet(nn.Module):
def __init__(self, gray_input=False, use_bn=True):
super(SANet, self).__init__()
if gray_input:
in_channels = 1
else:
in_channels = 3
self.encoder = nn.Sequential(
SAModule_Head(in_channels, 64, use_bn),
nn.MaxPool2d(2, 2),
SAModule(64, 128, use_bn),
nn.MaxPool2d(2, 2),
SAModule(128, 128, use_bn),
nn.MaxPool2d(2, 2),
SAModule(128, 128, use_bn),
)
self.decoder = nn.Sequential(
BasicConv(128, 64, use_bn=use_bn, kernel_size=9, padding=4),
BasicDeconv(64, 64, 2, stride=2, use_bn=use_bn),
BasicConv(64, 32, use_bn=use_bn, kernel_size=7, padding=3),
BasicDeconv(32, 32, 2, stride=2, use_bn=use_bn),
BasicConv(32, 16, use_bn=use_bn, kernel_size=5, padding=2),
BasicDeconv(16, 16, 2, stride=2, use_bn=use_bn),
BasicConv(16, 16, use_bn=use_bn, kernel_size=3, padding=1),
BasicConv(16, 1, use_bn=False, kernel_size=1),
)
initialize_weights(self.modules())
def forward(self, x):
features = self.encoder(x)
out = self.decoder(features)
return out
| 39.328
| 116
| 0.576485
| 628
| 4,916
| 4.25
| 0.124204
| 0.104908
| 0.059948
| 0.074934
| 0.757962
| 0.738854
| 0.73136
| 0.700262
| 0.650431
| 0.602848
| 0
| 0.051704
| 0.319365
| 4,916
| 125
| 117
| 39.328
| 0.745965
| 0.003051
| 0
| 0.46729
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.093458
| false
| 0
| 0.037383
| 0
| 0.224299
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
908122862c215e50bc7263f4816ba0b32fb42bb6
| 11,949
|
py
|
Python
|
ibis_substrait/proto/substrait/function_pb2.py
|
gforsyth/ibis-substrait
|
7eaf31201767011ce727cdf69f7afbc73627ce6e
|
[
"Apache-2.0"
] | 14
|
2022-01-19T00:20:51.000Z
|
2022-03-18T10:29:26.000Z
|
ibis_substrait/proto/substrait/function_pb2.py
|
gforsyth/ibis-substrait
|
7eaf31201767011ce727cdf69f7afbc73627ce6e
|
[
"Apache-2.0"
] | 82
|
2022-01-18T23:42:07.000Z
|
2022-03-30T18:30:23.000Z
|
ibis_substrait/proto/substrait/function_pb2.py
|
gforsyth/ibis-substrait
|
7eaf31201767011ce727cdf69f7afbc73627ce6e
|
[
"Apache-2.0"
] | 3
|
2022-01-19T00:04:19.000Z
|
2022-03-14T15:34:38.000Z
|
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from ..substrait import type_pb2 as substrait_dot_type__pb2
from ..substrait import parameterized_types_pb2 as substrait_dot_parameterized__types__pb2
from ..substrait import type_expressions_pb2 as substrait_dot_type__expressions__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18substrait/function.proto\x12\tsubstrait\x1a\x14substrait/type.proto\x1a#substrait/parameterized_types.proto\x1a substrait/type_expressions.proto"\xd9\x19\n\x11FunctionSignature\x1a\xbc\x02\n\x10FinalArgVariadic\x12\x19\n\x08min_args\x18\x01 \x01(\x03R\x07minArgs\x12\x19\n\x08max_args\x18\x02 \x01(\x03R\x07maxArgs\x12d\n\x0bconsistency\x18\x03 \x01(\x0e2B.substrait.FunctionSignature.FinalArgVariadic.ParameterConsistencyR\x0bconsistency"\x8b\x01\n\x14ParameterConsistency\x12%\n!PARAMETER_CONSISTENCY_UNSPECIFIED\x10\x00\x12$\n PARAMETER_CONSISTENCY_CONSISTENT\x10\x01\x12&\n"PARAMETER_CONSISTENCY_INCONSISTENT\x10\x02\x1a\x10\n\x0eFinalArgNormal\x1a\xc8\x04\n\x06Scalar\x12C\n\targuments\x18\x02 \x03(\x0b2%.substrait.FunctionSignature.ArgumentR\targuments\x12\x12\n\x04name\x18\x03 \x03(\tR\x04name\x12J\n\x0bdescription\x18\x04 \x01(\x0b2(.substrait.FunctionSignature.DescriptionR\x0bdescription\x12$\n\rdeterministic\x18\x07 \x01(\x08R\rdeterministic\x12+\n\x11session_dependent\x18\x08 \x01(\x08R\x10sessionDependent\x12@\n\x0boutput_type\x18\t \x01(\x0b2\x1f.substrait.DerivationExpressionR\noutputType\x12K\n\x08variadic\x18\n \x01(\x0b2-.substrait.FunctionSignature.FinalArgVariadicH\x00R\x08variadic\x12E\n\x06normal\x18\x0b \x01(\x0b2+.substrait.FunctionSignature.FinalArgNormalH\x00R\x06normal\x12U\n\x0fimplementations\x18\x0c \x03(\x0b2+.substrait.FunctionSignature.ImplementationR\x0fimplementationsB\x19\n\x17final_variable_behavior\x1a\xbc\x05\n\tAggregate\x12C\n\targuments\x18\x02 \x03(\x0b2%.substrait.FunctionSignature.ArgumentR\targuments\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12J\n\x0bdescription\x18\x04 \x01(\x0b2(.substrait.FunctionSignature.DescriptionR\x0bdescription\x12$\n\rdeterministic\x18\x07 \x01(\x08R\rdeterministic\x12+\n\x11session_dependent\x18\x08 \x01(\x08R\x10sessionDependent\x12@\n\x0boutput_type\x18\t \x01(\x0b2\x1f.substrait.DerivationExpressionR\noutputType\x12K\n\x08variadic\x18\n \x01(\x0b2-.substrait.FunctionSignature.FinalArgVariadicH\x00R\x08variadic\x12E\n\x06normal\x18\x0b \x01(\x0b2+.substrait.FunctionSignature.FinalArgNormalH\x00R\x06normal\x12\x18\n\x07ordered\x18\x0e \x01(\x08R\x07ordered\x12\x17\n\x07max_set\x18\x0c \x01(\x04R\x06maxSet\x12<\n\x11intermediate_type\x18\r \x01(\x0b2\x0f.substrait.TypeR\x10intermediateType\x12U\n\x0fimplementations\x18\x0f \x03(\x0b2+.substrait.FunctionSignature.ImplementationR\x0fimplementationsB\x19\n\x17final_variable_behavior\x1a\xfb\x06\n\x06Window\x12C\n\targuments\x18\x02 \x03(\x0b2%.substrait.FunctionSignature.ArgumentR\targuments\x12\x12\n\x04name\x18\x03 \x03(\tR\x04name\x12J\n\x0bdescription\x18\x04 \x01(\x0b2(.substrait.FunctionSignature.DescriptionR\x0bdescription\x12$\n\rdeterministic\x18\x07 \x01(\x08R\rdeterministic\x12+\n\x11session_dependent\x18\x08 \x01(\x08R\x10sessionDependent\x12L\n\x11intermediate_type\x18\t \x01(\x0b2\x1f.substrait.DerivationExpressionR\x10intermediateType\x12@\n\x0boutput_type\x18\n \x01(\x0b2\x1f.substrait.DerivationExpressionR\noutputType\x12K\n\x08variadic\x18\x10 \x01(\x0b2-.substrait.FunctionSignature.FinalArgVariadicH\x00R\x08variadic\x12E\n\x06normal\x18\x11 \x01(\x0b2+.substrait.FunctionSignature.FinalArgNormalH\x00R\x06normal\x12\x18\n\x07ordered\x18\x0b \x01(\x08R\x07ordered\x12\x17\n\x07max_set\x18\x0c \x01(\x04R\x06maxSet\x12O\n\x0bwindow_type\x18\x0e \x01(\x0e2..substrait.FunctionSignature.Window.WindowTypeR\nwindowType\x12U\n\x0fimplementations\x18\x0f \x03(\x0b2+.substrait.FunctionSignature.ImplementationR\x0fimplementations"_\n\nWindowType\x12\x1b\n\x17WINDOW_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15WINDOW_TYPE_STREAMING\x10\x01\x12\x19\n\x15WINDOW_TYPE_PARTITION\x10\x02B\x19\n\x17final_variable_behavior\x1a=\n\x0bDescription\x12\x1a\n\x08language\x18\x01 \x01(\tR\x08language\x12\x12\n\x04body\x18\x02 \x01(\tR\x04body\x1a\xb1\x01\n\x0eImplementation\x12D\n\x04type\x18\x01 \x01(\x0e20.substrait.FunctionSignature.Implementation.TypeR\x04type\x12\x10\n\x03uri\x18\x02 \x01(\tR\x03uri"G\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11TYPE_WEB_ASSEMBLY\x10\x01\x12\x12\n\x0eTYPE_TRINO_JAR\x10\x02\x1a\xf7\x03\n\x08Argument\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12K\n\x05value\x18\x02 \x01(\x0b23.substrait.FunctionSignature.Argument.ValueArgumentH\x00R\x05value\x12H\n\x04type\x18\x03 \x01(\x0b22.substrait.FunctionSignature.Argument.TypeArgumentH\x00R\x04type\x12H\n\x04enum\x18\x04 \x01(\x0b22.substrait.FunctionSignature.Argument.EnumArgumentH\x00R\x04enum\x1a]\n\rValueArgument\x120\n\x04type\x18\x01 \x01(\x0b2\x1c.substrait.ParameterizedTypeR\x04type\x12\x1a\n\x08constant\x18\x02 \x01(\x08R\x08constant\x1a@\n\x0cTypeArgument\x120\n\x04type\x18\x01 \x01(\x0b2\x1c.substrait.ParameterizedTypeR\x04type\x1aD\n\x0cEnumArgument\x12\x18\n\x07options\x18\x01 \x03(\tR\x07options\x12\x1a\n\x08optional\x18\x02 \x01(\x08R\x08optionalB\x0f\n\rargument_kindB+\n\x12io.substrait.protoP\x01\xaa\x02\x12Substrait.Protobufb\x06proto3')
_FUNCTIONSIGNATURE = DESCRIPTOR.message_types_by_name['FunctionSignature']
_FUNCTIONSIGNATURE_FINALARGVARIADIC = _FUNCTIONSIGNATURE.nested_types_by_name['FinalArgVariadic']
_FUNCTIONSIGNATURE_FINALARGNORMAL = _FUNCTIONSIGNATURE.nested_types_by_name['FinalArgNormal']
_FUNCTIONSIGNATURE_SCALAR = _FUNCTIONSIGNATURE.nested_types_by_name['Scalar']
_FUNCTIONSIGNATURE_AGGREGATE = _FUNCTIONSIGNATURE.nested_types_by_name['Aggregate']
_FUNCTIONSIGNATURE_WINDOW = _FUNCTIONSIGNATURE.nested_types_by_name['Window']
_FUNCTIONSIGNATURE_DESCRIPTION = _FUNCTIONSIGNATURE.nested_types_by_name['Description']
_FUNCTIONSIGNATURE_IMPLEMENTATION = _FUNCTIONSIGNATURE.nested_types_by_name['Implementation']
_FUNCTIONSIGNATURE_ARGUMENT = _FUNCTIONSIGNATURE.nested_types_by_name['Argument']
_FUNCTIONSIGNATURE_ARGUMENT_VALUEARGUMENT = _FUNCTIONSIGNATURE_ARGUMENT.nested_types_by_name['ValueArgument']
_FUNCTIONSIGNATURE_ARGUMENT_TYPEARGUMENT = _FUNCTIONSIGNATURE_ARGUMENT.nested_types_by_name['TypeArgument']
_FUNCTIONSIGNATURE_ARGUMENT_ENUMARGUMENT = _FUNCTIONSIGNATURE_ARGUMENT.nested_types_by_name['EnumArgument']
_FUNCTIONSIGNATURE_FINALARGVARIADIC_PARAMETERCONSISTENCY = _FUNCTIONSIGNATURE_FINALARGVARIADIC.enum_types_by_name['ParameterConsistency']
_FUNCTIONSIGNATURE_WINDOW_WINDOWTYPE = _FUNCTIONSIGNATURE_WINDOW.enum_types_by_name['WindowType']
_FUNCTIONSIGNATURE_IMPLEMENTATION_TYPE = _FUNCTIONSIGNATURE_IMPLEMENTATION.enum_types_by_name['Type']
FunctionSignature = _reflection.GeneratedProtocolMessageType('FunctionSignature', (_message.Message,), {'FinalArgVariadic': _reflection.GeneratedProtocolMessageType('FinalArgVariadic', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_FINALARGVARIADIC, '__module__': 'substrait.function_pb2'}), 'FinalArgNormal': _reflection.GeneratedProtocolMessageType('FinalArgNormal', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_FINALARGNORMAL, '__module__': 'substrait.function_pb2'}), 'Scalar': _reflection.GeneratedProtocolMessageType('Scalar', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_SCALAR, '__module__': 'substrait.function_pb2'}), 'Aggregate': _reflection.GeneratedProtocolMessageType('Aggregate', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_AGGREGATE, '__module__': 'substrait.function_pb2'}), 'Window': _reflection.GeneratedProtocolMessageType('Window', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_WINDOW, '__module__': 'substrait.function_pb2'}), 'Description': _reflection.GeneratedProtocolMessageType('Description', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_DESCRIPTION, '__module__': 'substrait.function_pb2'}), 'Implementation': _reflection.GeneratedProtocolMessageType('Implementation', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_IMPLEMENTATION, '__module__': 'substrait.function_pb2'}), 'Argument': _reflection.GeneratedProtocolMessageType('Argument', (_message.Message,), {'ValueArgument': _reflection.GeneratedProtocolMessageType('ValueArgument', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_ARGUMENT_VALUEARGUMENT, '__module__': 'substrait.function_pb2'}), 'TypeArgument': _reflection.GeneratedProtocolMessageType('TypeArgument', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_ARGUMENT_TYPEARGUMENT, '__module__': 'substrait.function_pb2'}), 'EnumArgument': _reflection.GeneratedProtocolMessageType('EnumArgument', (_message.Message,), {'DESCRIPTOR': _FUNCTIONSIGNATURE_ARGUMENT_ENUMARGUMENT, '__module__': 'substrait.function_pb2'}), 'DESCRIPTOR': _FUNCTIONSIGNATURE_ARGUMENT, '__module__': 'substrait.function_pb2'}), 'DESCRIPTOR': _FUNCTIONSIGNATURE, '__module__': 'substrait.function_pb2'})
_sym_db.RegisterMessage(FunctionSignature)
_sym_db.RegisterMessage(FunctionSignature.FinalArgVariadic)
_sym_db.RegisterMessage(FunctionSignature.FinalArgNormal)
_sym_db.RegisterMessage(FunctionSignature.Scalar)
_sym_db.RegisterMessage(FunctionSignature.Aggregate)
_sym_db.RegisterMessage(FunctionSignature.Window)
_sym_db.RegisterMessage(FunctionSignature.Description)
_sym_db.RegisterMessage(FunctionSignature.Implementation)
_sym_db.RegisterMessage(FunctionSignature.Argument)
_sym_db.RegisterMessage(FunctionSignature.Argument.ValueArgument)
_sym_db.RegisterMessage(FunctionSignature.Argument.TypeArgument)
_sym_db.RegisterMessage(FunctionSignature.Argument.EnumArgument)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\x12io.substrait.protoP\x01\xaa\x02\x12Substrait.Protobuf'
_FUNCTIONSIGNATURE._serialized_start = 133
_FUNCTIONSIGNATURE._serialized_end = 3422
_FUNCTIONSIGNATURE_FINALARGVARIADIC._serialized_start = 155
_FUNCTIONSIGNATURE_FINALARGVARIADIC._serialized_end = 471
_FUNCTIONSIGNATURE_FINALARGVARIADIC_PARAMETERCONSISTENCY._serialized_start = 332
_FUNCTIONSIGNATURE_FINALARGVARIADIC_PARAMETERCONSISTENCY._serialized_end = 471
_FUNCTIONSIGNATURE_FINALARGNORMAL._serialized_start = 473
_FUNCTIONSIGNATURE_FINALARGNORMAL._serialized_end = 489
_FUNCTIONSIGNATURE_SCALAR._serialized_start = 492
_FUNCTIONSIGNATURE_SCALAR._serialized_end = 1076
_FUNCTIONSIGNATURE_AGGREGATE._serialized_start = 1079
_FUNCTIONSIGNATURE_AGGREGATE._serialized_end = 1779
_FUNCTIONSIGNATURE_WINDOW._serialized_start = 1782
_FUNCTIONSIGNATURE_WINDOW._serialized_end = 2673
_FUNCTIONSIGNATURE_WINDOW_WINDOWTYPE._serialized_start = 2551
_FUNCTIONSIGNATURE_WINDOW_WINDOWTYPE._serialized_end = 2646
_FUNCTIONSIGNATURE_DESCRIPTION._serialized_start = 2675
_FUNCTIONSIGNATURE_DESCRIPTION._serialized_end = 2736
_FUNCTIONSIGNATURE_IMPLEMENTATION._serialized_start = 2739
_FUNCTIONSIGNATURE_IMPLEMENTATION._serialized_end = 2916
_FUNCTIONSIGNATURE_IMPLEMENTATION_TYPE._serialized_start = 2845
_FUNCTIONSIGNATURE_IMPLEMENTATION_TYPE._serialized_end = 2916
_FUNCTIONSIGNATURE_ARGUMENT._serialized_start = 2919
_FUNCTIONSIGNATURE_ARGUMENT._serialized_end = 3422
_FUNCTIONSIGNATURE_ARGUMENT_VALUEARGUMENT._serialized_start = 3176
_FUNCTIONSIGNATURE_ARGUMENT_VALUEARGUMENT._serialized_end = 3269
_FUNCTIONSIGNATURE_ARGUMENT_TYPEARGUMENT._serialized_start = 3271
_FUNCTIONSIGNATURE_ARGUMENT_TYPEARGUMENT._serialized_end = 3335
_FUNCTIONSIGNATURE_ARGUMENT_ENUMARGUMENT._serialized_start = 3337
_FUNCTIONSIGNATURE_ARGUMENT_ENUMARGUMENT._serialized_end = 3405
| 165.958333
| 5,000
| 0.849443
| 1,325
| 11,949
| 7.323019
| 0.179623
| 0.06699
| 0.046377
| 0.032155
| 0.351541
| 0.260126
| 0.233021
| 0.233021
| 0.219417
| 0.219417
| 0
| 0.084568
| 0.040087
| 11,949
| 72
| 5,001
| 165.958333
| 0.761378
| 0.002594
| 0
| 0
| 1
| 0.014085
| 0.497943
| 0.437253
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.112676
| 0
| 0.112676
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
90a6945a83bbeb1687b3c5c1358185a9d5846da1
| 116
|
py
|
Python
|
geometry/polar_point/base.py
|
markupCode/computational-geometry
|
9a0a63a0b0c86e0618c18f82283b41baded21c50
|
[
"MIT"
] | null | null | null |
geometry/polar_point/base.py
|
markupCode/computational-geometry
|
9a0a63a0b0c86e0618c18f82283b41baded21c50
|
[
"MIT"
] | null | null | null |
geometry/polar_point/base.py
|
markupCode/computational-geometry
|
9a0a63a0b0c86e0618c18f82283b41baded21c50
|
[
"MIT"
] | null | null | null |
class PolarPoint():
def __init__(self, angle, radius):
self.angle = angle
self.radius = radius
| 19.333333
| 38
| 0.612069
| 13
| 116
| 5.153846
| 0.538462
| 0.268657
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.284483
| 116
| 5
| 39
| 23.2
| 0.807229
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
290a9fdb3a242adb86cc82372bc6461f0b689ed5
| 100
|
py
|
Python
|
python/y2020/d14/__main__.py
|
luke-dixon/aoc
|
94851a5866a1ef29e3ba10098160cba883882683
|
[
"MIT"
] | 1
|
2021-01-12T20:04:01.000Z
|
2021-01-12T20:04:01.000Z
|
python/y2020/d14/__main__.py
|
luke-dixon/aoc
|
94851a5866a1ef29e3ba10098160cba883882683
|
[
"MIT"
] | null | null | null |
python/y2020/d14/__main__.py
|
luke-dixon/aoc
|
94851a5866a1ef29e3ba10098160cba883882683
|
[
"MIT"
] | null | null | null |
import sys
from .day14 import Day14
if __name__ == '__main__':
Day14(args=sys.argv[1:]).run()
| 14.285714
| 34
| 0.67
| 15
| 100
| 3.933333
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.084337
| 0.17
| 100
| 6
| 35
| 16.666667
| 0.626506
| 0
| 0
| 0
| 0
| 0
| 0.08
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
290b5634c64e1aaac95702f8338b8a495beb453e
| 374
|
py
|
Python
|
django_socketio_chat/admin.py
|
leukeleu/django-socketio-chat
|
8bdebfe6591202b9e13144afbea40e93189082d0
|
[
"Apache-2.0"
] | 6
|
2016-10-29T13:31:53.000Z
|
2021-04-21T04:42:47.000Z
|
django_socketio_chat/admin.py
|
leukeleu/django-socketio-chat
|
8bdebfe6591202b9e13144afbea40e93189082d0
|
[
"Apache-2.0"
] | null | null | null |
django_socketio_chat/admin.py
|
leukeleu/django-socketio-chat
|
8bdebfe6591202b9e13144afbea40e93189082d0
|
[
"Apache-2.0"
] | 7
|
2015-04-09T22:34:09.000Z
|
2022-03-17T20:06:14.000Z
|
from django.contrib import admin
from .models import Chat, UserChatStatus, Message
class ChatAdmin(admin.ModelAdmin):
pass
class UserChatStatusAdmin(admin.ModelAdmin):
pass
class MessageAdmin(admin.ModelAdmin):
pass
admin.site.register(Chat, ChatAdmin)
admin.site.register(UserChatStatus, UserChatStatusAdmin)
admin.site.register(Message, MessageAdmin)
| 17.809524
| 56
| 0.794118
| 41
| 374
| 7.243902
| 0.414634
| 0.151515
| 0.191919
| 0.161616
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122995
| 374
| 20
| 57
| 18.7
| 0.905488
| 0
| 0
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.272727
| 0.181818
| 0
| 0.454545
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
29162de07be391441baba79f55a715b9d6c4c3ce
| 158
|
py
|
Python
|
flaskrestful/FlaskProject/App/models/UserModel.py
|
riverstation/project-all
|
c56f1879e1303d561e95a3ff3a70f94fb5fa2191
|
[
"Apache-2.0"
] | null | null | null |
flaskrestful/FlaskProject/App/models/UserModel.py
|
riverstation/project-all
|
c56f1879e1303d561e95a3ff3a70f94fb5fa2191
|
[
"Apache-2.0"
] | null | null | null |
flaskrestful/FlaskProject/App/models/UserModel.py
|
riverstation/project-all
|
c56f1879e1303d561e95a3ff3a70f94fb5fa2191
|
[
"Apache-2.0"
] | null | null | null |
from App.ext import db
class User(db.Model):
u_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
u_name = db.Column(db.String(16))
| 17.555556
| 70
| 0.702532
| 27
| 158
| 4
| 0.703704
| 0.148148
| 0.185185
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015152
| 0.164557
| 158
| 8
| 71
| 19.75
| 0.80303
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.