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
aeadf47f1566dc963f3113497ae37f7465070600
217
py
Python
django_api/cas/admin.py
LonelVino/world-week-test
73d5201564cd1f3d7ece4ccb4aa5ba6baaf03f68
[ "MIT" ]
null
null
null
django_api/cas/admin.py
LonelVino/world-week-test
73d5201564cd1f3d7ece4ccb4aa5ba6baaf03f68
[ "MIT" ]
null
null
null
django_api/cas/admin.py
LonelVino/world-week-test
73d5201564cd1f3d7ece4ccb4aa5ba6baaf03f68
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Cas # 内置的表 class OrderAdmin(admin.ModelAdmin): list_display = ['username','password','role'] list_filter = ['created', 'updated'] admin.site.register(Cas)
24.111111
49
0.728111
27
217
5.777778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.133641
217
9
50
24.111111
0.829787
0.018433
0
0
0
0
0.160377
0
0
0
0
0
0
1
0
false
0.166667
0.333333
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
5
aeb4ab4320ebaaede9d04d434912f3be7c203fd3
137
py
Python
solutions/Counting_power_sets.py
AlexGameAndWebDev/CodeWars-Python
222b8244e9f248dbb4e5fabd390dd4cce446dc84
[ "MIT" ]
44
2015-05-24T13:46:22.000Z
2022-03-22T10:40:10.000Z
solutions/Counting_power_sets.py
badruu/CodeWars-Python
222b8244e9f248dbb4e5fabd390dd4cce446dc84
[ "MIT" ]
3
2016-09-10T07:14:02.000Z
2021-09-14T12:16:25.000Z
solutions/Counting_power_sets.py
badruu/CodeWars-Python
222b8244e9f248dbb4e5fabd390dd4cce446dc84
[ "MIT" ]
48
2016-04-03T04:48:33.000Z
2022-03-14T23:32:17.000Z
""" Counting power sets http://www.codewars.com/kata/54381f0b6f032f933c000108/train/python """ def powers(lst): return 2 ** len(lst)
19.571429
66
0.722628
18
137
5.5
0.944444
0
0
0
0
0
0
0
0
0
0
0.165289
0.116788
137
7
67
19.571429
0.652893
0.627737
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
aef4739af4fcadb0ff10d29b82fb5552d12d43c0
152
py
Python
tests/test_models.py
bmdefreitas/star-wars-api-python
e118843b7a304433549085f5ee6a08bf455b4d43
[ "Apache-2.0" ]
null
null
null
tests/test_models.py
bmdefreitas/star-wars-api-python
e118843b7a304433549085f5ee6a08bf455b4d43
[ "Apache-2.0" ]
null
null
null
tests/test_models.py
bmdefreitas/star-wars-api-python
e118843b7a304433549085f5ee6a08bf455b4d43
[ "Apache-2.0" ]
null
null
null
def test_a(): x = "this" assert "h" in x def test_b(): x = "hello" assert "h" in x def test_c(): x = "world" assert "w" in x
11.692308
19
0.486842
27
152
2.62963
0.481481
0.295775
0.253521
0.28169
0.478873
0.478873
0
0
0
0
0
0
0.355263
152
13
20
11.692308
0.72449
0
0
0.222222
0
0
0.112583
0
0
0
0
0
0.333333
1
0.333333
false
0
0
0
0.333333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
4e185e78cc9a89f9dbbd8ee82d7119b85128afdc
64
py
Python
pycue/FileSequence/__init__.py
writetoalex/TestOpenCue
e38df23f20b5f5be37b0f2a078e6a8dd2c562fc4
[ "Apache-2.0" ]
2
2019-01-27T10:08:30.000Z
2019-01-27T10:08:32.000Z
pycue/FileSequence/__init__.py
writetoalex/TestOpenCue
e38df23f20b5f5be37b0f2a078e6a8dd2c562fc4
[ "Apache-2.0" ]
null
null
null
pycue/FileSequence/__init__.py
writetoalex/TestOpenCue
e38df23f20b5f5be37b0f2a078e6a8dd2c562fc4
[ "Apache-2.0" ]
1
2019-01-27T12:54:26.000Z
2019-01-27T12:54:26.000Z
from FrameRange import FrameRange from FrameSet import FrameSet
21.333333
33
0.875
8
64
7
0.5
0
0
0
0
0
0
0
0
0
0
0
0.125
64
2
34
32
1
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
9d7c0d6a36e316354346cd52846f2bbad84f42c5
169
py
Python
tests/observers/observer.py
sando-io/flowmancer
34e6679651b00c1e8c78e211cac493708ce9b1b7
[ "MIT" ]
null
null
null
tests/observers/observer.py
sando-io/flowmancer
34e6679651b00c1e8c78e211cac493708ce9b1b7
[ "MIT" ]
21
2022-01-07T03:14:34.000Z
2022-01-22T22:32:20.000Z
tests/observers/observer.py
natsunlee/flowmancer
34e6679651b00c1e8c78e211cac493708ce9b1b7
[ "MIT" ]
null
null
null
import pytest from flowmancer.observers.observer import Observer def test_abstract_init_error(): with pytest.raises(TypeError): Observer() # type: ignore
21.125
50
0.751479
20
169
6.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.171598
169
7
51
24.142857
0.885714
0.071006
0
0
0
0
0
0
0
0
0
0
0
1
0.2
true
0
0.4
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
0
1
0
1
0
1
0
0
5
9d7df578d88cf538535f7182d5aafbe1b2dc94a7
42
py
Python
codeforces/rounds/#367/fact.py
GinugaSaketh/Codes
e934aa5652dd86231a42e3f7f84b145eb35bf47d
[ "MIT" ]
null
null
null
codeforces/rounds/#367/fact.py
GinugaSaketh/Codes
e934aa5652dd86231a42e3f7f84b145eb35bf47d
[ "MIT" ]
null
null
null
codeforces/rounds/#367/fact.py
GinugaSaketh/Codes
e934aa5652dd86231a42e3f7f84b145eb35bf47d
[ "MIT" ]
null
null
null
a=200 f=1 while a>1: f=f*a a=a-1 print f
7
10
0.595238
15
42
1.666667
0.4
0.16
0
0
0
0
0
0
0
0
0
0.181818
0.214286
42
6
11
7
0.575758
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.166667
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
1
0
0
0
0
0
0
0
0
5
9dcd475a4c8eb284fdf874e63572ac12951d3b5c
259
py
Python
lib/triplet_loss/triplet_loss_op.py
aditya2592/PoseCNN
a763120ce0ceb55cf3432980287ef463728f8052
[ "MIT" ]
655
2018-03-21T19:55:45.000Z
2022-03-25T20:41:21.000Z
lib/triplet_loss/triplet_loss_op.py
yuxng/FCN
77fbb50b4272514588a10a9f90b7d5f8d46974fb
[ "MIT" ]
122
2018-04-04T13:57:49.000Z
2022-03-18T09:28:44.000Z
lib/triplet_loss/triplet_loss_op.py
yuxng/FCN
77fbb50b4272514588a10a9f90b7d5f8d46974fb
[ "MIT" ]
226
2018-03-22T01:40:04.000Z
2022-03-17T11:56:14.000Z
import tensorflow as tf import os.path as osp filename = osp.join(osp.dirname(__file__), 'triplet_loss.so') _triplet_loss_module = tf.load_op_library(filename) triplet_loss = _triplet_loss_module.triplet triplet_loss_grad = _triplet_loss_module.triplet_grad
32.375
61
0.837838
40
259
4.925
0.475
0.335025
0.258883
0.243655
0
0
0
0
0
0
0
0
0.084942
259
7
62
37
0.831224
0
0
0
0
0
0.057915
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
9dee7613a9af7b5fef52de250c80f8aa9a6432e5
3,370
py
Python
pycrostates/utils/tests/test_utils.py
mscheltienne/pycrostates
be87adf69c94b2b179064f337acd8a49d01c305d
[ "BSD-3-Clause" ]
1
2021-12-14T09:58:57.000Z
2021-12-14T09:58:57.000Z
pycrostates/utils/tests/test_utils.py
mscheltienne/pycrostates
be87adf69c94b2b179064f337acd8a49d01c305d
[ "BSD-3-Clause" ]
null
null
null
pycrostates/utils/tests/test_utils.py
mscheltienne/pycrostates
be87adf69c94b2b179064f337acd8a49d01c305d
[ "BSD-3-Clause" ]
null
null
null
import pytest from mne import create_info from mne.io.constants import FIFF from pycrostates.io import ChInfo from pycrostates.utils import _compare_infos from pycrostates.utils._logs import logger, set_log_level set_log_level("INFO") logger.propagate = True def test_compare_infos(caplog): """Test _compare_infos(cluster_info, inst_info).""" # minimum chinfo chinfo = ChInfo(ch_names=["Fpz", "Cz", "CPz"], ch_types="eeg") _compare_infos(chinfo, chinfo.copy()) # with montage chinfo.set_montage("standard_1020") caplog.clear() _compare_infos(chinfo, chinfo.copy()) assert "does not have the same channels montage" not in caplog.text # with MNE info without montage info = create_info(["Fpz", "Cz", "CPz"], 1, "eeg") caplog.clear() _compare_infos(chinfo, info) assert "does not have the same channels montage" in caplog.text caplog.clear() _compare_infos(info, chinfo) assert "does not have the same channels montage" in caplog.text # with MNE info with montage info = create_info(["Fpz", "Cz", "CPz"], 1, "eeg") info.set_montage("standard_1020") caplog.clear() _compare_infos(chinfo, info) assert "does not have the same channels montage" not in caplog.text caplog.clear() _compare_infos(info, chinfo) assert "does not have the same channels montage" not in caplog.text caplog.clear() # with different channels chinfo1 = ChInfo(ch_names=["Fpz", "Cz", "CPz"], ch_types="eeg") chinfo2 = ChInfo(ch_names=["Oz", "Cz", "CPz"], ch_types="eeg") with pytest.raises(ValueError, match="does not have the same channels"): _compare_infos(chinfo1, chinfo2) with pytest.raises(ValueError, match="does not have the same channels"): _compare_infos(chinfo2, chinfo1) # with subset of channels info1 = ChInfo(ch_names=["Fpz", "Cz", "CPz"], ch_types="eeg") info2 = ChInfo(ch_names=["Cz", "CPz"], ch_types="eeg") with pytest.raises(ValueError, match="does not have the same channels"): _compare_infos(cluster_info=info1, inst_info=info2) _compare_infos(cluster_info=info2, inst_info=info1) # with different kind/unit/coord_frame chinfo1 = ChInfo(ch_names=["Fpz", "Cz", "CPz"], ch_types="eeg") chinfo1.set_montage("standard_1020") chinfo2 = chinfo1.copy() chinfo2["chs"][0]["unit"] = FIFF.FIFF_UNIT_C caplog.clear() _compare_infos(chinfo1, chinfo2) assert "does not have the same channels units" in caplog.text caplog.clear() chinfo2 = chinfo1.copy() chinfo2["chs"][0]["coord_frame"] = FIFF.FIFFV_COORD_DEVICE _compare_infos(chinfo1, chinfo2) assert "does not have the same coordinate frames" in caplog.text caplog.clear() chinfo2 = chinfo1.copy() chinfo2["chs"][0]["kind"] = FIFF.FIFFV_MEG_CH _compare_infos(chinfo1, chinfo2) assert "does not have the same channels kinds" in caplog.text caplog.clear() chinfo2 = chinfo1.copy() chinfo2["chs"][0]["unit"] = FIFF.FIFF_UNIT_C chinfo2["chs"][0]["coord_frame"] = FIFF.FIFFV_COORD_DEVICE chinfo2["chs"][0]["kind"] = FIFF.FIFFV_MEG_CH _compare_infos(chinfo1, chinfo2) assert "does not have the same channels units" in caplog.text assert "does not have the same coordinate frames" in caplog.text assert "does not have the same channels kinds" in caplog.text
38.735632
76
0.695549
474
3,370
4.774262
0.160338
0.090146
0.068051
0.086611
0.745029
0.728237
0.718515
0.718515
0.718515
0.598321
0
0.02029
0.181009
3,370
86
77
39.186047
0.799638
0.064095
0
0.720588
0
0
0.22247
0
0
0
0
0
0.161765
1
0.014706
false
0
0.088235
0
0.102941
0
0
0
0
null
0
0
0
0
1
1
1
1
0
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
9dfb4ecbe2d4f443fdf5e8bd6bbaf096dc2de775
39
py
Python
tests/__init__.py
lowcloudnine/runinside
84011e3448dd5f1e4a094307eae0ce0834026b21
[ "MIT" ]
null
null
null
tests/__init__.py
lowcloudnine/runinside
84011e3448dd5f1e4a094307eae0ce0834026b21
[ "MIT" ]
1
2021-01-24T16:20:24.000Z
2021-01-24T16:20:24.000Z
tests/__init__.py
lowcloudnine/runinside
84011e3448dd5f1e4a094307eae0ce0834026b21
[ "MIT" ]
1
2021-01-20T05:45:51.000Z
2021-01-20T05:45:51.000Z
"""Unit test package for runinside."""
19.5
38
0.692308
5
39
5.4
1
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
1
39
39
0.794118
0.820513
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
d181cfd6cf53762c539026d0329128beb2eb9a8e
3,625
py
Python
demo/person/tests/project/resources/person/controllers/test_legal_person_controllers.py
giovannifarlley/ms--fastapi-template
5bbd6903305db07cc18330ec86fb04ca518e9dab
[ "MIT" ]
24
2021-03-07T13:00:35.000Z
2022-02-11T03:41:51.000Z
demo/person/tests/project/resources/person/controllers/test_legal_person_controllers.py
giovannifarlley/ms--fastapi-template
5bbd6903305db07cc18330ec86fb04ca518e9dab
[ "MIT" ]
2
2021-05-15T01:05:17.000Z
2021-08-13T13:53:57.000Z
demo/person/tests/project/resources/person/controllers/test_legal_person_controllers.py
giovannifarlley/ms--fastapi-template
5bbd6903305db07cc18330ec86fb04ca518e9dab
[ "MIT" ]
4
2021-04-27T12:18:33.000Z
2021-10-03T23:43:23.000Z
import pytest from datetime import datetime from http import HTTPStatus as status from httpx import AsyncClient from tests.configurations.constants import API_URL from project.routers import app resource = "/person/legal/" _birthdate = str(datetime.strptime("1985-08-01", "%Y-%m-%d")) base_data = { "status": "active", "business_name": "teste of the corp", "fantasy_name": "teste corporate dev", "sponsor_business_document_id": "12132334354", "business_document_id": "54556576010287", "email": "test2corporate4dev@teste.com", "phone": "+5534988882222", } _output_data = {} @pytest.mark.asyncio async def test_save_legal_person_200(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.post(resource, json=base_data) assert response.status_code == status.OK _output_data["id"] = response.json()["id"] @pytest.mark.asyncio async def test_save_legal_person_400(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.post(resource, json=base_data) assert response.status_code == status.BAD_REQUEST @pytest.mark.asyncio async def test_save_legal_person_422(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.post(resource, json={}) assert response.status_code == status.UNPROCESSABLE_ENTITY @pytest.mark.asyncio async def test_update_legal_person_200(): async with AsyncClient(app=app, base_url=API_URL) as client: _id = _output_data["id"] response = await client.put(f"{resource}{_id}", json={"email": "carlos.neto@teste.com"}) assert response.status_code == status.OK @pytest.mark.asyncio async def test_update_legal_person_500(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.put(f"{resource}{_birthdate}", json={"email": "carlos.neto@teste.com"}) assert response.status_code == status.INTERNAL_SERVER_ERROR @pytest.mark.asyncio async def test_get_legal_person_by_id_200(): async with AsyncClient(app=app, base_url=API_URL) as client: _id = _output_data["id"] response = await client.get(f"{resource}by/id/{_id}") assert response.status_code == status.OK @pytest.mark.asyncio async def test_get_legal_person_by_id_500(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.get(f"{resource}by/id/{_birthdate}") assert response.status_code == status.INTERNAL_SERVER_ERROR @pytest.mark.asyncio async def test_get_legal_person_qs_200(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.get(f"{resource}by/qs", params={}) assert response.status_code == status.OK @pytest.mark.asyncio async def test_get_legal_person_qs_204(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.get(f"{resource}by/qs", params={"business_name": "tony sterco"}) assert response.status_code == status.NO_CONTENT @pytest.mark.asyncio async def test_delete_legal_person_200(): async with AsyncClient(app=app, base_url=API_URL) as client: _id = _output_data["id"] response = await client.delete(f"{resource}by/{_id}") assert response.status_code == status.OK @pytest.mark.asyncio async def test_delete_legal_person_500(): async with AsyncClient(app=app, base_url=API_URL) as client: response = await client.delete(f"{resource}by/{_birthdate}") assert response.status_code == status.INTERNAL_SERVER_ERROR
34.855769
103
0.722483
507
3,625
4.921105
0.185404
0.028858
0.07495
0.096994
0.786774
0.762725
0.752305
0.738677
0.731463
0.623246
0
0.026636
0.161103
3,625
103
104
35.194175
0.793818
0
0
0.454545
0
0
0.131034
0.053517
0
0
0
0
0.142857
1
0
false
0
0.077922
0
0.077922
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
d182c00902115ead2177e2cca16758c9b29aad22
216
py
Python
conformalmapping/unitdisk.py
TorbenFricke/cmtoolkit
f1bf1ec191fd9b20e6edcd3385c8b9fee1d638ca
[ "BSD-3-Clause" ]
16
2017-10-14T17:13:48.000Z
2022-01-11T22:19:45.000Z
conformalmapping/unitdisk.py
TorbenFricke/cmtoolkit
f1bf1ec191fd9b20e6edcd3385c8b9fee1d638ca
[ "BSD-3-Clause" ]
11
2015-05-11T08:02:42.000Z
2020-05-21T16:13:45.000Z
conformalmapping/unitdisk.py
TorbenFricke/cmtoolkit
f1bf1ec191fd9b20e6edcd3385c8b9fee1d638ca
[ "BSD-3-Clause" ]
3
2019-12-31T23:07:29.000Z
2021-03-08T02:05:38.000Z
from .disk import Disk from .circle import Circle def unitdisk(): """creates a unit disk region. d = unitdisk() Creates the unit disk region by d = disk(0, 1). """ return Disk(Circle(0, 1))
18
54
0.615741
32
216
4.15625
0.5
0.225564
0.210526
0
0
0
0
0
0
0
0
0.025316
0.268519
216
11
55
19.636364
0.816456
0.435185
0
0
0
0
0
0
0
0
0
0
0
1
0.25
true
0
0.5
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
0
0
0
5
d1c197dc84aee12443207b996d1eb7b7c74cd520
193
py
Python
venv/lib/python2.7/site-packages/requests_toolbelt/exceptions.py
LockScreen/Backend
42485a997f365172c7a63527f0df3b5707fd23f9
[ "MIT" ]
1
2016-04-07T12:16:09.000Z
2016-04-07T12:16:09.000Z
venv/lib/python2.7/site-packages/requests_toolbelt/exceptions.py
LockScreen/Backend
42485a997f365172c7a63527f0df3b5707fd23f9
[ "MIT" ]
null
null
null
venv/lib/python2.7/site-packages/requests_toolbelt/exceptions.py
LockScreen/Backend
42485a997f365172c7a63527f0df3b5707fd23f9
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Collection of exceptions raised by requests-toolbelt.""" class StreamingError(Exception): """Used in :mod:`requests_toolbelt.downloadutils.stream`.""" pass
24.125
64
0.689119
21
193
6.285714
0.904762
0.242424
0
0
0
0
0
0
0
0
0
0.006024
0.139896
193
7
65
27.571429
0.789157
0.678756
0
0
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
d1e7440026064a1ebd84dd6bcd1e8c5b25539028
55
py
Python
python/testData/inspections/PyRedundantParenthesesInspection/YieldFrom.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/inspections/PyRedundantParenthesesInspection/YieldFrom.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/inspections/PyRedundantParenthesesInspection/YieldFrom.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
def method_name(in1): return (yield from func(in1))
27.5
33
0.709091
9
55
4.222222
0.888889
0
0
0
0
0
0
0
0
0
0
0.043478
0.163636
55
2
33
27.5
0.782609
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
06140dd897fec072f78630a9ee309548de2074b3
4,481
py
Python
tests/contracts/interop/test_binary.py
Degget1986/neo-mamba
da7312d5027f3e9b0e5421495d5c00915bdfd786
[ "MIT" ]
null
null
null
tests/contracts/interop/test_binary.py
Degget1986/neo-mamba
da7312d5027f3e9b0e5421495d5c00915bdfd786
[ "MIT" ]
null
null
null
tests/contracts/interop/test_binary.py
Degget1986/neo-mamba
da7312d5027f3e9b0e5421495d5c00915bdfd786
[ "MIT" ]
null
null
null
import unittest from neo3 import vm from tests.contracts.interop.utils import test_engine class BinaryInteropTestCase(unittest.TestCase): def test_serialization(self): engine = test_engine() engine.push(vm.IntegerStackItem(100)) engine.invoke_syscall_by_name("System.Binary.Serialize") item = engine.pop() self.assertIsInstance(item, vm.ByteStringStackItem) self.assertEqual(b'\x21\x01\x64', item.to_array()) # Create an item with data larger than engine.MAX_ITEM_SIZE # this should fail in the BinarySerializer class engine.push(vm.ByteStringStackItem(b'\x01' * (1024 * 1024 * 2))) with self.assertRaises(ValueError) as context: engine.invoke_syscall_by_name("System.Binary.Serialize") self.assertEqual("Output length exceeds max size", str(context.exception)) def test_deserialization(self): engine = test_engine() original_item = vm.IntegerStackItem(100) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Serialize") engine.invoke_syscall_by_name("System.Binary.Deserialize") item = engine.pop() self.assertEqual(original_item, item) engine.push(vm.ByteStringStackItem(b'\xfa\x01')) with self.assertRaises(ValueError) as context: engine.invoke_syscall_by_name("System.Binary.Deserialize") self.assertEqual("Invalid format", str(context.exception)) def test_base64(self): engine = test_engine() original_item = vm.IntegerStackItem(100) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Base64Encode") item = engine.pop() self.assertEqual('ZA==', item.to_array().decode()) engine.push(item) engine.invoke_syscall_by_name("System.Binary.Base64Decode") item = engine.pop() self.assertEqual(original_item, vm.IntegerStackItem(item.to_array())) def test_base58(self): engine = test_engine() original_item = vm.IntegerStackItem(100) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Base58Encode") item = engine.pop() self.assertEqual('2j', item.to_array().decode()) engine.push(item) engine.invoke_syscall_by_name("System.Binary.Base58Decode") item = engine.pop() self.assertEqual(original_item, vm.IntegerStackItem(item.to_array())) def test_itoa(self): engine = test_engine() original_item = vm.IntegerStackItem(100) base = vm.IntegerStackItem(10) engine.push(base) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Itoa") item = engine.pop() self.assertEqual('100', item.to_array().decode('utf-8')) engine = test_engine() base = vm.IntegerStackItem(16) engine.push(base) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Itoa") item = engine.pop() self.assertEqual('64', item.to_array().decode('utf-8')) engine = test_engine() invalid_base = vm.IntegerStackItem(2) engine.push(invalid_base) engine.push(original_item) with self.assertRaises(ValueError) as context: engine.invoke_syscall_by_name("System.Binary.Itoa") self.assertIn("Invalid base specified", str(context.exception)) def test_atoi(self): engine = test_engine() original_item = vm.ByteStringStackItem(b'100') base = vm.IntegerStackItem(10) engine.push(base) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Atoi") item = engine.pop() self.assertEqual(vm.IntegerStackItem(100), item) engine = test_engine() original_item = vm.ByteStringStackItem(b'64') base = vm.IntegerStackItem(16) engine.push(base) engine.push(original_item) engine.invoke_syscall_by_name("System.Binary.Atoi") item = engine.pop() self.assertEqual(vm.IntegerStackItem(100), item) engine = test_engine() invalid_base = vm.IntegerStackItem(2) engine.push(invalid_base) engine.push(original_item) with self.assertRaises(ValueError) as context: engine.invoke_syscall_by_name("System.Binary.Atoi") self.assertIn("Invalid base specified", str(context.exception))
39.307018
82
0.667262
519
4,481
5.581888
0.169557
0.075941
0.098378
0.108733
0.808423
0.746634
0.746634
0.731446
0.622023
0.584743
0
0.021783
0.221379
4,481
113
83
39.654867
0.808541
0.023209
0
0.708333
0
0
0.107225
0.050983
0
0
0
0
0.197917
1
0.0625
false
0
0.03125
0
0.104167
0
0
0
0
null
0
0
0
1
1
1
1
0
0
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
ae182d4feefa4d891f2560e7d044273d7cdd9cfa
30
py
Python
Compiler Design Lab/ChocoPy_LLVM_Compiler/custom_tests/whilestmt.py
Abhishek-Aditya-bs/Lab-Projects-and-Assignments
fd2681a1c7453367a4df1790e58afb312f13998c
[ "MIT" ]
null
null
null
Compiler Design Lab/ChocoPy_LLVM_Compiler/custom_tests/whilestmt.py
Abhishek-Aditya-bs/Lab-Projects-and-Assignments
fd2681a1c7453367a4df1790e58afb312f13998c
[ "MIT" ]
null
null
null
Compiler Design Lab/ChocoPy_LLVM_Compiler/custom_tests/whilestmt.py
Abhishek-Aditya-bs/Lab-Projects-and-Assignments
fd2681a1c7453367a4df1790e58afb312f13998c
[ "MIT" ]
null
null
null
while True: printf("%d",1)
15
18
0.566667
5
30
3.4
1
0
0
0
0
0
0
0
0
0
0
0.041667
0.2
30
2
18
15
0.666667
0
0
0
0
0
0.064516
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
ae3c1457734fabc1f68ffe066404bdc8e7e1d777
131
py
Python
twister/accounts/admin.py
ultr4nerd/twister_project
1627e27ced781f6ea715edd178c82e00dc5e8775
[ "MIT" ]
null
null
null
twister/accounts/admin.py
ultr4nerd/twister_project
1627e27ced781f6ea715edd178c82e00dc5e8775
[ "MIT" ]
5
2021-03-18T22:29:40.000Z
2022-03-11T23:41:52.000Z
twister/accounts/admin.py
ultr4nerd/twister_project
1627e27ced781f6ea715edd178c82e00dc5e8775
[ "MIT" ]
null
null
null
"""Admin config for accounts app""" from django.contrib import admin from .models import Profile admin.site.register(Profile)
14.555556
35
0.763359
18
131
5.555556
0.722222
0
0
0
0
0
0
0
0
0
0
0
0.145038
131
8
36
16.375
0.892857
0.221374
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
ae86d0679d61d6125135708ca69ca32e8acb5615
32
py
Python
plugins/uptime_plugin/__init__.py
StarryPy/StarryPy-Historic
b9dbd552b8c4631a5a8e9dda98b7ba447eca59da
[ "WTFPL" ]
38
2015-02-12T11:57:59.000Z
2018-11-15T16:03:45.000Z
plugins/uptime_plugin/__init__.py
StarryPy/StarryPy-Historic
b9dbd552b8c4631a5a8e9dda98b7ba447eca59da
[ "WTFPL" ]
68
2015-02-05T23:29:47.000Z
2017-12-27T08:26:25.000Z
plugins/uptime_plugin/__init__.py
StarryPy/StarryPy-Historic
b9dbd552b8c4631a5a8e9dda98b7ba447eca59da
[ "WTFPL" ]
21
2015-02-06T18:58:21.000Z
2017-12-24T20:08:59.000Z
from uptime import UptimePlugin
16
31
0.875
4
32
7
1
0
0
0
0
0
0
0
0
0
0
0
0.125
32
1
32
32
1
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
ae9c177d3942674ac9f5e057d337bbc8b66bcb46
46
py
Python
workspace/bat_test/c.py
Anylee2142/News_Rank_System
0185cf5cdbe709e27a8ec270733bef135ce32a89
[ "MIT" ]
null
null
null
workspace/bat_test/c.py
Anylee2142/News_Rank_System
0185cf5cdbe709e27a8ec270733bef135ce32a89
[ "MIT" ]
null
null
null
workspace/bat_test/c.py
Anylee2142/News_Rank_System
0185cf5cdbe709e27a8ec270733bef135ce32a89
[ "MIT" ]
null
null
null
import time print('completed !') time.sleep(1)
15.333333
20
0.73913
7
46
4.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0.02381
0.086957
46
3
21
15.333333
0.785714
0
0
0
0
0
0.234043
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
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
882d44aaf1ae5054b13e6943021fd581bb5286f8
2,800
py
Python
test/test_rnn/test_learner.py
DwangoMediaVillage/marltas_core
91a5caf75c2350a31d47d1b0408c817644a0d41e
[ "MIT" ]
9
2021-02-15T08:20:31.000Z
2022-01-04T09:29:35.000Z
test/test_rnn/test_learner.py
DwangoMediaVillage/marltas_core
91a5caf75c2350a31d47d1b0408c817644a0d41e
[ "MIT" ]
null
null
null
test/test_rnn/test_learner.py
DwangoMediaVillage/marltas_core
91a5caf75c2350a31d47d1b0408c817644a0d41e
[ "MIT" ]
1
2021-09-21T16:11:17.000Z
2021-09-21T16:11:17.000Z
import tempfile from pathlib import Path from dqn import episodic_curiosity from dqn.learner import LearnerConfig from dqn.rnn.config import IntrinsicRewardConfig, RNNConfigBase from dqn.rnn.datum import Batch, SampleFromBuffer from dqn.rnn.learner import Learner from dqn.rnn.policy import Policy def test_vector_obs_update(): config = RNNConfigBase(obs_shape=[ 2, ], intrinsic_reward=IntrinsicRewardConfig( enable=True, episodic_curiosity=episodic_curiosity.EpisodicCuriosityConfig(enable=True))) learner = Learner(config=config) batch = Batch.from_buffer_sample(sample=SampleFromBuffer.as_random(size=3, np_defs=config.sample_from_buffer_def)) learner.update_core(batch) def test_update(): config = RNNConfigBase(learner=LearnerConfig(batch_size=3, double_dqn=True, target_sync_interval=1), intrinsic_reward=IntrinsicRewardConfig( enable=True, episodic_curiosity=episodic_curiosity.EpisodicCuriosityConfig(enable=True))) learner = Learner(config=config) batch = Batch.from_buffer_sample(sample=SampleFromBuffer.as_random(size=3, np_defs=config.sample_from_buffer_def)) learner.update_core(batch) def test_save_model(): config = RNNConfigBase(learner=LearnerConfig(batch_size=2, target_sync_interval=1), intrinsic_reward=IntrinsicRewardConfig(enable=True)) learner = Learner(config=config) with tempfile.TemporaryDirectory() as log_dir: learner.save_model(log_dir=Path(log_dir), global_step=0) def test_update_param(): config = RNNConfigBase(learner=LearnerConfig(batch_size=3, double_dqn=True, target_sync_interval=1), intrinsic_reward=IntrinsicRewardConfig( enable=True, episodic_curiosity=episodic_curiosity.EpisodicCuriosityConfig(enable=True))) learner = Learner(config=config) policy = Policy(config=config) assert learner.online_model.get_param() != policy.model.get_param() assert learner.episodic_curiosity_module.embedding_network.get_param( ) != policy.episodic_curiosity_module.embedding_network.get_param() assert learner.episodic_curiosity_module.inverse_model.get_param( ) != policy.episodic_curiosity_module.inverse_model.get_param() policy.update_model_param(learner.get_model_param(), only_online_model=False) assert learner.online_model.get_param() == policy.model.get_param() assert learner.episodic_curiosity_module.embedding_network.get_param( ) == policy.episodic_curiosity_module.embedding_network.get_param() assert learner.episodic_curiosity_module.inverse_model.get_param( ) == policy.episodic_curiosity_module.inverse_model.get_param()
45.901639
120
0.749643
324
2,800
6.182099
0.194444
0.127309
0.051922
0.047429
0.750874
0.750874
0.713929
0.713929
0.710934
0.678482
0
0.004281
0.165714
2,800
60
121
46.666667
0.853168
0
0
0.425532
0
0
0
0
0
0
0
0
0.12766
1
0.085106
false
0
0.170213
0
0.255319
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
883f862cc0c20708c1aae1c0650d64555ee69dd7
203
py
Python
backend/api/admin/actions/export_label.py
james687/disfactory-backend
9129e40e5a21f1e9e16bfc149b08b3758865be86
[ "MIT" ]
35
2020-01-02T10:52:49.000Z
2022-03-18T06:01:15.000Z
backend/api/admin/actions/export_label.py
james687/disfactory-backend
9129e40e5a21f1e9e16bfc149b08b3758865be86
[ "MIT" ]
348
2019-10-09T12:58:42.000Z
2022-03-30T14:17:51.000Z
backend/api/admin/actions/export_label.py
james687/disfactory-backend
9129e40e5a21f1e9e16bfc149b08b3758865be86
[ "MIT" ]
19
2019-10-09T12:51:11.000Z
2021-12-12T01:02:32.000Z
from api.utils import set_function_attributes class ExportLabelMixin: @set_function_attributes(short_description="下載標籤及交寄執據") def export_labels_as_docx(self, request, queryset): return
25.375
59
0.788177
24
203
6.333333
0.875
0.144737
0.276316
0
0
0
0
0
0
0
0
0
0.147783
203
7
60
29
0.878613
0
0
0
0
0
0.044335
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.8
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
8850bf212374a055c68a2770a2a9e0dcf5b7d17d
97
py
Python
main/admin.py
NikOneZ1/MarkovChainText
894f3de75c2a5781f95c95557e40fbfbe29ef051
[ "MIT" ]
1
2022-01-20T17:26:29.000Z
2022-01-20T17:26:29.000Z
main/admin.py
NikOneZ1/MarkovChainText
894f3de75c2a5781f95c95557e40fbfbe29ef051
[ "MIT" ]
7
2022-01-11T16:24:12.000Z
2022-01-21T23:05:19.000Z
main/admin.py
NikOneZ1/MarkovChainText
894f3de75c2a5781f95c95557e40fbfbe29ef051
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import PresetText admin.site.register(PresetText)
19.4
32
0.835052
13
97
6.230769
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.103093
97
4
33
24.25
0.931034
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8877db3ef29712d02e9772bcf5582727bc389b58
181
py
Python
storm/request/parameters/__init__.py
Rud356/Storm
18f8b7ac89babf9252da28c39c2cc84087f2afaf
[ "Apache-2.0" ]
1
2022-03-18T18:14:34.000Z
2022-03-18T18:14:34.000Z
storm/request/parameters/__init__.py
Rud356/Storm
18f8b7ac89babf9252da28c39c2cc84087f2afaf
[ "Apache-2.0" ]
1
2021-12-23T19:39:27.000Z
2021-12-23T19:39:27.000Z
storm/request/parameters/__init__.py
Rud356/Storm
18f8b7ac89babf9252da28c39c2cc84087f2afaf
[ "Apache-2.0" ]
null
null
null
from .base_request_parameter import BaseRequestParameter from .cookie import CookieParameter from .query import QueryParameter from .url import URLParameter, CompilableUrlParameter
36.2
56
0.878453
19
181
8.263158
0.684211
0
0
0
0
0
0
0
0
0
0
0
0.093923
181
4
57
45.25
0.957317
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
887bb6ae1f2b3650ee4214e41caa5c9edfeee145
119
py
Python
sphinx/__main__.py
daobook/sphinx
ef8daca1f9a82ede9b4b0b5cde93f3414cee3dfe
[ "BSD-2-Clause" ]
null
null
null
sphinx/__main__.py
daobook/sphinx
ef8daca1f9a82ede9b4b0b5cde93f3414cee3dfe
[ "BSD-2-Clause" ]
1,662
2015-01-02T11:45:27.000Z
2015-01-03T12:21:29.000Z
sphinx/__main__.py
daobook/sphinx
ef8daca1f9a82ede9b4b0b5cde93f3414cee3dfe
[ "BSD-2-Clause" ]
null
null
null
"""The Sphinx documentation toolchain.""" import sys from sphinx.cmd.build import main sys.exit(main(sys.argv[1:]))
14.875
41
0.731092
18
119
4.833333
0.722222
0.16092
0
0
0
0
0
0
0
0
0
0.009524
0.117647
119
7
42
17
0.819048
0.294118
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
88b6b9d42626b0e473c809b983d97dc73b946078
27
py
Python
model/__init__.py
Impavidity/text-classification-cnn
70e4a22802c568870ecf007eae557c58c9379e03
[ "MIT" ]
null
null
null
model/__init__.py
Impavidity/text-classification-cnn
70e4a22802c568870ecf007eae557c58c9379e03
[ "MIT" ]
null
null
null
model/__init__.py
Impavidity/text-classification-cnn
70e4a22802c568870ecf007eae557c58c9379e03
[ "MIT" ]
null
null
null
from model.cnnText import *
27
27
0.814815
4
27
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
27
1
27
27
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ee20963803e059cad9c58c94839787ffec56ef90
98
wsgi
Python
app.wsgi
ahmedwaqas92/jwacademicsweb
d8f98e5bc3af7ba15bd285e1e7dab411459586da
[ "MIT" ]
2
2022-03-18T05:31:46.000Z
2022-03-19T11:27:16.000Z
app.wsgi
ahmedwaqas92/jwacademicsweb
d8f98e5bc3af7ba15bd285e1e7dab411459586da
[ "MIT" ]
null
null
null
app.wsgi
ahmedwaqas92/jwacademicsweb
d8f98e5bc3af7ba15bd285e1e7dab411459586da
[ "MIT" ]
1
2022-03-20T16:50:43.000Z
2022-03-20T16:50:43.000Z
import sys sys.path.insert(0, '/var/www/html/jwacademicsweb') from app import app as application
19.6
50
0.77551
16
98
4.75
0.8125
0
0
0
0
0
0
0
0
0
0
0.011494
0.112245
98
4
51
24.5
0.862069
0
0
0
0
0
0.285714
0.285714
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
ee24534286c141193db422290085673793296c39
149
py
Python
blog/admin.py
xk-wang/django_blog
fdaf826584e9791df8584801b250e052a993661c
[ "MIT" ]
null
null
null
blog/admin.py
xk-wang/django_blog
fdaf826584e9791df8584801b250e052a993661c
[ "MIT" ]
null
null
null
blog/admin.py
xk-wang/django_blog
fdaf826584e9791df8584801b250e052a993661c
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Post, Column # Register your models here. admin.site.register(Post) admin.site.register(Column)
24.833333
32
0.805369
22
149
5.454545
0.545455
0.15
0.283333
0
0
0
0
0
0
0
0
0
0.107383
149
6
33
24.833333
0.902256
0.174497
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
c98c87ca4fbd5cdfada20281315a92b089758dba
129
py
Python
index/admin.py
ISeaTeL/ISeaTeL_Cup_Site
df22d993db2649a3eb118177bdd13358e3036e59
[ "MIT" ]
null
null
null
index/admin.py
ISeaTeL/ISeaTeL_Cup_Site
df22d993db2649a3eb118177bdd13358e3036e59
[ "MIT" ]
null
null
null
index/admin.py
ISeaTeL/ISeaTeL_Cup_Site
df22d993db2649a3eb118177bdd13358e3036e59
[ "MIT" ]
null
null
null
from django.contrib import admin # Register your models here. from index.models import Bulletin admin.site.register(Bulletin)
16.125
33
0.806202
18
129
5.777778
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.131783
129
7
34
18.428571
0.928571
0.20155
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
c9de1bf48f37e5cb0fdf36202f56abebf8c78c48
419
py
Python
app/models/models.py
igmalta/ml-classification-api
3fd2ebc7b656ed879b126931d40b015ac8588fb7
[ "MIT" ]
null
null
null
app/models/models.py
igmalta/ml-classification-api
3fd2ebc7b656ed879b126931d40b015ac8588fb7
[ "MIT" ]
null
null
null
app/models/models.py
igmalta/ml-classification-api
3fd2ebc7b656ed879b126931d40b015ac8588fb7
[ "MIT" ]
null
null
null
# app/models/models.py # Document models from mongoengine import Document, StringField class User(Document): """User model""" # User register fields email = StringField(required=True) first_name = StringField(required=True) last_name = StringField(required=True) password = StringField(required=True) # Database alias used to connect (mongoengine format) meta = {"db_alias": "user"}
24.647059
57
0.711217
48
419
6.145833
0.583333
0.257627
0.311864
0.183051
0
0
0
0
0
0
0
0
0.186158
419
16
58
26.1875
0.865103
0.288783
0
0
0
0
0.041522
0
0
0
0
0
0
1
0
false
0.142857
0.142857
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
5
a013fdfadc6567800c3ef6a253cb95a10354b95b
2,404
py
Python
lib/clckwrkbdgr/test/test_sql.py
umi0451/dotfiles
c618811be788d995fe01f6a16b355828d7efdd36
[ "MIT" ]
2
2017-04-16T14:54:17.000Z
2020-11-12T04:15:00.000Z
lib/clckwrkbdgr/test/test_sql.py
clckwrkbdgr/dotfiles
292dac8c3211248b490ddbae55fe2adfffcfcf58
[ "MIT" ]
null
null
null
lib/clckwrkbdgr/test/test_sql.py
clckwrkbdgr/dotfiles
292dac8c3211248b490ddbae55fe2adfffcfcf58
[ "MIT" ]
null
null
null
import unittest unittest.defaultTestLoader.testMethodPrefix = 'should' from clckwrkbdgr import sql class TestSqlTableRow(unittest.TestCase): def should_representt_row_as_string(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(str(row), "{'First':1, 'Second':2, 'Third':'foo'}") self.assertEqual(repr(row), "Row((1, 2, 'foo'), ('First', 'Second', 'Third'))") def should_compare_rows_as_tuples_of_Values(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) same = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) other = sql.Row([1, 3, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(row, same) self.assertNotEqual(row, other) self.assertTrue(row == same) self.assertFalse(row != same) self.assertFalse(row == other) self.assertTrue(row <= same) self.assertFalse(row < same) self.assertTrue(row <= other) self.assertTrue(row < other) def should_access_row_by_index(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(row[0], 1) self.assertEqual(row[1], 2) self.assertEqual(row[2], 'foo') def should_access_row_by_name(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(row['First'], 1) self.assertEqual(row['Second'], 2) self.assertEqual(row['Third'], 'foo') def should_access_row_by_attr(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(row.First, 1) self.assertEqual(row.Second, 2) self.assertEqual(row.Third, 'foo') def should_iterate_over_row(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(tuple(row), (1, 2, 'foo')) def should_create_sql_row(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(row['First'], 1) self.assertEqual(row['Second'], 2) self.assertEqual(row['Third'], 'foo') self.assertEqual(tuple(row), (1, 2, 'foo')) def should_create_sql_row_without_header(self): row = sql.Row([1, 2, 'foo']) self.assertEqual(row['0'], 1) self.assertEqual(row['1'], 2) self.assertEqual(row['2'], 'foo') self.assertEqual(tuple(row), (1, 2, 'foo')) def should_access_headers(self): row = sql.Row([1, 2, 'foo'], ['First', 'Second', 'Third']) self.assertEqual(row.get_headers(), ('First', 'Second', 'Third')) row = sql.Row([1, 2, 'foo']) self.assertEqual(row.get_headers(), ('0', '1', '2'))
41.448276
81
0.649334
347
2,404
4.391931
0.146974
0.226378
0.212598
0.07874
0.768373
0.714567
0.694226
0.651575
0.633858
0.603675
0
0.025202
0.125208
2,404
57
82
42.175439
0.699477
0
0
0.339286
0
0
0.152246
0
0
0
0
0
0.553571
1
0.160714
false
0
0.035714
0
0.214286
0
0
0
0
null
1
1
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
a01f89c5695adffbebf944ced2feef584fdbe75d
194
py
Python
dietr/models/pantry.py
essoplerck/dietr
982636c1fea848cf6b90c036dc6ca8a4f37f68a2
[ "MIT" ]
1
2020-09-25T03:53:46.000Z
2020-09-25T03:53:46.000Z
dietr/models/pantry.py
essoplerck/dietr
982636c1fea848cf6b90c036dc6ca8a4f37f68a2
[ "MIT" ]
null
null
null
dietr/models/pantry.py
essoplerck/dietr
982636c1fea848cf6b90c036dc6ca8a4f37f68a2
[ "MIT" ]
null
null
null
class PantryModel: def get_ingredients(self, user_id): """Get all ingredients from in pantry and return a list of instances of the ingredient class. """ pass
27.714286
76
0.634021
25
194
4.84
0.84
0
0
0
0
0
0
0
0
0
0
0
0.304124
194
6
77
32.333333
0.896296
0.463918
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
4e645593cf136c6938e2ec797829bceeb1408576
6,441
py
Python
geo_agent/test/class_A.py
kevjp/openstreetmap-carto
be30cfe8d73f78cb4b5ba9acaaf42a942c70270d
[ "CC0-1.0" ]
null
null
null
geo_agent/test/class_A.py
kevjp/openstreetmap-carto
be30cfe8d73f78cb4b5ba9acaaf42a942c70270d
[ "CC0-1.0" ]
null
null
null
geo_agent/test/class_A.py
kevjp/openstreetmap-carto
be30cfe8d73f78cb4b5ba9acaaf42a942c70270d
[ "CC0-1.0" ]
null
null
null
import psycopg2 from shapely import geometry, ops, wkb import time import pyproj import numpy as np def ways_tab(convert_osm_nodes_sql_2_numpy, convert_osm_ways_vertices_sql_2_numpy): # Connect to database print("I was here") conn = psycopg2.connect(dbname = "london_routing", user = "kevinryan", host = "localhost") curs = conn.cursor() t1 = time.time() start = 2448172873 end = 2372627054 curs.execute("select osm_id, attributes -> 'lon' as lon, attributes -> 'lat' as lat, svals(slice(tags, ARRAY['leisure','shop'])) from osm_nodes where tags -> 'shop' = 'supermarket' or tags -> 'leisure' = 'park';") results = curs.fetchall() osm_nodes_np_arr = convert_osm_nodes_sql_2_numpy(results) curs.execute("select osm_id, lon, lat from ways_vertices_pgr;") ways_vertices = curs.fetchall() osm_waysvertex_np_arr = convert_osm_ways_vertices_sql_2_numpy(ways_vertices) return osm_nodes_np_arr, osm_waysvertex_np_arr def convert_osm_nodes_sql_2_numpy(sql_table): """ convert sql table to numpy array """ projectlon_lat_2_utm = pyproj.Proj(proj='utm', zone=30, ellps='WGS84', preserve_units=True) rows = [] for res in sql_table: x, y = projectlon_lat_2_utm(float(res[1]), float(res[2])) res_elem = (res[0], float(res[1]), float(res[2]), y, x, res[3]) rows.append(res_elem) # convert sql table to numpy array dt = np.dtype([('osm_id', 'i4'), ('lon', 'float'), ('lat', 'float'), ('y', 'float'), ('x', 'float'), ('tags', 'U12')]) osm_nodes_np_arr = np.array(rows, dt) # sort according to location osm_nodes_np_arr = osm_nodes_np_arr[np.lexsort((osm_nodes_np_arr['y'], osm_nodes_np_arr['x']))] return osm_nodes_np_arr def convert_osm_ways_vertices_sql_2_numpy(sql_table): """ convert sql table to numpy array """ projectlon_lat_2_utm = pyproj.Proj(proj='utm', zone=30, ellps='WGS84', preserve_units=True) rows = [] for res in sql_table: x, y = projectlon_lat_2_utm(float(res[1]), float(res[2])) res_elem = (res[0], float(res[1]), float(res[2]), y, x) rows.append(res_elem) # convert sql table to numpy array # dt = np.dtype([('osm_id', 'i4'), ('lon', 'float'), ('lat', 'float'), ('y', 'float'), ('x', 'float')]) dt = np.dtype(float) osm_waysvertex_np_arr = np.array(rows, dt) # sort according to location y = osm_waysvertex_np_arr[:,3] # sort by y x = osm_waysvertex_np_arr[:,4] # sort by x osm_waysvertex_np_arr = osm_waysvertex_np_arr[np.lexsort((x,y))] return osm_waysvertex_np_arr a,b = ways_tab(convert_osm_nodes_sql_2_numpy, convert_osm_ways_vertices_sql_2_numpy) # def __init__(self): # # Connect to database # self.projectlon_lat_2_utm = pyproj.Proj(proj='utm', zone=30, ellps='WGS84', preserve_units=True) # print("I was here") # conn = psycopg2.connect(dbname = "london_routing", user = "kevinryan", host = "localhost") # curs = conn.cursor() # t1 = time.time() # start = 2448172873 # end = 2372627054 # curs.execute("select osm_id, attributes -> 'lon' as lon, attributes -> 'lat' as lat, svals(slice(tags, ARRAY['leisure','shop'])) from osm_nodes where tags -> 'shop' = 'supermarket' or tags -> 'leisure' = 'park';") # results = curs.fetchall() # self.convert_osm_nodes_sql_2_numpy(results) # curs.execute("select osm_id, lon, lat from ways_vertices_pgr;") # ways_vertices = curs.fetchall() # self.convert_osm_ways_vertices_sql_2_numpy(ways_vertices) # def convert_osm_nodes_sql_2_numpy(self,sql_table): # """ # convert sql table to numpy array # """ # rows = [] # for res in sql_table: # x, y = self.latlon_2_yx(float(res[1]), float(res[2])) # res_elem = (res[0], float(res[1]), float(res[2]), y, x, res[3]) # rows.append(res_elem) # # convert sql table to numpy array # dt = np.dtype([('osm_id', 'i4'), ('lon', 'float'), ('lat', 'float'), ('y', 'float'), ('x', 'float'), ('tags', 'U12')]) # self.osm_nodes_np_arr = np.array(rows, dt) # # sort according to location # self.osm_nodes_np_arr = self.osm_nodes_np_arr[np.lexsort((self.osm_nodes_np_arr['y'], self.osm_nodes_np_arr['x']))] # def convert_osm_ways_vertices_sql_2_numpy(self,sql_table): # """ # convert sql table to numpy array # """ # rows = [] # for res in sql_table: # x, y = self.latlon_2_yx(float(res[1]), float(res[2])) # res_elem = (res[0], float(res[1]), float(res[2]), y, x) # rows.append(res_elem) # # convert sql table to numpy array # # dt = np.dtype([('osm_id', 'i4'), ('lon', 'float'), ('lat', 'float'), ('y', 'float'), ('x', 'float')]) # dt = np.dtype(float) # self.osm_waysvertex_np_arr = np.array(rows, dt) # # sort according to location # y = self.osm_waysvertex_np_arr[:,3] # sort by y # x = self.osm_waysvertex_np_arr[:,4] # sort by x # self.osm_waysvertex_np_arr = self.osm_waysvertex_np_arr[np.lexsort((x,y))] # def latlon_2_yx(self, lat=None, lon=None): # """ # Converts WGS84 lat lon values to UTM # """ # # Project lon lat coordinates into UTM scale # return self.projectlon_lat_2_utm(lat, lon) # def yx_2_latlon(self,y,x): # """ # Converts y,x UTM values to WGS84 lat, lon # """ # # Project UTM y, x values to lon lat # return self.projectlon_lat_2_utm(lat, lon, inverse=True) # # Connect to database # conn = psycopg2.connect(dbname = "london_routing", user = "kevinryan", host = "localhost") # curs = conn.cursor() # t1 = time.time() # start = 2448172873 # end = 2372627054 # curs.execute("SELECT seq, edge, b.the_geom AS \"the_geom (truncated)\", b.name FROM pgr_dijkstra('SELECT gid as id, source_osm as source, target_osm as target, length as cost FROM ways',%s, %s, false) a INNER JOIN ways b ON (a.edge = b.gid) ORDER BY seq;", [start, end]) # __conf = { # 'route_list' : [wkb.loads(row[2], hex=True) for row in curs] # } # t2 = time.time() # total = t2 -t1 # print(total) # @staticmethod # def config(name): # return A.__conf[name]
36.389831
276
0.613259
932
6,441
3.992489
0.150215
0.034937
0.034937
0.045418
0.819672
0.777748
0.747111
0.737436
0.6767
0.639076
0
0.029256
0.235833
6,441
176
277
36.596591
0.726737
0.557522
0
0.227273
0
0.022727
0.127714
0.009201
0
0
0
0
0
1
0.068182
false
0
0.113636
0
0.25
0.022727
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
4e6dde1c0d1ea674b59e3e19f32ef2791f22bc3b
127
py
Python
library/.config/calibre/conversion/page_setup.py
funkeyfreak/calibre-drm-stripper
90813b644c86543fb423b4fd664685a02b43e525
[ "Apache-2.0" ]
null
null
null
library/.config/calibre/conversion/page_setup.py
funkeyfreak/calibre-drm-stripper
90813b644c86543fb423b4fd664685a02b43e525
[ "Apache-2.0" ]
null
null
null
library/.config/calibre/conversion/page_setup.py
funkeyfreak/calibre-drm-stripper
90813b644c86543fb423b4fd664685a02b43e525
[ "Apache-2.0" ]
1
2022-02-05T00:18:21.000Z
2022-02-05T00:18:21.000Z
version https://git-lfs.github.com/spec/v1 oid sha256:a07475e365d5c7b75a938ac47a51edd365885de6f6a6e33216decf0ec2d247c4 size 43
31.75
75
0.88189
13
127
8.615385
1
0
0
0
0
0
0
0
0
0
0
0.371901
0.047244
127
3
76
42.333333
0.553719
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
4e70dd3b203202feae01a64d17e89a8cc3a94eba
54
py
Python
load_rmbg_model.py
VincentSchmid/AOE_Shirts-api
a4566809199618a5d40af5182e3009cdf275ebd5
[ "MIT" ]
1
2021-11-24T12:17:25.000Z
2021-11-24T12:17:25.000Z
load_rmbg_model.py
VincentSchmid/AOE_Shirts
a4566809199618a5d40af5182e3009cdf275ebd5
[ "MIT" ]
null
null
null
load_rmbg_model.py
VincentSchmid/AOE_Shirts
a4566809199618a5d40af5182e3009cdf275ebd5
[ "MIT" ]
null
null
null
from rembg.u2net.detect import load_model load_model()
27
41
0.851852
9
54
4.888889
0.777778
0.409091
0
0
0
0
0
0
0
0
0
0.02
0.074074
54
2
42
27
0.86
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
14c8c764ee6bc7c775a2566e7cb3895e27e0a8f7
44
py
Python
ciclo1_python/upb/MisionTIC_UPB_Ciclo1/Python-coding/Ejemplos-Formador/copia_para_VisualStudioCode_mision-tic-2022/07-Python-101-Formato-salida-FelipeEscallon.py
felipeescallon/mision_tic_2022
20496fc40b18d2e98114d6362928f34fde41aaae
[ "CC0-1.0" ]
7
2021-07-05T21:25:50.000Z
2021-11-09T11:09:41.000Z
ciclo1_python/upb/MisionTIC_UPB_Ciclo1/Python-coding/Ejemplos-Formador/copia_para_VisualStudioCode_mision-tic-2022/07-Python-101-Formato-salida-FelipeEscallon.py
felipeescallon/mision_tic_2022
20496fc40b18d2e98114d6362928f34fde41aaae
[ "CC0-1.0" ]
null
null
null
ciclo1_python/upb/MisionTIC_UPB_Ciclo1/Python-coding/Ejemplos-Formador/copia_para_VisualStudioCode_mision-tic-2022/07-Python-101-Formato-salida-FelipeEscallon.py
felipeescallon/mision_tic_2022
20496fc40b18d2e98114d6362928f34fde41aaae
[ "CC0-1.0" ]
null
null
null
#07-Python-101-Formato-salida-FelipeEscallon
44
44
0.863636
6
44
6.333333
1
0
0
0
0
0
0
0
0
0
0
0.113636
0
44
1
44
44
0.75
0.977273
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
14d7577b38f85e4cb2bed56a69c79ece3f99f89f
52
py
Python
tracki/src/infrastructure/exceptions/shift.py
rok-povsic/Tracki
f92fec62fa66e87fa6feb509142f09cd548c570a
[ "MIT" ]
null
null
null
tracki/src/infrastructure/exceptions/shift.py
rok-povsic/Tracki
f92fec62fa66e87fa6feb509142f09cd548c570a
[ "MIT" ]
null
null
null
tracki/src/infrastructure/exceptions/shift.py
rok-povsic/Tracki
f92fec62fa66e87fa6feb509142f09cd548c570a
[ "MIT" ]
null
null
null
class NoShiftsPresentException(Exception): pass
17.333333
42
0.807692
4
52
10.5
1
0
0
0
0
0
0
0
0
0
0
0
0.134615
52
2
43
26
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
093a38d3285a9e2e563e6d4d62e7577902afa955
44
py
Python
src/autoinfo/decoders/errors.py
JeyKip/autoinfo-scrapper
ca0cb87b1d9486b71928fb08df734fc1413b7967
[ "MIT" ]
null
null
null
src/autoinfo/decoders/errors.py
JeyKip/autoinfo-scrapper
ca0cb87b1d9486b71928fb08df734fc1413b7967
[ "MIT" ]
null
null
null
src/autoinfo/decoders/errors.py
JeyKip/autoinfo-scrapper
ca0cb87b1d9486b71928fb08df734fc1413b7967
[ "MIT" ]
null
null
null
class HexDecodingError(Exception): pass
14.666667
34
0.772727
4
44
8.5
1
0
0
0
0
0
0
0
0
0
0
0
0.159091
44
2
35
22
0.918919
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
093fd533a0862c09fbc718d58b8c0088239a51ff
431
py
Python
src/pyinterp/tests/test_cf.py
CNES/pangeo-pyinterp
5f75f62a6c681db89c5aa8c74e43fc04a77418c3
[ "BSD-3-Clause" ]
67
2019-07-09T09:10:22.000Z
2022-03-01T09:46:35.000Z
src/pyinterp/tests/test_cf.py
CNES/pangeo-pyinterp
5f75f62a6c681db89c5aa8c74e43fc04a77418c3
[ "BSD-3-Clause" ]
8
2019-07-15T13:54:31.000Z
2021-06-28T05:06:34.000Z
src/pyinterp/tests/test_cf.py
CNES/pangeo-pyinterp
5f75f62a6c681db89c5aa8c74e43fc04a77418c3
[ "BSD-3-Clause" ]
7
2019-07-15T17:28:16.000Z
2022-01-19T19:43:47.000Z
# Copyright (c) 2021 CNES # # All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import pyinterp.cf def test_longitude(): assert isinstance(pyinterp.cf.AxisLongitudeUnit().units, list) def test_latitude(): assert isinstance(pyinterp.cf.AxisLatitudeUnit().units, list) def test_time(): assert isinstance(pyinterp.cf.AxisTimeUnit().units, list)
23.944444
66
0.74942
60
431
5.333333
0.683333
0.125
0.225
0.24375
0
0
0
0
0
0
0
0.010929
0.150812
431
17
67
25.352941
0.863388
0.329466
0
0
0
0
0
0
0
0
0
0
0.428571
1
0.428571
true
0
0.142857
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
1
0
1
1
0
0
0
0
0
0
5
11a014491a39e043c8dfb48751757a39221dea3c
34
py
Python
project/server/auth/__init__.py
InStateTeam/virtual-identities
91af9f8f9aa709a77360d608e29ae9969fc0e098
[ "MIT" ]
267
2017-01-10T09:01:55.000Z
2022-03-23T02:59:31.000Z
project/server/auth/__init__.py
InStateTeam/virtual-identities
91af9f8f9aa709a77360d608e29ae9969fc0e098
[ "MIT" ]
39
2019-03-13T05:40:40.000Z
2021-06-25T15:17:43.000Z
project/server/auth/__init__.py
InStateTeam/virtual-identities
91af9f8f9aa709a77360d608e29ae9969fc0e098
[ "MIT" ]
199
2016-12-13T20:44:01.000Z
2022-03-30T08:57:15.000Z
# project/server/auth/__init__.py
17
33
0.794118
5
34
4.6
1
0
0
0
0
0
0
0
0
0
0
0
0.058824
34
1
34
34
0.71875
0.911765
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
11bd057a9cd7de84419ef0ffaf1ece4a575bf92e
302
py
Python
retriever/pipeline.py
GaiYu0/learning_to_retrieve_reasoning_paths
f83c7a8f707c62d51b749716b7afc01e9cb9d737
[ "MIT" ]
null
null
null
retriever/pipeline.py
GaiYu0/learning_to_retrieve_reasoning_paths
f83c7a8f707c62d51b749716b7afc01e9cb9d737
[ "MIT" ]
null
null
null
retriever/pipeline.py
GaiYu0/learning_to_retrieve_reasoning_paths
f83c7a8f707c62d51b749716b7afc01e9cb9d737
[ "MIT" ]
null
null
null
db = DocDB('models/hotpot_models/wiki_db/wiki_abst_only_hotpotqa_w_original_title.db') ranker = TfidfDocRanker(tfidf_path='models/hotpot_models/tfidf_retriever/wiki_open_full_new_db_intro_only-tfidf-ngram\=2-hash\=16777216-tokenizer\=simple.npz') data = json.load('data/hotpot/hotpot_train_v1.1.json')
75.5
159
0.84106
49
302
4.795918
0.673469
0.102128
0.153191
0
0
0
0
0
0
0
0
0.037543
0.029801
302
3
160
100.666667
0.764505
0
0
0
0
0.333333
0.751656
0.751656
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
11cb204e4b35088a579af7dc279f2120c980082d
119
py
Python
devtask/commands/extend_process.py
vecin2/em_automation
b65bc498cc7c366d06425e51aaf04b970d581050
[ "MIT" ]
null
null
null
devtask/commands/extend_process.py
vecin2/em_automation
b65bc498cc7c366d06425e51aaf04b970d581050
[ "MIT" ]
84
2018-09-15T21:36:23.000Z
2021-12-13T19:49:57.000Z
devtask/commands/extend_process.py
vecin2/em_automation
b65bc498cc7c366d06425e51aaf04b970d581050
[ "MIT" ]
null
null
null
from devtask.extend_process import main class ExtendProcessCommand(object): def run(self): return main()
17
39
0.722689
14
119
6.071429
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.201681
119
6
40
19.833333
0.894737
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
11cd27134b52d159bbf74c67f6e908940e49a3d0
140
py
Python
universities_api/admin.py
FahimSifnatul/world_universities
3406a1b701a0db597b5f899da7d6d84ca50d3c93
[ "MIT" ]
null
null
null
universities_api/admin.py
FahimSifnatul/world_universities
3406a1b701a0db597b5f899da7d6d84ca50d3c93
[ "MIT" ]
null
null
null
universities_api/admin.py
FahimSifnatul/world_universities
3406a1b701a0db597b5f899da7d6d84ca50d3c93
[ "MIT" ]
null
null
null
from django.contrib import admin # customs from .models import Universities # Register your models here. admin.site.register(Universities)
20
33
0.814286
18
140
6.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.121429
140
7
33
20
0.926829
0.242857
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
11f23e87af3ef69b00b7c5c5aadb48644f51e6eb
93
py
Python
blender_bindings/material_loader/shaders/source2_shaders/complex.py
anderlli0053/SourceIO
3c0c4839939ce698439987ac52154f89ee2f5341
[ "MIT" ]
199
2019-04-02T02:30:58.000Z
2022-03-30T21:29:49.000Z
bpy_utilities/material_loader/shaders/source2_shaders/complex.py
syborg64/SourceIO
e4ba86d801f518e192260af08ef533759c2e1cc3
[ "MIT" ]
113
2019-03-03T19:36:25.000Z
2022-03-31T19:44:05.000Z
bpy_utilities/material_loader/shaders/source2_shaders/complex.py
syborg64/SourceIO
e4ba86d801f518e192260af08ef533759c2e1cc3
[ "MIT" ]
38
2019-05-15T16:49:30.000Z
2022-03-22T03:40:43.000Z
from .vr_complex import VrComplex class Complex(VrComplex): SHADER: str = 'complex.vfx'
18.6
33
0.741935
12
93
5.666667
0.75
0
0
0
0
0
0
0
0
0
0
0
0.16129
93
5
34
18.6
0.871795
0
0
0
0
0
0.117021
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
ee9b20b886373a6805e130f92b0bc180058d00c5
227
py
Python
map_matching/map_matcher.py
paperanonymous945/MapRec
5be48b02db855ce648d2674923a15c65afa90146
[ "MIT" ]
34
2019-11-21T12:48:20.000Z
2022-03-06T11:39:08.000Z
map_matching/map_matcher.py
paperanonymous945/MapRec
5be48b02db855ce648d2674923a15c65afa90146
[ "MIT" ]
1
2021-09-08T08:53:58.000Z
2021-09-08T08:53:58.000Z
map_matching/map_matcher.py
paperanonymous945/MapRec
5be48b02db855ce648d2674923a15c65afa90146
[ "MIT" ]
12
2020-06-29T13:43:12.000Z
2022-02-17T10:39:59.000Z
class MapMatcher: def __init__(self, rn, routing_weight='length'): self.rn = rn self.routing_weight = routing_weight def match(self, traj): pass def match_to_path(self, traj): pass
20.636364
52
0.61674
29
227
4.517241
0.482759
0.29771
0.183206
0
0
0
0
0
0
0
0
0
0.290749
227
10
53
22.7
0.813665
0
0
0.25
0
0
0.026432
0
0
0
0
0
0
1
0.375
false
0.25
0
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
5
ee9d78e21914794aaaf691fa3e5abbd2ff7867e8
113
py
Python
19/00/1/sub/Programmer.py
pylangstudy/201706
f1cc6af6b18e5bd393cda27f5166067c4645d4d3
[ "CC0-1.0" ]
null
null
null
19/00/1/sub/Programmer.py
pylangstudy/201706
f1cc6af6b18e5bd393cda27f5166067c4645d4d3
[ "CC0-1.0" ]
70
2017-06-01T11:02:51.000Z
2017-06-30T00:35:32.000Z
19/00/1/sub/Programmer.py
pylangstudy/201706
f1cc6af6b18e5bd393cda27f5166067c4645d4d3
[ "CC0-1.0" ]
null
null
null
import super.Human class Programmer(super.Human.Human): def programming(self): print('programming.')
22.6
36
0.707965
13
113
6.153846
0.692308
0.25
0
0
0
0
0
0
0
0
0
0
0.168142
113
4
37
28.25
0.851064
0
0
0
0
0
0.106195
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
eea00b0f4cdb340f8d3a838428a74222b2499a5e
120
py
Python
batproject/batapp/admin.py
JaL11/BAT
ed4bccef3c70ec01064ebd0c26933853d4f95355
[ "MIT" ]
1
2020-07-16T14:29:55.000Z
2020-07-16T14:29:55.000Z
batproject/batapp/admin.py
JaL11/BAT
ed4bccef3c70ec01064ebd0c26933853d4f95355
[ "MIT" ]
63
2020-06-04T14:41:18.000Z
2020-07-29T18:06:14.000Z
batproject/batapp/admin.py
JaL11/BAT
ed4bccef3c70ec01064ebd0c26933853d4f95355
[ "MIT" ]
6
2020-06-06T13:12:35.000Z
2020-08-28T20:25:51.000Z
from django.contrib import admin # Register your models here. from .models import Picture admin.site.register(Picture)
20
32
0.808333
17
120
5.705882
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.125
120
5
33
24
0.92381
0.216667
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
e1141ee496f7d25b97066abe088f08c00bcc1561
69
py
Python
rasa_exp/core/__init__.py
shfshf/rasa_exp
dd6db46c14c36f0ffe9602551836af43cebcfead
[ "Apache-2.0" ]
17
2019-07-02T05:27:33.000Z
2021-11-21T08:03:51.000Z
rasa_contrib/core/__init__.py
howl-anderson/rasa_nlu_addons
fea3b818a343f1458d7cf15a4d9063464a304b19
[ "Apache-2.0" ]
13
2019-12-23T18:15:45.000Z
2022-03-11T23:50:37.000Z
rasa_contrib/core/__init__.py
howl-anderson/rasa_nlu_addons
fea3b818a343f1458d7cf15a4d9063464a304b19
[ "Apache-2.0" ]
3
2019-09-10T08:42:33.000Z
2020-10-19T15:48:52.000Z
from rasa_contrib.core.policies import StackedBilstmTensorFlowPolicy
34.5
68
0.913043
7
69
8.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.057971
69
1
69
69
0.953846
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
e12aff8890b9005c632edc75a06ea457afa8c429
421
py
Python
examples/no_output/just_code.py
andriyor/sphinx-gallery
cc53540162613850c5bb19fa1172a1be960b1484
[ "BSD-3-Clause" ]
309
2015-01-18T23:00:29.000Z
2022-03-24T15:27:51.000Z
examples/no_output/just_code.py
andriyor/sphinx-gallery
cc53540162613850c5bb19fa1172a1be960b1484
[ "BSD-3-Clause" ]
891
2015-01-04T19:45:44.000Z
2022-03-31T02:36:49.000Z
examples/no_output/just_code.py
andriyor/sphinx-gallery
cc53540162613850c5bb19fa1172a1be960b1484
[ "BSD-3-Clause" ]
197
2015-01-27T13:14:14.000Z
2022-03-28T20:16:39.000Z
# -*- coding: utf-8 -*- """ A short Python script ===================== This demonstrates an example ``.py`` file that is not executed when gallery is generated (see :ref:`build_pattern`) but nevertheless gets included as an example. Note that no output is capture as this file is not executed. """ # Code source: Óscar Nájera # License: BSD 3 clause from __future__ import print_function print([i for i in range(10)])
28.066667
78
0.698337
64
421
4.5
0.796875
0.0625
0.090278
0
0
0
0
0
0
0
0
0.011331
0.16152
421
14
79
30.071429
0.804533
0.80285
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
011580ab06c019bfc68258734a660d65a62f621d
98
py
Python
senko/l10n/__init__.py
thatoneolib/senko
686d768f8bc0c69a874dba180abb85049ff473b9
[ "MIT" ]
null
null
null
senko/l10n/__init__.py
thatoneolib/senko
686d768f8bc0c69a874dba180abb85049ff473b9
[ "MIT" ]
null
null
null
senko/l10n/__init__.py
thatoneolib/senko
686d768f8bc0c69a874dba180abb85049ff473b9
[ "MIT" ]
null
null
null
from .locale import Locale, NullLocale from .locales import Locales from .mixin import LocaleMixin
32.666667
38
0.836735
13
98
6.307692
0.538462
0
0
0
0
0
0
0
0
0
0
0
0.122449
98
3
39
32.666667
0.953488
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
012e87241e7746c6eb99042c67af58d0a59a51e0
30
py
Python
deepvoice3_pytorch/version.py
faixan-khan/accent_control
24dcb1568d74228f8093245bb3268cc572b90b53
[ "MIT" ]
null
null
null
deepvoice3_pytorch/version.py
faixan-khan/accent_control
24dcb1568d74228f8093245bb3268cc572b90b53
[ "MIT" ]
null
null
null
deepvoice3_pytorch/version.py
faixan-khan/accent_control
24dcb1568d74228f8093245bb3268cc572b90b53
[ "MIT" ]
null
null
null
__version__ = '0.1.1+897f31e'
15
29
0.7
5
30
3.4
0.8
0
0
0
0
0
0
0
0
0
0
0.296296
0.1
30
1
30
30
0.333333
0
0
0
0
0
0.433333
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
0141c8d8c09d035f19b7360ad29ac27734cf9513
171
py
Python
bin/iamonds/hexiamonds-4x10-long-hex.py
tiwo/puzzler
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
[ "Intel" ]
null
null
null
bin/iamonds/hexiamonds-4x10-long-hex.py
tiwo/puzzler
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
[ "Intel" ]
null
null
null
bin/iamonds/hexiamonds-4x10-long-hex.py
tiwo/puzzler
7ad3d9a792f0635f7ec59ffa85fb46b54fd77a7e
[ "Intel" ]
1
2022-01-02T16:54:14.000Z
2022-01-02T16:54:14.000Z
#!/usr/bin/env python # $Id$ """856 solutions""" import puzzler from puzzler.puzzles.hexiamonds import Hexiamonds4x10LongHexagon puzzler.run(Hexiamonds4x10LongHexagon)
17.1
64
0.795322
18
171
7.555556
0.777778
0
0
0
0
0
0
0
0
0
0
0.058065
0.093567
171
9
65
19
0.819355
0.22807
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
018a475f9604a3598a4c9e551c3d0543cf048471
174
py
Python
tasks/html-decorator/task.py
dzbrozek/interview-tasks
552bf7f0652ec34b57d961cc59d0be14216b18eb
[ "MIT" ]
null
null
null
tasks/html-decorator/task.py
dzbrozek/interview-tasks
552bf7f0652ec34b57d961cc59d0be14216b18eb
[ "MIT" ]
null
null
null
tasks/html-decorator/task.py
dzbrozek/interview-tasks
552bf7f0652ec34b57d961cc59d0be14216b18eb
[ "MIT" ]
null
null
null
def html_tag(): # write body of decorator pass @html_tag('p') def foobar(): return 'foobar' if __name__ == "__main__": assert foobar() == '<p>foobar</p>'
13.384615
38
0.591954
23
174
4.043478
0.652174
0.150538
0
0
0
0
0
0
0
0
0
0
0.235632
174
12
39
14.5
0.699248
0.132184
0
0
0
0
0.187919
0
0
0
0
0
0.142857
1
0.285714
true
0.142857
0
0.142857
0.428571
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
1
0
0
0
5
6d73e91230e44532ab62b4795b61b091812c9cbc
10,421
py
Python
sdk/python/pulumi_minio/s3_bucket.py
pulumi/pulumi-minio
8c95b8c5680b6e063e3e5b90365ab7a31f4733bd
[ "ECL-2.0", "Apache-2.0" ]
1
2021-08-13T17:29:02.000Z
2021-08-13T17:29:02.000Z
sdk/python/pulumi_minio/s3_bucket.py
pulumi/pulumi-minio
8c95b8c5680b6e063e3e5b90365ab7a31f4733bd
[ "ECL-2.0", "Apache-2.0" ]
26
2021-06-30T22:17:37.000Z
2022-03-31T15:33:28.000Z
sdk/python/pulumi_minio/s3_bucket.py
pulumi/pulumi-minio
8c95b8c5680b6e063e3e5b90365ab7a31f4733bd
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# 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 __all__ = ['S3BucketArgs', 'S3Bucket'] @pulumi.input_type class S3BucketArgs: def __init__(__self__, *, acl: Optional[pulumi.Input[str]] = None, bucket: Optional[pulumi.Input[str]] = None, bucket_prefix: Optional[pulumi.Input[str]] = None, force_destroy: Optional[pulumi.Input[bool]] = None): """ The set of arguments for constructing a S3Bucket resource. """ if acl is not None: pulumi.set(__self__, "acl", acl) if bucket is not None: pulumi.set(__self__, "bucket", bucket) if bucket_prefix is not None: pulumi.set(__self__, "bucket_prefix", bucket_prefix) if force_destroy is not None: pulumi.set(__self__, "force_destroy", force_destroy) @property @pulumi.getter def acl(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "acl") @acl.setter def acl(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "acl", value) @property @pulumi.getter def bucket(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "bucket") @bucket.setter def bucket(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "bucket", value) @property @pulumi.getter(name="bucketPrefix") def bucket_prefix(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "bucket_prefix") @bucket_prefix.setter def bucket_prefix(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "bucket_prefix", value) @property @pulumi.getter(name="forceDestroy") def force_destroy(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "force_destroy") @force_destroy.setter def force_destroy(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "force_destroy", value) @pulumi.input_type class _S3BucketState: def __init__(__self__, *, acl: Optional[pulumi.Input[str]] = None, bucket: Optional[pulumi.Input[str]] = None, bucket_domain_name: Optional[pulumi.Input[str]] = None, bucket_prefix: Optional[pulumi.Input[str]] = None, force_destroy: Optional[pulumi.Input[bool]] = None): """ Input properties used for looking up and filtering S3Bucket resources. """ if acl is not None: pulumi.set(__self__, "acl", acl) if bucket is not None: pulumi.set(__self__, "bucket", bucket) if bucket_domain_name is not None: pulumi.set(__self__, "bucket_domain_name", bucket_domain_name) if bucket_prefix is not None: pulumi.set(__self__, "bucket_prefix", bucket_prefix) if force_destroy is not None: pulumi.set(__self__, "force_destroy", force_destroy) @property @pulumi.getter def acl(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "acl") @acl.setter def acl(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "acl", value) @property @pulumi.getter def bucket(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "bucket") @bucket.setter def bucket(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "bucket", value) @property @pulumi.getter(name="bucketDomainName") def bucket_domain_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "bucket_domain_name") @bucket_domain_name.setter def bucket_domain_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "bucket_domain_name", value) @property @pulumi.getter(name="bucketPrefix") def bucket_prefix(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "bucket_prefix") @bucket_prefix.setter def bucket_prefix(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "bucket_prefix", value) @property @pulumi.getter(name="forceDestroy") def force_destroy(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "force_destroy") @force_destroy.setter def force_destroy(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "force_destroy", value) class S3Bucket(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, acl: Optional[pulumi.Input[str]] = None, bucket: Optional[pulumi.Input[str]] = None, bucket_prefix: Optional[pulumi.Input[str]] = None, force_destroy: Optional[pulumi.Input[bool]] = None, __props__=None): """ ## Example Usage ```python import pulumi import pulumi_minio as minio state_terraform_s3 = minio.S3Bucket("stateTerraformS3", acl="public", bucket="state-terraform-s3") pulumi.export("minioId", state_terraform_s3.id) pulumi.export("minioUrl", state_terraform_s3.bucket_domain_name) ``` :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: Optional[S3BucketArgs] = None, opts: Optional[pulumi.ResourceOptions] = None): """ ## Example Usage ```python import pulumi import pulumi_minio as minio state_terraform_s3 = minio.S3Bucket("stateTerraformS3", acl="public", bucket="state-terraform-s3") pulumi.export("minioId", state_terraform_s3.id) pulumi.export("minioUrl", state_terraform_s3.bucket_domain_name) ``` :param str resource_name: The name of the resource. :param S3BucketArgs 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(S3BucketArgs, 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, acl: Optional[pulumi.Input[str]] = None, bucket: Optional[pulumi.Input[str]] = None, bucket_prefix: Optional[pulumi.Input[str]] = None, force_destroy: Optional[pulumi.Input[bool]] = 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__ = S3BucketArgs.__new__(S3BucketArgs) __props__.__dict__["acl"] = acl __props__.__dict__["bucket"] = bucket __props__.__dict__["bucket_prefix"] = bucket_prefix __props__.__dict__["force_destroy"] = force_destroy __props__.__dict__["bucket_domain_name"] = None super(S3Bucket, __self__).__init__( 'minio:index/s3Bucket:S3Bucket', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, acl: Optional[pulumi.Input[str]] = None, bucket: Optional[pulumi.Input[str]] = None, bucket_domain_name: Optional[pulumi.Input[str]] = None, bucket_prefix: Optional[pulumi.Input[str]] = None, force_destroy: Optional[pulumi.Input[bool]] = None) -> 'S3Bucket': """ Get an existing S3Bucket 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__ = _S3BucketState.__new__(_S3BucketState) __props__.__dict__["acl"] = acl __props__.__dict__["bucket"] = bucket __props__.__dict__["bucket_domain_name"] = bucket_domain_name __props__.__dict__["bucket_prefix"] = bucket_prefix __props__.__dict__["force_destroy"] = force_destroy return S3Bucket(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter def acl(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "acl") @property @pulumi.getter def bucket(self) -> pulumi.Output[str]: return pulumi.get(self, "bucket") @property @pulumi.getter(name="bucketDomainName") def bucket_domain_name(self) -> pulumi.Output[str]: return pulumi.get(self, "bucket_domain_name") @property @pulumi.getter(name="bucketPrefix") def bucket_prefix(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "bucket_prefix") @property @pulumi.getter(name="forceDestroy") def force_destroy(self) -> pulumi.Output[Optional[bool]]: return pulumi.get(self, "force_destroy")
37.351254
134
0.631513
1,177
10,421
5.282923
0.119796
0.077839
0.122226
0.109682
0.748311
0.723223
0.708106
0.676584
0.649566
0.604214
0
0.004264
0.257269
10,421
278
135
37.485612
0.799096
0.149026
0
0.721053
1
0
0.086839
0.003399
0
0
0
0
0
1
0.157895
false
0.005263
0.026316
0.073684
0.278947
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
6d923e63878cd464cdf6ea1f299ae5e0ad1032f8
206
py
Python
login_rest/api/urls.py
noctilukkas/api-login-token-drf
6f15571da8ecaf4588674b1e59dbe25c7520cc28
[ "MIT" ]
null
null
null
login_rest/api/urls.py
noctilukkas/api-login-token-drf
6f15571da8ecaf4588674b1e59dbe25c7520cc28
[ "MIT" ]
null
null
null
login_rest/api/urls.py
noctilukkas/api-login-token-drf
6f15571da8ecaf4588674b1e59dbe25c7520cc28
[ "MIT" ]
null
null
null
from django.urls import path from .views import PersonaList urlpatterns = [ path('persona/', PersonaList.as_view(), name='persona_list'), path('tuvieja/', PersonaList.as_view(), name='tuvieja'), ]
25.75
65
0.708738
25
206
5.72
0.56
0.181818
0.237762
0.293706
0
0
0
0
0
0
0
0
0.131068
206
7
66
29.428571
0.798883
0
0
0
0
0
0.169903
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
6da0ef9209e4743e6a0a457e2dbb7c41d6f78bf0
104
py
Python
acmicpc/2935.py
juseongkr/BOJ
8f10a2bf9a7d695455493fbe7423347a8b648416
[ "Apache-2.0" ]
7
2020-02-03T10:00:19.000Z
2021-11-16T11:03:57.000Z
acmicpc/2935.py
juseongkr/Algorithm-training
8f10a2bf9a7d695455493fbe7423347a8b648416
[ "Apache-2.0" ]
1
2021-01-03T06:58:24.000Z
2021-01-03T06:58:24.000Z
acmicpc/2935.py
juseongkr/Algorithm-training
8f10a2bf9a7d695455493fbe7423347a8b648416
[ "Apache-2.0" ]
1
2020-01-22T14:34:03.000Z
2020-01-22T14:34:03.000Z
a = int(input()) t = input() b = int(input()) if t == '*': print(a*b) elif t == '+': print(a+b)
13
16
0.442308
18
104
2.555556
0.444444
0.347826
0.304348
0.347826
0
0
0
0
0
0
0
0
0.259615
104
7
17
14.857143
0.597403
0
0
0
0
0
0.019231
0
0
0
0
0
0
1
0
false
0
0
0
0
0.285714
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
6df3f1016ae723a7eeb3a51c4f056dbe0bed65d4
29
py
Python
Lib/test/test_import/data/circular_imports/indirect.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
1
2018-06-21T18:21:24.000Z
2018-06-21T18:21:24.000Z
Lib/test/test_import/data/circular_imports/indirect.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
null
null
null
Lib/test/test_import/data/circular_imports/indirect.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
null
null
null
z . zaimportuj basic, basic2
14.5
28
0.758621
4
29
5.5
1
0
0
0
0
0
0
0
0
0
0
0.041667
0.172414
29
1
29
29
0.875
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
1
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
5
0993c0a1e7d5e798e6b8aa5e8b02a123408ab805
59
py
Python
deep_utils/utils/utils/__init__.py
dornasabet/deep_utils
be61b36ea5b3219831e9f2a364fbd4a63858abed
[ "MIT" ]
null
null
null
deep_utils/utils/utils/__init__.py
dornasabet/deep_utils
be61b36ea5b3219831e9f2a364fbd4a63858abed
[ "MIT" ]
null
null
null
deep_utils/utils/utils/__init__.py
dornasabet/deep_utils
be61b36ea5b3219831e9f2a364fbd4a63858abed
[ "MIT" ]
null
null
null
from .main import shift_lst, dictnamedtuple, easy_argparse
29.5
58
0.847458
8
59
6
1
0
0
0
0
0
0
0
0
0
0
0
0.101695
59
1
59
59
0.90566
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
0997d4db5bfba66e2cc1e01edfe1217ec0276a27
162
py
Python
project/main/tests.py
Dima12101/TestTravis
0bda2a7593a413e03c12343c00e1ceaae0ce3ab9
[ "Apache-2.0" ]
null
null
null
project/main/tests.py
Dima12101/TestTravis
0bda2a7593a413e03c12343c00e1ceaae0ce3ab9
[ "Apache-2.0" ]
5
2021-03-19T02:58:59.000Z
2022-02-10T08:58:41.000Z
project/main/tests.py
Dima12101/TestTravis
0bda2a7593a413e03c12343c00e1ceaae0ce3ab9
[ "Apache-2.0" ]
null
null
null
from django.test import TestCase class Test(TestCase): def setUp(self): self.value = 6 def test(self): self.assertEqual(self.value, 6)
16.2
39
0.635802
22
162
4.681818
0.545455
0.15534
0.194175
0
0
0
0
0
0
0
0
0.016667
0.259259
162
9
40
18
0.841667
0
0
0
0
0
0
0
0
0
0
0
0.166667
1
0.333333
false
0
0.166667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
09ac90f7e9a182461fa4fa7a877be80f0f5cb7ba
283
py
Python
tests/conftest.py
HeadHaus/Skeema
fc0faf13afad2c95b8943eaa3bfc2cc23b7de003
[ "MIT" ]
null
null
null
tests/conftest.py
HeadHaus/Skeema
fc0faf13afad2c95b8943eaa3bfc2cc23b7de003
[ "MIT" ]
null
null
null
tests/conftest.py
HeadHaus/Skeema
fc0faf13afad2c95b8943eaa3bfc2cc23b7de003
[ "MIT" ]
null
null
null
import pytest def uid(v): return f"id{v}" @pytest.fixture def id0(): return uid(0) @pytest.fixture def id1(): return uid(1) @pytest.fixture def id2(): return uid(2) @pytest.fixture def id3(): return uid(3) @pytest.fixture def id4(): return uid(4)
9.129032
19
0.614841
44
283
3.954545
0.431818
0.373563
0.45977
0
0
0
0
0
0
0
0
0.046296
0.236749
283
30
20
9.433333
0.759259
0
0
0.277778
0
0
0.017668
0
0
0
0
0
0
1
0.333333
false
0
0.055556
0.333333
0.722222
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
09ff1d4b73739294f4e39ea21cb52b7a5a441436
64
py
Python
1.py
xingjian2016/demo
923c77fdb0bbe9d449686dd05ffecde0edffff7c
[ "Apache-2.0" ]
null
null
null
1.py
xingjian2016/demo
923c77fdb0bbe9d449686dd05ffecde0edffff7c
[ "Apache-2.0" ]
null
null
null
1.py
xingjian2016/demo
923c77fdb0bbe9d449686dd05ffecde0edffff7c
[ "Apache-2.0" ]
null
null
null
#-*- coding:utf-8 -*- def display(name,age): print (name,age)
12.8
22
0.609375
10
64
3.9
0.8
0.358974
0
0
0
0
0
0
0
0
0
0.018182
0.140625
64
4
23
16
0.690909
0.3125
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0
0.5
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
5
61ee190538925b251b5270cd4e5eb672a2c43cfa
62
py
Python
aerokit/aero/nozzle.py
PierreMignerot/aerokit
78717288d840ef5cb3939b44e967cf8f250dc270
[ "MIT" ]
null
null
null
aerokit/aero/nozzle.py
PierreMignerot/aerokit
78717288d840ef5cb3939b44e967cf8f250dc270
[ "MIT" ]
null
null
null
aerokit/aero/nozzle.py
PierreMignerot/aerokit
78717288d840ef5cb3939b44e967cf8f250dc270
[ "MIT" ]
null
null
null
# backward compatibility from aerokit.instance.nozzle import *
31
37
0.83871
7
62
7.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.096774
62
2
37
31
0.928571
0.354839
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
61f6daa72eec769ddae3cc029c89e845fbc42e64
49
py
Python
main/candidate_ranking/__init__.py
wissembrdj/welink
ebc0cd4742578ad22014bd8067796e8cc1869f02
[ "MIT" ]
null
null
null
main/candidate_ranking/__init__.py
wissembrdj/welink
ebc0cd4742578ad22014bd8067796e8cc1869f02
[ "MIT" ]
null
null
null
main/candidate_ranking/__init__.py
wissembrdj/welink
ebc0cd4742578ad22014bd8067796e8cc1869f02
[ "MIT" ]
null
null
null
__all__ = ["candidate_similarities", "coherence"]
49
49
0.77551
4
49
8.25
1
0
0
0
0
0
0
0
0
0
0
0
0.061224
49
1
49
49
0.717391
0
0
0
0
0
0.62
0.44
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
11120d6590c58a95c24d151d030ecdce5218d3c3
87
py
Python
neural_pipeline/data_processor/__init__.py
pfriesch/neural-pipeline
2df4f7467a721b1fbd93f4439086c6dcee5dac2c
[ "MIT" ]
null
null
null
neural_pipeline/data_processor/__init__.py
pfriesch/neural-pipeline
2df4f7467a721b1fbd93f4439086c6dcee5dac2c
[ "MIT" ]
null
null
null
neural_pipeline/data_processor/__init__.py
pfriesch/neural-pipeline
2df4f7467a721b1fbd93f4439086c6dcee5dac2c
[ "MIT" ]
null
null
null
from .data_processor import DataProcessor, TrainDataProcessor from .model import Model
29
61
0.862069
10
87
7.4
0.7
0
0
0
0
0
0
0
0
0
0
0
0.103448
87
2
62
43.5
0.948718
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
111c6af163e2efe61fe15b1f50626044653ed560
143
py
Python
PythonClient/carla/driving_benchmark/experiment_suites/__init__.py
felipecode/CAL
bc3556097e61b69735392e310b2b0916ebeebce4
[ "MIT" ]
204
2019-01-28T13:31:53.000Z
2022-03-23T23:57:18.000Z
PythonClient/carla/driving_benchmark/experiment_suites/__init__.py
felipecode/CAL
bc3556097e61b69735392e310b2b0916ebeebce4
[ "MIT" ]
39
2019-02-02T22:14:14.000Z
2022-01-30T08:21:51.000Z
PythonClient/carla/driving_benchmark/experiment_suites/__init__.py
felipecode/CAL
bc3556097e61b69735392e310b2b0916ebeebce4
[ "MIT" ]
64
2019-02-24T10:26:04.000Z
2022-03-04T12:49:59.000Z
from .basic_experiment_suite import BasicExperimentSuite from .corl_2017 import CoRL2017 from .longcontrol_2018 import LongitudinalControl2018
35.75
56
0.895105
16
143
7.75
0.75
0
0
0
0
0
0
0
0
0
0
0.122137
0.083916
143
3
57
47.666667
0.824427
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
116370d280717873265e0aad450b575b75dd9ec7
11,294
py
Python
setup.py
sendx/sendx-api-python
edce9755d3718efb12cb5493da7cbac961cb1d9b
[ "Apache-2.0" ]
null
null
null
setup.py
sendx/sendx-api-python
edce9755d3718efb12cb5493da7cbac961cb1d9b
[ "Apache-2.0" ]
null
null
null
setup.py
sendx/sendx-api-python
edce9755d3718efb12cb5493da7cbac961cb1d9b
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ SendX REST API **NOTE:** All API calls contain 2 parameters - 'api_key' and 'team_id'. These can be inferred from your settings page 'https://app.sendx.io/setting' under the sections 'Api Key' and 'Team Id' respectively. For checking language specific Clients: - [Golang](https://github.com/sendx/sendx-api-go) - [Python](https://github.com/sendx/sendx-api-python) - [Ruby](https://github.com/sendx/sendx-api-ruby) - [Java](https://github.com/sendx/sendx-api-java) - [PHP](https://github.com/sendx/sendx-api-php) - [NodeJS](https://github.com/sendx/sendx-api-nodejs) We also have a [Javascript API](http://help.sendx.io/knowledge_base/topics/javascript-api-1) for client side integrations. SendX REST API has two methods: * Identify * Track ## Identify API Method Identify API Method is used to attach data to a visitor. If a contact is not yet created then we will create the contact. In case contact already exists then we update it. **Example Request:** ```json { email: \"john.doe@gmail.com\", firstName: \"John\", lastName: \"Doe\", birthday: \"1989-03-03\", customFields: { \"Designation\": \"Software Engineer\", \"Age\": \"27\", \"Experience\": \"5\" }, tags: [\"Developer\", \"API Team\"], } ``` Note that tags are an array of strings. In case they don't exist previously then API will create them and associate them with the contact. Similarly if a custom field doesn't exist then it is first created and then associated with the contact along-with the corresponding value. In case custom field exists already then we simply update the value of it for the aforementioned contact. We don't delete any of the properties based on identify call. What this means is that if for the same contact you did two API calls like: **API Call A** ```json { email: \"john.doe@gmail.com\", firstName: \"John\", birthday: \"1989-03-03\", customFields: { \"Designation\": \"Software Engineer\" }, tags: [\"Developer\"], } ``` **API Call B** ```json { email: \"john.doe@gmail.com\", customFields: { \"Age\": \"29\" }, tags: [\"API Team\"], } ``` Then the final contact will have firstName as **John**, birthday as **1989-03-03** present. Also both tags **Developer** and **API Team** shall be present along with custom fields **Designation** and **Age**. **Properties:** * **firstName**: type string * **lastName**: type string * **email**: type string * **newEmail**: type string * **company**: type string * **birthday**: type string with format **YYYY-MM-DD** eg: 2016-11-21 * **customFields**: type map[string]string * **tags**: type array of string In case email of an already existing contact needs to be updated then specify current email under email property and updated email under newEmail property. **Response:** ```json { \"status\": \"200\", \"message\": \"OK\", \"data\": { \"encryptedTeamId\": \"CLdh9Ig5GLIN1u8gTRvoja\", \"encryptedId\": \"c9QF63nrBenCaAXe660byz\", \"tags\": [ \"API Team\", \"Tech\" ], \"firstName\": \"John\", \"lastName\": \"Doe\", \"email\": \"john.doe@gmail.com\", \"company\": \"\", \"birthday\": \"1989-03-03\", \"customFields\": { \"Age\": \"29\", \"Designation\": \"Software Engineer\" } } } ``` ## Track API Method Track API Method is used to track a contact. In the track API object you can: * **addTags**: * **removeTags**: You can have automation rules based on tag addition as well as tag removal and they will get executed. For eg: * On **user registration** tag start onboarding drip for him / her. * **Account Upgrade** tag start add user to paid user list and start account expansion drip. * On removal of **trial user** tag start upsell trial completed users drip. **Example Request:** > \\_scq.push([\"track\", { \"addTags\": [\"blogger\", \"female\"] }]); > \\_scq.push([\"track\", { \"addTags\": [\"paid user\"], \"removeTags\": [\"trial user\"] }]); **Response:** > { \"status\": \"200\", \"message\": \"OK\", \"data\": \"success\" } OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import sys from setuptools import setup, find_packages NAME = "swagger_client" VERSION = "1.0.0" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] setup( name=NAME, version=VERSION, description="SendX REST API", author_email="", url="", keywords=["Swagger", "SendX REST API"], install_requires=REQUIRES, packages=find_packages(), include_package_data=True, long_description="""\ **NOTE:** All API calls contain 2 parameters - &#39;api_key&#39; and &#39;team_id&#39;. These can be inferred from your settings page &#39;https://app.sendx.io/setting&#39; under the sections &#39;Api Key&#39; and &#39;Team Id&#39; respectively. For checking language specific Clients: - [Golang](https://github.com/sendx/sendx-api-go) - [Python](https://github.com/sendx/sendx-api-python) - [Ruby](https://github.com/sendx/sendx-api-ruby) - [Java](https://github.com/sendx/sendx-api-java) - [PHP](https://github.com/sendx/sendx-api-php) - [NodeJS](https://github.com/sendx/sendx-api-nodejs) We also have a [Javascript API](http://help.sendx.io/knowledge_base/topics/javascript-api-1) for client side integrations. SendX REST API has two methods: * Identify * Track ## Identify API Method Identify API Method is used to attach data to a visitor. If a contact is not yet created then we will create the contact. In case contact already exists then we update it. **Example Request:** &#x60;&#x60;&#x60;json { email: \&quot;john.doe@gmail.com\&quot;, firstName: \&quot;John\&quot;, lastName: \&quot;Doe\&quot;, birthday: \&quot;1989-03-03\&quot;, customFields: { \&quot;Designation\&quot;: \&quot;Software Engineer\&quot;, \&quot;Age\&quot;: \&quot;27\&quot;, \&quot;Experience\&quot;: \&quot;5\&quot; }, tags: [\&quot;Developer\&quot;, \&quot;API Team\&quot;], } &#x60;&#x60;&#x60; Note that tags are an array of strings. In case they don&#39;t exist previously then API will create them and associate them with the contact. Similarly if a custom field doesn&#39;t exist then it is first created and then associated with the contact along-with the corresponding value. In case custom field exists already then we simply update the value of it for the aforementioned contact. We don&#39;t delete any of the properties based on identify call. What this means is that if for the same contact you did two API calls like: **API Call A** &#x60;&#x60;&#x60;json { email: \&quot;john.doe@gmail.com\&quot;, firstName: \&quot;John\&quot;, birthday: \&quot;1989-03-03\&quot;, customFields: { \&quot;Designation\&quot;: \&quot;Software Engineer\&quot; }, tags: [\&quot;Developer\&quot;], } &#x60;&#x60;&#x60; **API Call B** &#x60;&#x60;&#x60;json { email: \&quot;john.doe@gmail.com\&quot;, customFields: { \&quot;Age\&quot;: \&quot;29\&quot; }, tags: [\&quot;API Team\&quot;], } &#x60;&#x60;&#x60; Then the final contact will have firstName as **John**, birthday as **1989-03-03** present. Also both tags **Developer** and **API Team** shall be present along with custom fields **Designation** and **Age**. **Properties:** * **firstName**: type string * **lastName**: type string * **email**: type string * **newEmail**: type string * **company**: type string * **birthday**: type string with format **YYYY-MM-DD** eg: 2016-11-21 * **customFields**: type map[string]string * **tags**: type array of string In case email of an already existing contact needs to be updated then specify current email under email property and updated email under newEmail property. **Response:** &#x60;&#x60;&#x60;json { \&quot;status\&quot;: \&quot;200\&quot;, \&quot;message\&quot;: \&quot;OK\&quot;, \&quot;data\&quot;: { \&quot;encryptedTeamId\&quot;: \&quot;CLdh9Ig5GLIN1u8gTRvoja\&quot;, \&quot;encryptedId\&quot;: \&quot;c9QF63nrBenCaAXe660byz\&quot;, \&quot;tags\&quot;: [ \&quot;API Team\&quot;, \&quot;Tech\&quot; ], \&quot;firstName\&quot;: \&quot;John\&quot;, \&quot;lastName\&quot;: \&quot;Doe\&quot;, \&quot;email\&quot;: \&quot;john.doe@gmail.com\&quot;, \&quot;company\&quot;: \&quot;\&quot;, \&quot;birthday\&quot;: \&quot;1989-03-03\&quot;, \&quot;customFields\&quot;: { \&quot;Age\&quot;: \&quot;29\&quot;, \&quot;Designation\&quot;: \&quot;Software Engineer\&quot; } } } &#x60;&#x60;&#x60; ## Track API Method Track API Method is used to track a contact. In the track API object you can: * **addTags**: * **removeTags**: You can have automation rules based on tag addition as well as tag removal and they will get executed. For eg: * On **user registration** tag start onboarding drip for him / her. * **Account Upgrade** tag start add user to paid user list and start account expansion drip. * On removal of **trial user** tag start upsell trial completed users drip. **Example Request:** &gt; \\_scq.push([\&quot;track\&quot;, { \&quot;addTags\&quot;: [\&quot;blogger\&quot;, \&quot;female\&quot;] }]); &gt; \\_scq.push([\&quot;track\&quot;, { \&quot;addTags\&quot;: [\&quot;paid user\&quot;], \&quot;removeTags\&quot;: [\&quot;trial user\&quot;] }]); **Response:** &gt; { \&quot;status\&quot;: \&quot;200\&quot;, \&quot;message\&quot;: \&quot;OK\&quot;, \&quot;data\&quot;: \&quot;success\&quot; } """ )
205.345455
5,400
0.601381
1,435
11,294
4.720557
0.204181
0.055506
0.026867
0.033658
0.745645
0.706377
0.693239
0.670062
0.63168
0.624889
0
0.025647
0.240482
11,294
54
5,401
209.148148
0.764048
0.462458
0
0
0
0.052632
0.938501
0.167632
0
0
0
0
0
1
0
false
0
0.105263
0
0.105263
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
febfddd7198fc9c25959879a7ec64b57f2ba20f6
32
py
Python
chapter02/code03.py
ggggxiaolong/python
c73ea1ffcc6450ae13bd86b07520eb7b52c9f3c3
[ "MIT" ]
null
null
null
chapter02/code03.py
ggggxiaolong/python
c73ea1ffcc6450ae13bd86b07520eb7b52c9f3c3
[ "MIT" ]
null
null
null
chapter02/code03.py
ggggxiaolong/python
c73ea1ffcc6450ae13bd86b07520eb7b52c9f3c3
[ "MIT" ]
null
null
null
str = raw_input() print int(str)
16
17
0.71875
6
32
3.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.125
32
2
18
16
0.785714
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
feeeba75222b3ad1e58902cdd82165421f508fa1
88
py
Python
precession/__init__.py
DariaGangardt/precession
35c9226c78b5b73a06d26cc02e5234a93c12b1c7
[ "MIT" ]
20
2016-03-22T14:51:17.000Z
2022-02-22T14:42:31.000Z
precession/__init__.py
DariaGangardt/precession
35c9226c78b5b73a06d26cc02e5234a93c12b1c7
[ "MIT" ]
1
2017-09-21T15:07:05.000Z
2017-09-21T15:07:05.000Z
precession/__init__.py
DariaGangardt/precession
35c9226c78b5b73a06d26cc02e5234a93c12b1c7
[ "MIT" ]
14
2016-05-05T06:52:04.000Z
2022-02-21T23:42:49.000Z
""" precession - description """ from .__version__ import * from .precession import *
11
26
0.704545
8
88
7.25
0.625
0
0
0
0
0
0
0
0
0
0
0
0.170455
88
7
27
12.571429
0.794521
0.272727
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
3a20b1ad559e0966e29990d7bc2d26c200800309
138
py
Python
arithmetic/make-arithmetic-data.py
yaopang/TensorFlowNLP
f06301712312493e5fd52ee38b0b918ec60b91e1
[ "MIT" ]
23
2016-10-10T20:27:54.000Z
2021-01-16T05:02:01.000Z
arithmetic/make-arithmetic-data.py
yaopang/TensorFlowNLP
f06301712312493e5fd52ee38b0b918ec60b91e1
[ "MIT" ]
null
null
null
arithmetic/make-arithmetic-data.py
yaopang/TensorFlowNLP
f06301712312493e5fd52ee38b0b918ec60b91e1
[ "MIT" ]
23
2016-10-09T20:17:59.000Z
2019-10-15T12:34:31.000Z
import random for i in range(5000): a = random.randint(0,1000) b = random.randint(0,1000) print("{}+{},{}".format(a, b, a+b))
23
39
0.57971
23
138
3.478261
0.608696
0.325
0.35
0.45
0
0
0
0
0
0
0
0.126126
0.195652
138
6
39
23
0.594595
0
0
0
0
0
0.057554
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.2
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
3a38ce7a13d08d1c47500756912ddb735f9b7d52
59
py
Python
astropy/units.py
Ayush2007A/Code-master
fafe4a020adc3f8e78c78f6b8b2b08b5c3005613
[ "Unlicense" ]
1
2021-02-05T10:29:30.000Z
2021-02-05T10:29:30.000Z
astropy/units.py
Ayush2007A/Code-master
fafe4a020adc3f8e78c78f6b8b2b08b5c3005613
[ "Unlicense" ]
null
null
null
astropy/units.py
Ayush2007A/Code-master
fafe4a020adc3f8e78c78f6b8b2b08b5c3005613
[ "Unlicense" ]
null
null
null
from astropy import units as u print(42.0 * u.kilometer)
19.666667
31
0.728814
11
59
3.909091
0.909091
0
0
0
0
0
0
0
0
0
0
0.0625
0.186441
59
2
32
29.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
3a52cc0d1545ff7743d36eed25bb93de8a44f95d
130
py
Python
__init__.py
audacious-software/Passive-Data-Kit-External-Sensors
c4781c04ce3cb485b0c1e50a9e7c6db0c92a9959
[ "Apache-2.0" ]
null
null
null
__init__.py
audacious-software/Passive-Data-Kit-External-Sensors
c4781c04ce3cb485b0c1e50a9e7c6db0c92a9959
[ "Apache-2.0" ]
null
null
null
__init__.py
audacious-software/Passive-Data-Kit-External-Sensors
c4781c04ce3cb485b0c1e50a9e7c6db0c92a9959
[ "Apache-2.0" ]
null
null
null
# pylint: disable=invalid-name default_app_config = 'passive_data_kit_external_sensors.apps.PassiveDataKitExternalSensorsConfig'
32.5
97
0.876923
14
130
7.714286
1
0
0
0
0
0
0
0
0
0
0
0
0.053846
130
3
98
43.333333
0.878049
0.215385
0
0
0
0
0.74
0.74
0
0
0
0
0
1
0
false
1
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
3a5330f3918a61d0f64326458d7b2dae80e6ff70
291
py
Python
tests/test_cookiecutter_pypackage_instance.py
billsioros/cookiecutter-pypackage-instance
e986b7eb20fdeefdbf229ff5d3b0e74e1f492671
[ "MIT" ]
null
null
null
tests/test_cookiecutter_pypackage_instance.py
billsioros/cookiecutter-pypackage-instance
e986b7eb20fdeefdbf229ff5d3b0e74e1f492671
[ "MIT" ]
13
2021-08-28T10:58:25.000Z
2021-09-12T17:43:34.000Z
tests/test_cookiecutter_pypackage_instance.py
billsioros/cookiecutter-pypackage-instance
e986b7eb20fdeefdbf229ff5d3b0e74e1f492671
[ "MIT" ]
1
2021-09-09T22:03:23.000Z
2021-09-09T22:03:23.000Z
"""Tests concerning the `cookiecutter_pypackage_instance` module.""" from cookiecutter_pypackage_instance.cookiecutter_pypackage_instance import factorial def test_cookiecutter_pypackage_instance(): assert factorial(0) == 1 assert factorial(1) == 1 assert factorial(5) == 120
29.1
85
0.783505
33
291
6.636364
0.515152
0.383562
0.52968
0
0
0
0
0
0
0
0
0.031621
0.130584
291
9
86
32.333333
0.833992
0.213058
0
0
0
0
0
0
0
0
0
0
0.6
1
0.2
true
0
0.2
0
0.4
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
0
0
0
0
0
5
e902264ea72bcdfb78dc916dd5606671f37ffe6e
24
py
Python
vedo/version.py
marcomusy/vedo
cbf6639f2eb10491527beaf7cc3656c797f9fb42
[ "CC0-1.0" ]
836
2020-06-14T02:38:12.000Z
2022-03-31T15:39:50.000Z
vedo/version.py
marcomusy/vedo
cbf6639f2eb10491527beaf7cc3656c797f9fb42
[ "CC0-1.0" ]
418
2020-06-14T10:51:32.000Z
2022-03-31T23:23:14.000Z
vedo/version.py
marcomusy/vedo
cbf6639f2eb10491527beaf7cc3656c797f9fb42
[ "CC0-1.0" ]
136
2020-06-14T02:26:41.000Z
2022-03-31T12:47:18.000Z
_version='2021.0.6dev0'
12
23
0.75
4
24
4.25
1
0
0
0
0
0
0
0
0
0
0
0.304348
0.041667
24
1
24
24
0.434783
0
0
0
0
0
0.5
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
3a6ef78efbea6148fbc19299de4cbfa3dd781231
36
py
Python
setup.py
foxleoly/tools
f0ad8617808d2bce47bbc2f69a696590d1a606b6
[ "MIT" ]
null
null
null
setup.py
foxleoly/tools
f0ad8617808d2bce47bbc2f69a696590d1a606b6
[ "MIT" ]
null
null
null
setup.py
foxleoly/tools
f0ad8617808d2bce47bbc2f69a696590d1a606b6
[ "MIT" ]
null
null
null
#!/usr/bin/env python # setup new pc
18
21
0.694444
7
36
3.571429
1
0
0
0
0
0
0
0
0
0
0
0
0.138889
36
2
22
18
0.806452
0.916667
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
3ac077c97ffb107ef434fb0d9ac356a518f5be18
119
py
Python
generate_voice.py
DanielFlockhart/RNN-language-Model
7e4b060d4bf01560b410f43bf1ac90bb164eae16
[ "MIT" ]
null
null
null
generate_voice.py
DanielFlockhart/RNN-language-Model
7e4b060d4bf01560b410f43bf1ac90bb164eae16
[ "MIT" ]
null
null
null
generate_voice.py
DanielFlockhart/RNN-language-Model
7e4b060d4bf01560b410f43bf1ac90bb164eae16
[ "MIT" ]
null
null
null
from gtts import gTTS import os,time def save_sound(message): speech = gTTS(message) speech.save("audio.mp3")
17
28
0.714286
18
119
4.666667
0.666667
0.238095
0
0
0
0
0
0
0
0
0
0.010204
0.176471
119
6
29
19.833333
0.846939
0
0
0
0
0
0.07563
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
3ac9275b7bfe4e2c5dbe44a10888ba2cd8ef71eb
133
py
Python
league/admin.py
klauck/mettliga
a5fa9f06092274f22a69785ae9a869268c181967
[ "MIT" ]
1
2017-05-12T19:48:15.000Z
2017-05-12T19:48:15.000Z
league/admin.py
klauck/mettliga
a5fa9f06092274f22a69785ae9a869268c181967
[ "MIT" ]
null
null
null
league/admin.py
klauck/mettliga
a5fa9f06092274f22a69785ae9a869268c181967
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import MettEater, Metting admin.site.register(MettEater) admin.site.register(Metting)
22.166667
38
0.827068
18
133
6.111111
0.555556
0.163636
0.309091
0
0
0
0
0
0
0
0
0
0.090226
133
5
39
26.6
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
c94dc8382a511fe00771d81b0f4053e12fbd4a76
104
py
Python
cv/educations/admin.py
vignif/django_cv
0426b47da82341e676adcf7b441a7b55a3fa2d78
[ "MIT" ]
null
null
null
cv/educations/admin.py
vignif/django_cv
0426b47da82341e676adcf7b441a7b55a3fa2d78
[ "MIT" ]
null
null
null
cv/educations/admin.py
vignif/django_cv
0426b47da82341e676adcf7b441a7b55a3fa2d78
[ "MIT" ]
null
null
null
from django.contrib import admin from educations.models import Education admin.site.register(Education)
26
39
0.855769
14
104
6.357143
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.086538
104
4
40
26
0.936842
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c9575a0147102ced0a480e51e8eed5a5a3495119
110
py
Python
edx_lint/__main__.py
eduNEXT/edx-lint
e129a8b5478469f44737cb7ba1afc93b5a994bba
[ "Apache-2.0" ]
43
2015-05-30T21:35:34.000Z
2021-09-21T07:15:05.000Z
edx_lint/__main__.py
eduNEXT/edx-lint
e129a8b5478469f44737cb7ba1afc93b5a994bba
[ "Apache-2.0" ]
106
2015-02-02T17:43:55.000Z
2021-12-20T03:05:16.000Z
edx_lint/__main__.py
eduNEXT/edx-lint
e129a8b5478469f44737cb7ba1afc93b5a994bba
[ "Apache-2.0" ]
22
2015-08-28T16:19:41.000Z
2021-09-01T10:36:54.000Z
"""edx_lint's module-callable entry point.""" import sys from edx_lint.cmd.main import main sys.exit(main())
18.333333
45
0.745455
19
110
4.210526
0.684211
0.175
0
0
0
0
0
0
0
0
0
0
0.109091
110
5
46
22
0.816327
0.354545
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
c95f22dfbea8b2cf6d3c1030255c5ae2a34bb5c6
162
py
Python
SE/metadatos.py
Karimx/SGBDR
e4fa3a2d066d40c4d77b5021e8f2a582c16d03fa
[ "Apache-2.0" ]
1
2016-05-12T06:34:30.000Z
2016-05-12T06:34:30.000Z
SE/metadatos.py
Karimx/SGBDR
e4fa3a2d066d40c4d77b5021e8f2a582c16d03fa
[ "Apache-2.0" ]
null
null
null
SE/metadatos.py
Karimx/SGBDR
e4fa3a2d066d40c4d77b5021e8f2a582c16d03fa
[ "Apache-2.0" ]
null
null
null
class MetaDato: def __init__(self, nombreTabla, campos): pass def calcularRegistros(self): pass def getRegistro(self): pass
16.2
44
0.611111
16
162
5.9375
0.625
0.147368
0
0
0
0
0
0
0
0
0
0
0.314815
162
9
45
18
0.855856
0
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.428571
0
0
0.571429
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
c979a57c1534701ef27d687eef4f1d6eacb6e948
14,746
py
Python
day3.py
venomousmoog/adventofcode2021
0111db027954ab38d6c17e0c8048df3449cb90d2
[ "Apache-2.0" ]
null
null
null
day3.py
venomousmoog/adventofcode2021
0111db027954ab38d6c17e0c8048df3449cb90d2
[ "Apache-2.0" ]
null
null
null
day3.py
venomousmoog/adventofcode2021
0111db027954ab38d6c17e0c8048df3449cb90d2
[ "Apache-2.0" ]
null
null
null
# day3 - sonar sweeps # def count_bits(bits, pos): ones = sum([int(b[pos]) for b in bits]) zeros = len(bits) - ones return (ones, zeros) def power(bits): width = len(bits[0]) gamma = [] epsilon = [] for i in range(0, width): (ones, zeros) = count_bits(bits, i) print(f"ones = {ones} zeros = {zeros}") gamma.append("1" if ones > zeros else "0") epsilon.append("0" if ones > zeros else "1") gamma_b = "".join(gamma) epsilon_b = "".join(epsilon) print(f"gamma_b = {gamma_b} epsilon_v = {epsilon_b}") gamma_v = int("".join(gamma), 2) epsilon_v = int("".join(epsilon), 2) print(f"gamma_v = {gamma_v} epsilon_v = {epsilon_v}") print(f"power = {gamma_v * epsilon_v}") def life_support(bits): width = len(bits[0]) oxygen = list(bits) scrubber = list(bits) for i in range(0, width): (ones, zeros) = count_bits(oxygen, i) obit = "1" if ones >= zeros else "0" print(f"obit = {obit}") oxygen = [x for x in oxygen if x[i] == obit] print(f"o = {oxygen}") for i in range(0, width): (ones, zeros) = count_bits(scrubber, i) sbit = "0" if zeros <= ones else "1" print(f"sbit = {sbit}") scrubber = [x for x in scrubber if x[i] == sbit] print(f"s = {scrubber}") if len(scrubber) == 1: break print(f"o = {oxygen}, s = {scrubber}") oxygen_v = int(oxygen[0], 2) scrubber_v = int(scrubber[0], 2) print(f"o = {oxygen_v}, s = {scrubber_v}, life_support = {oxygen_v*scrubber_v}") test_data = """ 00100 11110 10110 10111 10101 01111 00111 11100 10000 11001 00010 01010""".split() data = """ 010111111011 010010101110 011001001100 001000001010 111100101000 111010101100 000111101111 010011010011 100010111011 101011000111 100111101010 101101101101 110010110110 100110011100 001110011000 011000101010 001100111101 100011101111 100111011001 011100101101 111101000111 111000101011 001001000101 010110011000 110100100001 010010010011 100100100100 011011001000 111101011101 101011110011 110011101101 001001000100 100111101110 101101101010 111110101000 111011011001 111110101101 110101010100 011100110000 000010111110 111011111111 010111111110 101001110101 001111010100 001111110001 000010000000 010001101000 100001001111 101111000010 000011110001 110111101110 000000100111 010100000111 011111100001 100011110001 101000001111 101010111001 001101100100 001100111001 001000011010 001001111100 011001011001 101011001010 100101101101 000101011110 101100110111 011000010110 110101000110 011010100101 110011100110 111101000010 111110101011 110101100101 101110101010 100110001011 000110101100 010100001001 010011001110 101010010101 101010000101 100100001011 010010100101 011000111111 001010000001 000001100111 010101101111 101110000110 100101001001 010000101001 001101011001 011101111110 011110011100 110100110111 000101011010 100000010011 011100111000 001110101000 001001001000 110101011101 000011001111 101000011010 100011110010 100100010111 110001010100 111010100110 101001010100 110100111101 111000010111 010001111000 000101010110 010100000100 001000110010 100111001100 111001000100 011100001011 100110001010 000010100111 001010111110 101100110001 010100100001 011001110010 010011100101 011111010110 111000010010 011110110101 110101101100 101010110110 000111000001 001111111101 110011101010 011000110010 101110101011 110100001100 001000011000 110110110010 101111000111 000111111001 111100110100 010010011010 010010111010 000001101000 000101010101 110111110101 111001110110 110011001100 011110011001 000010110101 011011000111 010101010110 001011010100 100001111001 011000111010 011100010000 110001011010 110010110111 001101010101 000110011000 000010011110 101100111001 100011001110 100010000000 001111010001 011100010011 010001000010 110010010111 011011111101 010011010100 100001101001 101100110110 000000101011 111000110111 111101010110 111110000000 101010000111 011010110110 100110100111 001011001011 110011111000 010111100110 001100101010 110001001000 000100000111 000001011100 000100000000 100010100000 110001011011 110110111101 100110010001 001101001110 011111011000 110010000100 100011010110 011001100000 010101001110 111100000001 110100010111 000001000011 101100010011 000100011111 111000001001 101100011100 010110010001 000110000010 110000101111 011010011100 111000011110 100110110001 100000011100 101010001011 010111001100 100111110111 111100001011 010100100100 100111100101 111100000111 101001001101 111001111000 001110010100 111010011001 010100111111 110111010011 100100000001 001101111111 111101001100 000111101010 000100101001 111011011101 010001110111 111010100001 001101010100 101010011100 000011100100 100101101010 011111100000 011011001110 000101000111 010010111111 001100111011 000001101001 001110110001 010011011110 001011011000 100000111010 001000100101 010001100011 011001000111 010110101010 101000001001 110101011000 001100000101 100110011001 000011001001 100110111001 111101101001 011011001001 010001100111 001100011100 011111101111 100100111010 101111110011 110111001110 000111100000 011110000101 111110100010 001011001101 110100101011 011100001101 111001111100 111110100110 000010010100 010111110010 001110001101 011111010011 110110111010 101001110000 011110110011 000111011000 010111000110 001011100010 001110000010 010111000011 010011111110 011000010000 101111011110 101010000110 011100011101 011101101100 100110101001 000000011001 100101010010 110011010101 010100100111 011101011100 011001111001 000001001000 001000101011 010110111101 100110010010 010010010110 000000111001 011111110101 011111001000 100100011111 000001111000 111101010010 101010100100 011010111101 000001011011 101111100001 100011000000 110011001010 000100010111 100000010000 101111010110 010010010001 101011100001 101001011100 001111000011 111000100010 001101110110 001110111011 100001110010 000001110001 111100001000 100010011101 000011000110 111100100110 000111110111 000100111001 011001110001 111101010001 110110101100 010001011001 001101111110 000101111010 110100100110 111011001110 110011010100 010000100011 011000111001 110001110001 101000000001 101011000101 011010000110 000010111000 010011100011 111101101110 001111010010 100011011100 111110111010 000010110010 101000011100 010011101011 110001011000 000000010011 001101010010 110111111011 111101011100 111001010011 110111100101 111000111001 001110010010 001011101101 110100100111 101011100000 011000100101 110101010010 000110000111 111111001000 000011100110 101101110011 001110011111 110000101110 110011100101 101110100101 001000111000 101111000011 100111111011 011010101111 101101001000 000101101110 111101000011 000011000010 000101010010 101001011101 110011010011 111010010001 110100010001 010100001010 110111101010 100111000101 101001100010 011010011011 101011101101 011001100001 001000110111 000100101000 010000000111 111111110000 001011110110 100010010001 100110101111 110110010000 100110011011 001100110101 100011101100 000011011001 010110100001 011110101111 101011011000 101110111001 111000010000 011100000010 100110100101 010101011111 100000111001 011000111100 101100100111 101011111000 111101111101 101000100011 101000010101 111001010010 101110000111 101010000001 000100100111 100001011101 110010101010 000000100100 011101000101 110010001101 111011101110 111111111110 011100000111 101111110010 000101100110 000110001011 100100011000 010001101111 011110010000 100011011111 010101101010 000011100000 000101001110 001001110001 111110011001 101110000000 010001010010 110001000110 101011001110 010001101001 000000011011 101001010011 011010000100 001100001100 100010001001 100000111111 001000000000 100110110100 100111110000 101001110001 000110101101 000111001010 101100011011 110001101000 000111101110 110110010011 100010001000 001010001100 001011111110 001110000111 110010100000 100001110101 000110111101 110010011000 111110111011 101000000011 011010011110 110000001111 011000110100 111111001101 000010110100 101100001100 110000101011 010000001110 101001101000 011000000100 101101011000 100111111100 110001001010 001010101100 111010001110 101110100110 011110010001 111011111010 000001100110 010001100101 100101001111 111001001011 111101101010 011011000001 010111010101 110001111110 110100101110 111101011011 011000101011 010100111100 011000000111 101000101001 111000110001 101000110001 001111010011 100000010100 001001101101 010101110001 100110000101 011000101101 001110110010 100111000001 011001000001 000101101000 101000101110 000100001110 111110101111 011110110001 101001110010 000000111010 101111010010 011110011010 101000011111 000100001100 110001111001 110000110101 111010011100 001000111011 111110001111 011011011000 000110110001 101001010010 111010100011 000001111100 110010000001 110101111011 100011001001 010011100001 101101011111 100000001010 001011001000 000011100010 011110111000 000110111011 010111001011 011100011000 101010011011 001001011110 000110001010 111011010101 010101110010 011100101001 100000110010 111100111001 001011011101 110101101001 001000111110 101011000011 001110111111 100101010110 111011011110 010111111001 011001010001 110101111111 110100100101 111111110001 010011000101 011101101010 101111000100 011101000100 001110110110 010011011000 000011011010 110000000110 001100001101 111001111001 100001100101 100100010011 111011111000 001001111110 101101000000 000001100001 001100001011 110011011111 010101111110 001110011100 111111000100 010011000010 101100010000 000010110111 110100000101 110100010010 111001100101 010000010001 101100100110 001111101100 011100110110 000000111101 001000000100 010101101101 100101101000 001001010101 000000001111 110111110100 000010110110 001000000010 011000101000 100101001101 010110101110 100010110001 010111010000 001111011001 000011110100 100100111000 011011100110 100100010110 000001111101 010111011011 110001000101 111100010001 101001000111 110100010000 001010000111 101001110111 010010010010 100010111100 001101000011 011001110011 000100101111 010110011101 001001011010 111011101001 111111000000 111110000111 110000001011 010000110010 011100011001 011001100011 001101000110 011001011111 100111100000 110111010100 101101000001 110011101000 001010110101 100101010001 101000101100 010110001000 111011111011 000010010001 010111011010 011101101011 001000101110 101010100111 001011000111 011011010110 110111101111 100001110001 100100101111 110000010011 011110111011 000110000100 110000111111 100110101100 001101110101 011100000100 001100011110 010111010010 001110101101 100110001110 100100010000 001000001101 011101110011 011001100110 110101000011 100101001010 111111101111 010011000100 100111000111 101100101100 010110000100 111100000100 000000101001 000011110010 011011110111 011101110001 111110000001 011000011001 100001101111 110000011010 110110101010 110100110000 111111000011 100011100010 100100010010 110100011000 000110000110 001101001000 101011110111 000011110111 001001100100 100010110011 100111111000 000001111010 110001111101 100011111111 111001001101 011111101011 101111110111 100111000011 010010001010 010101101011 011011110000 110111000000 010011101111 010001010101 111110101010 001010101010 001100101101 111011000111 101001000001 000101000100 010011110010 001110100010 110111001000 111011001101 111110001010 110000100001 000000010101 000010011001 011100100111 001101111010 000001100100 011111101100 110100011111 010110000000 001010101001 000010010011 111100000110 110101000101 010110001011 111001001000 010110101111 001000000001 111100001101 001000110110 110001101001 001110001011 111101101011 011101111100 100011001011 001000001001 000001001100 100100110111 111111101101 001110100000 001001001001 001111001100 101100101111 101100110010 101000100001 101000010110 100000010101 011010011000 101101101110 011101001100 101011111100 101110101000 110010100100 011111011110 110010011101 110100100011 111111100100 011011011101 011100100001 101011110000 001100100011 000111111000 110010001010 100001001001 110010001000 111010001001 010110111111 101011001101 101010011110 011011110001 101010100011 100000110111 100011101001 101110010011 101011011011 110010010000 011110100011 010010110110 100110010111 110100000110 101011101011 001100010100 101101010000 110110001001 010010001101 111011010110 111100001110 000101111001 100001000001 101111101001 100101101110 000011001101 000001000110 111110001011 000010101111 011101101101 000000000110 111111101010 101001110110 111011000100 001011101111 110010111010 110011110001 111100011111 110110010001 100101110000 010001001011 101100010100 110100001010 001011101001 110110000001 001101001001 100000111100 001101101010 010000110011 011111101110 110001110011 011110011000 000010001010 001110000100 000110101111 100011111000 100101100010 111111110010 101100011001 011100100000 100001100011 001010011110 111100011010 010110100010 101110010010 001011110010 100010111000 001100110010 001001101001 011111101101 101100111100 011010011101 101011100100 111000001000 010111011100 001010000000 011110000110 110101101110 000111000101 101001011010 110010100010 100101110010 000101100100 010100110010 011001000010 110010011010 010100001011 011001111110 011000101001 011101011011 010010000111 000001110111 100010101001 111100011101 100010001011 111100101100 011111010101 111100101110 111101001110 111000010110 000000110110 011110000001 000111011110 111010111010 101010001101 111110101100 000111110010 110000111101 111101110101 101010101100 101110110010 110110011010 111110110001 011101111011 101011111011 100111101101 000110011001 100101101011 110101101101 010111110100 001111110010 101010101000 011001100100 101011111111 001001000001 010100100110 111100011100 011100011010 000011011110 001011101010 010010001110 101101101111 000101000010 010111100010 010010010000 111000000101 010001100010 101100001111 011110111100 100011000010 010100001111 011100101110 011000111110 111101010000 110100111000 001010001111 111100011011 101000111110 100000011011 010110000001 001111100111 001111101111 011001011100 111001000011 110011101111 001101100011 101100111111 011111101010 010000011110 001111111111 010001001001 111010101000 110100001001 111111010111 000101110100 101101100000 001101100001 001111111000 100111101001 000110010001 100011101011 000010000101 101010001100 000111110011 001010110001 111110001110 010011100010 100011010000 100001010010 100011000101 110011000100 010000010000 110100110011 100011000111 010111101010 101011000010 110000101100 111100001111 000110100001 010010110001 111000100110 000110111110 100101000000 011101001010 101111011011 111011101111 000000010100 110011101110 111001110111 011111000111 111111011100 110010011111 111111110111 001110110011 000010010010 100100100001 111010000101 001001110011 101001101111 101110101110 101000101111""".split() power(data) life_support(data)
13.691736
84
0.880646
1,261
14,746
10.275971
0.839017
0.00463
0.001389
0.002547
0.013351
0.010727
0.008103
0.008103
0.008103
0.008103
0
0.909851
0.099552
14,746
1,077
85
13.691736
0.066049
0.001288
0
0.004726
0
0
0.908313
0.001426
0
1
0
0
0
1
0.002836
false
0
0
0
0.003781
0.009452
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
5
a323831709abf3b08a5a3c6cb19c140b718070cd
1,808
py
Python
frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/resources/instalment_schedule.py
ibrahmm22/library-management
b88a2129a5a2e96ce1f945ec8ba99a0b63b8c506
[ "MIT" ]
30
2015-07-08T21:10:10.000Z
2022-02-17T10:08:55.000Z
frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/resources/instalment_schedule.py
ibrahmm22/library-management
b88a2129a5a2e96ce1f945ec8ba99a0b63b8c506
[ "MIT" ]
21
2015-12-14T02:24:52.000Z
2022-02-05T15:56:00.000Z
frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/resources/instalment_schedule.py
ibrahmm22/library-management
b88a2129a5a2e96ce1f945ec8ba99a0b63b8c506
[ "MIT" ]
19
2016-02-10T15:57:42.000Z
2022-02-05T10:21:05.000Z
# WARNING: Do not edit by hand, this file was generated by Crank: # # https://github.com/gocardless/crank # class InstalmentSchedule(object): """A thin wrapper around a instalment_schedule, providing easy access to its attributes. Example: instalment_schedule = client.instalment_schedules.get() instalment_schedule.id """ def __init__(self, attributes, api_response): self.attributes = attributes self.api_response = api_response @property def created_at(self): return self.attributes.get('created_at') @property def currency(self): return self.attributes.get('currency') @property def id(self): return self.attributes.get('id') @property def links(self): return self.Links(self.attributes.get('links')) @property def metadata(self): return self.attributes.get('metadata') @property def name(self): return self.attributes.get('name') @property def payment_errors(self): return self.attributes.get('payment_errors') @property def status(self): return self.attributes.get('status') @property def total_amount(self): return self.attributes.get('total_amount') class Links(object): """Wrapper for the response's 'links' attribute.""" def __init__(self, attributes): self.attributes = attributes @property def customer(self): return self.attributes.get('customer') @property def mandate(self): return self.attributes.get('mandate') @property def payments(self): return self.attributes.get('payments')
17.72549
80
0.605088
190
1,808
5.647368
0.315789
0.20876
0.15657
0.246039
0.276794
0
0
0
0
0
0
0
0.294248
1,808
101
81
17.90099
0.840909
0.180863
0
0.325581
1
0
0.063668
0
0
0
0
0
0
1
0.325581
false
0
0
0.27907
0.651163
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
a329455af1a886af67beff6ab805c6887d7e83bf
25,026
py
Python
src/utils.py
HFooladi/lincs_processing
ac21d84bc09565a7c7e9285f6bae5557fa1617de
[ "MIT" ]
null
null
null
src/utils.py
HFooladi/lincs_processing
ac21d84bc09565a7c7e9285f6bae5557fa1617de
[ "MIT" ]
null
null
null
src/utils.py
HFooladi/lincs_processing
ac21d84bc09565a7c7e9285f6bae5557fa1617de
[ "MIT" ]
null
null
null
from __future__ import unicode_literals, print_function, division from typing import List, Union import pickle import pandas as pd from tqdm import tqdm from collections import Counter __author__ = "Hosein Fooladi" __email__ = "fooladi.hosein@gmail.com" def load_pickle(dataset_dir: str) -> List: """Loading (reading) a pickle file Parameters ---------- dataset_dir: str It must be string file that shows the directory of the dataset. Returns ------- List """ assert isinstance(dataset_dir, str), "The dataset_dir must be a string object" fp = open(dataset_dir, 'rb') return pickle.load(fp) def write_pickle(dataset_dir: str, data: List) -> None: """Writing a file (data) into a pickle file (dataset_dir) Parameters ---------- dataset_dir: str It must be string file that shows the directory for writing. data: List the object that should be written into the pickle file. """ assert isinstance(dataset_dir, str), "The dataset_dir must be a string object" fp = open(dataset_dir, 'wb') pickle.dump(data, fp) def print_statistics(data: Union[str, List]) -> None: """Print data statistics This function takes the directory of dataset and returns some useful statistics about the data. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) """ print("=================================================================") print("Data Loading..") assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data print("Data Statistics\n") print("Number of Train Data: {}".format(len(train))) print("Please wait while we are retriving information ...") cell_lines = [] compounds = [] doses = [] times = [] for i in range(len(train)): cell_lines.append(train[i][0][0]) compounds.append(train[i][0][1]) doses.append(train[i][0][3]) times.append(train[i][0][5]) print("Number of unique Cell Lines: {}".format(len(set(cell_lines)))) print("Number of unique Compounds: {}".format(len(set(compounds)))) print("Number of unique doses: {}".format(len(set(doses)))) print("Number of unique times: {}".format(len(set(times)))) def print_most_frequent(data: Union[str, List], n: int = 3) -> None: """Print most frequent cell line, compounds, and does. This function takes the directory of dataset (or a list object) and integer n and returns The n most frequent cell lines, compounds and doses in the dataset. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) n: int, optional (default 3) An integer which determine number of frequent statistics we want to retrieve. Default=3. """ print("=================================================================") print("Data Loading..") assert isinstance(n, int), "The parameter n must be an integer" assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data print("Please wait while we are retriving information ...") cell_lines = [] compounds = [] doses = [] for i in tqdm(range(len(train))): cell_lines.append(train[i][0][0]) compounds.append(train[i][0][1]) doses.append(train[i][0][3]) print("loop finished !!!") print("Most frequent Cell Lines: {}".format( Counter(cell_lines).most_common(n))) print("Most frequent Compounds: {}".format(Counter(compounds).most_common(n))) print("Most frequent Doses: {}".format(Counter(doses).most_common(n))) def cell_line_frequent(data: Union[str, List], n: int = 3) -> List: """Returns list of data belongs to most frequent cell lines This function takes the directory of dataset (or a list object) and integer n, and parse the data to keep only the data that belongs to n most frequent cell lines. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) n: int, optional (default 3) An integer which determine number of frequent statistics we want to retrieve. Default=3. Returns ------- parse_data: List A list containing data that belongs to n most frequent cell lines. """ print("=================================================================") print("Data Loading..") assert isinstance(n, int), "The parameter n must be an integer" assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data print("Please wait while we are retriving information ...") cell_lines = [] for i in tqdm(range(len(train))): cell_lines.append(train[i][0][0]) print("Number of unique Cell Lines: {}".format(len(set(cell_lines)))) print("Most frequent Cell Lines: {}".format( Counter(cell_lines).most_common(n))) if n > len(set(cell_lines)): import warnings warnings.warn( "n is greater than number of unique cell lines available in the dataset" ) # List of n most frequent cell lines x = list(map(lambda x: x[0], Counter(cell_lines).most_common(n))) parse_data = [line for line in train if line[0][0] in x] return parse_data def cell_line_list(data: Union[str, List], cells: List[str] = ['MCF7']) -> List: """Filter data based on desired cell line list This function takes the directory of dataset (or alist object) and a list cells, and parse the data to keep only the data that belongs to cells list. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) cells: List[str] list of cell lines that we want to keep their data to retrieve. Default=['MCF7'] Returns ------- parse_data: list A list containing data that belongs to desired list. """ assert isinstance(cells, list), "The parameter cells must be a list" print("=================================================================") print("Data Loading..") assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data print("Number of Train Data: {}".format(len(train))) parse_data = [line for line in train if line[0][0] in cells] print("Number of Data after parsing: {}".format(len(parse_data))) return parse_data def parse_list(data: Union[str, List], indicator: int = 0, query=['MCF7']) -> List: """Filter the data based on compound, cell line, dose or time This function takes the directory of dataset, indicator that indicates whether you want to subset the data based on cell line, compound, dose, or time and a list which shows what part of the data you want to keep. The output will be a list of desired parsed dataset. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) indicator: int it must be an integer from 0 1 2 and 3 that shows whether we want to retrieve the data based on cells, compound or dose. 0: cell_lines 1:compounds 2:doses 3:time Default=0 (cell_lines) query: List list of cells or compounds or doses that we want to retrieve. The list depends on the indicator. If the indicator is 0, you should enter the list of desired cell lines and so on. Default=['MCF7'] Returns ------- parse_data: List A list containing data that belongs to desired list. """ assert isinstance(indicator, int), "The indicator must be an int object" assert indicator in [0, 1, 2, 3], "You should choose indicator from 0, 1, 2 range" assert isinstance(query, list), "The parameter query must be a list" print("=================================================================") print("Data Loading..") assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data mapping = {0: 0, 1: 1, 2: 3, 3: 5} k = mapping[indicator] mapping_name = {0: 'cell_lines', 1: 'compounds', 2: 'doses', 3: 'time'} print("Number of Train Data: {}".format(len(train))) print("You are parsing the data base on {}".format(mapping_name[indicator])) parse_data = [line for line in train if line[0][k] in query] print("Number of Data after parsing: {}".format(len(parse_data))) return parse_data def parse_most_frequent(data: Union[str, List], indicator: int = 0, n: int = 3) -> List: """Returns most frequent data (based on cell line, compound, ...) This function takes the directory of dataset, indicator that indicates whether you want to subset the data based on cell line, compound, dose, or time and a n which how much frequent items you want to keep. The output will be a list of desired parsed dataset. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) indicator: int, optional (default n=0) It must be an integer from 0 1 2 and 3 that shows whether we want to retrieve the data based on cells, compound or dose. 0: cell_lines 1:compounds 2:doses 3:time Default=0 n: int, optional (default n=3) number of most frequent cells or compounds or doses that we want to retrieve. The list depends on the indicator. If the indicator is 0, you should enter the number of desired cell lines and so on. Default=3 Returns ------- parse_data: List A list containing data that belongs to desired list. """ assert isinstance(indicator, int), "The indicator must be an int object" assert indicator in [0, 1, 2, 3], "You should choose indicator from 0, 1, 2, 3 range" assert isinstance(n, int), "The parameter n must be an integer" print("=================================================================") print("Data Loading..") assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data mapping = {0: 0, 1: 1, 2: 3, 3: 5} k = mapping[indicator] mapping_name = {0: 'cell_lines', 1: 'compounds', 2: 'doses', 3: 'time'} mylist = [] for i in tqdm(range(len(train))): mylist.append(train[i][0][k]) print("Number of unique {}: {}".format(mapping_name[indicator], len(set(mylist)))) print("Most frequent {}: {}".format(mapping_name[indicator], Counter(mylist).most_common(n))) assert n <= len(set(mylist)), "n is out of valid range!" # List of n most frequent cell lines y = list(map(lambda x: x[0], Counter(mylist).most_common(n))) parse_data = [line for line in train if line[0][k] in y] return parse_data def parse_chunk_frequent(data: Union[str, List], indicator: int = 0, start: int = 0, end: int = 3) -> List: """ This function takes the directory of dataset, indicator that indicates whether you want to subset the data based on cell line, compound, dose, or time and a start and end which shows what chunk of data is desirable. E.g., if start=0 and end=3, you are subsetting 3 most frequent data. The output will be a list of desired parsed dataset. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) indicator: int, optional (default n=0) It must be an integer from 0 1 2 and 3 that shows whether we want to retrieve the data based on cells, compound or dose. 0: cell_lines 1:compounds 2:doses 3:time Default=0 start: int indicates the start of the list you want to subset. Default=0 end: int indicates the end of the list you want to subset. Default=3 Returns ------- parse_data: List A list containing data that belongs to desired list. """ assert isinstance(indicator, int), "The indicator must be an int object" assert indicator in [0, 1, 2], "You should choose indicator from 0, 1, 2 range" assert isinstance(start, int), "The parameter start must be an integer" assert isinstance(end, int), "The parameter end must be an integer" assert start <= end, "The start should be less than the end!!" print("=================================================================") print("Data Loading..") assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data mapping = {0: 0, 1: 1, 2: 3, 3: 5} k = mapping[indicator] mapping_name = {0: 'cell_lines', 1: 'compounds', 2: 'doses', 3: 'time'} mylist = [] for i in range(len(train)): mylist.append(train[i][0][k]) print("Number of unique {}: {}".format(mapping_name[indicator], len(set(mylist)))) assert end < len(set(mylist)), "end is out of valid range!" # List of n most frequent cell lines y = list(map(lambda x: x[0], Counter(mylist).most_common()))[start:end] print("Desired {}: {}".format(mapping_name[indicator], y)) parse_data = [line for line in train if line[0][k] in y] return parse_data def parse_dose_range(data: Union[str, List], dose_min: int = 0, dose_max: int = 5) -> List: """ This function takes the directory of dataset minimum and maximum dose and return a list of data that are within the desired range. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) dose_min: int, optional (default dose_min=0) minimum dose. Default=0 dose_max: int, optional (default dose_max=5) maximum_dose. Default=5 Returns -------- parse_data: List A list containing data that belongs to desired list ( Desired range of doses). """ assert isinstance(dose_min, int), "The parameter dose_min must be an integer" assert isinstance(dose_max, int), "The parameter dose_max must be an integer" assert dose_min < dose_max, "The minimum dose must be less than the maximum dose !!" print("=================================================================") print("Data Loading..") assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data print("Number of Train Data: {}".format(len(train))) parse_data = [ line for line in train if line[0][3] > dose_min and line[0][3] < dose_max ] print("Number of Data after parsing: {}".format(len(parse_data))) return parse_data def to_dataframe(data: Union[str, List]) -> pd.DataFrame: """This takes a list and produce a pandas datframe of data The input to this function is a list which contains metadata (such as cell lines, compounds, ..) and gene expression. this function returns a pandas dataframe where the first columns belongs to gene expression and last four columns contain metaddata cell line, compound, dose, and time in this order. Parameters ---------- data: Union[str, List] the data can be a string which is the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark.pkl' or it can be a list which contains the gene expression and metadata. It must be a list of tuples with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) Returns ------- pd.DataFrame This is a pandas dataframe where the first columns contains gene expression (978 or 12328-dimension) and the last four columns contains cell line, pert_id, dose, and time """ assert isinstance(data, (str, list)), "The data should be string or list object" if isinstance(data, str): with open(data, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data genes = [line[1] for line in train] cell_lines = [line[0][0] for line in train] compounds = [line[0][1] for line in train] doses = [line[0][3] for line in train] times = [line[0][5] for line in train] metadata = { "cell_lines": cell_lines, "compounds": compounds, "doses": doses, "times": times } data_df = pd.concat([pd.DataFrame(genes), pd.DataFrame(metadata)], axis=1) return data_df def parse_list_v2(dataset_dir, indicator=0, query=['MCF7'], data=None): """ This function takes the directory of dataset, indicator that indicates whether you want to subset the data based on cell line, compound, dose, time, touchstone, clinical phase, MOA or target. Moreover, it takes a list which shows what part of the data you want to keep. The output will be a list of desired parsed dataset. Input: Mandatory: -:param dataset_dir (str): It must be string file that shows the directory of the dataset. dataset should be a pickle file. e.g., valid argument is something like this: './Data/level3_trt_cp_landmark_allinfo.pkl' The pickle file should be as the following: list Format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type, touchstone, clinical phase, moa, target) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) Optional: -:params indicator (int): it must be an integer from 0 1 2 3 4 5 6 7 that shows whether we want to retrieve the data based on cells, compound, dose, touchstone, clinical phase, moa or target. 0: cell_lines 1: compounds 2: doses 3: time 4: touchstone 5: clinical phase 6: moa 7: target Default=0 (cell_lines) -:params query (list): list of cells or compounds or doses or time or touchstone or clinical phase or MOA or target that we want to retrieve. The list depends on the indicator. If the indicator is 0, you should enter the list of desired cell lines and so on. Default=['MCF7'] -:param data (list): It must be a list with the following format: line[0]:(cell_line, drug, drug_type, does, does_type, time, time_type, touchstone, clinical phase, moa, target) line[1]: 978 or 12328-dimensional Vector(Gene_expression_profile) Output: -:params parse_data (list): A list containing data that belongs to desired list. Note: If you provide the data argument, the function igonres the dataset_dir argument and returns output based on the provided data. Otherwise, it returns output based on dataset_dir. """ assert isinstance(dataset_dir, str), "The dataset_dir must be a string object" assert isinstance(indicator, int), "The indicator must be an int object" assert indicator in [ 0, 1, 2, 3, 4, 5, 6, 7 ], "You should choose indicator from 0, 1, 2, 3, 4, 5, 6, 7 range" assert isinstance(query, list), "The parameter query must be a list" print("=================================================================") print("Data Loading..") if data is None: with open(dataset_dir, "rb") as f: train = pickle.load(f) else: assert isinstance(data, list), "The data must be a list object" train = data mapping = {0: 0, 1: 1, 2: 3, 3: 5, 4: 7, 5: 8, 6: 9, 7: 10} k = mapping[indicator] mapping_name = { 0: 'cell_lines', 1: 'compounds', 2: 'doses', 3: 'time', 4: 'tochstone', 5: 'clinical_phase', 6: 'moa', 7: 'target' } print("Number of Train Data: {}".format(len(train))) print("You are parsing the data base on {}".format(mapping_name[indicator])) parse_data = [] if indicator in [0, 1, 2, 3, 4]: parse_data = [line for line in train if line[0][k] in query] elif indicator in [5, 6, 7]: for line in train: tmp = line[0][k][0].split('|') for a in tmp: if a in query: parse_data.append(line) break print("Number of Data after parsing: {}".format(len(parse_data))) return parse_data
34.855153
149
0.642532
3,723
25,026
4.255439
0.068225
0.010983
0.015906
0.015969
0.789686
0.776747
0.762545
0.746134
0.726819
0.715774
0
0.018827
0.233797
25,026
717
150
34.903766
0.807405
0.487773
0
0.62807
0
0.003509
0.283355
0.049544
0
0
0
0
0.154386
1
0.042105
false
0
0.024561
0
0.098246
0.175439
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
a3458c0e7ea0e00c34f6e98b7bc483cf91550aaa
62
py
Python
unity/__init__.py
princeton-vl/PackIt
9894d252c5238d582cba7c3d19540f89d47e4166
[ "BSD-3-Clause" ]
49
2020-07-24T18:17:12.000Z
2022-01-04T15:30:52.000Z
unity/__init__.py
princeton-vl/PackIt
9894d252c5238d582cba7c3d19540f89d47e4166
[ "BSD-3-Clause" ]
14
2020-07-21T20:21:08.000Z
2022-03-12T00:42:18.000Z
unity/__init__.py
princeton-vl/PackIt
9894d252c5238d582cba7c3d19540f89d47e4166
[ "BSD-3-Clause" ]
5
2020-07-27T12:35:00.000Z
2021-07-19T03:04:21.000Z
from .communicator_objects import * from .unityagents import *
31
35
0.822581
7
62
7.142857
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.112903
62
2
36
31
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
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
a35f3f67af4ee424e0d69451927de1102f1f730a
266
py
Python
uimnet/metrics/__init__.py
facebookresearch/uimnet
d7544cf5fb4c65cb262dca203afb0db4ba6c569d
[ "MIT" ]
7
2021-07-28T18:40:20.000Z
2022-01-26T23:50:41.000Z
uimnet/metrics/__init__.py
facebookresearch/uimnet
d7544cf5fb4c65cb262dca203afb0db4ba6c569d
[ "MIT" ]
10
2021-08-31T13:44:56.000Z
2021-08-31T14:10:12.000Z
uimnet/metrics/__init__.py
facebookresearch/uimnet
d7544cf5fb4c65cb262dca203afb0db4ba6c569d
[ "MIT" ]
1
2021-11-06T01:55:58.000Z
2021-11-06T01:55:58.000Z
#!/usr/bin/env python3 # # # Copyright (c) 2021 Facebook, inc. and its affiliates. All Rights Reserved # # from uimnet.metrics.out_domain import * from uimnet.metrics.auc import * from uimnet.metrics.fused_prediction import * from uimnet.metrics.prediction import *
26.6
77
0.770677
37
266
5.486486
0.648649
0.197044
0.334975
0.339901
0
0
0
0
0
0
0
0.021552
0.12782
266
9
78
29.555556
0.853448
0.360902
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
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
a366c2372505bac0d15d14f504a1723ae0469338
20
py
Python
probnode/interface/ievent.py
medasmarathon/Probnode
7a372a5d515a2e13575690d738404c14df07c784
[ "BSD-3-Clause" ]
3
2022-02-25T17:05:30.000Z
2022-02-28T15:39:58.000Z
probnode/interface/ievent.py
medasmarathon/Probnode
7a372a5d515a2e13575690d738404c14df07c784
[ "BSD-3-Clause" ]
1
2022-02-26T15:12:20.000Z
2022-02-27T08:29:44.000Z
probnode/interface/ievent.py
medasmarathon/Probnode
7a372a5d515a2e13575690d738404c14df07c784
[ "BSD-3-Clause" ]
null
null
null
class IEvent: pass
10
13
0.75
3
20
5
1
0
0
0
0
0
0
0
0
0
0
0
0.2
20
2
14
10
0.9375
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
6e646ede69755b2cf1217989d36d06fe6e0c7efa
48
py
Python
imagepy/tools/Measure/distance_tol.py
dada1437903138/imagepy
65d9ce088894eef587054e04018f9d34ff65084f
[ "BSD-4-Clause" ]
1,178
2017-05-25T06:59:01.000Z
2022-03-31T11:38:53.000Z
imagepy/tools/Measure/distance_tol.py
TomisTony/imagepy
3c378ebaf72762b94f0826a410897757ebafe689
[ "BSD-4-Clause" ]
76
2017-06-10T17:01:50.000Z
2021-12-23T08:13:29.000Z
imagepy/tools/Measure/distance_tol.py
TomisTony/imagepy
3c378ebaf72762b94f0826a410897757ebafe689
[ "BSD-4-Clause" ]
315
2017-05-25T12:59:53.000Z
2022-03-07T22:52:21.000Z
from sciapp.action import DistanceTool as Plugin
48
48
0.875
7
48
6
1
0
0
0
0
0
0
0
0
0
0
0
0.104167
48
1
48
48
0.976744
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
6e7116b66cfd84afbf50b56a5018b4889a9ab791
125
py
Python
game/displays/null_display.py
scooler/tic-tac-toe
8ec14c0c35dd48edc8718b478e5f4c83891a941a
[ "MIT" ]
null
null
null
game/displays/null_display.py
scooler/tic-tac-toe
8ec14c0c35dd48edc8718b478e5f4c83891a941a
[ "MIT" ]
null
null
null
game/displays/null_display.py
scooler/tic-tac-toe
8ec14c0c35dd48edc8718b478e5f4c83891a941a
[ "MIT" ]
null
null
null
class NullDisplay: def __init__(self, board=None): pass def show_results(self): pass def draw(self): pass
13.888889
33
0.656
17
125
4.529412
0.647059
0.181818
0
0
0
0
0
0
0
0
0
0
0.248
125
9
34
13.888889
0.819149
0
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.428571
0
0
0.571429
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
6ebf2eefd7fdec944abad2c80323c65d1501cc1b
68
py
Python
01_Python_Basico_Intermediario/Aula053/aula53.py
Joao-Inacio/Curso-de-Python3
179d85f43f77dced640ffb143a87214538254cf3
[ "MIT" ]
1
2021-07-19T12:31:49.000Z
2021-07-19T12:31:49.000Z
01_Python_Basico_Intermediario/Aula053/aula53.py
Joao-Inacio/Curso-de-Python3
179d85f43f77dced640ffb143a87214538254cf3
[ "MIT" ]
null
null
null
01_Python_Basico_Intermediario/Aula053/aula53.py
Joao-Inacio/Curso-de-Python3
179d85f43f77dced640ffb143a87214538254cf3
[ "MIT" ]
null
null
null
""" Módulos padrão do Python """ import sys print(sys.platform)
11.333333
28
0.676471
9
68
5.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.191176
68
5
29
13.6
0.836364
0.352941
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
288073e893e788262f3d79d2e2e80d8c610800a9
172
py
Python
thecampy/__init__.py
SyphonArch/thecampy
91da9fb3e4cbbcb6304ac7e8f9b52a7fcce26301
[ "MIT" ]
null
null
null
thecampy/__init__.py
SyphonArch/thecampy
91da9fb3e4cbbcb6304ac7e8f9b52a7fcce26301
[ "MIT" ]
null
null
null
thecampy/__init__.py
SyphonArch/thecampy
91da9fb3e4cbbcb6304ac7e8f9b52a7fcce26301
[ "MIT" ]
null
null
null
from . import utils from .client import client from .models import Cookie, Soldier, Message from .exceptions import ThecampyException, ThecampyValueError, ThecampyReqError
34.4
79
0.837209
19
172
7.578947
0.631579
0
0
0
0
0
0
0
0
0
0
0
0.116279
172
4
80
43
0.947368
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
288e5c32aaa6afe34e8c9f99c64bf883be30d12a
170
py
Python
hello/chalan/admin.py
sumanbudhathoki9808/E-Challan
5ce22f8d68bee1dbabc8d3081238fd56c1a325a6
[ "MIT" ]
null
null
null
hello/chalan/admin.py
sumanbudhathoki9808/E-Challan
5ce22f8d68bee1dbabc8d3081238fd56c1a325a6
[ "MIT" ]
18
2021-04-08T08:56:58.000Z
2021-05-19T15:50:30.000Z
hello/chalan/admin.py
sumanbudhathoki9808/E-Challan
5ce22f8d68bee1dbabc8d3081238fd56c1a325a6
[ "MIT" ]
null
null
null
from django.contrib import admin # Register your models here. from .models import challan, dynamicAbout admin.site.register(challan) admin.site.register(dynamicAbout)
18.888889
41
0.811765
22
170
6.272727
0.545455
0.130435
0.246377
0
0
0
0
0
0
0
0
0
0.111765
170
9
42
18.888889
0.913907
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
955aeeb9745d062eadd3cf6f3b48664ae45981ad
50
py
Python
stdlib_tests/test_math.py
MajkB/voc-1
a79af19c07fa66965522d8fb97ae783541cda110
[ "BSD-3-Clause" ]
null
null
null
stdlib_tests/test_math.py
MajkB/voc-1
a79af19c07fa66965522d8fb97ae783541cda110
[ "BSD-3-Clause" ]
null
null
null
stdlib_tests/test_math.py
MajkB/voc-1
a79af19c07fa66965522d8fb97ae783541cda110
[ "BSD-3-Clause" ]
null
null
null
import math as math print(math.floor(5.2232323))
12.5
28
0.76
9
50
4.222222
0.777778
0
0
0
0
0
0
0
0
0
0
0.181818
0.12
50
3
29
16.666667
0.681818
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
955ff3766b779c1a5c2527c02e0a825da76d092b
14,483
py
Python
machinelearning/test/kerasutilstest.py
hayj/MachineLearning
66a34b6776450f7d597acca05525120fb28c8deb
[ "MIT" ]
null
null
null
machinelearning/test/kerasutilstest.py
hayj/MachineLearning
66a34b6776450f7d597acca05525120fb28c8deb
[ "MIT" ]
null
null
null
machinelearning/test/kerasutilstest.py
hayj/MachineLearning
66a34b6776450f7d597acca05525120fb28c8deb
[ "MIT" ]
null
null
null
# coding: utf-8 import os import sys sys.path.append('../') import unittest import doctest from machinelearning import kerasutils from machinelearning.kerasutils import * # The level allow the unit test execution to choose only the top level test mini = 0 maxi = 9 assert mini <= maxi print("==============\nStarting unit tests...") if mini <= 0 <= maxi: class DocTest(unittest.TestCase): def testDoctests(self): """Run doctests""" doctest.testmod(kerasutils) if mini <= 1 <= maxi: class Test1(unittest.TestCase): def test1(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3, 'min_delta': 0.1}, 'val_acc': {'patience': 2}, 'val_top_k_categorical_accuracy': {'patience': 2, 'min_delta': 0.1}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], 'val_acc': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], } self.assertTrue(not hasToEarlyStop(history, esm)) def test2(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3}, 'val_acc': {'patience': 2}, 'val_top_k_categorical_accuracy': {'patience': 2}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.09], 'val_acc': [0.1, 0.1, 0.09, 0.08, 0.07, 0.06], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.07], } self.assertTrue(not hasToEarlyStop(history, esm)) def test3(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3, 'min_delta': 0.01}, 'val_acc': {'patience': 2, 'min_delta': 0.01}, 'val_top_k_categorical_accuracy': {'patience': 2, 'min_delta': 0.01}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], 'val_acc': [0.1, 0.1, 0.09, 0.08, 0.07, 0.06], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.07], } self.assertTrue(hasToEarlyStop(history, esm)) def test3(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 2}, }) history = \ { 'val_acc': [0.12, 0.13, 0.07, 0.06, 0.05], } self.assertTrue(hasToEarlyStop(history, esm)) def test4(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 3}, }) history = \ { 'val_acc': [0.1, 0.1, 0.12, 0.13, 0.07, 0.06, 0.05], } self.assertTrue(not hasToEarlyStop(history, esm)) def test5(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 1}, }) history = \ { 'val_acc': [0.1, 0.1, 0.12, 0.13, 0.07], } self.assertTrue(not hasToEarlyStop(history, esm)) def test5(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 0}, }) history = \ { 'val_acc': [0.1, 0.1, 0.12, 0.13, 0.07], } self.assertTrue(hasToEarlyStop(history, esm)) def test7(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 4}, }) history = \ { 'val_acc': [0.1, 0.14, 0.10, 0.11, 0.12, 0.13], } self.assertTrue(not hasToEarlyStop(history, esm)) def test7(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 1, 'min_delta': 0.5}, 'val_acc': {'patience': 3}, }) history = \ { 'val_loss': [10, 20, 9, 8, 8, 6, 5, 6], 'val_acc': [0.1, 0.14, 0.10, 0.11, 0.12, 0.13], } self.assertTrue(not hasToEarlyStop(history, esm)) def test8(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 1, 'min_delta': 0.5}, 'val_acc': {'patience': 3}, }) history = \ { 'val_loss': [10, 20, 9, 8, 8, 6, 5, 6, 7], 'val_acc': [0.1, 0.14, 0.10, 0.11, 0.12, 0.13], } self.assertTrue(hasToEarlyStop(history, esm)) def test9(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3}, 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], 'val_acc': [0.1, 0.1, 0.09, 0.08, 0.07, 0.1, 0.1], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.1], } self.assertTrue(not hasToEarlyStop(history, esm)) def test10(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3}, 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], 'val_acc': [0.1, 0.1, 0.09, 0.1, 0.07, 0.09], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.1], } self.assertTrue(not hasToEarlyStop(history, esm)) def test11(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3}, 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.3], 'val_acc': [0.1, 0.1, 0.09, 0.1, 0.07, 0.12, 0.13], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.1, 0.12, 0.13], } self.assertTrue(not hasToEarlyStop(history, esm)) def test12(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 3}, 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.3], 'val_acc': [0.1, 0.1, 0.09, 0.1, 0.07, 0.07, 0.09, 0.09], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.1, 0.12, 0.13], } self.assertTrue(not hasToEarlyStop(history, esm)) def test13(self): esm = normalizeEarlyStopMonitor(\ { 'val_loss': {'patience': 2}, 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_loss': [0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.3, 0.4], 'val_acc': [0.1, 0.1, 0.09, 0.1, 0.07, 0.07, 0.09, 0.09], 'val_top_k_categorical_accuracy': [0.1, 0.1, 0.1, 0.09, 0.08, 0.099, 0.095, 0.06], } self.assertTrue(hasToEarlyStop(history, esm)) def test14(self): esm = normalizeEarlyStopMonitor(\ { 'val_top_k_categorical_accuracy': {'patience': 1, 'min_delta': 0.03}, }) history = \ { 'val_top_k_categorical_accuracy': [0.13, 0.1, 0.1, 0.09, 0.08, 0.099, 0.095, 0.11, 0.12], } self.assertTrue(hasToEarlyStop(history, esm)) def test15(self): esm = normalizeEarlyStopMonitor(\ { 'val_top_k_categorical_accuracy': {'patience': 1, 'min_delta': 0.03}, }) history = \ { 'val_top_k_categorical_accuracy': [0.13, 0.1, 0.1, 0.09, 0.08, 0.099, 0.095, 0.15, 0.12], } self.assertTrue(hasToEarlyStop(history, esm)) def test16(self): esm = normalizeEarlyStopMonitor(\ { 'val_top_k_categorical_accuracy': {'patience': 1, 'min_delta': 0.019}, }) history = \ { 'val_top_k_categorical_accuracy': [0.13, 0.1, 0.1, 0.09, 0.08, 0.099, 0.095, 0.15, 0.12], } self.assertTrue(not hasToEarlyStop(history, esm)) def test17(self): esm = normalizeEarlyStopMonitor(\ { 'val_top_k_categorical_accuracy': {'patience': 2, 'min_delta': 0.1}, }) history = \ { 'val_top_k_categorical_accuracy': [0.1, 0.2, 0.3, 0.4], } self.assertTrue(not hasToEarlyStop(history, esm)) def test18(self): esm = normalizeEarlyStopMonitor(\ { 'val_top_k_categorical_accuracy': {'patience': 2, 'min_delta': 0.2}, }) history = \ { 'val_top_k_categorical_accuracy': [0.1, 0.2, 0.3, 0.4], } self.assertTrue(hasToEarlyStop(history, esm)) def test19(self): esm = normalizeEarlyStopMonitor(\ { 'val_top_k_categorical_accuracy': {'patience': 2, 'min_delta': 0.1}, }) history = \ { 'val_top_k_categorical_accuracy': [0.1, 0.2, 0.3, 0.4, 0.4, 0.4, 0.4], } self.assertTrue(hasToEarlyStop(history, esm)) def test20(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_acc': [0.1, 0.2, 0.3, 0.4, 0.3, 0.4, 0.3, 0.3], 'val_top_k_categorical_accuracy': [0.1, 0.2, 0.3, 0.4, 0.3, 0.4, 0.3, 0.3], } self.assertTrue(not hasToEarlyStop(history, esm)) def test20(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_acc': [0.1, 0.2, 0.3, 0.4, 0.3, 0.3, 0.3, 0.3], 'val_top_k_categorical_accuracy': [0.1, 0.2, 0.3, 0.4, 0.3, 0.4, 0.3, 0.3], } self.assertTrue(not hasToEarlyStop(history, esm)) def test20(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 3}, 'val_top_k_categorical_accuracy': {'patience': 3}, }) history = \ { 'val_acc': [0.1, 0.2, 0.3, 0.4, 0.3, 0.3, 0.3, 0.3], 'val_top_k_categorical_accuracy': [0.1, 0.2, 0.3, 0.4, 0.3, 0.3, 0.3, 0.3], } self.assertTrue(hasToEarlyStop(history, esm)) def test21(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 0}, }) history = \ { 'val_acc': [0.1], } self.assertTrue(not hasToEarlyStop(history, esm)) def test22(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 0}, }) history = \ { 'val_acc': [0.1, 0.2], } self.assertTrue(not hasToEarlyStop(history, esm)) def test23(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 0}, }) history = \ { 'val_acc': [], } self.assertTrue(not hasToEarlyStop(history, esm)) def test24(self): esm = normalizeEarlyStopMonitor(\ { 'val_acc': {'patience': 0}, }) history = \ { 'val_acc': [0.1, 0.02], } self.assertTrue(hasToEarlyStop(history, esm)) if mini <= 2 <= maxi: class Test2(unittest.TestCase): def test1(self): normalizeEarlyStopMonitor\ ( { 'val_loss': {'patience': 50, 'min_delta': 0.5555, 'mode': 'auto'}, 'val_acc': {'patience': 50, 'mode': 'auto'}, 'val_top_k_categorical_accuracy': {'patience': 50, 'min_delta': 0, 'mode': 'auto'}, }, ) if mini <= 12 <= maxi: class Test2(unittest.TestCase): def test1(self): x1 = xVal y1 = yVal x2 = iteratorToArray(asap.getTokensOnlyValidationInfiniteBatcher(), steps=asap.getValidationBatchsCount()) y2 = iteratorToArray(asap.getLabelOnlyValidationInfiniteBatcher(), steps=asap.getValidationBatchsCount()) for i in range(len(x1)): if i % 100 == 0: print("--------a") print(x1[i]) print(x2[i]) print("--------b") print(y1[i]) print(y2[i]) self.assertTrue(np.array_equal(x1[i], x2[i])) self.assertTrue(np.array_equal(y1[i], y2[i])) self.assertTrue(x1[i][1] == x2[i][1]) self.assertTrue(y1[i][1] == y2[i][1]) self.assertTrue(np.array_equal(x1, x2)) self.assertTrue(np.array_equal(y1, y2)) self.assertTrue(not np.array_equal(x1[2], x2[4])) self.assertTrue(not np.array_equal(y1[2], y2[4])) if __name__ == '__main__': unittest.main() # Orb executes it as a Python unit-test in eclipse print("Unit tests done.\n==============")
37.040921
118
0.446454
1,634
14,483
3.813341
0.085679
0.042369
0.056813
0.047504
0.839833
0.824266
0.75317
0.723158
0.689295
0.647248
0
0.104955
0.399365
14,483
391
119
37.040921
0.611335
0.010357
0
0.515957
0
0
0.154056
0.076434
0
0
0
0
0.098404
1
0.082447
false
0
0.015957
0
0.109043
0.021277
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
95d511a32b601ff55826a3bf005531ae0702a99f
56
py
Python
katas/kyu_8/multiply_the_number.py
the-zebulan/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
40
2016-03-09T12:26:20.000Z
2022-03-23T08:44:51.000Z
katas/kyu_8/multiply_the_number.py
akalynych/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
null
null
null
katas/kyu_8/multiply_the_number.py
akalynych/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
36
2016-11-07T19:59:58.000Z
2022-03-31T11:18:27.000Z
def multiply(n): return n * (5 ** len(str(abs(n))))
18.666667
38
0.535714
10
56
3
0.8
0
0
0
0
0
0
0
0
0
0
0.022727
0.214286
56
2
39
28
0.659091
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
2519d4d502acc4da656de340df5dc2a3030f1040
289
py
Python
simplads/simplad_bundle/retu.py
Cogmob/simplads
8731c4a02273109187cfe601058ce797e32ba1ae
[ "MIT" ]
null
null
null
simplads/simplad_bundle/retu.py
Cogmob/simplads
8731c4a02273109187cfe601058ce797e32ba1ae
[ "MIT" ]
null
null
null
simplads/simplad_bundle/retu.py
Cogmob/simplads
8731c4a02273109187cfe601058ce797e32ba1ae
[ "MIT" ]
null
null
null
from simplads.simplad_monad.simplad_monad import SimpladResult from simplads import ErrorDeltaMaker def rn(i): return SimpladResult(val=i, delta_map={}) def error(value, error): print('retu') return SimpladResult(val=value, delta_map={'error': ErrorDeltaMaker.error(error)})
28.9
86
0.764706
37
289
5.864865
0.486486
0.110599
0.202765
0
0
0
0
0
0
0
0
0
0.121107
289
9
87
32.111111
0.854331
0
0
0
0
0
0.031142
0
0
0
0
0
0
1
0.285714
false
0
0.285714
0.142857
0.857143
0.142857
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
254f6239f94ec7944489d4fd57a90de98abc3e78
141
py
Python
pydistributed/event_source/exceptions.py
jaycosaur/PyDistributed
b10ad07a56b78416d09790f1faf9bc7dfd2b02ba
[ "MIT" ]
null
null
null
pydistributed/event_source/exceptions.py
jaycosaur/PyDistributed
b10ad07a56b78416d09790f1faf9bc7dfd2b02ba
[ "MIT" ]
null
null
null
pydistributed/event_source/exceptions.py
jaycosaur/PyDistributed
b10ad07a56b78416d09790f1faf9bc7dfd2b02ba
[ "MIT" ]
null
null
null
class OffsetMissingInIndex(Exception): pass class CouldNotFindOffset(Exception): pass class LogSizeExceeded(Exception): pass
12.818182
38
0.758865
12
141
8.916667
0.5
0.364486
0.336449
0
0
0
0
0
0
0
0
0
0.177305
141
10
39
14.1
0.922414
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
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
255e7a4cf07bbac4240fac105b2cf34ce4a479af
298
py
Python
ossim/ossim/views.py
devil-r/Os-simulator
afb99d57d16ebb598a66fcd967f1d67247b4efb4
[ "MIT" ]
null
null
null
ossim/ossim/views.py
devil-r/Os-simulator
afb99d57d16ebb598a66fcd967f1d67247b4efb4
[ "MIT" ]
null
null
null
ossim/ossim/views.py
devil-r/Os-simulator
afb99d57d16ebb598a66fcd967f1d67247b4efb4
[ "MIT" ]
null
null
null
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect,HttpResponse from django.urls import reverse def index(request): return render(request, 'ossim/index2.html') def matindex(request): return render(request, 'mat/mainindex.html')
27.090909
58
0.768456
38
298
5.947368
0.631579
0.132743
0.168142
0.230089
0
0
0
0
0
0
0
0.015748
0.147651
298
10
59
29.8
0.874016
0
0
0
0
0
0.121528
0
0
0
0
0
0
1
0.285714
false
0
0.428571
0.285714
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
5
c2dc8b1dd7b4351785ec73649f13a3b2fc8ab78a
711
py
Python
instagram_scraper/model/__init__.py
luengwaiban/instagram-python-scraper
d3427afba9865d914a9b5daaafde9f2981ebf1c3
[ "MIT" ]
139
2019-06-02T16:19:06.000Z
2021-09-08T08:16:43.000Z
instagram_scraper/model/__init__.py
luengwaiban/instagram-python-scraper
d3427afba9865d914a9b5daaafde9f2981ebf1c3
[ "MIT" ]
4
2019-06-10T02:06:10.000Z
2020-07-07T04:45:59.000Z
instagram_scraper/model/__init__.py
luengwaiban/instagram-python-scraper
d3427afba9865d914a9b5daaafde9f2981ebf1c3
[ "MIT" ]
16
2019-06-07T10:02:49.000Z
2021-06-03T20:41:33.000Z
# # -*- coding:utf-8 -*- from instagram_scraper.model.base_model import BaseModel from instagram_scraper.model.initializer_model import InitializerModel from instagram_scraper.model.media import Media from instagram_scraper.model.account import Account from instagram_scraper.model.carousel_media import CarouselMedia from instagram_scraper.model.tag import Tag from instagram_scraper.model.location import Location from instagram_scraper.model.story import Story from instagram_scraper.model.user_stories import UserStories from instagram_scraper.model.like import Like __all__ = ["base_model", "initializer_model", "media", "account", "carousel_media", "Tag", "Location", "Story", "UserStories", "Like"]
39.5
134
0.825598
91
711
6.21978
0.263736
0.229682
0.353357
0.441696
0
0
0
0
0
0
0
0.001541
0.087201
711
17
135
41.823529
0.87057
0.028129
0
0
0
0
0.122987
0
0
0
0
0
0
1
0
false
0
0.909091
0
0.909091
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
6c06f3e0c2b2f146bce3a1a975b695c45c67f2f9
86
py
Python
evaluation/__init__.py
dichotomies/NeuralDiff
0f5f07e20e94368f8637f2fec1ec5a0c914524de
[ "MIT" ]
5
2022-01-28T23:31:42.000Z
2022-03-13T09:21:50.000Z
evaluation/__init__.py
yashbhalgat/NeuralDiff
a480f2103384a4f5d77eb84abd977a200e6e6405
[ "MIT" ]
2
2022-02-03T12:12:48.000Z
2022-02-18T05:07:21.000Z
evaluation/__init__.py
dichotomies/NeuralDiff
0f5f07e20e94368f8637f2fec1ec5a0c914524de
[ "MIT" ]
null
null
null
from . import video, segmentation from .segmentation import evaluate, evaluate_sample
28.666667
51
0.837209
10
86
7.1
0.6
0
0
0
0
0
0
0
0
0
0
0
0.116279
86
2
52
43
0.934211
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
6c3096e7054ff51f6b45c39984d2cd3d6e8ae973
64
py
Python
tests/test_pep542.py
nickdrozd/experimental
e4532800939935cb2ebaec12d0e0fcc63cd7ea78
[ "MIT" ]
21
2018-06-19T00:57:38.000Z
2022-02-20T22:52:53.000Z
tests/test_pep542.py
nickdrozd/experimental
e4532800939935cb2ebaec12d0e0fcc63cd7ea78
[ "MIT" ]
3
2018-07-21T14:48:15.000Z
2019-03-06T15:29:20.000Z
tests/test_pep542.py
nickdrozd/experimental
e4532800939935cb2ebaec12d0e0fcc63cd7ea78
[ "MIT" ]
4
2017-08-18T18:08:05.000Z
2018-07-21T14:04:20.000Z
from .common import experimental from .pep542_testfile import *
21.333333
32
0.828125
8
64
6.5
0.75
0
0
0
0
0
0
0
0
0
0
0.053571
0.125
64
2
33
32
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
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
6c30f28509834d8b8fbd8630ffbf7c1fb3fe28a7
87
py
Python
enthought/enable/radio_group.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/enable/radio_group.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/enable/radio_group.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from __future__ import absolute_import from enable.radio_group import *
21.75
38
0.83908
12
87
5.583333
0.75
0
0
0
0
0
0
0
0
0
0
0
0.126437
87
3
39
29
0.881579
0.137931
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
6688ffb8ced097f42ea26f76345fbfa945049d81
82
py
Python
vpp-api/python/vpp_papi/__init__.py
akshayanadahalli/vpp_ietf97
273c26a531bf031b3426588041bad67fe7f0a246
[ "Apache-2.0" ]
1
2019-06-12T12:13:45.000Z
2019-06-12T12:13:45.000Z
vpp-api/python/vpp_papi/__init__.py
akshayanadahalli/vpp_ietf97
273c26a531bf031b3426588041bad67fe7f0a246
[ "Apache-2.0" ]
null
null
null
vpp-api/python/vpp_papi/__init__.py
akshayanadahalli/vpp_ietf97
273c26a531bf031b3426588041bad67fe7f0a246
[ "Apache-2.0" ]
1
2020-11-09T10:43:08.000Z
2020-11-09T10:43:08.000Z
__import__('pkg_resources').declare_namespace(__name__) from . vpp_papi import *
20.5
55
0.804878
10
82
5.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.085366
82
3
56
27.333333
0.733333
0
0
0
0
0
0.160494
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
66a812a31638f2768f5dc916f2009636693f9cc8
13,701
py
Python
src/sharkradar/Util/sharkradarDbutils.py
bmonikraj/shark-radar
61dc685cd41041fc3b6d92de76c211cb0d23c6cf
[ "BSD-3-Clause" ]
8
2019-08-15T21:43:37.000Z
2022-03-13T06:49:54.000Z
src/sharkradar/Util/sharkradarDbutils.py
bmonikraj/shark-radar
61dc685cd41041fc3b6d92de76c211cb0d23c6cf
[ "BSD-3-Clause" ]
3
2019-08-25T11:33:05.000Z
2022-02-27T15:34:19.000Z
src/sharkradar/Util/sharkradarDbutils.py
bmonikraj/shark-radar
61dc685cd41041fc3b6d92de76c211cb0d23c6cf
[ "BSD-3-Clause" ]
null
null
null
""" DB Utils functions for the project """ import sys from os.path import dirname as opd, realpath as opr import os import time import sqlite3 basedir = opd(opd(opd(opr(__file__)))) sys.path.append(basedir) from sharkradar.Config.Config import Config def createTableIfNotExists(): """ Creates the SERVICE_RD, SERVICE_LOGS table in SQLite3 file mode, if table doesn't exist Columns of Table KEYS: VALUES: --------- ------------- i) ip ip address associated with micro-service ii) port port associated with micro-service iii) service_name unique name of the micro-service iv) status status (up/down) sent from the micro-service v) mem_usage Current memory usage vi) cpu_usage Current CPU usage vii) network_throughput Current network throughput viii) req_active No. of requests currently being processed by the instance ix) success_rate Fraction of requests successfully served x) health_interval The time interval specified by the micro-service at which it will send health report to service R/D continuously xi) status Status of the discovery log xii) retry_id Retry ID in discovery log """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute('''CREATE TABLE IF NOT EXISTS SERVICE_RD (SERVICE_NAME TEXT NOT NULL, IP TEXT NOT NULL, PORT TEXT NOT NULL, MEM_USAGE REAL NOT NULL, CPU_USAGE REAL NOT NULL, NW_TPUT_BW_RATIO REAL NOT NULL, REQ_ACTIVE_RATIO REAL NOT NULL, SUCCESS_RATE REAL NOT NULL, TIME_STAMP BIGINT NOT NULL, HEALTH_INTERVAL BIGINT NOT NULL);''') conn.execute('''CREATE TABLE IF NOT EXISTS SERVICE_LOGS (SERVICE_NAME TEXT NOT NULL, IP TEXT NOT NULL, PORT TEXT NOT NULL, MEM_USAGE REAL NOT NULL, CPU_USAGE REAL NOT NULL, NW_TPUT_BW_RATIO REAL NOT NULL, REQ_ACTIVE_RATIO REAL NOT NULL, SUCCESS_RATE REAL NOT NULL, TIME_STAMP BIGINT NOT NULL, HEALTH_INTERVAL BIGINT NOT NULL);''') conn.execute('''CREATE TABLE IF NOT EXISTS DISCOVERY_LOGS (SERVICE_NAME TEXT NOT NULL, IP TEXT NOT NULL, PORT TEXT NOT NULL, TIME_STAMP BIGINT NOT NULL, STATUS TEXT NOT NULL, RETRY_ID TEXT NOT NULL);''') conn.commit() conn.close() def findServiceByNameAndIpAndPort(service_name, ip, port): """ Find services by service name, IP address and port number @params:service_name: A string, representing the service name @params:ip: IP address of the service @params:port : Port number of the service @return: List of the query results from DB """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) response = conn.execute( """SELECT * FROM SERVICE_RD WHERE SERVICE_NAME = ? AND IP = ? AND PORT = ?""", (service_name, ip, port)).fetchall() conn.close() return response def findServiceByName(service_name): """ Find services by service name @params:service_name: A string, representing the service name @return: List of the query results from DB """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) service_instances = conn.execute( """SELECT * from SERVICE_RD WHERE SERVICE_NAME = ?""", (service_name, )).fetchall() conn.close() return service_instances def getAllService(): """ Find all services at current time @return: List of the query results from DB """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) service_instances = conn.execute( """SELECT * from SERVICE_RD""").fetchall() conn.close() return service_instances def updateServiceByAll( current_time_stamp, health_interval, mem_usage, cpu_usage, nw_tput_bw_ratio, req_active_ratio, success_rate, service_name, ip, port): """ Update services details @params:current_time_stamp: Current time stamp @params:health_interval: Health interval frequency in secs, the maximum threshold after which if health status is not received, the service will be de-registered @params:mem_usage: Memory usage in % of service @params:cpu_usage: CPU usage in % of service @params:nw_tput_bw_ratio: Ratio of current network throughput with maximum capacity (bandwidth) in % @params:req_active_ratio: Ratio of current requests being handled with maximum requests limit in % @param:success_rate: Ratio of successful response by total requests in % @params:service_name: A string, representing the service name @params:ip: IP address of the service @params:port : Port number of the service @return: Total number of rows updated """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute( """UPDATE SERVICE_RD SET TIME_STAMP = ?, HEALTH_INTERVAL = ?, MEM_USAGE = ?, CPU_USAGE = ?, NW_TPUT_BW_RATIO = ?, REQ_ACTIVE_RATIO = ?, SUCCESS_RATE = ? WHERE SERVICE_NAME = ? AND IP = ? AND PORT = ?""", (current_time_stamp, health_interval, mem_usage, cpu_usage, nw_tput_bw_ratio, req_active_ratio, success_rate, service_name, ip, port)) conn.commit() total_changes = conn.total_changes conn.close() return total_changes def insertServiceByAll( service_name, ip, port, current_time_stamp, health_interval, mem_usage, cpu_usage, nw_tput_bw_ratio, req_active_ratio, success_rate): """ Insert services details @params:service_name: A string, representing the service name @params:ip: IP address of the service @params:port : Port number of the service @params:current_time_stamp: Current time stamp @params:health_interval: Health interval frequency in secs, the maximum threshold after which if health status is not received, the service will be de-registered @params:mem_usage: Memory usage in % of service @params:cpu_usage: CPU usage in % of service @params:nw_tput_bw_ratio: Ratio of current network throughput with maximum capacity (bandwidth) in % @params:req_active_ratio: Ratio of current requests being handled with maximum requests limit in % @param:success_rate: Ratio of successful response by total requests in % """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute( """INSERT INTO SERVICE_RD (SERVICE_NAME, IP, PORT, TIME_STAMP, HEALTH_INTERVAL, MEM_USAGE, CPU_USAGE, NW_TPUT_BW_RATIO, REQ_ACTIVE_RATIO, SUCCESS_RATE) \ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", (service_name, ip, port, current_time_stamp, health_interval, mem_usage, cpu_usage, nw_tput_bw_ratio, req_active_ratio, success_rate)) conn.commit() conn.close() def insertServiceByAllPersist( service_name, ip, port, current_time_stamp, health_interval, mem_usage, cpu_usage, nw_tput_bw_ratio, req_active_ratio, success_rate): """ Insert services details persistant @params:service_name: A string, representing the service name @params:ip: IP address of the service @params:port : Port number of the service @params:current_time_stamp: Current time stamp @params:health_interval: Health interval frequency in secs, the maximum threshold after which if health status is not received, the service will be de-registered @params:mem_usage: Memory usage in % of service @params:cpu_usage: CPU usage in % of service @params:nw_tput_bw_ratio: Ratio of current network throughput with maximum capacity (bandwidth) in % @params:req_active_ratio: Ratio of current requests being handled with maximum requests limit in % @param:success_rate: Ratio of successful response by total requests in % """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute( """INSERT INTO SERVICE_LOGS (SERVICE_NAME, IP, PORT, TIME_STAMP, HEALTH_INTERVAL, MEM_USAGE, CPU_USAGE, NW_TPUT_BW_RATIO, REQ_ACTIVE_RATIO, SUCCESS_RATE) \ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", (service_name, ip, port, current_time_stamp, health_interval, mem_usage, cpu_usage, nw_tput_bw_ratio, req_active_ratio, success_rate)) conn.commit() conn.close() def getServicePersist(limit=250): """ Fetch service log records by limit @params:limit: latest n records @return: List of the query results from DB """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) service_instances = conn.execute( """SELECT * from SERVICE_LOGS ORDER BY TIME_STAMP DESC LIMIT ?""", (limit,)).fetchall() conn.close() return service_instances def insertDiscoveryPersist( service_name, ip, port, current_time_stamp, status, retryid): """ Insert discovery details persistant @params:service_name: A string, representing the service name @params:ip: IP address of the service @params:port : Port number of the service @params:current_time_stamp: Current time stamp @params:status: Status of the service @params:retryid: Retry ID for the discovery log """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute( """INSERT INTO DISCOVERY_LOGS (SERVICE_NAME, IP, PORT, TIME_STAMP, STATUS, RETRY_ID) \ VALUES (?, ?, ?, ?, ?, ?)""", (service_name, ip, port, current_time_stamp, status, retryid)) conn.commit() conn.close() def getDiscoveryPersist(limit=250): """ Fetch service log records by limit @params:limit: latest n records @return: List of the query results from DB """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) service_instances = conn.execute( """SELECT * from DISCOVERY_LOGS ORDER BY TIME_STAMP DESC LIMIT ?""", (limit,)).fetchall() conn.close() return service_instances def updateDiscoveryPersist( status, retryid): """ Update discovery details persistant @params:service_name: A string, representing the service name @params:ip: IP address of the service @params:port : Port number of the service @params:current_time_stamp: Current time stamp @params:status: Status of the service @params:retryid: Retry ID for the discovery log """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute( """UPDATE DISCOVERY_LOGS SET STATUS = ? WHERE RETRY_ID = ?""", (status, retryid)) conn.commit() conn.close() def getLatestRecordsDiscoveryLogs(service_name, ip, port, latest_records): """ Fetch latest n records from discovery logs corresponding to service name, IP and port @params:service_name: A string representing service name @params:ip: IP address @params:port: Port numbers @params:latest_records: Limit @return: List of records in ordered by desc timestamp """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) discovery_instances = conn.execute( """SELECT STATUS FROM DISCOVERY_LOGS WHERE SERVICE_NAME = ? AND IP = ? AND PORT = ? ORDER BY TIME_STAMP DESC LIMIT ?""", (service_name, ip, port, latest_records)).fetchall() conn.close() return discovery_instances def deleteServiceByNameAndIpAndPort(service_name, ip, port): """ Delete services by service name, Ip and port @params:service_name: A string, representing the service name @params:ip: IP Address of the service @params:port: Port number of the service """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) conn.execute( """DELETE FROM SERVICE_RD WHERE SERVICE_NAME = ? AND IP = ? AND PORT = ?""", (service_name, ip, port)) conn.commit() conn.close() def deleteServiceByNameAndTimestampDifferenceWithHealthInterval(service_name): """ Find services by service name, based on services who are declared dead Dead -> Services who haven't sent health status post their health interval @params:service_name: A string, representing the service name """ DB_PATH = Config.getDbPath() conn = sqlite3.connect(DB_PATH) current_time_epoch = time.time() conn.execute( """DELETE FROM SERVICE_RD WHERE SERVICE_NAME = ? AND ? - TIME_STAMP > HEALTH_INTERVAL""", (service_name, current_time_epoch)) conn.commit() conn.close()
34.598485
213
0.629808
1,652
13,701
5.050847
0.121065
0.073826
0.03116
0.034636
0.763663
0.755153
0.739214
0.700743
0.695709
0.657958
0
0.002265
0.29122
13,701
395
214
34.686076
0.856966
0.414349
0
0.763158
0
0
0.188511
0
0
0
0
0
0
1
0.061404
false
0
0.026316
0
0.118421
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