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
179da4e7e81bfbce00b07399ae857d9bbcfebc70
77
py
Python
models/__init__.py
rampagefx/pan_pp.pytorch
5d8e5f606a8b8de1d1096ef02f6c03148888e3f3
[ "Apache-2.0" ]
null
null
null
models/__init__.py
rampagefx/pan_pp.pytorch
5d8e5f606a8b8de1d1096ef02f6c03148888e3f3
[ "Apache-2.0" ]
null
null
null
models/__init__.py
rampagefx/pan_pp.pytorch
5d8e5f606a8b8de1d1096ef02f6c03148888e3f3
[ "Apache-2.0" ]
null
null
null
from .pan import PAN from .builder import build_model __all__ = ['PAN']
15.4
33
0.701299
11
77
4.454545
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.207792
77
4
34
19.25
0.803279
0
0
0
0
0
0.041096
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
17a2f54125e42553342e44c8db4cdbd925760e73
44
py
Python
scientific-computing/solutions/xarray/exercise2.py
ncar-hackathons/handson-notebooks
5738d86929f693af8cc582bd61f70f9393be8600
[ "Apache-2.0" ]
13
2019-06-03T16:30:43.000Z
2021-11-15T10:44:12.000Z
scientific-computing/solutions/xarray/exercise2.py
ncar-hackathons/handson-notebooks
5738d86929f693af8cc582bd61f70f9393be8600
[ "Apache-2.0" ]
8
2019-05-31T20:44:59.000Z
2019-08-07T19:47:43.000Z
scientific-computing/solutions/xarray/exercise2.py
ncar-hackathons/handson-notebooks
5738d86929f693af8cc582bd61f70f9393be8600
[ "Apache-2.0" ]
15
2019-05-31T14:46:13.000Z
2021-09-09T19:34:24.000Z
(f * g).sel(x=slice(-1, 1)).plot(marker='o')
44
44
0.545455
10
44
2.4
0.9
0
0
0
0
0
0
0
0
0
0
0.04878
0.068182
44
1
44
44
0.536585
0
0
0
0
0
0.022222
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
bd68b05c553da513d7a48cf037b66bdae1cfcdf6
483
py
Python
extensions/.stubs/clrclasses/__clrclasses__/System/Diagnostics/Contracts/Internal/__init__.py
vicwjb/Pycad
7391cd694b7a91ad9f9964ec95833c1081bc1f84
[ "MIT" ]
1
2020-03-25T03:27:24.000Z
2020-03-25T03:27:24.000Z
extensions/.stubs/clrclasses/__clrclasses__/System/Diagnostics/Contracts/Internal/__init__.py
vicwjb/Pycad
7391cd694b7a91ad9f9964ec95833c1081bc1f84
[ "MIT" ]
null
null
null
extensions/.stubs/clrclasses/__clrclasses__/System/Diagnostics/Contracts/Internal/__init__.py
vicwjb/Pycad
7391cd694b7a91ad9f9964ec95833c1081bc1f84
[ "MIT" ]
null
null
null
from __clrclasses__.System import Exception as _n_0_t_0 from __clrclasses__.System.Diagnostics.Contracts import ContractFailureKind as _n_1_t_0 import typing class ContractHelper(object): @staticmethod def RaiseContractFailedEvent(failureKind: _n_1_t_0, userMessage: str, conditionText: str, innerException: _n_0_t_0) -> str:... @staticmethod def TriggerFailure(kind: _n_1_t_0, displayMessage: str, userMessage: str, conditionText: str, innerException: _n_0_t_0):...
53.666667
130
0.803313
64
483
5.5625
0.4375
0.033708
0.025281
0.033708
0.269663
0.269663
0.269663
0.269663
0.269663
0
0
0.028103
0.115942
483
8
131
60.375
0.805621
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.375
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
4
bd83dca7c71237ca371e053694b153e4f3f1feb0
180
py
Python
simax/utils/math_utils.py
ytanay/simax
98c425f99c2285163698764f646d577d8696d8f0
[ "MIT" ]
null
null
null
simax/utils/math_utils.py
ytanay/simax
98c425f99c2285163698764f646d577d8696d8f0
[ "MIT" ]
null
null
null
simax/utils/math_utils.py
ytanay/simax
98c425f99c2285163698764f646d577d8696d8f0
[ "MIT" ]
null
null
null
def sign(val): if val == 0: return 0 return 1 if val > 0 else -1 def linear_interpolation(val, x0, y0, x1, y1): return y0 + ((val - x0) * (y1 - y0))/(x1 - x0)
22.5
50
0.533333
31
180
3.064516
0.451613
0.105263
0.126316
0
0
0
0
0
0
0
0
0.12
0.305556
180
8
50
22.5
0.64
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.833333
0
0
0
0
null
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
4
bd94b5f661ba8d6b8637e8913c4bdff32e460194
4,852
py
Python
tests/test_jacob.py
Russ76/robotics-toolbox-python
4b3e82a6522757ffde1f83aef8d05b3ad475e9de
[ "MIT" ]
null
null
null
tests/test_jacob.py
Russ76/robotics-toolbox-python
4b3e82a6522757ffde1f83aef8d05b3ad475e9de
[ "MIT" ]
null
null
null
tests/test_jacob.py
Russ76/robotics-toolbox-python
4b3e82a6522757ffde1f83aef8d05b3ad475e9de
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Oct 3 17:17:04 2021 @author: Peter Corke """ import numpy.testing as nt import numpy as np import roboticstoolbox as rtb from spatialmath.base import tr2x, numjac, numhess from scipy.linalg import block_diag import unittest import pytest class Tests: @pytest.fixture(autouse=True) def setUp(self): self.robot = rtb.models.ETS.Puma560() self.q = np.array([0.1, 0.2, 0.3, 0.1, 0.2, 0.3]) self.qd = np.array([0.1, -0.2, 0.3, -0.1, 0.2, -0.3]) # self.robot = rtb.models.ETS.Panda() # self.q = self.robot.qr # self.qd = self.robot.qr def test_jacob0(self): q = self.q nt.assert_array_almost_equal( self.robot.jacob0(q), numjac(lambda q: self.robot.fkine(q).A, q, SE=3) ) def test_jacobe(self): q = self.q J0 = numjac(lambda q: self.robot.fkine(q).A, q, SE=3) # velocity transform to EE frame TE = self.robot.fkine(q) Je = block_diag(TE.R.T, TE.R.T) @ J0 nt.assert_array_almost_equal(self.robot.jacobe(q), Je) def test_jacob_analytical_eul(self): rep = "eul" q = self.q Ja = numjac(lambda q: tr2x(self.robot.fkine(q).A, representation=rep), q) nt.assert_array_almost_equal( self.robot.jacob0_analytical(q, representation=rep), Ja ) def test_jacob_analytical_rpy_xyz(self): rep = "rpy/xyz" q = self.q Ja = numjac(lambda q: tr2x(self.robot.fkine(q).A, representation=rep), q) nt.assert_array_almost_equal( self.robot.jacob0_analytical(q, representation=rep), Ja ) def test_jacob_analytical_rpy_zyx(self): rep = "rpy/zyx" q = self.q Ja = numjac(lambda q: tr2x(self.robot.fkine(q).A, representation=rep), q) nt.assert_array_almost_equal( self.robot.jacob0_analytical(q, representation=rep), Ja ) def test_jacob_analytical_exp(self): rep = "exp" q = self.q Ja = numjac(lambda q: tr2x(self.robot.fkine(q).A, representation=rep), q) nt.assert_array_almost_equal( self.robot.jacob0_analytical(q, representation=rep), Ja ) def test_jacob_dot(self): j0 = self.robot.jacob0_dot(self.q, self.qd) H = numhess(lambda q: self.robot.jacob0(q), self.q) Jd = np.zeros((6, self.robot.n)) for i in range(self.robot.n): Jd += H[i, :, :] * self.qd[i] nt.assert_array_almost_equal(j0, Jd, decimal=4) def test_jacob_dot_analytical_eul(self): rep = "eul" j0 = self.robot.jacob0_dot(self.q, self.qd, representation=rep) H = numhess( lambda q: self.robot.jacob0_analytical(q, representation=rep), self.q ) Jd = np.zeros((6, self.robot.n)) for i in range(self.robot.n): Jd += H[i, :, :] * self.qd[i] print(np.round(j0, 2)) print() print(np.round(Jd, 2)) nt.assert_array_almost_equal(j0, Jd, decimal=4) # def test_jacob_dot_analytical_rpy_xyz(self): # rep = 'rpy/xyz' # j0 = self.robot.jacob_dot(self.q, self.qd, analytical=rep) # H = numhess(lambda q: self.robot.jacob0(q, analytical=rep), self.q) # Jd = np.zeros((6, self.robot.n)) # for i in range(self.robot.n): # Jd += H[:, :, i] * self.qd[i] # nt.assert_array_almost_equal(j0, Jd, decimal=4) # def test_jacob_dot_analytical_rpy_zyx(self): # rep = 'rpy/zyx' # j0 = self.robot.jacob_dot(self.q, self.qd, analytical=rep) # H = numhess(lambda q: self.robot.jacob0(q, analytical=rep), self.q) # Jd = np.zeros((6, self.robot.n)) # for i in range(self.robot.n): # Jd += H[:, :, i] * self.qd[i] # nt.assert_array_almost_equal(j0, Jd, decimal=4) # def test_jacob_dot_analytical_exp(self): # rep = 'exp' # j0 = self.robot.jacob_dot(self.q, self.qd, analytical=rep) # H = numhess(lambda q: self.robot.jacob0(q, analytical=rep), self.q) # Jd = np.zeros((6, self.robot.n)) # for i in range(self.robot.n): # Jd += H[:, :, i] * self.qd[i] # nt.assert_array_almost_equal(j0, Jd, decimal=4) # class TestJacobians_DH(unittest.TestCase, Tests): # def setUp(self): # self.robot = rtb.models.DH.Puma560() # self.q = np.r_[0.1, 0.2, 0.3, 0.1, 0.2, 0.3] # self.qd = np.r_[0.1, -0.2, 0.3, -0.1, 0.2, -0.3] # class TestJacobians_ERobot(unittest.TestCase, Tests): # def setUp(self): # self.robot = rtb.models.ETS.Puma560() # self.q = np.array([0.1, 0.2, 0.3, 0.1, 0.2, 0.3]) # self.qd = np.array([0.1, -0.2, 0.3, -0.1, 0.2, -0.3]) if __name__ == "__main__": unittest.main()
32.783784
82
0.580585
752
4,852
3.62234
0.144947
0.128855
0.013216
0.017621
0.790749
0.761747
0.761747
0.71696
0.693465
0.656021
0
0.038957
0.264633
4,852
147
83
33.006803
0.724496
0.361707
0
0.391892
0
0
0.010164
0
0
0
0
0
0.108108
1
0.121622
false
0
0.094595
0
0.22973
0.040541
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
da0e93468105a073c1e150396ef5a3e546c0c3fc
219
py
Python
enCount/tests/encode.py
mstrazar/enCount
dcff565ce96afe37aa8a41995637d00cce02360d
[ "MIT" ]
null
null
null
enCount/tests/encode.py
mstrazar/enCount
dcff565ce96afe37aa8a41995637d00cce02360d
[ "MIT" ]
null
null
null
enCount/tests/encode.py
mstrazar/enCount
dcff565ce96afe37aa8a41995637d00cce02360d
[ "MIT" ]
null
null
null
import enCount.encode as encode import unittest class TestEncode(unittest.TestCase): def test_get_online_list(self): experiments = encode.get_online_list() self.assertTrue(len(experiments) > 0 )
19.909091
46
0.730594
27
219
5.740741
0.666667
0.116129
0.167742
0.219355
0
0
0
0
0
0
0
0.005618
0.187215
219
10
47
21.9
0.865169
0
0
0
0
0
0
0
0
0
0
0
0.166667
1
0.166667
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
da1b6a079d7fbbb309e76f7d8d7a7e0bf740cc92
122
py
Python
ya3_report/__main__.py
ecoreuse/ya3-report
a7077b1c917e66987e79fbbaea610a97554c8838
[ "MIT" ]
null
null
null
ya3_report/__main__.py
ecoreuse/ya3-report
a7077b1c917e66987e79fbbaea610a97554c8838
[ "MIT" ]
null
null
null
ya3_report/__main__.py
ecoreuse/ya3-report
a7077b1c917e66987e79fbbaea610a97554c8838
[ "MIT" ]
null
null
null
# Copyright 2022 Shuhei Nitta. All rights reserved. from ya3_report import cli if __name__ == "__main__": cli.main()
20.333333
51
0.729508
17
122
4.705882
0.882353
0
0
0
0
0
0
0
0
0
0
0.05
0.180328
122
5
52
24.4
0.75
0.401639
0
0
0
0
0.112676
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
da229f846ca7287dc70364165d4aac0c95356186
10,394
py
Python
dataworkspace/dataworkspace/tests/request_data/test_views.py
uktrade/jupyterhub-data-auth-admin
91544f376209a201531f4dbfb8faad1b8ada18c9
[ "MIT" ]
1
2019-06-10T08:22:56.000Z
2019-06-10T08:22:56.000Z
dataworkspace/dataworkspace/tests/request_data/test_views.py
uktrade/jupyterhub-data-auth-admin
91544f376209a201531f4dbfb8faad1b8ada18c9
[ "MIT" ]
2
2019-05-17T13:10:42.000Z
2019-06-17T10:48:46.000Z
dataworkspace/dataworkspace/tests/request_data/test_views.py
uktrade/jupyterhub-data-auth-admin
91544f376209a201531f4dbfb8faad1b8ada18c9
[ "MIT" ]
null
null
null
import mock import pytest from lxml import html from django.urls import reverse from dataworkspace.apps.request_data.models import ( DataRequest, RoleType, SecurityClassificationType, DataRequestStatus, ) from dataworkspace.tests.request_data.factories import DataRequestFactory class TestRequestDataIndex: def test_page_available(self, client): resp = client.get(reverse("request-data:index")) assert resp.status_code == 200 def test_submitting_index_creates_data_request_for_user(self, client): assert DataRequest.objects.count() == 0 resp = client.post(reverse("request-data:index")) assert resp.status_code == 302 assert DataRequest.objects.count() == 1 assert resp.url == reverse( "request-data:who-are-you", kwargs={"pk": DataRequest.objects.first().pk} ) class TestRequestDataWhoAreYou: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:who-are-you", kwargs={"pk": dr.pk})) assert resp.status_code == 200 @pytest.mark.parametrize("role_type", ["", *RoleType.values]) def test_page_prefills_existing_data(self, client, role_type): dr = DataRequestFactory.create(requester_role=role_type) resp = client.get(reverse("request-data:who-are-you", kwargs={"pk": dr.pk})) doc = html.fromstring(resp.content.decode(resp.charset)) if role_type == "": assert len(doc.xpath('//input[@type="radio" and not(@checked)]')) == len(RoleType) else: label = RoleType(dr.requester_role).label element = doc.xpath(f'//input[@id = //label[contains(text(), "{label}")]/@for]')[0] assert element.checked is True assert len(doc.xpath('//input[@type="radio" and not(@checked)]')) == ( len(RoleType) - 1 ) class TestRequestDataOwnerOrManager: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:owner-or-manager", kwargs={"pk": dr.pk})) assert resp.status_code == 200 @pytest.mark.parametrize("text", ["", "Mr Blobby"]) def test_page_prefills_existing_data(self, client, text): dr = DataRequestFactory.create(name_of_owner_or_manager=text) resp = client.get(reverse("request-data:owner-or-manager", kwargs={"pk": dr.pk})) doc = html.fromstring(resp.content.decode(resp.charset)) assert doc.xpath('//input[@type="text"]/@value') == [text] class TestRequestDataDescription: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:describe-data", kwargs={"pk": dr.pk})) assert resp.status_code == 200 @pytest.mark.parametrize("text", ["", "this is a description of the data"]) def test_page_prefills_existing_data(self, client, text): dr = DataRequestFactory.create(data_description=text) resp = client.get(reverse("request-data:describe-data", kwargs={"pk": dr.pk})) doc = html.fromstring(resp.content.decode(resp.charset)) textareas = doc.xpath("//textarea") assert len(textareas) == 1 textarea = textareas[0] assert textarea.value == text class TestRequestDataPurpose: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:purpose-of-data", kwargs={"pk": dr.pk})) assert resp.status_code == 200 @pytest.mark.parametrize("text", ["", "to make a wonderful dashboard"]) def test_page_prefills_existing_data(self, client, text): dr = DataRequestFactory.create(data_purpose=text) resp = client.get(reverse("request-data:purpose-of-data", kwargs={"pk": dr.pk})) doc = html.fromstring(resp.content.decode(resp.charset)) textareas = doc.xpath("//textarea") assert len(textareas) == 1 textarea = textareas[0] assert textarea.value == text class TestRequestDataLocation: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:location-of-data", kwargs={"pk": dr.pk})) assert resp.status_code == 200 @pytest.mark.parametrize("text", ["", "in this very easy to access API"]) def test_page_prefills_existing_data(self, client, text): dr = DataRequestFactory.create(data_location=text) resp = client.get(reverse("request-data:location-of-data", kwargs={"pk": dr.pk})) doc = html.fromstring(resp.content.decode(resp.charset)) textareas = doc.xpath("//textarea") assert len(textareas) == 1 textarea = textareas[0] assert textarea.value == text class TestRequestDataSecurityClassification: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:security-classification", kwargs={"pk": dr.pk})) assert resp.status_code == 200 @pytest.mark.parametrize("security_classification", ["", *SecurityClassificationType.values]) def test_page_prefills_existing_data(self, client, security_classification): dr = DataRequestFactory.create(security_classification=security_classification) resp = client.get(reverse("request-data:security-classification", kwargs={"pk": dr.pk})) doc = html.fromstring(resp.content.decode(resp.charset)) if security_classification == "": assert len(doc.xpath('//input[@type="radio" and not(@checked)]')) == len( SecurityClassificationType ) else: label = SecurityClassificationType(dr.security_classification).label element = doc.xpath(f'//input[@id = //label[contains(text(), "{label}")]/@for]')[0] assert element.checked is True assert len(doc.xpath('//input[@type="radio" and not(@checked)]')) == ( len(SecurityClassificationType) - 1 ) class TestRequestDataCheckAnswers: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:check-answers", kwargs={"pk": dr.pk})) assert resp.status_code == 200 def test_page_prefills_existing_data_for_iam_without_alternative_name(self, client): dr = DataRequestFactory.create(requester_role=RoleType.IAM) resp = client.get(reverse("request-data:check-answers", kwargs={"pk": dr.pk})) body = resp.content.decode(resp.charset) assert dr.get_requester_role_display() in body assert dr.name_of_owner_or_manager not in body assert dr.data_description in body assert dr.data_purpose in body assert dr.data_location in body assert dr.get_security_classification_display() in body def test_page_prefills_existing_data_for_someone_else_with_alternative_name(self, client): dr = DataRequestFactory.create(requester_role=RoleType.other) resp = client.get(reverse("request-data:check-answers", kwargs={"pk": dr.pk})) body = resp.content.decode(resp.charset) assert dr.get_requester_role_display() in body assert dr.name_of_owner_or_manager in body assert dr.data_description in body assert dr.data_purpose in body assert dr.data_location in body assert dr.get_security_classification_display() in body @pytest.mark.parametrize( "expected_status_code, field, value", ( (400, "requester_role", "not-a-choice"), (400, "data_description", ""), (400, "data_purpose", ""), (302, "data_location", ""), # field can be blank (400, "security_classification", ""), (302, "name_of_owner_or_manager", ""), # field can be blank ), ) @mock.patch("dataworkspace.apps.request_data.views.create_support_request") def test_submitting_answers_fails_on_invalid_data( self, create_support_request_mock, client, expected_status_code, field, value ): dr = DataRequestFactory.create(**{field: value}, status=DataRequestStatus.draft) create_support_request_mock.return_value = 1234 resp = client.post(reverse("request-data:check-answers", kwargs={"pk": dr.pk})) assert resp.status_code == expected_status_code @mock.patch("dataworkspace.apps.request_data.views.create_support_request") def test_submitting_data_request_that_has_been_submitted_does_not_create_new_zendesk_ticket( self, create_support_request_mock, client ): dr = DataRequestFactory.create(status=DataRequestStatus.submitted) create_support_request_mock.side_effect = Exception("should not be called") resp = client.post(reverse("request-data:check-answers", kwargs={"pk": dr.pk})) assert resp.status_code == 302 assert resp.url == reverse("request-data:confirmation-page", kwargs={"pk": dr.pk}) assert create_support_request_mock.call_count == 0 @mock.patch("dataworkspace.apps.request_data.views.create_support_request") def test_submitting_valid_data_request_logs_support_ticket( self, create_support_request_mock, client ): dr = DataRequestFactory.create(status=DataRequestStatus.draft) create_support_request_mock.return_value = 123456789 resp = client.post(reverse("request-data:check-answers", kwargs={"pk": dr.pk})) assert resp.status_code == 302 assert resp.url == reverse("request-data:confirmation-page", kwargs={"pk": dr.pk}) assert create_support_request_mock.call_count == 1 class TestRequestDataConfirmationPage: def test_page_available(self, client): dr = DataRequestFactory.create() resp = client.get(reverse("request-data:confirmation-page", kwargs={"pk": dr.pk})) assert resp.status_code == 200 def test_shows_zendesk_ticket_id(self, client): dr = DataRequestFactory.create(zendesk_ticket_id="123456789-IM-A-REFERENCE-987654321") resp = client.get(reverse("request-data:confirmation-page", kwargs={"pk": dr.pk})) assert resp.status_code == 200 assert "123456789-IM-A-REFERENCE-987654321" in resp.content.decode(resp.charset)
41.742972
97
0.676159
1,232
10,394
5.529221
0.137175
0.048444
0.06606
0.038755
0.772754
0.734733
0.717264
0.704492
0.686729
0.65781
0
0.014401
0.198287
10,394
248
98
41.91129
0.803072
0.00356
0
0.536842
0
0
0.156654
0.110392
0
0
0
0
0.247368
1
0.115789
false
0
0.031579
0
0.194737
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
da36733db1180c1b8735a060e6a8e7aac744686c
156
py
Python
states/weather.py
DavidRomanovizc/weatherbot
ed4c2ae1b3b33a0e7438472e01158ead6e1f062e
[ "Apache-2.0" ]
1
2021-08-12T17:53:30.000Z
2021-08-12T17:53:30.000Z
states/weather.py
DavidRomanovizc/weatherbot
ed4c2ae1b3b33a0e7438472e01158ead6e1f062e
[ "Apache-2.0" ]
null
null
null
states/weather.py
DavidRomanovizc/weatherbot
ed4c2ae1b3b33a0e7438472e01158ead6e1f062e
[ "Apache-2.0" ]
null
null
null
from aiogram.dispatcher.filters.state import State, StatesGroup class WeatherFlow(StatesGroup): getting_location = State() gpc_location = State()
22.285714
63
0.769231
17
156
6.941176
0.705882
0.220339
0
0
0
0
0
0
0
0
0
0
0.147436
156
6
64
26
0.887218
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
da39027eed5624f59910d84f2841de63740d7483
88
py
Python
src/Structure/Supports/MatrixErrors/SizeError.py
bochkovoi/AHP
b51dc598f8f7a65a2ade039d887dccfa6d070f1e
[ "MIT" ]
null
null
null
src/Structure/Supports/MatrixErrors/SizeError.py
bochkovoi/AHP
b51dc598f8f7a65a2ade039d887dccfa6d070f1e
[ "MIT" ]
null
null
null
src/Structure/Supports/MatrixErrors/SizeError.py
bochkovoi/AHP
b51dc598f8f7a65a2ade039d887dccfa6d070f1e
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- class SizeError( Exception ): pass
14.666667
29
0.602273
11
88
4.818182
1
0
0
0
0
0
0
0
0
0
0
0.028571
0.204545
88
5
30
17.6
0.728571
0.488636
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
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
da3d02a5d72fb87b496a3c7dc91a5892c0cc47ad
75
py
Python
makahiki/apps/widgets/help/__init__.py
justinslee/Wai-Not-Makahiki
4b7dd685012ec64758affe0ecee3103596d16aa7
[ "MIT" ]
1
2015-07-22T11:31:20.000Z
2015-07-22T11:31:20.000Z
makahiki/apps/widgets/help/__init__.py
justinslee/Wai-Not-Makahiki
4b7dd685012ec64758affe0ecee3103596d16aa7
[ "MIT" ]
null
null
null
makahiki/apps/widgets/help/__init__.py
justinslee/Wai-Not-Makahiki
4b7dd685012ec64758affe0ecee3103596d16aa7
[ "MIT" ]
null
null
null
"""A set of widgets for storage, retrieval, and display of help topics."""
37.5
74
0.72
12
75
4.5
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.16
75
1
75
75
0.857143
0.906667
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
da483e6ba46c6c2b591f8319a8cdbdf744c2c249
27
py
Python
test/integration/StringFormat/one input.py
HighSchoolHacking/GLS-Draft
9e418b6290e7c8e3f2da87668784bdba1cde5a76
[ "MIT" ]
30
2019-10-29T12:47:50.000Z
2022-02-12T06:41:39.000Z
test/integration/StringFormat/one input.py
HighSchoolHacking/GLS-Draft
9e418b6290e7c8e3f2da87668784bdba1cde5a76
[ "MIT" ]
247
2017-09-21T17:11:18.000Z
2019-10-08T12:59:07.000Z
test/integration/StringFormat/one input.py
HighSchoolHacking/GLS-Draft
9e418b6290e7c8e3f2da87668784bdba1cde5a76
[ "MIT" ]
17
2017-10-01T16:53:20.000Z
2018-11-28T07:20:35.000Z
# "Foo: {0}".format(foo) #
6.75
22
0.481481
4
27
3.25
0.75
0
0
0
0
0
0
0
0
0
0
0.043478
0.148148
27
3
23
9
0.521739
0
0
0
0
0
0.32
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
da7a9c4261498869209ec6b7a99a05b5d076e06d
276
py
Python
flask_cf_framework/examples/user.py
bgodii/flask-cf-framework
7a3754cff2acdeae29cf80f95a6167a8eb44fd43
[ "MIT" ]
1
2020-10-08T20:00:47.000Z
2020-10-08T20:00:47.000Z
flask_cf_framework/examples/user.py
bgodii/flask-cf-framework
7a3754cff2acdeae29cf80f95a6167a8eb44fd43
[ "MIT" ]
null
null
null
flask_cf_framework/examples/user.py
bgodii/flask-cf-framework
7a3754cff2acdeae29cf80f95a6167a8eb44fd43
[ "MIT" ]
4
2020-10-01T14:01:10.000Z
2020-10-20T14:56:51.000Z
from endpoint import Endpoint class User(Endpoint): def __init__(self, request): super().__init__(request) def get(self): return 'User -> GET' def delete(self): return 'User -> DELETE' def post(self): return 'User -> POST'
17.25
33
0.586957
32
276
4.8125
0.4375
0.194805
0.272727
0
0
0
0
0
0
0
0
0
0.293478
276
15
34
18.4
0.789744
0
0
0
0
0
0.134058
0
0
0
0
0
0
1
0.4
false
0
0.1
0.3
0.9
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
da92623535c8dee5d97f9d2f550c8342e75798c5
257
py
Python
boost/libs/python/pyste/install/pyste.py
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
[ "BSD-3-Clause" ]
18
2016-03-04T15:44:24.000Z
2021-12-31T11:06:25.000Z
boost/libs/python/pyste/install/pyste.py
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
[ "BSD-3-Clause" ]
49
2016-02-29T17:59:52.000Z
2019-05-05T04:59:26.000Z
boost/libs/python/pyste/install/pyste.py
randolphwong/mcsema
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
[ "BSD-3-Clause" ]
9
2015-09-09T02:38:32.000Z
2021-01-30T00:24:24.000Z
#!/usr/bin/env python # Copyright Bruno da Silva de Oliveira 2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from Pyste import pyste pyste.main()
28.555556
72
0.766537
44
257
4.386364
0.772727
0.031088
0.093264
0.124352
0
0
0
0
0
0
0
0.045045
0.136187
257
8
73
32.125
0.824324
0.817121
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
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
1
0
0
0
0
4
e555e54878382352d70547629d452b42a778304e
205
py
Python
Traits/manual/temp_wildcard.py
marshallmcdonnell/interactive_plotting
35e9a781fa1a7328679794d27e24e194e35c012b
[ "MIT" ]
null
null
null
Traits/manual/temp_wildcard.py
marshallmcdonnell/interactive_plotting
35e9a781fa1a7328679794d27e24e194e35c012b
[ "MIT" ]
null
null
null
Traits/manual/temp_wildcard.py
marshallmcdonnell/interactive_plotting
35e9a781fa1a7328679794d27e24e194e35c012b
[ "MIT" ]
null
null
null
#!/usr/bin/env python # temp_wildcard.py --- Example of using a wildcard with a Trait # attribute name from traits.api import Any, HasTraits class Person(HasTraits): temp_ = Any
22.777778
63
0.658537
28
205
4.75
0.821429
0
0
0
0
0
0
0
0
0
0
0
0.258537
205
8
64
25.625
0.875
0.57561
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e59e211617784533c3c42a48976c4d2164387711
234
py
Python
quiz_bot/quiz/checkers/types.py
livestreamx/quiz-bot
e08e9161d908ce9cb851cd6c689f04703db1928f
[ "MIT" ]
1
2022-03-05T13:42:08.000Z
2022-03-05T13:42:08.000Z
quiz_bot/quiz/checkers/types.py
livestreamx/quiz-bot
e08e9161d908ce9cb851cd6c689f04703db1928f
[ "MIT" ]
null
null
null
quiz_bot/quiz/checkers/types.py
livestreamx/quiz-bot
e08e9161d908ce9cb851cd6c689f04703db1928f
[ "MIT" ]
2
2021-06-20T10:40:25.000Z
2022-02-15T04:26:58.000Z
from typing import Union from quiz_bot.quiz.checkers.regular_checker import RegularResultChecker from quiz_bot.quiz.checkers.story_checker import StoryResultChecker AnyResultChecker = Union[RegularResultChecker, StoryResultChecker]
33.428571
71
0.880342
26
234
7.769231
0.5
0.079208
0.108911
0.148515
0.227723
0
0
0
0
0
0
0
0.076923
234
6
72
39
0.935185
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e5a5ec0fff36106ae05a319199690c5f2f37ebca
189
py
Python
python/testData/quickFixes/PyAddCallSuperQuickFixTest/kwargs.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/quickFixes/PyAddCallSuperQuickFixTest/kwargs.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/quickFixes/PyAddCallSuperQuickFixTest/kwargs.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
class A(object): def __init__(self): pass class B(A): def <warning descr="Call to __init__ of super class is missed">__in<caret>it__</warning>(self, **kwargs): pass
27
109
0.640212
28
189
3.892857
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.227513
189
7
110
27
0.746575
0
0
0.333333
0
0
0.215789
0
0
0
0
0
0
0
null
null
0.333333
0
null
null
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
1
0
0
1
0
0
0
0
0
4
e5f2d065fea0421b9deff6af82d929a99088e79e
207
py
Python
networktables/entry.py
TheTripleV/pynetworktables
07c0b51949ff497cfed0c588c7bd5825f9dc3d56
[ "BSD-3-Clause" ]
56
2015-01-05T00:59:55.000Z
2022-03-30T22:40:09.000Z
networktables/entry.py
TheTripleV/pynetworktables
07c0b51949ff497cfed0c588c7bd5825f9dc3d56
[ "BSD-3-Clause" ]
71
2015-01-17T23:17:03.000Z
2021-12-28T18:44:44.000Z
networktables/entry.py
TheTripleV/pynetworktables
07c0b51949ff497cfed0c588c7bd5825f9dc3d56
[ "BSD-3-Clause" ]
36
2015-01-26T15:00:04.000Z
2022-03-02T23:02:22.000Z
import warnings from . import NetworkTableEntry # noqa warnings.warn( "networktables.entry is deprecated, import networktables.NetworkTableEntry directly", DeprecationWarning, stacklevel=2, )
20.7
89
0.772947
19
207
8.421053
0.736842
0
0
0
0
0
0
0
0
0
0
0.005747
0.15942
207
9
90
23
0.913793
0.019324
0
0
0
0
0.40796
0.154229
0
0
0
0
0
1
0
true
0
0.428571
0
0.428571
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f91820511d2b57682c6577817515a2d70dd44ff5
974
py
Python
tests/test_broker_id_generator.py
zalando-nakadi/bubuku
5738cc9309ed46e86fcad41b6fb580ddd69af8fd
[ "MIT" ]
32
2017-10-17T09:59:46.000Z
2022-01-23T11:39:31.000Z
tests/test_broker_id_generator.py
zalando-nakadi/bubuku
5738cc9309ed46e86fcad41b6fb580ddd69af8fd
[ "MIT" ]
91
2017-07-13T15:43:15.000Z
2022-02-21T13:06:35.000Z
tests/test_broker_id_generator.py
zalando-nakadi/bubuku
5738cc9309ed46e86fcad41b6fb580ddd69af8fd
[ "MIT" ]
3
2018-04-19T13:13:00.000Z
2018-09-11T05:59:38.000Z
import unittest from bubuku.id_extractor import _search_broker_id class TestBrokerIdExtractor(unittest.TestCase): def test_match_valid(self): assert '123534' == _search_broker_id(['broker.id=123534']) assert '123534' == _search_broker_id(['\tbroker.id=123534']) assert '123534' == _search_broker_id(['\tbroker.id=123534\n']) assert '123534' == _search_broker_id(['broker.id=123534 \n\r']) assert '123534' == _search_broker_id(['\tbroker.id=123534 \r']) assert '123534' == _search_broker_id(['xbroker.id=1', 'broker.id=123534']) assert '123534' == _search_broker_id(['broker.id=123534', 'boker.id=123534']) def test_match_invalid(self): assert _search_broker_id([]) is None assert _search_broker_id(['broker_id=123534']) is None assert _search_broker_id(['xbroker.id=1', 'broker.id=12f3534']) is None assert _search_broker_id(['bruker.id=123534', 'boker.id=123534']) is None
46.380952
85
0.680698
129
974
4.813953
0.224806
0.231884
0.270531
0.270531
0.706924
0.652174
0.504026
0.504026
0.144928
0.144928
0
0.142857
0.166324
974
20
86
48.7
0.621921
0
0
0
0
0
0.280287
0
0
0
0
0
0.6875
1
0.125
false
0
0.125
0
0.3125
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
0073df81451bc14b84877c19d427a510ab65deb3
355
py
Python
Dataset/Leetcode/train/3/636.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/3/636.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/3/636.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
class Solution: def XXX(self, s: str) -> int: max_len = 0 curr_str = "" for char_ in s: if char_ not in curr_str: curr_str += char_ max_len = max(max_len, len(curr_str)) else: curr_str = curr_str[curr_str.index(char_)+1:] + char_ return max_len
27.307692
69
0.492958
48
355
3.3125
0.4375
0.308176
0.207547
0.264151
0
0
0
0
0
0
0
0.009662
0.416901
355
12
70
29.583333
0.758454
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
0
0
4
00879d8709de75bc4a87e226cde7af5dc449f8ee
59
py
Python
src/masonite/stubs/events/Listener.py
cercos/masonite
f7f220efa7fae833683e9f07ce13c3795a87d3b8
[ "MIT" ]
1,816
2018-02-14T01:59:51.000Z
2022-03-31T17:09:20.000Z
src/masonite/stubs/events/Listener.py
cercos/masonite
f7f220efa7fae833683e9f07ce13c3795a87d3b8
[ "MIT" ]
340
2018-02-11T00:27:26.000Z
2022-03-21T12:00:24.000Z
src/masonite/stubs/events/Listener.py
cercos/masonite
f7f220efa7fae833683e9f07ce13c3795a87d3b8
[ "MIT" ]
144
2018-03-18T00:08:16.000Z
2022-02-26T01:51:58.000Z
class __class__: def handle(self, event): pass
14.75
28
0.610169
7
59
4.571429
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.305085
59
3
29
19.666667
0.780488
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
0095f632bc3875440ae6ede1e6a1975c7140e699
75
py
Python
lambda/lambda-2/app.py
aveek22/terraform-aws-learning
7484d2f6afba4baa994c436e2b4250dcd8d62f3f
[ "MIT" ]
null
null
null
lambda/lambda-2/app.py
aveek22/terraform-aws-learning
7484d2f6afba4baa994c436e2b4250dcd8d62f3f
[ "MIT" ]
null
null
null
lambda/lambda-2/app.py
aveek22/terraform-aws-learning
7484d2f6afba4baa994c436e2b4250dcd8d62f3f
[ "MIT" ]
null
null
null
def main(event, context): print(f'This is from Lambda 2nd function.')
18.75
47
0.693333
12
75
4.333333
1
0
0
0
0
0
0
0
0
0
0
0.016393
0.186667
75
4
47
18.75
0.836066
0
0
0
0
0
0.445946
0
0
0
0
0
0
1
0.5
false
0
0
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
4
00ae4d146a0e32b34c07a550265d83d1442db0fd
108
py
Python
baseline/deep_ed_PyTorch/deep_ed_PyTorch/words/w_freq/__init__.py
yifding/e2e_EL_evaluate
48e12a93c98daf99bb560efcc267749247f590ba
[ "MIT" ]
5
2021-11-30T02:19:52.000Z
2021-12-10T14:38:17.000Z
baseline/deep_ed_PyTorch/deep_ed_PyTorch/words/w_freq/__init__.py
yifding/e2e_EL_evaluate
48e12a93c98daf99bb560efcc267749247f590ba
[ "MIT" ]
1
2021-11-15T02:18:41.000Z
2021-12-01T13:36:26.000Z
baseline/deep_ed_PyTorch/deep_ed_PyTorch/words/w_freq/__init__.py
yifding/e2e_EL_evaluate
48e12a93c98daf99bb560efcc267749247f590ba
[ "MIT" ]
null
null
null
from .w_freq_gen import WFreqGen from .w_freq_index import WFreq __all__ = [ 'WFreqGen', 'WFreq', ]
15.428571
32
0.694444
15
108
4.466667
0.6
0.149254
0.268657
0
0
0
0
0
0
0
0
0
0.203704
108
7
33
15.428571
0.77907
0
0
0
0
0
0.119266
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
00bce8893a27fc84d848026abae0510480971801
258
py
Python
Examples_Topics/Topic_1_Programming_Basics/example_01_print_message.py
souzafcharles/Introduction-to-the-Python-Language
9b0efddc14e887aa8ed2f98ea47835106db27cc0
[ "MIT" ]
null
null
null
Examples_Topics/Topic_1_Programming_Basics/example_01_print_message.py
souzafcharles/Introduction-to-the-Python-Language
9b0efddc14e887aa8ed2f98ea47835106db27cc0
[ "MIT" ]
null
null
null
Examples_Topics/Topic_1_Programming_Basics/example_01_print_message.py
souzafcharles/Introduction-to-the-Python-Language
9b0efddc14e887aa8ed2f98ea47835106db27cc0
[ "MIT" ]
null
null
null
# Course title: Udemy Course: Introduction to the Python Language # Instructor: Prof. Dr. Diego Mariano # Example adapted by: Charles Fernandes de Souza # Date: July 10, 2021 # Print Message print("Hello, World!") print("Running Google Colab with Python")
25.8
65
0.751938
36
258
5.388889
0.888889
0
0
0
0
0
0
0
0
0
0
0.02765
0.158915
258
9
66
28.666667
0.866359
0.697674
0
0
0
0
0.625
0
0
0
0
0
0
1
0
true
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
00cb6249d8ab18ec7b8d555ac350943654acbd5d
123
py
Python
src/model/exception/not_in_voice_chat.py
konrad2508/kokomi-discord-bot
5a9d459e92d552fa24ba3ada5188db19d93f0aaa
[ "MIT" ]
2
2022-03-02T15:56:41.000Z
2022-03-10T16:30:41.000Z
src/model/exception/not_in_voice_chat.py
konrad2508/kokomi-discord-bot
5a9d459e92d552fa24ba3ada5188db19d93f0aaa
[ "MIT" ]
2
2022-03-10T16:30:20.000Z
2022-03-16T14:33:59.000Z
src/model/exception/not_in_voice_chat.py
konrad2508/kokomi-discord-bot
5a9d459e92d552fa24ba3ada5188db19d93f0aaa
[ "MIT" ]
null
null
null
class NotInVoiceChat(Exception): '''Exception stating that the user invoking the command is not in a voice channel.'''
41
89
0.756098
17
123
5.470588
0.882353
0
0
0
0
0
0
0
0
0
0
0
0.162602
123
2
90
61.5
0.902913
0.642276
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
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
0
0
1
0
0
4
daa4f6309485ebb5eb1286797c97b66040c16645
499
py
Python
python/CV_ex004.py
FaunoGuazina/X_very_old_algorithm_exercises
c9b9ec78e8b82f2e23ef85ba9a5e7fd6e0deaea6
[ "MIT" ]
null
null
null
python/CV_ex004.py
FaunoGuazina/X_very_old_algorithm_exercises
c9b9ec78e8b82f2e23ef85ba9a5e7fd6e0deaea6
[ "MIT" ]
null
null
null
python/CV_ex004.py
FaunoGuazina/X_very_old_algorithm_exercises
c9b9ec78e8b82f2e23ef85ba9a5e7fd6e0deaea6
[ "MIT" ]
null
null
null
x = input('escriu alguna cosa: ') print('el tipus primitiu d’aquest valor és', type(x)) print('el que heu escrit només té espais?', x.isspace()) print('el que heu escrit és numèric?', x.isnumeric()) print('el que heu escrit és alfabètic?', x.isalpha()) print('el que heu escrit és alfanumèric?', x.isalnum()) print('és el que heu escrit amb majúscules?', x.isupper()) print('és el que heu escrit amb minúscules?', x.islower()) print('el que heu escrit amb la primera lletra majúscula?', x.istitle())
55.444444
72
0.711423
84
499
4.22619
0.440476
0.098592
0.157746
0.276056
0.428169
0.312676
0.135211
0
0
0
0
0
0.134269
499
9
72
55.444444
0.821759
0
0
0
0
0
0.608
0
0
0
0
0
0
1
0
false
0
0
0
0
0.888889
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
dab293923d4eaca82232116278e705a987b76ee0
219
py
Python
wsgi.py
IIC2173-2018-2-G1/hashtag-service
a1fad7fb4313b3413f02b7f1d4b1e74621994998
[ "MIT" ]
null
null
null
wsgi.py
IIC2173-2018-2-G1/hashtag-service
a1fad7fb4313b3413f02b7f1d4b1e74621994998
[ "MIT" ]
null
null
null
wsgi.py
IIC2173-2018-2-G1/hashtag-service
a1fad7fb4313b3413f02b7f1d4b1e74621994998
[ "MIT" ]
null
null
null
from src.main import app import os if __name__ == "__main__": app.run( host=os.environ.get("HOST", "0.0.0.0"), port=os.environ.get("PORT", 5000), debug=os.environ.get("DEBUG", False), )
21.9
47
0.579909
33
219
3.606061
0.515152
0.226891
0.302521
0
0
0
0
0
0
0
0
0.047619
0.232877
219
9
48
24.333333
0.660714
0
0
0
0
0
0.127854
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
daebdf2d46c8c3733591abf30a48f4ed72027239
119
py
Python
datatypes/list_sorting.py
janbodnar/Python-Course
51705ab5a2adef52bcdb99a800e94c0d67144a38
[ "BSD-2-Clause" ]
13
2017-08-22T12:26:07.000Z
2021-07-29T16:13:50.000Z
datatypes/list_sorting.py
janbodnar/Python-Course
51705ab5a2adef52bcdb99a800e94c0d67144a38
[ "BSD-2-Clause" ]
1
2021-02-08T10:24:33.000Z
2021-02-08T10:24:33.000Z
datatypes/list_sorting.py
janbodnar/Python-Course
51705ab5a2adef52bcdb99a800e94c0d67144a38
[ "BSD-2-Clause" ]
17
2018-08-13T11:10:33.000Z
2021-07-29T16:14:02.000Z
#!/usr/bin/python # list_sorting.py numbers = [4, 3, 6, 1, 2, 0, 5 ] print (numbers) numbers.sort() print (numbers)
11.9
32
0.630252
20
119
3.7
0.8
0.324324
0
0
0
0
0
0
0
0
0
0.071429
0.176471
119
9
33
13.222222
0.683673
0.268908
0
0.5
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
9752bf8db622f11a0232cfe47ccab3752be23e8a
457
py
Python
query/plans/tpch3cfg.py
cakebytheoceanLuo/dogqc
163618becdb57bd952a1ac5ba346d3c7ec163e04
[ "MIT" ]
12
2020-02-08T10:41:50.000Z
2022-02-25T13:21:52.000Z
query/plans/tpch3cfg.py
cakebytheoceanLuo/dogqc
163618becdb57bd952a1ac5ba346d3c7ec163e04
[ "MIT" ]
62
2021-12-02T03:08:20.000Z
2022-03-31T14:05:58.000Z
query/plans/tpch3cfg.py
cakebytheoceanLuo/dogqc
163618becdb57bd952a1ac5ba346d3c7ec163e04
[ "MIT" ]
4
2020-03-15T03:34:10.000Z
2022-03-18T07:51:37.000Z
{ 2 : { "operator" : "selection", "selectivity" : 0.2 }, 4 : { "operator" : "selection", "selectivity" : 0.5 }, 5 : { "operator" : "join", "selectivity" : 0.19, "multimatch" : False }, 7 : { "operator" : "selection", "selectivity" : 0.5 }, 8 : { "operator" : "join", "selectivity" : 0.05, "multimatch" : False } }
18.28
34
0.387309
34
457
5.205882
0.411765
0.338983
0.474576
0.491525
0.338983
0
0
0
0
0
0
0.066406
0.439825
457
24
35
19.041667
0.625
0
0
0.375
0
0
0.328228
0
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
97615d2077138ea4034e0637375b6f808c743a49
288
py
Python
UNetGAN/main.py
gcinbis/deep-generative-models-spring20
d377bd63d5e79539477cca47c71462e5cc12adfa
[ "MIT" ]
18
2020-07-06T10:47:26.000Z
2021-05-30T11:43:17.000Z
UNetGAN/main.py
gcinbis/deep-generative-models-course-projects
d377bd63d5e79539477cca47c71462e5cc12adfa
[ "MIT" ]
1
2022-03-12T00:39:12.000Z
2022-03-12T00:39:12.000Z
UNetGAN/main.py
gcinbis/deep-generative-models-spring20
d377bd63d5e79539477cca47c71462e5cc12adfa
[ "MIT" ]
2
2020-07-13T20:46:44.000Z
2020-10-01T13:15:25.000Z
from unetgan.train_big import train_ubiggan from unetgan.test_model import test_model from unetgan.test_single import test_single if __name__ == "__main__": # Only for 100k iters train_ubiggan(train_path=".", latent_dim=140, num_epochs=80) # test_model() # test_single()
28.8
64
0.756944
42
288
4.714286
0.547619
0.166667
0.151515
0
0
0
0
0
0
0
0
0.032922
0.15625
288
9
65
32
0.781893
0.159722
0
0
0
0
0.037815
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
97ad711b7486c372e94988220f22804a6022e545
24
py
Python
cornell/_version.py
DavidMeu/cornell
329f16adb83276b829eed835ca72f5f05b9cc73c
[ "MIT" ]
null
null
null
cornell/_version.py
DavidMeu/cornell
329f16adb83276b829eed835ca72f5f05b9cc73c
[ "MIT" ]
null
null
null
cornell/_version.py
DavidMeu/cornell
329f16adb83276b829eed835ca72f5f05b9cc73c
[ "MIT" ]
null
null
null
__version__ = (1, 0, 4)
12
23
0.583333
4
24
2.5
1
0
0
0
0
0
0
0
0
0
0
0.157895
0.208333
24
1
24
24
0.368421
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
97ba1bdeb2fffadb295b5640012aabc4eb766b16
251
py
Python
lavaplayer/routes.py
HazemMeqdad/lavaplayer
e475ca1f94d6d500a975e3797e9037702612f89e
[ "MIT" ]
18
2021-12-25T21:03:01.000Z
2022-03-25T08:42:55.000Z
lavaplayer/routes.py
HazemMeqdad/lavaplayer
e475ca1f94d6d500a975e3797e9037702612f89e
[ "MIT" ]
13
2022-01-02T22:03:36.000Z
2022-03-29T14:57:58.000Z
lavaplayer/routes.py
HazemMeqdad/lavaplayer
e475ca1f94d6d500a975e3797e9037702612f89e
[ "MIT" ]
7
2022-01-02T21:31:34.000Z
2022-02-19T12:31:51.000Z
LOADTRACKS = "/loadtracks?identifier={query}" DECODETRACK = "/decodetrack" DECODETRACKS = "/decodetracks" ROUTEPLANNER = "/routeplanner/status" UNMARK_FAILED_ADDRESS = "/routeplanner/free/address" UNMARK_ALL_FAILED_ADDRESS = "/routeplanner/free/all"
31.375
52
0.792829
24
251
8.083333
0.5
0.134021
0.257732
0.298969
0
0
0
0
0
0
0
0
0.075697
251
7
53
35.857143
0.836207
0
0
0
0
0
0.492
0.312
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
97c9403a99c468fd641898a3a548cd19eb8c5478
60
py
Python
front-end/python/read_files.py
chuducthang77/Summer_code
48e0b507c8b4eebcb1eb641b11db8c0eced46c7d
[ "MIT" ]
1
2021-05-17T11:50:20.000Z
2021-05-17T11:50:20.000Z
front-end/python/read_files.py
chuducthang77/Summer_code
48e0b507c8b4eebcb1eb641b11db8c0eced46c7d
[ "MIT" ]
null
null
null
front-end/python/read_files.py
chuducthang77/Summer_code
48e0b507c8b4eebcb1eb641b11db8c0eced46c7d
[ "MIT" ]
null
null
null
with open('test1.txt', 'r') as file: print(file.read())
20
36
0.6
10
60
3.6
0.9
0
0
0
0
0
0
0
0
0
0
0.02
0.166667
60
2
37
30
0.7
0
0
0
0
0
0.166667
0
0
0
0
0
0
1
0
true
0
0
0
0
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
0
0
0
1
0
4
97d0d71dd7b893a9e7531fd6dad4618abb35a802
261
py
Python
modules/_boot_extra.py
nexus166/micropython-esp
533d5cf1ba4c99e64621a8e3b1805598e66a61f0
[ "MIT" ]
null
null
null
modules/_boot_extra.py
nexus166/micropython-esp
533d5cf1ba4c99e64621a8e3b1805598e66a61f0
[ "MIT" ]
null
null
null
modules/_boot_extra.py
nexus166/micropython-esp
533d5cf1ba4c99e64621a8e3b1805598e66a61f0
[ "MIT" ]
null
null
null
""" This file is injected in _boot.py during the build meaning whatever is defined here will run right after the normal _boot.py generated by MicroPython make, and you do not need to define a main.py at all """ from time import sleep, sleep_ms print("hi")
20.076923
77
0.754789
47
261
4.12766
0.87234
0.061856
0
0
0
0
0
0
0
0
0
0
0.187739
261
12
78
21.75
0.915094
0.773946
0
0
1
0
0.040816
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
4
8af68468e3476aacee72d438b2c6eb9fe2ba50d5
196
py
Python
neoOkpara/Phase-1/Day4/specifiedValue.py
nkem1010/python-challenge-solutions
203cedc691094a83b110fc75764aac51dbbc1a03
[ "MIT" ]
null
null
null
neoOkpara/Phase-1/Day4/specifiedValue.py
nkem1010/python-challenge-solutions
203cedc691094a83b110fc75764aac51dbbc1a03
[ "MIT" ]
null
null
null
neoOkpara/Phase-1/Day4/specifiedValue.py
nkem1010/python-challenge-solutions
203cedc691094a83b110fc75764aac51dbbc1a03
[ "MIT" ]
null
null
null
def check_values(group, value): for x in group: if x == value: return True return False print (check_values([34, 56, 77], 22)) print (check_values([34, 56, 77], 34))
19.6
38
0.586735
30
196
3.733333
0.566667
0.294643
0.285714
0.321429
0.392857
0.392857
0
0
0
0
0
0.113475
0.280612
196
9
39
21.777778
0.680851
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0
0
0.428571
0.285714
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8afe54632d23c26aee4bd9a670bfe012c683bf34
43,049
py
Python
app.py
dindamajesty13/web-risk
8ba90ceecf3146049a44df7359ac021de0a3d4ce
[ "MIT" ]
null
null
null
app.py
dindamajesty13/web-risk
8ba90ceecf3146049a44df7359ac021de0a3d4ce
[ "MIT" ]
null
null
null
app.py
dindamajesty13/web-risk
8ba90ceecf3146049a44df7359ac021de0a3d4ce
[ "MIT" ]
null
null
null
from flask import Flask from admin.app_threat import getAppThreat, insertAppThreat, deleteAppThreat from admin.login import getAdmin from admin.vulnerability import getVulnerability, insertVulnerability, deleteVulnerability, updateVulnerability, \ getCountVulnerability from admin.threat import getThreat, insertThreat, deleteThreat, updateThreat, getCountThreat from admin.assets import getAssets, insertAsset, deleteAsset, updateAsset from flask import render_template, request, redirect, url_for, flash, session import hashlib from admin.vulnerability_avg import getVulnerabilityAVG, insertVulnerabilityAVG, deleteVulnerabilityAVG from modules.bobot_aset import getBobotAssets, insertBobotAsset, deleteBobotAsset, updateBobotAsset, getCountData, \ getCountAsset from modules.kozlov import getNilaiKozlov, deleteKozlov, insertKozlov from modules.login import getUsers from modules.saat_usulan import getSaatUsulan, getCountSaatUsulan, insertSaatUsulan, updateSaatUsulan, deleteSaatUsulan from modules.sebelum_usulan import getThreatWeight, getNilaiSebelumUsulan, insertSebelumUsulan, deleteSebelumUsulan from modules.setelah_usulan import getSetelahUsulan, insertSetelahUsulan, deleteSetelahUsulan, updateSetelahUsulan from modules.shareeful import getNilaiShareeful, deleteShareeful, insertShareeful app = Flask(__name__) app.secret_key = 'many random bytes' @app.route('/', methods=['GET', 'POST']) def home(): if request.method == 'POST' and 'username' in request.form and 'password' in request.form: # Create variables for easy access username = request.form['username'] password = request.form['password'] # Check if account exists using MySQL password_hash = hashlib.md5(password.encode()) account = getUsers(username, password_hash.hexdigest()) # If account exists in accounts table in out database if account: # Create session data, we can access this data in other routes session['loggedin'] = True session['username'] = username # Redirect to home page return redirect(url_for('index_bobot_aset')) else: # Account doesnt exist or username/password incorrect msg = 'Incorrect username/password!' # Show the login form with message (if any) return render_template('login_user.html', msg=msg) if request.method == 'GET': if 'loggedin' in session and session['loggedin'] == True: return redirect(url_for('index_bobot_aset')) return render_template('login_user.html') @app.route('/admin/home', methods=['GET', 'POST']) def home_admin(): if 'loggedin_admin' in session: id_app = getAssets() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) final = hitungVulnerability(data_app_threat, data_hitung_avg) average = [] for data in id_app: average.append(final[data[0]]['average']) data_vulnerability_avg = getVulnerabilityAVG() final_data = hitungAVG(data_vulnerability_avg) threat_data = getThreat() threat_avg = [] for data in threat_data: threat_avg.append(final_data[data[0]]['average']) count_asset = getCountAsset() count_threat = getCountThreat() count_vuln = getCountVulnerability() return render_template('home.html', final=average, id_app=id_app, threat_data=threat_data, final_data=threat_avg, count_asset=count_asset[0][0], count_threat=count_threat[0][0], count_vuln=count_vuln[0][0]) return redirect(url_for('login')) @app.route('/bobot_aset') def index_bobot_aset(): if 'loggedin' in session: id_app = getAssets() data_bobot_aset = getBobotAssets() email = session['username'] count_data = getCountData(email) count_asset = getCountAsset() return render_template('bobot_aset.html', data_bobot_aset=data_bobot_aset, id_app=id_app,count_data=count_data[0][0], count_asset=count_asset[0][0]) return redirect(url_for('home')) @app.route('/admin/bobot_aset') def index_calculate_aset(): if 'loggedin_admin' in session: data_bobot_aset = getBobotAssets() return render_template('calculate_aset.html', data_bobot_aset=data_bobot_aset) return redirect(url_for('login')) @app.route('/bobot_aset/insert', methods = ['POST']) def insert_bobot_aset(): if request.method == "POST": flash("Data Inserted Successfully") email = request.form['email'] id_app = request.form['id_app'] criteria_1 = request.form['criteria_1'] criteria_2 = request.form['criteria_2'] criteria_3 = request.form['criteria_3'] insertBobotAsset(email, id_app, criteria_1, criteria_2, criteria_3) return redirect(url_for('index_bobot_aset')) @app.route('/bobot_aset/delete/<string:id_app>', methods = ['GET']) def delete_bobot_aset(id_app): flash("Record Has Been Deleted Successfully") email = 'user@gmail.com' deleteBobotAsset(id_app, email) return redirect(url_for('index_bobot_aset')) @app.route('/bobot_aset/update',methods=['POST','GET']) def update_bobot_aset(): if request.method == 'POST': email = session['username'] id_app = request.form['id_app'] criteria_1 = request.form['criteria_1'] criteria_2 = request.form['criteria_2'] criteria_3 = request.form['criteria_3'] updateBobotAsset(email, id_app, criteria_1, criteria_2, criteria_3) flash("Data Updated Successfully") return redirect(url_for('index_bobot_aset')) @app.route('/admin/login', methods=['GET', 'POST']) def login(): if request.method == 'POST' and 'username' in request.form and 'password' in request.form: # Create variables for easy access username = request.form['username'] password = request.form['password'] # Check if account exists using MySQL password_hash = hashlib.md5(password.encode()) account = getAdmin(username, password_hash.hexdigest()) # If account exists in accounts table in out database if account: # Create session data, we can access this data in other routes session['loggedin_admin'] = True session['admin'] = username # Redirect to home page return redirect(url_for('home_admin')) else: # Account doesnt exist or username/password incorrect msg = 'Incorrect username/password!' # Show the login form with message (if any) return render_template('login.html', msg=msg) if request.method == 'GET': if 'loggedin_admin' in session and session['loggedin_admin'] == True: return redirect(url_for('home_admin')) return render_template('login.html') @app.route('/logout') def logout(): # Remove session data, this will log the user out session.pop('loggedin', None) session.pop('id', None) session.pop('username', None) # Redirect to login page return redirect(url_for('home')) @app.route('/admin/logout') def logout_admin(): # Remove session data, this will log the user out session.pop('loggedin_admin', None) session.pop('id', None) session.pop('admin', None) # Redirect to login page return redirect(url_for('login')) @app.route('/admin/vulnerability') def index(): if 'loggedin_admin' in session: data_vulnerability = getVulnerability() return render_template('vulnerability.html', data_vulnerability=data_vulnerability) return redirect(url_for('login')) @app.route('/admin/vulnerability/insert', methods = ['POST']) def insert(): if request.method == "POST": flash("Data Inserted Successfully") id_vulnerability = request.form['id_vulnerability'] vulnerability_name = request.form['vulnerability_name'] vulnerability_level = request.form['vulnerability_level'] insertVulnerability(id_vulnerability, vulnerability_name, vulnerability_level) return redirect(url_for('index')) @app.route('/admin/vulnerability/delete/<string:id_vulnerability>', methods = ['GET']) def delete(id_vulnerability): flash("Record Has Been Deleted Successfully") deleteVulnerability(id_vulnerability) return redirect(url_for('index')) @app.route('/admin/vulnerability/update',methods=['POST','GET']) def update(): if request.method == 'POST': id_vulnerability = request.form['id_vulnerability'] vulnerability_name = request.form['vulnerability_name'] vulnerability_level = request.form['vulnerability_level'] updateVulnerability(id_vulnerability, vulnerability_name, vulnerability_level) flash("Data Updated Successfully") return redirect(url_for('index')) @app.route('/admin/threat') def index_threat(): if 'loggedin_admin' in session: data_threat = getThreat() return render_template('threat.html', data_threat=data_threat) return redirect(url_for('login')) @app.route('/admin/threat/insert', methods = ['POST']) def insert_threat(): if request.method == "POST": flash("Data Inserted Successfully") id_threat = request.form['id_threat'] threat_type = request.form['threat_type'] threat_weight = request.form['threat_weight'] insertThreat(id_threat, threat_type, threat_weight) return redirect(url_for('index_threat')) @app.route('/admin/threat/delete/<string:id_threat>', methods = ['GET']) def delete_threat(id_threat): flash("Record Has Been Deleted Successfully") deleteThreat(id_threat) return redirect(url_for('index_threat')) @app.route('/admin/threat/update',methods=['POST','GET']) def update_threat(): if request.method == 'POST': id_threat = request.form['id_threat'] threat_type = request.form['threat_type'] threat_weight = request.form['threat_weight'] updateThreat(id_threat, threat_type, threat_weight) flash("Data Updated Successfully") return redirect(url_for('index_threat')) @app.route('/admin/asset') def index_asset(): if 'loggedin_admin' in session: data_asset = getAssets() return render_template('asset.html', data_asset=data_asset) return redirect(url_for('login')) @app.route('/admin/asset/insert', methods = ['POST']) def insert_asset(): if request.method == "POST": flash("Data Inserted Successfully") id_app = request.form['id_app'] application_name = request.form['application_name'] insertAsset(id_app, application_name) return redirect(url_for('index_asset')) @app.route('/admin/asset/delete/<string:id_app>', methods = ['GET']) def delete_asset(id_app): flash("Record Has Been Deleted Successfully") deleteAsset(id_app) return redirect(url_for('index_asset')) @app.route('/admin/asset/update',methods=['POST','GET']) def update_asset(): if request.method == 'POST': id_app = request.form['id_app'] application_name = request.form['application_name'] updateAsset(id_app, application_name) flash("Data Updated Successfully") return redirect(url_for('index_asset')) def hitungAVG(data_vulnerability_avg): unique_id_threat_sum = {} unique_id_threat_avg = {} unique_id_threat_data_len = {} unique_id_threat_id_vuln = {} for data in data_vulnerability_avg: if data[0] in unique_id_threat_sum: id_vuln_temp = unique_id_threat_id_vuln[data[0]] id_vuln_temp.append(data[1]) unique_id_threat_sum[data[0]] += data[5] unique_id_threat_data_len[data[0]] += 1 unique_id_threat_id_vuln[data[0]] = id_vuln_temp else: id_vuln_temp = [] id_vuln_temp.append(data[1]) unique_id_threat_sum[data[0]] = data[5] unique_id_threat_data_len[data[0]] = 1 unique_id_threat_id_vuln[data[0]] = id_vuln_temp for id_threat, id_vuln_list in unique_id_threat_id_vuln.items(): unique_id_threat_id_vuln[id_threat] = ', '.join(id_vuln_list) for id_threat, value in unique_id_threat_sum.items(): unique_id_threat_avg[id_threat] = round(unique_id_threat_sum[id_threat] / unique_id_threat_data_len[id_threat], 1) final_threat_avg_and_id_vuln = {} for id_threat in unique_id_threat_avg: final_threat_avg_and_id_vuln[id_threat] = { 'average': unique_id_threat_avg[id_threat], 'id_vulnerability': unique_id_threat_id_vuln[id_threat] } return final_threat_avg_and_id_vuln @app.route('/admin/vulnerability_avg') def index_vulnerability_avg(): if 'loggedin_admin' in session: data_vulnerability_avg = getVulnerabilityAVG() final_data = hitungAVG(data_vulnerability_avg) threat_data = getThreat() vulnerability_data = getVulnerability() return render_template('vulnerability_avg.html', data_vulnerability_avg=final_data, threat_data=threat_data, vulnerability_data=vulnerability_data) return redirect(url_for('login')) @app.route('/admin/vulnerability_avg/insert', methods = ['POST']) def insert_vulnerability_avg(): if request.method == "POST": flash("Data Inserted Successfully") id_threat = request.form['id_threat'] id_vulnerability = request.form.getlist('id_vulnerability') for i in id_vulnerability: insertVulnerabilityAVG(id_threat, i) return redirect(url_for('index_vulnerability_avg')) @app.route('/admin/vulnerability_avg/update', methods=['POST']) def update_vulnerability_avg(): id_threat = request.form['id_threat'] id_vulnerability = request.form.getlist('id_vulnerability') deleteVulnerabilityAVG(id_threat) for i in id_vulnerability: insertVulnerabilityAVG(id_threat, i) flash("Data Updated Successfully") return redirect(url_for('index_vulnerability_avg')) @app.route('/admin/vulnerability_avg/delete/<string:id_threat>', methods = ['GET']) def delete_vulnerabily_avg(id_threat): flash("Record Has Been Deleted Successfully") deleteVulnerabilityAVG(id_threat) return redirect(url_for('index_vulnerability_avg')) def hitungVulnerability(data_app_threat, data_hitung_avg): data_threat = {} data_id_threat = [] data_value_threat = [] for row in data_hitung_avg: data_id_threat.append(row) data_value_threat.append(data_hitung_avg[row]['average']) data_threat[row] = data_hitung_avg[row]['average'] unique_id_app_id_threat = {} data_sum_threat = {} data_len_threat = {} threat_avg = {} for data in data_app_threat: if data[0] in unique_id_app_id_threat: id_threat_temp = unique_id_app_id_threat[data[0]] id_threat_temp.append(data[1]) unique_id_app_id_threat[data[0]] = id_threat_temp if data[1] in data_id_threat: data_sum_threat[data[0]] += data_threat[data[1]] data_len_threat[data[0]] += 1 else: id_threat_temp = [] id_threat_temp.append(data[1]) unique_id_app_id_threat[data[0]] = id_threat_temp if data[1] in data_id_threat: data_sum_threat[data[0]] = data_threat[data[1]] data_len_threat[data[0]] = 1 for id_app, id_threat_list in unique_id_app_id_threat.items(): unique_id_app_id_threat[id_app] = ', '.join(id_threat_list) for id_app, value in data_sum_threat.items(): threat_avg[id_app] = round(data_sum_threat[id_app] / data_len_threat[id_app], 2) final = {} for id_app in unique_id_app_id_threat: final[id_app] = { 'id_threat': unique_id_app_id_threat[id_app], 'average': threat_avg[id_app] } return final @app.route('/admin/app_threat') def index_app_threat(): if 'loggedin_admin' in session: data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) final = hitungVulnerability(data_app_threat, data_hitung_avg) app_data = getAssets() threat_data = getThreat() return render_template('app_threat.html', data_app_threat = final, threat_data = threat_data, app_data = app_data) return redirect(url_for('login')) @app.route('/admin/app_threat/insert', methods = ['POST']) def insert_app_threat(): if request.method == "POST": flash("Data Inserted Successfully") id_app = request.form['id_app'] id_threat = request.form.getlist('id_threat') for i in id_threat: insertAppThreat(id_app, i) return redirect(url_for('index_app_threat')) @app.route('/admin/app_threat/update', methods=['POST']) def update_app_threat(): id_app = request.form['id_app'] id_threat = request.form.getlist('id_threat') deleteAppThreat(id_app) for i in id_threat: insertAppThreat(id_app, i) flash("Data Updated Successfully") return redirect(url_for('index_app_threat')) @app.route('/admin/app_threat/delete/<string:id_app>', methods = ['GET']) def delete_app_threat(id_app): flash("Record Has Been Deleted Successfully") deleteAppThreat(id_app) return redirect(url_for('index_app_threat')) @app.route('/admin/before_migrating') def index_before_migrating(): data_sebelum_usulan = getNilaiSebelumUsulan() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) vulnerability = hitungVulnerability(data_app_threat, data_hitung_avg) return render_template('before_migrating.html', data_sebelum_usulan=data_sebelum_usulan, vulnerability=vulnerability) @app.route('/sebelum_usulan') def index_sebelum_usulan(): if 'loggedin' in session: data_sebelum_usulan = getNilaiSebelumUsulan() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) vulnerability = hitungVulnerability(data_app_threat, data_hitung_avg) return render_template('sebelum_usulan.html', data_sebelum_usulan = data_sebelum_usulan, vulnerability=vulnerability) return redirect(url_for('home')) @app.route('/sebelum_usulan/insert', methods=['POST']) def insert_sebelum_usulan(): if request.method == "POST": flash("Data Inserted Successfully") email = session['username'] deleteSebelumUsulan(email) final_data = hitungResikoSebelumUsulan() for datas in final_data['data']: for data in datas: email_user = session['username'] th1 = datas[data]['probabilitas_threat']['TH-01'] th2 = datas[data]['probabilitas_threat']['TH-02'] th3 = datas[data]['probabilitas_threat']['TH-03'] th4 = datas[data]['probabilitas_threat']['TH-04'] th5 = datas[data]['probabilitas_threat']['TH-05'] th6 = datas[data]['probabilitas_threat']['TH-06'] th7 = datas[data]['probabilitas_threat']['TH-07'] th8 = datas[data]['probabilitas_threat']['TH-08'] th9 = datas[data]['probabilitas_threat']['TH-09'] th10 = datas[data]['probabilitas_threat']['TH-10'] th11 = datas[data]['probabilitas_threat']['TH-11'] risk_value = datas[data]['hasil_akhir'] id_app = data insertSebelumUsulan(email_user, th1, th2, th3, th4, th5, th6, th7, th8, th9, th10, th11, risk_value, id_app) return redirect(url_for('index_sebelum_usulan')) def hitungResikoSebelumUsulan(): global hasil_akhir threat_weight = getThreatWeight() bobot_aset = getBobotAssets() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) data_app_threat_vulnerability = hitungVulnerability(data_app_threat, data_hitung_avg) data_threat = getThreat() nilai_bobot_aset = {} id_app_bobot_aset = [] data_id_app = {} unique_id_app_sum = {} sum_risk_value = {} for data in bobot_aset: id_app_bobot_aset.append(data[0]) nilai_bobot_aset[data[0]] = data[4] for i in threat_weight: if i[0] in id_app_bobot_aset: sum_th = round(i[2] * nilai_bobot_aset[i[0]] / 100, 2) if i[0] in data_id_app: id_app_temp = data_id_app[i[0]] id_app_temp.append(i[1]) data_id_app[i[0]] = id_app_temp unique_id_app_sum[i[0]] += sum_th else: id_app_temp = [] id_app_temp.append(i[1]) data_id_app[i[0]] = id_app_temp unique_id_app_sum[i[0]] = sum_th for id_app, value in unique_id_app_sum.items(): sum_risk_value[id_app] = value + data_app_threat_vulnerability[i[0]]['average'] hasil_akhir = {} for id_app in unique_id_app_sum: hasil_akhir[id_app] = sum_risk_value[id_app] dict_sum_th = {} for i in threat_weight: if i[0] in dict_sum_th: list_temp_th = dict_sum_th[i[0]] dict_temp_th = {} if i[1] in data_id_app[i[0]]: dict_temp_th[i[1]] = round(i[2] * nilai_bobot_aset[i[0]] / 100, 2) list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: dict_temp_th[i[1]] = 0 list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: list_temp_th = [] dict_temp_th = {} if i[1] in data_id_app[i[0]]: dict_temp_th[i[1]] = round(i[2] * nilai_bobot_aset[i[0]] / 100, 2) list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: dict_temp_th[i[1]] = 0 list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th list_id_threat = [i[0] for i in data_threat] final_sum_th = {} for k, v in dict_sum_th.items(): dict_temp_th_2 = {} dict_temp_th_sum = {} for dict_data in v: for a, b in dict_data.items(): dict_temp_th_2[a] = b for i in list_id_threat: if i in dict_temp_th_2: continue else: dict_temp_th_2[i] = 0 for id_threat, sum in sorted(dict_temp_th_2.items()): dict_temp_th_sum[id_threat] = sum final_sum_th[k] = dict_temp_th_sum list_data_final = [] for key, value in data_id_app.items(): temp_dict = {} temp_dict[key] = { 'probabilitas_threat': final_sum_th[key], 'bobot': nilai_bobot_aset[key], 'hasil_akhir': hasil_akhir[key] } list_data_final.append(temp_dict) final_data = { 'data': list_data_final } return final_data @app.route('/admin/saat_usulan') def index_during_migration(): if 'loggedin_admin' in session: id_app = getAssets() data_saat_usulan = getSaatUsulan() final_data = hitungDataSaatUsulan(data_saat_usulan) return render_template('during_migration.html', data_saat_usulan=data_saat_usulan, final_data=final_data, id_app=id_app) return redirect(url_for('login')) @app.route('/saat_usulan') def index_saat_usulan(): if 'loggedin' in session: id_app = getAssets() data_saat_usulan = getSaatUsulan() email = session['username'] count_data = getCountSaatUsulan(email) final_data = hitungDataSaatUsulan(data_saat_usulan) return render_template('saat_usulan.html', data_saat_usulan=data_saat_usulan, final_data=final_data, id_app=id_app, count_data=count_data[0][0]) return redirect(url_for('home')) @app.route('/saat_usulan/insert', methods = ['POST']) def insert_saat_usulan(): if request.method == "POST": flash("Data Inserted Successfully") email = request.form['email'] id_app = request.form['id_app'] criteria_1 = request.form['criteria_1'] criteria_2 = request.form['criteria_2'] criteria_3 = request.form['criteria_3'] criteria_4 = request.form['criteria_4'] criteria_5 = request.form['criteria_5'] insertSaatUsulan(email, id_app, criteria_1, criteria_2, criteria_3, criteria_4, criteria_5) return redirect(url_for('index_saat_usulan')) @app.route('/saat_usulan/delete/<string:id_app>', methods = ['GET']) def delete_saat_usulan(id_app): flash("Record Has Been Deleted Successfully") email = session['username'] deleteSaatUsulan(id_app, email) return redirect(url_for('index_saat_usulan')) @app.route('/saat_usulan/update',methods=['POST','GET']) def update_saat_usulan(): if request.method == 'POST': email = session['username'] id_app = request.form['id_app'] criteria_1 = request.form['criteria_1'] criteria_2 = request.form['criteria_2'] criteria_3 = request.form['criteria_3'] criteria_4 = request.form['criteria_4'] criteria_5 = request.form['criteria_5'] updateSaatUsulan(email, id_app, criteria_1, criteria_2, criteria_3, criteria_4, criteria_5) flash("Data Updated Successfully") return redirect(url_for('index_saat_usulan')) def hitungDataSaatUsulan(data_saat_usulan): data_unique_id_app = {} final_data = hitungResikoSebelumUsulan() data_final = {} sum_data_risk = {} for datas in final_data['data']: for data in datas: data_final[data] = datas[data]['hasil_akhir'] for data in data_saat_usulan: if data[0] not in data_unique_id_app: sum_data = data_final[data[0]] + data[6] sum_data_risk[data[0]] = round(sum_data / 2, 2) final_data = {} for id_app in sum_data_risk: final_data[id_app] = { 'risk_value': sum_data_risk[id_app] } return final_data def hitungDataSetelahUsulan(data_setelah_usulan): final_data = hitungResikoSebelumUsulan() data_final = {} for datas in final_data['data']: for data in datas: data_final[data] = datas[data]['hasil_akhir'] hasil_data = {} for data in data_setelah_usulan: if data[0] not in hasil_data: hasil_data[data[0]] = round((data_final[data[0]] + data[6]) / 2, 2) final = {} for id_app in hasil_data: final[id_app] = { 'risk_value': hasil_data[id_app] } return final @app.route('/admin/setelah_usulan') def index_after_migration(): if 'loggedin_admin' in session: id_app = getAssets() data_setelah_usulan = getSetelahUsulan() final = hitungDataSetelahUsulan(data_setelah_usulan) return render_template('after_migrating.html', data_setelah_usulan=data_setelah_usulan, final=final, id_app=id_app) return redirect(url_for('login')) @app.route('/setelah_usulan') def index_setelah_usulan(): if 'loggedin' in session: id_app = getAssets() data_setelah_usulan = getSetelahUsulan() email = session['username'] count_data = getCountSaatUsulan(email) final_data = hitungResikoSebelumUsulan() data_final = {} for datas in final_data['data']: for data in datas: data_final[data] = datas[data]['hasil_akhir'] hasil_data = {} for data in data_setelah_usulan: if data[0] not in hasil_data: hasil_data[data[0]] = round((data_final[data[0]] + data[6])/2, 2) final = {} for id_app in hasil_data: final[id_app] = { 'risk_value':hasil_data[id_app] } return render_template('setelah_usulan.html', data_setelah_usulan=data_setelah_usulan, final=final, id_app=id_app, count_data=count_data[0][0]) return redirect(url_for('home')) @app.route('/setelah_usulan/insert', methods = ['POST']) def insert_setelah_usulan(): if request.method == "POST": flash("Data Inserted Successfully") email = request.form['email'] id_app = request.form['id_app'] criteria_1 = request.form['criteria_1'] criteria_2 = request.form['criteria_2'] criteria_3 = request.form['criteria_3'] criteria_4 = request.form['criteria_4'] criteria_5 = request.form['criteria_5'] insertSetelahUsulan(email, id_app, criteria_1, criteria_2, criteria_3, criteria_4, criteria_5) return redirect(url_for('index_setelah_usulan')) @app.route('/setelah_usulan/delete/<string:id_app>', methods = ['GET']) def delete_setelah_usulan(id_app): flash("Record Has Been Deleted Successfully") email = session['username'] deleteSetelahUsulan(id_app, email) return redirect(url_for('index_setelah_usulan')) @app.route('/setelah_usulan/update',methods=['POST','GET']) def update_setelah_usulan(): if request.method == 'POST': email = session['username'] id_app = request.form['id_app'] criteria_1 = request.form['criteria_1'] criteria_2 = request.form['criteria_2'] criteria_3 = request.form['criteria_3'] criteria_4 = request.form['criteria_4'] criteria_5 = request.form['criteria_5'] updateSetelahUsulan(email, id_app, criteria_1, criteria_2, criteria_3, criteria_4, criteria_5) flash("Data Updated Successfully") return redirect(url_for('index_setelah_usulan')) def hitungResikoShareeful(): global hasil_akhir threat_weight = getThreatWeight() bobot_aset = getBobotAssets() data_threat = getThreat() nilai_bobot_aset = {} id_app_bobot_aset = [] data_id_app = {} unique_id_app_sum = {} for data in bobot_aset: id_app_bobot_aset.append(data[0]) nilai_bobot_aset[data[0]] = data[4] for i in threat_weight: if i[0] in id_app_bobot_aset: sum_th = round(i[2] * nilai_bobot_aset[i[0]] / 100, 2) if i[0] in data_id_app: id_app_temp = data_id_app[i[0]] id_app_temp.append(i[1]) data_id_app[i[0]] = id_app_temp unique_id_app_sum[i[0]] += sum_th else: id_app_temp = [] id_app_temp.append(i[1]) data_id_app[i[0]] = id_app_temp unique_id_app_sum[i[0]] = sum_th hasil_akhir = {} for id_app in unique_id_app_sum: hasil_akhir[id_app] = unique_id_app_sum[id_app] dict_sum_th = {} for i in threat_weight: if i[0] in dict_sum_th: list_temp_th = dict_sum_th[i[0]] dict_temp_th = {} if i[1] in data_id_app[i[0]]: dict_temp_th[i[1]] = round(i[2] * nilai_bobot_aset[i[0]] / 100, 2) list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: dict_temp_th[i[1]] = 0 list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: list_temp_th = [] dict_temp_th = {} if i[1] in data_id_app[i[0]]: dict_temp_th[i[1]] = round(i[2] * nilai_bobot_aset[i[0]] / 100, 2) list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: dict_temp_th[i[1]] = 0 list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th list_id_threat = [i[0] for i in data_threat] final_sum_th = {} for k, v in dict_sum_th.items(): dict_temp_th_2 = {} dict_temp_th_sum = {} for dict_data in v: for a, b in dict_data.items(): dict_temp_th_2[a] = b for i in list_id_threat: if i in dict_temp_th_2: continue else: dict_temp_th_2[i] = 0 for id_threat, sum in sorted(dict_temp_th_2.items()): dict_temp_th_sum[id_threat] = sum final_sum_th[k] = dict_temp_th_sum list_data_final = [] for key, value in data_id_app.items(): temp_dict = {} temp_dict[key] = { 'probabilitas_threat': final_sum_th[key], 'bobot': nilai_bobot_aset[key], 'hasil_akhir': hasil_akhir[key] } list_data_final.append(temp_dict) final_data = { 'data': list_data_final } return final_data @app.route('/shareeful') def index_shareeful(): if 'loggedin' in session: email = session['username'] count_data = getCountData(email) data_shareefull = getNilaiShareeful() return render_template('shareeful.html', count_data=count_data[0][0], data_shareefull=data_shareefull) return redirect(url_for('home')) @app.route('/shareeful/insert', methods = ['POST']) def insert_shareeful(): if request.method == "POST": flash("Data Calculated Successfully") email = session['username'] deleteShareeful(email) final_data = hitungResikoShareeful() for datas in final_data['data']: for data in datas: email_user = session['username'] th1 = datas[data]['probabilitas_threat']['TH-01'] th2 = datas[data]['probabilitas_threat']['TH-02'] th3 = datas[data]['probabilitas_threat']['TH-03'] th4 = datas[data]['probabilitas_threat']['TH-04'] th5 = datas[data]['probabilitas_threat']['TH-05'] th6 = datas[data]['probabilitas_threat']['TH-06'] th7 = datas[data]['probabilitas_threat']['TH-07'] th8 = datas[data]['probabilitas_threat']['TH-08'] th9 = datas[data]['probabilitas_threat']['TH-09'] th10 = datas[data]['probabilitas_threat']['TH-10'] th11 = datas[data]['probabilitas_threat']['TH-11'] risk_value = datas[data]['hasil_akhir'] id_app = data insertShareeful(email_user, th1, th2, th3, th4, th5, th6, th7, th8, th9, th10, th11, risk_value,id_app) return redirect(url_for('index_shareeful')) @app.route('/admin/report') def index_report(): if 'loggedin_admin' in session: asset = getAssets() data_sebelum = {} data_sebelum_usulan = getNilaiSebelumUsulan() for i in data_sebelum_usulan: data_sebelum[i[0]] = i[13] data_saat_usulan = getSaatUsulan() final_data = hitungDataSaatUsulan(data_saat_usulan) data_setelah_usulan = getSetelahUsulan() final = hitungDataSetelahUsulan(data_setelah_usulan) return render_template('report.html', asset=asset, data_sebelum_usulan=data_sebelum, data_saat_usulan = final_data, data_setelah_usulan=final) return redirect(url_for('login')) def hitungResikoKozlov(): global hasil_akhir threat_weight = getThreatWeight() bobot_aset = getBobotAssets() data_threat = getThreat() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) data_app_threat_vulnerability = hitungVulnerability(data_app_threat, data_hitung_avg) nilai_bobot_aset = {} id_app_bobot_aset = [] data_id_app = {} unique_id_app_sum = {} len_id_th_tempt = {} sum_risk_value = {} for data in bobot_aset: id_app_bobot_aset.append(data[0]) nilai_bobot_aset[data[0]] = data[4] for i in threat_weight: if i[0] in id_app_bobot_aset: sum_th = round(data_app_threat_vulnerability[i[0]]['average'] * i[2] * nilai_bobot_aset[i[0]] / 100, 2) if i[0] in data_id_app: id_app_temp = data_id_app[i[0]] id_app_temp.append(i[1]) data_id_app[i[0]] = id_app_temp unique_id_app_sum[i[0]] += sum_th len_id_th_tempt[i[0]] += 1 else: id_app_temp = [] id_app_temp.append(i[1]) data_id_app[i[0]] = id_app_temp unique_id_app_sum[i[0]] = sum_th len_id_th_tempt[i[0]] = 1 for id_app, value in unique_id_app_sum.items(): sum_risk_value[id_app] = round(value / len_id_th_tempt[id_app], 2) hasil_akhir = {} for id_app in unique_id_app_sum: hasil_akhir[id_app] = sum_risk_value[id_app] dict_sum_th = {} for i in threat_weight: if i[0] in dict_sum_th: list_temp_th = dict_sum_th[i[0]] dict_temp_th = {} if i[1] in data_id_app[i[0]]: dict_temp_th[i[1]] = round(data_app_threat_vulnerability[i[0]]['average'] * i[2] * nilai_bobot_aset[i[0]] / 100, 2) list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: dict_temp_th[i[1]] = 0 list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: list_temp_th = [] dict_temp_th = {} if i[1] in data_id_app[i[0]]: dict_temp_th[i[1]] = round(data_app_threat_vulnerability[i[0]]['average'] * i[2] * nilai_bobot_aset[i[0]] / 100, 2) list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th else: dict_temp_th[i[1]] = 0 list_temp_th.append(dict_temp_th) dict_sum_th[i[0]] = list_temp_th list_id_threat = [i[0] for i in data_threat] final_sum_th = {} for k, v in dict_sum_th.items(): dict_temp_th_2 = {} dict_temp_th_sum = {} for dict_data in v: for a, b in dict_data.items(): dict_temp_th_2[a] = b for i in list_id_threat: if i in dict_temp_th_2: continue else: dict_temp_th_2[i] = 0 for id_threat, sum in sorted(dict_temp_th_2.items()): dict_temp_th_sum[id_threat] = sum final_sum_th[k] = dict_temp_th_sum list_data_final = [] for key, value in data_id_app.items(): temp_dict = {} temp_dict[key] = { 'probabilitas_threat': final_sum_th[key], 'bobot': nilai_bobot_aset[key], 'hasil_akhir': hasil_akhir[key] } list_data_final.append(temp_dict) final_data = { 'data': list_data_final } return final_data @app.route('/admin/kozlov') def index_admin_kozlov(): if 'loggedin_admin' in session: data_kozlov = getNilaiKozlov() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) vulnerability = hitungVulnerability(data_app_threat, data_hitung_avg) return render_template('admin_kozlov.html', data_kozlov=data_kozlov, vulnerability=vulnerability) return redirect(url_for('login')) @app.route('/admin/shareeful') def index_admin_shareeful(): if 'loggedin_admin' in session: data_shareeful = getNilaiShareeful() return render_template('admin_shareeful.html', data_shareeful=data_shareeful) return redirect(url_for('login')) @app.route('/kozlov') def index_kozlov(): if 'loggedin' in session: email = session['username'] count_data = getCountData(email) data_kozlov = getNilaiKozlov() data_app_threat = getAppThreat() data_vulnerability_avg = getVulnerabilityAVG() data_hitung_avg = hitungAVG(data_vulnerability_avg) vulnerability = hitungVulnerability(data_app_threat, data_hitung_avg) return render_template('kozlov.html', count_data=count_data[0][0], data_kozlov=data_kozlov, vulnerability=vulnerability) return redirect(url_for('home')) @app.route('/kozlov/insert', methods = ['POST']) def insert_kozlov(): if request.method == "POST": flash("Data Calculated Successfully") email = session['username'] deleteKozlov(email) final_data = hitungResikoKozlov() for datas in final_data['data']: for data in datas: email_user = session['username'] th1 = datas[data]['probabilitas_threat']['TH-01'] th2 = datas[data]['probabilitas_threat']['TH-02'] th3 = datas[data]['probabilitas_threat']['TH-03'] th4 = datas[data]['probabilitas_threat']['TH-04'] th5 = datas[data]['probabilitas_threat']['TH-05'] th6 = datas[data]['probabilitas_threat']['TH-06'] th7 = datas[data]['probabilitas_threat']['TH-07'] th8 = datas[data]['probabilitas_threat']['TH-08'] th9 = datas[data]['probabilitas_threat']['TH-09'] th10 = datas[data]['probabilitas_threat']['TH-10'] th11 = datas[data]['probabilitas_threat']['TH-11'] risk_value = datas[data]['hasil_akhir'] id_app = data insertKozlov(email_user, th1, th2, th3, th4, th5, th6, th7, th8, th9, th10, th11, risk_value,id_app) return redirect(url_for('index_kozlov')) @app.route('/admin/perbandingan') def index_perbandingan(): if 'loggedin_admin' in session: asset = getAssets() global list_shareeful data_shareeful = hitungResikoShareeful() data_kozlov = hitungResikoKozlov() shareeful = {} for datas in data_shareeful['data']: for data in datas: shareeful[data] = datas[data]['hasil_akhir'] print(shareeful) kozlov = {} for datas in data_kozlov['data']: for data in datas: kozlov[data] = datas[data]['hasil_akhir'] print(kozlov) data_sebelum = {} data_sebelum_usulan = getNilaiSebelumUsulan() for i in data_sebelum_usulan: data_sebelum[i[0]] = i[13] data_saat_usulan = getSaatUsulan() final_data = hitungDataSaatUsulan(data_saat_usulan) data_setelah_usulan = getSetelahUsulan() final = hitungDataSetelahUsulan(data_setelah_usulan) return render_template('perbandingan.html', asset=asset, data_shareeful = shareeful, data_kozlov=kozlov, data_sebelum = data_sebelum, data_saat_usulan = final_data, data_setelah_usulan=final) return redirect(url_for('login')) if __name__ == '__main__': app.run(debug=True)
37.433913
214
0.645567
5,471
43,049
4.758911
0.045878
0.03476
0.020741
0.039945
0.80984
0.771509
0.729375
0.699455
0.674297
0.602013
0
0.014352
0.242514
43,049
1,149
215
37.466493
0.784078
0.01712
0
0.679185
0
0
0.12787
0.017852
0
0
0
0
0
1
0.062232
false
0.01073
0.017167
0
0.168455
0.002146
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8afeeded81b5bb3592693d702c542c38bde951e4
3,165
py
Python
hyaline/errors/GuildErrors.py
5elenay/hyaline
117321c972b43cdb7e4e4a749bc4fa41396c12cb
[ "MIT" ]
11
2021-06-09T05:23:01.000Z
2021-11-12T11:33:00.000Z
hyaline/errors/GuildErrors.py
5elenay/hyaline
117321c972b43cdb7e4e4a749bc4fa41396c12cb
[ "MIT" ]
1
2021-06-13T13:37:40.000Z
2021-06-13T14:06:20.000Z
hyaline/errors/GuildErrors.py
5elenay/hyaline
117321c972b43cdb7e4e4a749bc4fa41396c12cb
[ "MIT" ]
5
2021-06-09T13:53:31.000Z
2021-06-25T20:37:42.000Z
class EditGuildFailed(Exception): """Raises when editing the guild is failed.""" pass class FetchGuildChannelsFailed(Exception): """Raises when fetching the guild channels is failed.""" pass class CreateGuildChannelFailed(Exception): """Raises when creating new guild channel is failed.""" pass class ChangeChannelPositionFailed(Exception): """Raises when changing a channel position is failed.""" pass class FetchGuildMemberFailed(Exception): """Raises when fetching a guild member is failed.""" pass class FetchGuildMembersFailed(Exception): """Raises when fetching guild member list is failed.""" pass class SearchGuildMemberFailed(Exception): """Raises when searching the guild members is failed.""" pass class EditGuildMemberFailed(Exception): """Raises when editing the guild member is failed.""" pass class FetchGuildEmojiListFailed(Exception): """Raises when fetching the emoji list is failed.""" pass class FetchGuildEmojiFailed(Exception): """Raises when fetching the guild emoji is failed.""" pass class CreateGuildEmojiFailed(Exception): """Raises when creating a guild emoji is failed.""" pass class EditGuildEmojiFailed(Exception): """Raises when editing a guild emoji is failed.""" pass class DeleteGuildEmojiFailed(Exception): """Raises when delete a guild emoji is failed.""" pass class AddRoleToGuildMemberFailed(Exception): """Raises when adding a role to guild member is failed.""" pass class RemoveRoleFromGuildMemberFailed(Exception): """Raises when removing a role from guild member is failed.""" pass class KickMemberFromGuildFailed(Exception): """Raises when kicking a member from guild is failed.""" pass class BanMemberFromGuildFailed(Exception): """Raises when banning a member from guild is failed.""" pass class UnbanGuildMemberFailed(Exception): """Raises when unbanning a user from guild is failed.""" pass class FetchGuildBansFailed(Exception): """Raises when fetching the guild bans is failed.""" pass class FetchGuildBanFailed(Exception): """Raises when fetching the member guild ban is failed.""" pass class FetchGuildRolesFailed(Exception): """Raises when fetching the guild roles is failed.""" pass class CreateGuildRoleFailed(Exception): """Raises when creating new guild role is failed.""" pass class EditGuildRoleFailed(Exception): """Raises when editing the guild role is failed.""" pass class DeleteGuildRoleFailed(Exception): """Raises when deleting the guild role is failed.""" pass class ChangeClientUserNicknameFailed(Exception): """Raises when changing the client-user guild nickname is failed.""" pass class FetchGuildVanityUrlFailed(Exception): """Raises when fetching the vanity url is failed.""" pass class FetchAuditLogFailed(Exception): """Raises when fetching the guild audit log is failed.""" pass class FetchGuildWebhooksFailed(Exception): """Raises when fetching the guild webhooks is failed.""" pass
18.952096
72
0.714376
346
3,165
6.534682
0.208092
0.185759
0.235294
0.203008
0.40115
0.33525
0.091995
0.029191
0
0
0
0
0.19684
3,165
166
73
19.066265
0.889457
0.436651
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
c14b82c843a45665a418d93378311b76fda4b47f
1,283
py
Python
make_sdk.py
ueshita/ADX2LE-GodotPlugin
cb0d9a585e2c35c1d1708a0904899e1a47096b77
[ "MIT" ]
1
2020-10-08T14:56:23.000Z
2020-10-08T14:56:23.000Z
make_sdk.py
ueshita/ADX2LE-GodotPlugin
cb0d9a585e2c35c1d1708a0904899e1a47096b77
[ "MIT" ]
null
null
null
make_sdk.py
ueshita/ADX2LE-GodotPlugin
cb0d9a585e2c35c1d1708a0904899e1a47096b77
[ "MIT" ]
null
null
null
import os import shutil if os.path.isdir("cri/godot"): shutil.rmtree("cri/godot") os.mkdir("cri/godot") os.mkdir("cri/godot/include") os.mkdir("cri/godot/libs") shutil.copytree("cri/cocos2dx/include/android", "cri/godot/include/android") shutil.copytree("cri/cocos2dx/include/ios", "cri/godot/include/ios") shutil.copytree("cri/cocos2dx/include/macosx", "cri/godot/include/macosx") shutil.copytree("cri/cocos2dx/include/pc", "cri/godot/include/pc") shutil.copytree("cri/cocos2dx/libs/android", "cri/godot/libs/android") shutil.copytree("cri/cocos2dx/libs/ios", "cri/godot/libs/ios") shutil.copytree("cri/cocos2dx/libs/macosx", "cri/godot/libs/macosx") shutil.copytree("cri/cocos2dx/libs/pc", "cri/godot/libs/pc") shutil.copytree("cri/UE4/Engine/Plugins/Runtime/CriWare/CriWare/Source/ThirdParty/CriWare/cri/pc/libs/x64", "cri/godot/libs/pc/x64") if not os.path.isdir("godot-proj/addons/adx2le/bin/win32/"): os.makedirs("godot-proj/addons/adx2le/bin/win32/") shutil.copy("cri/godot/libs/pc/x86/cri_ware_pcx86_le.dll", "godot-proj/addons/adx2le/bin/win32/") if not os.path.isdir("godot-proj/addons/adx2le/bin/win64/"): os.makedirs("godot-proj/addons/adx2le/bin/win64/") shutil.copy("cri/godot/libs/pc/x64/cri_ware_pcx64_le.dll", "godot-proj/addons/adx2le/bin/win64/")
45.821429
132
0.753702
203
1,283
4.73399
0.20197
0.133195
0.159209
0.208117
0.64308
0.335068
0.21436
0.083247
0.083247
0.083247
0
0.031811
0.044427
1,283
27
133
47.518519
0.752039
0
0
0
0
0.045455
0.641465
0.537802
0
0
0
0
0
1
0
true
0
0.090909
0
0.090909
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
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
c14bfb947014bb7222b2d576137071bc15ed7c3d
7,126
py
Python
tests/openid_op_tests/test_client_registration.py
rerobins/django-openid-op
96952a6d413718d0ed4c656265248b6f0d0c2e4e
[ "MIT" ]
2
2020-02-15T20:20:36.000Z
2020-05-12T02:39:42.000Z
tests/openid_op_tests/test_client_registration.py
rerobins/django-openid-op
96952a6d413718d0ed4c656265248b6f0d0c2e4e
[ "MIT" ]
3
2021-11-24T21:28:52.000Z
2021-11-24T23:07:57.000Z
tests/openid_op_tests/test_client_registration.py
rerobins/django-openid-op
96952a6d413718d0ed4c656265248b6f0d0c2e4e
[ "MIT" ]
2
2019-11-25T07:40:28.000Z
2021-11-29T16:06:59.000Z
import hashlib import json import pytest import re from django.contrib.auth.models import User from django.core.management import call_command from openid_connect_op.models import OpenIDToken, OpenIDClient @pytest.mark.django_db class TestClientRegistrationRequest: @pytest.fixture(autouse=True) def init_jwk(self): call_command('create_jwt_keys') def test_client_registration_bad_token(self, client): resp = client.post( '/openid/register', json.dumps({}), content_type='application/json', HTTP_AUTHORIZATION=self.format_auth('abc')) assert resp.status_code == 403 def test_client_registration_bad_token2(self, client, openid_client, user): token = OpenIDToken.create_token(openid_client, OpenIDToken.TOKEN_TYPE_ACCESS_BEARER_TOKEN, {}, 1e9, user)[0] resp = client.post( '/openid/register', json.dumps({}), content_type='application/json', HTTP_AUTHORIZATION=self.format_auth(token)) assert resp.status_code == 403 def test_client_registration_no_redirect_uri(self, client, openid_client, user): token = OpenIDToken.create_token(openid_client, OpenIDToken.TOKEN_TYPE_CLIENT_DYNAMIC_REGISTRATION, {}, 1e9, user)[0] resp = client.post( '/openid/register', json.dumps({}), content_type='application/json', HTTP_AUTHORIZATION=self.format_auth(token)) assert resp.status_code == 400 assert json.loads(resp.content.decode('utf-8')) == { 'error': 'invalid_request', 'error_description': 'Required parameter with name "redirect_uris" is not present' } def test_client_registration_ok(self, client, openid_client, user): token = OpenIDToken.create_token(openid_client, OpenIDToken.TOKEN_TYPE_CLIENT_DYNAMIC_REGISTRATION, {}, 1e9, user)[0] resp = client.post( '/openid/register', json.dumps({ 'redirect_uris': [ 'http://test.org/auth/complete' ], 'another': 1 }), content_type='application/json', HTTP_AUTHORIZATION=self.format_auth(token)) assert resp.status_code == 201 content = json.loads(resp.content.decode('utf-8')) assert 'client_id' in content assert 'client_secret' in content client_id = content.pop('client_id') client_secret = content.pop('client_secret') registration_access_token = content.pop('registration_access_token') assert len(registration_access_token) > 32 registration_client_uri = content.pop('registration_client_uri') assert registration_client_uri.startswith('http://testserver/openid/client_configuration/') assert content == { 'another': 1, 'client_secret_expires_at': 0, 'redirect_uris': ['http://test.org/auth/complete'] } client = OpenIDClient.objects.get(client_id=client_id) assert client.check_client_secret(client_secret) def test_client_registration_pairwise(self, client, openid_client, user): token = OpenIDToken.create_token(openid_client, OpenIDToken.TOKEN_TYPE_CLIENT_DYNAMIC_REGISTRATION, {}, 1e9, user)[0] resp = client.post( '/openid/register', json.dumps({ 'redirect_uris': [ 'http://test.org/auth/complete' ], 'subject_type': ['pairwise'], 'another': 1 }), content_type='application/json', HTTP_AUTHORIZATION=self.format_auth(token)) assert resp.status_code == 201 content = json.loads(resp.content.decode('utf-8')) assert 'client_id' in content assert 'client_secret' in content client_id = content.pop('client_id') client_secret = content.pop('client_secret') registration_access_token = content.pop('registration_access_token') assert len(registration_access_token) > 32 registration_client_uri = content.pop('registration_client_uri') assert registration_client_uri.startswith('http://testserver/openid/client_configuration/') assert content == { 'another': 1, 'client_secret_expires_at': 0, 'redirect_uris': ['http://test.org/auth/complete'], 'subject_type': ['pairwise'], } client = OpenIDClient.objects.get(client_id=client_id) assert client.check_client_secret(client_secret) from django.conf import settings assert client.sub_hash == hashlib.sha256(('test.org' + settings.SECRET_KEY).encode('utf-8')).hexdigest() def test_client_configuration_service(self, client, openid_client, user): token = OpenIDToken.create_token(openid_client, OpenIDToken.TOKEN_TYPE_CLIENT_DYNAMIC_REGISTRATION, {}, 1e9, user)[0] resp = client.post( '/openid/register', json.dumps({ 'redirect_uris': [ 'http://test.org/auth/complete' ], 'another': 1 }), content_type='application/json', HTTP_AUTHORIZATION=self.format_auth(token)) content = json.loads(resp.content.decode('utf-8')) registration_access_token = content.pop('registration_access_token') registration_client_uri = content.pop('registration_client_uri') client_id = content.pop('client_id') resp = client.get(registration_client_uri, HTTP_AUTHORIZATION=self.format_auth(registration_access_token)) assert resp.status_code == 200 content = json.loads(resp.content.decode('utf-8')) assert 'client_id' in content assert 'client_secret' in content new_client_id = content.pop('client_id') content.pop('client_secret') assert new_client_id == client_id new_registration_access_token = content.pop('registration_access_token') assert len(new_registration_access_token) > 32 new_registration_client_uri = content.pop('registration_client_uri') assert new_registration_client_uri == registration_client_uri assert registration_client_uri.startswith('http://testserver/openid/client_configuration/') assert content == { 'another': 1, 'client_secret_expires_at': 0, 'redirect_uris': ['http://test.org/auth/complete'] } @pytest.fixture() def openid_client(self): return OpenIDClient.objects.create( client_id='1', client_auth_type=OpenIDClient.CLIENT_AUTH_TYPE_BASIC, ) @pytest.fixture def user(self): return User.objects.create(username='a') def format_auth(self, token): return 'Bearer ' + token
40.488636
114
0.625596
756
7,126
5.615079
0.154762
0.033922
0.069258
0.044523
0.766549
0.742285
0.730035
0.722968
0.68881
0.657244
0
0.011364
0.271401
7,126
175
115
40.72
0.80624
0
0
0.662252
0
0
0.172607
0.037047
0
0
0
0
0.178808
1
0.066225
false
0
0.05298
0.019868
0.145695
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c15f71c7c48cd50d5a4dccc8e4e4a416af5f8c4c
172
py
Python
pbc/func_decorator.py
violant/PBC-tasks
b1610bea9e8cbd7a44d6b32d65161feff825f7ca
[ "Apache-2.0" ]
1
2017-12-04T18:56:11.000Z
2017-12-04T18:56:11.000Z
pbc/func_decorator.py
violant/PBC-tasks
b1610bea9e8cbd7a44d6b32d65161feff825f7ca
[ "Apache-2.0" ]
9
2017-12-04T18:47:32.000Z
2021-06-01T21:54:05.000Z
pbc/func_decorator.py
violant/PBC-tasks
b1610bea9e8cbd7a44d6b32d65161feff825f7ca
[ "Apache-2.0" ]
1
2017-12-04T20:09:41.000Z
2017-12-04T20:09:41.000Z
def decorator(func): def wrapper(*args): print "{}{}".format(func.__name__, '(%s)' % ', '.join(map(repr, args))) return func(*args) return wrapper
24.571429
79
0.55814
20
172
4.6
0.65
0.217391
0
0
0
0
0
0
0
0
0
0
0.232558
172
6
80
28.666667
0.69697
0
0
0
0
0
0.05814
0
0
0
0
0
0
0
null
null
0
0
null
null
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
c1668483a7504a3ea10cf89b2885b526368fe2d2
12
py
Python
shobaleader-one/tests/__init__.py
pikesley/shobaleader-one
bcbf1d2bda01afc66cfa976e380758df0fa930a2
[ "MIT" ]
null
null
null
shobaleader-one/tests/__init__.py
pikesley/shobaleader-one
bcbf1d2bda01afc66cfa976e380758df0fa930a2
[ "MIT" ]
null
null
null
shobaleader-one/tests/__init__.py
pikesley/shobaleader-one
bcbf1d2bda01afc66cfa976e380758df0fa930a2
[ "MIT" ]
null
null
null
# hello git
6
11
0.666667
2
12
4
1
0
0
0
0
0
0
0
0
0
0
0
0.25
12
1
12
12
0.888889
0.75
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
c17894b9d0cc102f73b77d4a31f3bff3b5f19cc1
102
py
Python
cputils/__init__.py
computePods/pythonUtils
0669e1e42792a80ba1318152d341f43e7dccd663
[ "Apache-2.0" ]
null
null
null
cputils/__init__.py
computePods/pythonUtils
0669e1e42792a80ba1318152d341f43e7dccd663
[ "Apache-2.0" ]
null
null
null
cputils/__init__.py
computePods/pythonUtils
0669e1e42792a80ba1318152d341f43e7dccd663
[ "Apache-2.0" ]
null
null
null
# This file informs Python that this directory is a package # It has no other purpose (at the moment)
34
59
0.764706
18
102
4.333333
0.944444
0
0
0
0
0
0
0
0
0
0
0
0.196078
102
3
60
34
0.95122
0.95098
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
c1b901f42f734ad94c5d342ab6786f38f6425c8d
181
py
Python
src/loadgenerator/locustfiles/locustfile.py
UsamaIslam/microservices-demo
04856e80856b823771ec552b28ea368fcd5add2a
[ "Apache-2.0" ]
2
2020-10-20T18:09:02.000Z
2021-05-29T10:40:54.000Z
src/loadgenerator/locustfiles/locustfile.py
UsamaIslam/opencensus-microservices-demo
52c598f259ab6d13d6c9800c2007c0cdbe0e9375
[ "Apache-2.0" ]
null
null
null
src/loadgenerator/locustfiles/locustfile.py
UsamaIslam/opencensus-microservices-demo
52c598f259ab6d13d6c9800c2007c0cdbe0e9375
[ "Apache-2.0" ]
null
null
null
from locust import HttpUser, between from locustfiles.load_testing_microservice import LoadTest class PrimaryUser(HttpUser): tasks = [LoadTest] wait_time = between(1, 3)
20.111111
58
0.773481
22
181
6.227273
0.772727
0
0
0
0
0
0
0
0
0
0
0.013158
0.160221
181
8
59
22.625
0.888158
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
c1c18c65e17ce88e1af82ceb82ffe522c51ba911
17,125
py
Python
users/migrations/0001_initial.py
danielmicaletti/music-academy-student-portal
ca779f71e69d6676ee77a6cd68a13c2225c886f9
[ "MIT" ]
null
null
null
users/migrations/0001_initial.py
danielmicaletti/music-academy-student-portal
ca779f71e69d6676ee77a6cd68a13c2225c886f9
[ "MIT" ]
null
null
null
users/migrations/0001_initial.py
danielmicaletti/music-academy-student-portal
ca779f71e69d6676ee77a6cd68a13c2225c886f9
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2017-02-14 20:35 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import users.models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('password', models.CharField(max_length=128, verbose_name='password')), ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), ('username', models.CharField(blank=True, max_length=50, null=True, unique=True)), ('email', models.EmailField(max_length=254, unique=True)), ('first_name', models.CharField(blank=True, max_length=50, null=True)), ('last_name', models.CharField(blank=True, max_length=50, null=True)), ('is_admin', models.BooleanField(default=False)), ('is_active', models.BooleanField(default=False)), ('user_pic', models.FileField(blank=True, default='blank_user.png', null=True, upload_to=users.models.get_upload_file_name)), ('user_created', models.DateTimeField(auto_now_add=True)), ('user_updated', models.DateTimeField(auto_now=True)), ('play_level', models.CharField(blank=True, choices=[('1', 'White'), ('2', 'Yellow'), ('3', 'Orange'), ('4', 'Green'), ('5', 'Blue'), ('6', 'Purple'), ('7', 'Red'), ('8', 'Brown'), ('9', 'Black')], default='1', max_length=20, null=True)), ('date_of_birth', models.DateField(blank=True, max_length=50, null=True)), ('user_credit', models.CharField(blank=True, default=0, max_length=4, null=True)), ('recurring_credit', models.CharField(blank=True, default=0, max_length=2, null=True)), ('course_reminder', models.BooleanField(default=True)), ('practice_reminder', models.BooleanField(default=True)), ('user_update', models.BooleanField(default=True)), ], options={ 'abstract': False, }, ), migrations.CreateModel( name='Location', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(blank=True, max_length=50, null=True)), ('addr1', models.CharField(blank=True, max_length=50, null=True)), ('addr2', models.CharField(blank=True, max_length=50, null=True)), ('city', models.CharField(blank=True, max_length=50, null=True)), ('state', models.CharField(blank=True, max_length=50, null=True)), ('zip_code', models.CharField(blank=True, max_length=20, null=True)), ('phone_main', models.CharField(blank=True, max_length=20, null=True)), ('phone_other', models.CharField(blank=True, max_length=20, null=True)), ('notes', models.TextField(blank=True, null=True)), ('location_created', models.DateTimeField(auto_now_add=True)), ('location_created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='location_created_user', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentEmail', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('mail_type', models.CharField(blank=True, choices=[('CRE', 'User Created'), ('ACT', 'User Active'), ('UPD', 'Account Updated'), ('PRACT', 'User Practice Reminder'), ('SCHED', 'Course Scheduled'), ('CNCL', 'Course Cancelled'), ('REMD', 'Course Scheduled Reminder')], max_length=8, null=True)), ('from_email', models.EmailField(blank=True, max_length=254, null=True)), ('cc', models.EmailField(blank=True, max_length=254, null=True)), ('bcc', models.EmailField(blank=True, max_length=254, null=True)), ('subject', models.CharField(blank=True, max_length=250, null=True)), ('title', models.CharField(blank=True, max_length=250, null=True)), ('body', models.TextField(blank=True, null=True)), ('footer', models.TextField(blank=True, null=True)), ], ), migrations.CreateModel( name='StudentGoal', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('goal', models.CharField(max_length=250)), ('goal_target_date', models.DateTimeField(blank=True, max_length=50, null=True)), ('goal_complete', models.BooleanField(default=False)), ('goal_complete_date', models.DateTimeField(blank=True, max_length=50, null=True)), ('goal_notes', models.TextField(blank=True, null=True)), ('goal_created', models.DateTimeField(auto_now_add=True)), ('goal_updated', models.DateTimeField(auto_now=True)), ('goal_created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='goal_created_user', to=settings.AUTH_USER_MODEL)), ('goal_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='goal_updated_user', to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_goal', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentMaterial', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('file', models.FileField(blank=True, null=True, upload_to=users.models.get_upload_file_name)), ('material_name', models.CharField(blank=True, max_length=50, null=True)), ('material_notes', models.TextField(blank=True, null=True)), ('material_added', models.DateTimeField(auto_now_add=True)), ('material_updated', models.DateTimeField(auto_now=True)), ('material_added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='material_added_user', to=settings.AUTH_USER_MODEL)), ('material_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='material_updated_user', to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='student_material', to=settings.AUTH_USER_MODEL)), ('student_group', models.ManyToManyField(blank=True, related_name='group_student', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentNote', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('note', models.TextField()), ('note_created', models.DateTimeField(auto_now_add=True)), ('note_updated', models.DateTimeField(auto_now=True)), ('note_created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='note_created_user', to=settings.AUTH_USER_MODEL)), ('note_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='note_updated_user', to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_note', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentObjective', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('objective', models.CharField(max_length=250)), ('objective_complete', models.BooleanField(default=False)), ('objective_complete_date', models.DateTimeField(blank=True, max_length=50, null=True)), ('objective_notes', models.TextField(blank=True, null=True)), ('objective_visible', models.BooleanField(default=False)), ('objective_priority', models.CharField(blank=True, max_length=3, null=True)), ('objective_created', models.DateTimeField(auto_now_add=True)), ('objective_updated', models.DateTimeField(auto_now=True)), ('objective_created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='objective_created_user', to=settings.AUTH_USER_MODEL)), ('objective_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='objective_updated_user', to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_objective', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentPlan', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('plan_title', models.CharField(blank=True, max_length=50, null=True)), ('plan_description', models.TextField(blank=True, null=True)), ('plan_created', models.DateTimeField(auto_now_add=True)), ('plan_updated', models.DateTimeField(auto_now_add=True)), ('plan_created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_created_user', to=settings.AUTH_USER_MODEL)), ('plan_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_updated_user', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentPlanFile', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('plan_file', models.FileField(blank=True, null=True, upload_to=users.models.get_upload_file_name)), ('plan_file_name', models.CharField(blank=True, max_length=100, null=True)), ('plan_file_created', models.DateTimeField(auto_now_add=True)), ('plan_file_updated', models.DateTimeField(auto_now=True)), ('plan_file_created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_file_added_user', to=settings.AUTH_USER_MODEL)), ('plan_file_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_file_updated_user', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentPlanSection', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('section_week', models.CharField(blank=True, max_length=3, null=True)), ('section_number', models.CharField(blank=True, max_length=3, null=True)), ('section_title', models.CharField(blank=True, max_length=50)), ('section_description', models.TextField(blank=True)), ('section_notes', models.TextField(blank=True)), ('section_created', models.DateTimeField(auto_now_add=True)), ('section_updated', models.DateTimeField(auto_now_add=True)), ('section_created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='section_created_user', to=settings.AUTH_USER_MODEL)), ('section_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='section_updated_user', to=settings.AUTH_USER_MODEL)), ('student_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='plan_section', to='users.StudentPlan')), ], ), migrations.CreateModel( name='StudentPracticeLog', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('practice_category', models.CharField(blank=True, choices=[('LEAD_TECHNIQUE', 'Lead Technique'), ('RHYTHM_TECHNIQUE', 'Rhythm Technique'), ('FRETBOARD', 'Fretboard Knowledge'), ('THEORY', 'Music Theory Concepts'), ('REPERTOIRE', 'Songs and Repertoire'), ('CREATIVITY', 'Creativity')], max_length=20, null=True)), ('practice_item', models.CharField(max_length=50)), ('practice_time', models.CharField(blank=True, max_length=50, null=True)), ('practice_speed', models.CharField(blank=True, max_length=50, null=True)), ('practice_notes', models.TextField(blank=True, null=True)), ('practice_date', models.DateTimeField(blank=True, max_length=50, null=True)), ('practice_item_created', models.DateTimeField(auto_now_add=True)), ('practice_item_updated', models.DateTimeField(auto_now=True)), ('practice_item_created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='log_created_user', to=settings.AUTH_USER_MODEL)), ('practice_item_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='log_updated_user', to=settings.AUTH_USER_MODEL)), ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_log', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='StudentWishList', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('wish_item', models.CharField(max_length=250)), ('wish_item_complete', models.BooleanField(default=False)), ('wish_item_complete_date', models.DateTimeField(blank=True, max_length=50, null=True)), ('wish_item_notes', models.TextField(blank=True, null=True)), ('wish_item_created', models.DateTimeField(auto_now_add=True)), ('wish_item_updated', models.DateTimeField(auto_now_add=True)), ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='student_wishlist', to=settings.AUTH_USER_MODEL)), ('wish_item_created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wish_item_created_user', to=settings.AUTH_USER_MODEL)), ('wish_item_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='wish_item_updated_user', to=settings.AUTH_USER_MODEL)), ], ), migrations.AddField( model_name='studentplanfile', name='plan_section', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_section_file', to='users.StudentPlanSection'), ), migrations.AddField( model_name='user', name='location', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='user_location', to='users.Location'), ), migrations.AddField( model_name='user', name='student_plan', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plan_student', to='users.StudentPlan'), ), migrations.AddField( model_name='user', name='user_created_by', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='created_user', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='user', name='user_updated_by', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='updated_user', to=settings.AUTH_USER_MODEL), ), ]
72.87234
329
0.642394
1,937
17,125
5.446567
0.100155
0.060569
0.042464
0.06673
0.801043
0.747109
0.700095
0.596209
0.545877
0.478389
0
0.008839
0.213839
17,125
234
330
73.183761
0.77479
0.003912
0
0.327434
1
0
0.162943
0.018294
0
0
0
0
0
1
0
false
0.004425
0.022124
0
0.039823
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c1d423eb38950bc54f15652b5405d5d19aff3bb0
12,829
py
Python
sample_db/alembic/b049c50f01a6_update_model.py
brazil-data-cube/sample-db
296f98247fa26c58c8964de52e171c7df679edbb
[ "MIT" ]
1
2020-02-25T19:59:53.000Z
2020-02-25T19:59:53.000Z
sample_db/alembic/b049c50f01a6_update_model.py
fabianazioti/sample-db
1c65c6e281f8f900fc7ebd9ee37c99e704e316f0
[ "MIT" ]
45
2020-02-19T16:40:13.000Z
2022-01-18T14:05:12.000Z
sample_db/alembic/b049c50f01a6_update_model.py
fabianazioti/sample-db
1c65c6e281f8f900fc7ebd9ee37c99e704e316f0
[ "MIT" ]
1
2020-02-19T16:01:14.000Z
2020-02-19T16:01:14.000Z
"""update model. Revision ID: b049c50f01a6 Revises: 752b10fba4f9 Create Date: 2021-04-15 09:34:16.783824 """ from alembic import op import sqlalchemy as sa from sqlalchemy.orm.session import Session from lccs_db.models import LucClassificationSystem from sample_db.models import Datasets, CollectMethod, DatasetView from sample_db.models.dataset_table import DatasetType # revision identifiers, used by Alembic. revision = 'b049c50f01a6' down_revision = '752b10fba4f9' branch_labels = () depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### session = Session(bind=op.get_bind()) session.execute(f"DROP VIEW IF EXISTS {DatasetView.__table__}") dataset_type = DatasetType() dataset_type.create() session.commit() op.alter_column('collect_method', 'name', existing_type=sa.VARCHAR(), nullable=False, schema='sampledb') op.create_unique_constraint(op.f('collect_method_name_key'), 'collect_method', ['name'], schema='sampledb') op.create_index(op.f('idx_sampledb_collect_method_name'), 'collect_method', ['name'], unique=False, schema='sampledb') op.alter_column('datasets', 'observation_table_name', new_column_name='dataset_table_name', schema='sampledb') op.add_column('datasets', sa.Column('is_public', sa.Boolean(), nullable=False, server_default='t'), schema='sampledb') op.add_column('datasets', sa.Column('title', sa.String(length=255), nullable=False, server_default='Titulo'), schema='sampledb') op.add_column('datasets', sa.Column('version_predecessor', sa.Integer(), nullable=True), schema='sampledb') op.add_column('datasets', sa.Column('version_successor', sa.Integer(), nullable=True), schema='sampledb') op.alter_column('datasets', 'name', existing_type=sa.VARCHAR(), nullable=False, schema='sampledb') op.alter_column('datasets', 'version', existing_type=sa.VARCHAR(), nullable=False, schema='sampledb') op.create_unique_constraint(op.f('datasets_name_key'), 'datasets', ['name', 'version'], schema='sampledb') op.create_index('idx_datasets_start_date_end_date', 'datasets', ['start_date', 'end_date'], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_datasets_classification_system_id'), 'datasets', ['classification_system_id'], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_datasets_collect_method_id'), 'datasets', ['collect_method_id'], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_datasets_name'), 'datasets', ['name'], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_datasets_start_date'), 'datasets', [sa.text('start_date DESC')], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_datasets_user_id'), 'datasets', ['user_id'], unique=False, schema='sampledb') op.drop_constraint('datasets_collect_method_id_collect_method_fkey', 'datasets', schema='sampledb', type_='foreignkey') op.drop_constraint('datasets_classification_system_id_class_systems_fkey', 'datasets', schema='sampledb', type_='foreignkey') op.drop_constraint('datasets_user_id_users_fkey', 'datasets', schema='sampledb', type_='foreignkey') op.create_foreign_key(op.f('datasets_version_predecessor_datasets_fkey'), 'datasets', 'datasets', ['version_predecessor'], ['id'], source_schema='sampledb', referent_schema='sampledb', onupdate='CASCADE', ondelete='CASCADE') op.create_foreign_key(op.f('datasets_version_successor_datasets_fkey'), 'datasets', 'datasets', ['version_successor'], ['id'], source_schema='sampledb', referent_schema='sampledb', onupdate='CASCADE', ondelete='CASCADE') op.create_foreign_key(op.f('datasets_collect_method_id_collect_method_fkey'), 'datasets', 'collect_method', ['collect_method_id'], ['id'], source_schema='sampledb', referent_schema='sampledb', onupdate='CASCADE', ondelete='CASCADE') op.create_foreign_key(op.f('datasets_classification_system_id_class_systems_fkey'), 'datasets', 'class_systems', ['classification_system_id'], ['id'], source_schema='sampledb', referent_schema='lccs', onupdate='CASCADE', ondelete='CASCADE') op.create_foreign_key(op.f('datasets_user_id_users_fkey'), 'datasets', 'users', ['user_id'], ['id'], source_schema='sampledb', referent_schema='sampledb', ondelete='CASCADE') op.drop_column('datasets', 'midias_table_name', schema='sampledb') op.create_index(op.f('idx_sampledb_provenance_dataset_id'), 'provenance', ['dataset_id'], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_provenance_dataset_parent_id'), 'provenance', ['dataset_parent_id'], unique=False, schema='sampledb') op.drop_constraint('provenance_dataset_id_datasets_fkey', 'provenance', schema='sampledb', type_='foreignkey') op.drop_constraint('provenance_dataset_parent_id_datasets_fkey', 'provenance', schema='sampledb', type_='foreignkey') op.create_foreign_key(op.f('provenance_dataset_id_datasets_fkey'), 'provenance', 'datasets', ['dataset_id'], ['id'], source_schema='sampledb', referent_schema='sampledb', onupdate='CASCADE', ondelete='CASCADE') op.create_foreign_key(op.f('provenance_dataset_parent_id_datasets_fkey'), 'provenance', 'datasets', ['dataset_parent_id'], ['id'], source_schema='sampledb', referent_schema='sampledb', onupdate='CASCADE', ondelete='CASCADE') op.create_index(op.f('idx_sampledb_users_email'), 'users', ['email'], unique=False, schema='sampledb') op.create_index(op.f('idx_sampledb_users_full_name'), 'users', ['full_name'], unique=False, schema='sampledb') op.create_unique_constraint(op.f('users_email_key'), 'users', ['email'], schema='sampledb') session.execute("CREATE VIEW {} AS " \ "SELECT datasets.created_at, datasets.updated_at, datasets.id, datasets.name, " \ "datasets.title, datasets.start_date, datasets.end_date, datasets.dataset_table_name, " \ "datasets.version, datasets.version_successor, datasets.version_predecessor, " \ "datasets.description, class_systems.name AS classification_system_name, " \ "class_systems.id AS classification_system_id, class_systems.version AS classification_system_version, " \ "users.id AS user_id, users.full_name AS user_name, collect_method.name AS collect_method_name, " \ "collect_method.id AS collect_method_id, " \ "datasets.metadata_json, datasets.is_public " "FROM {} AS datasets, {} AS class_systems, {} AS users, {} AS collect_method " \ "WHERE users.id = datasets.user_id " \ "AND class_systems.id = datasets.classification_system_id " \ "AND collect_method.id = datasets.collect_method_id;" .format(DatasetView.__table__, Datasets.__table__, LucClassificationSystem.__table__, 'sampledb.users', CollectMethod.__table__) ) session.commit() # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_constraint(op.f('users_email_key'), 'users', schema='sampledb', type_='unique') op.drop_index(op.f('idx_sampledb_users_full_name'), table_name='users', schema='sampledb') op.drop_index(op.f('idx_sampledb_users_email'), table_name='users', schema='sampledb') op.drop_constraint(op.f('provenance_dataset_parent_id_datasets_fkey'), 'provenance', schema='sampledb', type_='foreignkey') op.drop_constraint(op.f('provenance_dataset_id_datasets_fkey'), 'provenance', schema='sampledb', type_='foreignkey') op.create_foreign_key('provenance_dataset_parent_id_datasets_fkey', 'provenance', 'datasets', ['dataset_parent_id'], ['id'], source_schema='sampledb', referent_schema='sampledb') op.create_foreign_key('provenance_dataset_id_datasets_fkey', 'provenance', 'datasets', ['dataset_id'], ['id'], source_schema='sampledb', referent_schema='sampledb') op.drop_index(op.f('idx_sampledb_provenance_dataset_parent_id'), table_name='provenance', schema='sampledb') op.drop_index(op.f('idx_sampledb_provenance_dataset_id'), table_name='provenance', schema='sampledb') op.add_column('datasets', sa.Column('midias_table_name', sa.VARCHAR(), autoincrement=False, nullable=True), schema='sampledb') op.drop_constraint(op.f('datasets_user_id_users_fkey'), 'datasets', schema='sampledb', type_='foreignkey') op.drop_constraint(op.f('datasets_classification_system_id_class_systems_fkey'), 'datasets', schema='sampledb', type_='foreignkey') op.drop_constraint(op.f('datasets_collect_method_id_collect_method_fkey'), 'datasets', schema='sampledb', type_='foreignkey') op.drop_constraint(op.f('datasets_version_successor_datasets_fkey'), 'datasets', schema='sampledb', type_='foreignkey') op.drop_constraint(op.f('datasets_version_predecessor_datasets_fkey'), 'datasets', schema='sampledb', type_='foreignkey') op.create_foreign_key('datasets_user_id_users_fkey', 'datasets', 'users', ['user_id'], ['id'], source_schema='sampledb', referent_schema='sampledb') op.create_foreign_key('datasets_classification_system_id_class_systems_fkey', 'datasets', 'class_systems', ['classification_system_id'], ['id'], source_schema='sampledb', referent_schema='lccs') op.create_foreign_key('datasets_collect_method_id_collect_method_fkey', 'datasets', 'collect_method', ['collect_method_id'], ['id'], source_schema='sampledb', referent_schema='sampledb') op.drop_index(op.f('idx_sampledb_datasets_user_id'), table_name='datasets', schema='sampledb') op.drop_index(op.f('idx_sampledb_datasets_start_date'), table_name='datasets', schema='sampledb') op.drop_index(op.f('idx_sampledb_datasets_name'), table_name='datasets', schema='sampledb') op.drop_index(op.f('idx_sampledb_datasets_collect_method_id'), table_name='datasets', schema='sampledb') op.drop_index(op.f('idx_sampledb_datasets_classification_system_id'), table_name='datasets', schema='sampledb') op.drop_index('idx_datasets_start_date_end_date', table_name='datasets', schema='sampledb') op.drop_constraint(op.f('datasets_name_key'), 'datasets', schema='sampledb', type_='unique') op.alter_column('datasets', 'version', existing_type=sa.VARCHAR(), nullable=True, schema='sampledb') op.alter_column('datasets', 'name', existing_type=sa.VARCHAR(), nullable=True, schema='sampledb') op.drop_column('datasets', 'version_successor', schema='sampledb') op.drop_column('datasets', 'version_predecessor', schema='sampledb') op.drop_column('datasets', 'title', schema='sampledb') op.drop_column('datasets', 'is_public', schema='sampledb') op.alter_column('datasets', 'dataset_table_name', new_column_name='observation_table_name', schema='sampledb') op.drop_index(op.f('idx_sampledb_collect_method_name'), table_name='collect_method', schema='sampledb') op.drop_constraint(op.f('collect_method_name_key'), 'collect_method', schema='sampledb', type_='unique') op.alter_column('collect_method', 'name', existing_type=sa.VARCHAR(), nullable=True, schema='sampledb') session = Session(bind=op.get_bind()) dataset_type = DatasetType() dataset_type.drop() session.commit() session.execute("CREATE OR REPLACE VIEW {} AS " \ "SELECT datasets.created_at, datasets.updated_at, datasets.id, datasets.name, " \ "datasets.start_date, datasets.end_date, datasets.observation_table_name, " \ "datasets.midias_table_name, datasets.metadata_json, datasets.version, " \ "datasets.description, class_systems.name AS classification_system_name, " \ "users.full_name AS user_name, collect_method.name AS collect_method " \ "FROM {} AS datasets, {} AS class_systems, {} AS users, {} AS collect_method " \ "WHERE users.id = datasets.user_id " \ "AND class_systems.id = datasets.classification_system_id " \ "AND collect_method.id = datasets.collect_method_id;" .format(DatasetView.__table__, Datasets.__table__, LucClassificationSystem.__table__, 'sampledb.users', CollectMethod.__table__) ) session.commit() # ### end Alembic commands ###
72.892045
244
0.702315
1,520
12,829
5.573684
0.088158
0.1322
0.084986
0.025968
0.847144
0.805949
0.784821
0.707979
0.640935
0.570703
0
0.00489
0.155195
12,829
175
245
73.308571
0.776804
0.022995
0
0.369863
0
0
0.443146
0.189165
0
0
0
0
0
1
0.013699
false
0
0.041096
0
0.054795
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c1e7045b62b93f3edc86cb15d8f64d637a754b61
129
py
Python
apps/plugins/__init__.py
jiangyx3915/-graph-bed
f4a228709783f97e73601076700e0bf37b7a4af2
[ "MIT" ]
10
2019-03-04T14:01:09.000Z
2020-03-06T06:26:54.000Z
apps/plugins/__init__.py
jiangyx3915/-graph-bed
f4a228709783f97e73601076700e0bf37b7a4af2
[ "MIT" ]
1
2019-03-09T09:14:22.000Z
2019-03-09T09:14:22.000Z
apps/plugins/__init__.py
jiangyx3915/-graph-bed
f4a228709783f97e73601076700e0bf37b7a4af2
[ "MIT" ]
2
2019-10-17T11:20:52.000Z
2020-02-29T12:51:37.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- """ __author__= 'jiangyixin' __time__ = 2019/2/25 22:11 """ from .smms import SmPlugin
16.125
26
0.643411
18
129
4.166667
1
0
0
0
0
0
0
0
0
0
0
0.108108
0.139535
129
7
27
18.428571
0.567568
0.697674
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
c1f398117f1a326140cec52aa0bee0316ad4c9fa
94
py
Python
covid19_id/data/data_key_doc.py
hexatester/covid19-id
8d8aa3f9092a40461a308f4db054ab4f95374849
[ "MIT" ]
null
null
null
covid19_id/data/data_key_doc.py
hexatester/covid19-id
8d8aa3f9092a40461a308f4db054ab4f95374849
[ "MIT" ]
null
null
null
covid19_id/data/data_key_doc.py
hexatester/covid19-id
8d8aa3f9092a40461a308f4db054ab4f95374849
[ "MIT" ]
null
null
null
import attr @attr.dataclass(slots=True) class DataKeyDoc: key: str doc_count: float
11.75
27
0.712766
13
94
5.076923
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.202128
94
7
28
13.428571
0.88
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.2
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
a9c2808382f784cb0d01f035b6c4c9f1d02b4179
91
py
Python
src/apps/core/purpleserver/providers/apps.py
blueprin4/purplship-server
e4817d6f6fb358adb10eab81153cf564fdcbc784
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
src/apps/core/purpleserver/providers/apps.py
blueprin4/purplship-server
e4817d6f6fb358adb10eab81153cf564fdcbc784
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
src/apps/core/purpleserver/providers/apps.py
blueprin4/purplship-server
e4817d6f6fb358adb10eab81153cf564fdcbc784
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class CarriersConfig(AppConfig): name = 'carriers'
15.166667
33
0.758242
10
91
6.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.164835
91
5
34
18.2
0.907895
0
0
0
0
0
0.087912
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a9c303c7651ce9299a1ac6e4a8b2222a49258cc4
29
py
Python
venv-lib/lib/python3.7/heapq.py
migmaciasdiaz/venvs
bcdbb75931cb27fc4b5b30f12fc44be85952157e
[ "MIT" ]
2
2020-03-30T14:17:10.000Z
2020-10-04T12:33:00.000Z
venv-lib/lib/python3.7/heapq.py
migmaciasdiaz/venvs
bcdbb75931cb27fc4b5b30f12fc44be85952157e
[ "MIT" ]
1
2020-11-24T03:31:13.000Z
2020-11-24T03:31:13.000Z
venv/lib/python3.7/heapq.py
wensu425/aws-eb-webapp
4b149c75c11fe5b33c9a080313ec336fabb45824
[ "MIT" ]
1
2021-05-04T09:18:22.000Z
2021-05-04T09:18:22.000Z
/usr/lib64/python3.7/heapq.py
29
29
0.793103
6
29
3.833333
1
0
0
0
0
0
0
0
0
0
0
0.137931
0
29
1
29
29
0.655172
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
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
4
a9c79cd015d75712a4c22eb1fc6f5f4a52fef2b1
161
py
Python
tests/__init__.py
mochazi/objprint
49bc213073ec56a4bed63fb5180240f6c01df6eb
[ "Apache-2.0" ]
191
2021-03-10T09:41:02.000Z
2022-03-30T19:15:39.000Z
tests/__init__.py
mochazi/objprint
49bc213073ec56a4bed63fb5180240f6c01df6eb
[ "Apache-2.0" ]
46
2021-03-02T02:09:39.000Z
2022-03-26T11:22:05.000Z
tests/__init__.py
mochazi/objprint
49bc213073ec56a4bed63fb5180240f6c01df6eb
[ "Apache-2.0" ]
12
2021-02-28T21:43:58.000Z
2022-03-23T11:44:47.000Z
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/gaogaotiantian/objprint/blob/master/NOTICE.txt
53.666667
80
0.78882
24
161
5.291667
0.916667
0
0
0
0
0
0
0
0
0
0
0.013333
0.068323
161
2
81
80.5
0.833333
0.968944
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
a9d6394cbafef67aa24df9ceb6a762f59a0f9eda
120
py
Python
winrm/error.py
invliD/python-winrm-client
54f9f248f931901ad0fb6b9d23cd32253c843c77
[ "Apache-2.0" ]
null
null
null
winrm/error.py
invliD/python-winrm-client
54f9f248f931901ad0fb6b9d23cd32253c843c77
[ "Apache-2.0" ]
null
null
null
winrm/error.py
invliD/python-winrm-client
54f9f248f931901ad0fb6b9d23cd32253c843c77
[ "Apache-2.0" ]
null
null
null
class WinRMError(Exception): def __init__(self, code, msg): super(Exception, self).__init__(msg) self.code = code
20
38
0.725
16
120
4.9375
0.5625
0.202532
0
0
0
0
0
0
0
0
0
0
0.141667
120
5
39
24
0.76699
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
a9d8af22cd727045a637d77c7aaa1e7f30abaa24
64
py
Python
tests/__init__.py
vfxetc/sgevents
dcb9d71f11dcbeb6aa2847743416915e1a3f7eb3
[ "BSD-3-Clause" ]
2
2017-09-27T00:11:33.000Z
2019-07-19T01:20:23.000Z
tests/__init__.py
vfxetc/sgevents
dcb9d71f11dcbeb6aa2847743416915e1a3f7eb3
[ "BSD-3-Clause" ]
null
null
null
tests/__init__.py
vfxetc/sgevents
dcb9d71f11dcbeb6aa2847743416915e1a3f7eb3
[ "BSD-3-Clause" ]
2
2017-07-04T18:55:48.000Z
2019-07-19T01:20:25.000Z
from unittest import TestCase from sgevents.event import Event
16
32
0.84375
9
64
6
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.140625
64
3
33
21.333333
0.981818
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e712f68522d502cde822aefd9c219cea2965ddac
93
py
Python
cosplay_codex/costumes/admin.py
vetaylor/cosplay-codex
d57a5555e18ded974715d3908ff1f8bc8f100cc7
[ "MIT" ]
null
null
null
cosplay_codex/costumes/admin.py
vetaylor/cosplay-codex
d57a5555e18ded974715d3908ff1f8bc8f100cc7
[ "MIT" ]
null
null
null
cosplay_codex/costumes/admin.py
vetaylor/cosplay-codex
d57a5555e18ded974715d3908ff1f8bc8f100cc7
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Costume admin.site.register(Costume)
13.285714
32
0.806452
13
93
5.769231
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.129032
93
6
33
15.5
0.925926
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
0
0
0
4
e7404fcc4462a351532af0d479125f1266fff3bf
220
py
Python
OpenGLCffi/GL/EXT/SGIS/point_parameters.py
cydenix/OpenGLCffi
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
[ "MIT" ]
null
null
null
OpenGLCffi/GL/EXT/SGIS/point_parameters.py
cydenix/OpenGLCffi
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
[ "MIT" ]
null
null
null
OpenGLCffi/GL/EXT/SGIS/point_parameters.py
cydenix/OpenGLCffi
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
[ "MIT" ]
null
null
null
from OpenGLCffi.GL import params @params(api='gl', prms=['pname', 'param']) def glPointParameterfSGIS(pname, param): pass @params(api='gl', prms=['pname', 'params']) def glPointParameterfvSGIS(pname, params): pass
18.333333
43
0.713636
27
220
5.814815
0.481481
0.11465
0.140127
0.191083
0.254777
0
0
0
0
0
0
0
0.109091
220
11
44
20
0.80102
0
0
0.285714
0
0
0.114679
0
0
0
0
0
0
1
0.285714
false
0.285714
0.142857
0
0.428571
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
e776c4dd9745b2574588ee0bf96e2f7566a00ba6
959
py
Python
website/userData.py
marvkey/onlineDatabsase
578fc31a11321aab61fe61425d79c0139cf8c221
[ "Apache-2.0" ]
null
null
null
website/userData.py
marvkey/onlineDatabsase
578fc31a11321aab61fe61425d79c0139cf8c221
[ "Apache-2.0" ]
null
null
null
website/userData.py
marvkey/onlineDatabsase
578fc31a11321aab61fe61425d79c0139cf8c221
[ "Apache-2.0" ]
null
null
null
from sqlalchemy.sql.expression import false from . import db from flask_login import UserMixin from sqlalchemy.sql import func class User(db.Model,UserMixin): id = db.Column(db.Integer, primary_key=True) email =db.Column(db.String(150),unique=True) firstname = db.Column(db.String(150)) lastname = db.Column(db.String(150)) username = db.Column(db.String(150)) password = db.Column(db.String(150)) date_created = db.Column(db.DateTime(timezone=True), default=func.now()) file =db.relationship("SavedItem",backref="user",passive_deletes=True) class SavedItem(db.Model): id = db.Column(db.Integer,primary_key=True) file = db.Column(db.LargeBinary) name = db.Column(db.String(150),nullable=False) Description = db.Column(db.String(1000)) date_created = db.Column(db.DateTime(timezone=True),default=func.now()) author = db.Column(db.Integer, db.ForeignKey('user.id', ondelete="CASCADE"), nullable=False)
39.958333
96
0.72367
139
959
4.94964
0.352518
0.151163
0.188953
0.162791
0.421512
0.255814
0.255814
0.255814
0.159884
0.159884
0
0.026347
0.129301
959
24
96
39.958333
0.797605
0
0
0.2
0
0
0.028125
0
0
0
0
0
0
1
0
false
0.1
0.2
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
82152f77d1f167c816fe8b2ad17601abcccdcfd7
338
py
Python
acl_service/service/database/database.py
justintrudell/medfs
1e84203205dbafdbd4005dddccce7adb7ef3b144
[ "Apache-2.0" ]
null
null
null
acl_service/service/database/database.py
justintrudell/medfs
1e84203205dbafdbd4005dddccce7adb7ef3b144
[ "Apache-2.0" ]
1
2021-01-28T19:47:23.000Z
2021-01-28T19:47:23.000Z
acl_service/service/database/database.py
justintrudell/medfs
1e84203205dbafdbd4005dddccce7adb7ef3b144
[ "Apache-2.0" ]
null
null
null
from sqlalchemy import create_engine from os import environ db_string = "postgresql://%s:%s@%s:%s/%s" % ( environ.get("ACL_SVC_DB_USER"), environ.get("ACL_SVC_DB_PASS"), environ.get("ACL_SVC_DB_URL"), environ.get("ACL_SVC_DB_PORT"), environ.get("ACL_SVC_DB_NAME"), ) db = create_engine(db_string, pool_pre_ping=True)
28.166667
49
0.713018
56
338
3.928571
0.410714
0.227273
0.295455
0.363636
0.409091
0
0
0
0
0
0
0
0.130178
338
11
50
30.727273
0.748299
0
0
0
0
0
0.298817
0.079882
0
0
0
0
0
1
0
false
0.1
0.2
0
0.2
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
82195c95226cf73443ef2e41cbd2e6ea68c7f11b
361
py
Python
chat-server/src/chatter/schema/types/chat_message.py
rob-blackbourn/chatter
1fcda16d8924b99f792683db690172f104d1533d
[ "Apache-2.0" ]
1
2019-05-18T17:05:38.000Z
2019-05-18T17:05:38.000Z
chat-server/src/chatter/schema/types/chat_message.py
rob-blackbourn/chatter
1fcda16d8924b99f792683db690172f104d1533d
[ "Apache-2.0" ]
6
2021-03-09T03:49:26.000Z
2022-02-26T10:50:38.000Z
chat-server/src/chatter/schema/types/chat_message.py
rob-blackbourn/chatter
1fcda16d8924b99f792683db690172f104d1533d
[ "Apache-2.0" ]
null
null
null
from graphql import ( GraphQLObjectType, GraphQLField, GraphQLNonNull, GraphQLString ) ChatMessageType = GraphQLObjectType( 'ChatMessageType', lambda: { 'timestamp': GraphQLField(GraphQLNonNull(GraphQLString)), 'email': GraphQLField(GraphQLNonNull(GraphQLString)), 'content': GraphQLField(GraphQLString) } )
22.5625
65
0.692521
22
361
11.363636
0.545455
0.312
0.468
0
0
0
0
0
0
0
0
0
0.210526
361
15
66
24.066667
0.877193
0
0
0
0
0
0.099723
0
0
0
0
0
0
1
0
false
0
0.071429
0
0.071429
0
1
0
1
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
821cdfc7341c60ceb2082af14f96e549c30418c0
156
py
Python
web_frameworks/resources/forms.py
Minkov/python-web-frameworks-2020-11
5857bb626792a9efe1f2d06677fa3779f5e2cc1d
[ "MIT" ]
4
2020-11-21T20:06:39.000Z
2020-12-15T13:30:23.000Z
web_frameworks/resources/forms.py
Minkov/python-web-frameworks-2020-11
5857bb626792a9efe1f2d06677fa3779f5e2cc1d
[ "MIT" ]
null
null
null
web_frameworks/resources/forms.py
Minkov/python-web-frameworks-2020-11
5857bb626792a9efe1f2d06677fa3779f5e2cc1d
[ "MIT" ]
null
null
null
from django import forms from resources.models import Pet class PetForm(forms.ModelForm): class Meta: model = Pet fields = '__all__'
15.6
32
0.673077
19
156
5.315789
0.736842
0
0
0
0
0
0
0
0
0
0
0
0.262821
156
9
33
17.333333
0.878261
0
0
0
0
0
0.044872
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
414cbd37f991cac5179e7f3a1672626ccb78eebd
92
py
Python
Conteudo das Aulas/015/Exercicios/Exercicio 2.py
cerberus707/lab-python
ebba3c9cde873d70d4bb61084f79ce30b7f9e047
[ "Apache-2.0" ]
null
null
null
Conteudo das Aulas/015/Exercicios/Exercicio 2.py
cerberus707/lab-python
ebba3c9cde873d70d4bb61084f79ce30b7f9e047
[ "Apache-2.0" ]
null
null
null
Conteudo das Aulas/015/Exercicios/Exercicio 2.py
cerberus707/lab-python
ebba3c9cde873d70d4bb61084f79ce30b7f9e047
[ "Apache-2.0" ]
null
null
null
""" Dados n e uma seqüência de n números inteiros, determinar a soma dos números pares. """
18.4
46
0.728261
15
92
4.466667
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.184783
92
4
47
23
0.893333
0.902174
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
4153a68064c10817db7d5413400bd5a1ff7a76b2
117
py
Python
app/schemas/__init__.py
akrisanov/dataset-catalog
fa55ae2097dfd10f89021971ae9b14c830990c47
[ "MIT" ]
null
null
null
app/schemas/__init__.py
akrisanov/dataset-catalog
fa55ae2097dfd10f89021971ae9b14c830990c47
[ "MIT" ]
null
null
null
app/schemas/__init__.py
akrisanov/dataset-catalog
fa55ae2097dfd10f89021971ae9b14c830990c47
[ "MIT" ]
null
null
null
from .dataset import Dataset, DatasetList from .response import error_response, paginator_params, page_data, Message
39
74
0.846154
15
117
6.4
0.733333
0
0
0
0
0
0
0
0
0
0
0
0.102564
117
2
75
58.5
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
416d6ca454aa746fdb0f5a07093b19ce5b083da4
463
py
Python
k0de/upgraded/upgraded.py
metaperl/karatbars-utils
8e7490a6380471549406efb03df85d0df5f73d86
[ "MIT" ]
null
null
null
k0de/upgraded/upgraded.py
metaperl/karatbars-utils
8e7490a6380471549406efb03df85d0df5f73d86
[ "MIT" ]
null
null
null
k0de/upgraded/upgraded.py
metaperl/karatbars-utils
8e7490a6380471549406efb03df85d0df5f73d86
[ "MIT" ]
2
2017-10-28T23:51:12.000Z
2019-08-28T15:20:44.000Z
#!/usr/bin/python class Marketer: def __init__(self, kbid, url=None): self.kbid=kbid self.url=url class Node: def __init__(self, data, left=None, right=None): self.data=data self.left=left self.right=right rows = [ [ 'sbsmarketing' ], 'kaelson amaboe'.split(), [ 'sweatgold', None, None, 'matosinho' ], [ 'herotti', None, None, None, None, None, None, None ] ] for row in rows: print row
19.291667
61
0.585313
59
463
4.457627
0.457627
0.212928
0.228137
0.243346
0.106464
0.106464
0
0
0
0
0
0
0.269978
463
23
62
20.130435
0.778107
0.034557
0
0
0
0
0.11435
0
0
0
0
0
0
0
null
null
0
0
null
null
0.058824
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
417cc99f39870fa7b1726658029e8cc662c55af7
259
py
Python
adain/model/layers/__init__.py
srihari-humbarwadi/adain-tensorflow2.x
c0da16e4d39d5316683ed0988787aedbb1c9768c
[ "MIT" ]
6
2020-12-27T08:20:19.000Z
2021-07-03T10:28:21.000Z
adain/model/layers/__init__.py
srihari-humbarwadi/adain-tensorflow2.x
c0da16e4d39d5316683ed0988787aedbb1c9768c
[ "MIT" ]
null
null
null
adain/model/layers/__init__.py
srihari-humbarwadi/adain-tensorflow2.x
c0da16e4d39d5316683ed0988787aedbb1c9768c
[ "MIT" ]
null
null
null
from adain.model.layers.adaptive_instance_normalization import \ AdaptiveInstanceNormalization # noqa: E501 from adain.model.layers.reflection_padding_2d import ReflectionPadding2D __all__ = ['AdaptiveInstanceNormalization', 'ReflectionPadding2D']
43.166667
73
0.830116
23
259
9
0.695652
0.086957
0.135266
0.193237
0
0
0
0
0
0
0
0.025862
0.104247
259
5
74
51.8
0.866379
0.03861
0
0
0
0
0.198347
0.119835
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
419d98be28605b53f5a919966b6e96fd2fbf9a25
95
py
Python
cgnal/core/data/model/__init__.py
CGnal/cgnal-core
cb0981194fb703c5b4ca65f9e61c8b3813abeafb
[ "MIT" ]
9
2022-02-25T14:47:57.000Z
2022-03-16T09:59:35.000Z
cgnal/core/data/model/__init__.py
CGnal/cgnal-core
cb0981194fb703c5b4ca65f9e61c8b3813abeafb
[ "MIT" ]
15
2022-02-25T09:30:54.000Z
2022-03-25T08:43:41.000Z
cgnal/core/data/model/__init__.py
CGnal/cgnal-core
cb0981194fb703c5b4ca65f9e61c8b3813abeafb
[ "MIT" ]
2
2022-03-04T15:36:50.000Z
2022-03-07T13:55:01.000Z
""" Data model module. In this module the data types used in CGnal framework are defined. """
15.833333
66
0.726316
15
95
4.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.189474
95
5
67
19
0.896104
0.905263
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
68dc3a06e865ff568490d1ea5ae8f42a543fc5b6
440
py
Python
unsupervised_meta_learning/cdfsl-benchmark/configs.py
ojss/c3lr
a018c5a793a2c9eedc3f0fefcca0970f0be35ffc
[ "Apache-2.0" ]
3
2022-02-24T07:02:12.000Z
2022-03-20T18:33:58.000Z
unsupervised_meta_learning/cdfsl-benchmark/configs.py
ojss/c3lr
a018c5a793a2c9eedc3f0fefcca0970f0be35ffc
[ "Apache-2.0" ]
null
null
null
unsupervised_meta_learning/cdfsl-benchmark/configs.py
ojss/c3lr
a018c5a793a2c9eedc3f0fefcca0970f0be35ffc
[ "Apache-2.0" ]
null
null
null
save_dir = './logs' # miniImageNet_path = '../../semifew_data/miniImagenetFullSize' miniImageNet_path = '/home/ojas/projects/unsupervised-meta-learning/data/untarred/miniImagenetFullSize' ISIC_path = "../../semifew_data/ISIC" ChestX_path = "../../semifew_data/chestX" CropDisease_path = "../../semifew_data/plant-disease" EuroSAT_path = "/home/ojas/projects/unsupervised-meta-learning/data/untarred/EuroSat"
44
103
0.715909
46
440
6.608696
0.456522
0.144737
0.197368
0.131579
0.368421
0.368421
0.368421
0.368421
0.368421
0
0
0
0.122727
440
9
104
48.888889
0.787565
0.163636
0
0
0
0
0.642077
0.625683
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
68e821ad0cc4c36909c8737c64b19df6e12dc0b3
561
py
Python
furuta/furuta_env_t_ppo.py
rravenel/furuta_pendulum
b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f
[ "MIT" ]
2
2021-09-23T16:29:23.000Z
2021-09-30T19:55:44.000Z
furuta/furuta_env_t_ppo.py
rravenel/furuta_pendulum
b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f
[ "MIT" ]
null
null
null
furuta/furuta_env_t_ppo.py
rravenel/furuta_pendulum
b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f
[ "MIT" ]
null
null
null
import math import numpy as np from gym import spaces import furuta_env_torque as fet import common as cm class FurutaEnvTorquePpo2(fet.FurutaEnvTorque): def __init__(self, state, render=False): super(FurutaEnvTorquePpo2, self).__init__(state=state, action_space=spaces.Box(np.array([-1]), np.array([1])), render=render) def decodeAction(self, action): return action def compute_reward(self, action, done=None): return math.cos(abs(cm.rad2Norm(self.pole_angle_real))) - abs(self.decodeAction(action)) * 0.0001
28.05
133
0.71836
77
561
5.051948
0.558442
0.03599
0.041131
0
0
0
0
0
0
0
0
0.021459
0.16934
561
19
134
29.526316
0.813305
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.416667
0.166667
0.916667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
ec1951b8548b4a690f743b8946380f6de1e7b65f
7,990
py
Python
appserver/neo4japp/services/annotations/data_transfer_objects/dto.py
SBRG/lifelike
a7b715f38b389a585c10e6d0d067345937455c13
[ "MIT" ]
8
2022-01-28T08:43:07.000Z
2022-03-23T11:18:10.000Z
appserver/neo4japp/services/annotations/data_transfer_objects/dto.py
SBRG/lifelike
a7b715f38b389a585c10e6d0d067345937455c13
[ "MIT" ]
23
2022-02-14T15:25:00.000Z
2022-03-28T15:30:45.000Z
appserver/neo4japp/services/annotations/data_transfer_objects/dto.py
SBRG/lifelike
a7b715f38b389a585c10e6d0d067345937455c13
[ "MIT" ]
5
2022-01-28T15:45:44.000Z
2022-03-14T11:36:49.000Z
import attr from typing import Dict, List, Optional, Set, Tuple from neo4japp.util import CamelDictMixin @attr.s(slots=True) class NLPResults(): anatomy: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) chemicals: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) compounds: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) diseases: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) foods: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) genes: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) phenomenas: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) phenotypes: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) proteins: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) species: Set[Tuple[int, int]] = attr.ib(default=attr.Factory(set)) @attr.s(slots=True) class PDFWord(): keyword: str = attr.ib() normalized_keyword: str = attr.ib() page_number: int = attr.ib() lo_location_offset: int = attr.ib() hi_location_offset: int = attr.ib() # used to determine abbreviations # if word is wrapped in parenthesis # this attribute will not be empty string previous_words: str = attr.ib() heights: List[float] = attr.ib(default=attr.Factory(list)) widths: List[float] = attr.ib(default=attr.Factory(list)) coordinates: List[List[float]] = attr.ib(default=attr.Factory(list)) @attr.s(frozen=False) class Annotation(CamelDictMixin): @attr.s(frozen=False) class Meta(CamelDictMixin): @attr.s(frozen=True) class Links(CamelDictMixin): ncbi: str = attr.ib(default='') uniprot: str = attr.ib(default='') mesh: str = attr.ib(default='') chebi: str = attr.ib(default='') pubchem: str = attr.ib(default='') wikipedia: str = attr.ib(default='') google: str = attr.ib(default='') type: str = attr.ib() links: Links = attr.ib() id: str = attr.ib() id_type: str = attr.ib() id_hyperlinks: List[str] = attr.ib() is_custom: bool = attr.ib(default=False) all_text: str = attr.ib(default='') @attr.s(frozen=False) class EnrichmentDomain(): domain: str = attr.ib(default='') sub_domain: str = attr.ib(default='') page_number: int = attr.ib() # keywords and rects are a pair # each index in the list correspond to the other # the keywords attribute is only there to help with debugging the coordinates keywords: List[str] = attr.ib() rects: List[List[float]] = attr.ib() # the matched str keyword (synonym) keyword: str = attr.ib() # string from document text_in_document: str = attr.ib() keyword_length: int = attr.ib() lo_location_offset: int = attr.ib() hi_location_offset: int = attr.ib() meta: Meta = attr.ib() uuid: str = attr.ib() primary_name: str = attr.ib(default='') enrichment_gene: str = attr.ib(default='') enrichment_domain: EnrichmentDomain = attr.ib(default=attr.Factory(EnrichmentDomain)) @attr.s(frozen=False) class OrganismAnnotation(Annotation): @attr.s(frozen=False) class OrganismMeta(Annotation.Meta): category: str = attr.ib(default='') @attr.s(frozen=False) class GeneAnnotation(Annotation): @attr.s(frozen=False) class GeneMeta(Annotation.Meta): category: str = attr.ib(default='') @attr.s(slots=True) class LMDBMatch(): entities: List[dict] = attr.ib() token: PDFWord = attr.ib() @attr.s(slots=True) class RecognizedEntities(): recognized_anatomy: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_chemicals: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_compounds: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_diseases: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_foods: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_genes: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_phenomenas: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_phenotypes: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_proteins: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_species: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_local_species: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) # non LMDB entity types recognized_companies: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_entities: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_lab_samples: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) recognized_lab_strains: List[LMDBMatch] = attr.ib(default=attr.Factory(list)) @attr.s(slots=True) class GlobalExclusions(): excluded_anatomy: Set[str] = attr.ib(default=attr.Factory(set)) excluded_chemicals: Set[str] = attr.ib(default=attr.Factory(set)) excluded_compounds: Set[str] = attr.ib(default=attr.Factory(set)) excluded_diseases: Set[str] = attr.ib(default=attr.Factory(set)) excluded_foods: Set[str] = attr.ib(default=attr.Factory(set)) excluded_genes: Set[str] = attr.ib(default=attr.Factory(set)) excluded_phenomenas: Set[str] = attr.ib(default=attr.Factory(set)) excluded_phenotypes: Set[str] = attr.ib(default=attr.Factory(set)) excluded_proteins: Set[str] = attr.ib(default=attr.Factory(set)) excluded_species: Set[str] = attr.ib(default=attr.Factory(set)) excluded_genes_case_insensitive: Set[str] = attr.ib(default=attr.Factory(set)) excluded_proteins_case_insensitive: Set[str] = attr.ib(default=attr.Factory(set)) # non LMDB entity types excluded_companies: Set[str] = attr.ib(default=attr.Factory(set)) excluded_entities: Set[str] = attr.ib(default=attr.Factory(set)) excluded_lab_samples: Set[str] = attr.ib(default=attr.Factory(set)) excluded_lab_strains: Set[str] = attr.ib(default=attr.Factory(set)) @attr.s(slots=True) class GlobalInclusions(): included_anatomy: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_chemicals: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_compounds: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_diseases: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_foods: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_genes: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_phenomenas: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_phenotypes: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_proteins: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_species: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_local_species: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) # non LMDB entity types included_companies: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_entities: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_lab_samples: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) included_lab_strains: Dict[str, List[dict]] = attr.ib(default=attr.Factory(dict)) @attr.s(slots=True) class SpecifiedOrganismStrain(): synonym: str = attr.ib() organism_id: str = attr.ib() category: str = attr.ib() @attr.s(slots=True) class BestOrganismMatch(): entity_id: str = attr.ib() organism_id: str = attr.ib() closest_distance: float = attr.ib() specified_organism_id: Optional[str] = attr.ib(default=None) @attr.s(slots=True) class GeneOrProteinToOrganism(): matches: dict = attr.ib(default=attr.Factory(dict)) data_sources: dict = attr.ib(default=attr.Factory(dict)) primary_names: dict = attr.ib(default=attr.Factory(dict))
42.956989
89
0.693492
1,097
7,990
4.969918
0.134913
0.118855
0.188371
0.205796
0.667828
0.610051
0.598679
0.5719
0.530814
0.332172
0
0.000148
0.156446
7,990
185
90
43.189189
0.808754
0.047434
0
0.193103
0
0
0
0
0
0
0
0
0
1
0
true
0
0.02069
0
0.758621
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
ec24520d86741274239450dbafe42c2873967c17
93
py
Python
my_velov_assistant/assistant/apps.py
thefifthagreement/my-velov
6688d22fde510dc93c1064bfb15ab556bb2e1f76
[ "MIT" ]
1
2021-05-07T07:16:00.000Z
2021-05-07T07:16:00.000Z
my_velov_assistant/assistant/apps.py
thefifthagreement/my-velov
6688d22fde510dc93c1064bfb15ab556bb2e1f76
[ "MIT" ]
7
2021-05-12T05:42:23.000Z
2022-03-30T21:07:09.000Z
my_velov_assistant/assistant/apps.py
thefifthagreement/my-velov
6688d22fde510dc93c1064bfb15ab556bb2e1f76
[ "MIT" ]
null
null
null
from django.apps import AppConfig class AssistantConfig(AppConfig): name = "assistant"
15.5
33
0.763441
10
93
7.1
0.9
0
0
0
0
0
0
0
0
0
0
0
0.16129
93
5
34
18.6
0.910256
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
ec2e1de0183efd8fa4c7fdcb7fb82fe8de47d21b
20
py
Python
app/utilities/__init__.py
Maxyme/movie-review
148d9e8f4019eb85cd4b14ff5df2e59f993177e3
[ "MIT" ]
null
null
null
app/utilities/__init__.py
Maxyme/movie-review
148d9e8f4019eb85cd4b14ff5df2e59f993177e3
[ "MIT" ]
99
2019-07-05T12:31:26.000Z
2021-07-20T11:20:55.000Z
app/utilities/__init__.py
Maxyme/movie-review
148d9e8f4019eb85cd4b14ff5df2e59f993177e3
[ "MIT" ]
null
null
null
"""app utilities"""
10
19
0.6
2
20
6
1
0
0
0
0
0
0
0
0
0
0
0
0.1
20
1
20
20
0.666667
0.65
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
6b8ae1bfa03f13d796ec4478fe5b82b5668aa65c
472
py
Python
authenticationApp/admin.py
FilipBali/VirtualPortfolio-WebApplication
9236509205e37c2c682b7b2f518f5794a94fd178
[ "MIT" ]
null
null
null
authenticationApp/admin.py
FilipBali/VirtualPortfolio-WebApplication
9236509205e37c2c682b7b2f518f5794a94fd178
[ "MIT" ]
null
null
null
authenticationApp/admin.py
FilipBali/VirtualPortfolio-WebApplication
9236509205e37c2c682b7b2f518f5794a94fd178
[ "MIT" ]
null
null
null
# ====================================================================================================================== # Fakulta informacnich technologii VUT v Brne # Bachelor thesis # Author: Filip Bali (xbalif00) # License: MIT # ====================================================================================================================== from django.contrib import admin from .models import Profile # Register your models here. admin.site.register(Profile)
42.909091
120
0.385593
31
472
5.870968
0.806452
0
0
0
0
0
0
0
0
0
0
0.004587
0.076271
472
11
121
42.909091
0.412844
0.777542
0
0
0
0
0
0
0
1
0
0
0
1
0
true
0
0.666667
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
0
0
1
0
1
0
0
0
0
4
6b8d3edae4a7a8f85b06728456effefcd950bb98
257
py
Python
app/simulator/networkcluster.py
wbj218/microVisualization
7fa1b71a81fa77c7708fe44c32ad5bbf7864acfc
[ "MIT" ]
null
null
null
app/simulator/networkcluster.py
wbj218/microVisualization
7fa1b71a81fa77c7708fe44c32ad5bbf7864acfc
[ "MIT" ]
3
2021-05-11T15:11:29.000Z
2022-02-13T14:07:47.000Z
app/simulator/networkcluster.py
Wzz917/Microservices-Visualization
40ba4bf1ffee66915b98566b4ef4b815119b798a
[ "MIT" ]
null
null
null
import Queue class NetworkCluster: def __init__(self): self.clusterQ = Queue.Queue() def add_member(self, member): self.clusterQ.put(member) def add_job(self, job): member = self.clusterQ.get() member.add_job(job) self.clusterQ.put(member)
18.357143
31
0.723735
37
257
4.837838
0.351351
0.268156
0.201117
0.234637
0
0
0
0
0
0
0
0
0.14786
257
14
32
18.357143
0.817352
0
0
0.2
0
0
0
0
0
0
0
0
0
1
0.3
false
0
0.1
0
0.5
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
6bb9093dfb3297a8333ce1e107b69653dfa5bbec
141
py
Python
accessify/__init__.py
dmytrostriletskyi/design-kit
6b7cf8657ffe18cd6a43c6cfb73b071084f0331e
[ "MIT" ]
107
2019-03-02T22:31:04.000Z
2022-01-24T09:57:15.000Z
accessify/__init__.py
dmytrostriletskyi/accessify
6b7cf8657ffe18cd6a43c6cfb73b071084f0331e
[ "MIT" ]
161
2019-03-02T17:46:20.000Z
2020-11-13T15:45:53.000Z
accessify/__init__.py
dmytrostriletskyi/design-kit
6b7cf8657ffe18cd6a43c6cfb73b071084f0331e
[ "MIT" ]
8
2019-03-04T13:01:40.000Z
2022-03-31T06:40:46.000Z
from accessify.access import ( accessify, private, protected, ) from accessify.interfaces import ( implements, throws, )
14.1
34
0.673759
13
141
7.307692
0.692308
0.273684
0
0
0
0
0
0
0
0
0
0
0.248227
141
9
35
15.666667
0.896226
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.222222
0
0.222222
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
0
0
0
0
0
4
6bce75535a1f4544e7278842b5dc6f9e67a52e2f
4,299
py
Python
polaris/polaris/tests/sep31/test_execute_outgoing_transactions.py
paysharesdev/django-polaris
cbbebed5623a92074071f59f4bca65e2b1c6571b
[ "Apache-2.0" ]
null
null
null
polaris/polaris/tests/sep31/test_execute_outgoing_transactions.py
paysharesdev/django-polaris
cbbebed5623a92074071f59f4bca65e2b1c6571b
[ "Apache-2.0" ]
null
null
null
polaris/polaris/tests/sep31/test_execute_outgoing_transactions.py
paysharesdev/django-polaris
cbbebed5623a92074071f59f4bca65e2b1c6571b
[ "Apache-2.0" ]
null
null
null
import pytest from unittest.mock import Mock, patch from datetime import datetime from polaris.models import Transaction from polaris.management.commands.execute_outgoing_transactions import Command def update_to_external(transaction): transaction.status = Transaction.STATUS.pending_external transaction.save() mock_rails_integration_external = Mock( execute_outgoing_transaction=Mock(side_effect=update_to_external) ) @pytest.mark.django_db @patch( "polaris.management.commands.execute_outgoing_transactions.rri", mock_rails_integration_external, ) def test_successful_pending(acc1_usd_deposit_transaction_factory): transaction = acc1_usd_deposit_transaction_factory( protocol=Transaction.PROTOCOL.sep31 ) transaction.status = Transaction.STATUS.pending_receiver transaction.amount_out = None transaction.save() Command.execute_outgoing_transactions() transaction.refresh_from_db() assert transaction.status == Transaction.STATUS.pending_external assert transaction.amount_out == transaction.amount_in - transaction.amount_fee assert not transaction.completed_at mock_rails_integration_external.execute_outgoing_transaction.assert_called_with( transaction ) mock_rails_integration_external.reset_mock() def update_to_completed(transaction): transaction.status = Transaction.STATUS.completed transaction.save() mock_rails_integration_completed = Mock( execute_outgoing_transaction=Mock(side_effect=update_to_completed) ) @pytest.mark.django_db @patch( "polaris.management.commands.execute_outgoing_transactions.rri", mock_rails_integration_completed, ) def test_successful_completed(acc1_usd_deposit_transaction_factory): transaction = acc1_usd_deposit_transaction_factory( protocol=Transaction.PROTOCOL.sep31 ) transaction.status = Transaction.STATUS.pending_receiver transaction.amount_out = None transaction.save() Command.execute_outgoing_transactions() transaction.refresh_from_db() assert transaction.status == Transaction.STATUS.completed assert transaction.amount_out == transaction.amount_in - transaction.amount_fee assert isinstance(transaction.completed_at, datetime) mock_rails_integration_completed.execute_outgoing_transaction.assert_called_with( transaction ) mock_rails_integration_completed.reset_mock() @pytest.mark.django_db @patch("polaris.management.commands.execute_outgoing_transactions.rri") def test_no_change(mock_rails_integration, acc1_usd_deposit_transaction_factory): transaction = acc1_usd_deposit_transaction_factory( protocol=Transaction.PROTOCOL.sep31 ) transaction.status = Transaction.STATUS.pending_receiver transaction.amount_out = None transaction.save() Command.execute_outgoing_transactions() transaction.refresh_from_db() assert transaction.status == Transaction.STATUS.pending_receiver assert not transaction.amount_out assert not transaction.completed_at mock_rails_integration.execute_outgoing_transaction.assert_called_with(transaction) def change_to_bad_status(transaction): transaction.status = Transaction.STATUS.pending_sender transaction.save() mock_rails_integration_sender = Mock( execute_outgoing_transaction=Mock(side_effect=change_to_bad_status) ) @pytest.mark.django_db @patch( "polaris.management.commands.execute_outgoing_transactions.rri", mock_rails_integration_sender, ) @patch("polaris.management.commands.execute_outgoing_transactions.logger") def test_bad_status_change(mock_logger, acc1_usd_deposit_transaction_factory): transaction = acc1_usd_deposit_transaction_factory( protocol=Transaction.PROTOCOL.sep31 ) transaction.status = Transaction.STATUS.pending_receiver transaction.amount_out = None transaction.save() Command.execute_outgoing_transactions() transaction.refresh_from_db() assert transaction.status == Transaction.STATUS.pending_sender assert not transaction.amount_out assert not transaction.completed_at mock_logger.error.assert_called() mock_rails_integration_sender.execute_outgoing_transaction.assert_called_with( transaction ) mock_rails_integration_sender.reset_mock()
34.392
87
0.808095
482
4,299
6.827801
0.124481
0.113643
0.085081
0.113643
0.830447
0.779398
0.721057
0.674263
0.655728
0.624126
0
0.004253
0.124913
4,299
124
88
34.669355
0.870548
0
0
0.495146
0
0
0.071645
0.071645
0
0
0
0
0.165049
1
0.067961
false
0
0.048544
0
0.116505
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6bd7080116ba6ea3e909f6489f2f0de85c7a394d
2,041
py
Python
resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtNetwork/QNetworkAddressEntry.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
1
2020-04-20T02:27:20.000Z
2020-04-20T02:27:20.000Z
resources/dot_PyCharm/system/python_stubs/cache/83fffae014956db69fadcc8dc156c529d265a60c3b195dc003754531e5b5eafd/PySide/QtNetwork/QNetworkAddressEntry.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
null
null
null
resources/dot_PyCharm/system/python_stubs/cache/83fffae014956db69fadcc8dc156c529d265a60c3b195dc003754531e5b5eafd/PySide/QtNetwork/QNetworkAddressEntry.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
null
null
null
# encoding: utf-8 # module PySide.QtNetwork # from C:\Python27\lib\site-packages\PySide\QtNetwork.pyd # by generator 1.147 # no doc # imports import PySide.QtCore as __PySide_QtCore import Shiboken as __Shiboken class QNetworkAddressEntry(__Shiboken.Object): # no doc def broadcast(self, *args, **kwargs): # real signature unknown pass def ip(self, *args, **kwargs): # real signature unknown pass def netmask(self, *args, **kwargs): # real signature unknown pass def prefixLength(self, *args, **kwargs): # real signature unknown pass def setBroadcast(self, *args, **kwargs): # real signature unknown pass def setIp(self, *args, **kwargs): # real signature unknown pass def setNetmask(self, *args, **kwargs): # real signature unknown pass def setPrefixLength(self, *args, **kwargs): # real signature unknown pass def __copy__(self, *args, **kwargs): # real signature unknown pass def __eq__(self, y): # real signature unknown; restored from __doc__ """ x.__eq__(y) <==> x==y """ pass def __ge__(self, y): # real signature unknown; restored from __doc__ """ x.__ge__(y) <==> x>=y """ pass def __gt__(self, y): # real signature unknown; restored from __doc__ """ x.__gt__(y) <==> x>y """ pass def __init__(self, *args, **kwargs): # real signature unknown pass def __le__(self, y): # real signature unknown; restored from __doc__ """ x.__le__(y) <==> x<=y """ pass def __lt__(self, y): # real signature unknown; restored from __doc__ """ x.__lt__(y) <==> x<y """ pass @staticmethod # known case of __new__ def __new__(S, *more): # real signature unknown; restored from __doc__ """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ pass def __ne__(self, y): # real signature unknown; restored from __doc__ """ x.__ne__(y) <==> x!=y """ pass
27.581081
77
0.607545
253
2,041
4.494071
0.26087
0.194371
0.299033
0.158311
0.64292
0.60774
0.576957
0.576957
0.216359
0
0
0.004657
0.263596
2,041
73
78
27.958904
0.75183
0.44586
0
0.447368
0
0
0
0
0
0
0
0
0
1
0.447368
false
0.447368
0.052632
0
0.526316
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
6bd932734622bb63f3a7ed5800c7c6f839ab8a81
2,486
py
Python
Protheus_WebApp/Modules/SIGAATF/ATFA005TESTCASE.py
HelenaAdrignoli/tir-script-samples
bb4f4ab3a49f723216c93f66a4395e5aa328b846
[ "MIT" ]
null
null
null
Protheus_WebApp/Modules/SIGAATF/ATFA005TESTCASE.py
HelenaAdrignoli/tir-script-samples
bb4f4ab3a49f723216c93f66a4395e5aa328b846
[ "MIT" ]
null
null
null
Protheus_WebApp/Modules/SIGAATF/ATFA005TESTCASE.py
HelenaAdrignoli/tir-script-samples
bb4f4ab3a49f723216c93f66a4395e5aa328b846
[ "MIT" ]
null
null
null
from tir import Webapp import unittest class ATFA005(unittest.TestCase): @classmethod def setUpClass(inst): inst.oHelper = Webapp() inst.oHelper.Setup("SIGAATF", "01/04/2016", "T1", "D MG 01 ", "01") inst.oHelper.Program("ATFA005") def test_ATFA005_001(self): self.oHelper.SetButton("Incluir") self.oHelper.SetValue("FNI_CODIND", "02" ) # Cod.Índice self.oHelper.SetValue("FNI_DSCIND", "ATFA005 CAMPO DESCRI" ) # Descrição self.oHelper.SetValue("FNI_PERIOD", "2 - Mensal" ) # Peridoo self.oHelper.SetValue("FNI_MSBLQL", "2 - Não" ) # Bloqueio sim ou nao self.oHelper.CheckResult("FNI_CODIND", "02" ) # Cod.Índice self.oHelper.CheckResult("FNI_DSCIND", "ATFA005 CAMPO DESCRI") # Descrição self.oHelper.CheckResult("FNI_PERIOD", "2 - Mensal" ) # Peridoo self.oHelper.CheckResult("FNI_MSBLQL", "2 - Não" ) # Bloqueio sim ou nao self.oHelper.SetButton("Confirmar") self.oHelper.SetButton("Fechar") # --------------------------------------------------------------------------- # Inclusão 2 # --------------------------------------------------------------------------- self.oHelper.SetButton("Incluir") self.oHelper.SetValue("FNI_CODIND", "05" ) # Cod.Índice self.oHelper.SetValue("FNI_DSCIND", "ATFA005 CALCULADO" ) # Descrição self.oHelper.SetValue("FNI_PERIOD", "2 - Mensal" ) # Peridoo self.oHelper.SetValue("FNI_MSBLQL", "2 - Não" ) # Bloqueio sim ou nao self.oHelper.SetValue("FNI_TIPO" , "2 - Calculado" ) self.oHelper.SetValue("FNI_CURVIN", "01/04/2016" ) self.oHelper.SetValue("FNI_CURVFI", "30/04/2016" ) self.oHelper.CheckResult("FNI_CODIND", "05" ) # Cod.Índice self.oHelper.CheckResult("FNI_DSCIND", "ATFA005 CALCULADO") # Descrição self.oHelper.CheckResult("FNI_PERIOD", "2 - Mensal" ) # Peridoo self.oHelper.CheckResult("FNI_MSBLQL", "2 - Não" ) self.oHelper.CheckResult("FNI_TIPO" , "2 - Calculado" ) # Bloqueio sim ou nao self.oHelper.CheckResult("FNI_CURVIN", "01/04/2016" ) self.oHelper.CheckResult("FNI_CURVFI", "30/04/2016" ) self.oHelper.SetButton("Confirmar") self.oHelper.SetButton("Fechar") self.oHelper.AssertTrue() @classmethod def tearDownClass(inst): inst.oHelper.TearDown() if __name__ == '__main__': unittest.main()
40.096774
87
0.591714
267
2,486
5.389513
0.235955
0.221682
0.14524
0.168172
0.732453
0.732453
0.717165
0.62057
0.371786
0.295344
0
0.044967
0.212792
2,486
61
88
40.754098
0.690342
0.144006
0
0.372093
0
0
0.246679
0
0
0
0
0
0.023256
1
0.069767
false
0
0.046512
0
0.139535
0
0
0
0
null
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6be1bbc9dfb5b29ca4d118a0dd0b8c2854fcbd9b
953
py
Python
TextBasedGame/questions.py
Kalonic/randomCode
35cd812eedb73296e1c684ffd5f9bf343f7de5c6
[ "Apache-2.0" ]
1
2020-11-11T09:19:18.000Z
2020-11-11T09:19:18.000Z
TextBasedGame/questions.py
Kalonic/randomCode
35cd812eedb73296e1c684ffd5f9bf343f7de5c6
[ "Apache-2.0" ]
null
null
null
TextBasedGame/questions.py
Kalonic/randomCode
35cd812eedb73296e1c684ffd5f9bf343f7de5c6
[ "Apache-2.0" ]
null
null
null
QUESTIONS = { 'a1': { 'Q': 'What is the chemical symbol for gold?', 'A': 'au' }, 'a2': { 'Q': '', 'A': '' }, 'a3': { 'Q': '', 'A': '' }, 'a4': { 'Q': '', 'A': '' }, 'b1': { 'Q': '', 'A': '' }, 'b2': { 'Q': '', 'A': '' }, 'b3': { 'Q': '', 'A': '' }, 'b4': { 'Q': '', 'A': '' }, 'c1': { 'Q': '', 'A': '' }, 'c2': { 'Q': '', 'A': '' }, 'c3': { 'Q': '', 'A': '' }, 'c4': { 'Q': '', 'A': '' }, 'd1': { 'Q': '', 'A': '' }, 'd2': { 'Q': '', 'A': '' }, 'd3': { 'Q': '', 'A': '' }, 'd4': { 'Q': '', 'A': '' }, }
14.223881
54
0.110178
57
953
1.842105
0.473684
0.285714
0
0
0
0
0
0
0
0
0
0.041995
0.60021
953
66
55
14.439394
0.233596
0
0
0.454545
0
0
0.116122
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
1
null
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6bf361e7b96fcf7f1d96156ef0a4db184b40eb1c
83
py
Python
src/shack.py
TENMAJKL/shack
ae585234e9fb42e53faaf1df4e341656118264c0
[ "MIT" ]
null
null
null
src/shack.py
TENMAJKL/shack
ae585234e9fb42e53faaf1df4e341656118264c0
[ "MIT" ]
1
2021-10-01T11:40:19.000Z
2021-10-01T11:40:19.000Z
src/shack.py
TENMAJKL/shack
ae585234e9fb42e53faaf1df4e341656118264c0
[ "MIT" ]
null
null
null
from cli import cli from sys import argv if __name__ == "__main__": cli(argv)
13.833333
26
0.698795
13
83
3.846154
0.615385
0
0
0
0
0
0
0
0
0
0
0
0.216867
83
5
27
16.6
0.769231
0
0
0
0
0
0.096386
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d46fc3893eb379a623712ceb9d28d89a0f6a41bc
211
py
Python
SimpleIsBetterThanComplex.com/myproject/.env/bin/django-admin.py
nitin-cherian/Webapps
fbfbef6cb22fc742ee66460268afe6ff7834faa1
[ "MIT" ]
1
2017-11-22T08:56:06.000Z
2017-11-22T08:56:06.000Z
SimpleIsBetterThanComplex.com/myproject/.env/bin/django-admin.py
nitin-cherian/Webapps
fbfbef6cb22fc742ee66460268afe6ff7834faa1
[ "MIT" ]
null
null
null
SimpleIsBetterThanComplex.com/myproject/.env/bin/django-admin.py
nitin-cherian/Webapps
fbfbef6cb22fc742ee66460268afe6ff7834faa1
[ "MIT" ]
null
null
null
#!/home/nitin/Learn/Repositories/Github/WebApps/SimpleIsBetterThanComplex.com/myproject/.env/bin/python3 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
35.166667
104
0.815166
25
211
6.44
0.92
0
0
0
0
0
0
0
0
0
0
0.005102
0.07109
211
5
105
42.2
0.816327
0.488152
0
0
0
0
0.074766
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d47944f39f55facbe497f244357e9db3aaae2b08
2,169
py
Python
backend/review/migrations/0004_auto_20200512_1526.py
pennlabs/penn-courses
6fd16c151e34a9660e883a41458a72cef6c1f8cd
[ "MIT" ]
32
2019-04-02T19:02:48.000Z
2022-03-05T17:32:52.000Z
backend/review/migrations/0004_auto_20200512_1526.py
pennlabs/penn-courses
6fd16c151e34a9660e883a41458a72cef6c1f8cd
[ "MIT" ]
281
2019-05-20T01:19:38.000Z
2022-03-31T08:17:13.000Z
backend/review/migrations/0004_auto_20200512_1526.py
pennlabs/penn-courses
6fd16c151e34a9660e883a41458a72cef6c1f8cd
[ "MIT" ]
2
2020-04-27T20:53:02.000Z
2021-09-26T16:40:28.000Z
# Generated by Django 3.0.6 on 2020-05-12 19:26 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("review", "0003_auto_20190525_2040"), ] operations = [ migrations.RenameField(model_name="reviewbit", old_name="score", new_name="average",), migrations.AddField( model_name="review", name="enrollment", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="review", name="form_type", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="review", name="responses", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="reviewbit", name="median", field=models.DecimalField(blank=True, decimal_places=5, max_digits=6, null=True), ), migrations.AddField( model_name="reviewbit", name="rating0", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="reviewbit", name="rating1", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="reviewbit", name="rating2", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="reviewbit", name="rating3", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="reviewbit", name="rating4", field=models.IntegerField(blank=True, null=True), ), migrations.AddField( model_name="reviewbit", name="stddev", field=models.DecimalField(blank=True, decimal_places=5, max_digits=6, null=True), ), migrations.AlterField( model_name="reviewbit", name="field", field=models.CharField(db_index=True, max_length=32), ), ]
32.863636
100
0.571692
209
2,169
5.818182
0.296651
0.088816
0.189145
0.222039
0.698191
0.698191
0.667763
0.667763
0.643092
0.643092
0
0.027815
0.303827
2,169
65
101
33.369231
0.777483
0.020747
0
0.627119
1
0
0.103676
0.010839
0
0
0
0
0
1
0
false
0
0.016949
0
0.067797
0
0
0
0
null
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d47fd73984c3b80e0c10988236169fbf3a35df37
322
py
Python
src/bos_consensus/middlewares/__init__.py
LuffyEMonkey/isaac-consensus-protocol
806d967d56ef8862a477b2515c7854af289c10a0
[ "Apache-2.0" ]
1
2018-04-10T11:00:59.000Z
2018-04-10T11:00:59.000Z
src/bos_consensus/middlewares/__init__.py
LuffyEMonkey/isaac-consensus-protocol
806d967d56ef8862a477b2515c7854af289c10a0
[ "Apache-2.0" ]
null
null
null
src/bos_consensus/middlewares/__init__.py
LuffyEMonkey/isaac-consensus-protocol
806d967d56ef8862a477b2515c7854af289c10a0
[ "Apache-2.0" ]
null
null
null
from .base import ( # noqa load_middlewares, ) from .blockchain.base import ( # noqa NoFurtherBlockchainMiddlewares, StopReceiveBallot, BaseBlockchainMiddleware, ) from .consensus.base import ( # noqa NoFurtherConsensusMiddlewares, StopStore, StopBroadcast, BaseConsensusMiddleware, )
18.941176
38
0.726708
23
322
10.130435
0.652174
0.128755
0.180258
0
0
0
0
0
0
0
0
0
0.204969
322
16
39
20.125
0.910156
0.043478
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.214286
0
0.214286
0
1
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
2e174593900dd499b82be69740ccdeb7f1a9be2a
331
py
Python
deepy/tensor/__init__.py
uaca/deepy
090fbad22a08a809b12951cd0d4984f5bd432698
[ "MIT" ]
260
2015-05-16T07:58:29.000Z
2016-01-07T09:10:47.000Z
deepy/tensor/__init__.py
uaca/deepy
090fbad22a08a809b12951cd0d4984f5bd432698
[ "MIT" ]
20
2015-04-21T01:46:46.000Z
2015-12-20T00:04:23.000Z
deepy/tensor/__init__.py
zomux/deepy
090fbad22a08a809b12951cd0d4984f5bd432698
[ "MIT" ]
50
2016-01-27T03:45:25.000Z
2020-12-16T07:02:57.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- from wrapper import deepy_tensor from functions import concat, concatenate, reverse, ifelse, apply, repeat, var, vars, activate, is_neural_var, is_theano_var from onehot import onehot_tensor, onehot import theano_nnet_imports as nnet import costs as costs from theano_imports import *
36.777778
124
0.794562
50
331
5.08
0.6
0.094488
0
0
0
0
0
0
0
0
0
0.00346
0.126888
331
9
125
36.777778
0.875433
0.126888
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
2e1dcb5299f920e73ef34844f4179c364eeada29
300
py
Python
Accessor.py
gudnm/dhash
e63e917f93096c9e8fa0690365de635b6cd2c692
[ "MIT" ]
3
2016-10-10T16:08:19.000Z
2020-06-29T07:30:42.000Z
Accessor.py
gudnm/dhash
e63e917f93096c9e8fa0690365de635b6cd2c692
[ "MIT" ]
1
2016-09-10T12:51:04.000Z
2016-09-10T16:28:00.000Z
Accessor.py
gudnm/dhash
e63e917f93096c9e8fa0690365de635b6cd2c692
[ "MIT" ]
3
2016-09-08T04:29:44.000Z
2018-05-06T08:04:38.000Z
class Accessor(object): """""" pass class WriteThru(Accessor): """Implement write-thru access pattern.""" pass class WriteAround(Accessor): """Implement write-around access pattern.""" pass class WriteBack(Accessor): """Implement write-back access pattern.""" pass
18.75
48
0.66
31
300
6.387097
0.451613
0.136364
0.333333
0.222222
0
0
0
0
0
0
0
0
0.2
300
15
49
20
0.825
0.373333
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
cf02f8e7dd3a9677ba767a2e463d4380bbfcffb9
246
py
Python
facepy/__init__.py
redwankarimsony/UniFAD
0edd851573313bdf013ca8f8844f45413dfd5373
[ "MIT" ]
null
null
null
facepy/__init__.py
redwankarimsony/UniFAD
0edd851573313bdf013ca8f8844f45413dfd5373
[ "MIT" ]
null
null
null
facepy/__init__.py
redwankarimsony/UniFAD
0edd851573313bdf013ca8f8844f45413dfd5373
[ "MIT" ]
1
2022-02-11T05:02:46.000Z
2022-02-11T05:02:46.000Z
# flake8: noqa from .dataset import Template, Dataset from . import evaluation from . import io from . import learning from . import linalg from . import metric from . import plot from . import protocol from . import system from . import brickie
20.5
38
0.768293
34
246
5.558824
0.441176
0.47619
0
0
0
0
0
0
0
0
0
0.004951
0.178862
246
12
39
20.5
0.930693
0.04878
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
cf279d78abac574bce33939ec04ff63c14cb6dae
37
py
Python
app/omwebapp/tests/view/__init__.py
JojiKoike/OMWebAppEngine
b390a28109add4b9d9631bed44e87090111f2bc3
[ "MIT" ]
null
null
null
app/omwebapp/tests/view/__init__.py
JojiKoike/OMWebAppEngine
b390a28109add4b9d9631bed44e87090111f2bc3
[ "MIT" ]
null
null
null
app/omwebapp/tests/view/__init__.py
JojiKoike/OMWebAppEngine
b390a28109add4b9d9631bed44e87090111f2bc3
[ "MIT" ]
null
null
null
""" View(WebAPI)のテストコード群パッケージです。 """
9.25
28
0.675676
3
37
8.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.081081
37
3
29
12.333333
0.735294
0.756757
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
cf386180f676c829f73b32384f87462ec16a32bc
344
py
Python
packages/pyright-internal/src/tests/samples/tryExcept7.py
martindemello/pyright
4fe3f1f7c08f139715701fdf746183062b5165ff
[ "MIT" ]
4,391
2019-05-07T01:18:57.000Z
2022-03-31T20:45:44.000Z
packages/pyright-internal/src/tests/samples/tryExcept7.py
martindemello/pyright
4fe3f1f7c08f139715701fdf746183062b5165ff
[ "MIT" ]
2,740
2019-05-07T03:29:30.000Z
2022-03-31T12:57:46.000Z
packages/pyright-internal/src/tests/samples/tryExcept7.py
martindemello/pyright
4fe3f1f7c08f139715701fdf746183062b5165ff
[ "MIT" ]
455
2019-05-07T12:55:14.000Z
2022-03-31T17:09:15.000Z
# This sample tests the syntax handling for Python 3.11 exception groups # as described in PEP 654. def func1(): try: pass # This should generate an error if using Python 3.10 or earlier. except* BaseException: pass # This should generate an error if using Python 3.10 or earlier. except*: pass
20.235294
72
0.656977
50
344
4.52
0.64
0.09292
0.123894
0.19469
0.530973
0.530973
0.530973
0.530973
0.530973
0.530973
0
0.053279
0.290698
344
16
73
21.5
0.872951
0.642442
0
0.428571
1
0
0
0
0
0
0
0
0
0
null
null
0.428571
0
null
null
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
4
cf7072260c7093fbb1b5b33a6fb38478cb9545be
80
py
Python
TextStuff/__init__.py
nortismo/ADC
48dfaaae71db174a48a0c308b77a3405d92cf729
[ "Beerware" ]
1
2018-11-26T10:59:51.000Z
2018-11-26T10:59:51.000Z
TextStuff/__init__.py
nortismo/ADC
48dfaaae71db174a48a0c308b77a3405d92cf729
[ "Beerware" ]
null
null
null
TextStuff/__init__.py
nortismo/ADC
48dfaaae71db174a48a0c308b77a3405d92cf729
[ "Beerware" ]
null
null
null
from .GoogleCloudVision import GoogleCloudVision __all__ = ['GoogleCloudVision']
40
48
0.85
6
80
10.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.075
80
2
49
40
0.864865
0
0
0
0
0
0.209877
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
0
0
0
4
cf85d597e0aba575df99ee3d464d24cb01fd697d
164
py
Python
src/helloworld.py
dmontemayor/experiment_template
84d791bb6cc4570f60bc50b6e515b0c6e095220f
[ "MIT" ]
null
null
null
src/helloworld.py
dmontemayor/experiment_template
84d791bb6cc4570f60bc50b6e515b0c6e095220f
[ "MIT" ]
null
null
null
src/helloworld.py
dmontemayor/experiment_template
84d791bb6cc4570f60bc50b6e515b0c6e095220f
[ "MIT" ]
null
null
null
""" Hello world in python """ def helloworld(): """ print hello world to screen """ print "Hello world!" if __name__ == '__main__': helloworld()
13.666667
35
0.591463
18
164
4.944444
0.666667
0.337079
0.337079
0
0
0
0
0
0
0
0
0
0.256098
164
11
36
14.909091
0.729508
0
0
0
0
0
0.208333
0
0
0
0
0
0
0
null
null
0
0
null
null
0.25
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
1
0
0
0
0
0
0
0
0
4
cf89cafcd80852ec9a5a7ea997f2b9fdb7e7d06c
1,252
py
Python
usr/share/pyshared/ajenti/plugins/mysql/main.py
lupyuen/RaspberryPiImage
664e8a74b4628d710feab5582ef59b344b9ffddd
[ "Apache-2.0" ]
7
2016-03-07T02:07:21.000Z
2022-01-21T02:22:41.000Z
usr/share/pyshared/ajenti/plugins/mysql/main.py
lupyuen/RaspberryPiImage
664e8a74b4628d710feab5582ef59b344b9ffddd
[ "Apache-2.0" ]
null
null
null
usr/share/pyshared/ajenti/plugins/mysql/main.py
lupyuen/RaspberryPiImage
664e8a74b4628d710feab5582ef59b344b9ffddd
[ "Apache-2.0" ]
8
2016-06-14T06:01:11.000Z
2020-04-22T09:21:44.000Z
from ajenti.api import * from ajenti.plugins.db_common.api import DBPlugin from ajenti.util import platform_select from api import MySQLDB @plugin class MySQLPlugin (DBPlugin): config_class = MySQLDB service_name = platform_select( debian='mysql', osx='org.macports.mysql56-server', default='mysqld', ) service_buttons = [ { 'command': 'reload', 'text': _('Reload'), 'icon': 'reload', } ] def init(self): self.title = 'MySQL' self.category = _('Software') self.icon = 'table' self.db = MySQLDB.get() def query_sql(self, db, sql): return self.db.query_sql(db, sql) def query_databases(self): return self.db.query_databases() def query_drop(self, db): return self.db.query_drop(db) def query_create(self, name): return self.db.query_create(name) def query_users(self): return self.db.query_users() def query_create_user(self, user): return self.db.query_create_user(user) def query_drop_user(self, user): return self.db.query_drop_user(user) def query_grant(self, user, db): return self.db.query_grant(user, db)
22.763636
49
0.615016
158
1,252
4.696203
0.310127
0.088949
0.12938
0.183288
0.235849
0.078167
0.078167
0
0
0
0
0.002193
0.271566
1,252
54
50
23.185185
0.811404
0
0
0
0
0
0.071086
0.021566
0
0
0
0
0
1
0.225
false
0
0.1
0.2
0.625
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
d848cf9e72fed6bd9df4e88e94d8d758ce00abf2
3,620
py
Python
QVertex/resources_rc.py
tuapsekad/qVertex
c243a146625ccbda6b004eb73590cc1064bbf062
[ "MIT" ]
null
null
null
QVertex/resources_rc.py
tuapsekad/qVertex
c243a146625ccbda6b004eb73590cc1064bbf062
[ "MIT" ]
null
null
null
QVertex/resources_rc.py
tuapsekad/qVertex
c243a146625ccbda6b004eb73590cc1064bbf062
[ "MIT" ]
1
2020-03-13T14:40:57.000Z
2020-03-13T14:40:57.000Z
# -*- coding: utf-8 -*- # Resource object code # # Created: пт июл 25 23:14:04 2014 # by: The Resource Compiler for PyQt (Qt v4.8.6) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x02\x67\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x17\x00\x00\x00\x18\x08\x06\x00\x00\x00\x11\x7c\x66\x75\ \x00\x00\x00\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\ \x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x12\x00\x00\x0b\x12\ \x01\xd2\xdd\x7e\xfc\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xd9\x02\ \x15\x16\x11\x2c\x9d\x48\x83\xbb\x00\x00\x00\x1a\x74\x45\x58\x74\ \x53\x6f\x66\x74\x77\x61\x72\x65\x00\x50\x61\x69\x6e\x74\x2e\x4e\ \x45\x54\x20\x76\x33\x2e\x35\x2e\x31\x31\x47\xf3\x42\x37\x00\x00\ \x01\xd0\x49\x44\x41\x54\x48\x4b\xd5\x91\xcd\x2b\x84\x51\x14\xc6\ \xef\x9f\x30\x7f\x02\x1b\x5b\x1f\x7b\x09\x1b\xcc\x8a\x52\xb3\x54\ \x66\x69\x43\xbe\x22\x91\x8d\x92\xa2\x2c\xac\x18\x2b\x5f\x89\xd8\ \x48\x4a\xe4\x6b\x43\x86\x9d\xcf\x48\x29\x52\xaf\x31\x46\x59\x1d\ \xef\x73\xea\x8c\x7b\xdf\x39\xf3\xc6\x58\x79\xeb\xa9\xf7\x9e\xfb\ \x9c\xdf\x79\xee\xbd\x86\x88\xaa\x3f\xbd\x9d\x78\xe6\x7e\x64\x2f\ \x7d\xd3\x4b\x7f\x15\x38\xe0\x81\x6b\xf0\xf3\x7e\xdb\x9f\xd6\x8c\ \x85\x0a\x3c\x70\x4d\x30\xf1\xf9\xfe\x28\x45\x2a\x3e\xa8\x29\x9e\ \x74\x1a\x44\xe5\xd1\x07\x96\xb6\x67\x0b\x5c\xa3\x6d\x4c\x4c\xae\ \x90\x29\x21\x5a\x9e\x4f\x38\xf5\xce\x81\x6d\xae\x1f\x6e\x4d\x50\ \xea\xaa\x87\xbc\x8b\x6e\x7a\xbb\xee\x71\x3c\xdf\xea\xcb\xa8\x70\ \xa8\x36\x76\xc1\x27\xb8\x3b\x1d\xe6\xf5\xe6\xda\x14\x83\x31\x38\ \xe8\xcd\x37\xc0\xbc\x9e\x47\xd5\x0d\xfb\x7a\x30\xa0\xb8\xea\x85\ \x07\x6a\x5e\x4d\xe0\x32\x5c\x14\x34\xc8\xf5\xe0\x8e\x31\x08\x03\ \x83\x1e\x91\xa4\xb7\x79\x0e\x5c\x64\x37\x01\x8c\x01\x89\xe9\x39\ \xa7\x1e\xd4\xf3\x49\x3d\x3d\x1d\xd7\x39\x1c\x15\x2e\x4a\x6e\xb5\ \x72\x62\xc0\xe5\x4a\xe2\xed\x47\xbc\xde\x5b\x6f\x53\x7b\x1a\x5b\ \x76\x29\x52\x9e\xe6\xde\x50\x78\x59\xfd\x25\x15\x55\x3e\xd2\xd0\ \xf0\x0c\x03\xc7\xc7\x26\xe9\xf6\x20\xc6\xcd\xd8\x0b\xfa\x37\x16\ \xbb\xb2\x3e\xac\xf3\xc2\x05\x88\x06\xac\x6b\x9a\x8f\xb3\x89\x96\ \x66\x07\x1d\x88\x08\x41\xe0\x93\xb5\x0a\x97\x04\x1d\xbd\x0b\xd9\ \x1a\x5f\x91\x0f\x97\x66\x39\x3e\x4e\x82\xb5\x84\x81\x4f\x7a\x72\ \xe0\x30\x23\x81\x76\x6c\x24\x95\xc4\x32\x0c\x43\xe4\x1f\x03\x6c\ \x7f\x0e\x1c\x66\x00\xf2\x3d\x98\x7d\x3d\x32\x0c\x41\xb4\x30\xa1\ \x0f\xfa\x13\x61\x18\x06\xc8\xdb\xd8\xfa\x33\x5c\xee\x5a\xdb\x33\ \xd8\x08\x13\x9b\xf2\xd4\xa1\x50\xb8\x56\xfc\x8d\x0a\x4e\xce\x06\ \xa5\x0e\x09\xe0\xff\x26\x0f\x51\x0a\xc9\x57\x03\x45\x96\x77\xd6\ \xc0\xd2\xf6\x7e\xa8\x55\xc0\x4b\x7d\x79\x56\xd1\x91\x96\x1a\xd2\ \xbc\x96\xc0\x2b\x35\xf8\xf0\xe3\x4b\x3d\x41\x01\x02\xc7\x07\x1b\ \xf3\x05\x9e\xb7\x40\xa5\x94\xfc\x42\x66\x00\x00\x00\x00\x49\x45\ \x4e\x44\xae\x42\x60\x82\ " qt_resource_name = "\ \x00\x07\ \x07\x3b\xe0\xb3\ \x00\x70\ \x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\ \x00\x07\ \x06\xcc\x9a\x68\ \x00\x51\ \x00\x56\x00\x65\x00\x72\x00\x74\x00\x65\x00\x78\ \x00\x08\ \x0a\x61\x5a\xa7\ \x00\x69\ \x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\ " qt_resource_struct = "\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ \x00\x00\x00\x28\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ " def qInitResources(): QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) def qCleanupResources(): QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) qInitResources()
42.588235
96
0.724862
813
3,620
3.205412
0.343173
0.126631
0.100153
0.036838
0.094398
0.092095
0.092095
0.08749
0.07713
0.066769
0
0.315683
0.040055
3,620
84
97
43.095238
0.434245
0.049724
0
0.028986
0
0.652174
0
0
0
1
0.002331
0
0
1
0.028986
false
0
0.014493
0
0.043478
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
4
d85583278a2b471e6a05fb86533179335fb5241d
179
py
Python
crossengage/utils.py
hellofresh/crossengage-python-client
2c462ac11e21129ab78474e6354516ce81040f0a
[ "MIT" ]
9
2016-12-07T11:05:49.000Z
2020-08-20T12:44:15.000Z
crossengage/utils.py
hellofresh/crossengage-python-client
2c462ac11e21129ab78474e6354516ce81040f0a
[ "MIT" ]
24
2016-05-10T21:28:36.000Z
2021-01-04T09:37:25.000Z
crossengage/utils.py
hellofresh/crossengage-python-client
2c462ac11e21129ab78474e6354516ce81040f0a
[ "MIT" ]
1
2020-08-17T18:43:47.000Z
2020-08-17T18:43:47.000Z
def update_dict(old_dict, values): """ Update dictionary without change the original object """ new_dict = old_dict.copy() new_dict.update(values) return new_dict
29.833333
64
0.715084
25
179
4.88
0.56
0.172131
0.180328
0
0
0
0
0
0
0
0
0
0.189944
179
5
65
35.8
0.841379
0.290503
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
d863c6a731b571403ea2f331fc85561719c000be
71
py
Python
models/api_key.py
Bidulman/qcm-api-snt
552b886ed2d7ebb66b430c8335a1dfefc4bae01b
[ "MIT" ]
null
null
null
models/api_key.py
Bidulman/qcm-api-snt
552b886ed2d7ebb66b430c8335a1dfefc4bae01b
[ "MIT" ]
null
null
null
models/api_key.py
Bidulman/qcm-api-snt
552b886ed2d7ebb66b430c8335a1dfefc4bae01b
[ "MIT" ]
null
null
null
from pydantic import BaseModel class ApiKey(BaseModel): key: str
11.833333
30
0.746479
9
71
5.888889
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.197183
71
5
31
14.2
0.929825
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d89c3e8aff85896185f758e88b33b1b58529dfb0
235
py
Python
projects/leds/leds.py
romilly/explorer-hat-examples
e92157d647c3ba4bc719e9255e52279e7eaa9d74
[ "MIT" ]
3
2020-09-02T14:17:13.000Z
2022-03-18T04:18:53.000Z
projects/leds/leds.py
romilly/explorer-hat-examples
e92157d647c3ba4bc719e9255e52279e7eaa9d74
[ "MIT" ]
null
null
null
projects/leds/leds.py
romilly/explorer-hat-examples
e92157d647c3ba4bc719e9255e52279e7eaa9d74
[ "MIT" ]
null
null
null
import explorerhat as eh from time import sleep while True: eh.light.off() eh.light.red.on() sleep(0.5) eh.light.yellow.on() sleep(0.5) eh.light.green.on() sleep(0.5) eh.light.blue.on() sleep(0.5)
15.666667
24
0.6
41
235
3.439024
0.439024
0.248227
0.22695
0.255319
0.340426
0.340426
0
0
0
0
0
0.044944
0.242553
235
14
25
16.785714
0.747191
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d8a2c015b4dfadd7dd2aeddfe0934fdeea5f9c2e
451
py
Python
utils/cm/mails.py
nguyenhuong791123/api
cbefc2f3cb882d5655ed9ebdcfe42be1af69cc89
[ "MIT" ]
null
null
null
utils/cm/mails.py
nguyenhuong791123/api
cbefc2f3cb882d5655ed9ebdcfe42be1af69cc89
[ "MIT" ]
5
2019-12-26T00:24:49.000Z
2022-01-13T01:56:06.000Z
utils/cm/mails.py
nguyenhuong791123/api
cbefc2f3cb882d5655ed9ebdcfe42be1af69cc89
[ "MIT" ]
null
null
null
# -*- coding: UTF-8 -*- import re import smtplib from validate_email import validate_email def is_mail(val): val = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', val) return (val is not None) def is_valid(val): return (validate_email(val) == True) def is_verify(val): return (validate_email(val, verify=True) == True) def is_valid_mx(val): return (validate_email(val, check_mx=True) == True)
25.055556
96
0.629712
75
451
3.613333
0.373333
0.239852
0.059041
0.073801
0.339483
0.062731
0.062731
0.062731
0.062731
0.062731
0
0.028721
0.150776
451
17
97
26.529412
0.678851
0.046563
0
0
0
0.083333
0.161215
0.161215
0
0
0
0
0
1
0.333333
false
0
0.25
0.25
0.916667
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
d8ac5e3dff674e6ab1f9e925e4847e74ed410076
121
py
Python
controllers/auth/responses.py
alvitoraidhy/voyage-journal-app-backend
b2d35c7727862ef2eb99caaef52c755a390515a5
[ "MIT" ]
null
null
null
controllers/auth/responses.py
alvitoraidhy/voyage-journal-app-backend
b2d35c7727862ef2eb99caaef52c755a390515a5
[ "MIT" ]
null
null
null
controllers/auth/responses.py
alvitoraidhy/voyage-journal-app-backend
b2d35c7727862ef2eb99caaef52c755a390515a5
[ "MIT" ]
null
null
null
from pydantic import BaseModel class TokenOut(BaseModel): token: str class UserOut(BaseModel): username: str
12.1
30
0.735537
14
121
6.357143
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.198347
121
9
31
13.444444
0.917526
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.2
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
0
0
1
0
0
4
d8f19912f0e4298e68662e802c249a943a88fe46
184
py
Python
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLES2/_types.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLES2/_types.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLES2/_types.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
from OpenGL.raw.GLES1._types import * from OpenGL.platform import PLATFORM as _p from OpenGL.error import _ErrorChecker _error_checker = _ErrorChecker( _p, _p.GLES2.glGetError )
30.666667
58
0.793478
25
184
5.52
0.56
0.217391
0
0
0
0
0
0
0
0
0
0.012658
0.141304
184
5
59
36.8
0.860759
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
d8fafdc53a8fe03561922d99540400f5258993ff
71
py
Python
emol/emol/views/admin/__init__.py
lrt512/emol
e1dd3462632a525c3b9701d4fd9a332d19c93b85
[ "MIT" ]
null
null
null
emol/emol/views/admin/__init__.py
lrt512/emol
e1dd3462632a525c3b9701d4fd9a332d19c93b85
[ "MIT" ]
null
null
null
emol/emol/views/admin/__init__.py
lrt512/emol
e1dd3462632a525c3b9701d4fd9a332d19c93b85
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Module for administration-related views."""
23.666667
46
0.633803
8
71
5.625
1
0
0
0
0
0
0
0
0
0
0
0.016129
0.126761
71
2
47
35.5
0.709677
0.887324
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
2b2e8371abe94d109c43d9decd1e6954d24a01e1
103
py
Python
mmdata/__init__.py
comRamona/Multimodal-Sentiment-Analysis---ACL-2018
2831df3ef210cb3e259bbc43dd39159533f4a33e
[ "BSD-3-Clause" ]
1
2018-05-22T13:08:54.000Z
2018-05-22T13:08:54.000Z
mmdata/__init__.py
comRamona/Multimodal-Sentiment-Analysis-Multicomp-ACL-2018
2831df3ef210cb3e259bbc43dd39159533f4a33e
[ "BSD-3-Clause" ]
null
null
null
mmdata/__init__.py
comRamona/Multimodal-Sentiment-Analysis-Multicomp-ACL-2018
2831df3ef210cb3e259bbc43dd39159533f4a33e
[ "BSD-3-Clause" ]
1
2020-06-02T00:57:20.000Z
2020-06-02T00:57:20.000Z
__author__ = "MultiComp" from .dataset import Dataset from .dataloader import MOSI, MOSEI, Dataloader
20.6
47
0.796117
12
103
6.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.135922
103
4
48
25.75
0.876404
0
0
0
0
0
0.087379
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
2b522d146059fe19b1e478f3c95f67482182aaac
759
py
Python
lib/systems/water_dimer.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/water_dimer.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/water_dimer.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
import pulsar as psr def load_ref_system(): """ Returns the tentitive global minimum geometry of the water dimer according to the TIP5P potential. Ref: T. James, D.J. Wales and J. Hernández-Rojas, Chem. Phys. Lett., 415, 302 (2005) """ return psr.make_system(""": O -0.0638166135700000 1.3782116490000000 0.0000013991477170 H 0.8583313934960812 1.6348726952004131 -0.0000192736448436 H -0.0465523195463249 0.4211673531851549 0.0000010357024237 O 0.0596797744600000 -1.2953846140000000 -0.0000013030828870 H -0.3727778924225715 -1.6906360791564299 0.7569587260112379 H -0.3728118210906938 -1.6906361161127510 -0.7569419281358893 """)
42.166667
74
0.666667
85
759
5.917647
0.694118
0.015905
0
0
0
0
0
0
0
0
0
0.557118
0.250329
759
17
75
44.647059
0.326889
0.26087
0
0
0
0
0.844444
0
0
0
0
0
0
1
0.1
true
0
0.1
0
0.3
0
0
0
0
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
0
0
0
0
0
0
1
0
0
0
0
0
0
4
2b6ff46089b2619cc96244706e2dad54b30912f7
98
py
Python
shopozor/__init__.py
softozor/saleor
c907fd55e745700a55db09fd5cc7246e987c9752
[ "BSD-3-Clause" ]
2
2018-12-07T20:18:08.000Z
2018-12-27T11:00:33.000Z
shopozor/__init__.py
softozor/saleor
c907fd55e745700a55db09fd5cc7246e987c9752
[ "BSD-3-Clause" ]
2
2018-12-27T11:03:57.000Z
2019-01-05T13:55:20.000Z
shopozor/__init__.py
softozor/saleor
c907fd55e745700a55db09fd5cc7246e987c9752
[ "BSD-3-Clause" ]
null
null
null
from saleor.celeryconf import app as celery_app __all__ = ['celery_app'] __version__ = 'dev'
19.6
48
0.734694
13
98
4.769231
0.769231
0.290323
0
0
0
0
0
0
0
0
0
0
0.173469
98
4
49
24.5
0.765432
0
0
0
0
0
0.138298
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
992f4a4ade68d3b848aa5eed1a307652e6237695
180
py
Python
tasks/__init__.py
solackerman/pytest
0fc00c02a7a39ebd6c57886a85580ea3341e76eb
[ "MIT" ]
null
null
null
tasks/__init__.py
solackerman/pytest
0fc00c02a7a39ebd6c57886a85580ea3341e76eb
[ "MIT" ]
2
2017-07-15T22:12:00.000Z
2017-08-09T00:34:51.000Z
tasks/__init__.py
solackerman/pytest
0fc00c02a7a39ebd6c57886a85580ea3341e76eb
[ "MIT" ]
1
2019-06-25T13:04:31.000Z
2019-06-25T13:04:31.000Z
""" Invoke tasks to help with pytest development and release process. """ import invoke from . import generate, vendoring ns = invoke.Collection( generate, vendoring )
12.857143
65
0.716667
21
180
6.142857
0.761905
0.263566
0
0
0
0
0
0
0
0
0
0
0.205556
180
13
66
13.846154
0.902098
0.361111
0
0
1
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
99475bc4ae059f48dce7e69112d5f767398057e5
150
py
Python
codebase/criterion/__init__.py
ashok-arjun/image-classification-codebase
a944e1c0cd161e87f7c04fd35acf01a13d3fca9a
[ "BSD-3-Clause" ]
5
2020-12-27T02:11:33.000Z
2021-12-21T14:11:18.000Z
codebase/criterion/__init__.py
ashok-arjun/image-classification-codebase
a944e1c0cd161e87f7c04fd35acf01a13d3fca9a
[ "BSD-3-Clause" ]
4
2021-06-30T16:17:26.000Z
2022-01-25T15:00:31.000Z
codebase/criterion/__init__.py
ashok-arjun/image-classification-codebase
a944e1c0cd161e87f7c04fd35acf01a13d3fca9a
[ "BSD-3-Clause" ]
4
2021-05-02T21:12:45.000Z
2021-12-30T09:53:17.000Z
import torch.nn as nn from .register import CRITERION from .label_smooth import LabelSmoothCrossEntropyLoss CRITERION.register(nn.CrossEntropyLoss)
21.428571
53
0.853333
18
150
7.055556
0.611111
0
0
0
0
0
0
0
0
0
0
0
0.1
150
6
54
25
0.940741
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4