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
f1a31b17f9e0df943aaad5af12e94500b9e449cb
24
py
Python
viewer/manager/trainer.py
simonjisu/viewer
7b8c805a3886ea0a63ae4b6bded76bbc94e4774d
[ "Apache-2.0" ]
6
2020-02-28T21:18:16.000Z
2020-03-13T16:45:57.000Z
viewer/manager/trainer.py
simonjisu/viewer
7b8c805a3886ea0a63ae4b6bded76bbc94e4774d
[ "Apache-2.0" ]
6
2020-02-28T12:42:52.000Z
2020-03-16T03:49:09.000Z
viewer/manager/trainer.py
simonjisu/viewer
7b8c805a3886ea0a63ae4b6bded76bbc94e4774d
[ "Apache-2.0" ]
6
2020-03-05T13:04:25.000Z
2020-03-13T16:46:03.000Z
# train test model save
24
24
0.75
4
24
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.208333
24
1
24
24
0.947368
0.875
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
7b09416d9fe0332bb6e1e04655de28c2cc7ac71f
96
py
Python
extern/smplx_optimization/smplx_optimization/__init__.py
wangxihao/rgbd-kinect-pose
03180723c99759ba2500bcd42b5fe7a1d26eb507
[ "MIT" ]
1
2022-02-07T06:12:26.000Z
2022-02-07T06:12:26.000Z
extern/smplx_optimization/smplx_optimization/__init__.py
wangxihao/rgbd-kinect-pose
03180723c99759ba2500bcd42b5fe7a1d26eb507
[ "MIT" ]
null
null
null
extern/smplx_optimization/smplx_optimization/__init__.py
wangxihao/rgbd-kinect-pose
03180723c99759ba2500bcd42b5fe7a1d26eb507
[ "MIT" ]
null
null
null
import smplx_optimization.pykinect import smplx_optimization.visualization __version__ = '1.0'
19.2
39
0.854167
11
96
6.909091
0.727273
0.289474
0.605263
0
0
0
0
0
0
0
0
0.022727
0.083333
96
4
40
24
0.840909
0
0
0
0
0
0.03125
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
9e89634a3d1cf01c0efad2d7c6b21543c641f11f
231
py
Python
VariavaisCorretas.py
belmiro-kunga/Curso-de-python
ce1c59c19aefbe789435c855b3fa950abb14bcae
[ "MIT" ]
null
null
null
VariavaisCorretas.py
belmiro-kunga/Curso-de-python
ce1c59c19aefbe789435c855b3fa950abb14bcae
[ "MIT" ]
null
null
null
VariavaisCorretas.py
belmiro-kunga/Curso-de-python
ce1c59c19aefbe789435c855b3fa950abb14bcae
[ "MIT" ]
null
null
null
minhaVar = 'ana' minha_var = 'aninha' _minhavar = 'anusa' minhavar = 'cesio' MINHAVAR = 'austin' minhavar2 = ' belmiro' print (minhaVar) print (minha_var) print (_minhavar ) print (minhavar) print (MINHAVAR) print (minhavar2)
12.833333
22
0.709957
26
231
6.153846
0.423077
0.325
0.45
0.325
0.275
0
0
0
0
0
0
0.010309
0.160173
231
18
23
12.833333
0.814433
0
0
0
0
0
0.142241
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
7b3b43488b0f0480a9753830a16490a6a1380b76
196
py
Python
src/recipes/__init__.py
vmoret/pyrecipes
fbcc302c6ee1e10fae32f3ffb267a3536fb14d84
[ "Apache-2.0" ]
null
null
null
src/recipes/__init__.py
vmoret/pyrecipes
fbcc302c6ee1e10fae32f3ffb267a3536fb14d84
[ "Apache-2.0" ]
null
null
null
src/recipes/__init__.py
vmoret/pyrecipes
fbcc302c6ee1e10fae32f3ffb267a3536fb14d84
[ "Apache-2.0" ]
null
null
null
"""Collection of Python recipes""" from ._version import version_info, __version__ from ._curry import curry from .itertools import * from .utils import * from .partial import partiall, partialr
24.5
47
0.785714
25
196
5.88
0.56
0.136054
0
0
0
0
0
0
0
0
0
0
0.137755
196
7
48
28
0.869822
0.142857
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
7b46caac54f5dc68528aebf1b3f73b92a870fc88
136
py
Python
pythonProject/q11.py
Babur171/python
a82a679fd8e9037fbc23ac347615cfea559f0281
[ "MIT" ]
null
null
null
pythonProject/q11.py
Babur171/python
a82a679fd8e9037fbc23ac347615cfea559f0281
[ "MIT" ]
null
null
null
pythonProject/q11.py
Babur171/python
a82a679fd8e9037fbc23ac347615cfea559f0281
[ "MIT" ]
null
null
null
def generate_n_chars(n, c): result = '' for i in range(n): result += c return result print(generate_n_chars(3, 'c'))
22.666667
31
0.595588
22
136
3.5
0.590909
0.233766
0.363636
0
0
0
0
0
0
0
0
0.01
0.264706
136
6
31
22.666667
0.76
0
0
0
1
0
0.007299
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.333333
0.166667
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7b4d5ae87e5bbacf17c3f6de99360eeaa16f5f64
157
py
Python
config.py
menicgiulia/FoodMine
d7a21720650790ec312f912c44fc8de9eaa98639
[ "MIT" ]
17
2019-12-10T20:07:58.000Z
2021-11-26T09:47:22.000Z
config.py
menicgiulia/FoodMine
d7a21720650790ec312f912c44fc8de9eaa98639
[ "MIT" ]
null
null
null
config.py
menicgiulia/FoodMine
d7a21720650790ec312f912c44fc8de9eaa98639
[ "MIT" ]
7
2019-12-26T22:15:07.000Z
2022-02-04T07:07:30.000Z
from pathlib import Path import os HEADPATH = Path(__file__).parent def mfp(path): """Make relative filepath""" return os.path.join(HEADPATH, path)
19.625
39
0.719745
22
157
4.954545
0.681818
0.220183
0
0
0
0
0
0
0
0
0
0
0.165605
157
8
39
19.625
0.832061
0.140127
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
7b6ba337875692072a9fc3d1d3985309d9f48f32
175
py
Python
test/test_working_with_windows.py
asemerenko/selenium_training
adb551a9ff3d12c020c24e77520139e17711b7a0
[ "Apache-2.0" ]
null
null
null
test/test_working_with_windows.py
asemerenko/selenium_training
adb551a9ff3d12c020c24e77520139e17711b7a0
[ "Apache-2.0" ]
null
null
null
test/test_working_with_windows.py
asemerenko/selenium_training
adb551a9ff3d12c020c24e77520139e17711b7a0
[ "Apache-2.0" ]
1
2019-09-15T18:54:58.000Z
2019-09-15T18:54:58.000Z
def test_links_opening_in_new_window(app, start): countries_links_list = app.window.get_countries_links() app.window.click_links_on_country_page(countries_links_list)
43.75
64
0.84
27
175
4.888889
0.592593
0.318182
0.272727
0
0
0
0
0
0
0
0
0
0.085714
175
3
65
58.333333
0.825
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
7b8da6b793276830dfde0f05c1cc7f4fe640aa26
654
py
Python
api/serializers/__init__.py
jcasmer/grow_control_backend-
6a18a137e0a16138607413925727d7e5f8486777
[ "BSD-3-Clause" ]
1
2019-05-11T14:45:47.000Z
2019-05-11T14:45:47.000Z
api/serializers/__init__.py
jcasmer/grow_control_backend-
6a18a137e0a16138607413925727d7e5f8486777
[ "BSD-3-Clause" ]
6
2021-03-18T20:45:02.000Z
2021-09-22T17:41:38.000Z
api/serializers/__init__.py
jcasmer/grow_control_backend-
6a18a137e0a16138607413925727d7e5f8486777
[ "BSD-3-Clause" ]
null
null
null
from .group import GroupSerializer from .user import UserSerializer, UserFullDataSerializer from .type_diagnostic import TypeDiagnosticSerializer, TypeDiagnosticFullDataSerializer from .advices import AdvicesSerializer, AdvicesFullDataSerializer from .relationship import RelationshipSerializer, RelationshipFullDataSerializer from .parents import ParentsSerializer, ParentsFullDataSerializer from .childs import ChildsSerializer, ChildsFullDataSerializer, ChildsSaveSerializer from .parents_childs import ParentsChildsSerializer, ParentsChildsFullDataSerializer from .childs_detail import ChildsDetailSerializer, ChildsDetailFullDataSerializer
65.4
88
0.889908
48
654
12.0625
0.604167
0.037997
0
0
0
0
0
0
0
0
0
0
0.082569
654
9
89
72.666667
0.965
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
7bbca48683a6a3880f44c2296d3658237a501a13
95
py
Python
tasks.py
RevolutionTech/seared-quail
ef2b87146850509e2f6f4057344fdc037c8a2808
[ "0BSD" ]
1
2021-01-28T20:10:36.000Z
2021-01-28T20:10:36.000Z
tasks.py
RevolutionTech/flamingo
d66f8c7c754de0fcc6ccc9fd5f0d0d44eea3891e
[ "0BSD" ]
150
2017-11-02T04:49:05.000Z
2022-03-12T01:02:40.000Z
tasks.py
RevolutionTech/flamingo
d66f8c7c754de0fcc6ccc9fd5f0d0d44eea3891e
[ "0BSD" ]
2
2016-08-27T21:35:12.000Z
2018-01-13T08:11:33.000Z
from invoke import Collection from opstrich.invoke import check namespace = Collection(check)
19
33
0.831579
12
95
6.583333
0.583333
0.303797
0
0
0
0
0
0
0
0
0
0
0.126316
95
4
34
23.75
0.951807
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
c8787fc6349ae38c9efb557832080e6c54570b9c
5,315
py
Python
python/tests.py
mvdwerve/streambar
265a42ccd20a5ea68f73a069f5c636bf1925e9ae
[ "MIT" ]
3
2021-02-24T14:40:40.000Z
2021-12-28T19:07:29.000Z
python/tests.py
mvdwerve/streambar
265a42ccd20a5ea68f73a069f5c636bf1925e9ae
[ "MIT" ]
null
null
null
python/tests.py
mvdwerve/streambar
265a42ccd20a5ea68f73a069f5c636bf1925e9ae
[ "MIT" ]
1
2020-08-15T06:32:16.000Z
2020-08-15T06:32:16.000Z
import unittest import streambar import tempfile import pandas as pd import numpy as np from io import StringIO from numpy.testing import assert_array_equal import os class TestBars(unittest.TestCase): def setUp(self): # create a filename out = tempfile.NamedTemporaryFile(delete=False) self._fname = out.name out.close() def tearDown(self): # unlink the file again os.unlink(self._fname) def test_tick_small(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.tick("tests/small.tape", self._fname, size=2), 6) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [200, 200, 200, 200, 200, 100]) assert_array_equal(df['buys'].values, [1, 2, 2, 2, 2, 1]) assert_array_equal(df['vwap'].values, [101.25, 102.5, 102.5, 102.5, 102.5, 102.5]) assert_array_equal(df['trades'].values, [2, 2, 2, 2, 2, 1]) def test_tick_incremental(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.tick("tests/incremental.tape", self._fname, size=2), 6) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [300, 700, 1100, 1500, 1900, 1100]) def test_volume_small(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.volume("tests/small.tape", self._fname, size=500), 3) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [500, 500, 100]) assert_array_equal(df['buys'].values, [4, 5, 1]) assert_array_equal(df['vwap'].values, [102, 102.5, 102.5]) assert_array_equal(df['trades'].values, [5, 5, 1]) def test_change_small(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.change("tests/small.tape", self._fname, size=100), 2) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [100, 1000]) assert_array_equal(df['buys'].values, [0, 10]) assert_array_equal(df['vwap'].values, [100, 102.5]) assert_array_equal(df['trades'].values, [1, 10]) def test_change_small_incremental_price(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.change("tests/incremental_price.tape", self._fname, size=500), 2) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [500, 600]) assert_array_equal(df['buys'].values, [4, 6]) assert_array_equal(df['vwap'].values, [102.4, 108]) assert_array_equal(df['trades'].values, [5, 6]) def test_volume_incremental(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.volume("tests/incremental.tape", self._fname, size=500), 8) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [600, 900, 600, 700, 800, 900, 1000, 1100]) def test_time_small(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.time("tests/small.tape", self._fname, size=4), 3) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [400, 400, 300]) assert_array_equal(df['buys'].values, [3, 4, 3]) assert_array_equal(df['vwap'].values, [101.875, 102.5, 102.5]) assert_array_equal(df['trades'].values, [4, 4, 3]) def test_time_incremental(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.time("tests/incremental.tape", self._fname, size=4), 3) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [1000, 2600, 3000]) def test_dollar_incremental(self): # should be 6 bars in total, with the last one being off self.assertEqual(streambar.dollar("tests/incremental.tape", self._fname, size=35000), 9) # open as a dataframe df = pd.read_csv(self._fname) # check the data assert_array_equal(df['volume'].values, [600, 400, 500, 600, 700, 800, 900, 1000, 1100]) def test_invalid_file(self): # should be 6 bars in total, with the last one being off @todo typeerror is weird but works for now I guess self.assertRaises(TypeError, streambar.tick, "nx", "", size=123) class TestPerformance(unittest.TestCase): def setUp(self): # create a filename out = tempfile.NamedTemporaryFile(delete=False) self._fname = out.name out.close() def tearDown(self): # unlink the file again os.unlink(self._fname) def test_performance(self): pass if __name__ == '__main__': unittest.main()
36.655172
115
0.629351
764
5,315
4.230366
0.159686
0.085087
0.123762
0.133663
0.823329
0.8125
0.744121
0.66677
0.635829
0.635829
0
0.06989
0.248918
5,315
145
116
36.655172
0.739729
0.187206
0
0.265823
0
0
0.073228
0.027052
0
0
0
0.006897
0.443038
1
0.189873
false
0.012658
0.101266
0
0.316456
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
1
0
0
0
0
0
0
0
0
0
5
c88a72671149c1f8251ee19af744b269996f3983
43
py
Python
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/python/exceptions.py
assessorgeneral/ConQAT
2a462f23f22c22aa9d01a7a204453d1be670ba60
[ "Apache-2.0" ]
1
2020-04-28T20:06:30.000Z
2020-04-28T20:06:30.000Z
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/python/exceptions.py
SvenPeldszus/conqat
28fe004a49453894922aeb27ee3467b1748d23e9
[ "Apache-2.0" ]
null
null
null
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/python/exceptions.py
SvenPeldszus/conqat
28fe004a49453894922aeb27ee3467b1748d23e9
[ "Apache-2.0" ]
null
null
null
try: print 'foo' except ImportError: pass
10.75
19
0.744186
6
43
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.162791
43
4
20
10.75
0.888889
0
0
0
0
0
0.068182
0
0
0
0
0
0
0
null
null
0.25
0.25
null
null
0.25
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
1
0
0
0
0
0
5
c8aa1d30b2fb5fede83f69d67c6dcdcea0d94f4b
83
py
Python
build/lib/psearcher/__init__.py
iridesc/psearcher
ee64a6c2cf9d326d562ccb06ec0c9e08b5862b2e
[ "MIT" ]
1
2019-12-04T15:54:50.000Z
2019-12-04T15:54:50.000Z
psearcher/__init__.py
iridesc/psearcher
ee64a6c2cf9d326d562ccb06ec0c9e08b5862b2e
[ "MIT" ]
null
null
null
psearcher/__init__.py
iridesc/psearcher
ee64a6c2cf9d326d562ccb06ec0c9e08b5862b2e
[ "MIT" ]
null
null
null
from .BaseEngine import BaseEngine from .Bing import Bing from .Baidu import Baidu
20.75
34
0.819277
12
83
5.666667
0.416667
0
0
0
0
0
0
0
0
0
0
0
0.144578
83
3
35
27.666667
0.957746
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c8b2263aaacd0d7ed73a5fcb67ab5f21b4cd2d93
29
py
Python
imqfody/__init__.py
CERT-Bund/python-imqfody
3a22cef7ac57fd6c9137ba81cd208a07b7077a5d
[ "MIT" ]
1
2021-08-31T06:08:20.000Z
2021-08-31T06:08:20.000Z
imqfody/__init__.py
CERT-Bund/python-imqfody
3a22cef7ac57fd6c9137ba81cd208a07b7077a5d
[ "MIT" ]
null
null
null
imqfody/__init__.py
CERT-Bund/python-imqfody
3a22cef7ac57fd6c9137ba81cd208a07b7077a5d
[ "MIT" ]
null
null
null
from .imqfody import IMQFody
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
cdee08d3d088e5b1a3a9990ed2b5a80de6c3b19b
166
py
Python
grapl_analyzerlib/schemas/any_node_schema.py
wittekm/grapl_analyzerlib
0eef2150c0adf80e50217e99c529f889318c7ff0
[ "MIT" ]
3
2019-06-08T05:52:09.000Z
2020-01-31T03:19:26.000Z
grapl_analyzerlib/schemas/any_node_schema.py
graplsec/grapl_analyzerlib
8591dfe549df71ac319283223b5cff3edac31d51
[ "MIT" ]
449
2020-09-11T07:07:18.000Z
2021-08-03T06:09:36.000Z
grapl_analyzerlib/schemas/any_node_schema.py
graplsec/grapl_analyzerlib
8591dfe549df71ac319283223b5cff3edac31d51
[ "MIT" ]
2
2020-01-31T03:19:57.000Z
2020-04-17T20:10:05.000Z
from grapl_analyzerlib.schemas.schema_builder import NodeSchema class AnyNodeSchema(NodeSchema): @staticmethod def self_type() -> str: return "Any"
20.75
63
0.73494
18
166
6.611111
0.944444
0
0
0
0
0
0
0
0
0
0
0
0.186747
166
7
64
23.714286
0.881481
0
0
0
0
0
0.018072
0
0
0
0
0
0
1
0.2
true
0
0.2
0.2
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
1
1
0
0
5
a8078a5e11ccbc4eabd74c9c7ad2cafffc56903e
214
py
Python
mysite/ct/exceptions.py
cjlee112/socraticqs2
2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820
[ "Apache-2.0" ]
8
2015-06-02T15:34:44.000Z
2019-03-21T12:27:30.000Z
mysite/ct/exceptions.py
cjlee112/socraticqs2
2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820
[ "Apache-2.0" ]
761
2015-01-07T05:13:08.000Z
2022-02-10T10:23:37.000Z
mysite/ct/exceptions.py
cjlee112/socraticqs2
2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820
[ "Apache-2.0" ]
12
2015-01-28T20:09:36.000Z
2018-03-20T13:32:11.000Z
# coding=utf-8 class CommonDisambiguationError(Exception): def __init__(self, options): self.options = options def __str__(self): return "There are more than one articles for that query"
21.4
64
0.691589
26
214
5.384615
0.807692
0.157143
0
0
0
0
0
0
0
0
0
0.006061
0.228972
214
9
65
23.777778
0.842424
0.056075
0
0
0
0
0.235
0
0
0
0
0
0
1
0.4
false
0
0
0.2
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
1
0
0
0
1
1
0
0
5
b57a7f516a5f666534e225eab518f2d26261187e
53
py
Python
catkin_ws/devel/lib/python2.7/dist-packages/duckietown_msgs/srv/__init__.py
bendychua/final
35fd0477ec5950479f0e082a65db2aa05a92db82
[ "CC-BY-2.0" ]
1
2019-05-13T00:40:11.000Z
2019-05-13T00:40:11.000Z
catkin_ws/devel/lib/python2.7/dist-packages/duckietown_msgs/srv/__init__.py
bendychua/final
35fd0477ec5950479f0e082a65db2aa05a92db82
[ "CC-BY-2.0" ]
null
null
null
catkin_ws/devel/lib/python2.7/dist-packages/duckietown_msgs/srv/__init__.py
bendychua/final
35fd0477ec5950479f0e082a65db2aa05a92db82
[ "CC-BY-2.0" ]
null
null
null
from ._SetValue import * from ._SetFSMState import *
17.666667
27
0.773585
6
53
6.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.150943
53
2
28
26.5
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b57ef85990f9746c5e50e725701858cbefe391c4
99
py
Python
src/pyFlask/hooks/hook-sparcur.py
megasanjay/SODA-for-SPARC
cb977384ed01bf2c0a615b86bcd40dbc0c60cde1
[ "MIT" ]
null
null
null
src/pyFlask/hooks/hook-sparcur.py
megasanjay/SODA-for-SPARC
cb977384ed01bf2c0a615b86bcd40dbc0c60cde1
[ "MIT" ]
null
null
null
src/pyFlask/hooks/hook-sparcur.py
megasanjay/SODA-for-SPARC
cb977384ed01bf2c0a615b86bcd40dbc0c60cde1
[ "MIT" ]
null
null
null
from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('sparcur', True)
33
54
0.838384
14
99
5.642857
0.785714
0.278481
0.405063
0
0
0
0
0
0
0
0
0
0.080808
99
3
55
33
0.868132
0
0
0
0
0
0.07
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
b587d148ecdd2ed7dbc66780eb27ab0311b3d5e9
1,716
py
Python
browser_integration_select.py
apiad/sublime-browser-integration
3914a8cd80ceabe58593a4123dd9e9493c5d5ebd
[ "MIT" ]
24
2015-03-11T12:46:22.000Z
2021-06-04T17:11:02.000Z
browser_integration_select.py
apiad/sublime-browser-integration
3914a8cd80ceabe58593a4123dd9e9493c5d5ebd
[ "MIT" ]
5
2015-04-08T23:20:10.000Z
2016-08-16T16:39:29.000Z
browser_integration_select.py
apiad/sublime-browser-integration
3914a8cd80ceabe58593a4123dd9e9493c5d5ebd
[ "MIT" ]
2
2015-05-21T18:18:43.000Z
2021-06-29T01:35:11.000Z
from .browser_integration import * class BrowserIntegrationSelectCommand(sublime_plugin.WindowCommand): plugin_name = "Select by CSS" plugin_description = "Select DOM elements by CSS selector." @staticmethod def visible(): return browser.connected() @async @require_browser def run(self): old_selector = browser.old_css_selector @async def cancel(): browser.unselect() if old_selector: browser.browser.select_css(old_selector) view = self.window.show_input_panel('CSS Selector', browser.old_css_selector, None, self.highlight, cancel) view.sel().add(sublime.Region(0, view.size())) def highlight(self, selector): browser.select_css(selector) class BrowserIntegrationSelectxpathCommand(sublime_plugin.WindowCommand): plugin_name = "Select by XPath" plugin_description = "Select DOM elements by XPath selector." @staticmethod def visible(): return browser.connected() @async @require_browser def run(self): old_selector = browser.old_xpath_selector @async def cancel(): browser.unselect() if old_selector: browser.browser.select_xpath(old_selector) view = self.window.show_input_panel('CSS Selector', browser.old_xpath_selector, None, self.highlight, cancel) view.sel().add(sublime.Region(0, view.size())) def highlight(self, selector): browser.select_xpath(selector)
27.677419
73
0.596737
168
1,716
5.910714
0.261905
0.120846
0.072508
0.064451
0.845921
0.829809
0.757301
0.668681
0.668681
0.668681
0
0.001715
0.320513
1,716
61
74
28.131148
0.849914
0
0
0.651163
0
0
0.073427
0
0
0
0
0
0
0
null
null
0
0.023256
null
null
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
1
0
0
0
0
0
0
0
0
5
b594b9a817f00b58a0a40b8f502ddb600f7eb95d
28
py
Python
app.py
Thiphapornn/hydroponics_iot
bfd51504ac7e8d71900512620d1170d7ec52242d
[ "Apache-2.0" ]
null
null
null
app.py
Thiphapornn/hydroponics_iot
bfd51504ac7e8d71900512620d1170d7ec52242d
[ "Apache-2.0" ]
null
null
null
app.py
Thiphapornn/hydroponics_iot
bfd51504ac7e8d71900512620d1170d7ec52242d
[ "Apache-2.0" ]
null
null
null
from fastapi import FastAPI
14
27
0.857143
4
28
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.142857
28
1
28
28
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a946334a8e9e363ee255f036bffeff9b7db2825e
140
py
Python
borrow/admin.py
Time-xg/bookmanager_django
3d8f2e9b38570e0e4ea5498f6ab4fe16b7d2f969
[ "MIT" ]
null
null
null
borrow/admin.py
Time-xg/bookmanager_django
3d8f2e9b38570e0e4ea5498f6ab4fe16b7d2f969
[ "MIT" ]
null
null
null
borrow/admin.py
Time-xg/bookmanager_django
3d8f2e9b38570e0e4ea5498f6ab4fe16b7d2f969
[ "MIT" ]
null
null
null
from django.contrib import admin # Register your models here. # 注册模型 from borrow.models import BorrowInfo admin.site.register(BorrowInfo)
17.5
36
0.807143
19
140
5.947368
0.684211
0
0
0
0
0
0
0
0
0
0
0
0.128571
140
7
37
20
0.92623
0.221429
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a97712f87893dee15f64a126273681e2b5aad284
5,415
py
Python
graditudelib/generate_html.py
foerstner-lab/GRADitude
02251b3e204bf4702bf189d9bec375068a6fc0d7
[ "0BSD" ]
1
2018-04-13T17:54:38.000Z
2018-04-13T17:54:38.000Z
graditudelib/generate_html.py
konrad/GRADitude
07a92b14bbad4383e5f146387530556e751389f3
[ "MIT" ]
8
2020-02-27T11:58:42.000Z
2020-11-25T07:30:52.000Z
graditudelib/generate_html.py
konrad/GRADitude
07a92b14bbad4383e5f146387530556e751389f3
[ "MIT" ]
1
2019-01-25T10:10:56.000Z
2019-01-25T10:10:56.000Z
import os from jinja2 import Template import pandas as pd from bokeh.plotting import figure, output_file, save from bokeh.models import BoxZoomTool, ResetTool, PanTool from bokeh.models import WheelZoomTool def generate_html_page(html_folder, html_folder_gene, html_folder_protein, rna_seq_file, name_column_rna, column_start_rna, column_end_rna, protein_file, name_column_protein, column_start_protein, column_end_protein): image_folder_gene = "{}/images".format(html_folder_gene) image_folder_protein = "{}/images".format(html_folder_protein) rna_seq_data = pd.read_csv(rna_seq_file, sep="\t") protein_data = pd.read_csv(protein_file, sep="\t") for folder in [html_folder, html_folder_gene, html_folder_protein, image_folder_gene, image_folder_protein]: if not os.path.exists(folder): os.mkdir(folder) generate_index_pager(rna_seq_data, protein_data, html_folder) generate_gene_pages(rna_seq_data, name_column_rna, column_start_rna, column_end_rna, html_folder_gene, image_folder_gene) generate_protein_pages(protein_data, name_column_protein, column_start_protein, column_end_protein, html_folder_protein, image_folder_protein) def generate_index_pager(rna_seq_data, protein_data, html_folder): # template = Template(open("templates/gene_index_template.html").read()) template = Template(open( "../templates/gene_index_template_bootstrap.html").read()) gene_index_html = template.render(rna_seq_data=rna_seq_data, protein_data=protein_data) with open("{}/index.html".format(html_folder), "w") as output_fh: output_fh.write(gene_index_html) def generate_gene_pages(rna_seq_data, name_column_rna, column_start_rna, column_end_rna, html_folder_gene, image_folder): for index, row in rna_seq_data.iterrows(): generate_gene_page(row, name_column_rna, html_folder_gene, image_folder) generate_gene_rna_distri_image(row, name_column_rna, column_start_rna, column_end_rna, image_folder) # exit(0) def generate_protein_pages(protein_data, name_column_protein, column_start_protein, column_end_protein, html_folder_protein, image_folder): for index, row in protein_data.iterrows(): generate_protein_page(row, name_column_protein, html_folder_protein, image_folder) generate_protein_distri_image(row, name_column_protein, column_start_protein, column_end_protein, image_folder) # exit(0) def generate_gene_page(row, name_column_rna, html_folder, image_folder): locus_tag = row[name_column_rna] with open("{}/{}.html".format(html_folder, locus_tag), "w") as output_fh: # template = Template(open("templates/gene_template.html").read()) template = Template(open("../templates/gene_template_bootstrap.html").read()) gene_html = template.render(row=row) output_fh.write(gene_html.format(image_folder, locus_tag)) def generate_protein_page(row, name_column_protein, html_folder, image_folder): locus_tag = row[name_column_protein] with open("{}/{}.html".format(html_folder, locus_tag), "w") as output_fh: # template = Template(open("templates/gene_template.html").read()) template = Template(open("../templates/protein_template_bootstrap.html").read()) gene_html = template.render(row=row) output_fh.write(gene_html.format(image_folder, locus_tag)) def generate_gene_rna_distri_image(row, name_column_rna, column_start_rna, column_end_rna, image_folder): locus_tag = row[name_column_rna] counting_value_list = row.iloc[column_start_rna:column_end_rna] plot_html = figure(title=locus_tag, plot_width=600, plot_height=600, x_axis_label='Fraction number', y_axis_label='Normalized and scaled to max read counts', tools=[BoxZoomTool(), ResetTool(), PanTool(), WheelZoomTool()]) plot_html.yaxis.axis_label_text_font_size = "15pt" plot_html.xaxis.axis_label_text_font_size = "15pt" plot_html.title.text_font_size = '15pt' plot_html.toolbar.logo = None y_axis = range(1, 21) plot_html.line(y_axis, counting_value_list) output_file("{}/{}.html".format(image_folder, locus_tag)) save(plot_html) def generate_protein_distri_image(row, name_column_protein, column_start_protein, column_end_protein, image_folder): locus_tag = row[name_column_protein] counting_value_list = row.iloc[column_start_protein:column_end_protein] plot_html = figure(title=locus_tag, plot_width=600, plot_height=600, x_axis_label='Fraction number', y_axis_label='Normalized and scaled to max read counts', tools=[BoxZoomTool(), ResetTool(), PanTool(), WheelZoomTool()]) plot_html.yaxis.axis_label_text_font_size = "15pt" plot_html.xaxis.axis_label_text_font_size = "15pt" plot_html.title.text_font_size = '15pt' plot_html.toolbar.logo = None y_axis = range(1, 21) plot_html.line(y_axis, counting_value_list) output_file("{}/{}.html".format(image_folder, locus_tag)) save(plot_html)
50.138889
116
0.705633
724
5,415
4.850829
0.138122
0.059795
0.044419
0.04328
0.851367
0.812642
0.780467
0.746014
0.68992
0.611048
0
0.007618
0.2
5,415
107
117
50.607477
0.803093
0.039889
0
0.44186
0
0
0.066243
0.025419
0
0
0
0
0
1
0.093023
false
0
0.069767
0
0.162791
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a97c80cd7b22fa79386690285df1580269e5b759
69
py
Python
products-service/domain/__init__.py
piotrb5e3/sanic-uservices-demo
8e9ae3fd7a16fdd5f10426195d3300a98d886974
[ "MIT" ]
null
null
null
products-service/domain/__init__.py
piotrb5e3/sanic-uservices-demo
8e9ae3fd7a16fdd5f10426195d3300a98d886974
[ "MIT" ]
null
null
null
products-service/domain/__init__.py
piotrb5e3/sanic-uservices-demo
8e9ae3fd7a16fdd5f10426195d3300a98d886974
[ "MIT" ]
1
2019-03-24T18:49:55.000Z
2019-03-24T18:49:55.000Z
from .products import get_all_products, get_optional_product_with_id
34.5
68
0.898551
11
69
5.090909
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.072464
69
1
69
69
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a97ead6523ed64d6f2717f2a3911557170d73b49
149
py
Python
cbuild/hooks/pre_pkg/999_collected_rdeps.py
mahiuchun/cports
37315875922d65a6d4f612cdc17bc0d88856d6d0
[ "BSD-2-Clause" ]
46
2021-06-10T02:27:32.000Z
2022-03-27T11:33:24.000Z
cbuild/hooks/pre_pkg/999_collected_rdeps.py
mahiuchun/cports
37315875922d65a6d4f612cdc17bc0d88856d6d0
[ "BSD-2-Clause" ]
58
2021-07-03T13:58:20.000Z
2022-03-13T16:45:35.000Z
cbuild/hooks/pre_pkg/999_collected_rdeps.py
mahiuchun/cports
37315875922d65a6d4f612cdc17bc0d88856d6d0
[ "BSD-2-Clause" ]
6
2021-07-04T10:46:40.000Z
2022-01-09T00:03:59.000Z
def invoke(pkg): if not (pkg.destdir / "rdeps").is_file(): return pkg.logger.out_plain(" " + (pkg.destdir / "rdeps").read_text())
24.833333
69
0.583893
20
149
4.2
0.75
0.238095
0.357143
0
0
0
0
0
0
0
0
0
0.221477
149
5
70
29.8
0.724138
0
0
0
0
0
0.087248
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
a9a0f4af577853bcb18956c6491c1270149f5b00
1,291
py
Python
digin/users/serializers.py
yhung119/cs411-digin
55e884ff0c26ca06056219e6cb641dc1ceae1f56
[ "Apache-2.0" ]
null
null
null
digin/users/serializers.py
yhung119/cs411-digin
55e884ff0c26ca06056219e6cb641dc1ceae1f56
[ "Apache-2.0" ]
null
null
null
digin/users/serializers.py
yhung119/cs411-digin
55e884ff0c26ca06056219e6cb641dc1ceae1f56
[ "Apache-2.0" ]
null
null
null
# users/serializers.py from rest_framework import serializers from . import models from django.contrib.auth.hashers import make_password from django.db import connection # class UserSerializer(serializers.ModelSerializer): # password = serializers.CharField(write_only=True) # def create(self, validated_data): # # user = models.CustomUser.objects.create(**validated_data) # with connection.cursor() as cursor: # cursor.execute("INSERT INTO users_customuser" # "(password, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined, name)" # "VALUES (%s, 0, %s, '', '', %s, 0, 1, NOW(), %s)", # (make_password(validated_data["password"]), validated_data["username"], validated_data["email"], validated_data["name"]) # ) # cursor.execute("SELECT * FROM users_customuser WHERE username=%s", [validated_data["username"]]) # validated_data['id'] = cursor.fetchone()[0] # 0 is default position # user = models.CustomUser(**validated_data) # return user # class Meta: # model = models.CustomUser # fields = ('password', 'username', 'name', 'email', 'id')
40.34375
149
0.617351
136
1,291
5.705882
0.463235
0.150773
0.051546
0.07732
0.087629
0
0
0
0
0
0
0.005181
0.252517
1,291
31
150
41.645161
0.798964
0.836561
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
8d2a8df4452644d1d664f0b8229d4565b77fd358
120
py
Python
blog/admin.py
BkrmDahal/newsapp
5b8a00072662db31a87f7975dcdf8e5bb6068235
[ "MIT" ]
1
2018-05-11T16:30:55.000Z
2018-05-11T16:30:55.000Z
blog/admin.py
BkrmDahal/newsapp
5b8a00072662db31a87f7975dcdf8e5bb6068235
[ "MIT" ]
null
null
null
blog/admin.py
BkrmDahal/newsapp
5b8a00072662db31a87f7975dcdf8e5bb6068235
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Stories # Register your models here. admin.site.register(Stories)
20
32
0.808333
17
120
5.705882
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.125
120
5
33
24
0.92381
0.216667
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8d77e9901fb628468c2056bcf5596617ff65214e
5,823
py
Python
mongo_api.py
IQisMySenpai/RedditTopOfBot
ce3b46d6f20a460b0d510530e225a52df69b3e30
[ "MIT" ]
null
null
null
mongo_api.py
IQisMySenpai/RedditTopOfBot
ce3b46d6f20a460b0d510530e225a52df69b3e30
[ "MIT" ]
null
null
null
mongo_api.py
IQisMySenpai/RedditTopOfBot
ce3b46d6f20a460b0d510530e225a52df69b3e30
[ "MIT" ]
null
null
null
import pymongo import bson class MongoAPI: client: pymongo.MongoClient db_name: str dummy_read: str dummy_write: str dummy_update: str def __init__(self, db_name: str, db_username: str, db_password: str): # initialising connection to Mongo self.client = pymongo.MongoClient(f"mongodb+srv://{db_username}:{db_password}@maincluster.ud45d.mongodb.net/" f"{db_name}?retryWrites=true&w=1") self.db_name = db_name def find_one(self, collection: str, filter_dict: dict = None, projection_dict: dict = None, sort: list = None): """ Query the database. :param collection: Collection name string :param filter_dict: A dict specifying elements which must be present for a document to be included in the res :param projection_dict: A dict of field names that should be returned in the result :param sort: A list of (key, direction) pairs specifying the sort order for this query :return: """ col = self.client[self.db_name][collection] return col.find_one(filter=filter_dict, projection=projection_dict, sort=sort) def find(self, collection: str, filter_dict: dict = None, projection_dict: dict = None, sort: list = None): """ Query the database. :param collection: Collection name string :param filter_dict: A dict specifying elements which must be present for a document to be included in the result :param projection_dict: A dict of field names that should be returned in the result :param sort: A list of (key, direction) pairs specifying the sort order for this query :return: """ col = self.client[self.db_name][collection] return col.find(filter=filter_dict, projection=projection_dict, sort=sort) def insert_one(self, collection: str, document_dict: dict = None): """ Insert a single document. :param collection: Collection name string :param document_dict: The document to insert :return: inserted id """ if document_dict is None: document_dict = {} col = self.client[self.db_name][collection] result = col.insert_one(document=document_dict) return result.inserted_id def insert(self, collection: str, document_list: list = None): """ Insert an iterable of documents. :param collection: Collection name string :param document_list: The documents to insert into the db. Needs to be a list containing doction :return: inserted id """ if document_list is None: document_list = [] col = self.client[self.db_name][collection] result = col.insert_many(document=document_list) return result.inserted_id def update_one(self, collection: str, filter_dict: dict = None, update_dict: dict = None, upsert: bool = False): """ Update a single document matching the filter. :param collection: Collection name string :param filter_dict: A dict specifying elements which must be present for a document to be included in the result :param update_dict: A dict with the modifications to apply :param upsert: If True, perform an insert if no documents match the filter :return: modified count """ col = self.client[self.db_name][collection] result = col.update_one(filter=filter_dict, update=update_dict, upsert=upsert) return result.modified_count def update(self, collection: str, filter_dict: dict = None, update_dict: dict = None, upsert: bool = False): """ Update one or more documents that match the filter. :param collection: Collection name string :param filter_dict: A dict specifying elements which must be present for a document to be included in the result :param update_dict: A dict with the modifications to apply :param upsert: If True, perform an insert if no documents match the filter :return: modified count """ col = self.client[self.db_name][collection] result = col.update_many(filter=filter_dict, update=update_dict, upsert=upsert) return result.modified_count def delete_one(self, collection: str, filter_dict: dict = None): """ Delete a single document matching the filter. :param collection: Collection name string :param filter_dict A dict specifying elements which must be present for a document to be included in the result :return: deleted count """ col = self.client[self.db_name][collection] result = col.delete_one(filter=filter_dict) return result.deleted_count def delete(self, collection: str, filter_dict: dict = None): """ Delete one or more documents matching the filter. :param collection: Collection name string :param filter_dict: A dict specifying elements which must be present for a document to be included in the result :return: deleted count """ col = self.client[self.db_name][collection] result = col.delete_many(filter=filter_dict) return result.deleted_count def count(self, collection: str, filter_dict: dict = None): """ Count the number of documents in this collection. :param collection: Collection name string :param filter_dict: A dict specifying elements which must be present for a document to be included in the result :return: """ if filter_dict is None: filter_dict = {} col = self.client[self.db_name][collection] return col.count_documents(filter=filter_dict)
35.944444
120
0.660999
757
5,823
4.968296
0.137384
0.061154
0.038288
0.069396
0.782239
0.755118
0.755118
0.720287
0.671098
0.63281
0
0.000702
0.266186
5,823
161
121
36.167702
0.879476
0.423665
0
0.294118
0
0
0.035565
0.035565
0
0
0
0
0
1
0.196078
false
0.039216
0.039216
0
0.529412
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
1
0
0
5
8d907ad1c500b5618882253d80cac8d61ff7a048
174
py
Python
app/checkout_backend/admin.py
jcazallasc/lana-python-challenge
134ef30b6dcc7c323c90df8992b194741f071d95
[ "MIT" ]
null
null
null
app/checkout_backend/admin.py
jcazallasc/lana-python-challenge
134ef30b6dcc7c323c90df8992b194741f071d95
[ "MIT" ]
null
null
null
app/checkout_backend/admin.py
jcazallasc/lana-python-challenge
134ef30b6dcc7c323c90df8992b194741f071d95
[ "MIT" ]
null
null
null
from django.contrib import admin from checkout_backend.models import Cart, Offer, Product admin.site.register(Cart) admin.site.register(Offer) admin.site.register(Product)
21.75
56
0.821839
25
174
5.68
0.52
0.190141
0.359155
0
0
0
0
0
0
0
0
0
0.086207
174
7
57
24.857143
0.893082
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a5d0102ff6237c6be870c6fe94645129c712b5a4
78
py
Python
captum/insights/attr_vis/__init__.py
i-jones/captum
567ec6fc67ab85ce07d075b25428be22bb65e31b
[ "BSD-3-Clause" ]
3,140
2019-10-10T17:05:37.000Z
2022-03-31T17:31:01.000Z
captum/insights/attr_vis/__init__.py
i-jones/captum
567ec6fc67ab85ce07d075b25428be22bb65e31b
[ "BSD-3-Clause" ]
758
2019-10-11T18:01:04.000Z
2022-03-31T21:36:07.000Z
captum/insights/attr_vis/__init__.py
i-jones/captum
567ec6fc67ab85ce07d075b25428be22bb65e31b
[ "BSD-3-Clause" ]
345
2019-10-10T17:17:06.000Z
2022-03-30T07:31:31.000Z
from captum.insights.attr_vis.app import AttributionVisualizer, Batch # noqa
39
77
0.833333
10
78
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.102564
78
1
78
78
0.914286
0.051282
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a5e6d32550185cd002b19490e936e5ea81e219ca
22
py
Python
cs150/mm.py
icterguru/DrLutchClass
4ae75e047d00e36af7fd5019a7d751a44bc7daa8
[ "Apache-2.0" ]
null
null
null
cs150/mm.py
icterguru/DrLutchClass
4ae75e047d00e36af7fd5019a7d751a44bc7daa8
[ "Apache-2.0" ]
null
null
null
cs150/mm.py
icterguru/DrLutchClass
4ae75e047d00e36af7fd5019a7d751a44bc7daa8
[ "Apache-2.0" ]
1
2018-09-20T20:50:08.000Z
2018-09-20T20:50:08.000Z
print ("Hello , mm")
7.333333
20
0.545455
3
22
4
1
0
0
0
0
0
0
0
0
0
0
0
0.227273
22
2
21
11
0.705882
0
0
0
0
0
0.47619
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
570467cee7474dfec1ed8adc7916ddd87ebcbdc6
18,590
py
Python
aiolifxc/unpack.py
brianmay/aiolifx
c0e9589693d48091e7fc35225a3541dc685004de
[ "MIT" ]
null
null
null
aiolifxc/unpack.py
brianmay/aiolifx
c0e9589693d48091e7fc35225a3541dc685004de
[ "MIT" ]
19
2017-07-28T12:48:06.000Z
2018-08-10T14:19:58.000Z
aiolifxc/unpack.py
brianmay/aiolifx
c0e9589693d48091e7fc35225a3541dc685004de
[ "MIT" ]
1
2021-12-23T11:58:51.000Z
2021-12-23T11:58:51.000Z
# unpack.py # Author: Meghan Clark import binascii import struct from . import msgtypes from .message import HEADER_SIZE_BYTES, Message # Creates a LIFX Message out of packed binary data # If the message type is not one of the officially released ones above, it will create just a Message out of it # If it's not in the LIFX protocol format, uhhhhh...we'll put that on a to-do list. def unpack_lifx_message(packed_message: bytes) -> Message: header_str = packed_message[0:HEADER_SIZE_BYTES] payload_str = packed_message[HEADER_SIZE_BYTES:] size = struct.unpack("H", header_str[0:2])[0] flags = struct.unpack("H", header_str[2:4])[0] origin = (flags >> 14) & 3 tagged = (flags >> 13) & 1 addressable = (flags >> 12) & 1 protocol = flags & 4095 source_id = struct.unpack("I", header_str[4:8])[0] target_addr = ":".join([('%02x' % b) for b in struct.unpack("B" * 6, header_str[8:14])]) response_flags = struct.unpack("B", header_str[22:23])[0] ack_requested = bool(response_flags & 2) response_requested = bool(response_flags & 1) seq_num = struct.unpack("B", header_str[23:24])[0] message_type = struct.unpack("H", header_str[32:34])[0] message = Message( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) if message_type == msgtypes.MSG_IDS[msgtypes.GetService]: message = msgtypes.GetService( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateService]: service = struct.unpack("B", payload_str[0:1])[0] port = struct.unpack("I", payload_str[1:5])[0] payload = {"service": service, "port": port} message = msgtypes.StateService( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetHostInfo]: message = msgtypes.GetHostInfo( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateHostInfo]: signal = struct.unpack("f", payload_str[0:4])[0] tx = struct.unpack("I", payload_str[4:8])[0] rx = struct.unpack("I", payload_str[8:12])[0] reserved1 = struct.unpack("h", payload_str[12:14])[0] payload = {"signal": signal, "tx": tx, "rx": rx, "reserved1": reserved1} message = msgtypes.StateHostInfo( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetHostFirmware]: message = msgtypes.GetHostFirmware( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateHostFirmware]: build = struct.unpack("Q", payload_str[0:8])[0] reserved1 = struct.unpack("Q", payload_str[8:16])[0] version = struct.unpack("I", payload_str[16:20])[0] payload = {"build": build, "reserved1": reserved1, "version": version} message = msgtypes.StateHostFirmware( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetWifiInfo]: message = msgtypes.GetWifiInfo( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateWifiInfo]: signal = struct.unpack("f", payload_str[0:4])[0] tx = struct.unpack("I", payload_str[4:8])[0] rx = struct.unpack("I", payload_str[8:12])[0] reserved1 = struct.unpack("h", payload_str[12:14])[0] payload = {"signal": signal, "tx": tx, "rx": rx, "reserved1": reserved1} message = msgtypes.StateWifiInfo( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetWifiFirmware]: message = msgtypes.GetWifiFirmware( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateWifiFirmware]: build = struct.unpack("Q", payload_str[0:8])[0] reserved1 = struct.unpack("Q", payload_str[8:16])[0] version = struct.unpack("I", payload_str[16:20])[0] payload = {"build": build, "reserved1": reserved1, "version": version} message = msgtypes.StateWifiFirmware( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetPower]: message = msgtypes.GetPower( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.SetPower]: power_level = struct.unpack("H", payload_str[0:2])[0] payload = {"power_level": power_level} message = msgtypes.SetPower( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StatePower]: power_level = struct.unpack("H", payload_str[0:2])[0] payload = {"power_level": power_level} message = msgtypes.StatePower( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetLabel]: message = msgtypes.GetLabel( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.SetLabel]: label = binascii.unhexlify("".join(["%2.2x" % (b & 0x000000ff) for b in struct.unpack("b" * 32, payload_str[0:32])])) payload = {"label": label} message = msgtypes.SetLabel( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateLabel]: label = binascii.unhexlify("".join(["%2.2x" % (b & 0x000000ff) for b in struct.unpack("b" * 32, payload_str[0:32])])) payload = {"label": label} message = msgtypes.StateLabel( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetLocation]: message = msgtypes.GetLocation( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateLocation]: location = [b for b in struct.unpack("B" * 16, payload_str[0:16])] label = binascii.unhexlify("".join(["%2.2x" % (b & 0x000000ff) for b in struct.unpack("b" * 32, payload_str[16:48])])) updated_at = struct.unpack("Q", payload_str[48:56])[0] payload = {"location": location, "label": label, "updated_at": updated_at} message = msgtypes.StateLocation( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetGroup]: message = msgtypes.GetGroup( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateGroup]: group = [b for b in struct.unpack("B" * 16, payload_str[0:16])] label = binascii.unhexlify("".join(["%2.2x" % (b & 0x000000ff) for b in struct.unpack("b" * 32, payload_str[16:48])])) updated_at = struct.unpack("Q", payload_str[48:56])[0] payload = {"group": group, "label": label, "updated_at": updated_at} message = msgtypes.StateGroup( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetVersion]: message = msgtypes.GetVersion( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateVersion]: vendor = struct.unpack("I", payload_str[0:4])[0] product = struct.unpack("I", payload_str[4:8])[0] version = struct.unpack("I", payload_str[8:12])[0] payload = {"vendor": vendor, "product": product, "version": version} message = msgtypes.StateVersion( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.GetInfo]: message = msgtypes.GetInfo( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.StateInfo]: time = struct.unpack("Q", payload_str[0:8])[0] uptime = struct.unpack("Q", payload_str[8:16])[0] downtime = struct.unpack("Q", payload_str[16:24])[0] payload = {"time": time, "uptime": uptime, "downtime": downtime} message = msgtypes.StateInfo( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.Acknowledgement]: message = msgtypes.Acknowledgement( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.EchoRequest]: byte_array_len = len(payload_str) byte_array = [b for b in struct.unpack("B" * byte_array_len, payload_str[0:byte_array_len])] payload = {"byte_array": byte_array} message = msgtypes.EchoRequest( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.EchoResponse]: byte_array_len = len(payload_str) byte_array = [b for b in struct.unpack("B" * byte_array_len, payload_str[0:byte_array_len])] payload = {"byte_array": byte_array} message = msgtypes.EchoResponse( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightGet]: message = msgtypes.LightGet( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightSetColor]: color = struct.unpack("H" * 4, payload_str[0:8]) duration = struct.unpack("I", payload_str[8:12])[0] payload = {"color": color, "duration": duration} message = msgtypes.LightSetColor( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightState]: color = struct.unpack("H" * 4, payload_str[0:8]) reserved1 = struct.unpack("H", payload_str[8:10])[0] power_level = struct.unpack("H", payload_str[10:12])[0] label = binascii.unhexlify("".join(["%2.2x" % (b & 0x000000ff) for b in struct.unpack("b" * 32, payload_str[12:44])])) reserved2 = struct.unpack("Q", payload_str[44:52])[0] payload = {"color": color, "reserved1": reserved1, "power_level": power_level, "label": label, "reserved2": reserved2} message = msgtypes.LightState( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightGetPower]: message = msgtypes.LightGetPower( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightSetPower]: power_level = struct.unpack("H", payload_str[0:2])[0] duration = struct.unpack("I", payload_str[2:6])[0] payload = {"power_level": power_level, "duration": duration} message = msgtypes.LightSetPower( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightStatePower]: power_level = struct.unpack("H", payload_str[0:2])[0] payload = {"power_level": power_level} message = msgtypes.LightStatePower( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightGetInfrared]: # 120 message = msgtypes.LightGetInfrared( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightStateInfrared]: # 121 infrared_brightness = struct.unpack("H", payload_str[0:2])[0] payload = {"infrared_brightness": infrared_brightness} message = msgtypes.LightStateInfrared( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.LightSetInfrared]: # 122 infrared_brightness = struct.unpack("H", payload_str[0:2])[0] payload = {"infrared_brightness": infrared_brightness} message = msgtypes.LightSetInfrared( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.MultiZoneStateZone]: # 503 count = struct.unpack("c", payload_str[0:1])[0] count = ord(count) # 8 bit index = struct.unpack("c", payload_str[1:2])[0] index = ord(index) # 8 bit color = struct.unpack("H" * 4, payload_str[2:10]) payload = {"count": count, "index": index, "color": color} message = msgtypes.MultiZoneStateZone( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) elif message_type == msgtypes.MSG_IDS[msgtypes.MultiZoneStateMultiZone]: # 506 count = struct.unpack("c", payload_str[0:1])[0] count = ord(count) # 8 bit index = struct.unpack("c", payload_str[1:2])[0] index = ord(index) # 8 bit colors = [] for i in range(8): color = struct.unpack("H" * 4, payload_str[2 + (i * 8):10 + (i * 8)]) colors.append(color) payload = {"count": count, "index": index, "color": colors} message = msgtypes.MultiZoneStateMultiZone( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload=payload, ack_requested=ack_requested, response_requested=response_requested) else: message = Message( target_addr=target_addr, source_id=source_id, seq_num=seq_num, payload={}, ack_requested=ack_requested, response_requested=response_requested) message.message_type = message_type message.size = size message.origin = origin message.tagged = tagged message.addressable = addressable message.protocol = protocol message.source_id = source_id message.header = header_str message.payload = payload_str return message
50.107817
111
0.663852
2,266
18,590
5.176964
0.081642
0.056602
0.177308
0.05592
0.777939
0.759356
0.742648
0.737533
0.718353
0.707271
0
0.022741
0.224153
18,590
370
112
50.243243
0.790612
0.016945
0
0.564263
0
0
0.025356
0
0
0
0.002738
0
0
1
0.003135
false
0
0.012539
0
0.018809
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
571ca2078b4a8fb53a75dd5d58fb34caa320ddf4
241
py
Python
products/models.py
yikikdeveloper/All-for-one
eceba9c9ce7d209e59f8abefe66893f32324fbcb
[ "Apache-2.0" ]
3
2021-08-13T16:56:29.000Z
2021-11-28T00:30:42.000Z
products/models.py
yikikdeveloper/microservice-web-app
eceba9c9ce7d209e59f8abefe66893f32324fbcb
[ "Apache-2.0" ]
null
null
null
products/models.py
yikikdeveloper/microservice-web-app
eceba9c9ce7d209e59f8abefe66893f32324fbcb
[ "Apache-2.0" ]
null
null
null
from django.db import models class Products(models.Model): title = models.CharField(max_length=200) image = models.CharField(max_length=200) likes = models.PositiveIntegerField(default=0) class User(models.Model): pass
24.1
50
0.73444
31
241
5.645161
0.645161
0.125714
0.205714
0.274286
0.308571
0
0
0
0
0
0
0.034826
0.165975
241
9
51
26.777778
0.835821
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.142857
0.142857
0
0.857143
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
5
573270ba0b59e5c9d48896fb3779c41a627789d5
2,004
py
Python
make_grib2_tables/get-ncep-grib2-originating-centers.py
jasonwashburn/grib2io
fcaaa8910876e611b21622dff4b0b7fff2211951
[ "MIT" ]
10
2020-11-03T01:13:14.000Z
2022-02-04T00:24:23.000Z
make_grib2_tables/get-ncep-grib2-originating-centers.py
jasonwashburn/grib2io
fcaaa8910876e611b21622dff4b0b7fff2211951
[ "MIT" ]
15
2021-02-11T02:33:38.000Z
2022-03-21T14:34:07.000Z
make_grib2_tables/get-ncep-grib2-originating-centers.py
jasonwashburn/grib2io
fcaaa8910876e611b21622dff4b0b7fff2211951
[ "MIT" ]
2
2021-10-04T23:41:41.000Z
2022-03-10T17:38:28.000Z
#!/usr/bin/env python3 import pandas as pd # ---------------------------------------------------------------------------------------- # Originating Center # ---------------------------------------------------------------------------------------- url = r'https://www.nco.ncep.noaa.gov/pmb/docs/on388/table0.html' tables = pd.read_html(url) df = tables[0] name = 'table_originating_centers' print(name," = {") for idx,row in df.iterrows(): value = row['VALUE'].lstrip('0') center = row['CENTER'].replace('\'','') line = "'%s':'%s'," % (value,center) line = line.replace('nan','unknown') print(line) print("}") print("") # ---------------------------------------------------------------------------------------- # Originating Sub-Center # ---------------------------------------------------------------------------------------- url = r'https://www.nco.ncep.noaa.gov/pmb/docs/on388/tablec.html' tables = pd.read_html(url) df = tables[0] name = 'table_originating_subcenters' print(name," = {") for idx,row in df.iterrows(): value = row['VALUE'] center = row['CENTER'].replace('\'','') line = "'%s':'%s'," % (value,center) line = line.replace('nan','unknown') print(line) print("}") print("") # ---------------------------------------------------------------------------------------- # Generating Process # ---------------------------------------------------------------------------------------- url = r'https://www.nco.ncep.noaa.gov/pmb/docs/on388/tablea.html' tables = pd.read_html(url) df = tables[0] name = 'table_generating_process' print(name," = {") for idx,row in df.iterrows(): if pd.isnull(row['VALUE']): continue value = row['VALUE'] if value == '00-01': value = '0-1' elif value == '07-09': value = '7-9' else: value = value.lstrip('0') center = row['MODEL'].replace('\'','') line = "'%s':'%s'," % (value,center) line = line.replace('nan','unknown') print(line) print("}")
27.452055
91
0.434132
203
2,004
4.241379
0.305419
0.037166
0.031359
0.041812
0.747967
0.715447
0.715447
0.715447
0.680604
0.680604
0
0.016232
0.139222
2,004
72
92
27.833333
0.482899
0.30988
0
0.652174
0
0.043478
0.277697
0.056122
0
0
0
0
0
1
0
false
0
0.021739
0
0.021739
0.23913
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
573c0022092b34785422637c4e7a8bc7f80598ae
38
py
Python
p_io/db.py
oaao/pomegranate-esi
783f0063df75b8897299f6db49783a10dfeb45b0
[ "MIT" ]
null
null
null
p_io/db.py
oaao/pomegranate-esi
783f0063df75b8897299f6db49783a10dfeb45b0
[ "MIT" ]
null
null
null
p_io/db.py
oaao/pomegranate-esi
783f0063df75b8897299f6db49783a10dfeb45b0
[ "MIT" ]
null
null
null
# Handle all database reading/writing
19
37
0.815789
5
38
6.2
1
0
0
0
0
0
0
0
0
0
0
0
0.131579
38
1
38
38
0.939394
0.921053
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
574b3a3ef9ba4f9d8976d60bd8243791064f8682
408
py
Python
src/models/base.py
elmontana/EPA-Inspection-Prioritization
65d8129e215d90a0d22e81d39f3bd90b182ae27a
[ "MIT" ]
null
null
null
src/models/base.py
elmontana/EPA-Inspection-Prioritization
65d8129e215d90a0d22e81d39f3bd90b182ae27a
[ "MIT" ]
null
null
null
src/models/base.py
elmontana/EPA-Inspection-Prioritization
65d8129e215d90a0d22e81d39f3bd90b182ae27a
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod class BaseModel(ABC): @abstractmethod def fit(X, y): raise NotImplementedError @abstractmethod def predict(X, columns=None): raise NotImplementedError @abstractmethod def predict_proba(X, columns=None): raise NotImplementedError def feature_importance(self, *args, **kwargs): raise NotImplementedError
17
50
0.681373
40
408
6.9
0.525
0.347826
0.275362
0.297101
0.521739
0
0
0
0
0
0
0
0.247549
408
23
51
17.73913
0.899023
0
0
0.538462
0
0
0
0
0
0
0
0
0
1
0.307692
false
0
0.153846
0
0.538462
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
1
0
0
5
938b830764d17da54e4108c78e3701a6d89bb94c
4,344
py
Python
tests/test_pay_links.py
Wolf-Byte/paddle-client
2fe7eb9289ad08e9d514c9b4a158b17c9191d39e
[ "MIT" ]
null
null
null
tests/test_pay_links.py
Wolf-Byte/paddle-client
2fe7eb9289ad08e9d514c9b4a158b17c9191d39e
[ "MIT" ]
null
null
null
tests/test_pay_links.py
Wolf-Byte/paddle-client
2fe7eb9289ad08e9d514c9b4a158b17c9191d39e
[ "MIT" ]
null
null
null
import os import pytest from .test_paddle import paddle_client # NOQA: F401 @pytest.mark.manual_cleanup def test_create_pay_link(paddle_client): # NOQA: F811 create_pay_link = getattr(paddle_client, 'create_pay_link', None) if not create_pay_link or not callable(create_pay_link): pytest.skip('paddle.create_pay_link does not exist') # ToDo: Create product when API exists for it here response = paddle_client.create_pay_link( # product_id=int(os.environ['PADDLE_TEST_DEFAULT_PRODUCT_ID']), title='paddle-python-test_create_pay_link', webhook_url='https://example.com/paddle-python', prices=['USD:19.99'], # recurring_prices=['USD:19.99'], trial_days=1, custom_message='custom_message', coupon_code='paddle-python-coupon_code', discountable=False, image_url='https://example.com/image_url', return_url='https://example.com/return_url', quantity_variable=1, quantity=1, affiliates=['12345:0.25'], recurring_affiliate_limit=1, # marketing_consent='0', customer_email='test@example.com', customer_country='GB', customer_postcode='SW1A 1AA', passthrough='passthrough data', ) assert 'url' in response def test_create_pay_link_mock(mocker, paddle_client): # NOQA: F811 """ Mock test as the above test is not run by tox due to manual_cleanup mark """ create_pay_link = getattr(paddle_client, 'create_pay_link', None) if not create_pay_link or not callable(create_pay_link): pytest.skip('paddle.create_pay_link does not exist') request = mocker.patch('paddle.paddle.requests.request') # product_id = int(os.environ['PADDLE_TEST_DEFAULT_PRODUCT_ID']) title = 'paddle-python-test_create_pay_link' webhook_url = 'https://example.com/paddle-python' prices = ['USD:19.99'] trial_days = 1 custom_message = 'custom_message' coupon_code = 'paddle-python-coupon_code' discountable = False image_url = 'https://example.com/image_url' return_url = 'https://example.com/return_url' quantity_variable = 0 quantity = 1 affiliates = ['12345:0.25'] recurring_affiliate_limit = 1 # marketing_consent = False customer_email = 'test@example.com' customer_country = 'GB' customer_postcode = 'SW1A 1AA' passthrough = 'passthrough data' json = { # 'product_id': product_id, 'title': title, 'webhook_url': webhook_url, 'prices': prices, # recurring_prices=prices, 'trial_days': trial_days, 'custom_message': custom_message, 'coupon_code': coupon_code, 'discountable': 1 if discountable else 0, 'image_url': image_url, 'return_url': return_url, 'quantity_variable': quantity_variable, 'quantity': quantity, 'affiliates': affiliates, 'recurring_affiliate_limit': recurring_affiliate_limit, # 'marketing_consent': '1' if marketing_consent else '0', 'customer_email': customer_email, 'customer_country': customer_country, 'customer_postcode': customer_postcode, 'passthrough': passthrough, 'vendor_id': int(os.environ['PADDLE_VENDOR_ID']), 'vendor_auth_code': os.environ['PADDLE_API_KEY'], } url = 'https://vendors.paddle.com/api/2.0/product/generate_license' method = 'POST' paddle_client.create_pay_link( # product_id=int(os.environ['PADDLE_TEST_DEFAULT_PRODUCT_ID']), title=title, webhook_url=webhook_url, prices=prices, # recurring_prices=prices, trial_days=trial_days, custom_message=custom_message, coupon_code=coupon_code, discountable=discountable, image_url=image_url, return_url=return_url, quantity_variable=quantity_variable, quantity=quantity, affiliates=affiliates, recurring_affiliate_limit=recurring_affiliate_limit, # marketing_consent=marketing_consent, customer_email=customer_email, customer_country=customer_country, customer_postcode=customer_postcode, passthrough=passthrough, ) request.assert_called_once_with( url=url, json=json, method=method, )
35.032258
76
0.671041
517
4,344
5.321083
0.2147
0.052345
0.075609
0.039258
0.794257
0.772446
0.772446
0.772446
0.772446
0.772446
0
0.016632
0.224908
4,344
123
77
35.317073
0.800416
0.13628
0
0.061856
0
0
0.245298
0.058302
0
0
0
0.00813
0.020619
1
0.020619
false
0.041237
0.030928
0
0.051546
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
93c4f6bdb5b4f4bcf6487803c64d5fef111afb2d
124
py
Python
ddq/proof.py
jadnohra/connect
8eb21e6f122898094447bc3d5edb3053d5a2adf2
[ "Unlicense" ]
null
null
null
ddq/proof.py
jadnohra/connect
8eb21e6f122898094447bc3d5edb3053d5a2adf2
[ "Unlicense" ]
6
2021-03-19T12:06:56.000Z
2022-03-12T00:23:09.000Z
ddq/proof.py
jadnohra/connect
8eb21e6f122898094447bc3d5edb3053d5a2adf2
[ "Unlicense" ]
null
null
null
from .universe import Universe class Proof: def __init__(self, universe: Universe): self._universe = universe
17.714286
43
0.709677
14
124
5.928571
0.571429
0.289157
0.481928
0
0
0
0
0
0
0
0
0
0.217742
124
6
44
20.666667
0.85567
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
1
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
5
93ef3fabe17a8b100de867bfc4f2fc13a1f27c65
94
py
Python
harmat/stats/__init__.py
whistlebee/harmat
c274186a64b8c04c16b44decec2beca2334ac798
[ "MIT" ]
1
2018-03-22T23:51:31.000Z
2018-03-22T23:51:31.000Z
harmat/stats/__init__.py
whistlebee/harmat
c274186a64b8c04c16b44decec2beca2334ac798
[ "MIT" ]
48
2018-01-31T11:58:18.000Z
2021-12-14T17:09:04.000Z
harmat/stats/__init__.py
whistlebee/harmat
c274186a64b8c04c16b44decec2beca2334ac798
[ "MIT" ]
1
2018-01-30T01:11:53.000Z
2018-01-30T01:11:53.000Z
from .reports import HarmSummary, SafeviewSummary from .analyse import exhaustive, psv_hybrid
31.333333
49
0.851064
11
94
7.181818
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.106383
94
2
50
47
0.940476
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9e00f8c28f35bf75aaceb1688be6eead067b5e7a
23
py
Python
monitoring/status-page/status_page.py
metronotes-testing/harmony-ops
b9cb64fe2fb28ccaf809b8cf75448e13ce449334
[ "MIT" ]
null
null
null
monitoring/status-page/status_page.py
metronotes-testing/harmony-ops
b9cb64fe2fb28ccaf809b8cf75448e13ce449334
[ "MIT" ]
null
null
null
monitoring/status-page/status_page.py
metronotes-testing/harmony-ops
b9cb64fe2fb28ccaf809b8cf75448e13ce449334
[ "MIT" ]
1
2021-11-08T04:42:05.000Z
2021-11-08T04:42:05.000Z
from status import app
11.5
22
0.826087
4
23
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.173913
23
1
23
23
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f53ca70dec8ff6e0ba65e7cc00d5c3e0629b7cb1
124
py
Python
devices/basic/wire.py
Valmarelox/myhdl
c79395185e69e22549602a730e3e7127cf526d48
[ "MIT" ]
null
null
null
devices/basic/wire.py
Valmarelox/myhdl
c79395185e69e22549602a730e3e7127cf526d48
[ "MIT" ]
null
null
null
devices/basic/wire.py
Valmarelox/myhdl
c79395185e69e22549602a730e3e7127cf526d48
[ "MIT" ]
null
null
null
from devices.logicdevice import LogicDevice class Wire(LogicDevice): def do(self, *args) -> tuple: return args
20.666667
43
0.701613
15
124
5.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.209677
124
6
44
20.666667
0.887755
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
f55bbd460e8aabc5d19815242921a79d3d7637eb
41
py
Python
evaluation/__init__.py
cenkbircanoglu/openface
2d54ca065b6ff6ba816299d25f296bc1d13ad761
[ "Apache-2.0" ]
1
2019-03-28T07:28:35.000Z
2019-03-28T07:28:35.000Z
evaluation/__init__.py
cenkbircanoglu/openface
2d54ca065b6ff6ba816299d25f296bc1d13ad761
[ "Apache-2.0" ]
null
null
null
evaluation/__init__.py
cenkbircanoglu/openface
2d54ca065b6ff6ba816299d25f296bc1d13ad761
[ "Apache-2.0" ]
1
2019-12-11T05:30:33.000Z
2019-12-11T05:30:33.000Z
import sys sys.path.insert(0, '../util/')
20.5
30
0.658537
7
41
3.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0.026316
0.073171
41
2
30
20.5
0.684211
0
0
0
0
0
0.190476
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f58ac47e34445ae8cac859749d2545841f8d2dee
38
py
Python
tests/__init__.py
srinandank/gensetpy
4f589b448901cf74f9ed73743ee2ac35280acb51
[ "MIT" ]
1
2021-02-18T16:43:25.000Z
2021-02-18T16:43:25.000Z
tests/__init__.py
srinandank/gensetpy
4f589b448901cf74f9ed73743ee2ac35280acb51
[ "MIT" ]
null
null
null
tests/__init__.py
srinandank/gensetpy
4f589b448901cf74f9ed73743ee2ac35280acb51
[ "MIT" ]
null
null
null
"""Unit test package for gensetpy."""
19
37
0.684211
5
38
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.131579
38
1
38
38
0.787879
0.815789
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
192726175e9eb5f1cce8c1d812ffa9791b530bb2
103
py
Python
libs/ms/python/__init__.py
ITBE-Lab/ma
039e2833dd2e50df9285f183ff774bd87bbae710
[ "MIT" ]
40
2019-04-28T21:16:45.000Z
2022-02-05T05:54:47.000Z
libs/ms/python/__init__.py
ITBE-Lab/ma
039e2833dd2e50df9285f183ff774bd87bbae710
[ "MIT" ]
11
2019-04-28T22:29:12.000Z
2022-02-21T14:07:10.000Z
libs/ms/python/__init__.py
ITBE-Lab/ma
039e2833dd2e50df9285f183ff774bd87bbae710
[ "MIT" ]
2
2019-05-06T15:29:23.000Z
2021-01-08T13:22:17.000Z
from ._lib_init import * from .util import * from .analyzeRuntimes import * from .printColumns import *
25.75
30
0.776699
13
103
6
0.538462
0.384615
0
0
0
0
0
0
0
0
0
0
0.145631
103
4
31
25.75
0.886364
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
194861d53340fc40cc3b0fec8820443e088db6ea
105
py
Python
venv/Lib/site-packages/frontend/events/ui/__init__.py
mysnyldz/Tez-Analizi-Tarama
47e149bbd6a9e865e9242e50fb7ca1a18adfc640
[ "MIT" ]
1
2022-01-18T17:56:51.000Z
2022-01-18T17:56:51.000Z
venv/Lib/site-packages/frontend/events/ui/__init__.py
mysnyldz/Tez-Analizi
47e149bbd6a9e865e9242e50fb7ca1a18adfc640
[ "MIT" ]
null
null
null
venv/Lib/site-packages/frontend/events/ui/__init__.py
mysnyldz/Tez-Analizi
47e149bbd6a9e865e9242e50fb7ca1a18adfc640
[ "MIT" ]
null
null
null
from .focus import * from .input import * from .keyboard import * from .mouse import * from .ui import *
17.5
23
0.714286
15
105
5
0.466667
0.533333
0
0
0
0
0
0
0
0
0
0
0.190476
105
5
24
21
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
5ff0eaf76bde7f5b76f65bd64412f8d9514c9bcf
4,014
py
Python
tests/test_ugtm_plot.py
sshojiro/ugtm
3d1086e51a438ad9a791c4d6d8d4bf9d53400927
[ "MIT" ]
34
2018-05-05T18:06:30.000Z
2022-02-26T13:38:25.000Z
tests/test_ugtm_plot.py
sshojiro/ugtm
3d1086e51a438ad9a791c4d6d8d4bf9d53400927
[ "MIT" ]
12
2018-05-14T11:00:43.000Z
2021-10-06T12:41:38.000Z
tests/test_ugtm_plot.py
sshojiro/ugtm
3d1086e51a438ad9a791c4d6d8d4bf9d53400927
[ "MIT" ]
7
2018-07-27T18:34:03.000Z
2021-04-11T12:21:53.000Z
import unittest import ugtm import numpy as np class TestPlots(unittest.TestCase): def setUp(self): np.random.seed(0) self.n_dimensions = 10 self.n_individuals = 100 self.n_nodes = 4 self.k = 2 self.n_rbf_centers = 4 self.m = 2 self.data = np.random.randn(self.n_individuals, self.n_dimensions) self.labels = np.random.choice([1, 2], size=self.n_individuals) self.gtm = ugtm.runGTM(self.data, k=self.k, m=self.m) def test_plotClassMap_html(self): self.gtm.plot_html(output="tests/output_tests/testout", discrete=True, pointsize=20, cname="Spectral_r", do_interpolate=False, prior="equiprobable", labels=self.labels) self.gtm.plot_html(output="tests/output_tests/testout", labels=self.labels, discrete=True, pointsize=20, cname="Spectral_r", do_interpolate=True, prior="estimated") def test_plotClassMap_pdf(self): self.gtm.plot(output="tests/output_tests/testout", labels=self.labels, discrete=True, pointsize=20, cname="Spectral_r", ) self.gtm.plot(output="tests/output_tests/testout", labels=self.labels, discrete=True, pointsize=20, cname="Spectral_r", ) def test_plotClassMap_multipanel(self): self.gtm.plot_multipanel(output="tests/output_tests/testout", labels=self.labels, discrete=True, pointsize=20, cname="Spectral_r", do_interpolate=False, prior="estimated") self.gtm.plot_multipanel(output="tests/output_tests/testout", labels=self.labels, discrete=True, pointsize=20, cname="Spectral_r", do_interpolate=True, prior="estimated") def test_plotLandscape_html(self): self.gtm.plot_html(output="tests/output_tests/testout", labels=self.labels, discrete=False, pointsize=20, cname="Spectral_r", do_interpolate=False) self.gtm.plot_html(output="tests/output_tests/testout", labels=self.labels, cname="Spectral_r", do_interpolate=True, discrete=False, pointsize=20) def test_plotLandscape_pdf(self): self.gtm.plot_html(output="tests/output_tests/testout", labels=self.labels, discrete=False, pointsize=20, cname="Spectral_r", do_interpolate=False) self.gtm.plot_html(output="tests/output_tests/testout", labels=self.labels, cname="Spectral_r", do_interpolate=True, discrete=False, pointsize=20) def test_plotLandscape_multipanel(self): self.gtm.plot_multipanel(output="tests/output_tests/testout", labels=self.labels, discrete=False, pointsize=20, cname="Spectral_r", do_interpolate=False, ) self.gtm.plot_multipanel(output="tests/output_tests/testout", labels=self.labels, cname="Spectral_r", discrete=False, do_interpolate=True, pointsize=20) if __name__ == '__main__': unittest.main()
44.10989
78
0.496512
375
4,014
5.122667
0.162667
0.137428
0.068714
0.137428
0.756897
0.751692
0.751692
0.751692
0.751692
0.751692
0
0.015293
0.413553
4,014
90
79
44.6
0.800765
0
0
0.6125
0
0
0.119332
0.077728
0
0
0
0
0
1
0.0875
false
0
0.0375
0
0.1375
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5ffc13e18ecd32537128d193017c6565906c51a2
290
py
Python
accounts/tokens.py
BassamMismar/store
8045d2ea453c60cbaf1779fddd44043d0eff6e4f
[ "MIT" ]
null
null
null
accounts/tokens.py
BassamMismar/store
8045d2ea453c60cbaf1779fddd44043d0eff6e4f
[ "MIT" ]
null
null
null
accounts/tokens.py
BassamMismar/store
8045d2ea453c60cbaf1779fddd44043d0eff6e4f
[ "MIT" ]
null
null
null
from django.contrib.auth.tokens import PasswordResetTokenGenerator class ConfirmEmailTokenGenerator(PasswordResetTokenGenerator): def _make_hash_value(self, user, timestamp): return f'{user.pk}{user.is_active}' confirm_email_token_generator = ConfirmEmailTokenGenerator()
29
66
0.810345
29
290
7.862069
0.862069
0
0
0
0
0
0
0
0
0
0
0
0.113793
290
9
67
32.222222
0.88716
0
0
0
0
0
0.086207
0.086207
0
0
0
0
0
1
0.2
false
0.4
0.2
0.2
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
0
1
0
1
1
0
0
5
27329c7e69321c65fba71140884be4472b44c2e3
15
py
Python
MapBusesRoute/src/java/rideshare/test1.py
manglakaran/TrafficKarmaSent
5fe876685510f9bd26977bba734e78034f888613
[ "MIT" ]
null
null
null
MapBusesRoute/src/java/rideshare/test1.py
manglakaran/TrafficKarmaSent
5fe876685510f9bd26977bba734e78034f888613
[ "MIT" ]
null
null
null
MapBusesRoute/src/java/rideshare/test1.py
manglakaran/TrafficKarmaSent
5fe876685510f9bd26977bba734e78034f888613
[ "MIT" ]
null
null
null
print "kireet"
7.5
14
0.733333
2
15
5.5
1
0
0
0
0
0
0
0
0
0
0
0
0.133333
15
1
15
15
0.846154
0
0
0
0
0
0.4
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
2760bf71075a31ee084bbbba4a399ed2891ba3da
268
py
Python
tests/test_url_exists.py
LucaCappelletti94/setup_python_package
61b5f3cff1ed3181f932293c63c4fcb71cbe0062
[ "MIT" ]
5
2019-09-17T14:46:35.000Z
2020-06-06T08:17:02.000Z
tests/test_url_exists.py
LucaCappelletti94/setup_python_package
61b5f3cff1ed3181f932293c63c4fcb71cbe0062
[ "MIT" ]
2
2020-12-18T01:47:55.000Z
2020-12-25T10:08:30.000Z
tests/test_url_exists.py
LucaCappelletti94/setup_python_package
61b5f3cff1ed3181f932293c63c4fcb71cbe0062
[ "MIT" ]
null
null
null
from setup_python_package.utils.url_exists import url_exists def test_url_exists(): assert url_exists("https://github.com/LucaCappelletti94/setup_python_package") assert not url_exists("https://www.gooooogwfekwejfgkwegfjwhegfwghejgewkhwegkfwekwegfhogle.com/")
53.6
100
0.835821
32
268
6.6875
0.5625
0.21028
0.168224
0
0
0
0
0
0
0
0
0.008032
0.070896
268
5
100
53.6
0.851406
0
0
0
0
0
0.475836
0
0
0
0
0
0.5
1
0.25
true
0
0.25
0
0.5
0
0
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
1
0
1
1
0
0
0
0
0
0
5
27beda81b3b6f861d17ccbe719e167d0c22a71e3
78
py
Python
treex/regularizers/__init__.py
ptigwe/treex
c46687376ccc50c8fea6cb8617e22e4b4dd1924a
[ "MIT" ]
null
null
null
treex/regularizers/__init__.py
ptigwe/treex
c46687376ccc50c8fea6cb8617e22e4b4dd1924a
[ "MIT" ]
null
null
null
treex/regularizers/__init__.py
ptigwe/treex
c46687376ccc50c8fea6cb8617e22e4b4dd1924a
[ "MIT" ]
null
null
null
from .l1l2 import L1, L1L2, L2 __all__ = [ "L1", "L1L2", "L2", ]
9.75
30
0.474359
10
78
3.3
0.6
0.363636
0.484848
0
0
0
0
0
0
0
0
0.192308
0.333333
78
7
31
11.142857
0.442308
0
0
0
0
0
0.102564
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
1
1
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
5
7e0414f3eb2c6377cd58eb52ddc00ef5d5495a3b
67
py
Python
azsentinel/ui/__init__.py
FrodeHus/sentinelmon
bc7486770b707e6e33dfd6f0c9b6382731dd1b57
[ "MIT" ]
1
2021-01-27T14:58:50.000Z
2021-01-27T14:58:50.000Z
azsentinel/ui/__init__.py
FrodeHus/sentinelmon
bc7486770b707e6e33dfd6f0c9b6382731dd1b57
[ "MIT" ]
null
null
null
azsentinel/ui/__init__.py
FrodeHus/sentinelmon
bc7486770b707e6e33dfd6f0c9b6382731dd1b57
[ "MIT" ]
null
null
null
from .azsctlui import AzsctlUI from .controller import Controller
16.75
34
0.835821
8
67
7
0.5
0
0
0
0
0
0
0
0
0
0
0
0.134328
67
3
35
22.333333
0.965517
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
fdd06823a98c2eeaa3146631e202100e00d1dc65
1,960
py
Python
demisto_sdk/commands/common/tests/release_notes_config_test.py
SergeBakharev/demisto-sdk
17d00942a1bd33039a8aba9ddffecfd81008d275
[ "MIT" ]
42
2019-11-07T13:02:00.000Z
2022-03-29T03:39:04.000Z
demisto_sdk/commands/common/tests/release_notes_config_test.py
SergeBakharev/demisto-sdk
17d00942a1bd33039a8aba9ddffecfd81008d275
[ "MIT" ]
1,437
2019-11-07T13:02:25.000Z
2022-03-31T12:48:11.000Z
demisto_sdk/commands/common/tests/release_notes_config_test.py
SergeBakharev/demisto-sdk
17d00942a1bd33039a8aba9ddffecfd81008d275
[ "MIT" ]
46
2019-12-09T21:44:30.000Z
2022-03-24T17:36:45.000Z
from typing import Optional import pytest from demisto_sdk.commands.common.hook_validations.release_notes_config import \ ReleaseNotesConfigValidator class TestReleaseNotesConfigValidator: HAS_CORRESPONDING_RN_FILE_INPUTS = [('Some RN text', True), (None, False)] @pytest.mark.parametrize('rn_text, expected', HAS_CORRESPONDING_RN_FILE_INPUTS) def test_has_corresponding_rn_file(self, pack, rn_text: Optional[str], expected: bool): """ Given: - Config file for RN. When: - Checking if config file is valid: Case a: Config file has corresponding RN file. Case b: Config file does not have corresponding RN file. Then: Ensure expected bool is returned: Case a: Ensure true is returned. Case b: Ensure false is returned. """ if rn_text: with open(f'{pack.path}/ReleaseNotes/1_0_1.md', 'w') as f: f.write(rn_text) rn_config_validator = ReleaseNotesConfigValidator(f'{pack.path}/ReleaseNotes/1_0_1.json') assert rn_config_validator.has_corresponding_rn_file() == expected @pytest.mark.parametrize('rn_text, expected', HAS_CORRESPONDING_RN_FILE_INPUTS) def test_is_valid_file(self, pack, rn_text: Optional[str], expected: bool): """ Given: - Config file for RN. When: - Checking if config file is valid: Case a: Config file has corresponding RN file. Case b: Config file does not have corresponding RN file. Then: Ensure expected bool is returned: Case a: Ensure true is returned. Case b: Ensure false is returned. """ if rn_text: with open(f'{pack.path}/ReleaseNotes/1_0_1.md', 'w') as f: f.write(rn_text) rn_config_validator = ReleaseNotesConfigValidator(f'{pack.path}/ReleaseNotes/1_0_1.json') assert rn_config_validator.is_file_valid() == expected
36.981132
97
0.664796
257
1,960
4.867704
0.256809
0.107914
0.136691
0.123102
0.789768
0.767386
0.767386
0.767386
0.767386
0.767386
0
0.008158
0.24949
1,960
52
98
37.692308
0.842284
0.289286
0
0.5
0
0
0.151067
0.111658
0
0
0
0
0.1
1
0.1
false
0
0.15
0
0.35
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
fdd2c3358531877fd927578f400961517577fb7a
107
py
Python
cdptools/indexers/__init__.py
joshuaipwork/cdptools
5c6b7f99f0e5c80d3d9ca8ea1781651ea5305295
[ "BSD-3-Clause" ]
10
2019-02-11T17:07:41.000Z
2020-12-01T01:08:55.000Z
cdptools/indexers/__init__.py
joshuaipwork/cdptools
5c6b7f99f0e5c80d3d9ca8ea1781651ea5305295
[ "BSD-3-Clause" ]
116
2019-04-13T23:30:28.000Z
2021-01-29T05:02:36.000Z
cdptools/indexers/__init__.py
joshuaipwork/cdptools
5c6b7f99f0e5c80d3d9ca8ea1781651ea5305295
[ "BSD-3-Clause" ]
11
2019-08-15T16:32:52.000Z
2020-10-29T21:14:19.000Z
# -*- coding: utf-8 -*- """Indexers package for cdptools.""" from .indexer import Indexer # noqa: F401
15.285714
42
0.635514
13
107
5.230769
0.923077
0
0
0
0
0
0
0
0
0
0
0.045977
0.186916
107
6
43
17.833333
0.735632
0.598131
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8befdf393983894180e62d173f3b8c14442543df
187
py
Python
tests/config.py
fossabot/many
7f79b0bf1007e2fd412db9f5f5df29f487ebf2ae
[ "MIT" ]
3
2020-09-10T05:06:19.000Z
2021-10-02T18:42:44.000Z
tests/config.py
fossabot/many
7f79b0bf1007e2fd412db9f5f5df29f487ebf2ae
[ "MIT" ]
21
2020-10-29T18:32:46.000Z
2022-03-24T10:19:41.000Z
tests/config.py
fossabot/many
7f79b0bf1007e2fd412db9f5f5df29f487ebf2ae
[ "MIT" ]
2
2020-10-29T18:02:50.000Z
2021-10-02T18:42:45.000Z
import pathlib TOLERANCE = 1e-8 PLOTS_DIR = pathlib.Path("./output_plots") BENCHMARK_DATA_DIR = pathlib.Path("./benchmark_data") BENCHMARK_PLOTS_DIR = pathlib.Path("./benchmark_plots")
23.375
55
0.775401
25
187
5.48
0.44
0.218978
0.306569
0.277372
0
0
0
0
0
0
0
0.011696
0.085562
187
7
56
26.714286
0.789474
0
0
0
0
0
0.251337
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
8bfc48529a429326d89cce610ab379956fd80f1c
145
py
Python
python/testData/paramInfo/KwdArgInClass.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/paramInfo/KwdArgInClass.py
Cyril-lamirand/intellij-community
60ab6c61b82fc761dd68363eca7d9d69663cfa39
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/paramInfo/KwdArgInClass.py
Cyril-lamirand/intellij-community
60ab6c61b82fc761dd68363eca7d9d69663cfa39
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
class A: def foo(self, e): self.kw = {} self.add_comm(**self<arg1>.kw) def add_comm(self, **kw): self.kw = []
14.5
38
0.468966
21
145
3.142857
0.47619
0.272727
0.30303
0
0
0
0
0
0
0
0
0.010526
0.344828
145
9
39
16.111111
0.684211
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
e34634f25b47a8b1c433b462fd9965c101e328e0
129
py
Python
instagram/posts/admin.py
aliaskar25/instagram_copy
742ef58eba5377c9f48b4428d26f2cfe740ca1ca
[ "MIT" ]
null
null
null
instagram/posts/admin.py
aliaskar25/instagram_copy
742ef58eba5377c9f48b4428d26f2cfe740ca1ca
[ "MIT" ]
null
null
null
instagram/posts/admin.py
aliaskar25/instagram_copy
742ef58eba5377c9f48b4428d26f2cfe740ca1ca
[ "MIT" ]
2
2021-03-06T05:02:38.000Z
2021-04-01T13:34:09.000Z
from django.contrib import admin from .models import Post, PostImage admin.site.register(Post) admin.site.register(PostImage)
16.125
35
0.806202
18
129
5.777778
0.555556
0.173077
0.326923
0
0
0
0
0
0
0
0
0
0.108527
129
7
36
18.428571
0.904348
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e37b6eec01ee36474a1c7fc89a4cf4e85ebb9664
26
py
Python
JGui.py
jtjisgod/JPen
c3179fcfb3b98cb4fb1808690e00bf261664dfdf
[ "MIT" ]
4
2018-09-13T07:36:44.000Z
2019-01-02T10:55:49.000Z
JGui.py
jtjisgod/JPen
c3179fcfb3b98cb4fb1808690e00bf261664dfdf
[ "MIT" ]
null
null
null
JGui.py
jtjisgod/JPen
c3179fcfb3b98cb4fb1808690e00bf261664dfdf
[ "MIT" ]
null
null
null
class JGui : pass
8.666667
12
0.5
3
26
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.461538
26
3
13
8.666667
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
e385d0f9e27684134cf4dbef52a1c3dede5f246a
615
py
Python
main.py
JI511/Personal_Fitness
25d54908398caf9291e70069dca97a567b1bd94b
[ "MIT" ]
null
null
null
main.py
JI511/Personal_Fitness
25d54908398caf9291e70069dca97a567b1bd94b
[ "MIT" ]
75
2019-04-01T01:57:34.000Z
2019-09-26T00:14:28.000Z
main.py
JI511/Personal_Fitness
25d54908398caf9291e70069dca97a567b1bd94b
[ "MIT" ]
1
2019-08-11T07:25:15.000Z
2019-08-11T07:25:15.000Z
# ---------------------------------------------------------------------------------------------------------------------- # Main # ---------------------------------------------------------------------------------------------------------------------- # imports from src.Personal_Fitness import PersonalFitness application = PersonalFitness() application.run() # ---------------------------------------------------------------------------------------------------------------------- # End # ----------------------------------------------------------------------------------------------------------------------
43.928571
120
0.15935
13
615
7.461538
0.846154
0.536082
0
0
0
0
0
0
0
0
0
0
0.050407
615
13
121
47.307692
0.166096
0.809756
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
8b515d625b4e325035d7ef8026f62bcd99a4cc1b
106
py
Python
src/fastapi_aad_auth/providers/__init__.py
Alex-Chekh/fastapi_aad_auth
4ad21fa76e7422da5d0799695bb547cd3e6224e0
[ "MIT" ]
29
2020-09-04T08:39:42.000Z
2022-01-21T08:43:48.000Z
src/fastapi_aad_auth/providers/__init__.py
Alex-Chekh/fastapi_aad_auth
4ad21fa76e7422da5d0799695bb547cd3e6224e0
[ "MIT" ]
86
2020-07-30T20:51:19.000Z
2022-03-30T16:55:24.000Z
src/fastapi_aad_auth/providers/__init__.py
Alex-Chekh/fastapi_aad_auth
4ad21fa76e7422da5d0799695bb547cd3e6224e0
[ "MIT" ]
11
2020-10-16T07:17:16.000Z
2022-02-09T17:13:55.000Z
"""Handlers for oauth.""" from fastapi_aad_auth.providers.aad import AADConfig, AADProvider # noqa F401
26.5
78
0.773585
14
106
5.714286
0.928571
0
0
0
0
0
0
0
0
0
0
0.032258
0.122642
106
3
79
35.333333
0.827957
0.283019
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8b644c6a079d91080b57d021981610214656d8cf
75
py
Python
src/plone/z3cform/textlines/__init__.py
zopefoundation/plone.z3cform
8b69a7607bd62c80f32c3e46e4eff0e66b7e7fae
[ "ZPL-2.1" ]
null
null
null
src/plone/z3cform/textlines/__init__.py
zopefoundation/plone.z3cform
8b69a7607bd62c80f32c3e46e4eff0e66b7e7fae
[ "ZPL-2.1" ]
15
2015-01-22T13:19:01.000Z
2019-04-09T05:51:07.000Z
src/plone/z3cform/textlines/__init__.py
zopefoundation/plone.z3cform
8b69a7607bd62c80f32c3e46e4eff0e66b7e7fae
[ "ZPL-2.1" ]
4
2015-04-03T05:18:45.000Z
2019-04-04T12:08:31.000Z
from plone.z3cform.textlines.textlines import TextLinesFieldWidget # noqa
37.5
74
0.853333
8
75
8
0.875
0
0
0
0
0
0
0
0
0
0
0.014706
0.093333
75
1
75
75
0.926471
0.053333
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8b8485580f421c919cd8968b97c3717883b10d45
59
py
Python
src/api/__init__.py
aiweithesushigirl/personal-portfolio
040a2dcbfceb83985756f51f782bac88870ebb93
[ "MIT" ]
null
null
null
src/api/__init__.py
aiweithesushigirl/personal-portfolio
040a2dcbfceb83985756f51f782bac88870ebb93
[ "MIT" ]
null
null
null
src/api/__init__.py
aiweithesushigirl/personal-portfolio
040a2dcbfceb83985756f51f782bac88870ebb93
[ "MIT" ]
null
null
null
"""search REST API.""" from src.api.form import form_query
19.666667
35
0.728814
10
59
4.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.118644
59
3
35
19.666667
0.807692
0.271186
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8b90716522ce3d1e2798072a534cb98b7dc9466c
68
py
Python
code/__init__.py
Bhaskers-Blu-Org1/knowledge-enabled-textual-entailment
be0741c94d734780536e549700509cf1aabcab66
[ "Apache-2.0" ]
42
2018-08-28T09:05:41.000Z
2021-08-02T16:42:14.000Z
code/__init__.py
SocioProphet/knowledge-enabled-textual-entailment
be0741c94d734780536e549700509cf1aabcab66
[ "Apache-2.0" ]
6
2019-01-17T02:34:04.000Z
2021-06-01T22:29:15.000Z
code/__init__.py
SocioProphet/knowledge-enabled-textual-entailment
be0741c94d734780536e549700509cf1aabcab66
[ "Apache-2.0" ]
13
2018-09-16T06:14:09.000Z
2021-06-08T19:56:31.000Z
from .models import * from .data import * from .predictors import *
17
25
0.735294
9
68
5.555556
0.555556
0.4
0
0
0
0
0
0
0
0
0
0
0.176471
68
3
26
22.666667
0.892857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8bd93697a75a498af16a9009a4579fad92545b62
44
py
Python
wildlifelicensing/apps/payments/exceptions.py
jawaidm/wildlifelicensing
87e8e9ab163e0d7bbb0c7a654a13ce8a4d8fcf82
[ "Apache-2.0" ]
20
2019-01-31T07:20:59.000Z
2022-02-26T15:58:55.000Z
payment_common/exceptions.py
LonieN/sawtooth-healthcare
ea44e5eb6fe22e35c2061ed9248603cf36a47bde
[ "Apache-2.0" ]
11
2019-03-19T02:03:11.000Z
2019-05-31T07:20:59.000Z
payment_common/exceptions.py
LonieN/sawtooth-healthcare
ea44e5eb6fe22e35c2061ed9248603cf36a47bde
[ "Apache-2.0" ]
15
2019-01-03T17:17:03.000Z
2022-03-31T13:13:44.000Z
class PaymentException(Exception): pass
14.666667
34
0.772727
4
44
8.5
1
0
0
0
0
0
0
0
0
0
0
0
0.159091
44
2
35
22
0.918919
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
8bdca77eee601e6ba45e47e5ffd317efaeb4465f
68
py
Python
client/__main__.py
nano-db/NanoCube
a1106b5718f105f27556d2600f4a8ae2dbcebe39
[ "Apache-2.0" ]
2
2015-05-29T13:47:59.000Z
2021-01-05T09:46:18.000Z
client/__main__.py
nano-db/NanoCube
a1106b5718f105f27556d2600f4a8ae2dbcebe39
[ "Apache-2.0" ]
1
2021-03-25T21:27:42.000Z
2021-03-25T21:27:42.000Z
client/__main__.py
nano-db/NanoCube
a1106b5718f105f27556d2600f4a8ae2dbcebe39
[ "Apache-2.0" ]
2
2015-05-29T13:45:55.000Z
2018-02-23T01:56:33.000Z
# -*- coding: utf-8 -*- from .cli import init_parser init_parser()
13.6
28
0.661765
10
68
4.3
0.8
0.465116
0
0
0
0
0
0
0
0
0
0.017544
0.161765
68
4
29
17
0.736842
0.308824
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
474067b14c2259c7c021dae4fc354ce7f080ecaa
18,505
py
Python
app/views.py
Arnoldblair/Neighborhood
7adc41e11754b854b65e2b0d90f3c86265f2a6e6
[ "MIT" ]
null
null
null
app/views.py
Arnoldblair/Neighborhood
7adc41e11754b854b65e2b0d90f3c86265f2a6e6
[ "MIT" ]
null
null
null
app/views.py
Arnoldblair/Neighborhood
7adc41e11754b854b65e2b0d90f3c86265f2a6e6
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from .models import * import cloudinary import cloudinary.uploader import cloudinary.api # Create your views here. # index view @login_required(login_url='/accounts/login/') def index(request): # get current user current_user = request.user # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # get all posts in the neighbourhood of the user ordered by date posts = Post.objects.filter(neighbourhood=neighbourhood).order_by("-created_at") return render(request, 'index.html', {'posts': posts}) # profile view @login_required(login_url='/accounts/login/') def profile(request): current_user = request.user profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) return render(request, 'profile.html', {'profile': profile, 'posts': posts, 'locations': locations, 'neighbourhood': neighbourhood, 'categories': category, 'businesses': businesses, 'contacts': contacts}) # update profile @login_required(login_url="/accounts/login/") def update_profile(request): if request.method == "POST": current_user = request.user first_name = request.POST["first_name"] last_name = request.POST["last_name"] username = request.POST["username"] email = request.POST["email"] name = request.POST["first_name"] + " " + request.POST["last_name"] neighbourhood = request.POST["neighbourhood"] location = request.POST["location"] # check if its an instance of location if location == "": location = None else: location = Location.objects.get(name=location) # check if its an instance of neighbourhood if neighbourhood == "": neighbourhood = None else: neighbourhood = NeighbourHood.objects.get(name=neighbourhood) profile_image = request.FILES["profile_pic"] profile_image = cloudinary.uploader.upload(profile_image) profile_url = profile_image["url"] user = User.objects.get(id=current_user.id) # check if user exists in profile table and if not create a new profile if Profile.objects.filter(user_id=current_user.id).exists(): profile = Profile.objects.get(user_id=current_user.id) profile.profile_pic = profile_url profile.neighbourhood = neighbourhood profile.location = location profile.save() else: profile = Profile( user_id=current_user.id, name=name, profile_pic=profile_url, neighbourhood=neighbourhood, location=location, ) profile.save_profile() user.first_name = first_name user.last_name = last_name user.username = username user.email = email user.save() return redirect("/profile", {"success": "Profile Updated Successfully"}) # return render(request, 'profile.html', {'success': 'Profile Updated Successfully'}) else: return render(request, "profile.html", {"danger": "Profile Update Failed"}) # create post @login_required(login_url="/accounts/login/") def create_post(request): if request.method == "POST": current_user = request.user title = request.POST["title"] content = request.POST["content"] category = request.POST["category"] location = request.POST["location"] # neighbourhood = request.POST["neighbourhood"] # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # check if its an instance of category if category == "": category = None else: category = Category.objects.get(name=category) # check if its an instance of location if location == "": location = None else: location = Location.objects.get(name=location) # check if there is a post with image if request.FILES: image = request.FILES["image"] # upload image to cloudinary and crop it to square image = cloudinary.uploader.upload( image, crop="limit", width=800, height=600) # image = cloudinary.uploader.upload(image) image_url = image["url"] post = Post( user_id=current_user.id, title=title, content=content, image=image_url, category=category, location=location, neighbourhood=neighbourhood, ) post.create_post() return redirect("/profile", {"success": "Post Created Successfully"}) else: post = Post( user_id=current_user.id, title=title, content=content, category=category, location=location, neighbourhood=neighbourhood, ) post.create_post() return redirect("/profile", {"success": "Post Created Successfully"}) else: return render(request, "profile.html", {"danger": "Post Creation Failed"}) # create business @login_required(login_url="/accounts/login/") def create_business(request): if request.method == "POST": current_user = request.user name = request.POST["name"] email = request.POST["email"] # phone = request.POST["phone"] # address = request.POST["address"] # location = request.POST["location"] # neighbourhood = request.POST["neighbourhood"] # check if its an instance of location # if location == "": # location = None # else: # location = Location.objects.get(name=location) # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # check if its an instance of neighbourhood if neighbourhood == "": neighbourhood = None else: neighbourhood = NeighbourHood.objects.get(name=neighbourhood) business = Business( user_id=current_user.id, name=name, email=email, # phone=phone, # address=address, # location=location, neighbourhood=neighbourhood, ) business.create_business() return redirect("/profile", {"success": "Business Created Successfully"}) else: return render(request, "profile.html", {"danger": "Business Creation Failed"}) # create contact @login_required(login_url="/accounts/login/") def create_contact(request): if request.method == "POST": current_user = request.user name = request.POST["name"] email = request.POST["email"] phone = request.POST["phone"] # neighbourhood = request.POST["neighbourhood"] # # check if its an instance of location # if location == "": # location = None # else: # location = Location.objects.get(name=location) # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # check if its an instance of neighbourhood if neighbourhood == "": neighbourhood = None else: neighbourhood = NeighbourHood.objects.get(name=neighbourhood) contact = Contact( user_id=current_user.id, name=name, email=email, phone=phone, neighbourhood=neighbourhood, ) contact.create_contact() return redirect("/profile", {"success": "Contact Created Successfully"}) else: return render(request, "profile.html", {"danger": "Contact Creation Failed"}) login_required(login_url="/accounts/login/") # posts page def posts(request): current_user = request.user # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # get all posts in the neighbourhood of the user ordered by date posts = Post.objects.filter(neighbourhood=neighbourhood).order_by("-created_at") return render(request, "posts.html", {"posts": posts}) @login_required(login_url="/accounts/login/") # alerts page def alerts(request): current_user = request.user # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # get the category that contains name "alerts" category = Category.objects.get(name="alerts") # get all posts that contains the word "alert" and order by date within the neighbourhood of the user posts = Post.objects.filter( neighbourhood=neighbourhood, category=category).order_by("-created_at") return render(request, "alerts.html", {"posts": posts}) # business page @login_required(login_url="/accounts/login/") def business(request): current_user = request.user # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # get all businesses in the user neighbourhood businesses = Business.objects.filter( neighbourhood=profile.neighbourhood) return render(request, "business.html", {"businesses": businesses}) # contact page @login_required(login_url="/accounts/login/") def contacts(request): current_user = request.user # get current user neighbourhood profile = Profile.objects.filter(user_id=current_user.id).first() # check if user has neighbourhood if profile is None: profile = Profile.objects.filter( user_id=current_user.id).first() # get profile posts = Post.objects.filter(user_id=current_user.id) # get all locations locations = Location.objects.all() neighbourhood = NeighbourHood.objects.all() category = Category.objects.all() businesses = Business.objects.filter(user_id=current_user.id) contacts = Contact.objects.filter(user_id=current_user.id) # redirect to profile with error message return render(request, "profile.html", {"danger": "Update Profile by selecting Your Neighbourhood name to continue 😥!!", "locations": locations, "neighbourhood": neighbourhood, "categories": category, "businesses": businesses, "contacts": contacts, "posts": posts}) else: neighbourhood = profile.neighbourhood # get all contacts where the neighbourhood is the same as the user neighbourhood contacts = Contact.objects.filter( neighbourhood=profile.neighbourhood).order_by("-created_at") return render(request, "contacts.html", {"contacts": contacts, "neighbourhood": profile.neighbourhood}) # search @login_required(login_url="/accounts/login/") def search(request): if 'search_term' in request.GET and request.GET["search_term"]: search_term = request.GET.get("search_term") searched_businesses = Business.objects.filter(name__icontains=search_term) message = f"Search For: {search_term}" return render(request, "search.html", {"message": message, "businesses": searched_businesses}) else: message = "You haven't searched for any term" return render(request, "search.html", {"message": message})
42.442661
277
0.647987
1,996
18,505
5.918838
0.064128
0.052311
0.05722
0.066023
0.804469
0.762824
0.753005
0.740816
0.68859
0.667428
0
0.000431
0.247393
18,505
436
278
42.442661
0.847275
0.147636
0
0.688136
0
0
0.140106
0
0
0
0
0
0
1
0.037288
false
0
0.023729
0
0.145763
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
475ca38bdb44086c9050959b73e6129a38ad60a3
714
py
Python
PlainMed/app/mod_auth/models.py
PlainStupid/PlainMed
c76bb48daec8d5452e148ee84098788696059e0c
[ "MIT" ]
null
null
null
PlainMed/app/mod_auth/models.py
PlainStupid/PlainMed
c76bb48daec8d5452e148ee84098788696059e0c
[ "MIT" ]
null
null
null
PlainMed/app/mod_auth/models.py
PlainStupid/PlainMed
c76bb48daec8d5452e148ee84098788696059e0c
[ "MIT" ]
null
null
null
from app import db from werkzeug import generate_password_hash from flask.ext.login import UserMixin class User(db.Model, UserMixin): id = db.Column(db.Integer(), primary_key=True) username = db.Column(db.String(128), nullable=False, unique=True) password = db.Column(db.String(192), nullable=False) def __init__(self, username, password): self.username = username self.password = generate_password_hash(password) def __repr__(self): return '<User %r>' % (self.username) def is_authenticated(self): return True def is_active(self): return True def is_anonymous(self): return False def get_id(self): return self.id
24.62069
69
0.673669
94
714
4.93617
0.414894
0.107759
0.064655
0.068966
0.081897
0
0
0
0
0
0
0.01085
0.22549
714
28
70
25.5
0.82821
0
0
0.1
1
0
0.012605
0
0
0
0
0
0
1
0.3
false
0.2
0.15
0.25
0.9
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
5
47832feb0451bc9ee22599d10a207a0f0a31babe
8,940
py
Python
Homework3/main.py
Prinzivalle/Computer_Network_Security
e5e9b0f3ed0c44060d1c10d73dece836cf9726d8
[ "MIT" ]
null
null
null
Homework3/main.py
Prinzivalle/Computer_Network_Security
e5e9b0f3ed0c44060d1c10d73dece836cf9726d8
[ "MIT" ]
null
null
null
Homework3/main.py
Prinzivalle/Computer_Network_Security
e5e9b0f3ed0c44060d1c10d73dece836cf9726d8
[ "MIT" ]
null
null
null
from random import SystemRandom from Cryptodome.Cipher import PKCS1_OAEP from Cryptodome.Util import number from Cryptodome.PublicKey import RSA from Cryptodome.Cipher import AES from Cryptodome.Util.Padding import pad import time import os ##################### AUXILIARY FUNCTIONS ########################### # use slide implementation of square and multiply, better implementation # by using modulo reduction at each step def sam(base, exp, n): f = 1 while exp > 0: lsb = 0x1 & exp exp >>= 1 if lsb: f *= base base *= base base = base % n f = f % n return f def selExp(phi): maxiter = 200 for i in range(maxiter): e = SystemRandom().randint(1, phi - 1) g, s, t = eea(e, phi) if g == 1: # s is the coefficient for the first argument # of egcd, so in this case s is coefficient of e d = s % phi return e, d return 0, 0 # based on slide implementation with some improvements def eea(a, b): s, s1 = 1, 0 t, t1 = 0, 1 g, g1 = a, b while g1: q = g // g1 s, s1 = s1, s - q * s1 t, t1 = t1, t - q * t1 g, g1 = g1, g - q * g1 return g, s, t ##################### RSA MAIN FUNCTIONS ########################### # variable name are based on slides RSA schemes def encrypt(x, e, n): y = sam(x, e, n) return y def decrypt(y, d, n): x = sam(y, d, n) return x def initialization(nbit): p = number.getPrime(nbit, os.urandom) q = number.getPrime(nbit, os.urandom) n = p * q phi = (p - 1) * (q - 1) return n, phi ##################### RSA COMPARISON ########################### def testRSA(rounds, keylength): buffer_size = 102400 # 100k ###### ENCRYPTION print() print("######### ENCRYPTION TEST RSA ############") ##### RSA pycrypto start_time = time.time() random_generator = os.urandom key = RSA.generate(keylength, random_generator) # generate pub and priv key print("pycryptodome RSA key generation --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() # In first round save the encrypted file for decrypt test f = open("small.txt", "rb") output_file = open('small_RSApy.encrypted', 'wb') cipher = PKCS1_OAEP.new(key) buffer = f.read(buffer_size) while len(buffer) > 0: ciphered_bytes = cipher.encrypt(buffer) output_file.write(ciphered_bytes) buffer = f.read(buffer_size) f.close() output_file.close() for i in range(rounds - 1): f = open("small.txt", "rb") cipher = PKCS1_OAEP.new(key) buffer = f.read(buffer_size) while len(buffer) > 0: cipher.encrypt(buffer) buffer = f.read(buffer_size) f.close() print("pycryptodome RSA --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() n, phi = initialization(keylength // 2) e, d = selExp(phi) print("my implementation RSA key generation --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() # In first round save the encrypted file for decrypt test f = open("small.txt", "r") output_file = open('small_RSAMine.encrypted', 'w') buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) while len(buffer) > 0: ciphered_bytes = encrypt(int(binarybuffer, 2), e, n) output_file.write(str(ciphered_bytes)) buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) f.close() output_file.close() for i in range(rounds - 1): f = open("small.txt", "r") buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) while len(buffer) > 0: encrypt(int(binarybuffer, 2), e, n) buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) f.close() print("my implementation RSA --- %s seconds ---" % (time.time() - start_time)) ###### DECRYPTION print() print("######### DECRYPTION TEST RSA ############") print() start_time = time.time() for i in range(rounds): f = open("small_RSApy.encrypted", "rb") cipher = PKCS1_OAEP.new(key) buffer = f.read(buffer_size) while len(buffer) > 0: cipher.decrypt(buffer) buffer = f.read(buffer_size) f.close() print("pycryptodome RSA --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() for i in range(rounds): f = open("small_RSAMine.encrypted", "r") buffer = f.read(buffer_size) while len(buffer) > 0: plain = decrypt(int(buffer), d, n) buffer = f.read(buffer_size) f.close() comp = open("small.txt", "r") buffer = comp.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) comp.close() print("original text file " + str(int(binarybuffer, 2))) print("decrypted plain text " + str(plain)) print("my implementation RSA --- %s seconds ---" % (time.time() - start_time)) ##################### AES COMPARISON ########################### def testAES(rounds, keylength): buffer_size = 102400 # 100k ###### ENCRYPTION print() print("######### ENCRYPTION TEST AES ############") start_time = time.time() # In first round save the encrypted file for decrypt test f = open("small.txt", "rb") output_file = open('smallECBPycrypto.encrypted', 'wb') cipher = AES.new(bytearray.fromhex("2b7e151628aed2a6abf7158809cf4f3c"), AES.MODE_ECB) buffer = f.read(buffer_size) while len(buffer) > 0: ciphered_bytes = cipher.encrypt(pad(buffer, 16)) output_file.write(ciphered_bytes) buffer = f.read(buffer_size) f.close() output_file.close() for i in range(rounds - 1): f = open("small.txt", "rb") cipher = AES.new(bytearray.fromhex("2b7e151628aed2a6abf7158809cf4f3c"), AES.MODE_ECB) buffer = f.read(buffer_size) while len(buffer) > 0: cipher.encrypt(pad(buffer, 16)) buffer = f.read(buffer_size) f.close() print("pycryptodome ECB --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() n, phi = initialization(keylength // 2) e, d = selExp(phi) print("my implementation RSA key generation --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() # In first round save the encrypted file for decrypt test f = open("small.txt", "r") output_file = open('small_RSAMine.encrypted', 'w') buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) while len(buffer) > 0: ciphered_bytes = encrypt(int(binarybuffer, 2), e, n) output_file.write(str(ciphered_bytes)) buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) f.close() output_file.close() for i in range(rounds - 1): f = open("small.txt", "r") buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) while len(buffer) > 0: encrypt(int(binarybuffer, 2), e, n) buffer = f.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) f.close() print("my implementation RSA --- %s seconds ---" % (time.time() - start_time)) ###### DECRYPTION print() print("######### DECRYPTION TEST AES ############") print() start_time = time.time() for i in range(rounds): f = open("smallECBPycrypto.encrypted", "rb") cipher = AES.new(bytearray.fromhex("2b7e151628aed2a6abf7158809cf4f3c"), AES.MODE_ECB) buffer = f.read(buffer_size) while len(buffer) > 0: cipher.decrypt(buffer) buffer = f.read(buffer_size) f.close() print("pycryptodome ECB --- %s seconds ---" % (time.time() - start_time)) start_time = time.time() for i in range(rounds): f = open("small_RSAMine.encrypted", "r") buffer = f.read(buffer_size) while len(buffer) > 0: plain = decrypt(int(buffer), d, n) buffer = f.read(buffer_size) f.close() comp = open("small.txt", "r") buffer = comp.read(buffer_size) binarybuffer = ''.join(format(ord(x), 'b') for x in buffer) comp.close() print("original text file " + str(int(binarybuffer, 2))) print("decrypted plain text " + str(plain)) print("my implementation RSA --- %s seconds ---" % (time.time() - start_time)) ##################### MAIN FUNCTION ########################### if __name__ == '__main__': testRSA(10, 3072) testAES(10, 3072)
30.408163
97
0.567897
1,153
8,940
4.322637
0.142238
0.05297
0.073034
0.081862
0.767857
0.752608
0.752608
0.752608
0.752608
0.752608
0
0.023065
0.262864
8,940
293
98
30.511945
0.733232
0.079083
0
0.671362
0
0
0.141905
0.035476
0
0
0.000377
0
0
1
0.037559
false
0
0.037559
0
0.107981
0.117371
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
479707ea424bd761c2a0d49f0325c1942835a2d8
243
py
Python
qrogue/game/logic/actors/__init__.py
7Magic7Mike7/Qrogue
70bd5671a77981c1d4b633246321ba44f13c21ff
[ "MIT" ]
4
2021-12-14T19:13:43.000Z
2022-02-16T13:25:38.000Z
qrogue/game/logic/actors/__init__.py
7Magic7Mike7/Qrogue
70bd5671a77981c1d4b633246321ba44f13c21ff
[ "MIT" ]
null
null
null
qrogue/game/logic/actors/__init__.py
7Magic7Mike7/Qrogue
70bd5671a77981c1d4b633246321ba44f13c21ff
[ "MIT" ]
1
2022-01-04T18:35:51.000Z
2022-01-04T18:35:51.000Z
# exporting from .state_vector import StateVector from .controllables import Controllable, Player, Robot from .controllables import robot from .puzzles import Enemy, Boss, Riddle # importing # +collectibles (Instruction) # +util (is_power_2)
24.3
54
0.798354
29
243
6.586207
0.724138
0.17801
0.240838
0
0
0
0
0
0
0
0
0.004717
0.127572
243
9
55
27
0.896226
0.271605
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
47bcb2883c6c0282777fe28e36f5ec757ebfc6d9
1,240
py
Python
codigo_das_aulas/aula_06/aula_06_2.py
VeirichR/curso-python-selenium
9b9107a64adb4e6bcf10c76287e0b4cc7d024321
[ "CC0-1.0" ]
234
2020-04-03T02:59:30.000Z
2022-03-27T15:29:21.000Z
codigo_das_aulas/aula_06/aula_06_2.py
VeirichR/curso-python-selenium
9b9107a64adb4e6bcf10c76287e0b4cc7d024321
[ "CC0-1.0" ]
8
2020-04-20T11:20:43.000Z
2021-08-18T16:41:15.000Z
codigo_das_aulas/aula_06/aula_06_2.py
VeirichR/curso-python-selenium
9b9107a64adb4e6bcf10c76287e0b4cc7d024321
[ "CC0-1.0" ]
77
2020-04-03T13:25:19.000Z
2022-02-24T15:31:26.000Z
from selenium.webdriver import Firefox b = Firefox() url = 'http://selenium.dunossauro.live/aula_06_a.html' b.get(url) # usando a atributo type [attr=valor] # nome = b.find_element_by_css_selector('[type="text"]') # senha = b.find_element_by_css_selector('[type="password"]') # btn = b.find_element_by_css_selector('[type="submit"]') # usando a atributo name [attr=valor] # nome = b.find_element_by_css_selector('[name="nome"]') # senha = b.find_element_by_css_selector('[name="senha"]') # btn = b.find_element_by_css_selector('[name="l0c0"]') # usando a atributo * [att*=valor] # nome = b.find_element_by_css_selector('[name*="ome"]') # senha = b.find_element_by_css_selector('[name*="nha"]') # btn = b.find_element_by_css_selector('[name*="l0"]') # usando a atributo | [att|=valor] # nome = b.find_element_by_css_selector('[name|="nome"]') # senha = b.find_element_by_css_selector('[name|="senha"]') # btn = b.find_element_by_css_selector('[name|="l0c0"]') # usando a atributo ^ [att^=valor] # nome = b.find_element_by_css_selector('[name^="n"]') # senha = b.find_element_by_css_selector('[name^="s"]') # btn = b.find_element_by_css_selector('[name^="l"]') nome.send_keys('Eduardo') senha.send_keys('batatinhas123') btn.click()
32.631579
61
0.710484
191
1,240
4.277487
0.235602
0.091799
0.220318
0.257038
0.744186
0.744186
0.744186
0.658507
0.49694
0.445532
0
0.008881
0.091935
1,240
37
62
33.513514
0.716696
0.805645
0
0
0
0
0.3
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0
0
0
0
null
0
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
9a17a5cfd2987d7e2c137b6f97f0d065ca14e2df
3,050
py
Python
tests/test_matcher/test_base.py
PrVrSs/ast-matcher
cf36cd83b1e0acc051df510178b1787c53dfea57
[ "MIT" ]
null
null
null
tests/test_matcher/test_base.py
PrVrSs/ast-matcher
cf36cd83b1e0acc051df510178b1787c53dfea57
[ "MIT" ]
null
null
null
tests/test_matcher/test_base.py
PrVrSs/ast-matcher
cf36cd83b1e0acc051df510178b1787c53dfea57
[ "MIT" ]
null
null
null
import pytest import ast_matcher as am from ..helper import NodeFixture @pytest.mark.parametrize('data', [ pytest.param(value, id=name) for name, value in dict( base=NodeFixture( code=''' class Test: def test_1(self): def inner(): ... ''', pattern=am.FunctionDef(am.FunctionDef()), ), base_2=NodeFixture( code=''' class Test: def test_1(self): def inner_1(): ... def inner_2(): ... ''', pattern=am.FunctionDef(am.FunctionDef(), am.FunctionDef()), ), ).items() ]) def test_match_base_ok(parse_ast_tree, data): assert bool(am.match(pattern=data.pattern, ast=parse_ast_tree(data.code))) is True @pytest.mark.parametrize('data', [ pytest.param(value, id=name) for name, value in dict( base=NodeFixture( code=''' class Test: def test_1(self): def inner(): ... ''', pattern=am.FunctionDef(am.FunctionDef(), am.FunctionDef()), ) ).items() ]) def test_match_base_wrong(parse_ast_tree, data): assert bool(am.match(pattern=data.pattern, ast=parse_ast_tree(data.code))) is False @pytest.mark.parametrize('data', [ pytest.param(value, id=name) for name, value in dict( base=NodeFixture( code=''' class Test: def test_1(self): def inner_1(): def inner3(): ... def inner4(): ... def inner5(): ... def inner_2(): def inner6(): ... def inner7(): ... ''', pattern=am.FunctionDef( am.FunctionDef( am.FunctionDef(), am.FunctionDef(), ), am.FunctionDef( am.FunctionDef(), ), ), ) ).items() ]) def test_match(parse_ast_tree, data): def get_nodes_name(root): from collections import deque todo = deque([root]) while todo: node = todo.popleft() todo.extendleft(node.children) yield node.ast_node.name assert [ list(get_nodes_name(tree)) for tree in am.match(pattern=data.pattern, ast=parse_ast_tree(data.code)) ] == [ ['test_1', 'inner_1', 'inner3', 'inner4', 'inner_2', 'inner6'], ['test_1', 'inner_1', 'inner3', 'inner5', 'inner_2', 'inner6'], ['test_1', 'inner_1', 'inner4', 'inner5', 'inner_2', 'inner6'], ['test_1', 'inner_1', 'inner3', 'inner4', 'inner_2', 'inner7'], ['test_1', 'inner_1', 'inner3', 'inner5', 'inner_2', 'inner7'], ['test_1', 'inner_1', 'inner4', 'inner5', 'inner_2', 'inner7'], ]
30.19802
87
0.471475
306
3,050
4.529412
0.19281
0.131313
0.108225
0.18759
0.767677
0.767677
0.767677
0.753968
0.61544
0.61544
0
0.026638
0.38459
3,050
100
88
30.5
0.711774
0
0
0.545455
0
0
0.338689
0
0
0
0
0
0.034091
1
0.045455
false
0
0.045455
0
0.090909
0
0
0
0
null
0
0
1
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
5
9a2849a71f15b680e240eb98064ec033c6c76e66
124
py
Python
src/syncabook/__init__.py
ishine/syncabook
45277e3a06098a53fae9820f491141ab30113a5f
[ "MIT" ]
57
2020-06-01T14:05:56.000Z
2022-03-30T21:15:16.000Z
src/syncabook/__init__.py
ishine/syncabook
45277e3a06098a53fae9820f491141ab30113a5f
[ "MIT" ]
7
2020-07-13T13:47:00.000Z
2022-02-03T10:08:57.000Z
src/syncabook/__init__.py
ishine/syncabook
45277e3a06098a53fae9820f491141ab30113a5f
[ "MIT" ]
12
2020-07-13T13:34:40.000Z
2022-01-26T13:40:36.000Z
import os.path BASE_DIR = os.path.dirname(os.path.realpath(__file__)) TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates/')
24.8
54
0.766129
20
124
4.4
0.5
0.272727
0.204545
0
0
0
0
0
0
0
0
0
0.080645
124
5
55
24.8
0.77193
0
0
0
0
0
0.08
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
7bee32318c3462a93655ea498126fa417665aeaa
576
py
Python
python/test.py
frogtd/q1tsim
ec6f923da2c78ef9a9dcda9d74ca1e726b026eb4
[ "Apache-2.0" ]
14
2019-05-30T18:25:37.000Z
2022-03-05T03:06:49.000Z
python/test.py
frogtd/q1tsim
ec6f923da2c78ef9a9dcda9d74ca1e726b026eb4
[ "Apache-2.0" ]
2
2019-05-29T11:55:36.000Z
2021-11-22T08:25:41.000Z
python/test.py
frogtd/q1tsim
ec6f923da2c78ef9a9dcda9d74ca1e726b026eb4
[ "Apache-2.0" ]
8
2019-04-25T07:26:58.000Z
2021-12-27T13:20:19.000Z
import q1tsim nr_qbits = 1 nr_cbits = 1 nr_shots = 10**3 ang = 1.23 with q1tsim.Circuit(nr_qbits, nr_cbits) as circuit: circuit.rx(ang, 0) circuit.peek(0, 0) circuit.execute(nr_shots) print(circuit.histogram()) ang = -1.23 circuit.reexecute() print(circuit.histogram()) print() ang = q1tsim.RefParam(1.23) with q1tsim.Circuit(nr_qbits, nr_cbits) as circuit: circuit.rx(ang, 0) circuit.peek(0, 0) circuit.execute(nr_shots) print(circuit.histogram()) ang.assign(-1.23) circuit.reexecute() print(circuit.histogram())
19.2
51
0.670139
86
576
4.383721
0.267442
0.03183
0.222812
0.068966
0.816976
0.816976
0.816976
0.604775
0.604775
0.604775
0
0.05794
0.190972
576
29
52
19.862069
0.751073
0
0
0.608696
0
0
0
0
0
0
0
0
0
1
0
false
0
0.043478
0
0.043478
0.217391
0
0
0
null
0
1
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
5
7bf64311e2a5e9c5d7a0f56fbc5a7459a79c8cfb
271
py
Python
toai/image/__init__.py
KipperPipper/Library_test
bdc35c2f1a6f2deadb4d0b00e3f4d5c8a597efdf
[ "MIT" ]
null
null
null
toai/image/__init__.py
KipperPipper/Library_test
bdc35c2f1a6f2deadb4d0b00e3f4d5c8a597efdf
[ "MIT" ]
null
null
null
toai/image/__init__.py
KipperPipper/Library_test
bdc35c2f1a6f2deadb4d0b00e3f4d5c8a597efdf
[ "MIT" ]
null
null
null
# pylama:ignore=W0611 from .ImageAugmentor import ImageAugmentor from .ImageDataset import ImageDataset from .ImageLearner import ImageLearner from .ImageParser import ImageParser from .ImageResizer import ImageResizer from .LearningRateFinder import LearningRateFinder
30.111111
50
0.867159
27
271
8.703704
0.407407
0
0
0
0
0
0
0
0
0
0
0.016393
0.099631
271
8
51
33.875
0.946721
0.070111
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d02b7b2e19b8f546560f7e3bc8717daafca6130f
192
py
Python
doorman/worker.py
haim/doorman
27a5ffc831347a4447ddf7fc7bf2e9f0fcef461b
[ "MIT" ]
614
2016-04-22T21:08:31.000Z
2022-02-04T15:37:57.000Z
doorman/worker.py
haim/doorman
27a5ffc831347a4447ddf7fc7bf2e9f0fcef461b
[ "MIT" ]
110
2016-04-23T13:55:21.000Z
2022-03-21T22:16:37.000Z
doorman/worker.py
haim/doorman
27a5ffc831347a4447ddf7fc7bf2e9f0fcef461b
[ "MIT" ]
110
2016-04-22T21:08:41.000Z
2021-11-17T08:21:31.000Z
# -*- coding: utf-8 -*- from doorman.application import create_app from doorman.settings import CurrentConfig from doorman.tasks import celery # noqa app = create_app(config=CurrentConfig)
24
42
0.78125
25
192
5.92
0.6
0.222973
0
0
0
0
0
0
0
0
0
0.005988
0.130208
192
7
43
27.428571
0.88024
0.135417
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
1
0
0
5
d0386ba8cd53c3a36a2ed83312e21bece401e204
65
py
Python
python/astra/tools/spectrum/__init__.py
sdss/astra
ef78c46a579ed0238a4486bcbb1595a22a7f2700
[ "BSD-3-Clause" ]
5
2019-08-15T23:05:17.000Z
2022-03-14T19:26:07.000Z
python/astra/tools/spectrum/__init__.py
sdss/astra
ef78c46a579ed0238a4486bcbb1595a22a7f2700
[ "BSD-3-Clause" ]
2
2019-04-22T17:12:50.000Z
2020-10-30T05:05:26.000Z
python/astra/tools/spectrum/__init__.py
sdss/astra
ef78c46a579ed0238a4486bcbb1595a22a7f2700
[ "BSD-3-Clause" ]
null
null
null
from astra.tools.spectrum.loaders import Spectrum1D, SpectrumList
65
65
0.876923
8
65
7.125
1
0
0
0
0
0
0
0
0
0
0
0.016393
0.061538
65
1
65
65
0.918033
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d0c6096ef006779c16d0fe8f65855368fe3b6abe
77
py
Python
hackerrank/Python/Shape and Reshape/solution.py
ATrain951/01.python-com_Qproject
c164dd093954d006538020bdf2e59e716b24d67c
[ "MIT" ]
4
2020-07-24T01:59:50.000Z
2021-07-24T15:14:08.000Z
hackerrank/Python/Shape and Reshape/solution.py
ATrain951/01.python-com_Qproject
c164dd093954d006538020bdf2e59e716b24d67c
[ "MIT" ]
null
null
null
hackerrank/Python/Shape and Reshape/solution.py
ATrain951/01.python-com_Qproject
c164dd093954d006538020bdf2e59e716b24d67c
[ "MIT" ]
null
null
null
import numpy print(numpy.array(input().strip().split(), int).reshape(3, 3))
19.25
62
0.688312
12
77
4.416667
0.833333
0
0
0
0
0
0
0
0
0
0
0.028169
0.077922
77
3
63
25.666667
0.71831
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
1905fb07f48fa5d5bb8e78bf1d9ca932b15fb2ff
1,146
py
Python
erpnext_ebay/config/erpnext_ebay.py
bglazier/erpext_ebay
a94744a9f8bd2a86aab2b4d47b7c14f0065cccaf
[ "MIT" ]
19
2018-09-12T08:58:15.000Z
2022-02-22T18:51:19.000Z
erpnext_ebay/config/erpnext_ebay.py
bglazier/erpext_ebay
a94744a9f8bd2a86aab2b4d47b7c14f0065cccaf
[ "MIT" ]
29
2018-06-14T09:47:07.000Z
2021-12-20T07:18:57.000Z
erpnext_ebay/config/erpnext_ebay.py
bglazier/erpext_ebay
a94744a9f8bd2a86aab2b4d47b7c14f0065cccaf
[ "MIT" ]
26
2016-09-08T05:07:31.000Z
2022-02-22T17:10:33.000Z
def get_data(): return [ { "label": "Documents", "items": [ { "type": "doctype", "name": "eBay Order" }, { "type": "doctype", "name": "eBay Sync Log" }, { "type": "doctype", "name": "Item Group eBay" } ] }, { "label": "Setup", "items": [ { "type": "doctype", "name": "eBay Manager", "onboard": 1 }, { "type": "doctype", "name": "eBay Manager Settings", "onboard": 1 }, { "type": "doctype", "name": "Online Selling Platform" }, { "type": "doctype", "name": "Online Selling Subtype" } ] } ]
26.045455
53
0.240838
54
1,146
5.092593
0.462963
0.28
0.381818
0.276364
0.556364
0
0
0
0
0
0
0.004854
0.640489
1,146
43
54
26.651163
0.662621
0
0
0.255814
0
0
0.234729
0
0
0
0
0
0
1
0.023256
true
0
0
0.023256
0.046512
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
1
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
5
efa474a2aa815923ef6148fdd326b14dd46caede
108
py
Python
keras_pos_embd/__init__.py
CyberZHG/keras-pos-embd
6f4bdb013629785865fddf79e4ca5f4018d51b1f
[ "MIT" ]
59
2018-09-19T22:10:10.000Z
2022-01-28T21:51:42.000Z
keras_pos_embd/__init__.py
CyberZHG/keras-pos-embd
6f4bdb013629785865fddf79e4ca5f4018d51b1f
[ "MIT" ]
5
2018-12-11T06:33:03.000Z
2022-01-22T09:43:01.000Z
keras_pos_embd/__init__.py
CyberZHG/keras-pos-embd
6f4bdb013629785865fddf79e4ca5f4018d51b1f
[ "MIT" ]
25
2018-11-19T15:20:24.000Z
2021-12-09T18:45:22.000Z
from .pos_embd import PositionEmbedding from .trig_pos_embd import TrigPosEmbedding __version__ = '0.12.0'
21.6
43
0.824074
15
108
5.466667
0.666667
0.170732
0.317073
0
0
0
0
0
0
0
0
0.041667
0.111111
108
4
44
27
0.8125
0
0
0
0
0
0.055556
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
efdcb6365fd8a498311dd85bf2169ff3f55bcd9a
136
py
Python
gaiavision/core/bricks/__init__.py
NickChang97/GAIA-cv
b691af89813ffa6a1d1e1719c6dd0ec4c253d2bf
[ "Apache-2.0" ]
49
2021-06-21T06:20:40.000Z
2022-01-03T14:01:01.000Z
gaiavision/core/bricks/__init__.py
NickChang97/GAIA-cv
b691af89813ffa6a1d1e1719c6dd0ec4c253d2bf
[ "Apache-2.0" ]
null
null
null
gaiavision/core/bricks/__init__.py
NickChang97/GAIA-cv
b691af89813ffa6a1d1e1719c6dd0ec4c253d2bf
[ "Apache-2.0" ]
5
2021-07-13T09:52:34.000Z
2022-03-21T04:18:39.000Z
from .dynamic_res_blocks import DynamicBottleneck from .dynamic_conv_module import DynamicConvModule from .norm import build_norm_layer
34
50
0.889706
18
136
6.388889
0.666667
0.191304
0
0
0
0
0
0
0
0
0
0
0.088235
136
3
51
45.333333
0.927419
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
efddf355d22c0a6d9cd40bbac0351d66f18625b6
2,613
py
Python
tests/parsers/c_parser/exprs/binary_ops/sub_op_expr_tests.py
mehrdad-shokri/retdec-regression-tests-framework
9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3
[ "MIT" ]
21
2017-12-12T20:38:43.000Z
2019-04-14T12:46:10.000Z
tests/parsers/c_parser/exprs/binary_ops/sub_op_expr_tests.py
mehrdad-shokri/retdec-regression-tests-framework
9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3
[ "MIT" ]
6
2018-01-06T13:32:23.000Z
2018-09-14T15:09:11.000Z
tests/parsers/c_parser/exprs/binary_ops/sub_op_expr_tests.py
mehrdad-shokri/retdec-regression-tests-framework
9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3
[ "MIT" ]
11
2017-12-12T20:38:46.000Z
2018-07-19T03:12:03.000Z
""" Tests for the :module`regression_tests.parsers.c_parser.exprs.binary_ops.sub_op_expr` module. """ from tests.parsers.c_parser import WithModuleTests class SubOpExprTests(WithModuleTests): """Tests for `SubOpExpr`.""" def test_sub_op_expr_is_sub_op(self): sub_op_expr = self.get_expr('1 - 2', 'int') self.assertTrue(sub_op_expr.is_sub_op()) def test_sub_op_expr_is_no_other_expr(self): sub_op_expr = self.get_expr('1 - 2', 'int') self.assertFalse(sub_op_expr.is_eq_op()) self.assertFalse(sub_op_expr.is_neq_op()) self.assertFalse(sub_op_expr.is_gt_op()) self.assertFalse(sub_op_expr.is_gt_eq_op()) self.assertFalse(sub_op_expr.is_lt_op()) self.assertFalse(sub_op_expr.is_lt_eq_op()) self.assertFalse(sub_op_expr.is_add_op()) self.assertFalse(sub_op_expr.is_mul_op()) self.assertFalse(sub_op_expr.is_mod_op()) self.assertFalse(sub_op_expr.is_div_op()) self.assertFalse(sub_op_expr.is_and_op()) self.assertFalse(sub_op_expr.is_or_op()) self.assertFalse(sub_op_expr.is_bit_and_op()) self.assertFalse(sub_op_expr.is_bit_or_op()) self.assertFalse(sub_op_expr.is_bit_xor_op()) self.assertFalse(sub_op_expr.is_bit_shl_op()) self.assertFalse(sub_op_expr.is_bit_shr_op()) self.assertFalse(sub_op_expr.is_not_op()) self.assertFalse(sub_op_expr.is_neg_op()) self.assertFalse(sub_op_expr.is_assign_op()) self.assertFalse(sub_op_expr.is_address_op()) self.assertFalse(sub_op_expr.is_deref_op()) self.assertFalse(sub_op_expr.is_array_index_op()) self.assertFalse(sub_op_expr.is_comma_op()) self.assertFalse(sub_op_expr.is_ternary_op()) self.assertFalse(sub_op_expr.is_call()) self.assertFalse(sub_op_expr.is_cast()) self.assertFalse(sub_op_expr.is_pre_increment_op()) self.assertFalse(sub_op_expr.is_post_increment_op()) self.assertFalse(sub_op_expr.is_pre_decrement_op()) self.assertFalse(sub_op_expr.is_post_decrement_op()) self.assertFalse(sub_op_expr.is_compound_assign_op()) self.assertFalse(sub_op_expr.is_struct_ref_op()) self.assertFalse(sub_op_expr.is_struct_deref_op()) def test_repr_returns_correct_repr(self): add_op_expr = self.get_expr('1 - 2', 'int') self.assertEqual(repr(add_op_expr), '<SubOpExpr lhs=1 rhs=2>') def test_str_returns_correct_str(self): add_op_expr = self.get_expr('1 - 2', 'int') self.assertEqual(str(add_op_expr), '1 - 2')
42.836066
75
0.70532
410
2,613
4.017073
0.173171
0.160291
0.218579
0.247116
0.76867
0.76867
0.704918
0.481481
0.133576
0.093503
0
0.005568
0.175277
2,613
60
76
43.55
0.758701
0.044393
0
0.085106
0
0
0.024272
0
0
0
0
0
0.787234
1
0.085106
false
0
0.021277
0
0.12766
0
0
0
0
null
0
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
4bfcd38fea178e43f766bee95c41eeb579a51413
278
py
Python
mebo/exceptions.py
Bayoslav/python-mebo
1d10d2088337819488af5e44af4e5c2865e05dd2
[ "MIT" ]
null
null
null
mebo/exceptions.py
Bayoslav/python-mebo
1d10d2088337819488af5e44af4e5c2865e05dd2
[ "MIT" ]
null
null
null
mebo/exceptions.py
Bayoslav/python-mebo
1d10d2088337819488af5e44af4e5c2865e05dd2
[ "MIT" ]
null
null
null
class MeboError(Exception): pass class MeboCommandError(MeboError): pass class MeboRequestError(MeboError): pass class MeboConnectionError(MeboError): pass class MeboConfigurationError(MeboError): pass class MeboDiscoveryError(MeboError): pass
12.086957
40
0.748201
24
278
8.666667
0.375
0.216346
0.346154
0
0
0
0
0
0
0
0
0
0.18705
278
22
41
12.636364
0.920354
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
ef1ee24c0d8ccc52cefca38e76341aadbd966d77
3,876
py
Python
echecs_hall/app/views/mj_hall_api/income_support.py
obespoir/echecs
e4bb8be1d360b6c568725aee4dfe4c037a855a49
[ "AFL-3.0" ]
14
2020-03-22T14:03:51.000Z
2022-02-21T09:28:39.000Z
echecs_hall/app/views/mj_hall_api/income_support.py
obespoir/echecs
e4bb8be1d360b6c568725aee4dfe4c037a855a49
[ "AFL-3.0" ]
null
null
null
echecs_hall/app/views/mj_hall_api/income_support.py
obespoir/echecs
e4bb8be1d360b6c568725aee4dfe4c037a855a49
[ "AFL-3.0" ]
7
2020-03-22T13:57:43.000Z
2022-02-21T09:30:17.000Z
# coding=utf-8 from app.views.base_handler import BaseHandler import json from . import mj_hall from app.share.error_code import * import time from app.extensions.common import md5, diff_days, diff_hours from tornado.web import authenticated from app.controller.mj_hall_controller import income_support_controller from app.controller.mj_hall_controller import login_hall_controller @mj_hall.route('/receiveincomesupport') class ReceiveIncomeSupport(BaseHandler): isLogin = True tag = __name__ @authenticated def get(self): user = self.current_user uid = user['uid'] user_money = int(user['money']) now = int(time.time()) # 判断是否符合条件领取破产补助 # 补助金额 money = int(self.application.game_config['income_support']) # 领取补助金额间隔时间 get_income_support_interval = int(self.application.game_config['get_income_support_interval']) if income_support_controller.get_income_support_by_uid(uid): # 玩家领取破产补助详情 income_support_info = income_support_controller.get_income_support_by_uid(uid) id = income_support_info['id'] collection_time = int(income_support_info['collection_time']) income_support_times = int(income_support_info['income_support_times']) if now - collection_time > get_income_support_interval: if income_support_times < 3: data = {'uid': uid, 'collection_time': now, 'income_support_times': int(income_support_info['income_support_times']) + 1} if income_support_controller.update_income_support_by_id(id, data): if login_hall_controller.update_user_in_cache(uid, {'money': user_money + money}): self.return_success({'money': user_money + money}) else: self.return_error(GET_INCOME_SUPPORT_THREE_TIME) else: self.return_error(GET_INCOME_SUPPORT_ERROR) else: data = {'uid': uid, 'collection_time': now, 'income_support_times': 1} if income_support_controller.save_income_support(data) > 0: if login_hall_controller.update_user_in_cache(uid, {'money': user_money+money}): self.return_success({'money': user_money+money}) else: self.return_error(INSERT_ERROR) def post(self): pass @mj_hall.route('/getincomesupport') class GetIncomeSupport(BaseHandler): isLogin = True tag = __name__ @authenticated def get(self): user = self.current_user uid = user['uid'] now = time.time() # 补助金额 money = int(self.application.game_config['income_support']) # 领取补助金额间隔时间 get_income_support_interval = int(self.application.game_config['get_income_support_interval']) if income_support_controller.get_income_support_by_uid(uid): # 玩家领取破产补助详情 income_support_info = income_support_controller.get_income_support_by_uid(uid) collection_time = int(income_support_info['collection_time']) income_support_times = int(income_support_info['income_support_times']) if now - collection_time > get_income_support_interval: if income_support_times < 3: data = {'money': money, 'income_support_times': int(income_support_info['income_support_times']) + 1} self.return_success(data) else: self.return_error(GET_INCOME_SUPPORT_THREE_TIME) else: self.return_error(GET_INCOME_SUPPORT_ERROR) else: data = {'money': money, 'income_support_times': 1} self.return_success(data) def post(self): pass
37.631068
106
0.643189
441
3,876
5.263039
0.172336
0.257648
0.09651
0.062042
0.778544
0.778544
0.769927
0.736321
0.688065
0.660491
0
0.003189
0.27193
3,876
102
107
38
0.819277
0.020898
0
0.68
0
0
0.102774
0.019815
0
0
0
0
0
1
0.053333
false
0.026667
0.12
0
0.253333
0
0
0
0
null
1
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
5
ef249959b52ff6fcd2af93b99443e59fe11670cb
203
py
Python
tekton-master/backend/appengine/routes/cookie/tasks.py
seijiakiyama/fatec-script
0aaa5223ab03b74b1d80f2e8829df7f9d1ea20b9
[ "MIT" ]
null
null
null
tekton-master/backend/appengine/routes/cookie/tasks.py
seijiakiyama/fatec-script
0aaa5223ab03b74b1d80f2e8829df7f9d1ea20b9
[ "MIT" ]
null
null
null
tekton-master/backend/appengine/routes/cookie/tasks.py
seijiakiyama/fatec-script
0aaa5223ab03b74b1d80f2e8829df7f9d1ea20b9
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaecookie import facade from gaecookie.decorator import no_csrf @no_csrf def renew(): facade.renew().execute()
20.3
56
0.758621
27
203
5.407407
0.62963
0.178082
0
0
0
0
0
0
0
0
0
0.005714
0.137931
203
9
57
22.555556
0.828571
0.103448
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
true
0
0.5
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ef69a8c8cc37a8399383d7ec9e0b106f07b21efd
175
py
Python
src/celery_worker.py
jonatasoli/the-eye
0a11334bc24c99dcb7158238bc2ae63a26dc63b1
[ "MIT" ]
null
null
null
src/celery_worker.py
jonatasoli/the-eye
0a11334bc24c99dcb7158238bc2ae63a26dc63b1
[ "MIT" ]
null
null
null
src/celery_worker.py
jonatasoli/the-eye
0a11334bc24c99dcb7158238bc2ae63a26dc63b1
[ "MIT" ]
null
null
null
#!/usr/bin/env python import os from src.app import app from src.events.adapters.celery import celery_obj from src.events.tasks import process_event app.app_context().push()
21.875
49
0.8
30
175
4.566667
0.6
0.153285
0.189781
0
0
0
0
0
0
0
0
0
0.102857
175
7
50
25
0.872611
0.114286
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.8
0
0.8
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
323c24f2a4e1e492cb21910aca6dce8351854568
222
py
Python
egg/resources/console/__init__.py
eanorambuena/Driver
3cb14f5d741c6bae364326305ae0ded04e10e9d4
[ "MIT" ]
null
null
null
egg/resources/console/__init__.py
eanorambuena/Driver
3cb14f5d741c6bae364326305ae0ded04e10e9d4
[ "MIT" ]
null
null
null
egg/resources/console/__init__.py
eanorambuena/Driver
3cb14f5d741c6bae364326305ae0ded04e10e9d4
[ "MIT" ]
null
null
null
from egg.resources.console.display import * from egg.resources.console.progress import * def get(tag: str): i=input(blue+"$"+tag+"> "+green) return i def put(content, colour = white): print(colour + content, end = "")
24.666667
44
0.698198
32
222
4.84375
0.6875
0.090323
0.206452
0.296774
0
0
0
0
0
0
0
0
0.135135
222
9
45
24.666667
0.807292
0
0
0
0
0
0.013453
0
0
0
0
0
0
1
0.285714
false
0
0.285714
0
0.714286
0.142857
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
327f4f9cfa73722cafd02b1f9e7f047c2dff0895
722
py
Python
hostel_project/hostel_webapp/views.py
Saumya0206/hostel-web-app
63a7013465239485475f3a886f3f97f933a6ed79
[ "MIT" ]
null
null
null
hostel_project/hostel_webapp/views.py
Saumya0206/hostel-web-app
63a7013465239485475f3a886f3f97f933a6ed79
[ "MIT" ]
null
null
null
hostel_project/hostel_webapp/views.py
Saumya0206/hostel-web-app
63a7013465239485475f3a886f3f97f933a6ed79
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.views import generic from .models import Complaint class ComplaintList(generic.ListView): queryset = Complaint.objects.order_by('date') template_name = 'complaintlist.html' def as_view(request): return render(request, 'complaintlist.html', {}) hostels = [ 'B1', 'B2', 'B5' ] # Create your views here. def index(request): return render(request, 'index.html', {}) def about(request): return render(request, 'about.html', {}) def login(request): return render(request, 'login.html', {}) def complaint(request): return render(request, 'complaint.html', {}) def g4(request): return render(request, 'g4.html', {})
20.628571
56
0.671745
85
722
5.670588
0.423529
0.161826
0.236515
0.323651
0
0
0
0
0
0
0
0.008503
0.185596
722
34
57
21.235294
0.811224
0.031856
0
0
0
0
0.139368
0
0
0
0
0
0
1
0.26087
false
0
0.130435
0.26087
0.782609
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
32800303e1967bdc47c774cf27f7f0a02a74cd7b
73
py
Python
my_library/dataset_readers/__init__.py
krispingal/toxic_comments
d259fdbcbb153ceeae0206fb6ca8d0c72ed6d9a1
[ "BSD-3-Clause" ]
null
null
null
my_library/dataset_readers/__init__.py
krispingal/toxic_comments
d259fdbcbb153ceeae0206fb6ca8d0c72ed6d9a1
[ "BSD-3-Clause" ]
null
null
null
my_library/dataset_readers/__init__.py
krispingal/toxic_comments
d259fdbcbb153ceeae0206fb6ca8d0c72ed6d9a1
[ "BSD-3-Clause" ]
null
null
null
from my_library.dataset_readers.reader import ToxicCommentsDatasetReader
36.5
72
0.917808
8
73
8.125
1
0
0
0
0
0
0
0
0
0
0
0
0.054795
73
1
73
73
0.942029
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
32c93a1dde78c5616291c8134a8252dc8b17c7c9
150
py
Python
star.for.py
jyotsanashyama/python_loop
04157fc6b762dd260b117b27ca82091c485a62fb
[ "MIT" ]
null
null
null
star.for.py
jyotsanashyama/python_loop
04157fc6b762dd260b117b27ca82091c485a62fb
[ "MIT" ]
null
null
null
star.for.py
jyotsanashyama/python_loop
04157fc6b762dd260b117b27ca82091c485a62fb
[ "MIT" ]
null
null
null
''' * * * * * * * * * * * * * * * * * * * * * * * * * ''' for b in range(5): for a in range(5): print("*",end=" ") print()
12.5
27
0.246667
13
150
2.846154
0.615385
0.378378
0.432432
0
0
0
0
0
0
0
0
0.023529
0.433333
150
11
28
13.636364
0.411765
0.326667
0
0
0
0
0.02439
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
08774e7d10b09d01576b95eb5b849a26d1fe3db3
2,788
py
Python
tests/integration/coding_sequences/test_gc_content_second_position.py
JLSteenwyk/BioKIT
9ca31d8003dc845bf56b2c56c87820c0b05021c4
[ "MIT" ]
8
2021-10-03T21:08:33.000Z
2021-12-02T17:15:32.000Z
tests/integration/coding_sequences/test_gc_content_second_position.py
JLSteenwyk/BioKIT
9ca31d8003dc845bf56b2c56c87820c0b05021c4
[ "MIT" ]
null
null
null
tests/integration/coding_sequences/test_gc_content_second_position.py
JLSteenwyk/BioKIT
9ca31d8003dc845bf56b2c56c87820c0b05021c4
[ "MIT" ]
5
2021-10-05T06:25:03.000Z
2022-01-04T11:01:09.000Z
import pytest from mock import patch, call from pathlib import Path import sys import textwrap from biokit.biokit import Biokit here = Path(__file__) @pytest.mark.integration class TestAlignmentSummary(object): @patch("builtins.print") def test_gc_content_second_position_invalid_input(self, mocked_print): # noqa with pytest.raises(SystemExit) as pytest_wrapped_e: Biokit() assert pytest_wrapped_e.type == SystemExit assert pytest_wrapped_e.value.code == 2 @pytest.mark.slow @patch("builtins.print") def test_gc_content_second_position_simple(self, mocked_print): expected_result = "0.3741" testargs = [ "biokit", "gc_content_second_position", f"{here.parent.parent.parent}/sample_files/GCF_000146045.2_R64_cds_from_genomic.fna", ] with patch.object(sys, "argv", testargs): Biokit() assert mocked_print.mock_calls == [call(expected_result)] @patch("builtins.print") def test_gc_content_second_position_simple_verbose(self, mocked_print): expected_result_0 = textwrap.dedent( """lcl|NC_001133.9_cds_NP_009332.1_1\t0.4711""" ) expected_result_1 = textwrap.dedent( """lcl|NC_001133.9_cds_NP_878038.1_2\t0.3684""" ) expected_result_2 = textwrap.dedent( """lcl|NC_001133.9_cds_NP_009333.1_3\t0.3569""" ) testargs = [ "biokit", "gc_content_second_position", f"{here.parent.parent.parent}/sample_files/GCF_000146045.2_R64_cds_from_genomic.small.fna", "-v", ] with patch.object(sys, "argv", testargs): Biokit() assert mocked_print.mock_calls == [ call(expected_result_0), call(expected_result_1), call(expected_result_2), ] @patch("builtins.print") def test_gc_content_second_position_simple_verbose_alias(self, mocked_print): expected_result_0 = textwrap.dedent( """lcl|NC_001133.9_cds_NP_009332.1_1\t0.4711""" ) expected_result_1 = textwrap.dedent( """lcl|NC_001133.9_cds_NP_878038.1_2\t0.3684""" ) expected_result_2 = textwrap.dedent( """lcl|NC_001133.9_cds_NP_009333.1_3\t0.3569""" ) testargs = [ "biokit", "gc2", f"{here.parent.parent.parent}/sample_files/GCF_000146045.2_R64_cds_from_genomic.small.fna", "-v", ] with patch.object(sys, "argv", testargs): Biokit() assert mocked_print.mock_calls == [ call(expected_result_0), call(expected_result_1), call(expected_result_2), ]
31.681818
103
0.61944
338
2,788
4.742604
0.239645
0.122271
0.078603
0.086089
0.786026
0.786026
0.767311
0.767311
0.767311
0.737367
0
0.086334
0.272956
2,788
87
104
32.045977
0.704489
0.001435
0
0.536232
0
0
0.1624
0.1228
0
0
0
0
0.072464
1
0.057971
false
0
0.086957
0
0.15942
0.15942
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0895d3a47be9f7b36dc0b49c5fb8546a7291b006
39
py
Python
fsdet/data/__init__.py
artificially-ai/few-shot-object-detection
2233934871a4a54ad59f6688db074c3f99ae8b87
[ "Apache-2.0" ]
null
null
null
fsdet/data/__init__.py
artificially-ai/few-shot-object-detection
2233934871a4a54ad59f6688db074c3f99ae8b87
[ "Apache-2.0" ]
null
null
null
fsdet/data/__init__.py
artificially-ai/few-shot-object-detection
2233934871a4a54ad59f6688db074c3f99ae8b87
[ "Apache-2.0" ]
null
null
null
from .builtin import register_all_coco
19.5
38
0.871795
6
39
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.102564
39
1
39
39
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3e93378c4fc2d85bd03d22a9ab61d924444f428d
191
py
Python
swsm/admin.py
yynet2022/swsm
e8edec8c10aab5d11a9ae30129bb09387091ac8a
[ "MIT" ]
null
null
null
swsm/admin.py
yynet2022/swsm
e8edec8c10aab5d11a9ae30129bb09387091ac8a
[ "MIT" ]
1
2022-01-08T03:57:18.000Z
2022-01-12T10:36:34.000Z
swsm/admin.py
yynet2022/swsm
e8edec8c10aab5d11a9ae30129bb09387091ac8a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from django.contrib import admin # Register your models here. from .models import Holiday, Information admin.site.register(Holiday) admin.site.register(Information)
21.222222
40
0.764398
25
191
5.84
0.6
0.123288
0.232877
0
0
0
0
0
0
0
0
0.005952
0.120419
191
8
41
23.875
0.863095
0.251309
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
3e97b13c23c55b817d486181f4356455f3f5e713
881
py
Python
flask/app/datafinance/routes.py
SchneiderDaniel/data
741f5d912eb9a62b77ec3cecf4fc54f21133784c
[ "MIT" ]
null
null
null
flask/app/datafinance/routes.py
SchneiderDaniel/data
741f5d912eb9a62b77ec3cecf4fc54f21133784c
[ "MIT" ]
null
null
null
flask/app/datafinance/routes.py
SchneiderDaniel/data
741f5d912eb9a62b77ec3cecf4fc54f21133784c
[ "MIT" ]
null
null
null
from . import blueprint from flask import render_template from Dashapps.finance import * from flask_security import login_required, roles_accepted @blueprint.route('/rebalancing') # @login_required def app1_template(): return render_template('app1.html', dash_url = Dash_App1.url_base, meta_text=Dash_App1.description_text) @blueprint.route('/correlation') # @login_required # @roles_accepted('admin') def app2_template(): return render_template('app2.html', dash_url = Dash_App2.url_base, meta_text=Dash_App2.description_text) @blueprint.route('/impact-of-fond-costs') @login_required @roles_accepted('admin') def app3_template(): return render_template('app3.html', dash_url = Dash_App3.url_base, meta_text=Dash_App3.description_text) @blueprint.route('/overview') # @login_required def finance_card_template(): return render_template('finance_cards.html')
30.37931
108
0.791146
119
881
5.537815
0.302521
0.106222
0.121396
0.169954
0.189681
0.103187
0
0
0
0
0
0.015
0.091941
881
29
109
30.37931
0.80875
0.081725
0
0
0
0
0.129193
0.026087
0
0
0
0
0
1
0.222222
true
0
0.222222
0.222222
0.666667
0.277778
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
1
0
0
1
1
0
0
5
3ea78b1af6261ef9eaf9ddb5db915c63732285f9
694
py
Python
aplicacao.py
renatoiglesias/DevSis10
f8efdbf7aabb958f199aa59acfe5d740107ae6a1
[ "bzip2-1.0.6" ]
null
null
null
aplicacao.py
renatoiglesias/DevSis10
f8efdbf7aabb958f199aa59acfe5d740107ae6a1
[ "bzip2-1.0.6" ]
null
null
null
aplicacao.py
renatoiglesias/DevSis10
f8efdbf7aabb958f199aa59acfe5d740107ae6a1
[ "bzip2-1.0.6" ]
null
null
null
from flask import Flask, render_template app = Flask (__name__) @app.route('/index.html') def home(): return render_template("index.html") @app.route('/detalhe.html') def det(): return render_template("detalhe.html") @app.route('/disciplina.html') def disc(): return render_template("disciplina.html") @app.route('/escola.html') def esc(): return render_template("escola.html") @app.route('/listacurso.html') def liscur(): return render_template("listacurso.html") @app.route('/noticias.html') def noti(): return render_template("noticias.html") @app.route('/tabelaprofessores.html') def tabprof(): return render_template("tabelaprofessores.html") app.run()
21.030303
52
0.711816
88
694
5.477273
0.295455
0.232365
0.290456
0
0
0
0
0
0
0
0
0
0.116715
694
32
53
21.6875
0.786297
0
0
0
0
0
0.292507
0.064842
0
0
0
0
0
1
0.291667
false
0
0.041667
0.291667
0.625
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
3ec9f8976673e6321d5f00ca6da3d94d8c0639cb
46
py
Python
data_structures/Arrays.py
niroshajayasundara/Python
ed113841165717d135a001307d06f4282ad16870
[ "MIT" ]
13
2021-03-11T00:25:22.000Z
2022-03-19T00:19:23.000Z
data_structures/arrays.py
tlhcelik/Python
3bab59ae06f79698ab579ba52d2bc4ea6402154c
[ "MIT" ]
160
2021-04-26T19:04:15.000Z
2022-03-26T20:18:37.000Z
data_structures/arrays.py
tlhcelik/Python
3bab59ae06f79698ab579ba52d2bc4ea6402154c
[ "MIT" ]
12
2021-04-26T19:43:01.000Z
2022-01-31T08:36:29.000Z
arr = [10, 20, 30, 40] arr[1] = 30 print(arr)
11.5
22
0.543478
10
46
2.5
0.7
0
0
0
0
0
0
0
0
0
0
0.305556
0.217391
46
3
23
15.333333
0.388889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3ee2d358bbccb3c13895dbd5950ecada3e15a2d2
639
py
Python
caldera/transforms/_base.py
jvrana/caldera
a346324e77f20739e00a82f97530dda4906f59dd
[ "MIT" ]
2
2021-12-13T17:52:17.000Z
2021-12-13T17:52:18.000Z
caldera/transforms/_base.py
jvrana/caldera
a346324e77f20739e00a82f97530dda4906f59dd
[ "MIT" ]
4
2020-10-06T21:06:15.000Z
2020-10-10T01:18:23.000Z
caldera/transforms/_base.py
jvrana/caldera
a346324e77f20739e00a82f97530dda4906f59dd
[ "MIT" ]
null
null
null
"""_base.py. Transform base class """ from abc import ABC from abc import abstractmethod from typing import Callable from typing import overload from typing import Union from caldera.data import GraphBatch from caldera.data import GraphData class TransformBase(ABC): @abstractmethod def transform(self, data): pass @overload def __call__(self, data: GraphBatch) -> GraphBatch: ... def __call__(self, data: GraphData) -> GraphData: return self.transform(data) def __repr__(self): return "{}".format(self.__class__.__name__) TransformCallable = Union[Callable, TransformBase]
19.96875
55
0.71205
73
639
5.945205
0.356164
0.069124
0.110599
0.096774
0
0
0
0
0
0
0
0
0.201878
639
31
56
20.612903
0.85098
0.048513
0
0
0
0
0.003328
0
0
0
0
0
0
1
0.210526
false
0.052632
0.368421
0.105263
0.736842
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
1
1
1
1
0
0
5
de275b54f6006967c7c34cee6e3d5830de4b5a92
204
py
Python
genelang/results/CallResult.py
GabrielAmare/Genelang
af5294e900d2f79ff54375f9759c156a4b5a098a
[ "MIT" ]
null
null
null
genelang/results/CallResult.py
GabrielAmare/Genelang
af5294e900d2f79ff54375f9759c156a4b5a098a
[ "MIT" ]
null
null
null
genelang/results/CallResult.py
GabrielAmare/Genelang
af5294e900d2f79ff54375f9759c156a4b5a098a
[ "MIT" ]
null
null
null
from .ResultUnit import ResultUnit from genelang.functions import indent class CallResult(ResultUnit): @property def body(self): return f"{self.process.name} ->\n{indent(self.result)}\n"
25.5
65
0.720588
26
204
5.653846
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.161765
204
7
66
29.142857
0.859649
0
0
0
0
0
0.230392
0.132353
0
0
0
0
0
1
0.166667
false
0
0.333333
0.166667
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
5
deb0f3e4b912dc4349a69b0e293a21677b2d1465
39
py
Python
asynclib/__init__.py
BBQ293/py-coro-impl
00b67f97f199c6d47149682590b96a33d9434e19
[ "WTFPL" ]
1
2022-03-26T17:53:17.000Z
2022-03-26T17:53:17.000Z
asynclib/__init__.py
BBQ293/py-coro-impl
00b67f97f199c6d47149682590b96a33d9434e19
[ "WTFPL" ]
8
2021-09-17T06:32:06.000Z
2021-11-08T14:28:54.000Z
asynclib/__init__.py
BBQ293/py-coro-impl
00b67f97f199c6d47149682590b96a33d9434e19
[ "WTFPL" ]
1
2021-09-27T15:25:14.000Z
2021-09-27T15:25:14.000Z
from .core import Promise, LoopManager
19.5
38
0.820513
5
39
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
1
39
39
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
defd2e4b061d5ee938a31e035b841837b5f50842
42
py
Python
LucasNinoEjercicios/ejer_1.py
zehemz/clases-python-101
633cb5f0cbc85e64e242514f0394754a5bed0513
[ "Apache-2.0" ]
null
null
null
LucasNinoEjercicios/ejer_1.py
zehemz/clases-python-101
633cb5f0cbc85e64e242514f0394754a5bed0513
[ "Apache-2.0" ]
null
null
null
LucasNinoEjercicios/ejer_1.py
zehemz/clases-python-101
633cb5f0cbc85e64e242514f0394754a5bed0513
[ "Apache-2.0" ]
null
null
null
print "aguante la comic bang" raw_input()
14
29
0.761905
7
42
4.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
42
2
30
21
0.861111
0
0
0
0
0
0.5
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
72030d4668758c81480e9307f9fd7c4d2640eceb
142
py
Python
src/system-interface/hook-flask_bootstrap.py
fredsongyu/mmitss-az
62fb59a9e5a19f62a1096971f3cc0ecc04599106
[ "Apache-2.0" ]
10
2018-12-05T14:48:59.000Z
2022-02-17T02:10:51.000Z
src/system-interface/hook-flask_bootstrap.py
fredsongyu/mmitss-az
62fb59a9e5a19f62a1096971f3cc0ecc04599106
[ "Apache-2.0" ]
null
null
null
src/system-interface/hook-flask_bootstrap.py
fredsongyu/mmitss-az
62fb59a9e5a19f62a1096971f3cc0ecc04599106
[ "Apache-2.0" ]
8
2018-11-16T06:38:25.000Z
2022-03-09T18:22:59.000Z
from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('flask_bootstrap') hiddenimports=['pkg_resources.py2_warn']
35.5
54
0.852113
19
142
6
0.842105
0.192982
0.280702
0
0
0
0
0
0
0
0
0.007463
0.056338
142
3
55
47.333333
0.843284
0
0
0
0
0
0.260563
0.15493
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
7209c51937de1ceb398932dc9832fa3e630f3fa3
126
py
Python
geeksbot_web/rcon/admin.py
dustinpianalto/geeksbot_web
ee02452dd5a61b0487706782020f9647ae202238
[ "MIT" ]
null
null
null
geeksbot_web/rcon/admin.py
dustinpianalto/geeksbot_web
ee02452dd5a61b0487706782020f9647ae202238
[ "MIT" ]
null
null
null
geeksbot_web/rcon/admin.py
dustinpianalto/geeksbot_web
ee02452dd5a61b0487706782020f9647ae202238
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import RconServer # Register your models here. admin.site.register(RconServer)
21
32
0.81746
17
126
6.058824
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.119048
126
6
33
21
0.927928
0.206349
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
722f528f911c8ad847a72d36ad2c0b4c8cb823ab
24
py
Python
sdk/lusid_notifications/__version__.py
finbourne/notifications-sdk-python-preview
2368e05445c74dc248afc1c98efa9f2ca895de3b
[ "MIT" ]
null
null
null
sdk/lusid_notifications/__version__.py
finbourne/notifications-sdk-python-preview
2368e05445c74dc248afc1c98efa9f2ca895de3b
[ "MIT" ]
null
null
null
sdk/lusid_notifications/__version__.py
finbourne/notifications-sdk-python-preview
2368e05445c74dc248afc1c98efa9f2ca895de3b
[ "MIT" ]
null
null
null
__version__ = "0.1.317"
12
23
0.666667
4
24
3
1
0
0
0
0
0
0
0
0
0
0
0.238095
0.125
24
1
24
24
0.333333
0
0
0
0
0
0.291667
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
72361f9ee99a7ad7385c9998a29ecbe308cfbacf
183
py
Python
main.py
RimuEirnarn/GTRN_Client
54bd7b27ff12880272ba1c631066a3cdd733a6bd
[ "BSD-3-Clause" ]
1
2021-04-19T19:50:07.000Z
2021-04-19T19:50:07.000Z
main.py
RimuEirnarn/GTRN_Client
54bd7b27ff12880272ba1c631066a3cdd733a6bd
[ "BSD-3-Clause" ]
null
null
null
main.py
RimuEirnarn/GTRN_Client
54bd7b27ff12880272ba1c631066a3cdd733a6bd
[ "BSD-3-Clause" ]
null
null
null
from lib.Game import * BANNER = """\ ------------------------------------------ G U E S S T H E R A N D O M N U M B E R ------------------------------------------""" install()
16.636364
45
0.273224
26
183
1.923077
0.730769
0.08
0
0
0
0
0
0
0
0
0
0
0.202186
183
10
46
18.3
0.342466
0
0
0
0
0
0.721311
0.459016
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5