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
c3e8d51a9ea9cb211fa01d9a7ab8537283bdcdaf
40
py
Python
src/parascopy/inner/errors.py
tprodanov/parascopy
fb3b201334c20761389ff3a9876e15c5e97dd724
[ "MIT" ]
null
null
null
src/parascopy/inner/errors.py
tprodanov/parascopy
fb3b201334c20761389ff3a9876e15c5e97dd724
[ "MIT" ]
null
null
null
src/parascopy/inner/errors.py
tprodanov/parascopy
fb3b201334c20761389ff3a9876e15c5e97dd724
[ "MIT" ]
2
2021-09-10T21:34:51.000Z
2021-10-06T15:57:19.000Z
class EmptyResult(Exception): pass
10
29
0.725
4
40
7.25
1
0
0
0
0
0
0
0
0
0
0
0
0.2
40
3
30
13.333333
0.90625
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
7f0af318cd2950a09fe852f3b55bb9138652ec9e
255
py
Python
adventure/admin.py
ttw4-mud/server
bb49b89669a2b54e3ae449c382a20d75401b17ee
[ "MIT" ]
null
null
null
adventure/admin.py
ttw4-mud/server
bb49b89669a2b54e3ae449c382a20d75401b17ee
[ "MIT" ]
6
2020-04-29T05:52:35.000Z
2021-09-22T19:00:46.000Z
adventure/admin.py
Sara-DLC/mud-server
11d1ea5dc8aab69ac64a6e0572f918a58a076894
[ "MIT" ]
null
null
null
############################################################ from django.contrib import admin from adventure.models import Tile, Player ############################################################ admin.site.register(Tile) admin.site.register(Player)
23.181818
60
0.419608
19
255
5.631579
0.578947
0.168224
0.317757
0
0
0
0
0
0
0
0
0
0.066667
255
10
61
25.5
0.44958
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
6175afc66a03b98dc878e2a9714ed605800b1604
21
py
Python
new2.py
whirlwind88/BelHard_52
7a0c7c008e8cee5a6b495eed43ea767362666aca
[ "MIT" ]
null
null
null
new2.py
whirlwind88/BelHard_52
7a0c7c008e8cee5a6b495eed43ea767362666aca
[ "MIT" ]
null
null
null
new2.py
whirlwind88/BelHard_52
7a0c7c008e8cee5a6b495eed43ea767362666aca
[ "MIT" ]
null
null
null
print('2st message')
10.5
20
0.714286
3
21
5
1
0
0
0
0
0
0
0
0
0
0
0.052632
0.095238
21
1
21
21
0.736842
0
0
0
0
0
0.52381
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
6186faa6ffbf680216fee97689b423f200fc28f8
190
py
Python
cct/core2/instrument/components/calibrants/__init__.py
awacha/cct
be1adbed2533df15c778051f3f4f9da0749c873a
[ "BSD-3-Clause" ]
1
2015-11-04T16:37:39.000Z
2015-11-04T16:37:39.000Z
cct/core2/instrument/components/calibrants/__init__.py
awacha/cct
be1adbed2533df15c778051f3f4f9da0749c873a
[ "BSD-3-Clause" ]
null
null
null
cct/core2/instrument/components/calibrants/__init__.py
awacha/cct
be1adbed2533df15c778051f3f4f9da0749c873a
[ "BSD-3-Clause" ]
1
2020-03-05T02:50:43.000Z
2020-03-05T02:50:43.000Z
from . import calibrant, calibrants, intensity, q from .calibrants import CalibrantStore from .calibrant import Calibrant from .intensity import IntensityCalibrant from .q import QCalibrant
31.666667
49
0.836842
22
190
7.227273
0.409091
0.188679
0
0
0
0
0
0
0
0
0
0
0.121053
190
5
50
38
0.952096
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
61aee98f314de951ef9732d219087c0324c9ab9e
3,792
py
Python
tests/objects/test_network.py
krnnrt/cpauto
6076ee0e3f55769aac5b2480453d82f99371a31f
[ "Apache-2.0" ]
16
2016-12-07T02:45:31.000Z
2022-01-20T11:46:24.000Z
tests/objects/test_network.py
krnnrt/cpauto
6076ee0e3f55769aac5b2480453d82f99371a31f
[ "Apache-2.0" ]
2
2017-07-20T21:12:27.000Z
2021-09-09T14:57:01.000Z
tests/objects/test_network.py
krnnrt/cpauto
6076ee0e3f55769aac5b2480453d82f99371a31f
[ "Apache-2.0" ]
5
2017-07-28T14:06:25.000Z
2021-09-06T12:01:18.000Z
# -*- coding: utf-8 -*- """Tests for cpauto.objects.network module.""" import pytest import responses import cpauto @pytest.mark.parametrize("name", ['net_test_a', 'net_test_b']) @pytest.mark.parametrize("params", [{}, { 'subnet': '192.168.1.0', 'subnet-mask': '255.255.255.0'}, { 'subnet': '10.0.0.0', 'subnet-mask': '255.255.255.0' }]) def test_add(core_client, mgmt_server_base_uri, name, params): endpoint = mgmt_server_base_uri + 'add-network' with responses.RequestsMock() as rsps: resp_body = {'foo': 'bar', 'message': 'OK'} rsps.add(responses.POST, endpoint, json=resp_body, status=200, content_type='application/json') nc = cpauto.Network(core_client) r = nc.add(name=name, params=params) assert r.status_code == 200 assert r.json() == resp_body @pytest.mark.parametrize("name,uid,details_level", [ ("net_test", "", ""), ("", "netuid", ""), ("net_test", "", "uid"), ("", "netuid", "full"), ]) def test_show(core_client, mgmt_server_base_uri, name, uid, details_level): endpoint = mgmt_server_base_uri + 'show-network' with responses.RequestsMock() as rsps: resp_body = {'foo': 'bar', 'message': 'OK'} rsps.add(responses.POST, endpoint, json=resp_body, status=200, content_type='application/json') nc = cpauto.Network(core_client) r = nc.show(name=name, uid=uid, details_level=details_level) assert r.status_code == 200 assert r.json() == resp_body @pytest.mark.parametrize("name,uid,params", [ ("net_test", "", {'subnet': '192.168.1.0', 'subnet-mask': '255.255.255.0'}), ("", "netuid", {'subnet': '10.0.0.0', 'subnet-mask': '255.255.255.0'}), ]) def test_set(core_client, mgmt_server_base_uri, name, uid, params): endpoint = mgmt_server_base_uri + 'set-network' with responses.RequestsMock() as rsps: resp_body = {'foo': 'bar', 'message': 'OK'} rsps.add(responses.POST, endpoint, json=resp_body, status=200, content_type='application/json') nc = cpauto.Network(core_client) r = nc.set(name=name, uid=uid, params=params) assert r.status_code == 200 assert r.json() == resp_body @pytest.mark.parametrize("name,uid,params", [ ("net_test", "", {}), ("", "netuid", {}), ("net_test", "", {'details-level': 'full'}), ("", "netuid", {'ignore-errors': True}), ]) def test_delete(core_client, mgmt_server_base_uri, name, uid, params): endpoint = mgmt_server_base_uri + 'delete-network' with responses.RequestsMock() as rsps: resp_body = {'foo': 'bar', 'message': 'OK'} rsps.add(responses.POST, endpoint, json=resp_body, status=200, content_type='application/json') nc = cpauto.Network(core_client) r = nc.delete(name=name, uid=uid, params=params) assert r.status_code == 200 assert r.json() == resp_body @pytest.mark.parametrize("limit,offset,order,details_level", [ (50, 0, [], ''), (50, 0, [{'ASC': 'foo'}], ''), (64, 32, [{'DESC': 'bar'}], 'uid'), ]) def test_show_all(core_client, mgmt_server_base_uri, limit, offset, order, details_level): endpoint = mgmt_server_base_uri + 'show-networks' with responses.RequestsMock() as rsps: resp_body = {'foo': 'bar', 'message': 'OK'} rsps.add(responses.POST, endpoint, json=resp_body, status=200, content_type='application/json') nc = cpauto.Network(core_client) r = nc.show_all(limit=limit, offset=offset, order=order, details_level=details_level) assert r.status_code == 200 assert r.json() == resp_body
36.114286
80
0.602057
482
3,792
4.551867
0.1639
0.054695
0.06381
0.077484
0.827256
0.79216
0.765725
0.751595
0.698724
0.698724
0
0.036345
0.223629
3,792
104
81
36.461538
0.708899
0.016614
0
0.541176
0
0
0.164115
0.014504
0
0
0
0
0.117647
1
0.058824
false
0
0.035294
0
0.094118
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
61afb3d05233787df7da6e110d95706607fdee2b
904
py
Python
terrascript/resource/hashicorp/nomad.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
terrascript/resource/hashicorp/nomad.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
terrascript/resource/hashicorp/nomad.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# terrascript/resource/hashicorp/nomad.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:22:41 UTC) import terrascript class nomad_acl_policy(terrascript.Resource): pass class nomad_acl_token(terrascript.Resource): pass class nomad_external_volume(terrascript.Resource): pass class nomad_job(terrascript.Resource): pass class nomad_namespace(terrascript.Resource): pass class nomad_quota_specification(terrascript.Resource): pass class nomad_scheduler_config(terrascript.Resource): pass class nomad_sentinel_policy(terrascript.Resource): pass class nomad_volume(terrascript.Resource): pass __all__ = [ "nomad_acl_policy", "nomad_acl_token", "nomad_external_volume", "nomad_job", "nomad_namespace", "nomad_quota_specification", "nomad_scheduler_config", "nomad_sentinel_policy", "nomad_volume", ]
17.056604
73
0.752212
105
904
6.152381
0.314286
0.294118
0.320433
0.346749
0.427245
0.120743
0
0
0
0
0
0.015789
0.159292
904
52
74
17.384615
0.834211
0.122788
0
0.3
1
0
0.197468
0.112658
0
0
0
0
0
1
0
false
0.3
0.033333
0
0.333333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
f60976389bd20ca8068f859191f7f6146cfc99f7
68
py
Python
pygraphql/auth/__init__.py
bendidi/pygraphql-async
7a1200ba870b00b8d64333a3bdf51efff440bde7
[ "MIT" ]
1
2020-10-16T00:31:27.000Z
2020-10-16T00:31:27.000Z
pygraphql/auth/__init__.py
bendidi/pygraphql-async
7a1200ba870b00b8d64333a3bdf51efff440bde7
[ "MIT" ]
null
null
null
pygraphql/auth/__init__.py
bendidi/pygraphql-async
7a1200ba870b00b8d64333a3bdf51efff440bde7
[ "MIT" ]
null
null
null
from .base import BaseAuth from .hasura_admin import HasuraAdminAuth
34
41
0.867647
9
68
6.444444
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.102941
68
2
41
34
0.95082
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f6206315215eb80982a746ee36bae3d7e6c1ff0d
161
py
Python
pokelance/__init__.py
sarthak-py/discmon
24c3db820ab16bcccbd94a2c397c554ae5335d99
[ "MIT" ]
3
2022-02-11T17:47:45.000Z
2022-02-16T04:44:56.000Z
pokelance/__init__.py
sarthak-py/discmon
24c3db820ab16bcccbd94a2c397c554ae5335d99
[ "MIT" ]
1
2022-02-25T07:15:06.000Z
2022-02-25T07:15:06.000Z
pokelance/__init__.py
sarthak-py/discmon
24c3db820ab16bcccbd94a2c397c554ae5335d99
[ "MIT" ]
1
2022-02-25T07:14:44.000Z
2022-02-25T07:14:44.000Z
from .client import * from .cache import * from .errors import * from .generations import * from .pokemon import * from .sprites import * __version__ = "0.0.2"
17.888889
26
0.720497
22
161
5.090909
0.5
0.446429
0
0
0
0
0
0
0
0
0
0.022556
0.173913
161
8
27
20.125
0.819549
0
0
0
0
0
0.031056
0
0
0
0
0
0
1
0
false
0
0.857143
0
0.857143
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
f653170b0e93c5471b90ea68ef7c6960c4aa722c
45
py
Python
tcli/__init__.py
Astiliano/tcli
4cf3656c979137b80400d2d0960894bd2ae056fc
[ "Apache-2.0" ]
6
2019-08-26T04:53:46.000Z
2021-10-21T04:38:52.000Z
tcli/__init__.py
Astiliano/tcli
4cf3656c979137b80400d2d0960894bd2ae056fc
[ "Apache-2.0" ]
5
2019-09-04T04:29:08.000Z
2019-09-05T22:37:56.000Z
tcli/__init__.py
Astiliano/tcli
4cf3656c979137b80400d2d0960894bd2ae056fc
[ "Apache-2.0" ]
5
2019-11-05T17:30:59.000Z
2021-10-16T08:56:04.000Z
"""TCLI Tokenized Command Line Interface."""
22.5
44
0.733333
5
45
6.6
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
45
1
45
45
0.825
0.844444
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f65e4839fdba91665a8e1083739b0b7b843de898
43
py
Python
streamjson/exceptions.py
zaironjacobs/streamjson
f67cd0e3444aeeec866c930e55a87516377d5334
[ "MIT" ]
null
null
null
streamjson/exceptions.py
zaironjacobs/streamjson
f67cd0e3444aeeec866c930e55a87516377d5334
[ "MIT" ]
null
null
null
streamjson/exceptions.py
zaironjacobs/streamjson
f67cd0e3444aeeec866c930e55a87516377d5334
[ "MIT" ]
null
null
null
class StreamJSONError(Exception): pass
14.333333
33
0.767442
4
43
8.25
1
0
0
0
0
0
0
0
0
0
0
0
0.162791
43
2
34
21.5
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
9cd75081794c2e881975dbef3e5953a9071a3cc7
144
py
Python
ml_model_evaluation/datasets/base_dataset.py
nkaenzig/ml_model_evaluation
0064a223b3a6362b7e281d9241cb9ffe97247bb0
[ "MIT" ]
null
null
null
ml_model_evaluation/datasets/base_dataset.py
nkaenzig/ml_model_evaluation
0064a223b3a6362b7e281d9241cb9ffe97247bb0
[ "MIT" ]
null
null
null
ml_model_evaluation/datasets/base_dataset.py
nkaenzig/ml_model_evaluation
0064a223b3a6362b7e281d9241cb9ffe97247bb0
[ "MIT" ]
null
null
null
class BaseDataset: """ """ def __init__(self) -> None: pass def download_dataset(self): raise NotImplementedError
16
33
0.597222
13
144
6.230769
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.298611
144
8
34
18
0.80198
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0.2
0
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
140ad4a3fdc6c145eba002acafcaaddb1d621b64
55,073
py
Python
tests/test_score.py
taikoma/TennisVideoAnalysis
e69f2f37e262f240b42a1d49dd9f13f65c08bb60
[ "MIT" ]
21
2019-02-25T05:04:08.000Z
2022-03-06T08:56:53.000Z
tests/test_score.py
taikoma/TennisVideoAnalysis
e69f2f37e262f240b42a1d49dd9f13f65c08bb60
[ "MIT" ]
4
2019-05-28T08:08:15.000Z
2021-11-29T02:26:48.000Z
tests/test_score.py
taikoma/TennisVideoAnalysis
e69f2f37e262f240b42a1d49dd9f13f65c08bb60
[ "MIT" ]
6
2019-05-28T15:31:52.000Z
2022-03-31T05:33:39.000Z
import unittest from pathlib import Path import sys import numpy as np sys.path.append(str(Path(__file__).parent.parent)) sys.path.append(str(Path(__file__).parent.parent / "src")) import src.score as score import src.const as const class TestScore(unittest.TestCase): def setUp(self): # 設定 save_temp_db self.score = score.Score(0) def test_convert_set(self): game_a, game_b = 6, 4 set_a, set_b = 0, 0 self.assertEqual( (0, 0, 1, 0), self.score.convert_set(game_a, game_b, set_a, set_b) ) game_a, game_b = 4, 6 set_a, set_b = 0, 0 self.assertEqual( (0, 0, 0, 1), self.score.convert_set(game_a, game_b, set_a, set_b) ) game_a, game_b = 7, 6 set_a, set_b = 0, 0 self.assertEqual( (0, 0, 1, 0), self.score.convert_set(game_a, game_b, set_a, set_b) ) game_a, game_b = 6, 7 set_a, set_b = 0, 0 self.assertEqual( (0, 0, 0, 1), self.score.convert_set(game_a, game_b, set_a, set_b) ) game_a, game_b = 6, 5 set_a, set_b = 0, 0 self.assertEqual( (6, 5, 0, 0), self.score.convert_set(game_a, game_b, set_a, set_b) ) game_a, game_b = 5, 6 set_a, set_b = 0, 0 self.assertEqual( (5, 6, 0, 0), self.score.convert_set(game_a, game_b, set_a, set_b) ) def test_convert_score( self, ): # score計算にエラーがないかテスト total_gameの変化が含まれていてステートレスになっていない # ゲームに変化がない場合 g = [0, 0] s = [0, 0] for i in range(0, 1): s[0] = i for j in range(0, 1): s[1] = j for k in range(0, 6): g[0] = k for l in range(0, 6): g[1] = l ps = [ [0, 0], [1, 0], [2, 0], [3, 0], [0, 1], [1, 1], [2, 1], [3, 1], # ,[4,0],[4,1] [0, 2], [1, 2], [2, 2], [3, 2], [0, 3], [1, 3], [2, 3], [3, 3], # ,[4,2] Ad [4, 3], [4, 4], [5, 4], [5, 5], [6, 5], [6, 6], [7, 6], [7, 7], ] # g_temp=g for m, p in enumerate(ps): correct_score = [ ["0", "0"], ["15", "0"], ["30", "0"], ["40", "0"], ["0", "15"], ["15", "15"], ["30", "15"], ["40", "15"], # ,['0','0'],['0','0'] ["0", "30"], ["15", "30"], ["30", "30"], ["40", "30"], ["0", "40"], ["15", "40"], ["30", "40"], ["40", "40"], # ,['0','0'],['0','0'] ["Ad", "40"], ["40", "40"], ["Ad", "40"], ["40", "40"], ["Ad", "40"], ["40", "40"], ["Ad", "40"], ["40", "40"], ] ( scoreA, scoreB, gamePointA, gamePointB, gameA, gameB, setA, setB, ) = self.score.convert_score( p[0], p[1], g[0], g[1], s[0], s[1] ) self.assertEqual([scoreA, scoreB], correct_score[m]) self.assertEqual([gamePointA, gamePointB], p) self.assertEqual([gameA, gameB], g) self.assertEqual([setA, setB], s) # ゲームに変化がある場合 for i in range(0, 1): s[0] = i for j in range(0, 1): s[1] = j for k in range(0, 5): g[0] = k for l in range(0, 5): g[1] = l ps = [ [4, 0], [4, 1], [4, 2], [5, 3], [6, 4], [7, 5], [9, 7], [10, 8], [11, 9], [12, 10], ] for m, p in enumerate(ps): ( scoreA, scoreB, gamePointA, gamePointB, gameA, gameB, setA, setB, ) = self.score.convert_score( p[0], p[1], g[0], g[1], s[0], s[1] ) self.assertEqual([scoreA, scoreB], ["0", "0"]) self.assertEqual([gamePointA, gamePointB], [0, 0]) self.assertEqual([gameA, gameB], [g[0] + 1, g[1]]) self.assertEqual([setA, setB], s) ps = [ [0, 4], [1, 4], [2, 4], [3, 5], [4, 6], [5, 7], [7, 9], [8, 10], [9, 11], [10, 12], ] for m, p in enumerate(ps): ( scoreA, scoreB, gamePointA, gamePointB, gameA, gameB, setA, setB, ) = self.score.convert_score( p[0], p[1], g[0], g[1], s[0], s[1] ) self.assertEqual([scoreA, scoreB], ["0", "0"]) self.assertEqual([gamePointA, gamePointB], [0, 0]) self.assertEqual([gameA, gameB], [g[0], g[1] + 1]) self.assertEqual([setA, setB], s) # セットに変化がある場合 for k in range(0, 1): s[0] = k for l in range(0, 1): s[1] = l gs = [[5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [6, 5]] p = [4, 0] for m, g in enumerate(gs): ( scoreA, scoreB, gamePointA, gamePointB, gameA, gameB, setA, setB, ) = self.score.convert_score(p[0], p[1], g[0], g[1], s[0], s[1]) self.assertEqual([scoreA, scoreB], ["0", "0"]) self.assertEqual([gamePointA, gamePointB], [0, 0]) self.assertEqual([gameA, gameB], [0, 0]) self.assertEqual([setA, setB], [s[0] + 1, s[1]]) gs = [[0, 5], [1, 5], [2, 5], [3, 5], [4, 5], [5, 6]] p = [0, 4] for m, g in enumerate(gs): ( scoreA, scoreB, gamePointA, gamePointB, gameA, gameB, setA, setB, ) = self.score.convert_score(p[0], p[1], g[0], g[1], s[0], s[1]) self.assertEqual([scoreA, scoreB], ["0", "0"]) self.assertEqual([gamePointA, gamePointB], [0, 0]) self.assertEqual([gameA, gameB], [0, 0]) self.assertEqual([setA, setB], [s[0], s[1] + 1]) def test_devide_left_right(self): text_score = "15-30" l, r = self.score.divide_left_right(text_score) self.assertEqual("15", l) self.assertEqual("30", r) text_score = "" l, r = self.score.divide_left_right(text_score) self.assertEqual("", l) self.assertEqual("", r) def test_get_winner(self): # (pre_count_a, count_a, pre_count_b, count_b) winner = self.score.get_winner(0, 0, 0, 0) self.assertEqual(2, winner) # fault winner = self.score.get_winner(0, 1, 0, 0) self.assertEqual(0, winner) # a won winner = self.score.get_winner(0, 0, 0, 1) self.assertEqual(1, winner) # b won winner = self.score.get_winner(3, 0, 1, 0) # self.assertEqual(0, winner) # b won winner = self.score.get_winner(4, 0, 3, 0) # self.assertEqual(0, winner) # b won winner = self.score.get_winner(1, 0, 3, 0) # 15-40 0-0 self.assertEqual(1, winner) # b won winner = self.score.get_winner(3, 0, 4, 0) # 40-Ad 0-0 self.assertEqual(1, winner) # b won def test_get_winner_list(self): array_score = [ "0-0", "0-15", "0-15", "15-15", "15-30", "15-40", "30-40", "40-40", "40-Ad", "40-40", ] winner_array = self.score.get_winner_list(array_score) self.assertEqual( [1, 2, 0, 1, 1, 0, 0, 1, 0, 3], winner_array ) # [1, 2, 0, 1, 1, 0, 0, 3, 3, 3] array_score = [ "0-0", "0-15", "0-15", "", "15-15", "15-30", "15-40", "30-40", "40-40", "40-Ad", "40-40", ] winner_array = self.score.get_winner_list(array_score) self.assertEqual([1, 2, 3, 0, 1, 1, 0, 0, 1, 0, 3], winner_array) array_score = [ "0-0", "0-15", "0-15", "", "", "15-15", "15-30", "15-40", "30-40", "40-40", "40-A", "40-40", ] winner_array = self.score.get_winner_list(array_score) self.assertEqual([1, 2, 3, 3, 0, 1, 1, 0, 0, 1, 0, 3], winner_array) array_score = [ "0-0", "0-15", "0-15", "", "", "0-15", "15-15", "15-30", "15-40", "30-40", "40-40", "40-A", "40-40", ] winner_array = self.score.get_winner_list(array_score) self.assertEqual([1, 2, 3, 3, 2, 0, 1, 1, 0, 0, 1, 0, 3], winner_array) array_score = [ "40-30", "0-0", "0-15", ] winner_array = self.score.get_winner_list(array_score) self.assertEqual([0, 1, 3], winner_array) array_score = [ "40-Ad", "0-0", "0-15", ] winner_array = self.score.get_winner_list(array_score) self.assertEqual([1, 1, 3], winner_array) def test_score2count(self): score = "0" self.assertEqual(0, self.score.score2count(score)) score = "15" self.assertEqual(1, self.score.score2count(score)) score = "30" self.assertEqual(2, self.score.score2count(score)) score = "40" self.assertEqual(3, self.score.score2count(score)) score = "A" self.assertEqual(4, self.score.score2count(score)) score = "fasdf" self.assertEqual(-1, self.score.score2count(score)) def test_winner2player_fault(self): player_name = ["a", "b"] winner_array = [0, 1, 1, 2, 2, 3, 0, 2] point_pattern = ["", "", "", "", "", "", "", ""] ( point_winner_array, first_second_array, point_pattern, ) = self.score.winner2player_fault(winner_array, player_name, point_pattern) self.assertEqual(["a", "b", "b", "", "", "", "a", ""], point_winner_array) self.assertEqual( [1, 1, 1, 1, 2, 0, 1, 1], first_second_array ) # 0:not point 1:1st 2:2nd self.assertEqual( ["", "", "", const.PATTERN[6], const.PATTERN[7], "", "", const.PATTERN[6]], point_pattern, ) # 0:not point 1:1st 2:2nd def test_get_game_list(self): array_score = [ "0-0", "0-15", "0-15", "15-15", "15-30", "15-40", "30-40", "40-40", "40-Ad", "40-40", ] game_list, set_list = self.score.get_game_list(array_score) self.assertEqual( ["0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0"], game_list, ) self.assertEqual( ["0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0", "0-0"], set_list, ) array_score = [ "40-Ad", "0-0", "0-15", ] game_list, set_list = self.score.get_game_list(array_score) self.assertEqual(["0-0", "0-1", "0-1"], game_list) self.assertEqual(["0-0", "0-0", "0-0"], set_list) array_score = [ "40-Ad", "0-0", "0-15", "0-30", "0-40", "0-0", "15-0", "30-0", "40-0", "0-0", ] game_list, set_list = self.score.get_game_list(array_score) self.assertEqual( [ "0-0", "0-1", "0-1", "0-1", "0-1", "0-2", "0-2", "0-2", "0-2", "1-2", ], game_list, ) def test_get_game_reset(self): # b set won game_a, game_b, set_a, set_b = 7, 5, 0, 0 self.assertEqual( (0, 0, 1, 0), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) game_a, game_b, set_a, set_b = 7, 6, 0, 0 self.assertEqual( (0, 0, 1, 0), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) game_a, game_b, set_a, set_b = 5, 2, 0, 0 self.assertEqual( (5, 2, 0, 0), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) game_a, game_b, set_a, set_b = 6, 2, 0, 0 self.assertEqual( (0, 0, 1, 0), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) # b set won game_a, game_b, set_a, set_b = 5, 7, 0, 0 self.assertEqual( (0, 0, 0, 1), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) game_a, game_b, set_a, set_b = 6, 7, 0, 0 self.assertEqual( (0, 0, 0, 1), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) game_a, game_b, set_a, set_b = 2, 6, 0, 0 self.assertEqual( (0, 0, 0, 1), self.score.get_game_reset(game_a, game_b, set_a, set_b) ) # def test_position_data2array(self): # # test when add num=2 data to array # self.score.playerName = ["A", "B"] # self.score.firstServer = 0 # self.score.totalGame = 1 # self.score.array_ball_position_shot = [[], [], [], []] # self.score.arrayPlayerAPosition = [[], [], [], []] # self.score.arrayPlayerBPosition = [[], [], [], []] # self.score.arrayHitPlayer = [[], [], [], []] # self.score.arrayBounceHit = [[], [], [], []] # self.score.arrayForeBack = [[], [], [], []] # self.score.arrayDirection = [[], [], [], []] # self.score.array_x1 = [[], [], [], []] # self.score.array_y1 = [[], [], [], []] # self.score.array_x2 = [[], [], [], []] # self.score.array_y2 = [[], [], [], []] # self.score.array_x3 = [[], [], [], []] # self.score.array_y3 = [[], [], [], []] # self.score.array_x4 = [[], [], [], []] # self.score.array_y4 = [[], [], [], []] # num = 2 # self.score.number = num # pos_seek = 100 # xball = 10 # yball = 20 # x1, y1, x2, y2, x3, y3, x4, y4 = 0, 1, 2, 3, 4, 5, 6, 7 # self.score.position_data2array( # xball, # yball, # 3, # 4, # 5, # 6, # 0, # "Hit", # "Fore", # "Cross", # x1, # y1, # x2, # y2, # x3, # y3, # x4, # y4, # pos_seek, # ) # self.assertEqual( # [[], [], [[num, pos_seek, xball, yball]], []], # self.score.array_ball_position_shot, # ) # self.assertEqual([[], [], ["B"], []], self.score.arrayHitPlayer) # self.assertEqual([[], [], [0], []], self.score.array_x1) # self.assertEqual([[], [], [7], []], self.score.array_y4) # def test_position_data2array_fix(self): # # # self.score.playerName = ["A", "B"] # self.score.firstServer = 0 # self.score.totalGame = 1 # self.score.array_ball_position_shot = [ # [], # [], # [[1, 11, 1, 2], [2, 51, 3, 4]], # [], # ] # self.score.arrayPlayerAPosition = [ # [], # [], # [[1, 11, 11, 12], [2, 51, 13, 14]], # [], # ] # self.score.arrayPlayerBPosition = [ # [], # [], # [[1, 11, 21, 22], [2, 51, 23, 24]], # [], # ] # self.score.arrayHitPlayer = [[], [], ["A", "A"], []] # self.score.arrayBounceHit = [[], [], ["Bounce", "Hit"], []] # self.score.arrayForeBack = [[], [], ["Fore", "Back"], []] # self.score.arrayDirection = [[], [], ["Cross", "Cross"], []] # self.score.array_x1 = [[], [], [1, 2], []] # self.score.array_y1 = [[], [], [3, 4], []] # self.score.array_x2 = [[], [], [5, 6], []] # self.score.array_y2 = [[], [], [7, 8], []] # self.score.array_x3 = [[], [], [9, 10], []] # self.score.array_y3 = [[], [], [11, 12], []] # self.score.array_x4 = [[], [], [13, 14], []] # self.score.array_y4 = [[], [], [15, 16], []] # num = 2 # self.score.number = num # rally = 2 # self.score.rally = rally # pos_seek = 100 # xball = 10 # yball = 20 # x1, y1, x2, y2, x3, y3, x4, y4 = 0, 1, 2, 3, 4, 5, 6, 7 # self.score.position_data2array_fix( # xball, # yball, # 3, # 4, # 5, # 6, # 0, # "Hit", # "Fore", # "Cross", # x1, # y1, # x2, # y2, # x3, # y3, # x4, # y4, # pos_seek, # ) # self.assertEqual( # [[], [], [[1, 11, 1, 2], [rally, pos_seek, xball, yball]], []], # self.score.array_ball_position_shot, # ) # self.assertEqual([[], [], ["A", "B"], []], self.score.arrayHitPlayer) # self.assertEqual([[], [], [1, 0], []], self.score.array_x1) # self.assertEqual([[], [], [15, 7], []], self.score.array_y4) def test_delete_position_data(self): # delete middle self.score.shot_index = [0, 0, 1] self.score.shot_frame = [11, 51, 101] self.score.array_ball_position_shot_x = [1, 3, 5] self.score.array_ball_position_shot_y = [2, 4, 6] self.score.arrayPlayerAPosition_x = [11, 13, 15] self.score.arrayPlayerAPosition_y = [12, 14, 16] self.score.arrayPlayerBPosition_x = [21, 23, 25] self.score.arrayPlayerBPosition_y = [22, 24, 26] self.score.arrayHitPlayer = ["A", "A", "B"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce"] self.score.arrayForeBack = ["Fore", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3] self.score.array_y1 = [3, 4, 5] self.score.array_x2 = [5, 6, 7] self.score.array_y2 = [7, 8, 9] self.score.array_x3 = [9, 10, 11] self.score.array_y3 = [11, 12, 13] self.score.array_x4 = [13, 14, 15] self.score.array_y4 = [15, 16, 17] # num = 2 # self.score.number = num i = 1 self.score.delete_position_data(i) self.assertEqual([0, 1], self.score.shot_index) self.assertEqual([11, 101], self.score.shot_frame) self.assertEqual([1, 5], self.score.array_ball_position_shot_x) self.assertEqual([2, 6], self.score.array_ball_position_shot_y) self.assertEqual([11, 15], self.score.arrayPlayerAPosition_x) self.assertEqual([12, 16], self.score.arrayPlayerAPosition_y) self.assertEqual([21, 25], self.score.arrayPlayerBPosition_x) self.assertEqual([22, 26], self.score.arrayPlayerBPosition_y) self.assertEqual([1, 3], self.score.array_x1) self.assertEqual([15, 17], self.score.array_y4) # delete last self.score.shot_index = [0, 0, 1] self.score.shot_frame = [11, 51, 101] self.score.array_ball_position_shot_x = [1, 3, 5] self.score.array_ball_position_shot_y = [2, 4, 6] self.score.arrayPlayerAPosition_x = [11, 13, 15] self.score.arrayPlayerAPosition_y = [12, 14, 16] self.score.arrayPlayerBPosition_x = [21, 23, 25] self.score.arrayPlayerBPosition_y = [22, 24, 26] self.score.arrayHitPlayer = ["A", "A", "B"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce"] self.score.arrayForeBack = ["Fore", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3] self.score.array_y1 = [3, 4, 5] self.score.array_x2 = [5, 6, 7] self.score.array_y2 = [7, 8, 9] self.score.array_x3 = [9, 10, 11] self.score.array_y3 = [11, 12, 13] self.score.array_x4 = [13, 14, 15] self.score.array_y4 = [15, 16, 17] # num = 2 # self.score.number = num i = 2 self.score.delete_position_data(i) self.assertEqual([0, 0], self.score.shot_index) self.assertEqual([11, 51], self.score.shot_frame) self.assertEqual([1, 3], self.score.array_ball_position_shot_x) self.assertEqual([2, 4], self.score.array_ball_position_shot_y) self.assertEqual([11, 13], self.score.arrayPlayerAPosition_x) self.assertEqual([12, 14], self.score.arrayPlayerAPosition_y) self.assertEqual([21, 23], self.score.arrayPlayerBPosition_x) self.assertEqual([22, 24], self.score.arrayPlayerBPosition_y) self.assertEqual([1, 2], self.score.array_x1) self.assertEqual([15, 16], self.score.array_y4) def test_delete_point_shift(self): # middle print("test_delete_point_shift") self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] # num = 2 # self.score.number = num start_shot = 1 end_shot = 2 self.score.delete_tree_shot_shift(start_shot, end_shot) self.assertEqual([0, 2], self.score.shot_index) self.assertEqual([11, 201], self.score.shot_frame) self.assertEqual([1, 7], self.score.array_ball_position_shot_x) self.assertEqual([2, 7], self.score.array_ball_position_shot_y) self.assertEqual([11, 17], self.score.arrayPlayerAPosition_x) self.assertEqual([12, 18], self.score.arrayPlayerAPosition_y) self.assertEqual([21, 27], self.score.arrayPlayerBPosition_x) self.assertEqual([22, 28], self.score.arrayPlayerBPosition_y) self.assertEqual([1, 4], self.score.array_x1) self.assertEqual([15, 18], self.score.array_y4) # all self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] # num = 2 # self.score.number = num start_shot = 0 end_shot = 3 self.score.delete_tree_shot_shift(start_shot, end_shot) self.assertEqual([], self.score.shot_index) self.assertEqual([], self.score.array_ball_position_shot_x) self.assertEqual([], self.score.array_x1) self.assertEqual([], self.score.array_y4) # last2 print("test_delete_point_shift") self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] # num = 2 # self.score.number = num start_shot = 2 end_shot = 3 self.score.delete_tree_shot_shift(start_shot, end_shot) self.assertEqual([0, 0], self.score.shot_index) self.assertEqual([11, 51], self.score.shot_frame) self.assertEqual([1, 3], self.score.array_ball_position_shot_x) self.assertEqual([2, 4], self.score.array_ball_position_shot_y) self.assertEqual([11, 13], self.score.arrayPlayerAPosition_x) self.assertEqual([12, 14], self.score.arrayPlayerAPosition_y) self.assertEqual([21, 23], self.score.arrayPlayerBPosition_x) self.assertEqual([22, 24], self.score.arrayPlayerBPosition_y) # last1 print("test_delete_point_shift") self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] num = 2 self.score.number = num start_shot = 3 end_shot = 3 self.score.delete_tree_shot_shift(start_shot, end_shot) self.assertEqual([0, 0, 1], self.score.shot_index) self.assertEqual([11, 51, 101], self.score.shot_frame) self.assertEqual([1, 3, 5], self.score.array_ball_position_shot_x) self.assertEqual([2, 4, 6], self.score.array_ball_position_shot_y) self.assertEqual([11, 13, 15], self.score.arrayPlayerAPosition_x) self.assertEqual([12, 14, 16], self.score.arrayPlayerAPosition_y) self.assertEqual([21, 23, 25], self.score.arrayPlayerBPosition_x) self.assertEqual([22, 24, 26], self.score.arrayPlayerBPosition_y) # 1st1 print("test_delete_point_shift") self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] # num = 2 # self.score.number = num start_shot = 0 end_shot = 0 self.score.delete_tree_shot_shift(start_shot, end_shot) self.assertEqual([0, 1, 2], self.score.shot_index) self.assertEqual([51, 101, 201], self.score.shot_frame) self.assertEqual([3, 5, 7], self.score.array_ball_position_shot_x) self.assertEqual([4, 6, 7], self.score.array_ball_position_shot_y) self.assertEqual([13, 15, 17], self.score.arrayPlayerAPosition_x) self.assertEqual([14, 16, 18], self.score.arrayPlayerAPosition_y) self.assertEqual([23, 25, 27], self.score.arrayPlayerBPosition_x) self.assertEqual([24, 26, 28], self.score.arrayPlayerBPosition_y) self.assertEqual([2, 3, 4], self.score.array_x1) self.assertEqual([16, 17, 18], self.score.array_y4) def test_divide_track_data(self): self.score.array_ball_position_shot = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayPlayerAPosition = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayPlayerBPosition = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayHitPlayer = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayBounceHit = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayForeBack = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayDirection = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.arrayBounceHit = [ [], [], [], [], [], [], [], [], [], [], [], [], ] # num12 self.score.array_x1 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_y1 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_x2 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_y2 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_x3 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_y3 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_x4 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 self.score.array_y4 = [[], [], [], [], [], [], [], [], [], [], [], []] # num12 start_frame = [0, 40, 70, 120, 1000] track_frame = [15, 20, 30, 50, 100, 115, 120, 130, 150, 200] bx = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] by = [11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0] xa = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] ya = [11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0] xb = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] yb = [11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0] x1 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] y1 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] x2 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] y2 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] x3 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] y3 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] x4 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] y4 = [81, 82, 83, 84, 85, 86, 87, 88, 89, 90] hit_bounce = [ "Front_Hit", "Front_Bounce", "Back_Hit", "Back_Bounce", "Front_Hit", "Front_Bounce", "Back_Hit", "Back_Bounce", "Front_Hit", "Front_Bounce", ] self.score.divide_track_data( start_frame, track_frame, bx, by, xa, ya, xb, yb, hit_bounce, x1, y1, x2, y2, x3, y3, x4, y4, ) # print(self.score.array_ball_position_shot) self.assertEqual( [ [[0, 15, 1.0, 11.0], [0, 20, 2.0, 12.0], [0, 30, 3.0, 13.0]], [[1, 50, 4.0, 14.0]], [[2, 100, 5.0, 15.0], [2, 115, 6.0, 16.0]], [ [3, 120, 7.0, 17.0], [3, 130, 8.0, 18.0], [3, 150, 9.0, 19.0], [3, 200, 10.0, 20.0], ], [], [], [], [], [], [], [], [], ], self.score.array_ball_position_shot, ) self.assertEqual( [ [[0, 15, 1.0, 11.0], [0, 20, 2.0, 12.0], [0, 30, 3.0, 13.0]], [[1, 50, 4.0, 14.0]], [[2, 100, 5.0, 15.0], [2, 115, 6.0, 16.0]], [ [3, 120, 7.0, 17.0], [3, 130, 8.0, 18.0], [3, 150, 9.0, 19.0], [3, 200, 10.0, 20.0], ], [], [], [], [], [], [], [], [], ], self.score.arrayPlayerAPosition, ) self.assertEqual( [ ["Hit", "Bounce", "Hit"], ["Bounce"], ["Hit", "Bounce"], ["Hit", "Bounce", "Hit", "Bounce"], [], [], [], [], [], [], [], [], ], self.score.arrayBounceHit, ) self.assertEqual( [ [11, 12, 13], [14], [15, 16], [17, 18, 19, 20], [], [], [], [], [], [], [], [], ], self.score.array_x1, ) self.assertEqual( [ [81, 82, 83], [84], [85, 86], [87, 88, 89, 90], [], [], [], [], [], [], [], [], ], self.score.array_y4, ) def test_delete_after_end(self): self.score.array_ball_position_shot = [ [], [], [[1, 11, 1, 2], [2, 51, 3, 4], [3, 101, 5, 6], [4, 201, 7, 8]], [], ] self.score.arrayPlayerAPosition = [ [], [], [[1, 11, 11, 12], [2, 51, 13, 14], [3, 101, 15, 16], [4, 201, 17, 18]], [], ] self.score.arrayPlayerBPosition = [ [], [], [[1, 11, 21, 22], [2, 51, 23, 24], [3, 101, 25, 26], [4, 201, 17, 18]], [], ] self.score.arrayHitPlayer = [[], [], ["A", "A", "B", "A"], []] self.score.arrayBounceHit = [[], [], ["Bounce", "Hit", "Bounce", "Hit"], []] self.score.arrayForeBack = [[], [], ["Fore", "Back", "Back", "Back"], []] self.score.arrayDirection = [[], [], ["Cross", "Cross", "Cross", "Cross"], []] self.score.array_x1 = [[], [], [1, 2, 3, 4], []] self.score.array_y1 = [[], [], [3, 4, 5, 6], []] self.score.array_x2 = [[], [], [5, 6, 7, 8], []] self.score.array_y2 = [[], [], [7, 8, 9, 10], []] self.score.array_x3 = [[], [], [9, 10, 11, 12], []] self.score.array_y3 = [[], [], [11, 12, 13, 14], []] self.score.array_x4 = [[], [], [13, 14, 15, 16], []] self.score.array_y4 = [[], [], [15, 16, 17, 18], []] self.score.number = 2 end = 100 self.score.delete_after_end(self.score.number, end) self.assertEqual( [[], [], [[1, 11, 1, 2], [2, 51, 3, 4]], []], self.score.array_ball_position_shot, ) self.assertEqual( [[], [], [[1, 11, 11, 12], [2, 51, 13, 14]], []], self.score.arrayPlayerAPosition, ) def test_delete_tree_point(self): self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_frame_start = [100, 200, 300, 400] self.score.array_frame_end = [100, 200, 300, 400] self.score.arraySet = [100, 200, 300, 400] self.score.arrayGame = [100, 200, 300, 400] self.score.arrayScore = [100, 200, 300, 400] self.score.arrayScoreResult = [100, 200, 300, 400] self.score.arrayFirstSecond = [100, 200, 300, 400] self.score.arrayServer = [100, 200, 300, 400] self.score.arrayPointWinner = [100, 200, 300, 400] self.score.pointWin[0] = [0, 1, 1, 2] self.score.pointWin[1] = [0, 1, 1, 2] self.score.arrayPointPattern = [100, 200, 300, 400] self.score.arrayFault = [0, 0, 1, 0] self.score.arrayContactServe = [[0, 0], [1, 1], [2, 2], [3, 3]] self.score.arrayCourt = [ [[0, 0], [1, 1], [2, 2], [3, 3]], [[10, 0], [11, 11], [12, 12], [13, 13]], [[20, 20], [21, 21], [22, 22], [23, 23]], [[30, 30], [31, 31], [32, 32], [33, 33]], ] self.score.array_ball_position_shot_x = [1, 3, 1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 2, 4, 6, 8] self.score.arrayPlayerAPosition_x = [11, 13, 11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [21, 23, 21, 23, 25, 27] self.score.arrayPlayerBPosition_x = [31, 33, 31, 33, 35, 37] self.score.arrayPlayerBPosition_y = [41, 43, 41, 43, 45, 47] self.score.arrayHitPlayer = ["A", "A", "A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Fore", "Back", "Back", "Back"] self.score.arrayDirection = [ "Cross", "Cross", "Cross", "Cross", "Cross", "Cross", ] self.score.array_x1 = [1, 2, 1, 2, 3, 4] self.score.array_y1 = [3, 4, 3, 4, 5, 6] self.score.array_x2 = [5, 6, 5, 6, 7, 8] self.score.array_y2 = [7, 8, 7, 8, 9, 10] self.score.array_x3 = [9, 10, 9, 10, 11, 12] self.score.array_y3 = [11, 12, 11, 12, 13, 14] self.score.array_x4 = [13, 14, 13, 14, 15, 16] self.score.array_y4 = [15, 16, 15, 16, 17, 18] self.score.number = 1 # delete 1th row self.score.delete_tree_point() self.assertEqual([100, 300, 400], self.score.array_frame_start) self.assertEqual([0, 1, 2], self.score.pointWin[0]) self.assertEqual([0, 1, 2], self.score.pointWin[1]) self.assertEqual([1, 3, 1, 3, 5, 7], self.score.array_ball_position_shot_x) self.assertEqual([0, 0, 0, 0], self.score.shot_index) self.assertEqual([[0, 0], [2, 2], [3, 3]], self.score.arrayContactServe) self.assertEqual( [ [[0, 0], [2, 2], [3, 3]], [[10, 0], [12, 12], [13, 13]], [[20, 20], [22, 22], [23, 23]], [[30, 30], [32, 32], [33, 33]], ], self.score.arrayCourt, ) # def test_position_data2array_insert(self): # self.score.array_ball_position_shot = [ # [], # [[1, 11, 1, 2], [2, 51, 3, 4]], # [[1, 11, 1, 2], [2, 51, 3, 4], [3, 101, 5, 6], [4, 201, 7, 8]], # [], # ] # self.score.arrayPlayerAPosition = [ # [], # [[1, 11, 11, 12], [2, 51, 13, 14]], # [[1, 11, 11, 12], [2, 51, 13, 14], [3, 101, 15, 16], [4, 201, 717, 18]], # [], # ] # self.score.arrayPlayerBPosition = [ # [], # [[1, 11, 21, 22], [2, 51, 23, 24]], # [[1, 11, 21, 22], [2, 51, 23, 24], [3, 101, 25, 26], [4, 201, 717, 18]], # [], # ] # self.score.arrayHitPlayer = [[], ["A", "A"], ["A", "A", "B", "A"], []] # self.score.arrayBounceHit = [ # [], # ["Bounce", "Hit"], # ["Bounce", "Hit", "Bounce", "Hit"], # [], # ] # self.score.arrayForeBack = [ # [], # ["Fore", "Back"], # ["Fore", "Back", "Back", "Back"], # [], # ] # self.score.arrayDirection = [ # [], # ["Cross", "Cross"], # ["Cross", "Cross", "Cross", "Cross"], # [], # ] # self.score.array_x1 = [[], [1, 2], [1, 2, 3, 4], []] # self.score.array_y1 = [[], [3, 4], [3, 4, 5, 6], []] # self.score.array_x2 = [[], [5, 6], [5, 6, 7, 8], []] # self.score.array_y2 = [[], [7, 8], [7, 8, 9, 10], []] # self.score.array_x3 = [[], [9, 10], [9, 10, 11, 12], []] # self.score.array_y3 = [[], [11, 12], [11, 12, 13, 14], []] # self.score.array_x4 = [[], [13, 14], [13, 14, 15, 16], []] # self.score.array_y4 = [[], [15, 16], [15, 16, 17, 18], []] # self.score.number = 2 # pos_seek = 100 # xball = 10 # yball = 20 # x1, y1, x2, y2, x3, y3, x4, y4 = 0, 1, 2, 3, 4, 5, 6, 7 # self.score.position_data2array_insert( # xball, # yball, # 3, # 4, # 5, # 6, # 0, # "Hit", # "Fore", # "Cross", # x1, # y1, # x2, # y2, # x3, # y3, # x4, # y4, # pos_seek, # ) # self.assertEqual( # self.score.array_ball_position_shot, # [ # [], # [[1, 11, 1, 2], [2, 51, 3, 4]], # [ # [1, 11, 1, 2], # [2, 51, 3, 4], # [3, 100, 10, 20], # [4, 101, 5, 6], # [5, 201, 7, 8], # ], # [], # ], # ) def test_convert_bally2player_y(self): self.score.array_ball_position_shot_x = [1, 3, 1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 2, 4, 6, 8] self.score.arrayPlayerAPosition_x = [11, 13, 11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 22, 24, 26, 28] self.score.arrayHitPlayer = ["Up", "Down", "Up", "Down", "Up", "Down"] self.score.convert_bally2player_y() self.assertEqual( [12, 24, 12, 24, 16, 28], self.score.array_ball_position_shot_y, ) def test_index_shot(self): score_frame = [0, 100, 200, 300, 400, 500] shot_frame = [50, 80, 130, 250, 450, 550, 1000, 3200] shot_index = self.score.index_shot(score_frame, shot_frame) self.assertEqual([0, 0, 1, 2, 4, 5, 5, 5], shot_index) def test_insert_tree_point(self): self.score.shot_frame = [50, 80, 130, 250, 450, 550, 1000, 3200] self.score.array_frame_start = [100, 200, 300, 400] self.score.array_frame_end = [199, 299, 399, 499] self.score.number = 1 # insert 1th row self.score.insert_tree_point() self.assertEqual([100, 200, 202, 300, 400], self.score.array_frame_start) self.assertEqual([199, 201, 299, 399, 499], self.score.array_frame_end) self.assertEqual([0, 0, 0, 2, 4, 4, 4, 4], self.score.shot_index) def test_get_server_num(self): text_game = "0-0" self.assertEqual(0, self.score.get_server_num(text_game)) text_game = "0-1" self.assertEqual(1, self.score.get_server_num(text_game)) text_game = "-" self.assertEqual(-1, self.score.get_server_num(text_game)) def test_get_server_list(self): array_game = [ "0-0", "0-0", "0-0", "0-0", "0-1", "0-1", "0-1", "0-1", "1-1", "1-1", "1-1", "1-1", ] self.score.playerName = ["A", "B"] self.score.firstServer = 0 array_server = self.score.get_server_list(array_game) self.assertEqual( ["A", "A", "A", "A", "B", "B", "B", "B", "A", "A", "A", "A"], array_server ) self.score.firstServer = 1 array_server = self.score.get_server_list(array_game) self.assertEqual( ["B", "B", "B", "B", "A", "A", "A", "A", "B", "B", "B", "B"], array_server ) def test_get_index_array_shot(self): shot_index = [0, 0, 1, 1, 2, 3, 4] num_point = 1 self.assertEqual([2, 3], self.score.get_index_array_shot(num_point, shot_index)) num_point = 10 self.assertEqual([], self.score.get_index_array_shot(num_point, shot_index)) def test_get_index_shot(self): shot_index = [0, 0, 1, 1, 2, 3, 4] num_point = 1 num_shot = 1 self.assertEqual(3, self.score.get_index_shot(num_point, num_shot, shot_index)) def test_get_index_frame(self): shot_frame = [11, 51, 101, 201] frame = 100 self.assertEqual(1, self.score.get_index_frame(frame, shot_frame)) shot_frame = [11, 51, 101, 201] frame = 101 self.assertEqual(2, self.score.get_index_frame(frame, shot_frame)) def test_insert_tree_shot(self): self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] self.score.number = 1 self.score.insert_tree_shot(2, 80) self.assertEqual([0, 0, 1, 1, 2], self.score.shot_index) self.assertEqual([11, 51, 80, 101, 201], self.score.shot_frame) self.assertEqual([1, 3, 3, 5, 7], self.score.array_ball_position_shot_x) def test_insert_position_xy(self): self.score.shot_index = [0, 0, 1, 2] self.score.shot_frame = [11, 51, 101, 201] self.score.array_ball_position_shot_x = [1, 3, 5, 7] self.score.array_ball_position_shot_y = [2, 4, 6, 7] self.score.arrayPlayerAPosition_x = [11, 13, 15, 17] self.score.arrayPlayerAPosition_y = [12, 14, 16, 18] self.score.arrayPlayerBPosition_x = [21, 23, 25, 27] self.score.arrayPlayerBPosition_y = [22, 24, 26, 28] self.score.arrayHitPlayer = ["A", "A", "B", "A"] self.score.arrayBounceHit = ["Bounce", "Hit", "Bounce", "Hit"] self.score.arrayForeBack = ["Fore", "Back", "Back", "Back"] self.score.arrayDirection = ["Cross", "Cross", "Cross", "Cross"] self.score.array_x1 = [1, 2, 3, 4] self.score.array_y1 = [3, 4, 5, 6] self.score.array_x2 = [5, 6, 7, 8] self.score.array_y2 = [7, 8, 9, 10] self.score.array_x3 = [9, 10, 11, 12] self.score.array_y3 = [11, 12, 13, 14] self.score.array_x4 = [13, 14, 15, 16] self.score.array_y4 = [15, 16, 17, 18] frame = 100 x_c, y_c = 1, 2 self.score.insert_position_xy_a(frame, x_c, y_c) self.assertEqual([11, 1, 15, 17], self.score.arrayPlayerAPosition_x) self.score.insert_position_xy_b(frame, x_c, y_c) self.assertEqual([21, 1, 25, 27], self.score.arrayPlayerBPosition_x) self.score.insert_position_xy_ball(frame, x_c, y_c) self.assertEqual([1, 1, 5, 7], self.score.array_ball_position_shot_x)
36.715333
88
0.428213
6,443
55,073
3.516064
0.038957
0.197051
0.119273
0.039728
0.861526
0.830008
0.781231
0.721948
0.668624
0.646332
0
0.123661
0.401503
55,073
1,499
89
36.739827
0.563636
0.123309
0
0.586587
0
0
0.031395
0.001917
0
0
0
0
0.134975
1
0.021222
false
0
0.005093
0
0.027165
0.003396
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1416cb488f6b2f8a8578feb085276d9d9d60c84a
95
py
Python
src/cms/forms/media/__init__.py
S10MC2015/cms-django
b08f2be60a9db6c8079ee923de2cd8912f550b12
[ "Apache-2.0" ]
null
null
null
src/cms/forms/media/__init__.py
S10MC2015/cms-django
b08f2be60a9db6c8079ee923de2cd8912f550b12
[ "Apache-2.0" ]
null
null
null
src/cms/forms/media/__init__.py
S10MC2015/cms-django
b08f2be60a9db6c8079ee923de2cd8912f550b12
[ "Apache-2.0" ]
null
null
null
""" Forms for creating and modifying media objects """ from .document_form import DocumentForm
19
46
0.789474
12
95
6.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.136842
95
4
47
23.75
0.902439
0.484211
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
144883dd5729cd4a4dc16f3d0dba09e070fca685
8,314
py
Python
tests/test_encoding/test_mean_encoder.py
kylegilde/feature_engine
39bc2ff328d7b2eecba0e5d385d603a39992b092
[ "BSD-3-Clause" ]
196
2021-08-06T21:49:52.000Z
2022-03-30T13:59:59.000Z
tests/test_encoding/test_mean_encoder.py
kylegilde/feature_engine
39bc2ff328d7b2eecba0e5d385d603a39992b092
[ "BSD-3-Clause" ]
97
2021-08-06T12:03:40.000Z
2022-03-31T06:37:30.000Z
tests/test_encoding/test_mean_encoder.py
kylegilde/feature_engine
39bc2ff328d7b2eecba0e5d385d603a39992b092
[ "BSD-3-Clause" ]
28
2021-08-09T12:02:49.000Z
2022-03-28T15:48:06.000Z
import pandas as pd import pytest from sklearn.exceptions import NotFittedError from feature_engine.encoding import MeanEncoder, OrdinalEncoder def test_user_enters_1_variable(df_enc): # test case 1: 1 variable encoder = MeanEncoder(variables=["var_A"]) encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"]) X = encoder.transform(df_enc[["var_A", "var_B"]]) # expected output transf_df = df_enc.copy() transf_df["var_A"] = [ 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, ] # test init params assert encoder.variables == ["var_A"] # test fit attr assert encoder.variables_ == ["var_A"] assert encoder.encoder_dict_ == { "var_A": {"A": 0.3333333333333333, "B": 0.2, "C": 0.5} } assert encoder.n_features_in_ == 2 # test transform output pd.testing.assert_frame_equal(X, transf_df[["var_A", "var_B"]]) def test_automatically_find_variables(df_enc): # test case 2: automatically select variables encoder = MeanEncoder(variables=None) encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"]) X = encoder.transform(df_enc[["var_A", "var_B"]]) # expected output transf_df = df_enc.copy() transf_df["var_A"] = [ 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, ] transf_df["var_B"] = [ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.5, 0.5, 0.5, 0.5, ] # test init params assert encoder.variables is None # test fit attr assert encoder.variables_ == ["var_A", "var_B"] assert encoder.encoder_dict_ == { "var_A": {"A": 0.3333333333333333, "B": 0.2, "C": 0.5}, "var_B": {"A": 0.2, "B": 0.3333333333333333, "C": 0.5}, } assert encoder.n_features_in_ == 2 # test transform output pd.testing.assert_frame_equal(X, transf_df[["var_A", "var_B"]]) def test_error_if_y_not_passed_to_fit(df_enc): # test case 3: raises error if target is not passed with pytest.raises(TypeError): encoder = MeanEncoder() encoder.fit(df_enc) def test_warning_if_transform_df_contains_categories_not_present_in_fit_df( df_enc, df_enc_rare ): # test case 4: when dataset to be transformed contains categories not present # in training dataset msg = "During the encoding, NaN values were introduced in the feature(s) var_A." # check for warning when rare_labels equals 'ignore' with pytest.warns(UserWarning) as record: encoder = MeanEncoder(errors="ignore") encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"]) encoder.transform(df_enc_rare[["var_A", "var_B"]]) # check that only one warning was raised assert len(record) == 1 # check that the message matches assert record[0].message.args[0] == msg # check for error when rare_labels equals 'raise' with pytest.raises(ValueError) as record: encoder = MeanEncoder(errors="raise") encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"]) encoder.transform(df_enc_rare[["var_A", "var_B"]]) # check that the error message matches assert str(record.value) == msg def test_fit_raises_error_if_df_contains_na(df_enc_na): # test case 4: when dataset contains na, fit method with pytest.raises(ValueError): encoder = MeanEncoder() encoder.fit(df_enc_na[["var_A", "var_B"]], df_enc_na["target"]) def test_transform_raises_error_if_df_contains_na(df_enc, df_enc_na): # test case 4: when dataset contains na, transform method with pytest.raises(ValueError): encoder = MeanEncoder() encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"]) encoder.transform(df_enc_na) def test_raises_non_fitted_error(df_enc): with pytest.raises(NotFittedError): imputer = OrdinalEncoder() imputer.transform(df_enc) def test_user_enters_1_variable_ignore_format(df_enc_numeric): # test case 1: 1 variable encoder = MeanEncoder(variables=["var_A"], ignore_format=True) encoder.fit(df_enc_numeric[["var_A", "var_B"]], df_enc_numeric["target"]) X = encoder.transform(df_enc_numeric[["var_A", "var_B"]]) # expected output transf_df = df_enc_numeric.copy() transf_df["var_A"] = [ 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, ] # test init params assert encoder.variables == ["var_A"] # test fit attr assert encoder.variables_ == ["var_A"] assert encoder.encoder_dict_ == {"var_A": {1: 0.3333333333333333, 2: 0.2, 3: 0.5}} assert encoder.n_features_in_ == 2 # test transform output pd.testing.assert_frame_equal(X, transf_df[["var_A", "var_B"]]) def test_automatically_find_variables_ignore_format(df_enc_numeric): # test case 2: automatically select variables encoder = MeanEncoder(variables=None, ignore_format=True) encoder.fit(df_enc_numeric[["var_A", "var_B"]], df_enc_numeric["target"]) X = encoder.transform(df_enc_numeric[["var_A", "var_B"]]) # expected output transf_df = df_enc_numeric.copy() transf_df["var_A"] = [ 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, ] transf_df["var_B"] = [ 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.5, 0.5, 0.5, 0.5, ] # test init params assert encoder.variables is None # test fit attr assert encoder.variables_ == ["var_A", "var_B"] assert encoder.encoder_dict_ == { "var_A": {1: 0.3333333333333333, 2: 0.2, 3: 0.5}, "var_B": {1: 0.2, 2: 0.3333333333333333, 3: 0.5}, } assert encoder.n_features_in_ == 2 # test transform output pd.testing.assert_frame_equal(X, transf_df[["var_A", "var_B"]]) def test_variables_cast_as_category(df_enc_category_dtypes): df = df_enc_category_dtypes.copy() encoder = MeanEncoder(variables=["var_A"]) encoder.fit(df[["var_A", "var_B"]], df["target"]) X = encoder.transform(df[["var_A", "var_B"]]) # expected output transf_df = df.copy() transf_df["var_A"] = [ 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, ] pd.testing.assert_frame_equal(X, transf_df[["var_A", "var_B"]], check_dtype=False) assert X["var_A"].dtypes == float def test_error_if_rare_labels_not_permitted_value(): with pytest.raises(ValueError): MeanEncoder(errors="empanada")
26.062696
86
0.582993
1,130
8,314
4.064602
0.109735
0.033094
0.045722
0.054866
0.774222
0.734161
0.712824
0.702373
0.681036
0.674069
0
0.179973
0.28891
8,314
318
87
26.144654
0.596922
0.106447
0
0.767068
0
0
0.066108
0
0
0
0
0
0.100402
1
0.044177
false
0.004016
0.016064
0
0.060241
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
144965eaf880f5786abe891dd408635a5d20d202
79
py
Python
web_test - lipei/scripts/__init__.py
wl027728/web_demo_wl
52bae068afc4bd67f6a2e5b1d29ab7e78f1776f8
[ "MIT" ]
null
null
null
web_test - lipei/scripts/__init__.py
wl027728/web_demo_wl
52bae068afc4bd67f6a2e5b1d29ab7e78f1776f8
[ "MIT" ]
null
null
null
web_test - lipei/scripts/__init__.py
wl027728/web_demo_wl
52bae068afc4bd67f6a2e5b1d29ab7e78f1776f8
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Create Time: 2019/8/28 15:05 Author: 作者 """
15.8
32
0.493671
12
79
3.25
0.916667
0
0
0
0
0
0
0
0
0
0
0.20339
0.253165
79
5
33
15.8
0.457627
0.78481
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
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
14591bbe11542cc7a661758a4968a31b7900f44d
187
py
Python
linked_lists.py
Chansazm/Project_25_LeetCode
703c5b54b2070f234b1b0ddfd2c452083a698e9d
[ "MIT" ]
null
null
null
linked_lists.py
Chansazm/Project_25_LeetCode
703c5b54b2070f234b1b0ddfd2c452083a698e9d
[ "MIT" ]
null
null
null
linked_lists.py
Chansazm/Project_25_LeetCode
703c5b54b2070f234b1b0ddfd2c452083a698e9d
[ "MIT" ]
null
null
null
class Node: def __init__(self,data = None,next = None): self.data = data self.next = next class linked_list: def __init__(self): self.head = None
20.777778
47
0.572193
24
187
4.083333
0.458333
0.142857
0.22449
0
0
0
0
0
0
0
0
0
0.331551
187
9
48
20.777778
0.784
0
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0
0
0.571429
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
1
0
0
5
146fb99c998392d6984b339ca583ff451d13b152
232
py
Python
src/tensorflow_node/__init__.py
elggem/tensorflow_node
8669fcfa058e54673c1348abf197dd1cfc373f68
[ "Unlicense" ]
9
2017-02-14T14:51:40.000Z
2020-02-13T19:31:56.000Z
src/tensorflow_node/__init__.py
elggem/ae-destin
8669fcfa058e54673c1348abf197dd1cfc373f68
[ "Unlicense" ]
1
2017-05-13T13:10:58.000Z
2018-02-23T05:52:19.000Z
src/tensorflow_node/__init__.py
elggem/ae-destin
8669fcfa058e54673c1348abf197dd1cfc373f68
[ "Unlicense" ]
4
2017-06-14T12:13:04.000Z
2020-11-01T12:38:07.000Z
# -*- coding: utf-8 -*- from .utils import SummaryWriter from .input import OpenCVInputLayer from .input import ROSInputLayer from .nodes import AutoEncoderNode from .nodes import StackedAutoEncoderNode from .architectures import *
29
41
0.806034
26
232
7.192308
0.538462
0.096257
0.160428
0
0
0
0
0
0
0
0
0.004926
0.125
232
7
42
33.142857
0.916256
0.090517
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
1485abf46957ea16e24aaee5e642f806be23abec
373
py
Python
zina_uploader/__init__.py
valdergallo/zina_uploader
2916bae8ab2a0541115444f717ad79cc5dba9b23
[ "MIT" ]
1
2020-09-12T10:47:51.000Z
2020-09-12T10:47:51.000Z
zina_uploader/__init__.py
valdergallo/zina_uploader
2916bae8ab2a0541115444f717ad79cc5dba9b23
[ "MIT" ]
null
null
null
zina_uploader/__init__.py
valdergallo/zina_uploader
2916bae8ab2a0541115444f717ad79cc5dba9b23
[ "MIT" ]
null
null
null
""" BUGS ---- :todo: Need install ['IronPythonConsole', 'System', 'System.Windows.Forms.Clipboard', 'clr', 'console', 'email.Generator', 'email.Iterators', 'modes.editingmodes', 'pyreadline.keysyms.make_KeyPress', 'pyreadline.keysyms.make_KeyPress_from_keydescr', 'pyreadline.keysyms.make_keyinfo', 'pyreadline.keysyms.make_keysym', 'startup'] """ __version__ = "0.6.3"
26.642857
85
0.739946
41
373
6.487805
0.707317
0.255639
0.315789
0.218045
0
0
0
0
0
0
0
0.008646
0.069705
373
13
86
28.692308
0.757925
0.914209
0
0
0
0
0.217391
0
0
0
0
0.076923
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
5
1498d51ff471a092f18a99996f32e97131e9baa5
85
py
Python
Scripts/dk/editor/__init__.py
hhg128/DKGL
c61bc6546ac5655da97462cc532a9034ba08516d
[ "PSF-2.0", "BSD-3-Clause" ]
14
2015-09-12T01:32:05.000Z
2021-10-13T02:52:53.000Z
Scripts/dk/editor/__init__.py
hhg128/DKGL
c61bc6546ac5655da97462cc532a9034ba08516d
[ "PSF-2.0", "BSD-3-Clause" ]
null
null
null
Scripts/dk/editor/__init__.py
hhg128/DKGL
c61bc6546ac5655da97462cc532a9034ba08516d
[ "PSF-2.0", "BSD-3-Clause" ]
3
2015-11-10T03:12:49.000Z
2018-10-15T15:38:31.000Z
from . import texturepacker from .app import App from .mainframe import MainFrame
12.142857
32
0.788235
11
85
6.090909
0.454545
0
0
0
0
0
0
0
0
0
0
0
0.176471
85
6
33
14.166667
0.957143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
14a43bd768495e8c8ac7364b19f450fcbd21b6dc
149
py
Python
tests/web_platform/css_flexbox_1/test_flexbox_rowspan.py
fletchgraham/colosseum
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
[ "BSD-3-Clause" ]
null
null
null
tests/web_platform/css_flexbox_1/test_flexbox_rowspan.py
fletchgraham/colosseum
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
[ "BSD-3-Clause" ]
null
null
null
tests/web_platform/css_flexbox_1/test_flexbox_rowspan.py
fletchgraham/colosseum
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
[ "BSD-3-Clause" ]
1
2020-01-16T01:56:41.000Z
2020-01-16T01:56:41.000Z
from tests.utils import W3CTestCase class TestFlexbox_Rowspan(W3CTestCase): vars().update(W3CTestCase.find_tests(__file__, 'flexbox_rowspan'))
24.833333
70
0.805369
17
149
6.647059
0.764706
0
0
0
0
0
0
0
0
0
0
0.022222
0.09396
149
5
71
29.8
0.814815
0
0
0
0
0
0.101351
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
14aaf0a6958e67d51994ada24b7cd47629a24ea1
693
py
Python
pokus/1.py
frantiseknovotny/cdt
aa5fafb7f50235045970deb5ff37064fb4319b3f
[ "BSD-2-Clause" ]
null
null
null
pokus/1.py
frantiseknovotny/cdt
aa5fafb7f50235045970deb5ff37064fb4319b3f
[ "BSD-2-Clause" ]
null
null
null
pokus/1.py
frantiseknovotny/cdt
aa5fafb7f50235045970deb5ff37064fb4319b3f
[ "BSD-2-Clause" ]
1
2021-01-20T17:35:46.000Z
2021-01-20T17:35:46.000Z
# Generated by Selenium IDE import pytest import time import json from needle.cases import NeedleTestCase from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities class MyTests(NeedleTestCase): @classmethod def get_web_driver(cls): return NeedleChrome() n=MyTests() n.driver.get("http://localhost:94/") n.driver.set_window_size(1054, 900)
30.130435
78
0.815296
89
693
6.269663
0.505618
0.150538
0.225806
0.193548
0
0
0
0
0
0
0
0.014706
0.116883
693
22
79
31.5
0.897059
0.036075
0
0
1
0
0.030075
0
0
0
0
0
0
1
0.055556
false
0
0.611111
0.055556
0.777778
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
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
14be3cbfbc9ab0105ae047275a3bfd39b84137c0
81
py
Python
yales2/cylinder-opt/pymooCFD/runPostProc.py
gmclove/pymoo-CFD
fd4a7b1335db33b467fe975ec804f4b055de407c
[ "Apache-2.0" ]
null
null
null
yales2/cylinder-opt/pymooCFD/runPostProc.py
gmclove/pymoo-CFD
fd4a7b1335db33b467fe975ec804f4b055de407c
[ "Apache-2.0" ]
null
null
null
yales2/cylinder-opt/pymooCFD/runPostProc.py
gmclove/pymoo-CFD
fd4a7b1335db33b467fe975ec804f4b055de407c
[ "Apache-2.0" ]
null
null
null
from setup import * from optPreProc.gen0Map import gen0Map # runPostProc(gen):
13.5
38
0.777778
10
81
6.3
0.7
0
0
0
0
0
0
0
0
0
0
0.028986
0.148148
81
5
39
16.2
0.884058
0.209877
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
14beab6994208d27d952ed085877754c697b7d02
12,513
py
Python
src/wikify/tests/view_tests.py
cburgmer/django-wikify
866419a77346c1880f193cba32dec747e5b34dd5
[ "BSD-3-Clause" ]
3
2015-05-18T13:49:32.000Z
2015-05-18T14:37:28.000Z
src/wikify/tests/view_tests.py
cburgmer/django-wikify
866419a77346c1880f193cba32dec747e5b34dd5
[ "BSD-3-Clause" ]
null
null
null
src/wikify/tests/view_tests.py
cburgmer/django-wikify
866419a77346c1880f193cba32dec747e5b34dd5
[ "BSD-3-Clause" ]
null
null
null
from urllib2 import urlparse import fudge from django.utils import unittest from django.test import TestCase from django.db import models from django.http import HttpResponse from django.conf.urls import patterns import reversion from wikify import wikify try: from wikify.diff_utils import side_by_side_diff, context_diff except ImportError: can_test_diff = False else: can_test_diff = True # App environment class Page(models.Model): title = models.CharField(max_length=255, primary_key=True) content = models.TextField(blank=True) class Meta: # Hack: Cannot use an app_label that is under South control, due to http://south.aeracode.org/ticket/520 app_label = "auth" def __unicode__(self): return self.title reversion.register(Page) @wikify('wikify.tests.Page') def page_view(request, object_id): try: page = Page.objects.get(pk=object_id) except Page.DoesNotExist: page = None return HttpResponse("OK") urlpatterns = patterns("", (r'^(?P<object_id>[^/]+)$', page_view), ) # Helpers page_pk_counter = 0; def get_unique_page_title(): global page_pk_counter page_pk_counter += 1; return "test title %d" % page_pk_counter def construct_versions(version_count): assert version_count > 0 with reversion.revision: instance = Page.objects.create(title=get_unique_page_title(), content="content_0") reversion.revision.comment = 'Version 0' versions = [] for i in range(1, version_count): with reversion.revision: instance.content = "content_%s" % i instance.save() reversion.revision.comment = 'Version %s' % i return reversion.get_for_object_reference(Page, instance.pk).order_by("pk") # Test cases class EditViewTest(TestCase): urls = 'wikify.tests' @fudge.patch('wikify.utils.get_model_wiki_form') def test_edit_view_renders_form_on_existing_instance(self, get_model_wiki_form): instance = Page.objects.create(title=get_unique_page_title(), content='test content') fake_form = "fake form" (get_model_wiki_form.is_callable() .returns_fake().is_callable() .with_args(instance=instance) .returns(fake_form)) resp = self.client.get('/%s' % instance.pk, {'action': 'edit'}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/edit.html', [template.name for template in resp.templates]) self.assertEquals(fake_form, resp.context['form']) self.assertEquals(instance.pk, resp.context['object_id']) self.assertEquals(None, resp.context['version']) @fudge.patch('wikify.utils.get_model_wiki_form') def test_edit_view_renders_form_for_creating_an_instance(self, get_model_wiki_form): object_id = "non existing item" fake_form = "fake form" (get_model_wiki_form.is_callable() .returns_fake().is_callable() .returns(fake_form)) resp = self.client.get('/%s' % object_id, {'action': 'edit'}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/edit.html', [template.name for template in resp.templates]) self.assertEquals(fake_form, resp.context['form']) self.assertEquals(object_id, resp.context['object_id']) self.assertEquals(None, resp.context['version']) @fudge.patch('wikify.utils.get_model_wiki_form') def test_edit_view_renders_form_for_instance_version(self, get_model_wiki_form): with reversion.revision: instance = Page.objects.create(title=get_unique_page_title(), content="test content") version = reversion.get_for_object_reference(Page, instance.pk)[0] fake_form = "fake form" (get_model_wiki_form.is_callable() .returns_fake().is_callable() .returns(fake_form)) resp = self.client.get('/%s' % instance.pk, {'action': 'edit', 'version_id': version.id}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/edit.html', [template.name for template in resp.templates]) self.assertEquals(fake_form, resp.context['form']) self.assertEquals(instance.pk, resp.context['object_id']) self.assertEquals(version, resp.context['version']) @fudge.patch('wikify.utils.get_model_wiki_form') def test_edit_view_creates_a_new_instance(self, get_model_wiki_form): object_id = "non existing item" cleaned_data = fudge.Fake('CleanedData').provides('get').returns(None) fake_form = (fudge.Fake('Form').expects('is_valid').returns(True) .expects('save') .has_attr(cleaned_data=cleaned_data)) (get_model_wiki_form.is_callable() .returns_fake().is_callable() .returns(fake_form)) resp = self.client.post('/%s' % object_id, {'action': 'edit'}) self.assertEquals(resp.status_code, 302) location = urlparse.urlsplit(resp['location']).path self.assertEquals(urlparse.unquote(location), '/%s' % object_id) @fudge.patch('wikify.utils.get_model_wiki_form') def test_edit_view_saves_an_existing_instance(self, get_model_wiki_form): instance = Page.objects.create(title=get_unique_page_title(), content='test content') cleaned_data = fudge.Fake('CleanedData').provides('get').returns(None) fake_form = (fudge.Fake('Form').expects('is_valid').returns(True) .expects('save') .has_attr(cleaned_data=cleaned_data)) (get_model_wiki_form.is_callable() .returns_fake().is_callable() .returns(fake_form)) resp = self.client.post('/%s' % instance.pk, {'action': 'edit'}) self.assertEquals(resp.status_code, 302) location = urlparse.urlsplit(resp['location']).path self.assertEquals(urlparse.unquote(location), '/%s' % instance.pk) # TODO # test that comment is saved # test invalid form # test that anonymous user's IP is saved # test that a new version is created class VersionViewTest(TestCase): urls = 'wikify.tests' def test_version_view(self): with reversion.revision: instance = Page.objects.create(title=get_unique_page_title(), content="test content") version = reversion.get_for_object_reference(Page, instance.pk)[0] resp = self.client.get('/%s' % instance.pk, {'action': 'version', 'version_id': version.id}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/version.html', [template.name for template in resp.templates]) self.assertEquals(instance, resp.context['instance']) self.assertEquals(version, resp.context['version']) self.assertEquals(len(resp.context['fields']), 1) _, field_value = resp.context['fields'][0] self.assertEquals(instance.content, field_value) def test_version_view_returns_400_for_invalid_version(self): resp = self.client.get('/test', {'action': 'version', 'version_id': 'a42'}) self.assertEquals(resp.status_code, 404) def test_version_view_returns_400_for_missing_version(self): resp = self.client.get('/test', {'action': 'version', 'version_id': '42'}) self.assertEquals(resp.status_code, 404) class VersionsViewTest(TestCase): urls = 'wikify.tests' def test_versions_view(self): versions = construct_versions(2) versions = versions.reverse() instance = versions[0].object_version.object resp = self.client.get('/%s' % instance.pk, {'action': 'versions'}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/versions.html', [template.name for template in resp.templates]) self.assertEquals(instance.pk, resp.context['object_id']) self.assertEquals(list(versions), list(resp.context['versions'].object_list)) def test_versions_view_shows_paged_results(self): versions = construct_versions(40) versions = versions.reverse() instance = versions[0].object_version.object resp = self.client.get('/%s' % instance.pk, {'action': 'versions'}) self.assertEquals(resp.status_code, 200) self.assertEquals(list(versions[:20]), list(resp.context['versions'].object_list)) def test_versions_view_shows_second_page(self): versions = construct_versions(40) versions = versions.reverse() instance = versions[0].object_version.object resp = self.client.get('/%s' % instance.pk, {'action': 'versions', 'page': '2'}) self.assertEquals(resp.status_code, 200) self.assertEquals(list(versions[20:]), list(resp.context['versions'].object_list)) @unittest.skipUnless(can_test_diff, "Diff match patch library not installed") class DiffViewTest(TestCase): urls = 'wikify.tests' def test_versions_view(self): old, new, next = construct_versions(3) old_instance = old.object_version.object new_instance = new.object_version.object resp = self.client.get('/%s' % old_instance.pk, {'action': 'diff', 'version_id': str(new.id)}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/diff.html', [template.name for template in resp.templates]) self.assertEquals(old, resp.context['old_version']) self.assertEquals(new, resp.context['new_version']) self.assertEquals(next, resp.context['next_version']) self.assertEquals(len(resp.context['fields']), 1) _, old_value, new_value = resp.context['fields'][0] self.assertEquals(old_instance.content, old_value) self.assertEquals(new_instance.content, new_value) def test_diff_view_for_single_version(self): with reversion.revision: new_instance = Page.objects.create(title=get_unique_page_title(), content="test content") new = reversion.get_for_object_reference(Page, new_instance.pk)[0] resp = self.client.get('/%s' % new_instance.pk, {'action': 'diff', 'version_id': str(new.id)}) self.assertEquals(resp.status_code, 200) self.assertIn('wikify/diff.html', [template.name for template in resp.templates]) self.assertEquals(None, resp.context['old_version']) self.assertEquals(new, resp.context['new_version']) self.assertEquals(None, resp.context['next_version']) self.assertEquals(len(resp.context['fields']), 1) _, old_value, new_value = resp.context['fields'][0] self.assertEquals(None, old_value) self.assertEquals(new_instance.content, new_value) def test_diff_view_returns_400_for_invalid_version(self): resp = self.client.get('/test', {'action': 'diff', 'version_id': 'a42'}) self.assertEquals(resp.status_code, 404) def test_diff_view_returns_400_for_missing_version(self): resp = self.client.get('/test', {'action': 'diff', 'version_id': '42'}) self.assertEquals(resp.status_code, 404)
36.802941
112
0.596899
1,385
12,513
5.167509
0.137906
0.102836
0.02515
0.033534
0.754506
0.750594
0.735923
0.726981
0.700713
0.676121
0
0.011346
0.28858
12,513
339
113
36.911504
0.792631
0.020858
0
0.57384
0
0
0.097778
0.014867
0
0
0
0.00295
0.227848
1
0.080169
false
0
0.046414
0.004219
0.194093
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
211fbf5e8327cbc3a78a63b2eb2fe413689e329a
24
py
Python
aviad/pytorch/models/__init__.py
huylb314/AVIAD_AVIJST
bf8e0617849b4f8f4b95ea345be1565ea063ee38
[ "MIT" ]
4
2021-03-17T08:36:52.000Z
2022-03-31T10:32:18.000Z
aviad/tensorflow/models/__init__.py
huylb314/AVIAD_AVIJST
bf8e0617849b4f8f4b95ea345be1565ea063ee38
[ "MIT" ]
null
null
null
aviad/tensorflow/models/__init__.py
huylb314/AVIAD_AVIJST
bf8e0617849b4f8f4b95ea345be1565ea063ee38
[ "MIT" ]
null
null
null
from .aviad import AVIAD
24
24
0.833333
4
24
5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.125
24
1
24
24
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
211fea982fa61c2981568f4cba1481487fbdaefd
164
py
Python
Languages/Python/python_study_1/page8/script.py
myarist/Progate
0132583c989b5ec1805d4de1a6f6861586cf152e
[ "MIT" ]
5
2021-09-08T03:07:22.000Z
2022-03-18T13:36:27.000Z
Languages/Python/python_study_1/page8/script.py
myarist/Progate
0132583c989b5ec1805d4de1a6f6861586cf152e
[ "MIT" ]
null
null
null
Languages/Python/python_study_1/page8/script.py
myarist/Progate
0132583c989b5ec1805d4de1a6f6861586cf152e
[ "MIT" ]
12
2021-05-11T07:54:20.000Z
2022-03-27T02:55:46.000Z
# Tetapkan 'Bob' ke variable my_name my_name = "Bob" # Cetak 'Nama saya Bob' dengan menggabungkan variable my_name dan sebuah string print("Nama saya " + my_name)
32.8
79
0.75
26
164
4.576923
0.576923
0.201681
0.235294
0
0
0
0
0
0
0
0
0
0.164634
164
5
80
32.8
0.868613
0.689024
0
0
0
0
0.265306
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
214b57e459b04c222c5adfb2af752bc2e85c06e8
167
py
Python
tensorkit/flows/__init__.py
lizeyan/tensorkit
2997a5914ec3c3ec72f91eb5906b5ee878fdc020
[ "MIT" ]
null
null
null
tensorkit/flows/__init__.py
lizeyan/tensorkit
2997a5914ec3c3ec72f91eb5906b5ee878fdc020
[ "MIT" ]
null
null
null
tensorkit/flows/__init__.py
lizeyan/tensorkit
2997a5914ec3c3ec72f91eb5906b5ee878fdc020
[ "MIT" ]
2
2020-10-15T06:41:32.000Z
2021-01-27T12:55:11.000Z
from .act_norm import * from .core import * from .coupling import * from .identity import * from .rearrangement import * from .reshape_ import * from .split_ import *
20.875
28
0.748503
22
167
5.545455
0.454545
0.491803
0
0
0
0
0
0
0
0
0
0
0.167665
167
7
29
23.857143
0.877698
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
dcc9e3148495a9e1b21973cffcaadaaa7fbd1982
221
py
Python
apps/users/admin.py
Curiou/classify_email
1fa3162ec6cb499fdda2e51d4c6d7fbd934813db
[ "Apache-2.0" ]
null
null
null
apps/users/admin.py
Curiou/classify_email
1fa3162ec6cb499fdda2e51d4c6d7fbd934813db
[ "Apache-2.0" ]
null
null
null
apps/users/admin.py
Curiou/classify_email
1fa3162ec6cb499fdda2e51d4c6d7fbd934813db
[ "Apache-2.0" ]
1
2020-11-24T05:34:14.000Z
2020-11-24T05:34:14.000Z
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from users.models import UserProfile # Register your models here. # 用UserAdmin 去注册 UserProfile admin.site.register(UserProfile, UserAdmin)
27.625
47
0.832579
29
221
6.344828
0.551724
0.108696
0.184783
0
0
0
0
0
0
0
0
0
0.108597
221
7
48
31.571429
0.93401
0.239819
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
dcea6e2f6f6774c1433d2382a1355e539480cd1e
30
py
Python
AdaTrain_utils/config.py
mpslxz/theano_ops
1cf2ed01f7f3bb2fe393717dd4014d94383a022d
[ "MIT" ]
1
2020-12-11T21:46:24.000Z
2020-12-11T21:46:24.000Z
AdaTrain_utils/config.py
mpslxz/theano_ops
1cf2ed01f7f3bb2fe393717dd4014d94383a022d
[ "MIT" ]
null
null
null
AdaTrain_utils/config.py
mpslxz/theano_ops
1cf2ed01f7f3bb2fe393717dd4014d94383a022d
[ "MIT" ]
null
null
null
INPUT_SIZE = (1, 1, 128, 128)
15
29
0.6
6
30
2.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0.333333
0.2
30
1
30
30
0.375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
dcfa7589b82ba6333f5274590e7542a8d0af4f0d
189
py
Python
tests/web_platform/CSS2/normal_flow/test_block_in_inline_remove_005_nosplit_ref.py
jonboland/colosseum
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
[ "BSD-3-Clause" ]
71
2015-04-13T09:44:14.000Z
2019-03-24T01:03:02.000Z
tests/web_platform/CSS2/normal_flow/test_block_in_inline_remove_005_nosplit_ref.py
jonboland/colosseum
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
[ "BSD-3-Clause" ]
35
2019-05-06T15:26:09.000Z
2022-03-28T06:30:33.000Z
tests/web_platform/CSS2/normal_flow/test_block_in_inline_remove_005_nosplit_ref.py
jonboland/colosseum
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
[ "BSD-3-Clause" ]
139
2015-05-30T18:37:43.000Z
2019-03-27T17:14:05.000Z
from tests.utils import W3CTestCase class TestBlockInInlineRemove005NosplitRef(W3CTestCase): vars().update(W3CTestCase.find_tests(__file__, 'block-in-inline-remove-005-nosplit-ref'))
31.5
93
0.814815
21
189
7.095238
0.857143
0
0
0
0
0
0
0
0
0
0
0.051429
0.074074
189
5
94
37.8
0.8
0
0
0
0
0
0.201058
0.201058
0
0
0
0
0
1
0
true
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
dcfcd5b1fb4ea5a3569b3cce382234c56fba68dd
64
py
Python
srampufparest/__init__.py
lkusters/srampufparest
3c44b3c719db7071e17a5e830e5eecade16ce736
[ "MIT" ]
null
null
null
srampufparest/__init__.py
lkusters/srampufparest
3c44b3c719db7071e17a5e830e5eecade16ce736
[ "MIT" ]
null
null
null
srampufparest/__init__.py
lkusters/srampufparest
3c44b3c719db7071e17a5e830e5eecade16ce736
[ "MIT" ]
null
null
null
from .ModelParametersEstimation import * from .LoadData import *
32
40
0.828125
6
64
8.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.109375
64
2
41
32
0.929825
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0d18e23c4c409bae3b77c988c4cd31dff9bf35b5
165
py
Python
strawberry/extensions/tracing/__init__.py
TheVinhLuong102/Strawberry
3c442dc19d17bc55c4e26de1db7a9eedc0a228f5
[ "MIT" ]
2,062
2019-04-07T17:47:30.000Z
2022-03-31T01:54:16.000Z
strawberry/extensions/tracing/__init__.py
TheVinhLuong102/Strawberry
3c442dc19d17bc55c4e26de1db7a9eedc0a228f5
[ "MIT" ]
1,582
2019-04-07T18:31:33.000Z
2022-03-31T18:32:13.000Z
strawberry/extensions/tracing/__init__.py
TheVinhLuong102/Strawberry
3c442dc19d17bc55c4e26de1db7a9eedc0a228f5
[ "MIT" ]
303
2019-04-13T08:44:40.000Z
2022-03-29T09:54:41.000Z
from .apollo import ApolloTracingExtension, ApolloTracingExtensionSync # noqa from .opentelemetry import OpenTelemetryExtension, OpenTelemetryExtensionSync # noqa
55
85
0.866667
12
165
11.916667
0.75
0
0
0
0
0
0
0
0
0
0
0
0.09697
165
2
86
82.5
0.959732
0.054545
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0d2bc154eb69caee56086721e22b15cd41ab4ef3
21
py
Python
Adafruit_Seesaw/__init__.py
adafruit/Adafruit_Python_seesaw
6b849ee4c579e48edace1711b77ca125d583529e
[ "MIT" ]
2
2017-10-07T02:11:47.000Z
2017-10-16T15:10:01.000Z
Adafruit_Seesaw/__init__.py
adafruit/Adafruit_Python_seesaw
6b849ee4c579e48edace1711b77ca125d583529e
[ "MIT" ]
null
null
null
Adafruit_Seesaw/__init__.py
adafruit/Adafruit_Python_seesaw
6b849ee4c579e48edace1711b77ca125d583529e
[ "MIT" ]
null
null
null
from .seesaw import *
21
21
0.761905
3
21
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
21
1
21
21
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
b4c6b475b27b7930b0e248d2c39c3232e1560d08
108
py
Python
spiderBasic/urllibTest/parseTest/unquoteTest.py
turoDog/LearningPython
8e87e1a6926e2d6d7f131fbadaf63a03e2aa41cd
[ "Apache-2.0" ]
2
2018-07-11T02:13:44.000Z
2019-04-06T02:41:44.000Z
spiderBasic/urllibTest/parseTest/unquoteTest.py
turoDog/LearningPython
8e87e1a6926e2d6d7f131fbadaf63a03e2aa41cd
[ "Apache-2.0" ]
null
null
null
spiderBasic/urllibTest/parseTest/unquoteTest.py
turoDog/LearningPython
8e87e1a6926e2d6d7f131fbadaf63a03e2aa41cd
[ "Apache-2.0" ]
null
null
null
from urllib.parse import unquote url = 'https://www.baidu.com/s?wd=%E5%A3%81%E7%BA%B8' print(unquote(url))
21.6
53
0.712963
21
108
3.666667
0.904762
0.25974
0
0
0
0
0
0
0
0
0
0.060606
0.083333
108
4
54
27
0.717172
0
0
0
0
0.333333
0.416667
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
b4d01ecc0dfde428b22e20b88b0d11bf18a28f24
1,496
py
Python
app/core/migrations/0011_auto_20201207_1953.py
aakash-sheth/django-rest-api
5dcd5eb03c5efccd7011fd6417b50e2ceacff243
[ "MIT" ]
null
null
null
app/core/migrations/0011_auto_20201207_1953.py
aakash-sheth/django-rest-api
5dcd5eb03c5efccd7011fd6417b50e2ceacff243
[ "MIT" ]
null
null
null
app/core/migrations/0011_auto_20201207_1953.py
aakash-sheth/django-rest-api
5dcd5eb03c5efccd7011fd6417b50e2ceacff243
[ "MIT" ]
null
null
null
# Generated by Django 3.1.3 on 2020-12-07 19:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0010_auto_20201203_2152'), ] operations = [ migrations.AlterField( model_name='pricing', name='interest_rate', field=models.DecimalField(decimal_places=4, max_digits=6), ), migrations.AlterField( model_name='pricing', name='max_cagr', field=models.DecimalField(decimal_places=3, max_digits=5), ), migrations.AlterField( model_name='pricing', name='min_cagr', field=models.DecimalField(decimal_places=3, max_digits=5), ), migrations.AlterField( model_name='pricing', name='payment_cap_factor', field=models.DecimalField(decimal_places=3, max_digits=5), ), migrations.AlterField( model_name='pricing', name='prepayment_fv', field=models.DecimalField(decimal_places=3, max_digits=5), ), migrations.AlterField( model_name='pricing', name='prepayment_growth', field=models.DecimalField(decimal_places=3, max_digits=5), ), migrations.AlterField( model_name='pricing', name='targeted_cagr', field=models.DecimalField(decimal_places=3, max_digits=5), ), ]
30.530612
70
0.581551
149
1,496
5.624161
0.328859
0.167064
0.208831
0.242243
0.75179
0.708831
0.613365
0.613365
0.613365
0.613365
0
0.043436
0.307487
1,496
48
71
31.166667
0.765444
0.03008
0
0.642857
1
0
0.114562
0.015873
0
0
0
0
0
1
0
false
0
0.02381
0
0.095238
0
0
0
0
null
0
1
1
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
371a52dfd51a2924eee6ba81f76548c5afdbf131
170
py
Python
bookmanager/book/admin.py
yangyi-d/django_base
b59543143156c1a011d31026af6de05e79aa0ce3
[ "MIT" ]
null
null
null
bookmanager/book/admin.py
yangyi-d/django_base
b59543143156c1a011d31026af6de05e79aa0ce3
[ "MIT" ]
null
null
null
bookmanager/book/admin.py
yangyi-d/django_base
b59543143156c1a011d31026af6de05e79aa0ce3
[ "MIT" ]
null
null
null
from django.contrib import admin from book.models import BookInfo, PeopleInfo # Register your models here. admin.site.register(BookInfo) admin.site.register(PeopleInfo)
24.285714
44
0.823529
23
170
6.086957
0.565217
0.128571
0.242857
0
0
0
0
0
0
0
0
0
0.1
170
7
45
24.285714
0.915033
0.152941
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
2ed659f79291f47f2d902a3671c76088181cec77
573
py
Python
images.py
quantumjim/qubmitmap
0a707c9cd3d1a17f58a0d7571818922ccb177feb
[ "Apache-2.0" ]
1
2019-12-09T08:24:48.000Z
2019-12-09T08:24:48.000Z
images.py
quantumjim/qubitmap
0a707c9cd3d1a17f58a0d7571818922ccb177feb
[ "Apache-2.0" ]
null
null
null
images.py
quantumjim/qubitmap
0a707c9cd3d1a17f58a0d7571818922ccb177feb
[ "Apache-2.0" ]
null
null
null
mario = {} for x in range(8): for y in range(8): mario[x,y] = (255,255,255) for (x,y) in [(0,3),(0,4),(0,5),(5,3),(5,4),(5,5),(2,0),(3,0),(1,1),(2,1),(3,1),(4,1),(2,3),(3,3)]: mario[x,y] = (255,0,0) for (x,y) in [(1,3),(1,4),(1,5),(1,6),(4,3),(4,4),(4,5),(4,6),(2,4),(2,5),(3,4),(3,5)]: mario[x,y] = (0,0,255) for (x,y) in [(2,2),(3,2)]: mario[x,y] = (255,192,203) for (x,y) in [(0,7),(1,7),(4,7),(5,7)]: mario[x,y] = (92,64,51) for (x,y) in [(6,5),(7,4)]: mario[x,y] = (210,180,140) for (x,y) in [(7,5),(7,3)]: mario[x,y] = (107,92,72)
33.705882
99
0.422339
149
573
1.624161
0.174497
0.107438
0.202479
0.173554
0.161157
0
0
0
0
0
0
0.257796
0.160558
573
17
100
33.705882
0.245322
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
0
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2eefe13bd80d61a2ff8129544c2341e74d87b70b
35
py
Python
algobattle/problems/testsproblem/generator_execution_error/main.py
Benezivas/algobattle
ffcd769ecdbfdf17994bb2b142cdcfc2b80ea64e
[ "MIT" ]
4
2021-01-17T19:27:13.000Z
2021-12-16T16:24:20.000Z
algobattle/problems/testsproblem/solver_execution_error/main.py
Benezivas/algobattle
ffcd769ecdbfdf17994bb2b142cdcfc2b80ea64e
[ "MIT" ]
11
2021-11-20T14:03:30.000Z
2022-03-16T10:58:15.000Z
algobattle/problems/testsproblem/generator_execution_error/main.py
Benezivas/algobattle
ffcd769ecdbfdf17994bb2b142cdcfc2b80ea64e
[ "MIT" ]
2
2021-11-18T17:30:50.000Z
2021-12-16T16:24:25.000Z
print This python script is broken
17.5
34
0.828571
6
35
4.833333
1
0
0
0
0
0
0
0
0
0
0
0
0.171429
35
1
35
35
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
2ef889039c33915723a1950b672c940f85bdd372
176
py
Python
intvalpy/linear/__init__.py
SShary/intvalpy
42f4c8f6b23e6481f4032b0a0f7cc0d798fda3be
[ "MIT" ]
null
null
null
intvalpy/linear/__init__.py
SShary/intvalpy
42f4c8f6b23e6481f4032b0a0f7cc0d798fda3be
[ "MIT" ]
null
null
null
intvalpy/linear/__init__.py
SShary/intvalpy
42f4c8f6b23e6481f4032b0a0f7cc0d798fda3be
[ "MIT" ]
null
null
null
from .overdetermined import Rohn, PSS from .square_system import Gauss, Gauss_Seidel from .system_properties import Uni, Tol, ive from .solution_set import lineqs, IntLinIncR2
35.2
46
0.829545
25
176
5.68
0.68
0
0
0
0
0
0
0
0
0
0
0.006452
0.119318
176
4
47
44
0.909677
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
2c116a8a61daaeec857f93c478f9d32e56c8e5d9
61
py
Python
fed_distill/fed/__init__.py
Ahmedjjj/dataset-distillation
f2e4267d070c7fb8e50476297e95638f351b76d6
[ "MIT" ]
null
null
null
fed_distill/fed/__init__.py
Ahmedjjj/dataset-distillation
f2e4267d070c7fb8e50476297e95638f351b76d6
[ "MIT" ]
null
null
null
fed_distill/fed/__init__.py
Ahmedjjj/dataset-distillation
f2e4267d070c7fb8e50476297e95638f351b76d6
[ "MIT" ]
null
null
null
from fed_distill.fed.splitter import HeterogenousDistribution
61
61
0.918033
7
61
7.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.04918
61
1
61
61
0.948276
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
2c158d944d24e3dcd5520f92165905d2e9338624
98
py
Python
angr/engines/vex/statements/abihint.py
mariusmue/angr
f8304c4b1f0097a721a6692b02a45cabaae137c5
[ "BSD-2-Clause" ]
8
2016-01-19T03:13:32.000Z
2020-11-03T09:30:05.000Z
angr/engines/vex/statements/abihint.py
mariusmue/angr
f8304c4b1f0097a721a6692b02a45cabaae137c5
[ "BSD-2-Clause" ]
null
null
null
angr/engines/vex/statements/abihint.py
mariusmue/angr
f8304c4b1f0097a721a6692b02a45cabaae137c5
[ "BSD-2-Clause" ]
3
2017-04-24T00:22:30.000Z
2020-11-03T09:30:06.000Z
from . import SimIRStmt class SimIRStmt_AbiHint(SimIRStmt): def _execute(self): pass
16.333333
35
0.704082
11
98
6.090909
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.22449
98
5
36
19.6
0.881579
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
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
1
0
0
1
0
0
5
25ba203efb390b9baaaca3818fe3243d797acc22
121
py
Python
Hero_Masum/admin.py
MasumBhai/Learning-Python-Django
8fc231838dc27861c70ae1c4de5749b1bfefa0c2
[ "Apache-2.0" ]
1
2021-04-02T06:25:09.000Z
2021-04-02T06:25:09.000Z
Hero_Masum/admin.py
MasumBhai/Learning-Python-Django
8fc231838dc27861c70ae1c4de5749b1bfefa0c2
[ "Apache-2.0" ]
null
null
null
Hero_Masum/admin.py
MasumBhai/Learning-Python-Django
8fc231838dc27861c70ae1c4de5749b1bfefa0c2
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import ToDoList # Register your models here. admin.site.register(ToDoList)
24.2
32
0.818182
17
121
5.823529
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.115702
121
5
33
24.2
0.925234
0.214876
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
25cc1b4a013e1a92185f590ab9adbb9a29066c7f
269
py
Python
vectorai/analytics/analytics.py
0xflotus/vectorai
590f7f0ca135c751c3ea366664d341212e107003
[ "Apache-2.0" ]
null
null
null
vectorai/analytics/analytics.py
0xflotus/vectorai
590f7f0ca135c751c3ea366664d341212e107003
[ "Apache-2.0" ]
null
null
null
vectorai/analytics/analytics.py
0xflotus/vectorai
590f7f0ca135c751c3ea366664d341212e107003
[ "Apache-2.0" ]
null
null
null
"""Mixin class for analytics submodule containing vector analytics tools. """ from .dimensionality_reduction import * from .viz import * class ViAnalyticsMixin(VizMixin): """ Vi Analytics Mixin. Currently includes visualisation mixin. """ pass
17.933333
73
0.713755
27
269
7.074074
0.740741
0
0
0
0
0
0
0
0
0
0
0
0.204461
269
14
74
19.214286
0.892523
0.486989
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.5
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
25d416ce5425d520ac7757ebfe93afb7a38d347a
146
py
Python
stagifyapi/api/urls.py
Davee02/Stagify
048dd53219267cfdbe804cd91626a06964f64a2a
[ "MIT" ]
null
null
null
stagifyapi/api/urls.py
Davee02/Stagify
048dd53219267cfdbe804cd91626a06964f64a2a
[ "MIT" ]
2
2021-01-02T18:02:56.000Z
2021-01-04T18:24:08.000Z
stagifyapi/api/urls.py
Davee02/Stagify
048dd53219267cfdbe804cd91626a06964f64a2a
[ "MIT" ]
null
null
null
from django.urls import path from .views import auth, concert, artist urlpatterns = auth.urlpatterns + concert.urlpatterns + artist.urlpatterns
24.333333
73
0.80137
18
146
6.5
0.555556
0.290598
0
0
0
0
0
0
0
0
0
0
0.130137
146
5
74
29.2
0.92126
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
25f6ff4ff36a2b5bd659611bf3305172c03a1ca8
141
py
Python
src/amuse/support/io/horizons.py
rknop/amuse
85d5bdcc29cfc87dc69d91c264101fafd6658aec
[ "Apache-2.0" ]
131
2015-06-04T09:06:57.000Z
2022-02-01T12:11:29.000Z
src/amuse/support/io/horizons.py
rknop/amuse
85d5bdcc29cfc87dc69d91c264101fafd6658aec
[ "Apache-2.0" ]
690
2015-10-17T12:18:08.000Z
2022-03-31T16:15:58.000Z
src/amuse/support/io/horizons.py
rieder/amuse
3ac3b6b8f922643657279ddee5c8ab3fc0440d5e
[ "Apache-2.0" ]
102
2015-01-22T10:00:29.000Z
2022-02-09T13:29:43.000Z
import warnings warnings.warn("amuse.support.io is depreacated, use amuse.io instead", DeprecationWarning) from amuse.io.horizons import *
23.5
90
0.801418
19
141
5.947368
0.684211
0.123894
0
0
0
0
0
0
0
0
0
0
0.106383
141
5
91
28.2
0.896825
0
0
0
0
0
0.375887
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d38ead305ebcab9f071c5f9e1555f0ee2ddab518
251
py
Python
boa3_test/test_sc/interop_test/contract/CreateStandardAccount.py
hal0x2328/neo3-boa
6825a3533384cb01660773050719402a9703065b
[ "Apache-2.0" ]
25
2020-07-22T19:37:43.000Z
2022-03-08T03:23:55.000Z
boa3_test/test_sc/interop_test/contract/CreateStandardAccount.py
hal0x2328/neo3-boa
6825a3533384cb01660773050719402a9703065b
[ "Apache-2.0" ]
419
2020-04-23T17:48:14.000Z
2022-03-31T13:17:45.000Z
boa3_test/test_sc/interop_test/contract/CreateStandardAccount.py
hal0x2328/neo3-boa
6825a3533384cb01660773050719402a9703065b
[ "Apache-2.0" ]
15
2020-05-21T21:54:24.000Z
2021-11-18T06:17:24.000Z
from boa3.builtin import public from boa3.builtin.interop.contract import create_standard_account from boa3.builtin.type import ECPoint, UInt160 @public def main(public_key: bytes) -> UInt160: return create_standard_account(ECPoint(public_key))
27.888889
65
0.820717
35
251
5.714286
0.514286
0.12
0.225
0
0
0
0
0
0
0
0
0.040179
0.10757
251
8
66
31.375
0.852679
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.5
0.166667
0.833333
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
1
1
0
0
5
d392fddc7a14f99552b9b21f870a49acd05bebba
129
py
Python
ros_ws/src/baxter_tools/scripts/enable_robot.py
mesneym/Baxter-Arm-PP
fdbf86309bc64c31af105daa026b2f8519710129
[ "MIT" ]
null
null
null
ros_ws/src/baxter_tools/scripts/enable_robot.py
mesneym/Baxter-Arm-PP
fdbf86309bc64c31af105daa026b2f8519710129
[ "MIT" ]
null
null
null
ros_ws/src/baxter_tools/scripts/enable_robot.py
mesneym/Baxter-Arm-PP
fdbf86309bc64c31af105daa026b2f8519710129
[ "MIT" ]
null
null
null
version https://git-lfs.github.com/spec/v1 oid sha256:2ca67dfd27bde5d3f25895799f93bee67063877ea1bd205020b50bf0a183eb32 size 3317
32.25
75
0.883721
13
129
8.769231
1
0
0
0
0
0
0
0
0
0
0
0.390244
0.046512
129
3
76
43
0.536585
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
d393fef98a651b118463b553b7b7bdc3c661d3b9
69
py
Python
nrconv/__init__.py
JulianPL/Non-Rectangular_Convolution
383e217b6559c486557545a1a7b29294ed39c01b
[ "MIT" ]
null
null
null
nrconv/__init__.py
JulianPL/Non-Rectangular_Convolution
383e217b6559c486557545a1a7b29294ed39c01b
[ "MIT" ]
null
null
null
nrconv/__init__.py
JulianPL/Non-Rectangular_Convolution
383e217b6559c486557545a1a7b29294ed39c01b
[ "MIT" ]
null
null
null
#!/usr/bin/python3 from .primes import * from .convolution import *
13.8
26
0.724638
9
69
5.555556
0.777778
0
0
0
0
0
0
0
0
0
0
0.016949
0.144928
69
4
27
17.25
0.830508
0.246377
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
6ca981901f698a5c0016c2c2e181602cc208373e
70
py
Python
bpush/utils/__init__.py
semitable/boulderpush
d5ecb343ae4370de9683d63b7a4cf94b51a48d4e
[ "MIT" ]
62
2020-06-17T17:32:47.000Z
2022-03-25T06:04:30.000Z
rware/utils/__init__.py
LukasSchaefer/robotic-warehouse
d5e594bf3430c29e7a3a75feb4a5de5547549d3d
[ "MIT" ]
6
2020-06-09T20:12:05.000Z
2022-03-30T13:05:31.000Z
rware/utils/__init__.py
LukasSchaefer/robotic-warehouse
d5e594bf3430c29e7a3a75feb4a5de5547549d3d
[ "MIT" ]
13
2020-06-11T09:19:17.000Z
2022-03-30T01:18:31.000Z
from .spaces import MultiAgentActionSpace, MultiAgentObservationSpace
35
69
0.9
5
70
12.6
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
70
1
70
70
0.969231
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
6ccc673560eafe7b74331b72fde0fb425dc7d908
90
py
Python
test/test_scanning_a_package.py
assuremoss/lastpymile
363d3fcf539b8f80c30b0554c893569b5a09591b
[ "Apache-2.0" ]
12
2021-12-20T10:15:31.000Z
2022-03-25T03:24:22.000Z
test/test_scanning_a_package.py
assuremoss/lastpymile
363d3fcf539b8f80c30b0554c893569b5a09591b
[ "Apache-2.0" ]
null
null
null
test/test_scanning_a_package.py
assuremoss/lastpymile
363d3fcf539b8f80c30b0554c893569b5a09591b
[ "Apache-2.0" ]
1
2022-02-23T03:26:55.000Z
2022-02-23T03:26:55.000Z
""" Scanning a package on PyPI and generates a list of phanton files and lines if any """
22.5
81
0.733333
16
90
4.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.2
90
3
82
30
0.916667
0.9
0
null
1
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
1
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
9f00734ce3e8ce010f073018cdbba87bda8ab855
72
py
Python
keras_contrib/activations/__init__.py
rgreenblatt/keras-contrib
46fcdb9384b3bc9399c651b2b43640aa54098e64
[ "MIT" ]
11
2019-03-23T13:23:49.000Z
2022-01-20T07:57:56.000Z
keras_contrib/activations/__init__.py
rgreenblatt/keras-contrib
46fcdb9384b3bc9399c651b2b43640aa54098e64
[ "MIT" ]
1
2017-12-26T02:59:59.000Z
2017-12-26T02:59:59.000Z
keras_contrib/activations/__init__.py
rgreenblatt/keras-contrib
46fcdb9384b3bc9399c651b2b43640aa54098e64
[ "MIT" ]
11
2017-07-06T14:11:51.000Z
2021-08-21T23:18:20.000Z
from __future__ import absolute_import from keras.activations import *
18
38
0.847222
9
72
6.222222
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.125
72
3
39
24
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9f27edf96a036bbfc4443e46bc3b12d7b8cb7ed6
34
py
Python
ext/DataMining/3_FeatureEngineering/smbinning/__init__.py
Jie-Yuan/1_DataMining
f5338388b4f883233f350d4fb9c5903180883430
[ "Apache-2.0" ]
14
2019-06-25T13:46:32.000Z
2020-10-27T02:04:59.000Z
ext/DataMining/3_FeatureEngineering/smbinning/__init__.py
Jie-Yuan/2_DataMining
f5338388b4f883233f350d4fb9c5903180883430
[ "Apache-2.0" ]
null
null
null
ext/DataMining/3_FeatureEngineering/smbinning/__init__.py
Jie-Yuan/2_DataMining
f5338388b4f883233f350d4fb9c5903180883430
[ "Apache-2.0" ]
7
2019-06-25T13:26:16.000Z
2020-10-27T02:05:03.000Z
''' python版smbinning: 支持多分类分箱 '''
6.8
17
0.676471
2
34
11.5
1
0
0
0
0
0
0
0
0
0
0
0
0.117647
34
4
18
8.5
0.766667
0.735294
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
9f87318b5bab1eee38e6c782ddcdcbbcdc63f869
201
py
Python
001271edxDev1274xPythonIntro/edx001271Dev274xU02s1ss2_TASK01_20200506.py
SafonovMikhail/python_000577
739f764e80f1ca354386f00b8e9db1df8c96531d
[ "Apache-2.0" ]
null
null
null
001271edxDev1274xPythonIntro/edx001271Dev274xU02s1ss2_TASK01_20200506.py
SafonovMikhail/python_000577
739f764e80f1ca354386f00b8e9db1df8c96531d
[ "Apache-2.0" ]
null
null
null
001271edxDev1274xPythonIntro/edx001271Dev274xU02s1ss2_TASK01_20200506.py
SafonovMikhail/python_000577
739f764e80f1ca354386f00b8e9db1df8c96531d
[ "Apache-2.0" ]
null
null
null
# [ ] slice long_word to print "act" and to print "tic" long_word = "characteristics" print(long_word[4:7]) # [ ] slice long_word to print "sequence" long_word = "Consequences" print(long_word[3:-1])
25.125
55
0.711443
32
201
4.28125
0.46875
0.350365
0.189781
0.218978
0.291971
0
0
0
0
0
0
0.023256
0.144279
201
7
56
28.714286
0.773256
0.462687
0
0
0
0
0.257143
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
9f9d8c7c755ae4f7e317879a53fe48142eea5344
84
py
Python
src/hashing/cms/__init__.py
williamvietnguyen/modern-algorithm-ideas
91b601d81c1db5e677ae9b672f5c51c389194a6c
[ "MIT" ]
null
null
null
src/hashing/cms/__init__.py
williamvietnguyen/modern-algorithm-ideas
91b601d81c1db5e677ae9b672f5c51c389194a6c
[ "MIT" ]
null
null
null
src/hashing/cms/__init__.py
williamvietnguyen/modern-algorithm-ideas
91b601d81c1db5e677ae9b672f5c51c389194a6c
[ "MIT" ]
null
null
null
# William Nguyen # email: williamvnguyen2@gmail.com from .count_min_sketch import *
21
34
0.797619
11
84
5.909091
1
0
0
0
0
0
0
0
0
0
0
0.013514
0.119048
84
4
35
21
0.864865
0.559524
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9fa06767026f5985eaf209507f2e0da87498747f
168
py
Python
conversations/admin.py
ph00lt0/websms
1f9ef48fd2fe1540770dc90022b142aed3d7d214
[ "MIT" ]
null
null
null
conversations/admin.py
ph00lt0/websms
1f9ef48fd2fe1540770dc90022b142aed3d7d214
[ "MIT" ]
null
null
null
conversations/admin.py
ph00lt0/websms
1f9ef48fd2fe1540770dc90022b142aed3d7d214
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Conversation, Message # Register your models here. admin.site.register(Conversation) admin.site.register(Message)
24
41
0.821429
22
168
6.272727
0.545455
0.130435
0.246377
0
0
0
0
0
0
0
0
0
0.10119
168
7
42
24
0.913907
0.154762
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
4c91e2234772b2922433e9dd16e37e64ba5a4afd
186
py
Python
myproject/templates/maid/urls.py
krishnatahr/matter
26cff865298ab10d0a9a9ac7a9d821099c314969
[ "Apache-2.0" ]
null
null
null
myproject/templates/maid/urls.py
krishnatahr/matter
26cff865298ab10d0a9a9ac7a9d821099c314969
[ "Apache-2.0" ]
null
null
null
myproject/templates/maid/urls.py
krishnatahr/matter
26cff865298ab10d0a9a9ac7a9d821099c314969
[ "Apache-2.0" ]
null
null
null
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: )
18.6
51
0.763441
23
186
6.173913
0.608696
0.211268
0.197183
0
0
0
0
0
0
0
0
0
0.145161
186
9
52
20.666667
0.893082
0.048387
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
4cb243b598eecebcd6d126cb3cdd750c5f65f53c
128
py
Python
sdk/ml/azure-ai-ml/tests/test_utilities/constants.py
dubiety/azure-sdk-for-python
62ffa839f5d753594cf0fe63668f454a9d87a346
[ "MIT" ]
1
2022-02-01T18:50:12.000Z
2022-02-01T18:50:12.000Z
sdk/ml/azure-ai-ml/tests/test_utilities/constants.py
ellhe-blaster/azure-sdk-for-python
82193ba5e81cc5e5e5a5239bba58abe62e86f469
[ "MIT" ]
null
null
null
sdk/ml/azure-ai-ml/tests/test_utilities/constants.py
ellhe-blaster/azure-sdk-for-python
82193ba5e81cc5e5e5a5239bba58abe62e86f469
[ "MIT" ]
null
null
null
Test_Workspace_Name = "test_workspace_name" Test_Subscription = "test_subscription" Test_Resource_Group = "test_resource_group"
32
43
0.859375
16
128
6.25
0.375
0.26
0.34
0.42
0
0
0
0
0
0
0
0
0.070313
128
3
44
42.666667
0.840336
0
0
0
0
0
0.429688
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
981ba12b49c05afed62150000fa97c83f016b0ef
84
py
Python
fooof/plts/__init__.py
varman-m/eeg_notebooks_doc
12230719637c8087b020e8d5feeb20520a4da74d
[ "Apache-2.0" ]
1
2020-11-05T21:30:07.000Z
2020-11-05T21:30:07.000Z
fooof/plts/__init__.py
Xawwell/fooof
7a520c4f8ac3a44f4f18dc025b5e5d40049c9f2b
[ "Apache-2.0" ]
null
null
null
fooof/plts/__init__.py
Xawwell/fooof
7a520c4f8ac3a44f4f18dc025b5e5d40049c9f2b
[ "Apache-2.0" ]
null
null
null
"""Plots sub-module for FOOOF.""" from .spectra import plot_spectrum, plot_spectra
21
48
0.761905
12
84
5.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.119048
84
3
49
28
0.837838
0.321429
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
981d07ae3213efa82a114f5368d0bb40330801c6
240
py
Python
app/projects/models/__init__.py
open-plan-tool/epa
2a2354d1f8440314b8ae72fb3e5e6c3d121abc90
[ "MIT" ]
null
null
null
app/projects/models/__init__.py
open-plan-tool/epa
2a2354d1f8440314b8ae72fb3e5e6c3d121abc90
[ "MIT" ]
112
2021-11-25T12:12:01.000Z
2022-03-31T20:27:32.000Z
app/projects/models/__init__.py
open-plan-tool/epa
2a2354d1f8440314b8ae72fb3e5e6c3d121abc90
[ "MIT" ]
null
null
null
from projects.models.base_models import * from projects.models.simulation_models import ( Simulation, SensitivityAnalysis, get_project_sensitivity_analysis, ) from projects.models.usecases import UseCase, load_usecase_from_dict
30
68
0.825
28
240
6.785714
0.535714
0.189474
0.284211
0
0
0
0
0
0
0
0
0
0.120833
240
7
69
34.285714
0.900474
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.428571
0
0.428571
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e2180fe5c06d5a3413f1e03df77e9717c7a5a734
379
py
Python
builtinPlugins/brokerage_charlesSchwab.py
jscherer26/Icarra
5bc8b298ae21dcde7e8e2253b9ed9db95fd0d164
[ "BSD-3-Clause" ]
1
2021-11-09T04:36:57.000Z
2021-11-09T04:36:57.000Z
builtinPlugins/brokerage_charlesSchwab.py
jscherer26/Icarra
5bc8b298ae21dcde7e8e2253b9ed9db95fd0d164
[ "BSD-3-Clause" ]
null
null
null
builtinPlugins/brokerage_charlesSchwab.py
jscherer26/Icarra
5bc8b298ae21dcde7e8e2253b9ed9db95fd0d164
[ "BSD-3-Clause" ]
2
2020-03-28T02:55:19.000Z
2021-11-09T04:37:08.000Z
from brokerage import * class Brokerage(BrokerageBase): def getName(self): return "Charles Schwab" def getUrl(self): return "https://ofx.schwab.com/cgi_dev/ofx_server" def getOrg(self): return "ISC" def getFid(self): return "5104" def getBrokerId(self): return "Schwab.com" def getNotes(self): return [] def massageTransaction(self, trans): pass
15.791667
52
0.699208
49
379
5.367347
0.55102
0.228137
0
0
0
0
0
0
0
0
0
0.012862
0.17942
379
23
53
16.478261
0.832797
0
0
0
0
0
0.189974
0
0
0
0
0
0
1
0.4375
false
0.0625
0.0625
0.375
0.9375
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
1
0
1
1
0
0
5
e2316a89045bf6e8c558dc84faa9b477fb739642
5,663
py
Python
baidu.py
powerQiu/phone_number_seg_spider
ece7dc06b40042f97c0f4f3ea452765a9b25ac5f
[ "MIT" ]
1
2021-04-08T08:47:15.000Z
2021-04-08T08:47:15.000Z
baidu.py
powerQiu/phone_number_seg_spider
ece7dc06b40042f97c0f4f3ea452765a9b25ac5f
[ "MIT" ]
null
null
null
baidu.py
powerQiu/phone_number_seg_spider
ece7dc06b40042f97c0f4f3ea452765a9b25ac5f
[ "MIT" ]
null
null
null
# https://haoma.baidu.com/phoneSearch import requests class BaiDuHaoMa: def __init__(self): self.sess = requests.Session() def index(self): self.sess.get(url="https://haoma.baidu.com/phoneSearch") def info(self): self.sess.get(url="https://haoma.baidu.com/api/v1/user/info") def abdr(self): payload = "eyJkYXRhIjoiYTBhZDUyZjQwZWQ4OWZjYjI1NmQ0MDg2ZDJlMjhiNTg5OTkyNzZhZTk4YWU4ODM5YmZkOGVkNDU3MGI2YjJjOWY5YTM0N2Y5OGUxMWU4OGM4YTk2MDFlOWVlNzRkMTM0NmIzNTYzYzk2MmNmNzU0MTBlYjdmNWIxNjlhOGEwODlhYTgzOGEwYzY4M2I4NDM0OGVjMGFjNzA1N2Y5YjI0MDcwN2I0MDIwOTk3MDM2M2U2MzI5ZGE0Y2QxMjQ3ODU3ZjBjMjg3NTNiOGUzZTA0YTdlMGYyZGY5ZGZhNGM2NzI4MTM1MzkyN2FlMjMwZDA2MTBhZjljNDFlYmEwNzNiOTdkYWVkODVlNDkwMjQwMzRhNGY0OGUzMzcyZmMzY2ViMzlmNDQyNzc0MmM3NjA0ODgwN2E0MWQ1ODg4YzBhNTdiMWRjNGRkYzA1ZmIwYWEzZGUzOWRlNjRhYzMwNzRhNTdhNzRjMTRhZDc0ZDM3ZmVhOWFhZTQxOWMzYzZjM2JkZGRiMTYwOTQwMmU3ZmYxMjRhYTY5Y2VkYzRlN2IwMGI1MTEwNzA2MjJlOTBjZjRkN2Q3NjljY2E4YTM4ZTYyMzFkOTk1N2YzMWU5ODE4NGE4Mjg2NTA2Njk1MmYxYjg5YzYxMmJlNzNmNDRjOGY4MGViNDM4YTljMzc2YWJhNzNkOWQwNDc0YTIzMDFlZWM2ZmQ0MmY4NTIyYzZlM2YxZWM5YjAxMTczZjRkNjUwMTIwNDNmOWQ0OTRhZGYyYmJkYjY1YzgwMzhlNTJjZGY4MWMzZGVhYTY2YTM3ZmFhMmNhODE3Nzc1YWE5ZDAwZDllMjgyYmVhMTE1MzFjMGVjYzJkOTNiZmEzOTkyNDhlYjExYmI1NDM5NDk3ODg2NTFkNGQ1Mjg3MDZkYWFkYzE2MmU3MjExMDI1Y2RjZDg3MDA3NmYxYWNmZjk5ZjBjZmQ3N2NjMDY1ZDA5N2FjOWNlZmJiMGE0ODY1OWU3MmQ1YzhjYTY5MjBmNDhiN2EwMGQyNjYyZmQxMDhlM2FiNjcxOTU5NjAzMDhhZGIxNGFhY2IzODhiZGQ2OTIwZWZiZjhmYjk2Y2I2YWY0MGFkOTViZDM4Mzk0ODBjNGMxYTNiNDJhNDhkNzUwNGM0YmRjZmU4ZTVhMGYwNDYxODNkODM5YmViZmYxMTc0Y2Q1MzZlMTg5ZTczODkzZDk3Zjk3YWY1NWU5MDUyYmZlZmNkMzZkMzc5OWRiZGE2M2QxZDZiNTM3OTAyOWNhMzJiYjA4MDc4NzI0NTQ0YjA1Y2EzZWQ3MjVhYzkxYWEwNmFlYTFiYTAzYWFmZTg4MjE4ZjZjN2UwYjllYWEwZTVhNmVjM2JkYjMwZDMzMDNhMzI3OTg1MWFhZGQ0Y2E1NDIxZWFhY2QyYzVhMmY3OGM0OGEwOGI2M2NiY2VkNGY1MGExMGMwYTc3OTg4YmFhMjZhNWM2YjY1YTdhNmM0ZWEzODJkNWI3NTE2Mjg1YzE3ZjQ0ZTI0ZWY4YzI4NzMyMDAzZTc1NzQyZTY1ZWE1ODMyYzg3ZmEwMWRhZjdiN2RhM2RjMjVmOWFlNTFlNTllYzE2YTgxMDMxZWQzZGMyMDkzYmM5NzcwYzI3YWVlYWM2ZGZjNTBiMWYwOWFjY2I5YzZkZjA4NGZhZGUzOTJjZGIyODY1MGRhN2M0MjE3NmQ0N2EyZjcwZmIwYmNkNjczOTRlYTYzMzNkYjUzMzI4ODRjYThiMGU2MGQ3ODM0OTZmMmZlZDYwODgxYWQxNzljY2JhYTk1NDFmMTFjYzU3ZTdkYmYyN2RiODM0ZDlkNjExZjczNDJjOGM1YWJkNzZhZjY4MWVhYzJhOWIyNzgwNGE5ZDNiODEwODNmMTkzMjhhY2I1NGFmYTE3M2JlZTQ3MjhiMjVmZTFjZDZhYzZmNGU3OWNlMmY0ZGY3NDFiOTc5MjczNzc4ZjU2Y2VjM2ZlOTFlZDU3NzM4YTBmMDcwNzI4OGVkYjgwNjRjNWJjOThiMjU5YjY3OTUxYzQxOTcxZDRjNjFlYTJjMDRmYWIxNDA1NDJhOTE0NGI2NzJmZjM3YmJhYTcxMjFjNzIzMGRhNWRjOTY5NzJkYTZiNDMxZjhlOTk4N2Y2ODQ1M2UwOWEzOWFhZDRhYWM4MjY2OWVjOTE3OTI1NTNlMTgxNDYzMTc3NmY3MDIwY2Q2YzIxODJlNzkxNDQ4YWU5YjQ5M2M2NTAyYjU2ZjRjZGMwZDBjMjQ4OTAxZmE5ZGIwYTBiNGQ2YjVmMzlmN2YwZTEwYmY2OWE4NWVjMzRjNzRkY2Y5ZDE4YzNhOTJmNDM2YmM1NmQ5ZTYwYmUwNGFiNTQ3NjBmNTQ2NTYxODUwYzRhNzZlZWY3OGRjMjhlNDIyY2MzOGIwMGI4NjliNjgzMTAwZTM4MjBkNzM5MTY0Y2ZlMTVlZThjMWJjM2M4MzkzOWMyNDgzY2Y1ODkyYjgyNmIyYThmMWMyNTUxNTIwMWI2MDQ2NjA0OWMyY2ViYjMzZjIzOTVkMTBkYWYyMTVkNWQ5ZTg5MDA0ZDA0MDZhNTI4ZTdhODhkNDg1MmI1NDA5NTljYzViMTc3YzVhYzZiM2Y3MjQ2NjkwZWZkMWIwOGRmOGJiY2QwMWJhYWNiMDIyZGIyNmJkYTMxYjZlYjlmYjk3OTQ4M2RkNjliM2JiZGFmNTgyZjg3OWM0ZDg1MmFkM2I0YzdmNjRjZTFkZmM4YzRkNzNiNzg0NjQzYzdhNDhiMTk4ZDAxNmMyZjI2YjRkYjFmY2JiNTgxMjQwMjI1NTdhMDc4ZTIxMzViODdhZTljYjVkZDdhNjA0ZTA1NDUxMGRkNTJhODJiOTgzNDg0NDg1N2U3MmFkMzYwOTY4NjFmMTZhYjJkM2M4M2RmNzkzY2YxNTVlYWUyMGY0Y2ZhZGJmNTllNDA3OWExZDgyMWVhZDAwOGQzNmZmODE5MTY3M2EwZjJkYTVjZjZlNTBlMGY2MGJmYmRiMmUyZmFhOTgzZjU1NWU1ODJiZmE0MDVlMjkxMmU4NDY2NGU2OGE5NWFhZDkxYmNmNDhjZGUyOTQwMDk1ZTExOGMxNzBmMWZjNTUxNzQxZDRiMmYyNzM5OTYxZjlkZWRlMDk5YmRmZjQyZjM1MzJmOTcyYTZlOWE2OWRjZjBlZjZiYjY3Zjg2OTE2MmQ4NzljZDNhY2VkN2U1MWI1ZjNhNWUyNmZjOWNmZWVlNWJkOTAzODY1MWMyZDlkZTFkMTVjNDM4MDdlZDBkZDA0MDY1N2UwNGE5NzQyZDEwZjUwMzRjZGYyMjc2YzRmY2Q4M2FiOWU4ZjFjMGZjNjRmYzRjMmYxYmQzMWM2ZThlODNhODU2ZjM4NjRkMTlmM2M3MWQxMjI2MzIyNGU1NDZlM2I0NDU0N2E3ZWMyZmViOTJmMDY2ODg3NTE4MzgwMDA1ODJhMmI2ZDQ1N2MxODg5ODc0ZGE3MzFkNzcxYTQ5MWMyNjJiZWYzOWYiLCJrZXlfaWQiOjQ3fQ==" self.sess.headers = { "Host": "miao.baidu.com", "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"', "DNT": "1", "sec-ch-ua-mobile": "?0", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36", "Content-Type": "text/plain;charset=UTF-8", "Origin": "https://haoma.baidu.com", "Sec-Fetch-Site": "same-site", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Dest": "empty", "Referer": "https://haoma.baidu.com/", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7,ja;q=0.6", } resp = self.sess.post(url="https://miao.baidu.com/abdr", data=payload) if not resp.text: return {} return resp.json() def search(self, phone_number): j = self.abdr() if not j: return self.sess.headers.update(**{ "Host": "haoma.baidu.com", "Accept": "application/json, text/plain, */*", "Content-Type": "application/json;charset=UTF-8", "Origin": "https://haoma.baidu.com", "Referer": "https://haoma.baidu.com/phoneSearch", }) data = { "data": j.get("data"), "key_id": j.get("key_id"), "sign": j.get("sign"), "page": 1, "size": 10, "search": phone_number } resp = self.sess.post("https://haoma.baidu.com/api/v1/search", json=data) return resp.json() if __name__ == '__main__': bdhm = BaiDuHaoMa() print(bdhm.search("13088888888"))
88.484375
3,552
0.818647
268
5,663
17.238806
0.421642
0.019048
0.025325
0.031169
0.058658
0.036797
0.030736
0.030736
0.015584
0
0
0.089034
0.109483
5,663
63
3,553
89.888889
0.827087
0.00618
0
0.075472
0
0.056604
0.779772
0.645219
0
1
0
0
0
1
0.09434
false
0
0.018868
0
0.207547
0.018868
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
5
e297ff7756b858dfd3395a148f6d57aa737be972
12,751
py
Python
sdk/python/pulumi_artifactory/replication_config.py
pulumi/terraform-provider-artifactory
4f217f2e6bc2f7e5395a148cd3b3b7b5aaa66372
[ "ECL-2.0", "Apache-2.0" ]
4
2021-11-17T15:06:59.000Z
2022-03-21T02:36:15.000Z
sdk/python/pulumi_artifactory/replication_config.py
pulumi/terraform-provider-artifactory
4f217f2e6bc2f7e5395a148cd3b3b7b5aaa66372
[ "ECL-2.0", "Apache-2.0" ]
113
2021-11-09T14:14:50.000Z
2022-03-31T23:18:29.000Z
sdk/python/pulumi_artifactory/replication_config.py
pulumi/terraform-provider-artifactory
4f217f2e6bc2f7e5395a148cd3b3b7b5aaa66372
[ "ECL-2.0", "Apache-2.0" ]
2
2021-11-22T11:19:48.000Z
2021-12-17T01:39:20.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities from . import outputs from ._inputs import * __all__ = ['ReplicationConfigArgs', 'ReplicationConfig'] @pulumi.input_type class ReplicationConfigArgs: def __init__(__self__, *, cron_exp: pulumi.Input[str], repo_key: pulumi.Input[str], enable_event_replication: Optional[pulumi.Input[bool]] = None, replications: Optional[pulumi.Input[Sequence[pulumi.Input['ReplicationConfigReplicationArgs']]]] = None): """ The set of arguments for constructing a ReplicationConfig resource. """ pulumi.set(__self__, "cron_exp", cron_exp) pulumi.set(__self__, "repo_key", repo_key) if enable_event_replication is not None: pulumi.set(__self__, "enable_event_replication", enable_event_replication) if replications is not None: pulumi.set(__self__, "replications", replications) @property @pulumi.getter(name="cronExp") def cron_exp(self) -> pulumi.Input[str]: return pulumi.get(self, "cron_exp") @cron_exp.setter def cron_exp(self, value: pulumi.Input[str]): pulumi.set(self, "cron_exp", value) @property @pulumi.getter(name="repoKey") def repo_key(self) -> pulumi.Input[str]: return pulumi.get(self, "repo_key") @repo_key.setter def repo_key(self, value: pulumi.Input[str]): pulumi.set(self, "repo_key", value) @property @pulumi.getter(name="enableEventReplication") def enable_event_replication(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "enable_event_replication") @enable_event_replication.setter def enable_event_replication(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "enable_event_replication", value) @property @pulumi.getter def replications(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ReplicationConfigReplicationArgs']]]]: return pulumi.get(self, "replications") @replications.setter def replications(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ReplicationConfigReplicationArgs']]]]): pulumi.set(self, "replications", value) @pulumi.input_type class _ReplicationConfigState: def __init__(__self__, *, cron_exp: Optional[pulumi.Input[str]] = None, enable_event_replication: Optional[pulumi.Input[bool]] = None, replications: Optional[pulumi.Input[Sequence[pulumi.Input['ReplicationConfigReplicationArgs']]]] = None, repo_key: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering ReplicationConfig resources. """ if cron_exp is not None: pulumi.set(__self__, "cron_exp", cron_exp) if enable_event_replication is not None: pulumi.set(__self__, "enable_event_replication", enable_event_replication) if replications is not None: pulumi.set(__self__, "replications", replications) if repo_key is not None: pulumi.set(__self__, "repo_key", repo_key) @property @pulumi.getter(name="cronExp") def cron_exp(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "cron_exp") @cron_exp.setter def cron_exp(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "cron_exp", value) @property @pulumi.getter(name="enableEventReplication") def enable_event_replication(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "enable_event_replication") @enable_event_replication.setter def enable_event_replication(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "enable_event_replication", value) @property @pulumi.getter def replications(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ReplicationConfigReplicationArgs']]]]: return pulumi.get(self, "replications") @replications.setter def replications(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ReplicationConfigReplicationArgs']]]]): pulumi.set(self, "replications", value) @property @pulumi.getter(name="repoKey") def repo_key(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "repo_key") @repo_key.setter def repo_key(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "repo_key", value) class ReplicationConfig(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cron_exp: Optional[pulumi.Input[str]] = None, enable_event_replication: Optional[pulumi.Input[bool]] = None, replications: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ReplicationConfigReplicationArgs']]]]] = None, repo_key: Optional[pulumi.Input[str]] = None, __props__=None): """ Note: this resource is deprecated in favor of `PushReplication` resource. Provides an Artifactory replication config resource. This can be used to create and manage Artifactory replications. ## Example Usage ```python import pulumi import pulumi_artifactory as artifactory # Create a replication between two artifactory local repositories provider_test_source = artifactory.LocalMavenRepository("providerTestSource", key="provider_test_source") provider_test_dest = artifactory.LocalMavenRepository("providerTestDest", key="provider_test_dest") foo_rep = artifactory.ReplicationConfig("foo-rep", cron_exp="0 0 * * * ?", enable_event_replication=True, replications=[artifactory.ReplicationConfigReplicationArgs( password="$var.artifactory_password", url="$var.artifactory_url", username="$var.artifactory_username", )], repo_key=provider_test_source.key) ``` ## Import Replication configs can be imported using their repo key, e.g. ```sh $ pulumi import artifactory:index/replicationConfig:ReplicationConfig foo-rep provider_test_source ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. """ ... @overload def __init__(__self__, resource_name: str, args: ReplicationConfigArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Note: this resource is deprecated in favor of `PushReplication` resource. Provides an Artifactory replication config resource. This can be used to create and manage Artifactory replications. ## Example Usage ```python import pulumi import pulumi_artifactory as artifactory # Create a replication between two artifactory local repositories provider_test_source = artifactory.LocalMavenRepository("providerTestSource", key="provider_test_source") provider_test_dest = artifactory.LocalMavenRepository("providerTestDest", key="provider_test_dest") foo_rep = artifactory.ReplicationConfig("foo-rep", cron_exp="0 0 * * * ?", enable_event_replication=True, replications=[artifactory.ReplicationConfigReplicationArgs( password="$var.artifactory_password", url="$var.artifactory_url", username="$var.artifactory_username", )], repo_key=provider_test_source.key) ``` ## Import Replication configs can be imported using their repo key, e.g. ```sh $ pulumi import artifactory:index/replicationConfig:ReplicationConfig foo-rep provider_test_source ``` :param str resource_name: The name of the resource. :param ReplicationConfigArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(ReplicationConfigArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cron_exp: Optional[pulumi.Input[str]] = None, enable_event_replication: Optional[pulumi.Input[bool]] = None, replications: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ReplicationConfigReplicationArgs']]]]] = None, repo_key: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = ReplicationConfigArgs.__new__(ReplicationConfigArgs) if cron_exp is None and not opts.urn: raise TypeError("Missing required property 'cron_exp'") __props__.__dict__["cron_exp"] = cron_exp __props__.__dict__["enable_event_replication"] = enable_event_replication __props__.__dict__["replications"] = replications if repo_key is None and not opts.urn: raise TypeError("Missing required property 'repo_key'") __props__.__dict__["repo_key"] = repo_key super(ReplicationConfig, __self__).__init__( 'artifactory:index/replicationConfig:ReplicationConfig', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, cron_exp: Optional[pulumi.Input[str]] = None, enable_event_replication: Optional[pulumi.Input[bool]] = None, replications: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ReplicationConfigReplicationArgs']]]]] = None, repo_key: Optional[pulumi.Input[str]] = None) -> 'ReplicationConfig': """ Get an existing ReplicationConfig resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _ReplicationConfigState.__new__(_ReplicationConfigState) __props__.__dict__["cron_exp"] = cron_exp __props__.__dict__["enable_event_replication"] = enable_event_replication __props__.__dict__["replications"] = replications __props__.__dict__["repo_key"] = repo_key return ReplicationConfig(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="cronExp") def cron_exp(self) -> pulumi.Output[str]: return pulumi.get(self, "cron_exp") @property @pulumi.getter(name="enableEventReplication") def enable_event_replication(self) -> pulumi.Output[bool]: return pulumi.get(self, "enable_event_replication") @property @pulumi.getter def replications(self) -> pulumi.Output[Optional[Sequence['outputs.ReplicationConfigReplication']]]: return pulumi.get(self, "replications") @property @pulumi.getter(name="repoKey") def repo_key(self) -> pulumi.Output[str]: return pulumi.get(self, "repo_key")
42.362126
139
0.665673
1,348
12,751
6.004451
0.132789
0.066593
0.070423
0.028169
0.76847
0.74722
0.732271
0.707438
0.676674
0.654065
0
0.000513
0.235354
12,751
300
140
42.503333
0.829641
0.249471
0
0.632768
1
0
0.137277
0.075463
0
0
0
0
0
1
0.152542
false
0.00565
0.039548
0.067797
0.282486
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
e29a219634a4c18c5c8b563a2272cacc22836865
63
py
Python
CodeWars/7 Kyu/Power of two.py
anubhab-code/Competitive-Programming
de28cb7d44044b9e7d8bdb475da61e37c018ac35
[ "MIT" ]
null
null
null
CodeWars/7 Kyu/Power of two.py
anubhab-code/Competitive-Programming
de28cb7d44044b9e7d8bdb475da61e37c018ac35
[ "MIT" ]
null
null
null
CodeWars/7 Kyu/Power of two.py
anubhab-code/Competitive-Programming
de28cb7d44044b9e7d8bdb475da61e37c018ac35
[ "MIT" ]
null
null
null
def power_of_two(x): return x != 0 and ((x & (x - 1)) == 0)
31.5
42
0.492063
13
63
2.230769
0.692308
0
0
0
0
0
0
0
0
0
0
0.065217
0.269841
63
2
42
31.5
0.565217
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
2c42d190fac9e42afa513bac6d629b9032a35978
202
py
Python
apigateway/admin.py
tianhuyang/djangoapigateway
c35bdc7e7da24de0b19a99d3b3af7f3b7e1bdae7
[ "MIT" ]
1
2019-11-12T17:49:06.000Z
2019-11-12T17:49:06.000Z
apigateway/admin.py
allanice001/djangoapigateway
c35bdc7e7da24de0b19a99d3b3af7f3b7e1bdae7
[ "MIT" ]
null
null
null
apigateway/admin.py
allanice001/djangoapigateway
c35bdc7e7da24de0b19a99d3b3af7f3b7e1bdae7
[ "MIT" ]
2
2018-09-19T22:09:32.000Z
2019-02-20T08:05:01.000Z
from django.contrib import admin from .models import Api, Consumer, Authenticator # Register your models here. admin.site.register(Api) admin.site.register(Consumer) admin.site.register(Authenticator)
25.25
48
0.816832
27
202
6.111111
0.481481
0.163636
0.309091
0
0
0
0
0
0
0
0
0
0.094059
202
7
49
28.857143
0.901639
0.128713
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
2c5325b0c63266b6d370ef3eb88550511a006948
3,220
py
Python
tests/unit/objects/test_delete_objects.py
dlite-tools/aws-s3-tools
f434ed36c1fc0530f2be6b52808cbc5e59ea8990
[ "MIT" ]
6
2021-02-18T10:03:17.000Z
2022-01-14T06:11:54.000Z
tests/unit/objects/test_delete.py
FerrariDG/aws-s3-tools
0ddbb35cebc858bae1a0627aa8726e063a3ef5cd
[ "MIT" ]
4
2021-04-20T18:20:32.000Z
2022-02-04T08:32:39.000Z
tests/unit/objects/test_delete_objects.py
dlite-tools/aws-s3-tools
f434ed36c1fc0530f2be6b52808cbc5e59ea8990
[ "MIT" ]
2
2021-03-04T00:25:51.000Z
2021-05-10T13:20:42.000Z
"""Unit tests for delete.py""" from botocore.exceptions import ClientError from s3_tools import ( delete_keys, delete_object, delete_prefix, object_exists ) from tests.unit.conftest import ( create_bucket, BUCKET_NAME, FILENAME ) class TestDelete: def test_delete_nonexisting_bucket(self, s3_client): try: delete_object(BUCKET_NAME, "prefix/object") except ClientError as e: error = e.response["Error"]["Code"] assert error == "NoSuchBucket" def test_delete_nonexisting_object(self, s3_client): key = "prefix/object" with create_bucket(s3_client, BUCKET_NAME): before = object_exists(BUCKET_NAME, key) delete_object(BUCKET_NAME, key) after = object_exists(BUCKET_NAME, key) assert before is False assert after is False def test_delete_existing_object(self, s3_client): key = "prefix/object" with create_bucket(s3_client, BUCKET_NAME, keys_paths=[(key, FILENAME)]): before = object_exists(BUCKET_NAME, key) delete_object(BUCKET_NAME, key) after = object_exists(BUCKET_NAME, key) assert before is True assert after is False def test_delete_keys(self, s3_client): lst = [(f"prefix/mock_{i}.csv", FILENAME) for i in range(4)] keys = [key for key, fn in lst] with create_bucket(s3_client, BUCKET_NAME, keys_paths=lst): before = [object_exists(BUCKET_NAME, key) for key in keys] delete_keys(BUCKET_NAME, keys, False) after = [object_exists(BUCKET_NAME, key) for key in keys] assert all(before) is True assert all(after) is False def test_delete_prefix(self, s3_client): lst = [(f"prefix/mock_{i}.csv", FILENAME) for i in range(4)] keys = [key for key, fn in lst] with create_bucket(s3_client, BUCKET_NAME, keys_paths=lst): before = [object_exists(BUCKET_NAME, key) for key in keys] delete_prefix(BUCKET_NAME, "prefix", False) after = [object_exists(BUCKET_NAME, key) for key in keys] assert all(before) is True assert all(after) is False def test_delete_prefix_dry_run(self, s3_client): lst = [(f"prefix/mock_{i}.csv", FILENAME) for i in range(4)] keys = [key for key, fn in lst] with create_bucket(s3_client, BUCKET_NAME, keys_paths=lst): before = [object_exists(BUCKET_NAME, key) for key in keys] delete_prefix(BUCKET_NAME, "prefix", True) after = [object_exists(BUCKET_NAME, key) for key in keys] assert all(before) is True assert all(after) is True def test_delete_keys_dry_run(self, s3_client): lst = [(f"prefix/mock_{i}.csv", FILENAME) for i in range(4)] keys = [key for key, fn in lst] with create_bucket(s3_client, BUCKET_NAME, keys_paths=lst): before = [object_exists(BUCKET_NAME, key) for key in keys] delete_keys(BUCKET_NAME, keys, True) after = [object_exists(BUCKET_NAME, key) for key in keys] assert all(before) is True assert all(after) is True
33.894737
81
0.639441
443
3,220
4.422122
0.130926
0.132721
0.092905
0.134763
0.789689
0.789689
0.789689
0.75804
0.75804
0.753446
0
0.007647
0.268944
3,220
94
82
34.255319
0.824554
0.007453
0
0.535211
0
0
0.046395
0
0
0
0
0
0.183099
1
0.098592
false
0
0.042254
0
0.15493
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2c70e0fa70f1afda520d6826445123187ec00306
111
py
Python
Exception/base.py
hc-tec/redis-py
28172eb4de2bfc61b0ff1023dbf7b52d4f4ba47c
[ "MIT" ]
1
2021-11-24T07:54:17.000Z
2021-11-24T07:54:17.000Z
Exception/base.py
hc-tec/pydis
28172eb4de2bfc61b0ff1023dbf7b52d4f4ba47c
[ "MIT" ]
1
2021-11-13T15:08:14.000Z
2021-11-13T15:08:14.000Z
Exception/base.py
hc-tec/redis-py
28172eb4de2bfc61b0ff1023dbf7b52d4f4ba47c
[ "MIT" ]
1
2021-11-13T14:57:57.000Z
2021-11-13T14:57:57.000Z
class BaseError(Exception): msg = 'Server Error' def get_msg(self): return f'{self.msg}\n'
12.333333
30
0.594595
15
111
4.333333
0.8
0
0
0
0
0
0
0
0
0
0
0
0.27027
111
8
31
13.875
0.802469
0
0
0
0
0
0.222222
0
0
0
0
0
0
1
0.25
false
0
0
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
2c7f3d7fd074aa5b434868f956c2a2fa8f5577d5
313
wsgi
Python
fiowebviewer/examples/fiowebapp.wsgi
rclsilver/fiowebviewer
986b9f1b680a71e39be2dd95f1c00479b68ead1e
[ "BSD-3-Clause" ]
4
2020-03-20T14:00:06.000Z
2021-01-13T09:16:10.000Z
fiowebviewer/examples/fiowebapp.wsgi
rclsilver/fiowebviewer
986b9f1b680a71e39be2dd95f1c00479b68ead1e
[ "BSD-3-Clause" ]
2
2020-12-11T20:14:10.000Z
2021-02-08T11:26:13.000Z
fiowebviewer/examples/fiowebapp.wsgi
rclsilver/fiowebviewer
986b9f1b680a71e39be2dd95f1c00479b68ead1e
[ "BSD-3-Clause" ]
4
2020-10-19T21:06:58.000Z
2021-02-15T10:01:05.000Z
import sys import os # this path have to point to fiowebviewer package sys.path.insert(0,"/path/where/you/installed/fiowebviewer/fiowebviewer") # this path have to point to config file os.environ['FIOWEBVIEWER_SETTINGS'] = '/path/where/you/installed/fiowebviewer/config.cfg' from fiowebviewer import application
34.777778
89
0.805112
45
313
5.577778
0.488889
0.063745
0.095618
0.111554
0.430279
0.167331
0
0
0
0
0
0.003546
0.099042
313
8
90
39.125
0.886525
0.27476
0
0
0
0
0.540179
0.540179
0
0
0
0
0
1
0
true
0
0.6
0
0.6
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
1
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e2dc22d8f4e9d6439f233800c416fc3c9601e4e0
3,373
py
Python
python_codes/request_lattices_data.py
lucasedng/research_scripts
c9160b9afcd6bcad06d2505e0176d3cbdd53a41b
[ "MIT" ]
null
null
null
python_codes/request_lattices_data.py
lucasedng/research_scripts
c9160b9afcd6bcad06d2505e0176d3cbdd53a41b
[ "MIT" ]
null
null
null
python_codes/request_lattices_data.py
lucasedng/research_scripts
c9160b9afcd6bcad06d2505e0176d3cbdd53a41b
[ "MIT" ]
null
null
null
from typing import List from numpy import array from re import compile import re def name_request_from_web(site_return: str) -> str: initial_str = '<a NAME="NAME"><STRONG>NAME</STRONG></a><br>' final_str = '<br><p><li>' initial_index = site_return.find(initial_str)+len(initial_str) final_index = initial_index + \ site_return[initial_index:].find(final_str) return site_return[initial_index:final_index] def dimension_request_from_web(site_return: str) -> int: if '<a NAME="DIMENSION"><STRONG>DIMENSION</STRONG></a><br>' in site_return: initial_str = '<a NAME="DIMENSION"><STRONG>DIMENSION</STRONG></a><br>' elif '<a NAME="DIM"><STRONG>DIM</STRONG></a><br>' in site_return: initial_str = '<a NAME="DIM"><STRONG>DIM</STRONG></a><br>' else: return -1 final_str = '<br><p><li>' initial_index = site_return.find(initial_str)+len(initial_str) final_index = initial_index + site_return[initial_index:].find(final_str) return int(site_return[initial_index:final_index]) def determinant_request_from_web(site_return: str) -> float: if '<a NAME="DET"><STRONG>DET</STRONG></a><br>' in site_return: initial_str = '<a NAME="DET"><STRONG>DET</STRONG></a><br>' else: return -1.0 final_str = '<br><p><li>' initial_index = site_return.find(initial_str)+len(initial_str) final_index = initial_index + site_return[initial_index:].find(final_str) return float(site_return[initial_index:final_index]) def minimal_norm_request_from_web(site_return: str) -> float: if '<a NAME="MINIMAL_NORM"><STRONG>MINIMAL_NORM</STRONG></a><br>' in site_return: initial_str = '<a NAME="MINIMAL_NORM"><STRONG>MINIMAL_NORM</STRONG></a><br>' else: return -1.0 final_str = '<br><p><li>' initial_index = site_return.find(initial_str)+len(initial_str) final_index = initial_index + site_return[initial_index:].find(final_str) return float(site_return[initial_index:final_index]) def kissing_number_request_from_web(site_return: str) -> float: if '<a NAME="KISSING_NUMBER"><STRONG>KISSING_NUMBER</STRONG></a><br>' in site_return: initial_str = '<a NAME="KISSING_NUMBER"><STRONG>KISSING_NUMBER</STRONG></a><br>' else: return -1 final_str = '<br><p><li>' initial_index = site_return.find(initial_str)+len(initial_str) final_index = initial_index + site_return[initial_index:].find(final_str) return int(site_return[initial_index:final_index]) def gram_matrix_request_from_web(site_return: str) -> List[List[float]]: if '<a NAME="GRAM"><STRONG>GRAM</STRONG></a><br>' in site_return: initial_str = '<a NAME="GRAM"><STRONG>GRAM</STRONG></a><br>' else: return [[]] final_str = '<br><p><li>' initial_index = site_return.find(initial_str)+len(initial_str) final_index = initial_index + site_return[initial_index:].find(final_str) numeric_const_pattern = '[-+]? (?: (?: \d* \. \d+ ) | (?: \d+ \.? ) )(?: [Ee] [+-]? \d+ ) ?' rx = compile(numeric_const_pattern, re.VERBOSE) numbers = [ float(s) for s in rx.findall(site_return[initial_index:final_index]) ] num_row = int(numbers[0]) num_columns = int(numbers[1]) gram_matrix = array(numbers[2:]).reshape(num_row, num_columns) return gram_matrix.tolist()
31.523364
96
0.672695
487
3,373
4.379877
0.123203
0.140647
0.14346
0.123769
0.817628
0.81294
0.759962
0.743554
0.669948
0.669948
0
0.003202
0.166617
3,373
106
97
31.820755
0.755603
0
0
0.447761
0
0.014925
0.23362
0.182923
0
0
0
0
0
1
0.089552
false
0
0.059701
0
0.313433
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
391b6d33cbe57252c1b7146322490fea64147122
180
py
Python
dummy/group1.py
vavrines/card-game
c68178de9c613e9692e09dd6ccc428d455c0c3d8
[ "MIT" ]
null
null
null
dummy/group1.py
vavrines/card-game
c68178de9c613e9692e09dd6ccc428d455c0c3d8
[ "MIT" ]
null
null
null
dummy/group1.py
vavrines/card-game
c68178de9c613e9692e09dd6ccc428d455c0c3d8
[ "MIT" ]
null
null
null
import numpy as np def play(nplayers, ncards, nturn, playerid, history, cheated): # this player plays a random card and might therefore cheat return np.random.randint(ncards)
30
62
0.766667
27
180
5.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.161111
180
5
63
36
0.913907
0.316667
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
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
1
1
0
0
0
5
39290addc45e9987bb2268dfe86a3d313b0c7eb6
7,081
py
Python
tests/commands/create/test_install_app_dependencies.py
danyeaw/briefcase
fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78
[ "BSD-3-Clause" ]
null
null
null
tests/commands/create/test_install_app_dependencies.py
danyeaw/briefcase
fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78
[ "BSD-3-Clause" ]
null
null
null
tests/commands/create/test_install_app_dependencies.py
danyeaw/briefcase
fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78
[ "BSD-3-Clause" ]
null
null
null
import subprocess import sys import pytest from briefcase.commands.create import DependencyInstallError def create_installation_artefacts(app_packages_path, packages): """Utility method for generating a function that will mock installation artefacts. Creates a function that when invoked, creates a dummy ``__init__.py`` and ``__main__.py`` for each package named in ``packages``. :param app_packages_path: The pathlib object where app packages will be installed :param packages: A list of package names to mock. :returns: A function that will create files to mock the named installed packages. """ def _create_installation_artefacts(*args, **kwargs): for package in packages: (app_packages_path / package).mkdir(parents=True) with (app_packages_path / package / '__init__.py').open('w') as f: f.write('') with (app_packages_path / package / '__main__.py').open('w') as f: f.write('print("I am {package}")') return _create_installation_artefacts def test_no_requires(create_command, myapp, app_packages_path): "If an app has no requirements, install_app_dependencies is a no-op." myapp.requires = None create_command.install_app_dependencies(myapp) # No request was made to install dependencies create_command.subprocess.run.assert_not_called() def test_empty_requires(create_command, myapp, app_packages_path): "If an app has an empty requirements list, install_app_dependencies is a no-op." myapp.requires = [] create_command.install_app_dependencies(myapp) # No request was made to install dependencies create_command.subprocess.run.assert_not_called() def test_valid_requires(create_command, myapp, app_packages_path): "If an app has an valid list of requirements, pip is invoked." myapp.requires = ['first', 'second', 'third'] create_command.install_app_dependencies(myapp) # No request was made to install dependencies create_command.subprocess.run.assert_called_with( [ sys.executable, "-m", "pip", "install", "--upgrade", "--no-user", f'--target={app_packages_path}', 'first', 'second', 'third', ], check=True, ) def test_invalid_requires(create_command, myapp, app_packages_path): "If an app has an valid list of requirements, pip is invoked." myapp.requires = ['does-not-exist'] # Unfortunately, no way to tell the difference between "offline" and # "your requirements are invalid"; pip returns status code 1 for all # failures. create_command.subprocess.run.side_effect = subprocess.CalledProcessError( cmd=['python', '-m', 'pip', '...'], returncode=1 ) with pytest.raises(DependencyInstallError): create_command.install_app_dependencies(myapp) # But the request to install was still made create_command.subprocess.run.assert_called_with( [ sys.executable, "-m", "pip", "install", "--upgrade", "--no-user", f'--target={app_packages_path}', 'does-not-exist', ], check=True, ) def test_offline(create_command, myapp, app_packages_path): "If user is offline, pip fails." myapp.requires = ['first', 'second', 'third'] # Unfortunately, no way to tell the difference between "offline" and # "your requirements are invalid"; pip returns status code 1 for all # failures. create_command.subprocess.run.side_effect = subprocess.CalledProcessError( cmd=['python', '-m', 'pip', '...'], returncode=1 ) with pytest.raises(DependencyInstallError): create_command.install_app_dependencies(myapp) # But the request to install was still made create_command.subprocess.run.assert_called_with( [ sys.executable, "-m", "pip", "install", "--upgrade", "--no-user", f'--target={app_packages_path}', 'first', 'second', 'third', ], check=True, ) def test_install_dependencies(create_command, myapp, app_packages_path): "Dependencies can be installed." # Set up the app requirements myapp.requires = ['first', 'second', 'third'] # The side effect of calling pip is creating installation artefacts create_command.subprocess.run.side_effect = create_installation_artefacts(app_packages_path, myapp.requires) # Install the dependencies create_command.install_app_dependencies(myapp) # The request to install was made create_command.subprocess.run.assert_called_with( [ sys.executable, "-m", "pip", "install", "--upgrade", "--no-user", f'--target={app_packages_path}', 'first', 'second', 'third', ], check=True, ) # The new app packages have installation artefacts created assert (app_packages_path / 'first').exists() assert (app_packages_path / 'first' / '__main__.py').exists() assert (app_packages_path / 'second').exists() assert (app_packages_path / 'second' / '__main__.py').exists() assert (app_packages_path / 'third').exists() assert (app_packages_path / 'third' / '__main__.py').exists() def test_replace_existing_dependencies(create_command, myapp, app_packages_path): "If the app has already had dependencies installed, they are removed first." # Create some existing dependencies create_installation_artefacts(app_packages_path, ['old', 'ancient'])() # Set up the app requirements myapp.requires = ['first', 'second', 'third'] # The side effect of calling pip is creating installation artefacts create_command.subprocess.run.side_effect = create_installation_artefacts(app_packages_path, myapp.requires) # Install the dependencies create_command.install_app_dependencies(myapp) # The request to install was still made create_command.subprocess.run.assert_called_with( [ sys.executable, "-m", "pip", "install", "--upgrade", "--no-user", f'--target={app_packages_path}', 'first', 'second', 'third', ], check=True, ) # The new app packages have installation artefacts created assert (app_packages_path / 'first').exists() assert (app_packages_path / 'first' / '__main__.py').exists() assert (app_packages_path / 'second').exists() assert (app_packages_path / 'second' / '__main__.py').exists() assert (app_packages_path / 'third').exists() assert (app_packages_path / 'third' / '__main__.py').exists() # The old app packages no longer exist. assert not (app_packages_path / 'old').exists() assert not (app_packages_path / 'ancient').exists()
33.400943
112
0.646095
819
7,081
5.345543
0.173382
0.095477
0.116492
0.057561
0.789173
0.756053
0.736866
0.700548
0.700548
0.681361
0
0.00075
0.246434
7,081
211
113
33.559242
0.819715
0.258438
0
0.681159
0
0
0.190935
0.033547
0
0
0
0
0.152174
1
0.065217
false
0
0.028986
0
0.101449
0.007246
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1a4d6dc32db6c5de12dda31910696ee748fce8fa
134
py
Python
problems/1720_decode_xored_array.py
wasi0013/leet_code
c589c10f06043fa0ac7643e09ae3903d77c2f8e9
[ "MIT" ]
null
null
null
problems/1720_decode_xored_array.py
wasi0013/leet_code
c589c10f06043fa0ac7643e09ae3903d77c2f8e9
[ "MIT" ]
null
null
null
problems/1720_decode_xored_array.py
wasi0013/leet_code
c589c10f06043fa0ac7643e09ae3903d77c2f8e9
[ "MIT" ]
null
null
null
class Solution: def decode(self, encoded: List[int], first: int) -> List[int]: return [first] + [first:=first^i for i in encoded]
44.666667
117
0.671642
21
134
4.285714
0.619048
0.155556
0
0
0
0
0
0
0
0
0
0
0.164179
134
2
118
67
0.803571
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
1a4e10375c3142a0f83e8da0bdd7d81443201d16
40
py
Python
simpletrie/__init__.py
davesque/simple-trie
3ca5bbb8147ec541e7f60f89b1baf4c738c51bfa
[ "MIT" ]
1
2019-03-24T23:12:46.000Z
2019-03-24T23:12:46.000Z
simpletrie/__init__.py
davesque/simple-trie
3ca5bbb8147ec541e7f60f89b1baf4c738c51bfa
[ "MIT" ]
null
null
null
simpletrie/__init__.py
davesque/simple-trie
3ca5bbb8147ec541e7f60f89b1baf4c738c51bfa
[ "MIT" ]
null
null
null
from .trie import * # noqa: F401, F403
20
39
0.65
6
40
4.333333
1
0
0
0
0
0
0
0
0
0
0
0.193548
0.225
40
1
40
40
0.645161
0.4
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
1a71c8df437d97c376f2446f132aa976096b26bb
11,811
py
Python
python/cross_service/dynamodb_item_tracker/test/test_app.py
jiazhan/aws-doc-sdk-examples
414734a2dae73d1cb9ef6131b57b4743ff854af6
[ "Apache-2.0" ]
1
2022-02-02T03:49:17.000Z
2022-02-02T03:49:17.000Z
python/cross_service/dynamodb_item_tracker/test/test_app.py
jiazhan/aws-doc-sdk-examples
414734a2dae73d1cb9ef6131b57b4743ff854af6
[ "Apache-2.0" ]
null
null
null
python/cross_service/dynamodb_item_tracker/test/test_app.py
jiazhan/aws-doc-sdk-examples
414734a2dae73d1cb9ef6131b57b4743ff854af6
[ "Apache-2.0" ]
1
2022-01-29T14:20:24.000Z
2022-01-29T14:20:24.000Z
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Unit tests for the dynamodb_item_tracker example. """ from contextlib import contextmanager from datetime import datetime import boto3 from botocore.stub import ANY from flask import appcontext_pushed, g import pytest from app import create_app from storage import Storage from report import Report _TABLE_NAME = 'test-table' @contextmanager def storage_set(app, storage): def handler(sender, **kwargs): g.storage = storage with appcontext_pushed.connected_to(handler, app): yield @contextmanager def report_set(app, report): def handler(sender, **kwargs): g.report = report with appcontext_pushed.connected_to(handler, app): yield def test_no_table(): app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) with app.test_client() as client: rv = client.get('/') assert b"Couldn't get items from table" in rv.data @pytest.mark.parametrize('item_count, status_filter, error_code', [ (5, None, None), (3, 'All', None), (1, 'Open', None), (0, None, None), (3, None, 'TestException') ]) def test_items(make_stubber, item_count, status_filter, error_code): ddb_resource = boto3.resource('dynamodb') ddb_stubber = make_stubber(ddb_resource.meta.client) table = ddb_resource.Table(_TABLE_NAME) storage = Storage(table, ddb_resource) app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) items = [{ 'item_id': f'id-{ind}', 'name': f'Name {ind}', 'description': f'Description {ind}!', 'created_date': str(datetime.now()), 'status': f'Open' } for ind in range(5)] fex = ANY if status_filter is not None and status_filter != 'All' else None ddb_stubber.stub_scan( _TABLE_NAME, items, filter_expression=fex, error_code=error_code) with storage_set(app, storage): with app.test_client() as client: rte = '/' if status_filter is None else f'/?status_filter={status_filter}' rv = client.get(rte) if error_code is None: for item in items: assert item['name'].encode() in rv.data assert item['description'].encode() in rv.data assert datetime.fromisoformat( item['created_date']).strftime('%b %d %Y').encode() in rv.data assert item['status'].encode() in rv.data assert b'<div class="alert' not in rv.data if not items: assert b'No items found in table' in rv.data else: for item in items: assert item['name'].encode() not in rv.data assert b"Couldn't get items from table" in rv.data assert b"TestException" in rv.data @pytest.mark.parametrize('item_id, error_code', [ (None, None), ('id-1', None), ('id-1', 'TestException') ]) def test_item_get(make_stubber, item_id, error_code): ddb_resource = boto3.resource('dynamodb') ddb_stubber = make_stubber(ddb_resource.meta.client) table = ddb_resource.Table(_TABLE_NAME) storage = Storage(table, ddb_resource) app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) item = { 'item_id': item_id, 'name': f'Name test', 'description': f'Description test!', 'created_date': str(datetime.now()), 'status': f'Open'} if item_id is not None: ddb_stubber.stub_get_item(_TABLE_NAME, {'item_id': item_id}, item, error_code=error_code) with storage_set(app, storage): with app.test_client() as client: rte = '/item/' if item_id is None else f'/item/{item_id}' rv = client.get(rte) if error_code is None: if item_id is not None: assert item['item_id'].encode() in rv.data assert item['name'].encode() in rv.data assert item['description'].encode() in rv.data assert datetime.fromisoformat( item['created_date']).strftime('%b %d %Y').encode() in rv.data assert item['status'].encode() in rv.data assert b'Update</button>' in rv.data else: assert item['name'].encode() not in rv.data assert item['description'].encode() not in rv.data assert datetime.fromisoformat( item['created_date']).strftime('%b %d %Y').encode() not in rv.data assert b'Add</button>' in rv.data assert b'<div class="alert' not in rv.data else: assert item['name'].encode() not in rv.data assert b"Couldn't get item" assert b"TestException" in rv.data @pytest.mark.parametrize('item_id, error_code', [ (None, None), ('id-1', None), ('id-1', 'TestException') ]) def test_item_post(make_stubber, item_id, error_code): ddb_resource = boto3.resource('dynamodb') ddb_stubber = make_stubber(ddb_resource.meta.client) table = ddb_resource.Table(_TABLE_NAME) storage = Storage(table, ddb_resource) app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) attribs = { 'name': f'Name test', 'description': f'Description test!', 'status': f'Open'} if item_id is None: item = {'item_id': ANY, 'created_date': ANY} item.update(attribs) ddb_stubber.stub_put_item(_TABLE_NAME, item, error_code=error_code) else: ddb_stubber.stub_update_item_attr_update( _TABLE_NAME, {'item_id': item_id}, attribs, error_code=error_code) if error_code is None: item = {'item_id': 'id-1', 'created_date': str(datetime.now())} item.update(attribs) ddb_stubber.stub_scan(_TABLE_NAME, [item]) with storage_set(app, storage): with app.test_client() as client: rte = '/item/' if item_id is None else f'/item/{item_id}' rv = client.post(rte, data=attribs, follow_redirects=True) if error_code is None: assert _TABLE_NAME.encode() in rv.data assert b'<table' in rv.data assert attribs['name'].encode() in rv.data assert attribs['description'].encode() in rv.data assert attribs['status'].encode() in rv.data assert b'<div class="alert' not in rv.data else: if item_id is not None: assert item_id.encode() in rv.data assert attribs['name'].encode() in rv.data assert b"Couldn't add or update item" assert b"TestException" in rv.data assert b'<div class="alert' in rv.data @pytest.mark.parametrize('error_code', [None, 'TestException']) def test_item_delete(make_stubber, error_code): ddb_resource = boto3.resource('dynamodb') ddb_stubber = make_stubber(ddb_resource.meta.client) table = ddb_resource.Table(_TABLE_NAME) storage = Storage(table, ddb_resource) app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) item_id = 'test_id' out_item = { 'item_id': 'another-id', 'name': f'Name test', 'description': f'Description test!', 'created_date': str(datetime.now()), 'status': f'Open'} ddb_stubber.stub_delete_item(_TABLE_NAME, {'item_id': item_id}, error_code=error_code) ddb_stubber.stub_scan(_TABLE_NAME, [out_item]) with storage_set(app, storage): with app.test_client() as client: rte = f'/items/delete/{item_id}' rv = client.get(rte, follow_redirects=True) if error_code is None: assert out_item['name'].encode() in rv.data assert out_item['description'].encode() in rv.data assert out_item['status'].encode() in rv.data assert b'<div class="alert' not in rv.data else: assert b"Couldn't delete item" assert b"TestException" in rv.data assert b'<div class="alert' in rv.data @pytest.mark.parametrize('item_count, error_code', [ (5, None), (0, None), (5, 'TestException')]) def test_report_get(make_stubber, item_count, error_code): ddb_resource = boto3.resource('dynamodb') ddb_stubber = make_stubber(ddb_resource.meta.client) ses_client = boto3.client('ses') ses_stubber = make_stubber(ses_client) table = ddb_resource.Table(_TABLE_NAME) storage = Storage(table, ddb_resource) report = Report(ses_client) app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) status_filter = 'Open' items = [{ 'item_id': f'id-{ind}', 'name': f'Name {ind}', 'description': f'Description {ind}!', 'created_date': str(datetime.now()), 'status': f'Open' } for ind in range(5)] ddb_stubber.stub_scan( _TABLE_NAME, items, filter_expression=ANY, error_code=error_code) with storage_set(app, storage): with app.test_client() as client: rv = client.get(f'/report/{status_filter}') if error_code is None: for item in items: assert item['name'].encode() in rv.data assert item['description'].encode() in rv.data assert datetime.fromisoformat( item['created_date']).strftime('%b %d %Y').encode() in rv.data assert item['status'].encode() in rv.data assert b'<div class="alert' not in rv.data if not items: assert b'No items found in table' in rv.data else: assert b"Couldn't get items from table" assert b"TestException" in rv.data assert b'<div class="alert' in rv.data @pytest.mark.parametrize('item_count, error_code', [ (5, None), (0, None), (5, 'TestException')]) def test_report_post(make_stubber, item_count, error_code): ddb_resource = boto3.resource('dynamodb') ddb_stubber = make_stubber(ddb_resource.meta.client) ses_client = boto3.client('ses') ses_stubber = make_stubber(ses_client) table = ddb_resource.Table(_TABLE_NAME) storage = Storage(table, ddb_resource) report = Report(ses_client) app = create_app({'TESTING': True, 'TABLE_NAME': _TABLE_NAME}) status_filter = 'Open' items = [{ 'item_id': f'id-{ind}', 'name': f'Name {ind}', 'description': f'Description {ind}!', 'created_date': str(datetime.now()), 'status': f'Open' } for ind in range(5)] post_data = { 'message': 'Test message', 'sender': 'test-sender', 'recipient': 'test-recipient' } ddb_stubber.stub_scan(_TABLE_NAME, items, filter_expression=ANY) ses_stubber.stub_send_email( post_data['sender'], {'ToAddresses': [post_data['recipient']]}, f"Report for items with status '{status_filter}'", ANY, ANY, 'test-id', error_code=error_code) ddb_stubber.stub_scan(_TABLE_NAME, items) with storage_set(app, storage): with report_set(app, report): with app.test_client() as client: rv = client.post( f'/report/{status_filter}', data=post_data, follow_redirects=True) if error_code is None: assert b"Report sent" in rv.data else: assert b"Report not sent" in rv.data assert b"TestException" in rv.data
37.855769
97
0.597663
1,522
11,811
4.447438
0.086728
0.029546
0.059093
0.070321
0.816221
0.795095
0.756685
0.718718
0.674103
0.624612
0
0.003532
0.28084
11,811
311
98
37.977492
0.793384
0.012954
0
0.677903
0
0
0.163619
0.008584
0
0
0
0
0.202247
1
0.041199
false
0
0.033708
0
0.074906
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1a7c2a378098644f30a2fe466b899bf365aa934e
960
py
Python
utils/tests/test_cr_utils.py
CrossRef/reference-matching-evaluation
ed347f26a52d809db0884a548d581840e283d0e8
[ "MIT" ]
14
2018-12-27T16:51:29.000Z
2021-11-28T20:59:17.000Z
utils/tests/test_cr_utils.py
CrossRef/reference-matching-evaluation
ed347f26a52d809db0884a548d581840e283d0e8
[ "MIT" ]
1
2019-04-10T22:26:01.000Z
2019-06-01T11:41:13.000Z
utils/tests/test_cr_utils.py
CrossRef/reference-matching-evaluation
ed347f26a52d809db0884a548d581840e283d0e8
[ "MIT" ]
1
2020-01-02T08:11:22.000Z
2020-01-02T08:11:22.000Z
from utils.cr_utils import generate_sample_args, parse_filter_text class TestGenerateSampleArgs: def test_generate_sample_args(self): assert generate_sample_args(0) == [] assert generate_sample_args(1, 'f', 'q') == [(1, 'f', 'q')] assert generate_sample_args(78, 2) == [(78, 2, {})] assert generate_sample_args(100) == [(100, {}, {})] assert generate_sample_args(101, 1, '4') == [(100, 1, '4'), (1, 1, '4')] assert generate_sample_args(211) == [(100, {}, {}), (100, {}, {}), (11, {}, {})] class TestParseFilterText: def test_parse_filter_text(self): assert parse_filter_text(None) == {} assert parse_filter_text('') == {} assert parse_filter_text('a:1') == {'a': '1'} assert parse_filter_text('a:1,bc:d,123:qqqq') == \ {'a': '1', 'bc': 'd', '123': 'qqqq'}
38.4
74
0.515625
110
960
4.218182
0.309091
0.241379
0.310345
0.310345
0.146552
0.146552
0
0
0
0
0
0.072917
0.3
960
24
75
40
0.61756
0
0
0
1
0
0.042708
0
0
0
0
0
0.555556
1
0.111111
false
0
0.055556
0
0.277778
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
1a7e653b6a58a21c90478457766c2ab3ea966a0f
165
py
Python
capstone/rl/__init__.py
davidrobles/mlnd-capstone-code
19ca88aaa137665af147da9bbd0e510829a14cf1
[ "MIT" ]
2
2017-04-13T18:31:39.000Z
2017-05-06T05:14:12.000Z
capstone/rl/__init__.py
davidrobles/mlnd-capstone-code
19ca88aaa137665af147da9bbd0e510829a14cf1
[ "MIT" ]
null
null
null
capstone/rl/__init__.py
davidrobles/mlnd-capstone-code
19ca88aaa137665af147da9bbd0e510829a14cf1
[ "MIT" ]
null
null
null
from .environment import Environment from .learner import EpisodicLearnerMixin from .value_function import ValueFunction from .mdp import MDP, FixedGameMDP, GameMDP
33
43
0.854545
19
165
7.368421
0.578947
0
0
0
0
0
0
0
0
0
0
0
0.109091
165
4
44
41.25
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
1a958bd18a2be42739c868ad525830ba5ff165ce
123
py
Python
src/compas/geometry/curves/__init__.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
235
2017-11-07T07:33:22.000Z
2022-03-25T16:20:00.000Z
src/compas/geometry/curves/__init__.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
770
2017-09-22T13:42:06.000Z
2022-03-31T21:26:45.000Z
src/compas/geometry/curves/__init__.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
99
2017-11-06T23:15:28.000Z
2022-03-25T16:05:36.000Z
from __future__ import absolute_import from .curve import Curve # noqa: F401 from .nurbs import NurbsCurve # noqa: F401
24.6
43
0.780488
17
123
5.352941
0.529412
0.175824
0
0
0
0
0
0
0
0
0
0.058824
0.170732
123
4
44
30.75
0.833333
0.170732
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
46ce15606615cc748225bca455d1b09ed1bb2cbc
665
py
Python
webapp/user/models.py
Ilyaivanov60/web_dictionary
1cbfd9fd78f4bb59a59d6b3d2f727304b138c01e
[ "MIT" ]
null
null
null
webapp/user/models.py
Ilyaivanov60/web_dictionary
1cbfd9fd78f4bb59a59d6b3d2f727304b138c01e
[ "MIT" ]
1
2021-01-14T12:47:50.000Z
2021-01-14T12:47:50.000Z
webapp/user/models.py
Ilyaivanov60/web_dictionary
1cbfd9fd78f4bb59a59d6b3d2f727304b138c01e
[ "MIT" ]
null
null
null
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from webapp.db import db class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(50), index=True, unique=True) password = db.Column(db.String(128)) email = db.Column(db.String(50), unique=True) def set_password(self, password): self.password = generate_password_hash(password) def check_password(self, password): return check_password_hash(self.password, password ) def __repr__(self): return '<User name={} id={}>'.format(self.username, self.id)
35
73
0.720301
92
665
5.032609
0.391304
0.103672
0.086393
0.103672
0.077754
0
0
0
0
0
0
0.01259
0.16391
665
19
74
35
0.820144
0
0
0
1
0
0.03003
0
0
0
0
0
0
1
0.214286
false
0.428571
0.214286
0.142857
0.928571
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
5
2000f756ef0a6bbeb79f1842a41e3271cf082ca3
343
py
Python
python-skylark/skylark/errors.py
wangg12/libskylark
e8836190be854d0284d38772c48e110b3c6d5e51
[ "Apache-2.0" ]
2
2021-06-12T07:26:43.000Z
2021-06-12T07:26:47.000Z
python-skylark/skylark/errors.py
cjiyer/libskylark
e8836190be854d0284d38772c48e110b3c6d5e51
[ "Apache-2.0" ]
null
null
null
python-skylark/skylark/errors.py
cjiyer/libskylark
e8836190be854d0284d38772c48e110b3c6d5e51
[ "Apache-2.0" ]
null
null
null
class SkylarkError(Exception): pass class DimensionMistmatchError(SkylarkError): pass class UnexpectedLowerLayerError(SkylarkError): pass class UnsupportedError(SkylarkError): pass class ParameterMistmatchError(SkylarkError): pass class InvalidParamterError(SkylarkError): pass class InvalidObjectError(SkylarkError): pass
16.333333
46
0.819242
28
343
10.035714
0.357143
0.192171
0.373665
0
0
0
0
0
0
0
0
0
0.119534
343
20
47
17.15
0.930464
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
20107f3491eb51cea01318d32cb647da398e5860
3,786
py
Python
terraguard/validators/must_contain.py
Jamian/terraguard
982cdfd99f11695d36ecdcbce706956b66e8d185
[ "MIT" ]
1
2019-07-26T10:58:30.000Z
2019-07-26T10:58:30.000Z
terraguard/validators/must_contain.py
Jamian/terraguard
982cdfd99f11695d36ecdcbce706956b66e8d185
[ "MIT" ]
null
null
null
terraguard/validators/must_contain.py
Jamian/terraguard
982cdfd99f11695d36ecdcbce706956b66e8d185
[ "MIT" ]
null
null
null
MUST_CONTAIN = 'must_contain' def resource_must_contain(rule, resource, full_address): error_message = None if isinstance(rule, str): if rule not in resource.config['values']: error_message = 'Missing required [{rule}] attribute from {resource_type}'.format( rule=rule, resource_type=resource.resource_type ) elif not resource.config['values'][rule]: error_message = 'Missing required [{rule}] attribute from {resource_type}'.format( rule=rule, resource_type=resource.resource_type ) if error_message: resource.add_violation(full_address, error_message) if isinstance(rule, list): for required_value in rule: if required_value not in resource.config['values']: error_message = 'Missing required [{required_value}] attribute from {resource_type}'.format( required_value=required_value, resource_type=resource.resource_type ) elif not resource.config['values'][required_value]: error_message = 'Missing required [{required_value}] attribute from {resource_type}'.format( required_value=required_value, resource_type=resource.resource_type ) if error_message: resource.add_violation(full_address, error_message) def attribute_must_contain(rule, resource, attribute_name, full_address): if isinstance(rule, str): if rule not in resource.config['values']: error_message = 'Missing required [{rule}] attribute from {resource_type}'.format( rule=rule, resource_type=resource.resource_type ) resource.add_violation(full_address, error_message) elif isinstance(rule, list): for item in rule: # If the attribute_name doesn't exist as all if attribute_name not in resource.config['values']: error_message = 'Missing {attribute_name} block and [{item}] required defined in {resource_type}'.format( attribute_name=attribute_name.capitalize(), item=item, resource_type=resource.resource_type ) resource.add_violation(full_address, error_message) # If the attribute_name exists, but is set to a null value elif resource.config['values'][attribute_name] is None: error_message = 'Null {attribute_name} block and [{item}] required defined in {resource_type}'.format( attribute_name=attribute_name.capitalize(), item=item, resource_type=resource.resource_type ) resource.add_violation(full_address, error_message) # Lookup key exists so let's look at each individual item elif item not in resource.config['values'][attribute_name]: error_message = 'Missing {attribute_name} [{item}] defined in {resource_type}'.format( attribute_name=attribute_name.capitalize(), item=item, resource_type=resource.resource_type ) resource.add_violation(full_address, error_message) def must_contain(rule, resource, attribute_name=None): address = resource.config['address'] full_address = '{address}.{validator}'.format( address=address, validator=MUST_CONTAIN) if not attribute_name: resource_must_contain(rule, resource, full_address) else: attribute_must_contain(rule, resource, attribute_name, full_address)
45.614458
121
0.616218
399
3,786
5.60401
0.14787
0.128801
0.107335
0.100179
0.801878
0.755814
0.739714
0.702147
0.677996
0.616726
0
0
0.302694
3,786
82
122
46.170732
0.84697
0.04094
0
0.514286
0
0
0.166253
0.00579
0
0
0
0
0
1
0.042857
false
0
0
0
0.042857
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
20253aa2f9be311f92c43d617ff4a301018516e8
164
py
Python
user/admin.py
alihasanimam/Hashmap4All
bada827b48ab9d4318f9bc4bf203a207c0db9e23
[ "MIT" ]
null
null
null
user/admin.py
alihasanimam/Hashmap4All
bada827b48ab9d4318f9bc4bf203a207c0db9e23
[ "MIT" ]
null
null
null
user/admin.py
alihasanimam/Hashmap4All
bada827b48ab9d4318f9bc4bf203a207c0db9e23
[ "MIT" ]
null
null
null
from django.contrib import admin from user.models import UserModel, Hashmap # Register your models here. admin.site.register(UserModel) admin.site.register(Hashmap)
32.8
42
0.829268
23
164
5.913043
0.565217
0.132353
0.25
0
0
0
0
0
0
0
0
0
0.091463
164
5
43
32.8
0.912752
0.158537
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
202b6fe4540d016bcc91bdf67db099e9251722b7
359
py
Python
8kyu/test_opposite_number.py
adun/codewars.py
89e7d81e9ca05a432007d634892c1cba28f5b715
[ "MIT" ]
null
null
null
8kyu/test_opposite_number.py
adun/codewars.py
89e7d81e9ca05a432007d634892c1cba28f5b715
[ "MIT" ]
null
null
null
8kyu/test_opposite_number.py
adun/codewars.py
89e7d81e9ca05a432007d634892c1cba28f5b715
[ "MIT" ]
null
null
null
# Opposite number # Very simple, given a number, find its opposite. def opposite(number): return -number def test_opposite(): assert opposite(1) == -1 assert opposite(25.6) == -25.6 assert opposite(0) == 0 assert opposite(1425.2222) == -1425.2222 assert opposite(-3.1458) == 3.1458 assert opposite(-95858588225) == 95858588225
22.4375
49
0.662953
48
359
4.9375
0.4375
0.35443
0
0
0
0
0
0
0
0
0
0.203509
0.206128
359
15
50
23.933333
0.62807
0.175487
0
0
0
0
0
0
0
0
0
0
0.666667
1
0.222222
false
0
0
0.111111
0.333333
0
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
1
0
1
0
0
0
1
0
0
0
5
2054ae04b2ca89c041619704cfe93d847e335401
129
py
Python
part5/testclass_without_init.py
MADTeacher/python_basics
06ae43d8063c1c8426a4fbb53443b6d1ee727951
[ "MIT" ]
null
null
null
part5/testclass_without_init.py
MADTeacher/python_basics
06ae43d8063c1c8426a4fbb53443b6d1ee727951
[ "MIT" ]
null
null
null
part5/testclass_without_init.py
MADTeacher/python_basics
06ae43d8063c1c8426a4fbb53443b6d1ee727951
[ "MIT" ]
4
2020-10-04T12:24:14.000Z
2022-01-16T17:01:59.000Z
class TestClass: pass if __name__ == "__main__": my_test = TestClass() my_test.magic = 10 print(my_test.magic)
14.333333
26
0.643411
17
129
4.235294
0.647059
0.25
0.305556
0
0
0
0
0
0
0
0
0.020619
0.248062
129
8
27
16.125
0.721649
0
0
0
0
0
0.062016
0
0
0
0
0
0
1
0
false
0.166667
0
0
0.166667
0.166667
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
64b89c6cb418e0044162afb3384d108c478fed67
30
py
Python
graphgallery/functional/attr_matrix/__init__.py
kisekizzz/GraphGallery
fd4a1f474c244f774397460ae95935638ef48f5b
[ "MIT" ]
null
null
null
graphgallery/functional/attr_matrix/__init__.py
kisekizzz/GraphGallery
fd4a1f474c244f774397460ae95935638ef48f5b
[ "MIT" ]
null
null
null
graphgallery/functional/attr_matrix/__init__.py
kisekizzz/GraphGallery
fd4a1f474c244f774397460ae95935638ef48f5b
[ "MIT" ]
null
null
null
from .attr_transform import *
15
29
0.8
4
30
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.133333
30
1
30
30
0.884615
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
64baa376e20cf5d5f14883cf1a66dbba4b18bfdd
175
py
Python
codec_quopri.py
furikake/sublime-codec
7572b8612218f21f622573e9a50f1746242106a8
[ "MIT" ]
16
2015-07-08T17:50:54.000Z
2022-01-31T19:16:55.000Z
codec_quopri.py
Someonesol/sublime-codec
7572b8612218f21f622573e9a50f1746242106a8
[ "MIT" ]
9
2015-10-01T16:41:33.000Z
2021-06-11T06:41:28.000Z
codec_quopri.py
Someonesol/sublime-codec
7572b8612218f21f622573e9a50f1746242106a8
[ "MIT" ]
6
2015-10-01T15:39:21.000Z
2021-10-19T10:46:20.000Z
import quopri def decodestring(s, header=False): return quopri.decodestring(s, header) def encodestring(s, quotetabs=False): return quopri.encodestring(s, quotetabs)
25
44
0.765714
22
175
6.090909
0.454545
0.19403
0.283582
0
0
0
0
0
0
0
0
0
0.131429
175
7
44
25
0.881579
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.2
0.4
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
1
0
0
0
1
0
0
0
5
64dd1ec1589506c4fb7de0bdb4f19428c76ab760
297
py
Python
rflib/ops/info.py
tycoer/rflib-1
5746c668f990841bd8b8385408e8ddb268d22dd4
[ "Apache-2.0" ]
null
null
null
rflib/ops/info.py
tycoer/rflib-1
5746c668f990841bd8b8385408e8ddb268d22dd4
[ "Apache-2.0" ]
null
null
null
rflib/ops/info.py
tycoer/rflib-1
5746c668f990841bd8b8385408e8ddb268d22dd4
[ "Apache-2.0" ]
2
2021-07-30T04:22:46.000Z
2021-07-30T05:08:43.000Z
from ..utils import ext_loader ext_module = ext_loader.load_ext( '_ext', ['get_compiler_version', 'get_compiling_cuda_version']) def get_compiler_version(): return ext_module.get_compiler_version() def get_compiling_cuda_version(): return ext_module.get_compiling_cuda_version()
29.7
71
0.784512
41
297
5.146341
0.341463
0.127962
0.255924
0.327014
0.236967
0
0
0
0
0
0
0
0.121212
297
9
72
33
0.808429
0
0
0
0
0
0.16835
0.087542
0
0
0
0
0
1
0.285714
false
0
0.142857
0.285714
0.714286
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
b3896cdaebd949ee48800ab2f21459c5478bd7b8
115
py
Python
enthought/block_canvas/function_tools/local_function_info.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/block_canvas/function_tools/local_function_info.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/block_canvas/function_tools/local_function_info.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from __future__ import absolute_import from blockcanvas.function_tools.local_function_info import *
28.75
60
0.869565
15
115
6.133333
0.733333
0
0
0
0
0
0
0
0
0
0
0
0.095652
115
3
61
38.333333
0.884615
0.104348
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b3a89ed0b7a045fe8a6664114bfb73b0c00ba2db
68
py
Python
datass/text/__init__.py
htbrandao/datass
cb07d668731760a89c31eea75f58fcf3fe27b096
[ "MIT" ]
null
null
null
datass/text/__init__.py
htbrandao/datass
cb07d668731760a89c31eea75f58fcf3fe27b096
[ "MIT" ]
null
null
null
datass/text/__init__.py
htbrandao/datass
cb07d668731760a89c31eea75f58fcf3fe27b096
[ "MIT" ]
null
null
null
""" datass submodule for handling str and list[str] and objects """
17
59
0.720588
10
68
4.9
0.8
0.244898
0
0
0
0
0
0
0
0
0
0
0.161765
68
3
60
22.666667
0.859649
0.867647
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
b3c74c800b0bfbbeeb696bc35f60993657cc5b62
101
py
Python
utils/exceptions.py
aws-samples/boto3-proxy-api-sls
06c7935fd32278f59c55c79dcf8c8b219d567265
[ "MIT-0" ]
null
null
null
utils/exceptions.py
aws-samples/boto3-proxy-api-sls
06c7935fd32278f59c55c79dcf8c8b219d567265
[ "MIT-0" ]
null
null
null
utils/exceptions.py
aws-samples/boto3-proxy-api-sls
06c7935fd32278f59c55c79dcf8c8b219d567265
[ "MIT-0" ]
null
null
null
class InvalidRegionException(Exception): pass class InvalidInputException(Exception): pass
14.428571
40
0.782178
8
101
9.875
0.625
0.329114
0
0
0
0
0
0
0
0
0
0
0.158416
101
6
41
16.833333
0.929412
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
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
0
1
1
0
0
0
0
0
5
b3f9833c4f26659e71f6cad7bb7577bdb1df3226
114
py
Python
tests/__init__.py
rkhwaja/sqlalchemy-sqliteupload
e6323373156cc4b6b04a900cd6b7a4c4fbd9d58a
[ "MIT" ]
2
2021-01-27T06:44:01.000Z
2021-09-05T19:22:25.000Z
tests/__init__.py
rkhwaja/sqlalchemy-sqliteupload
e6323373156cc4b6b04a900cd6b7a4c4fbd9d58a
[ "MIT" ]
null
null
null
tests/__init__.py
rkhwaja/sqlalchemy-sqliteupload
e6323373156cc4b6b04a900cd6b7a4c4fbd9d58a
[ "MIT" ]
null
null
null
from os.path import join, realpath from sys import path path.append(realpath(join(__file__, "..", "..", "src")))
22.8
56
0.684211
16
114
4.625
0.625
0
0
0
0
0
0
0
0
0
0
0
0.122807
114
4
57
28.5
0.74
0
0
0
0
0
0.061404
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b3fa1271a1128af050e909eaeb502e122df25e06
479
py
Python
src/api-engine/api/lib/agent/kubernetes/__init__.py
inaciosadovski/cello
98f2b872b032c8327bfa0cdf65ace3c9e56b94cd
[ "Apache-2.0" ]
null
null
null
src/api-engine/api/lib/agent/kubernetes/__init__.py
inaciosadovski/cello
98f2b872b032c8327bfa0cdf65ace3c9e56b94cd
[ "Apache-2.0" ]
null
null
null
src/api-engine/api/lib/agent/kubernetes/__init__.py
inaciosadovski/cello
98f2b872b032c8327bfa0cdf65ace3c9e56b94cd
[ "Apache-2.0" ]
null
null
null
# # SPDX-License-Identifier: Apache-2.0 # from api.lib.agent.base import AgentBase class KubernetesAgent(AgentBase): def __init__(self, *args, **kwargs): super(AgentBase, self).__init__() def create(self, *args, **kwargs): pass def start(self, *args, **kwargs): pass def stop(self, *args, **kwargs): pass def delete(self, *args, **kwargs): pass def generate_compose_yaml(self, *args, **kwargs): pass
19.16
53
0.605428
57
479
4.912281
0.508772
0.171429
0.3
0.321429
0.3
0
0
0
0
0
0
0.005587
0.25261
479
24
54
19.958333
0.776536
0.073069
0
0.357143
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.357143
0.071429
0
0.571429
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
37438c3b71a9a0d3d2a8524f4f0b9c8bd0faeffa
739
py
Python
pbirest/__init__.py
AntoineDW/powerbi-rest-api-python
d836c07a048ea82e8e5404323d5e947cc979a223
[ "MIT" ]
3
2020-03-02T19:46:51.000Z
2022-03-24T03:42:31.000Z
pbirest/__init__.py
AntoineDW/powerbi-rest-api-python
d836c07a048ea82e8e5404323d5e947cc979a223
[ "MIT" ]
1
2022-03-15T21:25:44.000Z
2022-03-15T21:25:44.000Z
pbirest/__init__.py
AntoineDW/powerbi-rest-api-python
d836c07a048ea82e8e5404323d5e947cc979a223
[ "MIT" ]
1
2021-07-01T19:48:39.000Z
2021-07-01T19:48:39.000Z
from .core import connect from .core import verify_token from .core import get_token from .core import get_workspace from .core import get_workspaces from .core import create_workspace from .core import delete_workspace from .core import get_users_in_workspace from .core import add_user_to_workspace from .core import delete_user_from_workspace from .core import update_user_in_workspace from .core import get_report from .core import get_reports from .core import delete_report from .core import export_report from .core import import_report from .core import clone_report from .core import get_dataset from .core import get_datasets from .core import delete_dataset from .core import refresh_dataset from .core import get_audit_logs
28.423077
44
0.847091
118
739
5.050847
0.220339
0.295302
0.516779
0.256711
0.505034
0
0
0
0
0
0
0
0.123139
739
26
45
28.423077
0.919753
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
37688b55303e4211c4a10df6daca841457cf04bf
158
py
Python
timexy/rule.py
paulrinckens/timexy
b9fb2b991be71c9696a927d40e23e91900892579
[ "MIT" ]
34
2022-03-09T11:42:25.000Z
2022-03-23T13:04:52.000Z
timexy/rule.py
s-lilo/timexy
4eda4239074f0a461e6beb65238f349d01042199
[ "MIT" ]
5
2022-02-28T22:34:00.000Z
2022-03-16T23:07:54.000Z
timexy/rule.py
s-lilo/timexy
4eda4239074f0a461e6beb65238f349d01042199
[ "MIT" ]
4
2022-03-09T16:25:16.000Z
2022-03-16T10:18:52.000Z
from typing import List, Tuple from pydantic import BaseModel class Rule(BaseModel): regex: str pattern: str tests: List[Tuple[str, int, int]]
15.8
37
0.702532
22
158
5.045455
0.636364
0.162162
0
0
0
0
0
0
0
0
0
0
0.21519
158
9
38
17.555556
0.895161
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
1
0
1
0
0
5
3777ceb2fe44655b47a2e7f1c78bfe54f543635c
241
py
Python
opus/api/__init__.py
svartalf/python-opus
a3c1d556d2772b5be659ddd08c033ddd4d566b3a
[ "BSD-3-Clause" ]
22
2015-01-12T21:18:41.000Z
2021-08-10T04:07:15.000Z
opus/api/__init__.py
svartalf/python-opus
a3c1d556d2772b5be659ddd08c033ddd4d566b3a
[ "BSD-3-Clause" ]
3
2015-12-21T08:14:39.000Z
2020-12-08T15:36:17.000Z
opus/api/__init__.py
svartalf/python-opus
a3c1d556d2772b5be659ddd08c033ddd4d566b3a
[ "BSD-3-Clause" ]
21
2015-01-02T22:18:53.000Z
2021-02-03T15:44:43.000Z
import ctypes from ctypes.util import find_library libopus = ctypes.CDLL(find_library('opus')) c_int_pointer = ctypes.POINTER(ctypes.c_int) c_int16_pointer = ctypes.POINTER(ctypes.c_int16) c_float_pointer = ctypes.POINTER(ctypes.c_float)
24.1
48
0.813278
38
241
4.868421
0.368421
0.421622
0.324324
0.421622
0.437838
0
0
0
0
0
0
0.018182
0.087137
241
9
49
26.777778
0.822727
0
0
0
0
0
0.016598
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
8065afc8e708034801a25701232d5e19e79d36a2
167
py
Python
pyobs/modules/acquisition/__init__.py
pyobs/pyobs-core
e3401e63eb31587c2bc535f7346b7e4ef69d64ab
[ "MIT" ]
4
2020-02-14T10:50:03.000Z
2022-03-25T04:15:06.000Z
pyobs/modules/acquisition/__init__.py
pyobs/pyobs-core
e3401e63eb31587c2bc535f7346b7e4ef69d64ab
[ "MIT" ]
60
2020-09-14T09:10:20.000Z
2022-03-25T17:51:42.000Z
pyobs/modules/acquisition/__init__.py
pyobs/pyobs-core
e3401e63eb31587c2bc535f7346b7e4ef69d64ab
[ "MIT" ]
2
2020-10-14T09:34:57.000Z
2021-04-27T09:35:57.000Z
""" Modules for performing acquisition. TODO: write doc """ __title__ = 'Acquisition' from .base import BaseAcquisition from .astrometry import AstrometryAcquisition
18.555556
45
0.796407
17
167
7.588235
0.823529
0
0
0
0
0
0
0
0
0
0
0
0.125749
167
8
46
20.875
0.883562
0.305389
0
0
0
0
0.101852
0
0
0
0
0.125
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
1
0
0
5
806e254f9f4094872bf4d3a23a5486ce6161647d
33
py
Python
sovrinxplore/strats/__init__.py
fredericoschardong/sovrin-schema-matching
6172b5309870b000b1dc5853a057dec93b6173fb
[ "MIT" ]
null
null
null
sovrinxplore/strats/__init__.py
fredericoschardong/sovrin-schema-matching
6172b5309870b000b1dc5853a057dec93b6173fb
[ "MIT" ]
null
null
null
sovrinxplore/strats/__init__.py
fredericoschardong/sovrin-schema-matching
6172b5309870b000b1dc5853a057dec93b6173fb
[ "MIT" ]
1
2022-01-25T15:27:03.000Z
2022-01-25T15:27:03.000Z
from .spacy import Spacy # noqa
16.5
32
0.727273
5
33
4.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.212121
33
1
33
33
0.923077
0.121212
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
80a5dd54586e494aa45f4f3a15a0cfccec821f0a
99
py
Python
.history/run_20200624135035.py
AdamMomen/linear_regression
cf4d3ac41709b42878222ef37697587af7cb1b97
[ "MIT" ]
null
null
null
.history/run_20200624135035.py
AdamMomen/linear_regression
cf4d3ac41709b42878222ef37697587af7cb1b97
[ "MIT" ]
6
2020-11-13T18:57:02.000Z
2022-03-12T00:36:40.000Z
.history/run_20200624135100.py
AdamMomen/linear_regression
cf4d3ac41709b42878222ef37697587af7cb1b97
[ "MIT" ]
null
null
null
import matplotlib.pyplot as plt import numpy as np import pandas as pd import sklearn.linear_model
19.8
31
0.838384
17
99
4.823529
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.141414
99
4
32
24.75
0.964706
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
80d1cf0afa0d77e34cf4a191e7bb8032eb27b81a
79
py
Python
FTX/exceptions.py
zevaverbach/ftx-api-wrapper-python3
2206091d49d1d65a2335594230ccf86ebb0d1a5b
[ "MIT" ]
1
2021-05-11T11:12:34.000Z
2021-05-11T11:12:34.000Z
FTX/exceptions.py
zevaverbach/ftx-api-wrapper-python3
2206091d49d1d65a2335594230ccf86ebb0d1a5b
[ "MIT" ]
null
null
null
FTX/exceptions.py
zevaverbach/ftx-api-wrapper-python3
2206091d49d1d65a2335594230ccf86ebb0d1a5b
[ "MIT" ]
null
null
null
class Invalid(Exception): pass class DoesntExist(Exception): pass
7.9
29
0.683544
8
79
6.75
0.625
0.481481
0
0
0
0
0
0
0
0
0
0
0.240506
79
9
30
8.777778
0.9
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
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
0
1
1
0
0
0
0
0
5
80e45e3249c6216f96d5f3763d8dee7dd2469999
107
py
Python
MeowSite/IndexApp/views.py
mironovmeow/MeowSite
2aaace7d26c32c5fb3f989c892c74817bbb228b0
[ "MIT" ]
null
null
null
MeowSite/IndexApp/views.py
mironovmeow/MeowSite
2aaace7d26c32c5fb3f989c892c74817bbb228b0
[ "MIT" ]
null
null
null
MeowSite/IndexApp/views.py
mironovmeow/MeowSite
2aaace7d26c32c5fb3f989c892c74817bbb228b0
[ "MIT" ]
null
null
null
from django.shortcuts import render def index(requests, url): return render(requests, f"{url}.html")
17.833333
42
0.728972
15
107
5.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.149533
107
5
43
21.4
0.857143
0
0
0
0
0
0.093458
0
0
0
0
0
0
1
0.333333
false
0
0.333333
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
1
1
0
0
0
5
80e8fc77250866d9ddb0de3d59075906224dca9b
67
py
Python
src/test/resources/python-code-examples/import_of_same_dir/pkg/importing.py
florayym/depends
6c437a78268d91d54059b560c0273ae3c9253452
[ "BSD-3-Clause", "MIT" ]
146
2019-03-09T03:02:59.000Z
2022-03-28T11:28:41.000Z
src/test/resources/python-code-examples/import_of_same_dir/pkg/importing.py
florayym/depends
6c437a78268d91d54059b560c0273ae3c9253452
[ "BSD-3-Clause", "MIT" ]
27
2019-03-11T02:12:54.000Z
2021-12-21T00:24:13.000Z
src/test/resources/python-code-examples/import_of_same_dir/pkg/importing.py
florayym/depends
6c437a78268d91d54059b560c0273ae3c9253452
[ "BSD-3-Clause", "MIT" ]
41
2019-03-09T03:04:50.000Z
2022-01-14T06:53:14.000Z
from import_of_same_dir.pkg import a def test(): a.foo() pass
11.166667
36
0.701493
13
67
3.384615
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.19403
67
5
37
13.4
0.814815
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
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
1
1
1
0
0
0
0
0
5
80ea81982bb73a1ef9f8055f66e4b92ee79e1dcd
99
py
Python
magicwaves/guirunner.py
nsde/magicwaves
258353bd633501304cffa19f1dc3fc5521f51f30
[ "MIT" ]
null
null
null
magicwaves/guirunner.py
nsde/magicwaves
258353bd633501304cffa19f1dc3fc5521f51f30
[ "MIT" ]
null
null
null
magicwaves/guirunner.py
nsde/magicwaves
258353bd633501304cffa19f1dc3fc5521f51f30
[ "MIT" ]
null
null
null
"""Manages the GUI program for MagicWaves YouTube Downloader.""" import os; os.system('py gui.py')
33
64
0.737374
15
99
4.866667
0.8
0
0
0
0
0
0
0
0
0
0
0
0.121212
99
3
65
33
0.83908
0.585859
0
0
0
0
0.25
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
03c4d07995100366c33f79060fc77c45b09aeb75
40
py
Python
tests/authorizer/__init__.py
muhlba91/onyx-client
7dcbf1da9f1269039fff22fd781eba9c5a432d84
[ "MIT" ]
2
2021-02-09T22:35:06.000Z
2021-11-23T10:22:35.000Z
tests/authorizer/__init__.py
muhlba91/onyx-client
7dcbf1da9f1269039fff22fd781eba9c5a432d84
[ "MIT" ]
7
2021-02-10T10:47:07.000Z
2021-11-24T14:03:27.000Z
tests/authorizer/__init__.py
muhlba91/onyx-client
7dcbf1da9f1269039fff22fd781eba9c5a432d84
[ "MIT" ]
null
null
null
"""Tests for the authorizer package."""
20
39
0.7
5
40
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.125
40
1
40
40
0.8
0.825
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5