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
2ce4398f64596457bf066f0c9f07a0dc77efb150
627
py
Python
pcbhdl/test/library/test_package.py
pcbhdl/pcbhdl
08d8ffa29645e5bea2b8a51c9a47cd0ec6215f8c
[ "0BSD" ]
null
null
null
pcbhdl/test/library/test_package.py
pcbhdl/pcbhdl
08d8ffa29645e5bea2b8a51c9a47cd0ec6215f8c
[ "0BSD" ]
null
null
null
pcbhdl/test/library/test_package.py
pcbhdl/pcbhdl
08d8ffa29645e5bea2b8a51c9a47cd0ec6215f8c
[ "0BSD" ]
null
null
null
import unittest from pcbhdl.library.package.passive import * class TestPackage(unittest.TestCase): def test_eia_two_terminal(self): pkg = EIA_I_0603 self.assertEqual(pkg.name, "EIA_I_0603") self.assertEqual(pkg.pads[0].name, "1") self.assertEqual(pkg.pads[0].center, (-0.9, 0.0)) self.assertEqual(pkg.pads[0].width, 0.8) self.assertEqual(pkg.pads[0].height, 1.0) self.assertEqual(pkg.pads[1].name, "2") self.assertEqual(pkg.pads[1].center, (0.9, 0.0)) self.assertEqual(pkg.pads[1].width, 0.8) self.assertEqual(pkg.pads[1].height, 1.0)
36.882353
57
0.637959
95
627
4.136842
0.315789
0.343511
0.412214
0.447837
0.643766
0.506361
0.310433
0.16285
0.16285
0
0
0.067729
0.199362
627
16
58
39.1875
0.715139
0
0
0
0
0
0.019139
0
0
0
0
0
0.642857
1
0.071429
false
0.071429
0.142857
0
0.285714
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
1
0
0
0
0
0
5
fa05302b2ed25605b5ee0bf6d728d5e72eddf34a
102
py
Python
If_Instructions/testes_condicionais.py
Brunokrk/Learning-Python
36a3b1c4782dbb21af189760a451fd2e9c083bb6
[ "MIT" ]
null
null
null
If_Instructions/testes_condicionais.py
Brunokrk/Learning-Python
36a3b1c4782dbb21af189760a451fd2e9c083bb6
[ "MIT" ]
null
null
null
If_Instructions/testes_condicionais.py
Brunokrk/Learning-Python
36a3b1c4782dbb21af189760a451fd2e9c083bb6
[ "MIT" ]
null
null
null
# = atribuição, == comparação car='panamera' print(car=='panamera') car='audi' print(car=='panamera')
20.4
29
0.686275
12
102
5.833333
0.5
0.471429
0.457143
0
0
0
0
0
0
0
0
0
0.088235
102
5
30
20.4
0.752688
0.264706
0
0.5
0
0
0.378378
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
fa0885b982196169f9ef5831a96342c9f23d949a
1,119
py
Python
ezgoogleapi/__init__.py
rrwielema/ezgoogleapi
9aa8f22f51cb437b329bc2cfe668ade9e8477d15
[ "MIT" ]
null
null
null
ezgoogleapi/__init__.py
rrwielema/ezgoogleapi
9aa8f22f51cb437b329bc2cfe668ade9e8477d15
[ "MIT" ]
null
null
null
ezgoogleapi/__init__.py
rrwielema/ezgoogleapi
9aa8f22f51cb437b329bc2cfe668ade9e8477d15
[ "MIT" ]
null
null
null
from ezgoogleapi.analytics.body import Body from ezgoogleapi.analytics.daterange import (TODAY, YESTERDAY, LAST_WEEK, LAST_7_DAYS, THIS_MONTH, LAST_MONTH, LAST_90_DAYS, LAST_YEAR, CURRENT_QUARTER, LAST_QUARTER, quarter, weeks, last_weeks, last_days) from ezgoogleapi.analytics.query import Query from ezgoogleapi.analytics.variable_names import VariableName, NameDatabase from ezgoogleapi.bigquery.base import BigQuery from ezgoogleapi.bigquery.schema import schema, SchemaTypes from ezgoogleapi.sheets import SpreadSheet, Permission
53.285714
75
0.410188
70
1,119
6.371429
0.442857
0.235426
0.215247
0
0
0
0
0
0
0
0
0.006122
0.562109
1,119
20
76
55.95
0.904082
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.35
0
0.35
0
0
0
0
null
1
1
0
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
1
0
0
0
0
5
fa2293947b7cb8c7a7134d73556bad03b40de805
58
py
Python
masks.py
chrisnbattista/multi-agent-kinetics
01af3bbd8a44038e7e8744975000e5474fa1124b
[ "MIT" ]
1
2021-01-13T22:26:53.000Z
2021-01-13T22:26:53.000Z
masks.py
chrisnbattista/multi-agent-kinetics
01af3bbd8a44038e7e8744975000e5474fa1124b
[ "MIT" ]
null
null
null
masks.py
chrisnbattista/multi-agent-kinetics
01af3bbd8a44038e7e8744975000e5474fa1124b
[ "MIT" ]
null
null
null
def threshold_distance_mask(r, h): return r < h
6.444444
34
0.62069
9
58
3.777778
0.777778
0.117647
0
0
0
0
0
0
0
0
0
0
0.293103
58
8
35
7.25
0.829268
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
fa2d3b73ce0f5262a750e63f7b5a444709dcb71d
208
py
Python
dbus_curio/__init__.py
hugosenari/dbus_curio
080541b683862767ca3506d7514ce22ca2a64a60
[ "BSD-3-Clause" ]
null
null
null
dbus_curio/__init__.py
hugosenari/dbus_curio
080541b683862767ca3506d7514ce22ca2a64a60
[ "BSD-3-Clause" ]
null
null
null
dbus_curio/__init__.py
hugosenari/dbus_curio
080541b683862767ca3506d7514ce22ca2a64a60
[ "BSD-3-Clause" ]
null
null
null
from .auth import auth from .connection import system_bus, session_bus __all__ = [auth, system_bus, session_bus] __author__ = """Hugo Sena Ribeiro""" __email__ = 'hugosenari@gmail.com' __version__ = '0.1.0'
26
47
0.754808
29
208
4.724138
0.655172
0.131387
0.233577
0.277372
0
0
0
0
0
0
0
0.016484
0.125
208
7
48
29.714286
0.736264
0
0
0
0
0
0.201923
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
fa37bef14d060ae89bd3d5837191f583b5a70f11
86
py
Python
lib/train/__init__.py
ishine/TextNormSeq2Seq
585b6a7f17910876c76240ff82ee811c66e23104
[ "MIT" ]
36
2019-04-20T15:06:45.000Z
2022-03-03T22:42:57.000Z
lib/train/__init__.py
ishine/TextNormSeq2Seq
585b6a7f17910876c76240ff82ee811c66e23104
[ "MIT" ]
5
2019-06-06T14:48:54.000Z
2021-06-05T15:40:09.000Z
lib/train/__init__.py
ishine/TextNormSeq2Seq
585b6a7f17910876c76240ff82ee811c66e23104
[ "MIT" ]
13
2019-05-11T02:59:54.000Z
2022-03-23T18:24:10.000Z
from .optim import Optim from .trainer import Trainer from .evaluator import Evaluator
28.666667
32
0.837209
12
86
6
0.416667
0
0
0
0
0
0
0
0
0
0
0
0.127907
86
3
32
28.666667
0.96
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
fa40e10c762a167c9fb3851f9638fc190f6d8ab9
70
py
Python
polyglotdb/query/lexicon/__init__.py
msonderegger/PolyglotDB
583fd8ec14c2e34807b45b9f15fa19cffa130bfa
[ "MIT" ]
25
2016-01-28T20:47:07.000Z
2021-11-29T16:13:07.000Z
polyglotdb/query/lexicon/__init__.py
msonderegger/PolyglotDB
583fd8ec14c2e34807b45b9f15fa19cffa130bfa
[ "MIT" ]
120
2016-04-07T17:55:09.000Z
2022-03-24T18:30:10.000Z
polyglotdb/query/lexicon/__init__.py
PhonologicalCorpusTools/PolyglotDB
7640212c7062cf44ae911081241ce83a26ced2eb
[ "MIT" ]
10
2015-12-03T20:06:58.000Z
2021-02-11T03:02:48.000Z
from .query import LexiconQuery from .attributes import LexiconNode
14
35
0.828571
8
70
7.25
0.75
0
0
0
0
0
0
0
0
0
0
0
0.142857
70
4
36
17.5
0.966667
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
fa68c6b1ab6e5681ed93f03163086a7c29e77ba6
111
py
Python
pymoon/core/utils/extension_checker.py
hassanMuhamad/pymoon
4f5f0e7b6e7382740f8bafa4abcd1044ae9c8993
[ "MIT" ]
1
2019-11-09T15:54:47.000Z
2019-11-09T15:54:47.000Z
pymoon/core/utils/extension_checker.py
hassanMuhamad/pymoon
4f5f0e7b6e7382740f8bafa4abcd1044ae9c8993
[ "MIT" ]
null
null
null
pymoon/core/utils/extension_checker.py
hassanMuhamad/pymoon
4f5f0e7b6e7382740f8bafa4abcd1044ae9c8993
[ "MIT" ]
1
2019-11-12T19:23:07.000Z
2019-11-12T19:23:07.000Z
# !TODO: # - Module that checks the file extension # @entry: file Object || image Object # return a flag
22.2
43
0.657658
15
111
4.866667
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.243243
111
4
44
27.75
0.869048
0.918919
0
null
0
null
0
0
null
0
0
0.25
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
0
0
0
0
0
5
3af9fb490bf23cc6735909c0e37e8bf5dcd7ed4a
2,738
py
Python
testsuite/tests/NA17-007__Ada_runtime_units/run_test.py
AdaCore/style_checker
17108ebfc44375498063ecdad6c6e4430458e60a
[ "CNRI-Python" ]
2
2017-10-22T18:04:26.000Z
2020-03-06T11:07:41.000Z
testsuite/tests/NA17-007__Ada_runtime_units/run_test.py
AdaCore/style_checker
17108ebfc44375498063ecdad6c6e4430458e60a
[ "CNRI-Python" ]
null
null
null
testsuite/tests/NA17-007__Ada_runtime_units/run_test.py
AdaCore/style_checker
17108ebfc44375498063ecdad6c6e4430458e60a
[ "CNRI-Python" ]
4
2018-05-22T12:08:54.000Z
2020-12-14T15:25:27.000Z
def test_a_cohama_adb(style_checker): """Style check test against a-cohama.adb.""" style_checker.set_year(2006) p = style_checker.run_style_checker('trunk/gnat', 'a-cohama.adb') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p) def test_a_cohamb_adb(style_checker): """Style check test against a-cohamb.adb.""" p = style_checker.run_style_checker('trunk/gnat', 'a-cohamb.adb') style_checker.assertNotEqual(p.status, 0, p.image) style_checker.assertRunOutputEqual(p, """\ a-cohamb.adb: Copyright notice missing, must occur before line 24 """) def test_a_cohata_ads(style_checker): """Style check test against a-cohata.ads.""" style_checker.set_year(2006) p = style_checker.run_style_checker('trunk/gnat', 'a-cohata.ads') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p) def test_a_except_ads(style_checker): """Style check test against a-except.ads.""" style_checker.set_year(2006) p = style_checker.run_style_checker('trunk/gnat', 'a-except.ads') style_checker.assertNotEqual(p.status, 0, p.image) style_checker.assertRunOutputEqual(p, """\ a-except.ads:9: Copyright notice must include current year (found 2005, expected 2006) """) def test_exceptions_ads(style_checker): """Style check test against exceptions.ads.""" style_checker.set_year(2006) p = style_checker.run_style_checker('trunk/gnat', 'exceptions.ads') style_checker.assertNotEqual(p.status, 0, p.image) style_checker.assertRunOutputEqual(p, """\ exceptions.ads:9: Copyright notice must include current year (found 2005, expected 2006) """) def test_a_zttest_ads(style_checker): """Style check test against a-zttest.ads """ p = style_checker.run_style_checker('trunk/gnat', 'a-zttest.ads') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p) def test_directio_ads(style_checker): """Style check test against directio.ads """ p = style_checker.run_style_checker('trunk/gnat', 'directio.ads') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p) def test_i_c_ads(style_checker): """Style check test against i-c.ads """ p = style_checker.run_style_checker('trunk/gnat', 'i-c.ads') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p) def test_s_taprop_linux_adb(style_checker): """Style check test s-taprop-linux.adb """ style_checker.set_year(2010) p = style_checker.run_style_checker('trunk/gnat', 's-taprop-linux.adb') style_checker.assertEqual(p.status, 0, p.image) style_checker.assertRunOutputEmpty(p)
35.558442
88
0.732652
392
2,738
4.887755
0.127551
0.313152
0.117432
0.10334
0.918058
0.86691
0.855428
0.768789
0.652923
0.569937
0
0.020745
0.137327
2,738
76
89
36.026316
0.790432
0.130022
0
0.531915
0
0.021277
0.192621
0
0
0
0
0
0.382979
1
0.191489
false
0
0
0
0.191489
0
0
0
0
null
1
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d70dd97d8b6ac934b5ce51383051085fea06a455
147
py
Python
doctor/email_info.py
JuliasBright/SendMoney
d13e2df81bf75a9154abfc57d897a416b4950e80
[ "CC0-1.0" ]
1
2021-01-29T16:57:42.000Z
2021-01-29T16:57:42.000Z
doctor/email_info.py
JuliasBright/SendMoney
d13e2df81bf75a9154abfc57d897a416b4950e80
[ "CC0-1.0" ]
null
null
null
doctor/email_info.py
JuliasBright/SendMoney
d13e2df81bf75a9154abfc57d897a416b4950e80
[ "CC0-1.0" ]
null
null
null
EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'findadoctor2@gmail.com' EMAIL_HOST_PASSWORD = 'Qwerty1@' EMAIL_USE_TLS = True
29.4
43
0.768707
22
147
4.772727
0.636364
0.257143
0.247619
0
0
0
0
0
0
0
0
0.03876
0.122449
147
5
44
29.4
0.775194
0
0
0
0
0
0.305556
0.152778
0
0
0
0
0
1
0
false
0.2
0
0
0
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
1
0
0
0
0
0
5
d71cec00e2775c2beaa2f807471ba48d7733f3b6
53
py
Python
sakt/__init__.py
scaomath/kaggle-riiid-test
6c99deccc33def7e5d0c982b0a9a19612138e893
[ "MIT" ]
null
null
null
sakt/__init__.py
scaomath/kaggle-riiid-test
6c99deccc33def7e5d0c982b0a9a19612138e893
[ "MIT" ]
null
null
null
sakt/__init__.py
scaomath/kaggle-riiid-test
6c99deccc33def7e5d0c982b0a9a19612138e893
[ "MIT" ]
null
null
null
from .sakt import * # from .train_sakt_final import *
26.5
33
0.754717
8
53
4.75
0.625
0
0
0
0
0
0
0
0
0
0
0
0.150943
53
2
33
26.5
0.844444
0.584906
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
d728e3cecdc03bd70055ff453f1a6b1c2d084baf
35
py
Python
python/helpers/tests/generator3_tests/data/SkeletonGeneration/segmentation_fault_handling/sigsegv.py
tgodzik/intellij-community
f5ef4191fc30b69db945633951fb160c1cfb7b6f
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/helpers/tests/generator3_tests/data/SkeletonGeneration/segmentation_fault_handling/sigsegv.py
tgodzik/intellij-community
f5ef4191fc30b69db945633951fb160c1cfb7b6f
[ "Apache-2.0" ]
2
2022-02-19T09:45:05.000Z
2022-02-27T20:32:55.000Z
python/helpers/tests/generator3_tests/data/SkeletonGeneration/segmentation_fault_handling/sigsegv.py
tgodzik/intellij-community
f5ef4191fc30b69db945633951fb160c1cfb7b6f
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
import ctypes ctypes.string_at(0)
8.75
19
0.8
6
35
4.5
0.833333
0
0
0
0
0
0
0
0
0
0
0.032258
0.114286
35
3
20
11.666667
0.83871
0
0
0
0
0
0
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
d7384bab319ea3a2b2fa3683c41accb902076fd2
5,062
py
Python
armstrong/core/arm_content/tests/video/backends/youtube.py
cirlabs/armstrong.core.arm_content
91b2022bc19f0ddb10402d928c9b68c9faf242b6
[ "Apache-2.0" ]
null
null
null
armstrong/core/arm_content/tests/video/backends/youtube.py
cirlabs/armstrong.core.arm_content
91b2022bc19f0ddb10402d928c9b68c9faf242b6
[ "Apache-2.0" ]
null
null
null
armstrong/core/arm_content/tests/video/backends/youtube.py
cirlabs/armstrong.core.arm_content
91b2022bc19f0ddb10402d928c9b68c9faf242b6
[ "Apache-2.0" ]
null
null
null
from ..._utils import * from ....fields.video import EmbeddedVideo from ....video.backends import helpers from ....video.backends.youtube import YouTubeBackend class YouTubeBackendTestCase(ArmContentTestCase): def generate_random_url(self): random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id return random_id, url def test_returns_tuple_with_url_as_first_value(self): random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id backend = YouTubeBackend() video = EmbeddedVideo(url, backend) self.assertEqual("http", video.url.scheme) self.assertEqual("youtube.com", video.url.netloc) def test_returns_tuple_with_id_as_second_value(self): random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id backend = YouTubeBackend() video = EmbeddedVideo(url, backend) self.assertEqual(random_id, video.id) def test_returns_the_expected_html_when_embed_is_called(self): random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id backend = YouTubeBackend() video = EmbeddedVideo(url, backend) expected = "".join([ '<iframe title="YouTube video player" ', 'width="640" height="390" ', 'src="http://www.youtube.com/embed/%s" ', 'frameborder="0" allowfullscreen></iframe>']) % random_id self.assertEqual(expected, backend.embed(video)) def test_embed_width_can_be_set_with_a_kwarg(self): random_width = random.randint(1000, 2000) random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id backend = YouTubeBackend() video = EmbeddedVideo(url, backend) expected = "".join([ '<iframe title="YouTube video player" ', 'width="%d" height="390" ' % random_width, 'src="http://www.youtube.com/embed/%s" ', 'frameborder="0" allowfullscreen></iframe>']) % random_id self.assertRegexpMatches(backend.embed(video, width=random_width), r'width="%d"' % random_width) def test_embed_height_can_be_set_with_a_kwarg(self): random_height = random.randint(1000, 2000) random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id backend = YouTubeBackend() video = EmbeddedVideo(url, backend) expected = "".join([ '<iframe title="YouTube video player" ', 'width="%d" height="390" ' % random_height, 'src="http://www.youtube.com/embed/%s" ', 'frameborder="0" allowfullscreen></iframe>']) % random_id self.assertRegexpMatches(backend.embed(video, height=random_height), r'height="%d"' % random_height) def test_embed_width_and_height_can_be_strings(self): random_height = str(random.randint(1000, 2000)) random_width = str(random.randint(1000, 2000)) random_id = str(random.randint(100, 200)) url = "http://youtube.com/watch?v=%s" % random_id backend = YouTubeBackend() video = EmbeddedVideo(url, backend) expected = "".join([ '<iframe title="YouTube video player" ', 'width="%s" height="%s" ' % (random_width, random_height), 'src="http://www.youtube.com/embed/%s" ', 'frameborder="0" allowfullscreen></iframe>']) % random_id self.assertRegexpMatches(backend.embed(video, width=random_width), r'width="%s"' % random_width) self.assertRegexpMatches(backend.embed(video, height=random_height), r'height="%s"' % random_height) def test_height_defaults_to_configured_if_not_provided(self): random_height = random.randint(1000, 2000) settings = fudge.Fake() settings.has_attr(ARMSTRONG_EMBED_VIDEO_HEIGHT=random_height) settings.has_attr(ARMSTRONG_EMBED_VIDEO_WIDTH="does not matter") with fudge.patched_context(helpers, 'settings', settings): random_id, url = self.generate_random_url() backend = YouTubeBackend() video = EmbeddedVideo(url, backend) self.assertRegexpMatches(backend.embed(video), r'height="%s"' % random_height) def test_width_defaults_to_configured_if_not_provided(self): random_width = random.randint(1000, 2000) settings = fudge.Fake() settings.has_attr(ARMSTRONG_EMBED_VIDEO_WIDTH=random_width) settings.has_attr(ARMSTRONG_EMBED_VIDEO_HEIGHT="does not matter") with fudge.patched_context(helpers, 'settings', settings): random_id, url = self.generate_random_url() backend = YouTubeBackend() video = EmbeddedVideo(url, backend) self.assertRegexpMatches(backend.embed(video), r'width="%s"' % random_width)
43.264957
76
0.63552
585
5,062
5.280342
0.152137
0.056976
0.046617
0.101004
0.823568
0.791842
0.781159
0.73001
0.68404
0.68404
0
0.027404
0.235875
5,062
116
77
43.637931
0.7712
0
0
0.680412
0
0
0.175227
0.019755
0
0
0
0
0.103093
1
0.092784
false
0
0.041237
0
0.154639
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
d777d0ce4abc3f4a312ab70f3c81ea83b57f9821
659
py
Python
xautodl/spaces/__init__.py
Joey61Liuyi/AutoDL-Projects
2092e144920e82d74753a7ac31e1890a150d41cf
[ "MIT" ]
817
2020-01-15T00:23:41.000Z
2022-03-31T14:52:03.000Z
xautodl/spaces/__init__.py
Joey61Liuyi/AutoDL-Projects
2092e144920e82d74753a7ac31e1890a150d41cf
[ "MIT" ]
77
2020-01-14T14:02:45.000Z
2022-03-25T07:06:02.000Z
xautodl/spaces/__init__.py
Joey61Liuyi/AutoDL-Projects
2092e144920e82d74753a7ac31e1890a150d41cf
[ "MIT" ]
176
2020-01-15T10:39:41.000Z
2022-03-31T04:24:53.000Z
##################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.01 # ##################################################### # Define complex searc space for AutoDL # ##################################################### from .basic_space import Categorical from .basic_space import Continuous from .basic_space import Integer from .basic_space import Space from .basic_space import VirtualNode from .basic_op import has_categorical from .basic_op import has_continuous from .basic_op import is_determined from .basic_op import get_determined_value from .basic_op import get_min from .basic_op import get_max
36.611111
53
0.60698
78
659
4.897436
0.397436
0.259162
0.172775
0.267016
0.26178
0
0
0
0
0
0
0.010309
0.116844
659
17
54
38.764706
0.646048
0.133536
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ad22ee4b2f00653cb78df13760d28f833e71da87
63
py
Python
text processing in python/process_beta.py
TheBrownViking20/DSstuff
d915f48e88c22baa81cf8f6114615c6d1bd3faa9
[ "MIT" ]
3
2018-02-12T14:18:50.000Z
2018-05-31T19:06:54.000Z
text processing in python/process_beta.py
TheBrownViking20/DSstuff
d915f48e88c22baa81cf8f6114615c6d1bd3faa9
[ "MIT" ]
null
null
null
text processing in python/process_beta.py
TheBrownViking20/DSstuff
d915f48e88c22baa81cf8f6114615c6d1bd3faa9
[ "MIT" ]
1
2018-05-31T19:06:56.000Z
2018-05-31T19:06:56.000Z
import os import glob from process_alpha import text_process
10.5
38
0.84127
10
63
5.1
0.7
0
0
0
0
0
0
0
0
0
0
0
0.15873
63
5
39
12.6
0.962264
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
ad26e96ed1f6ff28f3015be9815a17e2a5553345
63
py
Python
torchcam/cams/__init__.py
alexandrosstergiou/torch-cam
7a95e145341edde0bd26aedf38efd06bb0c2d2a6
[ "MIT" ]
749
2020-03-24T09:32:23.000Z
2022-03-31T17:30:00.000Z
torchcam/cams/__init__.py
alexandrosstergiou/torch-cam
7a95e145341edde0bd26aedf38efd06bb0c2d2a6
[ "MIT" ]
118
2020-03-24T01:21:31.000Z
2022-03-31T12:41:37.000Z
torchcam/cams/__init__.py
alexandrosstergiou/torch-cam
7a95e145341edde0bd26aedf38efd06bb0c2d2a6
[ "MIT" ]
81
2020-05-20T01:18:32.000Z
2022-03-31T07:55:58.000Z
from .cam import * from .gradcam import * from .utils import *
15.75
22
0.714286
9
63
5
0.555556
0.444444
0
0
0
0
0
0
0
0
0
0
0.190476
63
3
23
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
ad521a5b0f34caf9230158f86bc5692bade3762d
420
py
Python
tests/resources/xmpp_handlers.py
pombreda/tipfy
900e5a31a5d24107efa8dfacd89fd69d207cf470
[ "BSD-3-Clause" ]
23
2015-02-15T22:35:04.000Z
2021-11-17T11:39:24.000Z
tests/resources/xmpp_handlers.py
iki/tipfy
20a4d20eb68d2caa8f0a8f51caf5b8a075efa9c3
[ "BSD-3-Clause" ]
null
null
null
tests/resources/xmpp_handlers.py
iki/tipfy
20a4d20eb68d2caa8f0a8f51caf5b8a075efa9c3
[ "BSD-3-Clause" ]
3
2016-03-21T15:57:28.000Z
2020-11-26T02:26:19.000Z
from tipfy.appengine.xmpp import BaseHandler, CommandHandler class XmppHandler(CommandHandler): def foo_command(self, message): message.reply('Foo command!') def bar_command(self, message): message.reply('Bar command!') def text_message(self, message): super(XmppHandler, self).text_message(message) message.reply(message.body) class XmppHandler2(BaseHandler): pass
23.333333
60
0.707143
47
420
6.234043
0.446809
0.191126
0.194539
0.170648
0.204778
0
0
0
0
0
0
0.002941
0.190476
420
17
61
24.705882
0.858824
0
0
0
0
0
0.057143
0
0
0
0
0
0
1
0.272727
false
0.090909
0.090909
0
0.545455
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
ad7296db40a28ad8b4f7434f61946ea883e0fc99
6,057
py
Python
python_modules/libraries/dagster-bash/dagster_bash/solids.py
flowersw/dagster
0de6baf2bd6a41bfacf0be532b954e23305fb6b4
[ "Apache-2.0" ]
3
2020-09-09T04:10:23.000Z
2021-11-08T02:10:42.000Z
python_modules/libraries/dagster-bash/dagster_bash/solids.py
flowersw/dagster
0de6baf2bd6a41bfacf0be532b954e23305fb6b4
[ "Apache-2.0" ]
2
2021-05-11T13:36:27.000Z
2021-09-03T01:53:11.000Z
python_modules/libraries/dagster-bash/dagster_bash/solids.py
flowersw/dagster
0de6baf2bd6a41bfacf0be532b954e23305fb6b4
[ "Apache-2.0" ]
null
null
null
import os from dagster import ( Enum, EnumValue, Failure, Field, InputDefinition, Noneable, Nothing, OutputDefinition, Permissive, check, solid, ) from .utils import execute, execute_script_file def bash_command_solid(bash_command, name='bash_solid', input_defs=None, **kwargs): '''This function is a factory which constructs a solid that will execute a Bash command. Any kwargs passed to this function will be passed along to the underlying :func:`@solid <dagster.solid>` decorator. However, note that overriding ``config`` or ``output_defs`` is not supported. You might consider using :func:`@composite_solid <dagster.composite_solid>` to wrap this solid in the cases where you'd like to configure the bash solid with different config fields. Examples: .. literalinclude:: ../../../../../python_modules/libraries/dagster-bash/dagster_bash_tests/example_bash_command_solid.py :language: python Args: bash_command (str): The shell command to execute. name (str, optional): The name of this solid. Defaults to "bash_solid". input_defs (List[InputDefinition], optional): input definitions for the solid. Defaults to a single Nothing input. Raises: Failure: Raised when the shell command returns a non-zero exit code. Returns: SolidDefinition: Returns the constructed solid definition. ''' check.str_param(bash_command, 'bash_command') name = check.str_param(name, 'name') check.opt_list_param(input_defs, 'input_defs', of_type=InputDefinition) if 'output_defs' in kwargs: raise TypeError('Overriding output_defs for bash solid is not supported.') if 'config' in kwargs: raise TypeError('Overriding config for bash solid is not supported.') @solid( name=name, description=kwargs.pop('description', 'A solid to invoke a bash command.'), input_defs=input_defs or [InputDefinition('start', Nothing)], output_defs=[OutputDefinition(str, 'result')], config=bash_solid_config(), **kwargs ) def _bash_solid(context): output, return_code = execute( bash_command=bash_command, log=context.log, **context.solid_config ) if return_code: raise Failure( description='Bash command execution failed with output: {output}'.format( output=output ) ) return output return _bash_solid def bash_script_solid(bash_script_path, name='bash_script_solid', input_defs=None, **kwargs): '''This function is a factory which constructs a solid that will execute a Bash command read from a script file. Any kwargs passed to this function will be passed along to the underlying :func:`@solid <dagster.solid>` decorator. However, note that overriding ``config`` or ``output_defs`` is not supported. You might consider using :func:`@composite_solid <dagster.composite_solid>` to wrap this solid in the cases where you'd like to configure the bash solid with different config fields. Examples: .. literalinclude:: ../../../../../python_modules/libraries/dagster-bash/dagster_bash_tests/example_bash_script_solid.py :language: python Args: bash_script_path (str): The script file to execute. name (str, optional): The name of this solid. Defaults to "bash_script_solid". input_defs (List[InputDefinition], optional): input definitions for the solid. Defaults to a single Nothing input. Raises: Failure: Raised when the shell command returns a non-zero exit code. Returns: SolidDefinition: Returns the constructed solid definition. ''' check.str_param(bash_script_path, 'bash_script_path') name = check.str_param(name, 'name') check.opt_list_param(input_defs, 'input_defs', of_type=InputDefinition) if 'output_defs' in kwargs: raise TypeError('Overriding output_defs for bash solid is not supported.') if 'config' in kwargs: raise TypeError('Overriding config for bash solid is not supported.') @solid( name=name, description=kwargs.pop('description', 'A solid to invoke a bash command.'), input_defs=input_defs or [InputDefinition('start', Nothing)], output_defs=[OutputDefinition(str, 'result')], config=bash_solid_config(), **kwargs ) def _bash_script_solid(context): output, return_code = execute_script_file( bash_script_path=bash_script_path, log=context.log, **context.solid_config ) if return_code: raise Failure( description='Bash command execution failed with output: {output}'.format( output=output ) ) return output return _bash_script_solid def bash_solid_config(): return { 'env': Field( Noneable(Permissive()), default_value=os.environ.copy(), is_required=False, description='An optional dict of environment variables to pass to the subprocess. ' 'Defaults to using os.environ.copy().', ), 'output_logging': Field( Enum( name='OutputType', enum_values=[ EnumValue('STREAM', description='Stream script stdout/stderr.'), EnumValue( 'BUFFER', description='Buffer bash script stdout/stderr, then log upon completion.', ), EnumValue('NONE', description='No logging'), ], ), is_required=False, default_value='BUFFER', ), 'cwd': Field( Noneable(str), default_value=None, is_required=False, description='Working directory in which to execute bash script', ), }
33.65
125
0.63827
704
6,057
5.338068
0.204545
0.040979
0.022352
0.019159
0.75785
0.753592
0.705695
0.705695
0.705695
0.705695
0
0
0.272247
6,057
179
126
33.837989
0.852541
0.348853
0
0.431373
0
0
0.222575
0
0
0
0
0
0
1
0.04902
false
0.009804
0.029412
0.009804
0.127451
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
ad8cae38854595ad8b6907c8ae142b4f150b0508
1,847
py
Python
angalabiri/shop/forms/cartform.py
dark-codr/ebiangala
0af3de29b2afa71df3e138cd16ecddc69fbd597d
[ "MIT" ]
1
2021-03-25T14:06:23.000Z
2021-03-25T14:06:23.000Z
angalabiri/shop/forms/cartform.py
dark-codr/ebiangala
0af3de29b2afa71df3e138cd16ecddc69fbd597d
[ "MIT" ]
5
2021-09-08T03:08:46.000Z
2022-03-12T00:56:35.000Z
angalabiri/shop/forms/cartform.py
me-edavids/ebiangala
0af3de29b2afa71df3e138cd16ecddc69fbd597d
[ "MIT" ]
null
null
null
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import ( Column, HTML, Field, Fieldset, Layout, Row, Submit, BaseInput, ) from crispy_forms.bootstrap import InlineField, UneditableField from crispy_forms import layout PRODUCT_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 200)] class CartAddProductForm(forms.Form): quantity = forms.TypedChoiceField( choices=PRODUCT_QUANTITY_CHOICES, coerce=int, required=False, widget=forms.TextInput(attrs={'class': 'qty', 'style':'width:60px; padding: 8.7px;'}) ) update = forms.BooleanField( widget=forms.HiddenInput(), initial=False, required=False ) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( BaseInput("quantity", value=1, style="width:50px;", add_class="qty"), Submit("Add To Cart", "Add to Cart", css_class="add-to-cart button m-0"), ) # class ListCartAddProductForm(forms.Form): # quantity = forms.TypedChoiceField( # choices=PRODUCT_QUANTITY_CHOICES, # coerce=int, # required=False, # widget=forms.TextInput(attrs={'class': 'qty', 'style':'width:60px; padding: 8.7px;'}) # ) # update = forms.BooleanField( # widget=forms.HiddenInput(), initial=False, required=False # ) # def __init__(self, *args, **kwargs): # super().__init__(*args, **kwargs) # self.helper = FormHelper() # self.helper.layout = Layout( # BaseInput("quantity", value=1, style="width:50px;", add_class="qty"), # Submit("Add To Cart", "Add To Cart", css_class="add-to-cart button m-0"), # ) # <i class="icon-shopping-cart"></i>
29.790323
95
0.623714
209
1,847
5.368421
0.325359
0.026738
0.048128
0.039216
0.705882
0.705882
0.705882
0.705882
0.705882
0.705882
0
0.014094
0.231727
1,847
61
96
30.278689
0.776603
0.400108
0
0
0
0
0.097337
0
0
0
0
0
0
1
0.03125
false
0
0.15625
0
0.28125
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
d100f2edb9ccb5ba2c2151a7d3f00ada35be2feb
71
py
Python
newtonnet/train/hooks/__init__.py
THGLab/NewtonNet
fcf2af848a1c998bd08096dcefb58a5610eda03c
[ "MIT" ]
null
null
null
newtonnet/train/hooks/__init__.py
THGLab/NewtonNet
fcf2af848a1c998bd08096dcefb58a5610eda03c
[ "MIT" ]
null
null
null
newtonnet/train/hooks/__init__.py
THGLab/NewtonNet
fcf2af848a1c998bd08096dcefb58a5610eda03c
[ "MIT" ]
null
null
null
""" """ from newtonnet.train.hooks.visualizers import VizMolVectors3D
14.2
61
0.774648
7
71
7.857143
1
0
0
0
0
0
0
0
0
0
0
0.015625
0.098592
71
5
61
14.2
0.84375
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
d12632ef89add1fa673d803e3bfa1f49a08e0895
643
py
Python
arrow/commands/cmd_remote.py
trstickland/python-apollo
04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb
[ "MIT" ]
5
2017-06-27T19:41:57.000Z
2021-06-05T13:36:11.000Z
arrow/commands/cmd_remote.py
trstickland/python-apollo
04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb
[ "MIT" ]
28
2017-07-24T15:10:37.000Z
2021-09-03T11:56:35.000Z
arrow/commands/cmd_remote.py
trstickland/python-apollo
04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb
[ "MIT" ]
10
2017-05-10T19:13:44.000Z
2021-08-09T04:52:33.000Z
import click from arrow.commands.remote.add_organism import cli as add_organism from arrow.commands.remote.add_track import cli as add_track from arrow.commands.remote.delete_organism import cli as delete_organism from arrow.commands.remote.delete_track import cli as delete_track from arrow.commands.remote.update_organism import cli as update_organism from arrow.commands.remote.update_track import cli as update_track @click.group() def cli(): pass cli.add_command(add_organism) cli.add_command(add_track) cli.add_command(delete_organism) cli.add_command(delete_track) cli.add_command(update_organism) cli.add_command(update_track)
30.619048
72
0.846034
103
643
5.048544
0.165049
0.103846
0.196154
0.265385
0.388462
0
0
0
0
0
0
0
0.087092
643
20
73
32.15
0.88586
0
0
0
0
0
0
0
0
0
0
0
0
1
0.0625
true
0.0625
0.4375
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
5
d12bc0140faaf024fcd4675dbbb0883ad1aa6148
37
py
Python
CodeForces/A2OJ Ladder/demo5.py
dimitrov-dimitar/competitive-programming
f2b022377baf6d4beff213fc513907b774c12352
[ "MIT" ]
null
null
null
CodeForces/A2OJ Ladder/demo5.py
dimitrov-dimitar/competitive-programming
f2b022377baf6d4beff213fc513907b774c12352
[ "MIT" ]
null
null
null
CodeForces/A2OJ Ladder/demo5.py
dimitrov-dimitar/competitive-programming
f2b022377baf6d4beff213fc513907b774c12352
[ "MIT" ]
null
null
null
for i in range(100000): print(i)
12.333333
23
0.621622
7
37
3.285714
0.857143
0
0
0
0
0
0
0
0
0
0
0.214286
0.243243
37
2
24
18.5
0.607143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
d134d6e171e2027b009af41fac2481ff27123790
91
py
Python
uol_os_reports.py
LCBRU/reporter
8cb0ae403346e375a5e99d1d4df375cf2d5f3b81
[ "MIT" ]
null
null
null
uol_os_reports.py
LCBRU/reporter
8cb0ae403346e375a5e99d1d4df375cf2d5f3b81
[ "MIT" ]
null
null
null
uol_os_reports.py
LCBRU/reporter
8cb0ae403346e375a5e99d1d4df375cf2d5f3b81
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import reporter.uol_os_reports from runner import run run()
13
31
0.725275
14
91
4.571429
0.857143
0
0
0
0
0
0
0
0
0
0
0.013514
0.186813
91
6
32
15.166667
0.851351
0.230769
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
d140214440afa91487170cb9f734112e88307afb
160
py
Python
plugins/__init__.py
SeaSeaEm/SpueBox
303dc0be7c5b9cd7906ff4297fd565e15bda95ef
[ "MIT" ]
9
2018-11-12T19:03:07.000Z
2021-12-02T10:25:18.000Z
plugins/__init__.py
SeaSeaEm/SpueBox
303dc0be7c5b9cd7906ff4297fd565e15bda95ef
[ "MIT" ]
3
2018-08-13T21:47:09.000Z
2021-05-09T02:28:35.000Z
plugins/__init__.py
SeaSeaEm/SpueBox
303dc0be7c5b9cd7906ff4297fd565e15bda95ef
[ "MIT" ]
6
2018-09-12T19:30:17.000Z
2021-12-02T16:42:40.000Z
from .administrative import AdministrativePlugin from .musicplayer import MusicPlayerPlugin from .tag import TagPlugin from .randomgame import RandomGamePlugin
32
48
0.875
16
160
8.75
0.625
0
0
0
0
0
0
0
0
0
0
0
0.1
160
4
49
40
0.972222
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
d15e4faa0172854d2a82bdc0f069ffca02dcadff
97
py
Python
astropop/polarimetry/__init__.py
rudnerlq/astropop
37688c6b91fa9718202a1c4e85c99049f591a3fc
[ "BSD-3-Clause" ]
3
2020-06-15T18:09:15.000Z
2020-06-16T00:58:21.000Z
astropop/polarimetry/__init__.py
rudnerlq/astropop
37688c6b91fa9718202a1c4e85c99049f591a3fc
[ "BSD-3-Clause" ]
null
null
null
astropop/polarimetry/__init__.py
rudnerlq/astropop
37688c6b91fa9718202a1c4e85c99049f591a3fc
[ "BSD-3-Clause" ]
null
null
null
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .dualbeam import * # noqa
24.25
63
0.731959
15
97
4.733333
0.933333
0
0
0
0
0
0
0
0
0
0
0.012821
0.195876
97
3
64
32.333333
0.897436
0.680412
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
d16d7715394a6e6026fdc4126de3d845f6dee494
142
py
Python
minigest/tributi/models/accertamento_rata/__init__.py
ctrlmaniac/minigest
2bfceb57e41c872e4112e24d0e6991164846888b
[ "MIT" ]
null
null
null
minigest/tributi/models/accertamento_rata/__init__.py
ctrlmaniac/minigest
2bfceb57e41c872e4112e24d0e6991164846888b
[ "MIT" ]
1
2021-09-22T19:10:20.000Z
2021-09-22T19:10:20.000Z
minigest/tributi/models/accertamento_rata/__init__.py
ctrlmaniac/minigest
2bfceb57e41c872e4112e24d0e6991164846888b
[ "MIT" ]
null
null
null
from .erario import AccertamentoRataSezErario from .rata import AccertamentoRata __all__ = ["AccertamentoRataSezErario", "AccertamentoRata"]
28.4
59
0.838028
11
142
10.454545
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.091549
142
4
60
35.5
0.891473
0
0
0
0
0
0.288732
0.176056
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
d16dd530bbca19d1da92c43ca3702f32d6787337
249
py
Python
laia/models/htr/__init__.py
basbeu/PyLaia
d14458484b56622204b1730a7d53220c5d0f1bc1
[ "MIT" ]
2
2020-09-10T13:31:17.000Z
2021-07-31T09:44:17.000Z
laia/models/htr/__init__.py
basbeu/PyLaia
d14458484b56622204b1730a7d53220c5d0f1bc1
[ "MIT" ]
1
2020-12-06T18:11:52.000Z
2020-12-06T18:19:38.000Z
laia/models/htr/__init__.py
basbeu/PyLaia
d14458484b56622204b1730a7d53220c5d0f1bc1
[ "MIT" ]
2
2020-04-20T13:40:56.000Z
2020-10-17T11:59:55.000Z
from __future__ import absolute_import from laia.models.htr.conv_block import ConvBlock from laia.models.htr.dummy_model import DummyModel from laia.models.htr.laia_crnn import LaiaCRNN from laia.models.htr.gated_crnn import GatedConv2d, GatedCRNN
35.571429
61
0.859438
38
249
5.394737
0.473684
0.156098
0.273171
0.331707
0
0
0
0
0
0
0
0.004405
0.088353
249
6
62
41.5
0.898678
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0f313b49f16cdc2b083aeda3d79142c275779667
76
py
Python
jacdac/matrix_keypad/__init__.py
microsoft/jacdac-python
712ad5559e29065f5eccb5dbfe029c039132df5a
[ "MIT" ]
1
2022-02-15T21:30:36.000Z
2022-02-15T21:30:36.000Z
jacdac/matrix_keypad/__init__.py
microsoft/jacdac-python
712ad5559e29065f5eccb5dbfe029c039132df5a
[ "MIT" ]
null
null
null
jacdac/matrix_keypad/__init__.py
microsoft/jacdac-python
712ad5559e29065f5eccb5dbfe029c039132df5a
[ "MIT" ]
1
2022-02-08T19:32:45.000Z
2022-02-08T19:32:45.000Z
# Autogenerated file. from .client import MatrixKeypadClient # type: ignore
25.333333
53
0.802632
8
76
7.625
1
0
0
0
0
0
0
0
0
0
0
0
0.131579
76
2
54
38
0.924242
0.421053
0
0
1
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
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0f41dd0e8a10cc049d632ffea1ca4b19a1b5cfc6
16
py
Python
openml_data_integration/protobuf_generator/openml_40646/myconstants.py
tuix/tutorials
733d35a8a39df079e8c2432c441b70785ab08440
[ "Apache-2.0" ]
8
2020-04-21T13:29:04.000Z
2021-12-13T08:59:09.000Z
openml_data_integration/protobuf_generator/openml_40646/myconstants.py
tuix/tutorials
733d35a8a39df079e8c2432c441b70785ab08440
[ "Apache-2.0" ]
3
2021-04-27T11:03:04.000Z
2021-05-24T18:22:57.000Z
openml_data_integration/protobuf_generator/openml_40646/myconstants.py
tuix/tutorials
733d35a8a39df079e8c2432c441b70785ab08440
[ "Apache-2.0" ]
6
2020-07-06T08:23:25.000Z
2021-11-24T10:39:34.000Z
DATA_ID = 40646
8
15
0.75
3
16
3.666667
1
0
0
0
0
0
0
0
0
0
0
0.384615
0.1875
16
1
16
16
0.461538
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0f49b9c489972d64861be13715b8a2ece606e158
172
py
Python
testing/util.py
bbhunter/fuzz-lightyear
75c1318d2f747a4fac6b55a46649c944528769ba
[ "Apache-2.0" ]
169
2019-11-06T20:30:16.000Z
2022-01-22T15:55:19.000Z
testing/util.py
bbhunter/fuzz-lightyear
75c1318d2f747a4fac6b55a46649c944528769ba
[ "Apache-2.0" ]
29
2019-09-24T19:44:03.000Z
2021-10-01T09:29:30.000Z
testing/util.py
bbhunter/fuzz-lightyear
75c1318d2f747a4fac6b55a46649c944528769ba
[ "Apache-2.0" ]
27
2019-12-27T19:57:28.000Z
2021-12-08T05:38:10.000Z
import re # Source: https://stackoverflow.com/a/14693789 _ansi_escape = re.compile(r'\x1b\[[0-?]*[ -/]*[@-~]') def uncolor(text): return _ansi_escape.sub('', text)
17.2
53
0.633721
23
172
4.565217
0.826087
0.190476
0
0
0
0
0
0
0
0
0
0.066667
0.127907
172
9
54
19.111111
0.633333
0.255814
0
0
0
0
0.18254
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
0f4faf6715384d47dd264801d3c572e7baf256e3
14,472
py
Python
cli/test/test_runner_slurm.py
vipulchhabra99/popper
9bbbe3340daea7161230a219fe2381603ba2a622
[ "MIT" ]
null
null
null
cli/test/test_runner_slurm.py
vipulchhabra99/popper
9bbbe3340daea7161230a219fe2381603ba2a622
[ "MIT" ]
null
null
null
cli/test/test_runner_slurm.py
vipulchhabra99/popper
9bbbe3340daea7161230a219fe2381603ba2a622
[ "MIT" ]
null
null
null
import os import unittest import tempfile from testfixtures import compare, Replacer, replace from testfixtures.popen import MockPopen from testfixtures.mock import call from popper.config import ConfigLoader from popper.runner import WorkflowRunner from popper.parser import WorkflowParser from popper.runner_slurm import SlurmRunner, DockerRunner, SingularityRunner from popper.cli import log as log from .test_common import PopperTest from box import Box def mock_kill(pid, sig): return 0 class TestSlurmSlurmRunner(PopperTest): def setUp(self): log.setLevel("CRITICAL") self.Popen = MockPopen() replacer = Replacer() replacer.replace("popper.runner_host.Popen", self.Popen) self.addCleanup(replacer.restore) def tearDown(self): log.setLevel("NOTSET") def test_tail_output(self): self.Popen.set_command("tail -f slurm-x.out", returncode=0) with SlurmRunner(config=ConfigLoader.load()) as sr: self.assertEqual(sr._tail_output("slurm-x.out"), 0) self.assertEqual(len(sr._out_stream_pid), 1) def test_stop_running_tasks(self): self.Popen.set_command("scancel --name job_a", returncode=0) with SlurmRunner(config=ConfigLoader.load()) as sr: sr._spawned_jobs.add("job_a") sr.stop_running_tasks() compare( call.Popen( ["scancel", "--name", "job_a"], cwd=os.getcwd(), env=None, preexec_fn=os.setsid, stderr=-2, stdout=-1, universal_newlines=True, ), self.Popen.all_calls[0], ) @replace("popper.runner_slurm.os.kill", mock_kill) def test_submit_batch_job(self, mock_kill): config = ConfigLoader.load(workspace_dir="/w") self.Popen.set_command( "sbatch --wait " f"--job-name popper_sample_{config.wid} " f"--output /tmp/popper/slurm/popper_sample_{config.wid}.out " f"/tmp/popper/slurm/popper_sample_{config.wid}.sh", returncode=0, ) self.Popen.set_command( f"tail -f /tmp/popper/slurm/popper_sample_{config.wid}.out", returncode=0 ) step = Box({"id": "sample"}, default_box=True) with SlurmRunner(config=config) as sr: sr._submit_batch_job(["ls -la"], step) with open(f"/tmp/popper/slurm/popper_sample_{config.wid}.sh", "r") as f: content = f.read() self.assertEqual(content, "#!/bin/bash\nls -la") self.assertEqual(len(sr._spawned_jobs), 0) self.assertEqual(sr._out_stream_thread.is_alive(), False) call_tail = call.Popen( ["tail", "-f", f"/tmp/popper/slurm/popper_sample_{config.wid}.out"], cwd=os.getcwd(), env=None, preexec_fn=os.setsid, stderr=-2, stdout=-1, universal_newlines=True, ) call_sbatch = call.Popen( [ "sbatch", "--wait", "--job-name", f"popper_sample_{config.wid}", "--output", f"/tmp/popper/slurm/popper_sample_{config.wid}.out", f"/tmp/popper/slurm/popper_sample_{config.wid}.sh", ], cwd=os.getcwd(), env=None, preexec_fn=os.setsid, stderr=-2, stdout=-1, universal_newlines=True, ) self.assertEqual(call_tail in self.Popen.all_calls, True) self.assertEqual(call_sbatch in self.Popen.all_calls, True) @replace("popper.runner_slurm.os.kill", mock_kill) def test_submit_job_failure(self, mock_kill): config_dict = { "engine": {"name": "docker", "options": {}}, "resource_manager": {"name": "slurm", "options": {}}, } config = ConfigLoader.load(workspace_dir="/w", config_file=config_dict) self.Popen.set_command( f"sbatch --wait --job-name popper_1_{config.wid} " f"--output /tmp/popper/slurm/popper_1_{config.wid}.out " f"/tmp/popper/slurm/popper_1_{config.wid}.sh", returncode=12, ) self.Popen.set_command( f"tail -f /tmp/popper/slurm/popper_1_{config.wid}.out", returncode=0 ) with WorkflowRunner(config) as r: wf_data = { "steps": [ { "uses": "popperized/bin/sh@master", "runs": ["cat"], "args": ["README.md"], } ] } self.assertRaises(SystemExit, r.run, WorkflowParser.parse(wf_data=wf_data)) call_tail = call.Popen( ["tail", "-f", f"/tmp/popper/slurm/popper_1_{config.wid}.out"], cwd=os.getcwd(), env=None, preexec_fn=os.setsid, stderr=-2, stdout=-1, universal_newlines=True, ) call_sbatch = call.Popen( [ "sbatch", "--wait", "--job-name", f"popper_1_{config.wid}", "--output", f"/tmp/popper/slurm/popper_1_{config.wid}.out", f"/tmp/popper/slurm/popper_1_{config.wid}.sh", ], cwd=os.getcwd(), env=None, preexec_fn=os.setsid, stderr=-2, stdout=-1, universal_newlines=True, ) self.assertEqual(call_tail in self.Popen.all_calls, True) self.assertEqual(call_sbatch in self.Popen.all_calls, True) def test_dry_run(self): config = ConfigLoader.load( engine_name="docker", resman_name="slurm", dry_run=True, ) with WorkflowRunner(config) as r: wf_data = { "steps": [ { "uses": "popperized/bin/sh@master", "runs": ["cat"], "args": ["README.md"], } ] } r.run(WorkflowParser.parse(wf_data=wf_data)) self.assertEqual(self.Popen.all_calls, []) class TestSlurmDockerRunner(unittest.TestCase): def setUp(self): log.setLevel("CRITICAL") self.Popen = MockPopen() replacer = Replacer() replacer.replace("popper.runner_host.Popen", self.Popen) self.addCleanup(replacer.restore) def tearDown(self): log.setLevel("NOTSET") def test_create_cmd(self): config = {"workspace_dir": "/w"} with DockerRunner(config=ConfigLoader.load(**config)) as drunner: step = Box({"args": ["-two", "-flags"]}, default_box=True) cmd = drunner._create_cmd(step, "foo:1.9", "container_name") expected = ( "docker create" " --name container_name" " --workdir /workspace" " -v /w:/workspace" " -v /var/run/docker.sock:/var/run/docker.sock" " foo:1.9 -two -flags" ) self.assertEqual(expected, cmd) config_dict = { "engine": { "name": "docker", "options": { "privileged": True, "hostname": "popper.local", "domainname": "www.example.org", "volumes": ["/path/in/host:/path/in/container"], "environment": {"FOO": "bar"}, }, }, "resource_manager": {"name": "slurm"}, } config = {"workspace_dir": "/w", "config_file": config_dict} with DockerRunner(config=ConfigLoader.load(**config)) as drunner: step = Box({"args": ["-two", "-flags"]}, default_box=True) cmd = drunner._create_cmd(step, "foo:1.9", "container_name") expected = ( "docker create --name container_name " "--workdir /workspace " "-v /w:/workspace " "-v /var/run/docker.sock:/var/run/docker.sock " "-v /path/in/host:/path/in/container " "-e FOO=bar --privileged --hostname popper.local " "--domainname www.example.org " "foo:1.9 -two -flags" ) self.assertEqual(expected, cmd) @replace("popper.runner_slurm.os.kill", mock_kill) def test_run(self, mock_kill): config_dict = { "engine": { "name": "docker", "options": { "privileged": True, "hostname": "popper.local", "domainname": "www.example.org", "volumes": ["/path/in/host:/path/in/container"], "environment": {"FOO": "bar"}, }, }, "resource_manager": {"name": "slurm"}, } config = ConfigLoader.load(workspace_dir="/w", config_file=config_dict) self.Popen.set_command( f"sbatch --wait --job-name popper_1_{config.wid} " f"--output /tmp/popper/slurm/popper_1_{config.wid}.out " f"/tmp/popper/slurm/popper_1_{config.wid}.sh", returncode=0, ) self.Popen.set_command( f"tail -f /tmp/popper/slurm/popper_1_{config.wid}.out", returncode=0 ) with WorkflowRunner(config) as r: wf_data = { "steps": [ { "uses": "popperized/bin/sh@master", "runs": ["cat"], "args": ["README.md"], } ] } r.run(WorkflowParser.parse(wf_data=wf_data)) with open(f"/tmp/popper/slurm/popper_1_{config.wid}.sh", "r") as f: # fmt: off expected = f"""#!/bin/bash docker rm -f popper_1_{config.wid} || true docker build -t popperized/bin:master {os.environ['HOME']}/.cache/popper/{config.wid}/github.com/popperized/bin/sh docker create --name popper_1_{config.wid} --workdir /workspace --entrypoint cat -v /w:/workspace -v /var/run/docker.sock:/var/run/docker.sock -v /path/in/host:/path/in/container -e FOO=bar --privileged --hostname popper.local --domainname www.example.org popperized/bin:master README.md docker start --attach popper_1_{config.wid}""" # fmt: on actual = f.read() self.maxDiff = None self.assertEqual(expected, actual) class TestSlurmSingularityRunner(unittest.TestCase): def setUp(self): self.Popen = MockPopen() replacer = Replacer() replacer.replace("popper.runner_host.Popen", self.Popen) self.addCleanup(replacer.restore) def tearDown(self): log.setLevel("NOTSET") def test_create_cmd(self): config = ConfigLoader.load(workspace_dir="/w") with SingularityRunner(config=config) as sr: step = Box({"args": ["-two", "-flags"]}, default_box=True) sr._setup_singularity_cache() sr._container = os.path.join(sr._singularity_cache, "c1.sif") cmd = sr._create_cmd(step, "c1.sif") expected = ( "singularity run" " --userns --pwd /workspace" " --bind /w:/workspace" f' {os.environ["HOME"]}/.cache/popper/singularity/{config.wid}/c1.sif' " -two -flags" ) self.assertEqual(expected, cmd) config_dict = { "engine": { "name": "singularity", "options": { "hostname": "popper.local", "ipc": True, "bind": ["/path/in/host:/path/in/container"], }, }, "resource_manager": {"name": "slurm"}, } config = ConfigLoader.load(workspace_dir="/w", config_file=config_dict) with SingularityRunner(config=config) as sr: step = Box({"args": ["-two", "-flags"]}, default_box=True) sr._setup_singularity_cache() sr._container = os.path.join(sr._singularity_cache, "c2.sif") cmd = sr._create_cmd(step, "c2.sif") # fmt: off expected = f"singularity run --userns --pwd /workspace --bind /w:/workspace --bind /path/in/host:/path/in/container --hostname popper.local --ipc {os.environ['HOME']}/.cache/popper/singularity/{config.wid}/c2.sif -two -flags" # fmt: on self.assertEqual(expected, cmd) @replace("popper.runner_slurm.os.kill", mock_kill) def test_slurm_singularity_run(self, mock_kill): config_dict = { "engine": { "name": "singularity", "options": { "hostname": "popper.local", "bind": ["/path/in/host:/path/in/container"], }, }, "resource_manager": {"name": "slurm"}, } config = ConfigLoader.load(workspace_dir="/w", config_file=config_dict) # fmt: off self.Popen.set_command( f"sbatch --wait --job-name popper_1_{config.wid} --output /tmp/popper/slurm/popper_1_{config.wid}.out /tmp/popper/slurm/popper_1_{config.wid}.sh", returncode=0, ) # fmt: on self.Popen.set_command( f"tail -f /tmp/popper/slurm/popper_1_{config.wid}.out", returncode=0 ) with WorkflowRunner(config) as r: wf_data = {"steps": [{"uses": "popperized/bin/sh@master", "args": ["ls"],}]} r.run(WorkflowParser.parse(wf_data=wf_data)) with open(f"/tmp/popper/slurm/popper_1_{config.wid}.sh", "r") as f: # fmt: off expected = f"""#!/bin/bash singularity run --userns --pwd /workspace --bind /w:/workspace --bind /path/in/host:/path/in/container --hostname popper.local {os.environ['HOME']}/.cache/popper/singularity/{config.wid}/popper_1_{config.wid}.sif ls""" # fmt: on actual = f.read() self.assertEqual(expected, actual)
36.089776
287
0.52377
1,539
14,472
4.777128
0.126706
0.042845
0.038901
0.047878
0.787133
0.764962
0.744559
0.743471
0.701306
0.650027
0
0.006465
0.337341
14,472
400
288
36.18
0.760167
0.00463
0
0.60241
0
0.01506
0.28362
0.147124
0
0
0
0
0.051205
1
0.048193
false
0
0.039157
0.003012
0.099398
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
0f693181fb5752447a3c08c3bd7693332134f9e4
55
py
Python
cycy/__main__.py
Magnetic/cycy
494282a37b5f7d1eaa17b8d01796df8302da2a81
[ "MIT" ]
26
2015-03-25T15:34:20.000Z
2019-03-22T09:26:30.000Z
cycy/__main__.py
DeloitteHux/cycy
494282a37b5f7d1eaa17b8d01796df8302da2a81
[ "MIT" ]
1
2017-05-21T14:00:08.000Z
2017-05-21T14:44:42.000Z
cycy/__main__.py
Magnetic/cycy
494282a37b5f7d1eaa17b8d01796df8302da2a81
[ "MIT" ]
4
2016-12-05T12:59:49.000Z
2018-11-02T05:59:43.000Z
import sys from cycy.target import main main(sys.argv)
13.75
28
0.8
10
55
4.4
0.7
0
0
0
0
0
0
0
0
0
0
0
0.127273
55
3
29
18.333333
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0f943657c9b39b0f6febd186c26d29592154fc9c
97
py
Python
Rest Django Framework/myproject/webapp/admin.py
PaulMarcelo/Python
66a9fa21d2d803f5b06d285c705812251dc6d234
[ "Apache-2.0" ]
null
null
null
Rest Django Framework/myproject/webapp/admin.py
PaulMarcelo/Python
66a9fa21d2d803f5b06d285c705812251dc6d234
[ "Apache-2.0" ]
null
null
null
Rest Django Framework/myproject/webapp/admin.py
PaulMarcelo/Python
66a9fa21d2d803f5b06d285c705812251dc6d234
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from . models import employees admin.site.register(employees)
16.166667
32
0.814433
13
97
6.076923
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.123711
97
5
33
19.4
0.929412
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
7e1f3993233edb8b38978703eeff6dbb7ca28b97
6,393
py
Python
src/reader.py
epogrebnyak/data-rosstat-boo-light
6b07f3e630fadbe18510e52c01797fd6c4e9aaa4
[ "MIT" ]
null
null
null
src/reader.py
epogrebnyak/data-rosstat-boo-light
6b07f3e630fadbe18510e52c01797fd6c4e9aaa4
[ "MIT" ]
null
null
null
src/reader.py
epogrebnyak/data-rosstat-boo-light
6b07f3e630fadbe18510e52c01797fd6c4e9aaa4
[ "MIT" ]
null
null
null
from itertools import islice from collections import OrderedDict import os import pandas as pd import settings import streams import row_parser from inspect_columns import Columns from logs import print_elapsed_time COLUMNS = Columns.COLUMNS VALID_ROW_WIDTH = len(COLUMNS) def _raw_rows(year): path = settings.url_local_path(year) return streams.yield_csv_rows(path) def has_valid_length(_row, n=VALID_ROW_WIDTH): return len(_row) == n def raw_rows(year): return filter(has_valid_length, _raw_rows(year)) def as_dict(row, columns=COLUMNS): return OrderedDict(zip(columns, row)) def _raw_dicts(year): return map(as_dict, _raw_rows(year)) def has_inn(_dict): return _dict['inn'] def raw_dicts(year): return filter(has_inn, _raw_dicts(year)) assert next(raw_rows(2012)) assert next(raw_dicts(2017)) class Dataset: dtypes = row_parser.DTYPES colnames = row_parser.COLNAMES def __init__(self, year: int): self.year = year # FIXME: this is untrivial - the function accepts a dict and produces a list def rows(self): gen = raw_dicts(self.year) return map(row_parser.parse_row_to_list, gen) def dicts(self): gen = raw_dicts(self.year) return map(row_parser.parse_row_to_dict, gen) # FIXME: make separate functions # @staticmethod # def nth(gen, n): # return next(islice(gen, n, n + 1)) # # def nth_row(self, n=0): # return self.nth(self.rows(), n) # # def nth_dict(self, n=0): # return self.nth(self.dicts(), n) @property def path(self): return settings.csv_path_processed(self.year) def to_csv(self): if not os.path.exists(self.path): print(f"{self.year}: Saving large file to", self.path) streams.rows_to_csv(path = self.path, stream = self.rows(), cols = self.colnames) else: print(f"{self.year}: File already exists:", self.path) @print_elapsed_time def read_dataframe(self): print("Reading {} dataframe...".format(self.year)) with open(self.path, 'r', encoding='utf-8') as f: return pd.read_csv(f, dtype=self.dtypes) #class Subset: # def __init__(self, year: int, inns: list): # self.dataset = Dataset(year) # self.inns = [str(x) for x in inns] # # def dicts(self): # for d in self.dataset.dicts(): # inn = str(d['inn']) # if inn in self.inns: # self.inns.remove(inn) # yield d # if not self.inns: # break # # def not_found(self): # return "\n".join(sorted(k.inns)) # # def to_csv(self, filename): # path = tempfile(filename) # if not os.path.exists(path): # dicts_to_csv(path = path, # dict_stream = self.dicts(), # column_names = self.dataset.colnames) # return path #if __name__ == "__main__": # # create model dataset # stream = list(islice(RawDataset(2012).rows(), 0, 500)) # path = tempfile('reference_dataset.txt') # to_csv(path, stream, cols=None) # # TODO: place at # # # #Subset(2015, 'test1').to_csv() # d = Dataset(2012) # a = next(Dataset(2016).dicts()) # z = next(RawDataset(2016).get_rows()) # import random # ix = [random.choice(range(100)) for _ in range(5)] # inns = [d.nth_dict(i)['inn'] for i in ix] # inns = ['2224102690', '2204026804', '2222057509', '2204026730', '2207007165'] # s = Subset(2012, inns) # #gen = s.dicts() # #print(list(gen)) # s.to_csv("sample5.csv") # # #df = Dataset(2016).read_dataframe() # #Dataset(2016).to_csv() # # FIXME: results in MemoryError # # doc = """6125021399 #6165111610 #5501092795 #3252005997 #2617013243 #0214005782 #6125028404 #7840322535 #2723127073 #7726311464 #6432005430 #2460222454 #2009002493 #2460205089 #7707049388 #7713591359 #4027083322 #7601000640 #7702347870 #1627005779 #6135006840 #2320102816 #5007035121 #7801499923 #2502039781 #2465102746 #7709756135 #7614005035 #2721162072 #7725027605 #7704753638 #2310119472 #7709758887 #6234028965 #6312034863 #7727541830 #2312153550 #7328063237 #1661028712 #7734046851 #4501122913 #7701897582 #1834051678 #4003034171 #2317044843 #7714175986 #7606053324 #7735128151 #7206025040 #6320002223 #2420002597 #1327000226 #6125022025 #3327823181 #1646021952 #1650161470 #4703038767 #7710884741 #7713730490 #1650206314 #2320153289 #2317010611 #5029140480 #7830002705 #2320126091 #6313036408 #2325014338 #4807013380 #7813173683 #6906011193 #4715019631 #2721167592 #5030062677 #7425756540 #2319037591 #7116145872 #5010032360 #6163082392 #1659032038 #7712094033 #5029006702 #2130001337 #7707327050 #7611020204 #7724791423 #7714005350 #1434045743 #7706273281 #7731084175 #4713008017 #6315376946 #7817312063 #7708624200 #7714046028 #6167081833 #4214018010 #3013015987 #0522016027 #2277011020 #7743816842 #7801435581 #7718532879 #5614023224 #1216015989 #7718226550 #7705620334 #7707131554 #4027077632 #5307006883 #2342016712 #7701513162 #5614054173 #2127007427 #3815011264 #2130009512 #6453010174 #2130181337 #6450079058 #7707296041 #8300005580 #7105514574 #5032172562 #0710005596 #2709001880 #3663075863 #5402480282 #3904612524 #6123015784 #7724674670 #7708320240 #4214000252 #5040066582 #6453076256 #3917016350 #7842012360 #5604009492 #7705514093 #6230004963 #5616009708 #7702334864 #5032124142 #5613001002 #3437006665 #5040058775 #2703000858 #2011002420 #7730589568 #3837049102 #5614018560 #1616016850 #6623029538 #7730052050 #7731644035 #7839395419 #7731644035 #6659190900 #2902060361 #7327016379 #7709413138 #7708710924 #7725638925 #7708304859 #7717163097 #7724736609 #7714619159 #5032178356 #7728278043 #3663029916 #7702326045 #7729355614 #7722787661 #9909391333 #9909391291 #9909391260 #7708201998 #9909001382 #9909378244 #9909439151 #9909012056""" # # inns = doc.split("\n") # k = Subset(2016, inns) # k.to_csv('179.csv') # # """Not finished: # # subsets as Excel files # manageable, smaller files # Expert 200 # #""" # # #
19.026786
82
0.656186
718
6,393
5.713092
0.470752
0.017552
0.010726
0.006826
0.063384
0.03608
0.03608
0.024866
0.024866
0.024866
0
0.386835
0.230095
6,393
335
83
19.083582
0.446566
0.604724
0
0.036364
0
0
0.043907
0
0
0
0
0.002985
0.036364
1
0.236364
false
0
0.163636
0.127273
0.654545
0.090909
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
7e3b5d9d272b6bcbd3ac425a5dfc3806c55d4ab9
65
py
Python
core/base/pydantic.py
cleiveliu/django-template
01c6d03a66fe869e7155f8189b5b79570f36ba44
[ "MIT" ]
null
null
null
core/base/pydantic.py
cleiveliu/django-template
01c6d03a66fe869e7155f8189b5b79570f36ba44
[ "MIT" ]
null
null
null
core/base/pydantic.py
cleiveliu/django-template
01c6d03a66fe869e7155f8189b5b79570f36ba44
[ "MIT" ]
null
null
null
from pydantic import BaseModel, ValidationError, EmailStr, Field
32.5
64
0.846154
7
65
7.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.107692
65
1
65
65
0.948276
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
7e4f35e358bde7ea8bb926ca03727c4ce868d8c8
131
py
Python
codewof/programming/content/en/string-concatenation/solution.py
taskmaker1/codewof
92d52cd3ee91f0f311ff01a92cf6ec07e5593b8d
[ "MIT" ]
3
2019-08-29T04:11:22.000Z
2021-06-22T16:05:51.000Z
codewof/programming/content/en/string-concatenation/solution.py
taskmaker1/codewof
92d52cd3ee91f0f311ff01a92cf6ec07e5593b8d
[ "MIT" ]
265
2019-05-30T03:51:46.000Z
2022-03-31T01:05:12.000Z
codewof/programming/content/en/string-concatenation/solution.py
samuelsandri/codewof
c9b8b378c06b15a0c42ae863b8f46581de04fdfc
[ "MIT" ]
7
2019-06-29T12:13:37.000Z
2021-09-06T06:49:14.000Z
string_1 = input("String 1? ") string_2 = input("String 2? ") string_3 = input("String 3? ") print(string_1 + string_2 + string_3)
26.2
37
0.679389
22
131
3.772727
0.272727
0.253012
0.313253
0.337349
0
0
0
0
0
0
0
0.081081
0.152672
131
4
38
32.75
0.666667
0
0
0
0
0
0.229008
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
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
7e6ec91a7e0cd9768d10af045025dc822a62b0f1
192
py
Python
primeira_lista/ex002.py
PedroSantana2/exercicios-em-python
e0a98e699ba49873f67438fd9092dc3ab0ca719c
[ "MIT" ]
1
2021-03-16T03:58:39.000Z
2021-03-16T03:58:39.000Z
primeira_lista/ex002.py
PedroSantana2/exercicios-em-python
e0a98e699ba49873f67438fd9092dc3ab0ca719c
[ "MIT" ]
null
null
null
primeira_lista/ex002.py
PedroSantana2/exercicios-em-python
e0a98e699ba49873f67438fd9092dc3ab0ca719c
[ "MIT" ]
null
null
null
''' Faça um Programa que peça um número e então mostre a mensagem: O número informado foi [número]. ''' numero = input('Digite um número: ') print('O número informado foi: {}'.format(numero))
32
95
0.708333
29
192
4.689655
0.655172
0.117647
0.235294
0.279412
0
0
0
0
0
0
0
0
0.15625
192
5
96
38.4
0.839506
0.494792
0
0
0
0
0.494382
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
7e8e70033287aa44e9302ffd4212483e44b7d6d1
1,242
py
Python
coderdojochi/migrations/0019_auto_20180815_1658.py
rgroves/weallcode-website
ead60d3272dbbfe610b2d500978d1de44aef6386
[ "MIT" ]
15
2019-05-04T00:24:00.000Z
2021-08-21T16:34:05.000Z
coderdojochi/migrations/0019_auto_20180815_1658.py
rgroves/weallcode-website
ead60d3272dbbfe610b2d500978d1de44aef6386
[ "MIT" ]
73
2019-04-24T15:53:42.000Z
2021-08-06T20:41:41.000Z
coderdojochi/migrations/0019_auto_20180815_1658.py
rgroves/weallcode-website
ead60d3272dbbfe610b2d500978d1de44aef6386
[ "MIT" ]
20
2019-04-26T20:13:08.000Z
2021-06-21T14:53:21.000Z
# Generated by Django 2.0.6 on 2018-08-15 21:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coderdojochi', '0018_auto_20180606_0838'), ] operations = [ migrations.AddField( model_name='guardian', name='birthday', field=models.DateTimeField(null=True), ), migrations.AddField( model_name='guardian', name='gender', field=models.CharField(max_length=255, null=True), ), migrations.AddField( model_name='guardian', name='race_ethnicity', field=models.ManyToManyField(to='coderdojochi.RaceEthnicity'), ), migrations.AddField( model_name='mentor', name='birthday', field=models.DateTimeField(null=True), ), migrations.AddField( model_name='mentor', name='gender', field=models.CharField(max_length=255, null=True), ), migrations.AddField( model_name='mentor', name='race_ethnicity', field=models.ManyToManyField(to='coderdojochi.RaceEthnicity'), ), ]
28.227273
74
0.563607
111
1,242
6.189189
0.414414
0.157205
0.200873
0.235808
0.774381
0.774381
0.6754
0.6754
0.634643
0.430859
0
0.043839
0.320451
1,242
43
75
28.883721
0.770142
0.036232
0
0.810811
1
0
0.154812
0.062762
0
0
0
0
0
1
0
false
0
0.027027
0
0.108108
0
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0e733b7632db76bc324daa1d1bcc7ba5d8556c2b
37
py
Python
tests/__init__.py
sizumita/dpybrew
bdf9e42f238ef16229d1ae05aa213ffb3a32b3af
[ "MIT" ]
1
2020-06-20T14:49:39.000Z
2020-06-20T14:49:39.000Z
tests/__init__.py
sizumita/dpybrew
bdf9e42f238ef16229d1ae05aa213ffb3a32b3af
[ "MIT" ]
3
2020-03-29T12:57:06.000Z
2020-03-30T13:40:00.000Z
tests/__init__.py
sizumita/dpybrew
bdf9e42f238ef16229d1ae05aa213ffb3a32b3af
[ "MIT" ]
1
2020-03-30T09:42:59.000Z
2020-03-30T09:42:59.000Z
"""Unit test package for dpybrew."""
18.5
36
0.675676
5
37
5
1
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
1
37
37
0.78125
0.810811
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
0e788c71030fd04ef2f56a23799722c9816c5d1f
120
py
Python
hght/__init__.py
zephenryus/botw-hght
48f7a933c183b55a4ee0852594281aaab1ad16c1
[ "MIT" ]
null
null
null
hght/__init__.py
zephenryus/botw-hght
48f7a933c183b55a4ee0852594281aaab1ad16c1
[ "MIT" ]
null
null
null
hght/__init__.py
zephenryus/botw-hght
48f7a933c183b55a4ee0852594281aaab1ad16c1
[ "MIT" ]
null
null
null
from .read_hght import read_hght from .write_hght import write_hght, compile_hght from .generate_map import generate_map
40
48
0.866667
20
120
4.85
0.4
0.164948
0
0
0
0
0
0
0
0
0
0
0.1
120
3
49
40
0.898148
0
0
0
1
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
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0e835dded92b27c09fa90189998b2e3d72cbbdaf
32
py
Python
Beta/Return Even Whatever Youve Been Given.py
mwk0408/codewars_solutions
9b4f502b5f159e68024d494e19a96a226acad5e5
[ "MIT" ]
6
2020-09-03T09:32:25.000Z
2020-12-07T04:10:01.000Z
Beta/Return Even Whatever Youve Been Given.py
mwk0408/codewars_solutions
9b4f502b5f159e68024d494e19a96a226acad5e5
[ "MIT" ]
1
2021-12-13T15:30:21.000Z
2021-12-13T15:30:21.000Z
Beta/Return Even Whatever Youve Been Given.py
mwk0408/codewars_solutions
9b4f502b5f159e68024d494e19a96a226acad5e5
[ "MIT" ]
null
null
null
def always_even(n): return n-n%2
32
32
0.75
8
32
2.875
0.75
0
0
0
0
0
0
0
0
0
0
0.034483
0.09375
32
1
32
32
0.758621
0
0
0
0
0
0
0
0
0
0
0
0
1
1
false
0
0
1
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
1
0
0
0
1
0
0
0
5
7d37344389f31e522356ccc53dea0e08b94ec7b4
530
py
Python
AI/home/views.py
Phong940253/math-word-problem
e8410944c9d2aafce949811025e8f164fee6c74c
[ "MIT" ]
1
2021-05-12T19:29:04.000Z
2021-05-12T19:29:04.000Z
AI/home/views.py
Phong940253/math-word-problem
e8410944c9d2aafce949811025e8f164fee6c74c
[ "MIT" ]
null
null
null
AI/home/views.py
Phong940253/math-word-problem
e8410944c9d2aafce949811025e8f164fee6c74c
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.http import HttpResponse from .EngineCKB import Engine def home(request): return render(request, 'page/page.html') def thread(request): return render(request, 'page/thread.html') def about(request): return render(request, 'page/aboutus.html') def result(request): if request.method == 'POST': test = request.POST["search"] engine = Engine(test) print(engine.res) return render(request, 'page/result.html', {'engine': engine.res})
22.083333
70
0.688679
67
530
5.447761
0.38806
0.131507
0.208219
0.252055
0.246575
0
0
0
0
0
0
0
0.183019
530
23
71
23.043478
0.842956
0
0
0
0
0
0.149057
0
0
0
0
0
0
1
0.266667
false
0
0.2
0.2
0.733333
0.066667
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
7d42cb74709f216bc7143ceae9c2e943b2e06644
265
py
Python
deepext_with_lightning/models/classification/__init__.py
pei223/deepext_with_lightning
e40ac19844a05864f803431d8ef4a534286a0950
[ "MIT" ]
1
2021-02-25T14:30:08.000Z
2021-02-25T14:30:08.000Z
deepext_with_lightning/models/classification/__init__.py
pei223/deepext_with_lightning
e40ac19844a05864f803431d8ef4a534286a0950
[ "MIT" ]
null
null
null
deepext_with_lightning/models/classification/__init__.py
pei223/deepext_with_lightning
e40ac19844a05864f803431d8ef4a534286a0950
[ "MIT" ]
null
null
null
from .mobilenet_v3.mobilenet_v3 import MobileNetV3 from .efficientnet.efficientnet import EfficientNet from .abn.attention_branch_network import AttentionBranchNetwork from .customnet.custom_classification import CustomClassificationNetwork from . import functions
44.166667
72
0.890566
28
265
8.25
0.571429
0.095238
0
0
0
0
0
0
0
0
0
0.012245
0.075472
265
5
73
53
0.930612
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
7d492fc930eb7f9403cd953775800f86d6c58f1c
117
py
Python
setup.py
kreneskyp/ixian
80133e9106e23eeb562c0112dd70bcdfb61986f9
[ "Apache-2.0" ]
null
null
null
setup.py
kreneskyp/ixian
80133e9106e23eeb562c0112dd70bcdfb61986f9
[ "Apache-2.0" ]
null
null
null
setup.py
kreneskyp/ixian
80133e9106e23eeb562c0112dd70bcdfb61986f9
[ "Apache-2.0" ]
null
null
null
from setuptools import setup setup(setup_requires=["pbr"], pbr=True, long_description_content_type="text/markdown")
29.25
86
0.811966
16
117
5.6875
0.8125
0.21978
0
0
0
0
0
0
0
0
0
0
0.068376
117
3
87
39
0.834862
0
0
0
0
0
0.136752
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
adb3fcf64508ba7e71978a1988d1dc68df75c64c
38
py
Python
regex_builder/errors.py
Zomatree/regex-builder
a83377dd50ba9557126a8d0a6d5a987df4fccad3
[ "MIT" ]
3
2020-07-27T10:15:02.000Z
2021-01-13T00:12:40.000Z
regex_builder/errors.py
Zomatree/regex-builder
a83377dd50ba9557126a8d0a6d5a987df4fccad3
[ "MIT" ]
null
null
null
regex_builder/errors.py
Zomatree/regex-builder
a83377dd50ba9557126a8d0a6d5a987df4fccad3
[ "MIT" ]
1
2021-01-13T00:13:49.000Z
2021-01-13T00:13:49.000Z
class NotSection(Exception): pass
12.666667
28
0.736842
4
38
7
1
0
0
0
0
0
0
0
0
0
0
0
0.184211
38
2
29
19
0.903226
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
adb413dc26c8d62d378d338a8568409207560a51
193
py
Python
models/amenity.py
kemboy-254/AirBnB_clone
45bfb47cd8a47a7db85f0cfc266b09e88e8fbad7
[ "MIT" ]
null
null
null
models/amenity.py
kemboy-254/AirBnB_clone
45bfb47cd8a47a7db85f0cfc266b09e88e8fbad7
[ "MIT" ]
2
2020-07-01T17:02:43.000Z
2020-07-12T19:57:08.000Z
models/amenity.py
kemboy-254/AirBnB_clone
45bfb47cd8a47a7db85f0cfc266b09e88e8fbad7
[ "MIT" ]
4
2020-07-07T15:17:00.000Z
2021-11-11T12:15:00.000Z
#!/usr/bin/python3 """New class inherit from BaseModel""" from models.base_model import BaseModel class Amenity(BaseModel): """Class Amenity that inherit from BaseModel""" name = ""
19.3
51
0.709845
24
193
5.666667
0.625
0.161765
0.294118
0
0
0
0
0
0
0
0
0.006211
0.165803
193
9
52
21.444444
0.838509
0.476684
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
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
adbbb936de507ba25fabc7e08662900411a58564
47
py
Python
specter/__main__.py
breekristensen/Specter
1f5a729b0aa16242add8c1c754efa268335e3944
[ "MIT" ]
18
2015-03-19T17:01:31.000Z
2020-01-03T18:30:09.000Z
specter/__main__.py
breekristensen/Specter
1f5a729b0aa16242add8c1c754efa268335e3944
[ "MIT" ]
52
2015-01-19T05:10:59.000Z
2020-04-16T17:41:19.000Z
specter/__main__.py
breekristensen/Specter
1f5a729b0aa16242add8c1c754efa268335e3944
[ "MIT" ]
11
2015-07-14T16:23:07.000Z
2021-09-09T20:59:24.000Z
from specter.runner import activate activate()
15.666667
35
0.829787
6
47
6.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.106383
47
2
36
23.5
0.928571
0
0
0
0
0
0
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
bc114fccbc460740d090660db9f5c058ab088e00
177
py
Python
backend/entities/i_serializable.py
GroupLe/grouple-face-tagger
5fd87c074dc50a5fc341e9f30774094a1616a87f
[ "MIT" ]
null
null
null
backend/entities/i_serializable.py
GroupLe/grouple-face-tagger
5fd87c074dc50a5fc341e9f30774094a1616a87f
[ "MIT" ]
19
2021-07-22T11:18:17.000Z
2021-08-20T10:12:17.000Z
backend/entities/i_serializable.py
GroupLe/grouple-face-tagger
5fd87c074dc50a5fc341e9f30774094a1616a87f
[ "MIT" ]
1
2021-07-29T11:56:03.000Z
2021-07-29T11:56:03.000Z
from typing import Dict class ISerializable: def __init__(self, *args, **kwargs): raise NotImplemented def to_json(self) -> Dict: raise NotImplemented
19.666667
40
0.672316
20
177
5.7
0.75
0.333333
0
0
0
0
0
0
0
0
0
0
0.248588
177
9
41
19.666667
0.857143
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
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
1
0
0
0
0
1
0
0
5
bc1f200d52558487f8dc500d0e5294712a331bd6
50
py
Python
my_app/__main__.py
fschuch/fastapi_project
7897a83fe6e802cbcb0e2f3757aa008989c07bcb
[ "MIT" ]
null
null
null
my_app/__main__.py
fschuch/fastapi_project
7897a83fe6e802cbcb0e2f3757aa008989c07bcb
[ "MIT" ]
null
null
null
my_app/__main__.py
fschuch/fastapi_project
7897a83fe6e802cbcb0e2f3757aa008989c07bcb
[ "MIT" ]
null
null
null
import uvicorn from . import app uvicorn.run(app)
12.5
17
0.78
8
50
4.875
0.625
0
0
0
0
0
0
0
0
0
0
0
0.14
50
4
18
12.5
0.906977
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
70bc2f94c57e57184fba73ddd7b2039bcd304441
107
py
Python
settings.py
jwross24/twitoff
6d89c361ae9235f606b224deef22b1a5d27a0117
[ "MIT" ]
null
null
null
settings.py
jwross24/twitoff
6d89c361ae9235f606b224deef22b1a5d27a0117
[ "MIT" ]
3
2021-09-08T01:44:01.000Z
2022-03-12T00:18:17.000Z
settings.py
jwross24/twitoff
6d89c361ae9235f606b224deef22b1a5d27a0117
[ "MIT" ]
1
2021-05-08T07:02:06.000Z
2021-05-08T07:02:06.000Z
"""Allow the application to see the environment variables.""" from dotenv import load_dotenv load_dotenv()
26.75
61
0.794393
15
107
5.533333
0.733333
0.240964
0
0
0
0
0
0
0
0
0
0
0.121495
107
3
62
35.666667
0.882979
0.514019
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
cb3bb3477d42809580b10cbc396a6f56151088aa
135
py
Python
pynetlinux/util.py
youviewtv/pynetlinux
e3f16978855c6649685f0c43d4c3fcf768427ae5
[ "BSD-3-Clause" ]
69
2015-01-07T01:34:41.000Z
2022-03-29T01:40:59.000Z
pynetlinux/util.py
youviewtv/pynetlinux
e3f16978855c6649685f0c43d4c3fcf768427ae5
[ "BSD-3-Clause" ]
5
2015-03-18T03:19:56.000Z
2021-03-02T23:54:07.000Z
pynetlinux/util.py
youviewtv/pynetlinux
e3f16978855c6649685f0c43d4c3fcf768427ae5
[ "BSD-3-Clause" ]
37
2015-01-25T21:13:05.000Z
2022-03-10T06:41:26.000Z
import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: binary_type = bytes else: binary_type = str
13.5
30
0.651852
23
135
3.652174
0.652174
0.238095
0.333333
0.357143
0
0
0
0
0
0
0
0.067308
0.22963
135
9
31
15
0.740385
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
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
cb666be8979f576507aedd5b90ecaf5dcdbc0fc6
306
py
Python
main.py
Eli-pixel/Etext
b30413867c4d67f6ece441c4654bcc94c4f4588e
[ "MIT" ]
1
2020-06-01T14:31:50.000Z
2020-06-01T14:31:50.000Z
main.py
Eli-pixel/Etext
b30413867c4d67f6ece441c4654bcc94c4f4588e
[ "MIT" ]
null
null
null
main.py
Eli-pixel/Etext
b30413867c4d67f6ece441c4654bcc94c4f4588e
[ "MIT" ]
null
null
null
from ecolor import slow_color, slow_print, ecolor ecolor("This is red text", "red") ecolor("This is bold blue text", "bold_blue") slow_print("This is slow_print", 0.025) slow_color("This is slow_print but colorful", "blue", 0.025) slow_color("This is slow_print but colorful and bold", "bold_blue", 0.025)
43.714286
74
0.748366
55
306
3.981818
0.309091
0.205479
0.136986
0.205479
0.356164
0.356164
0.356164
0.356164
0.356164
0.356164
0
0.04461
0.120915
306
6
75
51
0.769517
0
0
0
0
0
0.496732
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
0.666667
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
cb9b503e3afe08ac14f1874cd147712dba6dd8a0
12,692
py
Python
hostmanager/tomato/migrations/0006_users3.py
dswd/ToMaTo
355fd3a8c7f95dc72c62383b3edfa8f6c0396bf4
[ "BSD-4-Clause-UC" ]
2
2016-11-10T06:12:05.000Z
2016-11-10T06:12:10.000Z
hostmanager/tomato/migrations/0006_users3.py
dswd/ToMaTo
355fd3a8c7f95dc72c62383b3edfa8f6c0396bf4
[ "BSD-4-Clause-UC" ]
2
2015-01-19T16:00:24.000Z
2015-01-20T11:33:56.000Z
hostmanager/tomato/migrations/0006_users3.py
dswd/ToMaTo
355fd3a8c7f95dc72c62383b3edfa8f6c0396bf4
[ "BSD-4-Clause-UC" ]
1
2016-11-10T06:12:15.000Z
2016-11-10T06:12:15.000Z
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Network', fields ['bridge'] db.delete_unique('tomato_network', ['bridge']) # Changing field 'Network.owner' db.alter_column('tomato_network', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tomato.User'])) # Adding unique constraint on 'Network', fields ['owner', 'bridge'] db.create_unique('tomato_network', ['owner_id', 'bridge']) # Deleting field 'Element.owner_str' db.delete_column('tomato_element', 'owner_str') # Changing field 'Element.owner' db.alter_column('tomato_element', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tomato.User'])) # Deleting field 'Connection.owner_str' db.delete_column('tomato_connection', 'owner_str') # Changing field 'Connection.owner' db.alter_column('tomato_connection', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tomato.User'])) # Changing field 'Template.owner' db.alter_column('tomato_template', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tomato.User'])) # Adding unique constraint on 'Template', fields ['owner', 'tech', 'name'] db.create_unique('tomato_template', ['owner_id', 'tech', 'name']) def backwards(self, orm): # Removing unique constraint on 'Template', fields ['owner', 'tech', 'name'] db.delete_unique('tomato_template', ['owner_id', 'tech', 'name']) # Removing unique constraint on 'Network', fields ['owner', 'bridge'] db.delete_unique('tomato_network', ['owner_id', 'bridge']) # Changing field 'Network.owner' db.alter_column('tomato_network', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(null=False, to=orm['tomato.User'])) # Adding unique constraint on 'Network', fields ['bridge'] db.create_unique('tomato_network', ['bridge']) # User chose to not deal with backwards NULL issues for 'Element.owner_str' raise RuntimeError("Cannot reverse this migration. 'Element.owner_str' and its values cannot be restored.") # Changing field 'Element.owner' db.alter_column('tomato_element', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(null=False, to=orm['tomato.User'])) # User chose to not deal with backwards NULL issues for 'Connection.owner_str' raise RuntimeError("Cannot reverse this migration. 'Connection.owner_str' and its values cannot be restored.") # Changing field 'Connection.owner' db.alter_column('tomato_connection', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(null=False, to=orm['tomato.User'])) # Changing field 'Template.owner' db.alter_column('tomato_template', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(null=False, to=orm['tomato.User'])) models = { 'tomato.bridge': { 'Meta': {'object_name': 'Bridge', '_ormbases': ['tomato.Connection']}, 'connection_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Connection']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.connection': { 'Meta': {'object_name': 'Connection'}, 'attrs': ('tomato.lib.db.JSONField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'connections'", 'to': "orm['tomato.User']"}), 'state': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'usageStatistics': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'connection'", 'unique': 'True', 'null': 'True', 'to': "orm['tomato.UsageStatistics']"}) }, 'tomato.element': { 'Meta': {'object_name': 'Element'}, 'attrs': ('tomato.lib.db.JSONField', [], {}), 'connection': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'elements'", 'null': 'True', 'to': "orm['tomato.Connection']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'elements'", 'to': "orm['tomato.User']"}), 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'null': 'True', 'to': "orm['tomato.Element']"}), 'state': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'timeout': ('django.db.models.fields.FloatField', [], {}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'usageStatistics': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'element'", 'unique': 'True', 'null': 'True', 'to': "orm['tomato.UsageStatistics']"}) }, 'tomato.external_network': { 'Meta': {'object_name': 'External_Network', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}), 'network': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'instances'", 'null': 'True', 'to': "orm['tomato.Network']"}) }, 'tomato.fixed_bridge': { 'Meta': {'object_name': 'Fixed_Bridge', '_ormbases': ['tomato.Connection']}, 'connection_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Connection']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.kvmqm': { 'Meta': {'object_name': 'KVMQM', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}), 'template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tomato.Template']", 'null': 'True'}) }, 'tomato.kvmqm_interface': { 'Meta': {'object_name': 'KVMQM_Interface', 'db_table': "'tomato_kvm_interface'", '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.network': { 'Meta': {'unique_together': "(('bridge', 'owner'),)", 'object_name': 'Network', '_ormbases': ['tomato.Resource']}, 'bridge': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'kind': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'networks'", 'to': "orm['tomato.User']"}), 'preference': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'resource_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Resource']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.openvz': { 'Meta': {'object_name': 'OpenVZ', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}), 'template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tomato.Template']", 'null': 'True'}) }, 'tomato.openvz_interface': { 'Meta': {'object_name': 'OpenVZ_Interface', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.repy': { 'Meta': {'object_name': 'Repy', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}), 'template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tomato.Template']", 'null': 'True'}) }, 'tomato.repy_interface': { 'Meta': {'object_name': 'Repy_Interface', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.resource': { 'Meta': {'object_name': 'Resource'}, 'attrs': ('tomato.lib.db.JSONField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '20'}) }, 'tomato.resourceinstance': { 'Meta': {'unique_together': "(('num', 'type'),)", 'object_name': 'ResourceInstance'}, 'attrs': ('tomato.lib.db.JSONField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'num': ('django.db.models.fields.IntegerField', [], {}), 'ownerConnection': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tomato.Connection']", 'null': 'True'}), 'ownerElement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['tomato.Element']", 'null': 'True'}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '20'}) }, 'tomato.template': { 'Meta': {'unique_together': "(('tech', 'name', 'owner'),)", 'object_name': 'Template', '_ormbases': ['tomato.Resource']}, 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'templates'", 'to': "orm['tomato.User']"}), 'preference': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'resource_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Resource']", 'unique': 'True', 'primary_key': 'True'}), 'tech': ('django.db.models.fields.CharField', [], {'max_length': '20'}) }, 'tomato.tinc': { 'Meta': {'object_name': 'Tinc', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.udp_tunnel': { 'Meta': {'object_name': 'UDP_Tunnel', '_ormbases': ['tomato.Element']}, 'element_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['tomato.Element']", 'unique': 'True', 'primary_key': 'True'}) }, 'tomato.usagerecord': { 'Meta': {'object_name': 'UsageRecord'}, 'begin': ('django.db.models.fields.FloatField', [], {}), 'cputime': ('django.db.models.fields.FloatField', [], {}), 'diskspace': ('django.db.models.fields.FloatField', [], {}), 'end': ('django.db.models.fields.FloatField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'measurements': ('django.db.models.fields.IntegerField', [], {}), 'memory': ('django.db.models.fields.FloatField', [], {}), 'statistics': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'records'", 'to': "orm['tomato.UsageStatistics']"}), 'traffic': ('django.db.models.fields.FloatField', [], {}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '10'}) }, 'tomato.usagestatistics': { 'Meta': {'object_name': 'UsageStatistics'}, 'attrs': ('tomato.lib.db.JSONField', [], {}), 'begin': ('django.db.models.fields.FloatField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) }, 'tomato.user': { 'Meta': {'object_name': 'User'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}) } } complete_apps = ['tomato']
65.087179
191
0.581153
1,304
12,692
5.534509
0.099693
0.075378
0.129971
0.185673
0.803935
0.767771
0.726618
0.710406
0.662879
0.591243
0
0.002733
0.19272
12,692
195
192
65.087179
0.70164
0.070832
0
0.230263
0
0
0.569815
0.291999
0
0
0
0
0
1
0.013158
false
0
0.026316
0
0.059211
0
0
0
0
null
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
cbb33ca1055aecac56a595340359148d7cd30307
163
py
Python
run.py
gaolycn/ssr-panel-sanic
73739710dbd6206d8febbf57e02eebc6b3082095
[ "MIT" ]
9
2017-07-11T08:36:48.000Z
2021-03-24T02:34:53.000Z
run.py
gaolycn/ssr-panel-sanic
73739710dbd6206d8febbf57e02eebc6b3082095
[ "MIT" ]
null
null
null
run.py
gaolycn/ssr-panel-sanic
73739710dbd6206d8febbf57e02eebc6b3082095
[ "MIT" ]
7
2017-07-11T08:36:51.000Z
2018-04-27T00:59:19.000Z
from ssr_panel import app if __name__ == '__main__': app.run(host=app.config.HOST, port=app.config.PORT, workers=app.config.WORKERS, debug=app.config.DEBUG)
27.166667
107
0.748466
26
163
4.346154
0.538462
0.318584
0
0
0
0
0
0
0
0
0
0
0.110429
163
5
108
32.6
0.77931
0
0
0
0
0
0.04908
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
cbc7a2a51f62b1b9e80be750bdddaab95b56a85c
6,044
py
Python
python/oneflow/test/modules/test_add.py
Zhangchangh/oneflow
4ea3935458cc83dcea0abd88dd613f09c57dc01a
[ "Apache-2.0" ]
null
null
null
python/oneflow/test/modules/test_add.py
Zhangchangh/oneflow
4ea3935458cc83dcea0abd88dd613f09c57dc01a
[ "Apache-2.0" ]
null
null
null
python/oneflow/test/modules/test_add.py
Zhangchangh/oneflow
4ea3935458cc83dcea0abd88dd613f09c57dc01a
[ "Apache-2.0" ]
null
null
null
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import unittest from collections import OrderedDict import numpy as np from test_util import GenArgList import oneflow as flow import oneflow.unittest def _test_add_forward(test_case, shape, device): x = flow.Tensor(np.random.randn(*shape), device=flow.device(device)) y = flow.Tensor(np.random.randn(*shape), device=flow.device(device)) of_out = flow.add(x, y) np_out = np.add(x.numpy(), y.numpy()) test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 0.0001, 0.0001)) x = 5 y = flow.Tensor(np.random.randn(*shape), device=flow.device(device)) of_out = flow.add(x, y) np_out = np.add(x, y.numpy()) test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 0.0001, 0.0001)) x = flow.Tensor(np.random.randn(*shape), device=flow.device(device)) y = 5 of_out = flow.add(x, y) np_out = np.add(x.numpy(), y) test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 0.0001, 0.0001)) x = flow.Tensor(np.random.randn(*shape), device=flow.device(device)) y = flow.Tensor(np.array([5.0]), device=flow.device(device)) of_out = flow.add(x, y) np_out = np.add(x.numpy(), y.numpy()) test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 0.0001, 0.0001)) x = flow.Tensor(np.random.randn(1, 1), device=flow.device(device)) y = flow.Tensor(np.random.randn(*shape), device=flow.device(device)) of_out = flow.add(x, y) np_out = np.add(x.numpy(), y.numpy()) test_case.assertTrue(np.allclose(of_out.numpy(), np_out, 0.0001, 0.0001)) def _test_add_backward(test_case, shape, device): x = 5 y = flow.Tensor( np.random.randn(*shape), requires_grad=True, device=flow.device(device) ) of_out = flow.add(x, y).sum() of_out.backward() test_case.assertTrue( np.allclose(y.grad.numpy(), np.ones(shape=shape), 0.0001, 0.0001) ) def _test_inplace_add(test_case, shape, device): np_x = np.random.randn(*shape) of_x = flow.Tensor( np_x, dtype=flow.float32, device=flow.device(device), requires_grad=True ) of_x_inplace = of_x + 1 id_old = id(of_x_inplace) of_x_inplace.add_(5) test_case.assertEqual(id_old, id(of_x_inplace)) np_out = np_x + 1 + 5 test_case.assertTrue(np.allclose(of_x_inplace.numpy(), np_out, 1e-05, 1e-05)) of_x_inplace = of_x_inplace.sum() of_x_inplace.backward() test_case.assertTrue(np.allclose(of_x.grad.numpy(), np.ones(shape), 1e-05, 1e-05)) of_x = flow.Tensor( np_x, dtype=flow.float32, device=flow.device(device), requires_grad=True ) of_y = flow.Tensor( np.random.randn(*shape), device=flow.device(device), requires_grad=False ) of_x_inplace = of_x + 1 id_old = id(of_x_inplace) of_x_inplace.add_(of_y) test_case.assertEqual(id_old, id(of_x_inplace)) np_out = np_x + 1 + of_y.numpy() test_case.assertTrue(np.allclose(of_x_inplace.numpy(), np_out, 1e-05, 1e-05)) of_x_inplace = of_x_inplace.sum() of_x_inplace.backward() test_case.assertTrue(np.allclose(of_x.grad.numpy(), np.ones(shape), 1e-05, 1e-05)) of_x = flow.Tensor( np_x, dtype=flow.float32, device=flow.device(device), requires_grad=True ) of_y = flow.Tensor( np.random.randn(*shape), device=flow.device(device), requires_grad=False ) of_x_inplace = of_x + 1 id_old = id(of_x_inplace) of_x_inplace += of_y test_case.assertEqual(id_old, id(of_x_inplace)) np_out = np_x + 1 + of_y.numpy() test_case.assertTrue(np.allclose(of_x_inplace.numpy(), np_out, 1e-05, 1e-05)) of_x_inplace = of_x_inplace.sum() of_x_inplace.backward() test_case.assertTrue(np.allclose(of_x.grad.numpy(), np.ones(shape), 1e-05, 1e-05)) of_x = flow.Tensor( np_x, dtype=flow.float32, device=flow.device(device), requires_grad=True ) of_y = flow.Tensor(np.array([5.0]), device=flow.device(device), requires_grad=False) of_x_inplace = of_x + 1 id_old = id(of_x_inplace) of_x_inplace.add_(of_y) test_case.assertEqual(id_old, id(of_x_inplace)) np_out = np_x + 6 test_case.assertTrue(np.allclose(of_x_inplace.numpy(), np_out, 1e-05, 1e-05)) of_x_inplace = of_x_inplace.sum() of_x_inplace.backward() test_case.assertTrue(np.allclose(of_x.grad.numpy(), np.ones(shape), 1e-05, 1e-05)) of_x = flow.Tensor( np_x, dtype=flow.float32, device=flow.device(device), requires_grad=True ) np_y = np.random.randn(*shape[:-1], 1) of_y = flow.Tensor(np_y, device=flow.device(device), requires_grad=False) of_x_inplace = of_x + 1 id_old = id(of_x_inplace) of_x_inplace.add_(of_y) test_case.assertEqual(id_old, id(of_x_inplace)) np_out = np_x + 1 + np_y test_case.assertTrue(np.allclose(of_x_inplace.numpy(), np_out, 1e-05, 1e-05)) of_x_inplace = of_x_inplace.sum() of_x_inplace.backward() test_case.assertTrue(np.allclose(of_x.grad.numpy(), np.ones(shape), 1e-05, 1e-05)) @flow.unittest.skip_unless_1n1d() class TestAddModule(flow.unittest.TestCase): def test_add(test_case): arg_dict = OrderedDict() arg_dict["test_fun"] = [ _test_add_forward, _test_add_backward, _test_inplace_add, ] arg_dict["shape"] = [(2, 3), (2, 3, 4), (2, 3, 4, 5)] arg_dict["device"] = ["cpu", "cuda"] for arg in GenArgList(arg_dict): arg[0](test_case, *arg[1:]) if __name__ == "__main__": unittest.main()
38.496815
88
0.67869
1,007
6,044
3.838133
0.125124
0.042691
0.103493
0.102458
0.743079
0.724191
0.708668
0.708409
0.708409
0.700129
0
0.035038
0.178359
6,044
156
89
38.74359
0.743254
0.096128
0
0.585938
0
0
0.006233
0
0
0
0
0
0.164063
1
0.03125
false
0
0.046875
0
0.085938
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
1ddb8a6ddd3a847ffbfe1b5d9dcc96687e24154a
3,658
bzl
Python
antlir/bzl/image/feature/symlink.bzl
facebookincubator/fs_image
3515a24bb0e93176a5584bdc8839464fa28390d7
[ "MIT" ]
9
2019-12-02T20:17:35.000Z
2020-06-13T16:34:25.000Z
antlir/bzl/image/feature/symlink.bzl
facebookincubator/fs_image
3515a24bb0e93176a5584bdc8839464fa28390d7
[ "MIT" ]
19
2019-11-22T23:30:04.000Z
2020-07-16T18:05:48.000Z
antlir/bzl/image/feature/symlink.bzl
facebookincubator/fs_image
3515a24bb0e93176a5584bdc8839464fa28390d7
[ "MIT" ]
4
2019-12-04T19:03:28.000Z
2020-06-13T16:34:29.000Z
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. load("//antlir/bzl:shape.bzl", "shape") load("//antlir/bzl:target_helpers.bzl", "antlir_dep") load("//antlir/bzl:target_tagger.bzl", "new_target_tagger", "target_tagger_to_feature") load(":symlink.shape.bzl", "symlink_t") def _build_symlink_feature(link_target, link_name, symlinks_to_arg): symlink_spec = shape.new( symlink_t, dest = link_name, source = link_target, ) return target_tagger_to_feature( new_target_tagger(), items = struct(**{symlinks_to_arg: [symlink_spec]}), # The `fake_macro_library` docblock explains this self-dependency extra_deps = [antlir_dep("bzl/image/feature:symlink")], ) def feature_ensure_dir_symlink(link_target, link_name): """ The operation follows rsync convention for a destination (`link_name`): `ends/in/slash/` means "write into this directory", `does/not/end/with/slash` means "write with the specified filename": - `feature.ensure_dir_symlink("/d", "/e/")` symlinks directory `/d` to `/e/d` - `feature.ensure_dir_symlink("/a", "/b/c")` symlinks directory `/a` to `/b/c` Both arguments are mandatory: - `link_target` is the image-absolute source file/dir of the symlink. This file must exist as we do not support dangling symlinks. IMPORTANT: The emitted symlink will be **relative** by default, enabling easier inspection if images via `buck-image-out`. If this is a problem for you, we can add an `absolute` boolean kwarg. - `link_name` is an image-absolute path. A trailing / is significant. A `link_name` that does NOT end in / is a full path in the new image, ending with a filename for the new symlink. As with `image.clone`, a traling / means that `link_name` must be a pre-existing directory in the image (e.g. created via `image.ensure_dirs_exist`), and the actual link will be placed at `link_name/(basename of link_target)`. This item is indempotent: it is a no-op if a symlink already exists that matches the spec. """ return _build_symlink_feature(link_target, link_name, "symlinks_to_dirs") def feature_ensure_file_symlink(link_target, link_name): """ The operation follows rsync convention for a destination (`link_name`): `ends/in/slash/` means "write into this directory", `does/not/end/with/slash` means "write with the specified filename": - `feature.ensure_file_symlink("/d", "/e/")` symlinks file `/d` to `/e/d` - `feature.ensure_file_symlink("/a", "/b/c")` symlinks file `/a` to `/b/c` Both arguments are mandatory: - `link_target` is the image-absolute source file/dir of the symlink. This file must exist as we do not support dangling symlinks. IMPORTANT: The emitted symlink will be **relative** by default, enabling easier inspection if images via `buck-image-out`. If this is a problem for you, we can add an `absolute` boolean kwarg. - `link_name` is an image-absolute path. A trailing / is significant. A `link_name` that does NOT end in / is a full path in the new image, ending with a filename for the new symlink. As with `image.clone`, a traling / means that `link_name` must be a pre-existing directory in the image (e.g. created via `image.ensure_dirs_exist`), and the actual link will be placed at `link_name/(basename of link_target)`. This item is indempotent: it is a no-op if a symlink already exists that matches the spec. """ return _build_symlink_feature(link_target, link_name, "symlinks_to_files")
41.101124
87
0.719245
571
3,658
4.464098
0.245184
0.050216
0.027462
0.035308
0.76226
0.733229
0.719106
0.719106
0.719106
0.700667
0
0
0.175779
3,658
88
88
41.568182
0.845439
0.75041
0
0
0
0
0.25
0.147321
0
0
0
0
0
1
0.157895
false
0
0
0
0.315789
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
1df4b1273460f2b25a0da391abeadf33a24a8abc
39
py
Python
run.py
beenje/aiolegomac
4bf780749e018750c5644fea3e84f09444c43d3d
[ "BSD-2-Clause" ]
1
2017-12-29T14:24:34.000Z
2017-12-29T14:24:34.000Z
run.py
beenje/aiolegomac
4bf780749e018750c5644fea3e84f09444c43d3d
[ "BSD-2-Clause" ]
5
2021-03-18T20:23:21.000Z
2022-03-11T23:16:41.000Z
run.py
beenje/aiolegomac
4bf780749e018750c5644fea3e84f09444c43d3d
[ "BSD-2-Clause" ]
null
null
null
from aiolegomac.app import run run()
7.8
30
0.74359
6
39
4.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.179487
39
4
31
9.75
0.90625
0
0
0
0
0
0
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
380164c29263d89e69a77897dc813b50f3c4f768
7,296
py
Python
tools/graph_bag/scripts/test_rmse_utilities.py
limenutt/astrobee
9241e67e6692810d6e275abb3165b6d02f4ca5ef
[ "Apache-2.0" ]
629
2017-08-31T23:09:00.000Z
2022-03-30T11:55:40.000Z
tools/graph_bag/scripts/test_rmse_utilities.py
limenutt/astrobee
9241e67e6692810d6e275abb3165b6d02f4ca5ef
[ "Apache-2.0" ]
269
2018-05-05T12:31:16.000Z
2022-03-30T22:04:11.000Z
tools/graph_bag/scripts/test_rmse_utilities.py
limenutt/astrobee
9241e67e6692810d6e275abb3165b6d02f4ca5ef
[ "Apache-2.0" ]
248
2017-08-31T23:20:56.000Z
2022-03-30T22:29:16.000Z
#!/usr/bin/python # # Copyright (c) 2017, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # # All rights reserved. # # The Astrobee platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import math import unittest import numpy as np import poses import rmse_utilities def make_poses(times, xs, ys, zs): new_poses = poses.Poses("", "") new_poses.times = times new_poses.positions.xs = xs new_poses.positions.ys = ys new_poses.positions.zs = zs return new_poses class TestRMSESequence(unittest.TestCase): def test_prune_missing_timestamps_beginning_set(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 b_times = np.arange(5.0) poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(b_times, xs, ys, zs) trimmed_a, trimmed_b = rmse_utilities.get_same_timestamp_poses(poses_a, poses_b) self.assertEqual(len(trimmed_a.times), len(trimmed_b.times)) self.assertEqual(len(trimmed_a.times), 5) self.assertTrue(np.allclose(trimmed_a.times, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.xs, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.ys, b_times + 1, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.zs, b_times + 2, rtol=0)) def test_prune_missing_timestamps_middle_set(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 b_times = np.arange(3.0, 7.0) poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(b_times, xs, ys, zs) trimmed_a, trimmed_b = rmse_utilities.get_same_timestamp_poses(poses_a, poses_b) self.assertEqual(len(trimmed_a.times), len(trimmed_b.times)) self.assertEqual(len(trimmed_a.times), 4) self.assertTrue(np.allclose(trimmed_a.times, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.xs, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.ys, b_times + 1, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.zs, b_times + 2, rtol=0)) def test_prune_missing_timestamps_end_set(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 b_times = np.arange(7.0, 10.0) poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(b_times, xs, ys, zs) trimmed_a, trimmed_b = rmse_utilities.get_same_timestamp_poses(poses_a, poses_b) self.assertEqual(len(trimmed_a.times), len(trimmed_b.times)) self.assertEqual(len(trimmed_a.times), 3) self.assertTrue(np.allclose(trimmed_a.times, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.xs, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.ys, b_times + 1, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.zs, b_times + 2, rtol=0)) def test_prune_missing_timestamps_scattered_set(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 b_times = np.array([1.0, 5.0, 6.0, 9.0]) poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(b_times, xs, ys, zs) trimmed_a, trimmed_b = rmse_utilities.get_same_timestamp_poses(poses_a, poses_b) self.assertEqual(len(trimmed_a.times), len(trimmed_b.times)) self.assertTrue(np.allclose(trimmed_a.times, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.xs, b_times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.ys, b_times + 1, rtol=0)) self.assertTrue(np.allclose(trimmed_a.positions.zs, b_times + 2, rtol=0)) def test_prune_missing_timestamps_disjoint_set(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 b_times = np.arange(11, 20) poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(b_times, xs, ys, zs) trimmed_a, trimmed_b = rmse_utilities.get_same_timestamp_poses(poses_a, poses_b) self.assertEqual(len(trimmed_a.times), 0) self.assertEqual(len(trimmed_b.times), 0) def test_prune_missing_timestamps_some_overlap(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 b_times = np.arange(8.0, 20.0) poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(b_times, xs, ys, zs) expected_time_range = np.arange(8.0, 10.0) trimmed_a, trimmed_b = rmse_utilities.get_same_timestamp_poses(poses_a, poses_b) self.assertEqual(len(trimmed_a.times), len(trimmed_b.times)) self.assertTrue(np.allclose(trimmed_a.times, trimmed_b.times, rtol=0)) self.assertTrue(np.allclose(trimmed_a.times, expected_time_range, rtol=0)) self.assertTrue( np.allclose(trimmed_a.positions.xs, expected_time_range, rtol=0) ) self.assertTrue( np.allclose(trimmed_a.positions.ys, expected_time_range + 1, rtol=0) ) self.assertTrue( np.allclose(trimmed_a.positions.zs, expected_time_range + 2, rtol=0) ) def test_rmse_same_poses(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(a_times, xs, ys, zs) rmse = rmse_utilities.rmse_timestamped_poses(poses_a, poses_b) self.assertTrue(np.isclose(rmse, 0, rtol=0)) def test_rmse_off_by_one(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(a_times, xs + 1, ys, zs) rmse = rmse_utilities.rmse_timestamped_poses(poses_a, poses_b) self.assertTrue(np.isclose(rmse, 1.0, rtol=0)) def test_rmse_all_off_by_one(self): a_times = np.arange(10.0) xs = np.arange(10.0) ys = np.arange(10.0) + 1.0 zs = np.arange(10.0) + 2.0 poses_a = make_poses(a_times, xs, ys, zs) poses_b = make_poses(a_times, xs + 1, ys + 1, zs + 1) rmse = rmse_utilities.rmse_timestamped_poses(poses_a, poses_b) self.assertTrue(np.isclose(rmse, math.sqrt(3.0), rtol=0)) if __name__ == "__main__": unittest.main()
40.988764
88
0.655291
1,174
7,296
3.856899
0.124361
0.074205
0.079505
0.087456
0.767005
0.756846
0.742712
0.741608
0.741608
0.741608
0
0.041014
0.221354
7,296
177
89
41.220339
0.756029
0.098684
0
0.626866
0
0
0.00122
0
0
0
0
0
0.253731
1
0.074627
false
0
0.037313
0
0.126866
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
381ff9151357b8a545a0467f150806d9d897afa1
161
py
Python
handlers/__init__.py
dragondjf/cqssl
86d4d69654c79650646d7672d580abf9dccf6c98
[ "Apache-2.0" ]
null
null
null
handlers/__init__.py
dragondjf/cqssl
86d4d69654c79650646d7672d580abf9dccf6c98
[ "Apache-2.0" ]
null
null
null
handlers/__init__.py
dragondjf/cqssl
86d4d69654c79650646d7672d580abf9dccf6c98
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- from .task import task from .mainhandler import MainHandler from .websockerhandler import WebSocketManagerHandler
23
53
0.770186
19
161
6.526316
0.684211
0
0
0
0
0
0
0
0
0
0
0.007092
0.124224
161
6
54
26.833333
0.87234
0.26087
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
383fecd42d9412dba0da8104dc4c13bda2a0f420
121
py
Python
mastermind_django_files/front_end/admin.py
chodges7/mastermind-capstone
39bce35c1a4abf4b5bbde8927713b25451463c85
[ "MIT" ]
null
null
null
mastermind_django_files/front_end/admin.py
chodges7/mastermind-capstone
39bce35c1a4abf4b5bbde8927713b25451463c85
[ "MIT" ]
null
null
null
mastermind_django_files/front_end/admin.py
chodges7/mastermind-capstone
39bce35c1a4abf4b5bbde8927713b25451463c85
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Games, Stats admin.site.register(Games) admin.site.register(Stats)
20.166667
32
0.809917
18
121
5.444444
0.555556
0.183673
0.346939
0
0
0
0
0
0
0
0
0
0.099174
121
5
33
24.2
0.899083
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
38448a990820a9bba1ca4bed8932ac32999884bf
15,073
py
Python
tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py
awslabs/aws-lambda-builders
b317c5da6a981f83adee4631c5710cea14e60beb
[ "Apache-2.0" ]
180
2018-11-09T04:51:19.000Z
2020-08-06T21:43:20.000Z
tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py
awslabs/aws-lambda-builders
b317c5da6a981f83adee4631c5710cea14e60beb
[ "Apache-2.0" ]
108
2018-11-08T18:34:51.000Z
2020-08-12T17:59:41.000Z
tests/integration/workflows/nodejs_npm_esbuild/test_nodejs_npm_with_esbuild.py
awslabs/aws-lambda-builders
b317c5da6a981f83adee4631c5710cea14e60beb
[ "Apache-2.0" ]
91
2018-11-08T22:58:00.000Z
2020-08-17T21:15:31.000Z
import os import shutil import tempfile from unittest import TestCase from aws_lambda_builders.builder import LambdaBuilder from aws_lambda_builders.exceptions import WorkflowFailedError from aws_lambda_builders.workflows.nodejs_npm.npm import SubprocessNpm from aws_lambda_builders.workflows.nodejs_npm.utils import OSUtils from aws_lambda_builders.workflows.nodejs_npm_esbuild.esbuild import EsbuildExecutionError from aws_lambda_builders.workflows.nodejs_npm_esbuild.utils import EXPERIMENTAL_FLAG_ESBUILD from parameterized import parameterized class TestNodejsNpmWorkflowWithEsbuild(TestCase): """ Verifies that `nodejs_npm` workflow works by building a Lambda using NPM """ TEST_DATA_FOLDER = os.path.join(os.path.dirname(__file__), "testdata") def setUp(self): self.artifacts_dir = tempfile.mkdtemp() self.scratch_dir = tempfile.mkdtemp() self.dependencies_dir = tempfile.mkdtemp() self.no_deps = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild") self.builder = LambdaBuilder(language="nodejs", dependency_manager="npm-esbuild", application_framework=None) def tearDown(self): shutil.rmtree(self.artifacts_dir) shutil.rmtree(self.scratch_dir) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_doesnt_build_without_feature_flag(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") with self.assertRaises(EsbuildExecutionError) as context: self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, ) self.assertEqual(str(context.exception), "Esbuild Failed: Feature flag must be enabled to use this workflow") @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_javascript_project_with_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") options = {"entry_points": ["included.js"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js", "included.js.map"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_javascript_project_with_multiple_entrypoints(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-multiple-entrypoints") options = {"entry_points": ["included.js", "included2.js"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js", "included.js.map", "included2.js", "included2.js.map"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_typescript_projects(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-typescript") options = {"entry_points": ["included.ts"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js", "included.js.map"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_with_external_esbuild(self, runtime): osutils = OSUtils() npm = SubprocessNpm(osutils) source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild") esbuild_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-binary") npm.run(["ci"], cwd=esbuild_dir) binpath = npm.run(["bin"], cwd=esbuild_dir) options = {"entry_points": ["included.js"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, executable_search_paths=[binpath], experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js", "included.js.map"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_no_options_passed_to_esbuild(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild") with self.assertRaises(WorkflowFailedError) as context: self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) self.assertEqual(str(context.exception), "NodejsNpmEsbuildBuilder:EsbuildBundle - entry_points not set ({})") @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_bundle_with_implicit_file_types(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "implicit-file-types") options = {"entry_points": ["included", "implicit"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js.map", "implicit.js.map", "implicit.js", "included.js"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_bundles_project_without_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-package-esbuild") options = {"entry_points": ["included"]} osutils = OSUtils() npm = SubprocessNpm(osutils) esbuild_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-binary") npm.run(["ci"], cwd=esbuild_dir) binpath = npm.run(["bin"], cwd=esbuild_dir) self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], executable_search_paths=[binpath], ) expected_files = {"included.js.map", "included.js"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_with_dependencies_dir(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") options = {"entry_points": ["included.js"]} osutils = OSUtils() npm = SubprocessNpm(osutils) esbuild_dir = os.path.join(self.TEST_DATA_FOLDER, "esbuild-binary") npm.run(["ci"], cwd=esbuild_dir) binpath = npm.run(["bin"], cwd=esbuild_dir) self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), options=options, runtime=runtime, dependencies_dir=self.dependencies_dir, download_dependencies=False, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], executable_search_paths=[binpath], ) expected_files = {"included.js.map", "included.js"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_project_with_remote_dependencies_with_download_dependencies_and_dependencies_dir(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") options = {"entry_points": ["included.js"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, dependencies_dir=self.dependencies_dir, download_dependencies=True, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js.map", "included.js"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) expected_modules = "minimal-request-promise" output_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules"))) self.assertIn(expected_modules, output_modules) expected_dependencies_files = {"node_modules"} output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) self.assertNotIn(expected_dependencies_files, output_dependencies_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_project_with_remote_dependencies_without_download_dependencies_without_dependencies_dir( self, runtime ): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") with self.assertRaises(EsbuildExecutionError) as context: self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, dependencies_dir=None, download_dependencies=False, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) self.assertEqual(str(context.exception), "Esbuild Failed: Lambda Builders encountered and invalid workflow") @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_project_without_combine_dependencies(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-no-node_modules") options = {"entry_points": ["included.js"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, dependencies_dir=self.dependencies_dir, download_dependencies=True, combine_dependencies=False, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js.map", "included.js"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) expected_modules = "minimal-request-promise" output_modules = set(os.listdir(os.path.join(self.dependencies_dir, "node_modules"))) self.assertIn(expected_modules, output_modules) expected_dependencies_files = {"node_modules"} output_dependencies_files = set(os.listdir(os.path.join(self.dependencies_dir))) self.assertNotIn(expected_dependencies_files, output_dependencies_files) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_javascript_project_with_external(self, runtime): source_dir = os.path.join(self.TEST_DATA_FOLDER, "with-deps-esbuild-externals") options = {"entry_points": ["included.js"], "external": ["minimal-request-promise"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js", "included.js.map"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) with open(str(os.path.join(self.artifacts_dir, "included.js"))) as f: js_file = f.read() # Check that the module has been require() instead of bundled self.assertIn('require("minimal-request-promise")', js_file) @parameterized.expand([("nodejs12.x",), ("nodejs14.x",), ("nodejs16.x",)]) def test_builds_javascript_project_with_loader(self, runtime): osutils = OSUtils() source_dir = os.path.join(self.TEST_DATA_FOLDER, "no-deps-esbuild-loader") options = {"entry_points": ["included.js"], "loader": [".reference=json"]} self.builder.build( source_dir, self.artifacts_dir, self.scratch_dir, os.path.join(source_dir, "package.json"), runtime=runtime, options=options, experimental_flags=[EXPERIMENTAL_FLAG_ESBUILD], ) expected_files = {"included.js", "included.js.map"} output_files = set(os.listdir(self.artifacts_dir)) self.assertEqual(expected_files, output_files) included_js_path = os.path.join(self.artifacts_dir, "included.js") # check that the .reference file is correctly bundled as code by running the result self.assertEqual( osutils.check_output(included_js_path), str.encode( "===\n" "The Muses\n" "===\n" "\n" "\tcalliope: eloquence and heroic poetry\n" "\terato: lyric or erotic poetry\n" "\tmelpomene: tragedy\n" "\tpolymnia: sacred poetry\n" "\tterpsichore: dance\n" "\tthalia: comedy\n" "\turania: astronomy and astrology" ), )
40.848238
120
0.639886
1,654
15,073
5.587062
0.111245
0.037117
0.042203
0.04361
0.798074
0.782166
0.782166
0.761714
0.738556
0.738556
0
0.00759
0.239567
15,073
368
121
40.959239
0.798639
0.014264
0
0.694631
0
0
0.149923
0.02392
0
0
0
0
0.077181
1
0.053691
false
0.003356
0.036913
0
0.097315
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
3849630253ce2c38d780907a24dc85a17d990961
114
py
Python
plugins/trivia/questions.py
wuhoodude/Bappybot
c7f0bf42678758d2d042b48f843c8c341b737e70
[ "MIT" ]
7
2015-06-08T17:57:16.000Z
2017-12-14T09:09:01.000Z
plugins/trivia/questions.py
wuhoodude/Bappybot
c7f0bf42678758d2d042b48f843c8c341b737e70
[ "MIT" ]
8
2015-06-08T19:51:50.000Z
2021-12-13T19:46:10.000Z
plugins/trivia/questions.py
wuhoodude/Bappybot
c7f0bf42678758d2d042b48f843c8c341b737e70
[ "MIT" ]
21
2015-06-08T17:06:42.000Z
2020-07-23T07:21:12.000Z
class QuestionGenerator: def makeQuestion(self): return {'a':'42','q':'What is the meaning of life?'}
28.5
60
0.640351
15
114
4.866667
1
0
0
0
0
0
0
0
0
0
0
0.021978
0.201754
114
3
61
38
0.78022
0
0
0
0
0
0.280702
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
6972d734b43870c7374651044827d478299981f4
83
py
Python
test/Inputs/getmtime.py
xjc90s/swift
cafe5ccbd1b7aa9cc9c837c5be2cdf3d5acd8a49
[ "Apache-2.0" ]
1
2022-03-27T15:28:07.000Z
2022-03-27T15:28:07.000Z
test/Inputs/getmtime.py
xjc90s/swift
cafe5ccbd1b7aa9cc9c837c5be2cdf3d5acd8a49
[ "Apache-2.0" ]
null
null
null
test/Inputs/getmtime.py
xjc90s/swift
cafe5ccbd1b7aa9cc9c837c5be2cdf3d5acd8a49
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 import os import sys print(os.path.getmtime(sys.argv[1]))
11.857143
36
0.722892
15
83
4
0.8
0
0
0
0
0
0
0
0
0
0
0.027027
0.108434
83
6
37
13.833333
0.783784
0.253012
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0.333333
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
697ee74dc4e53951274bc0c01e25d38b373fccbe
102
py
Python
run.py
Divisibility/l5r-game-master-tool
8eb746163256931cdbaff1fde5c66f399906835b
[ "MIT" ]
2
2018-09-04T18:32:27.000Z
2018-12-04T14:11:51.000Z
run.py
Divisibility/l5r-game-master-tool
8eb746163256931cdbaff1fde5c66f399906835b
[ "MIT" ]
null
null
null
run.py
Divisibility/l5r-game-master-tool
8eb746163256931cdbaff1fde5c66f399906835b
[ "MIT" ]
null
null
null
#!/usr/bin/env python from gmt import app app.run(debug=app.config['DEBUG'], port=app.config['PORT'])
25.5
59
0.715686
18
102
4.055556
0.666667
0.246575
0
0
0
0
0
0
0
0
0
0
0.078431
102
3
60
34
0.776596
0.196078
0
0
0
0
0.111111
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
6992c115a9faa2fb70414a73636ce6b97a3a5b33
21
py
Python
olive/scripts/calibration/__init__.py
liuyenting/olive-core
b532b29e29fe9f167369f66b8d922f5f644f9309
[ "Apache-2.0" ]
null
null
null
olive/scripts/calibration/__init__.py
liuyenting/olive-core
b532b29e29fe9f167369f66b8d922f5f644f9309
[ "Apache-2.0" ]
null
null
null
olive/scripts/calibration/__init__.py
liuyenting/olive-core
b532b29e29fe9f167369f66b8d922f5f644f9309
[ "Apache-2.0" ]
null
null
null
from .aotf import *
10.5
20
0.666667
3
21
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.238095
21
1
21
21
0.875
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
69a238f8632b12f2eaad7859e1eeb823b11b56c5
128
py
Python
ggcg/gen/__init__.py
FreNeS1/ggcg
814aa152d911d62da9771381fc4e74e4ca8ba762
[ "MIT" ]
1
2020-07-09T12:43:09.000Z
2020-07-09T12:43:09.000Z
ggcg/gen/__init__.py
FreNeS1/ggcg
814aa152d911d62da9771381fc4e74e4ca8ba762
[ "MIT" ]
4
2020-11-13T18:55:07.000Z
2022-02-10T01:49:56.000Z
ggcg/gen/__init__.py
FreNeS1/ggcg
814aa152d911d62da9771381fc4e74e4ca8ba762
[ "MIT" ]
null
null
null
"""Generator package. Contains the logic to simplify, modify and regenerate new computational graphs based on existing ones."""
42.666667
118
0.796875
17
128
6
1
0
0
0
0
0
0
0
0
0
0
0
0.132813
128
2
119
64
0.918919
0.945313
0
null
1
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
69a506ea3ed9f1e8132122e3a5a8d3e9bed70e45
112
py
Python
order/admin.py
YatharthVats/Dishes-API
0dd40a3d2c8d14cc01260b8f5348c839f46dff7a
[ "MIT" ]
null
null
null
order/admin.py
YatharthVats/Dishes-API
0dd40a3d2c8d14cc01260b8f5348c839f46dff7a
[ "MIT" ]
null
null
null
order/admin.py
YatharthVats/Dishes-API
0dd40a3d2c8d14cc01260b8f5348c839f46dff7a
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Dish # Register your models here. admin.site.register(Dish)
28
32
0.8125
17
112
5.352941
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.116071
112
4
33
28
0.919192
0.232143
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
69a969504b2937315d39e7a3d48eace064c99059
8,123
py
Python
networks.py
Blupblupblup/Deep-MSVDD-PyTorch
2a97b44b13925e57b166b3353cfaf1e262bc0b60
[ "MIT" ]
null
null
null
networks.py
Blupblupblup/Deep-MSVDD-PyTorch
2a97b44b13925e57b166b3353cfaf1e262bc0b60
[ "MIT" ]
null
null
null
networks.py
Blupblupblup/Deep-MSVDD-PyTorch
2a97b44b13925e57b166b3353cfaf1e262bc0b60
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F """ architectures from: - https://github.com/lukasruff/Deep-SAD-PyTorch/blob/master/src/networks/mnist_LeNet.py - https://github.com/lukasruff/Deep-SAD-PyTorch/blob/master/src/networks/fmnist_LeNet.py - https://github.com/lukasruff/Deep-SAD-PyTorch/blob/master/src/networks/cifar10_LeNet.py one should note that F.leaky_relu() uses leakiness alpha = 0.01 and not 0.1 as indicated in the paper http://proceedings.mlr.press/v80/ruff18a/ruff18a.pdf """ ############# ### MNIST ### ############# class MNIST_LeNet(nn.Module): def __init__(self, rep_dim=32): super().__init__() self.rep_dim = rep_dim self.pool = nn.MaxPool2d(2, 2) self.conv1 = nn.Conv2d(1, 8, 5, bias=False, padding=2) self.bn1 = nn.BatchNorm2d(8, eps=1e-04, affine=False) self.conv2 = nn.Conv2d(8, 4, 5, bias=False, padding=2) self.bn2 = nn.BatchNorm2d(4, eps=1e-04, affine=False) self.fc1 = nn.Linear(4 * 7 * 7, self.rep_dim, bias=False) def forward(self, x): x = x.view(-1, 1, 28, 28) x = self.conv1(x) x = self.pool(F.leaky_relu(self.bn1(x))) x = self.conv2(x) x = self.pool(F.leaky_relu(self.bn2(x))) x = x.view(int(x.size(0)), -1) x = self.fc1(x) return x class MNIST_LeNet_Decoder(nn.Module): def __init__(self, rep_dim=32): super().__init__() self.rep_dim = rep_dim # Decoder network self.deconv1 = nn.ConvTranspose2d(2, 4, 5, bias=False, padding=2) self.bn3 = nn.BatchNorm2d(4, eps=1e-04, affine=False) self.deconv2 = nn.ConvTranspose2d(4, 8, 5, bias=False, padding=3) self.bn4 = nn.BatchNorm2d(8, eps=1e-04, affine=False) self.deconv3 = nn.ConvTranspose2d(8, 1, 5, bias=False, padding=2) def forward(self, x): x = x.view(int(x.size(0)), int(self.rep_dim / 16), 4, 4) x = F.interpolate(F.leaky_relu(x), scale_factor=2) x = self.deconv1(x) x = F.interpolate(F.leaky_relu(self.bn3(x)), scale_factor=2) x = self.deconv2(x) x = F.interpolate(F.leaky_relu(self.bn4(x)), scale_factor=2) x = self.deconv3(x) x = torch.sigmoid(x) return x.squeeze() class MNIST_LeNet_Autoencoder(nn.Module): def __init__(self, rep_dim=32): super().__init__() self.rep_dim = rep_dim self.encoder = MNIST_LeNet(rep_dim=rep_dim) self.decoder = MNIST_LeNet_Decoder(rep_dim=rep_dim) def forward(self, x): x = self.encoder(x) x = self.decoder(x) return x #################### ### FashionMNIST ### #################### class FashionMNIST_LeNet(nn.Module): def __init__(self, rep_dim=64): super().__init__() self.rep_dim = rep_dim self.pool = nn.MaxPool2d(2, 2) self.conv1 = nn.Conv2d(1, 16, 5, bias=False, padding=2) self.bn2d1 = nn.BatchNorm2d(16, eps=1e-04, affine=False) self.conv2 = nn.Conv2d(16, 32, 5, bias=False, padding=2) self.bn2d2 = nn.BatchNorm2d(32, eps=1e-04, affine=False) self.fc1 = nn.Linear(32 * 7 * 7, 128, bias=False) self.bn1d1 = nn.BatchNorm1d(128, eps=1e-04, affine=False) self.fc2 = nn.Linear(128, self.rep_dim, bias=False) def forward(self, x): x = x.view(-1, 1, 28, 28) x = self.conv1(x) x = self.pool(F.leaky_relu(self.bn2d1(x))) x = self.conv2(x) x = self.pool(F.leaky_relu(self.bn2d2(x))) x = x.view(int(x.size(0)), -1) x = F.leaky_relu(self.bn1d1(self.fc1(x))) x = self.fc2(x) return x class FashionMNIST_LeNet_Decoder(nn.Module): def __init__(self, rep_dim=64): super().__init__() self.rep_dim = rep_dim self.fc3 = nn.Linear(self.rep_dim, 128, bias=False) self.bn1d2 = nn.BatchNorm1d(128, eps=1e-04, affine=False) self.deconv1 = nn.ConvTranspose2d(8, 32, 5, bias=False, padding=2) self.bn2d3 = nn.BatchNorm2d(32, eps=1e-04, affine=False) self.deconv2 = nn.ConvTranspose2d(32, 16, 5, bias=False, padding=3) self.bn2d4 = nn.BatchNorm2d(16, eps=1e-04, affine=False) self.deconv3 = nn.ConvTranspose2d(16, 1, 5, bias=False, padding=2) def forward(self, x): x = self.bn1d2(self.fc3(x)) x = x.view(int(x.size(0)), int(128 / 16), 4, 4) x = F.interpolate(F.leaky_relu(x), scale_factor=2) x = self.deconv1(x) x = F.interpolate(F.leaky_relu(self.bn2d3(x)), scale_factor=2) x = self.deconv2(x) x = F.interpolate(F.leaky_relu(self.bn2d4(x)), scale_factor=2) x = self.deconv3(x) x = torch.sigmoid(x) return x.squeeze() class FashionMNIST_LeNet_Autoencoder(nn.Module): def __init__(self, rep_dim=64): super().__init__() self.rep_dim = rep_dim self.encoder = FashionMNIST_LeNet(rep_dim=rep_dim) self.decoder = FashionMNIST_LeNet_Decoder(rep_dim=rep_dim) def forward(self, x): x = self.encoder(x) x = self.decoder(x) return x ############### ### CIFAR10 ### ############### class CIFAR10_LeNet(nn.Module): def __init__(self, rep_dim=128): super().__init__() self.rep_dim = rep_dim self.pool = nn.MaxPool2d(2, 2) self.conv1 = nn.Conv2d(3, 32, 5, bias=False, padding=2) self.bn2d1 = nn.BatchNorm2d(32, eps=1e-04, affine=False) self.conv2 = nn.Conv2d(32, 64, 5, bias=False, padding=2) self.bn2d2 = nn.BatchNorm2d(64, eps=1e-04, affine=False) self.conv3 = nn.Conv2d(64, 128, 5, bias=False, padding=2) self.bn2d3 = nn.BatchNorm2d(128, eps=1e-04, affine=False) self.fc1 = nn.Linear(128 * 4 * 4, self.rep_dim, bias=False) def forward(self, x): # x = x.view(-1, 3, 32, 32) x = torch.transpose(x,1,3) x = self.conv1(x) x = self.pool(F.leaky_relu(self.bn2d1(x))) x = self.conv2(x) x = self.pool(F.leaky_relu(self.bn2d2(x))) x = self.conv3(x) x = self.pool(F.leaky_relu(self.bn2d3(x))) x = x.view(int(x.size(0)), -1) x = self.fc1(x) return x class CIFAR10_LeNet_Decoder(nn.Module): def __init__(self, rep_dim=128): super().__init__() self.rep_dim = rep_dim self.deconv1 = nn.ConvTranspose2d(int(self.rep_dim / (4 * 4)), 128, 5, bias=False, padding=2) nn.init.xavier_uniform_(self.deconv1.weight, gain=nn.init.calculate_gain('leaky_relu')) self.bn2d4 = nn.BatchNorm2d(128, eps=1e-04, affine=False) self.deconv2 = nn.ConvTranspose2d(128, 64, 5, bias=False, padding=2) nn.init.xavier_uniform_(self.deconv2.weight, gain=nn.init.calculate_gain('leaky_relu')) self.bn2d5 = nn.BatchNorm2d(64, eps=1e-04, affine=False) self.deconv3 = nn.ConvTranspose2d(64, 32, 5, bias=False, padding=2) nn.init.xavier_uniform_(self.deconv3.weight, gain=nn.init.calculate_gain('leaky_relu')) self.bn2d6 = nn.BatchNorm2d(32, eps=1e-04, affine=False) self.deconv4 = nn.ConvTranspose2d(32, 3, 5, bias=False, padding=2) nn.init.xavier_uniform_(self.deconv4.weight, gain=nn.init.calculate_gain('leaky_relu')) def forward(self, x): x = x.view(int(x.size(0)), int(self.rep_dim / (4 * 4)), 4, 4) x = F.leaky_relu(x) x = self.deconv1(x) x = F.interpolate(F.leaky_relu(self.bn2d4(x)), scale_factor=2) x = self.deconv2(x) x = F.interpolate(F.leaky_relu(self.bn2d5(x)), scale_factor=2) x = self.deconv3(x) x = F.interpolate(F.leaky_relu(self.bn2d6(x)), scale_factor=2) x = self.deconv4(x) x = torch.sigmoid(x) return torch.transpose(x,1,3) class CIFAR10_LeNet_Autoencoder(nn.Module): def __init__(self, rep_dim=128): super().__init__() self.rep_dim = rep_dim self.encoder = CIFAR10_LeNet(rep_dim=rep_dim) self.decoder = CIFAR10_LeNet_Decoder(rep_dim=rep_dim) def forward(self, x): x = self.encoder(x) x = self.decoder(x) return x
34.419492
154
0.605934
1,245
8,123
3.801606
0.101205
0.020283
0.052821
0.053243
0.830763
0.822311
0.791042
0.762307
0.740545
0.477076
0
0.070316
0.233165
8,123
236
155
34.419492
0.689517
0.008741
0
0.521212
0
0
0.005343
0
0
0
0
0
0
1
0.109091
false
0
0.018182
0
0.236364
0
0
0
0
null
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
69ee385c0f3fa68eed3f5076ffc48b0e49e7da0a
130
py
Python
norns/enemy/admin.py
the-norns/norns
8856626fb6937452c123e4629a5888a49a82c349
[ "MIT" ]
null
null
null
norns/enemy/admin.py
the-norns/norns
8856626fb6937452c123e4629a5888a49a82c349
[ "MIT" ]
62
2018-05-19T22:18:01.000Z
2018-05-26T00:13:21.000Z
norns/enemy/admin.py
the-norns/norns
8856626fb6937452c123e4629a5888a49a82c349
[ "MIT" ]
3
2018-05-19T18:54:28.000Z
2018-05-21T02:14:47.000Z
from django.contrib import admin from .models import Enemy, EnemyType admin.site.register(Enemy) admin.site.register(EnemyType)
18.571429
36
0.815385
18
130
5.888889
0.555556
0.169811
0.320755
0
0
0
0
0
0
0
0
0
0.1
130
6
37
21.666667
0.905983
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
386272c0d0660b67c49d9b5845133dcbc214c0e7
84
py
Python
tests/test_sample.py
whs2k/tweetCarousel
fd9bf32388573c373491d7259d8a7c4452af0c9a
[ "MIT" ]
null
null
null
tests/test_sample.py
whs2k/tweetCarousel
fd9bf32388573c373491d7259d8a7c4452af0c9a
[ "MIT" ]
null
null
null
tests/test_sample.py
whs2k/tweetCarousel
fd9bf32388573c373491d7259d8a7c4452af0c9a
[ "MIT" ]
null
null
null
def add_up(nums): return sum(nums) def test_answer(): assert add_up([1,2,2]) == 5
16.8
28
0.666667
17
84
3.117647
0.705882
0.188679
0
0
0
0
0
0
0
0
0
0.055556
0.142857
84
5
28
16.8
0.680556
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.5
false
0
0
0.25
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
388f68464a39af7ea5cc19e6d513b120737b0064
270
py
Python
tfn/tools/loaders/__init__.py
UPEIChemistry/TFN_Layers
5c25583ee4108a13af8e73eabd3c448f42cb70a0
[ "MIT" ]
2
2021-06-24T00:27:10.000Z
2021-09-19T06:50:28.000Z
tfn/tools/loaders/__init__.py
UPEIChemistry/TFN_Layers
5c25583ee4108a13af8e73eabd3c448f42cb70a0
[ "MIT" ]
4
2019-10-10T18:36:37.000Z
2019-10-10T18:37:55.000Z
tfn/tools/loaders/__init__.py
UPEIChemistry/TFN_Layers
5c25583ee4108a13af8e73eabd3c448f42cb70a0
[ "MIT" ]
null
null
null
""" Sub-package containg all loader classes """ from .data_loader import DataLoader from .qm9_loader import QM9DataDataLoader from .iso17_loader import ISO17DataLoader from .ts_loader import TSLoader from .sn2_loader import SN2Loader from .isom_loader import IsomLoader
27
41
0.837037
36
270
6.111111
0.555556
0.327273
0
0
0
0
0
0
0
0
0
0.033473
0.114815
270
9
42
30
0.887029
0.144444
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
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
3896c529bb2366c6b7d2f1c4920fc05bd72675e7
382
py
Python
fastapi_mvc/commands/__init__.py
rszamszur/fastapi-mvc
98670eda3b485cfe25850773dcc1ae7ae5feced9
[ "MIT" ]
98
2021-12-21T18:45:07.000Z
2022-03-27T08:48:37.000Z
fastapi_mvc/commands/__init__.py
rszamszur/fastapi-mvc
98670eda3b485cfe25850773dcc1ae7ae5feced9
[ "MIT" ]
48
2021-12-21T16:06:56.000Z
2022-03-26T17:28:57.000Z
fastapi_mvc/commands/__init__.py
rszamszur/fastapi-mvc
98670eda3b485cfe25850773dcc1ae7ae5feced9
[ "MIT" ]
16
2022-01-05T14:21:50.000Z
2022-02-13T17:55:07.000Z
"""Command design pattern. The ``fastapi-mvc.commands`` submodule implements command design pattern. Resources: 1. https://refactoring.guru/design-patterns/command """ from fastapi_mvc.commands.base import Command from fastapi_mvc.commands.invoker import Invoker from fastapi_mvc.commands.run_generator import RunGenerator from fastapi_mvc.commands.run_shell import RunShell
29.384615
73
0.82199
50
382
6.16
0.48
0.162338
0.292208
0.285714
0.350649
0
0
0
0
0
0
0.002899
0.096859
382
12
74
31.833333
0.889855
0.434555
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
38b28cf76888a648b452e934a33a7d0a458b67ed
1,069
py
Python
or_suite/envs/general_test.py
JasmineSamadi/ORSuite
e2b2b0a5b497ea6566e794dcef1f176081fca4ce
[ "MIT" ]
4
2021-12-01T10:56:17.000Z
2022-02-06T17:07:43.000Z
or_suite/envs/general_test.py
JasmineSamadi/ORSuite
e2b2b0a5b497ea6566e794dcef1f176081fca4ce
[ "MIT" ]
2
2021-08-11T13:25:01.000Z
2022-03-20T19:23:23.000Z
or_suite/envs/general_test.py
JasmineSamadi/ORSuite
e2b2b0a5b497ea6566e794dcef1f176081fca4ce
[ "MIT" ]
2
2021-07-27T02:39:37.000Z
2022-02-14T21:03:15.000Z
import gym import numpy as np import sys from scipy.stats import poisson import env_configs import pytest from stable_baselines3.common.env_checker import check_env import general_test_helpers def test_ambulance_metric(): general_test_helpers.test_env( 'Ambulance-v0', env_configs.ambulance_metric_default_config) def test_ambulance_graph(): general_test_helpers.test_env( 'Ambulance-v1', env_configs.ambulance_graph_default_config) def test_resource(): general_test_helpers.test_env( 'Resource-v0', env_configs.resource_allocation_default_config) def test_bandit(): general_test_helpers.test_env( 'Bandit-v0', env_configs.finite_bandit_default_config) def test_vaccine(): general_test_helpers.test_env( 'Vaccine-v0', env_configs.vaccine_default_config1) def test_rideshare(): general_test_helpers.test_env( 'Rideshare-v0', env_configs.rideshare_graph_default_config) def test_oil(): general_test_helpers.test_env( 'Oil-v0', env_configs.oil_environment_default_config)
23.23913
70
0.778297
144
1,069
5.340278
0.263889
0.104031
0.187256
0.20026
0.315995
0.088427
0
0
0
0
0
0.009868
0.146866
1,069
45
71
23.755556
0.833333
0
0
0.241379
0
0
0.067353
0
0
0
0
0
0
1
0.241379
true
0
0.275862
0
0.517241
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
1
0
0
0
1
0
0
5
2a3b5d9b8da087bf208f6fc1a6ee076594aff76d
308
py
Python
poop/hfdp/adapter/ducks/challenge/drone_adapter.py
cassiobotaro/poop
fc218fbf638c50da8ea98dab7de26ad2a52e83f5
[ "MIT" ]
37
2020-12-27T00:13:07.000Z
2022-01-31T19:30:18.000Z
poop/hfdp/adapter/ducks/challenge/drone_adapter.py
cassiobotaro/poop
fc218fbf638c50da8ea98dab7de26ad2a52e83f5
[ "MIT" ]
null
null
null
poop/hfdp/adapter/ducks/challenge/drone_adapter.py
cassiobotaro/poop
fc218fbf638c50da8ea98dab7de26ad2a52e83f5
[ "MIT" ]
7
2020-12-26T22:33:47.000Z
2021-11-07T01:29:59.000Z
from poop.hfdp.adapter.ducks.challenge.drone import Drone class DroneAdapter: def __init__(self, drone: Drone) -> None: self.__drone = drone def quack(self) -> None: self.__drone.beep() def fly(self) -> None: self.__drone.spin_rotors() self.__drone.take_off()
22
57
0.63961
39
308
4.692308
0.538462
0.245902
0.213115
0.185792
0
0
0
0
0
0
0
0
0.24026
308
13
58
23.692308
0.782051
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.111111
0
0.555556
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
2a55f2bcb6b545b671fc907e0d9b0d8583e77a56
2,084
py
Python
tests/test_convert.py
vikpe/exex-cli
e8b639882e8db3cb6eb3e873b4327a0f9c864f44
[ "MIT" ]
2
2021-11-14T05:47:24.000Z
2021-12-27T13:58:27.000Z
tests/test_convert.py
vikpe/exex-cli
e8b639882e8db3cb6eb3e873b4327a0f9c864f44
[ "MIT" ]
null
null
null
tests/test_convert.py
vikpe/exex-cli
e8b639882e8db3cb6eb3e873b4327a0f9c864f44
[ "MIT" ]
null
null
null
from exex_cli import convert def test_to_string(): assert convert.to_string(None) == "" assert convert.to_string("None") == "None" assert convert.to_string(0) == "0" assert convert.to_string(1) == "1" assert convert.to_string("a") == "a" assert convert.to_string(False) == "False" assert convert.to_string("False") == "False" assert convert.to_string([]) == "" def test_to_strings(): assert convert.to_strings(None) == "" assert convert.to_strings("None") == "None" assert convert.to_strings(0) == "0" assert convert.to_strings(1) == "1" assert convert.to_strings("a") == "a" assert convert.to_strings(False) == "False" assert convert.to_strings("False") == "False" assert convert.to_strings([]) == "" assert convert.to_strings(["a"]) == ["a"] assert convert.to_strings([1]) == ["1"] assert convert.to_strings([["a", 1], ["b", 2]]) == [["a", "1"], ["b", "2"]] def test_to_csv(): assert convert.to_csv(None) == "\n" assert convert.to_csv("None") == "None\n" assert convert.to_csv(0) == "0\n" assert convert.to_csv(1) == "1\n" assert convert.to_csv("a") == "a\n" assert convert.to_csv(False) == "False\n" assert convert.to_csv("False") == "False\n" assert convert.to_csv([]) == "\n" assert convert.to_csv(["a"]) == "a\n" assert convert.to_csv(["a", "b", 3]) == "a,b,3\n" assert convert.to_csv([["a", "b", 3]]) == "a,b,3\n" assert convert.to_csv([1]) == "1\n" assert convert.to_csv([["a", 1], ["b", 2]]) == "a,1\nb,2\n" def test_to_json(): def strip_whitespace(val): import re pattern = re.compile(r"\s+") return re.sub(pattern, "", val) def json_no_whitespace(val): return strip_whitespace(convert.to_json(val)) assert json_no_whitespace(["a"]) == '["a"]' assert json_no_whitespace(["a", "b", 3]) == '["a","b",3]' assert json_no_whitespace([["a", "b", 3]]) == '[["a","b",3]]' assert json_no_whitespace([1]) == "[1]" assert json_no_whitespace([["a", 1], ["b", 2]]) == '[["a",1],["b",2]]'
34.733333
79
0.578215
309
2,084
3.718447
0.110032
0.258486
0.417755
0.203655
0.809399
0.604003
0.532637
0.532637
0.519582
0.519582
0
0.022485
0.18906
2,084
59
80
35.322034
0.657396
0
0
0
0
0
0.096929
0
0
0
0
0
0.770833
1
0.125
false
0
0.041667
0.020833
0.208333
0
0
0
0
null
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
2a7d2a6598d374b4ef6188db24c8f653e8b7d102
25
py
Python
miner/__init__.py
chrisedebo/nice-py-switcher
fc1a24ab220e65f87c7561dc5404a2003634ddbf
[ "MIT" ]
null
null
null
miner/__init__.py
chrisedebo/nice-py-switcher
fc1a24ab220e65f87c7561dc5404a2003634ddbf
[ "MIT" ]
null
null
null
miner/__init__.py
chrisedebo/nice-py-switcher
fc1a24ab220e65f87c7561dc5404a2003634ddbf
[ "MIT" ]
3
2018-02-23T19:42:18.000Z
2022-03-31T02:51:14.000Z
#Miner plugin definition
12.5
24
0.84
3
25
7
1
0
0
0
0
0
0
0
0
0
0
0
0.12
25
1
25
25
0.954545
0.92
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
2a8403ad1f20768706782bc6163b24d0fe72e6af
20
py
Python
lib/ui/__init__.py
mattermccrea/expensive-skeleton-free
feb32387457da0cd34d2e36dcf568efc786c634d
[ "Apache-2.0" ]
null
null
null
lib/ui/__init__.py
mattermccrea/expensive-skeleton-free
feb32387457da0cd34d2e36dcf568efc786c634d
[ "Apache-2.0" ]
null
null
null
lib/ui/__init__.py
mattermccrea/expensive-skeleton-free
feb32387457da0cd34d2e36dcf568efc786c634d
[ "Apache-2.0" ]
null
null
null
# this is init file
10
19
0.7
4
20
3.5
1
0
0
0
0
0
0
0
0
0
0
0
0.25
20
1
20
20
0.933333
0.85
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
aa783baa904aa30270a896b768683b8426882e6f
48
py
Python
data_structures/linked_list/doubly_linked/__init__.py
kwahome/data-structures-and-algos
535b23c63bf384d63c1ebc08d1c32d3dd808297c
[ "Apache-2.0" ]
null
null
null
data_structures/linked_list/doubly_linked/__init__.py
kwahome/data-structures-and-algos
535b23c63bf384d63c1ebc08d1c32d3dd808297c
[ "Apache-2.0" ]
null
null
null
data_structures/linked_list/doubly_linked/__init__.py
kwahome/data-structures-and-algos
535b23c63bf384d63c1ebc08d1c32d3dd808297c
[ "Apache-2.0" ]
null
null
null
from .linked_list import DoublyLinkedList, Node
24
47
0.854167
6
48
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.104167
48
1
48
48
0.930233
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
aa9784c94b8e97334b939009da1f5d45b9e3e694
140
py
Python
venv/Lib/site-packages/lunr/exceptions.py
star10919/drf
77c005794087484d72ffc0d76612a6ac9845821e
[ "BSD-3-Clause" ]
2
2021-06-18T07:48:14.000Z
2021-06-21T11:55:01.000Z
venv/Lib/site-packages/lunr/exceptions.py
star10919/drf
77c005794087484d72ffc0d76612a6ac9845821e
[ "BSD-3-Clause" ]
null
null
null
venv/Lib/site-packages/lunr/exceptions.py
star10919/drf
77c005794087484d72ffc0d76612a6ac9845821e
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals class BaseLunrException(Exception): pass class QueryParseError(BaseLunrException): pass
14
41
0.8
13
140
8.230769
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.157143
140
9
42
15.555556
0.90678
0
0
0.4
0
0
0
0
0
0
0
0
0
1
0
true
0.4
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
1
0
0
5
2aab127318c802a89f8dee2aa4c6426be3c779fd
77
py
Python
src/models/jaxgp/mean.py
jejjohnson/uncertain_gps
8f71a74dc38640dcf2113eb742229d991ead041d
[ "MIT" ]
9
2020-02-23T16:23:58.000Z
2022-03-07T06:43:45.000Z
src/models/jaxgp/mean.py
jejjohnson/uncertain_gps
8f71a74dc38640dcf2113eb742229d991ead041d
[ "MIT" ]
null
null
null
src/models/jaxgp/mean.py
jejjohnson/uncertain_gps
8f71a74dc38640dcf2113eb742229d991ead041d
[ "MIT" ]
1
2022-02-25T04:37:18.000Z
2022-02-25T04:37:18.000Z
import jax.numpy as jnp def zero_mean(x): return jnp.zeros(x.shape[0])
12.833333
32
0.688312
15
77
3.466667
0.866667
0
0
0
0
0
0
0
0
0
0
0.015873
0.181818
77
5
33
15.4
0.809524
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
0
0
0
5
2ab14394a782679c9b1f520e50a6f6505815bfda
87
py
Python
myparser/config.py
kbondar17/declarations-parser
8afae82be47e62b57cb02386beed8f1b64a9c627
[ "MIT" ]
null
null
null
myparser/config.py
kbondar17/declarations-parser
8afae82be47e62b57cb02386beed8f1b64a9c627
[ "MIT" ]
null
null
null
myparser/config.py
kbondar17/declarations-parser
8afae82be47e62b57cb02386beed8f1b64a9c627
[ "MIT" ]
null
null
null
import configparser from dotenv import dotenv_values config = dotenv_values(".env")
14.5
32
0.793103
11
87
6.090909
0.636364
0.358209
0
0
0
0
0
0
0
0
0
0
0.137931
87
5
33
17.4
0.893333
0
0
0
0
0
0.046512
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
2abf3d058a68f7a241f46f980a6970a510207010
135
py
Python
nose2/tests/functional/support/scenario/module_import_err/pkg/test_attribute_err.py
benj-pml/nose2
b8c66e6f13319ab1b4a43a367b2ffac4cce90b70
[ "BSD-2-Clause" ]
null
null
null
nose2/tests/functional/support/scenario/module_import_err/pkg/test_attribute_err.py
benj-pml/nose2
b8c66e6f13319ab1b4a43a367b2ffac4cce90b70
[ "BSD-2-Clause" ]
null
null
null
nose2/tests/functional/support/scenario/module_import_err/pkg/test_attribute_err.py
benj-pml/nose2
b8c66e6f13319ab1b4a43a367b2ffac4cce90b70
[ "BSD-2-Clause" ]
null
null
null
from nose2.compat import unittest def test_foo(): pass class TestFoo(unittest.TestCase): def test_foo(self): pass
11.25
33
0.674074
18
135
4.944444
0.722222
0.157303
0.224719
0
0
0
0
0
0
0
0
0.009804
0.244444
135
11
34
12.272727
0.862745
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0.166667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
2ac1ff96a2eb086e7b21c0cc742f98d0ea38b5ed
112
py
Python
src/hotels/utils.py
bee-travels/data-generator
a27d446daa24b93b5c0ecba9e1b3a8228815023e
[ "Apache-2.0" ]
2
2021-06-23T03:52:09.000Z
2021-07-26T06:14:15.000Z
src/destination/utils.py
bee-travels/data-generator
a27d446daa24b93b5c0ecba9e1b3a8228815023e
[ "Apache-2.0" ]
1
2020-04-16T17:28:50.000Z
2020-04-16T17:28:50.000Z
src/hotels/utils.py
bee-travels/data-generator
a27d446daa24b93b5c0ecba9e1b3a8228815023e
[ "Apache-2.0" ]
2
2021-07-26T06:59:04.000Z
2022-01-14T06:58:04.000Z
import json def load_json(file_name): with open(file_name) as json_data: return json.load(json_data)
28
38
0.732143
19
112
4.052632
0.578947
0.207792
0
0
0
0
0
0
0
0
0
0
0.1875
112
4
39
28
0.846154
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
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
630ccccc613826ccf4d9e7688588cba9a03292b7
555
py
Python
exercises/bob/example.py
kishankj/python
82042de746128127502e109111e6c4e8ab002af6
[ "MIT" ]
1,177
2017-06-21T20:24:06.000Z
2022-03-29T02:30:55.000Z
exercises/bob/example.py
kishankj/python
82042de746128127502e109111e6c4e8ab002af6
[ "MIT" ]
1,890
2017-06-18T20:06:10.000Z
2022-03-31T18:35:51.000Z
exercises/bob/example.py
kishankj/python
82042de746128127502e109111e6c4e8ab002af6
[ "MIT" ]
1,095
2017-06-26T23:06:19.000Z
2022-03-29T03:25:38.000Z
def response(hey_bob): hey_bob = hey_bob.strip() if _is_silence(hey_bob): return 'Fine. Be that way!' if _is_shouting(hey_bob): if _is_question(hey_bob): return "Calm down, I know what I'm doing!" else: return 'Whoa, chill out!' elif _is_question(hey_bob): return 'Sure.' else: return 'Whatever.' def _is_silence(hey_bob): return hey_bob == '' def _is_shouting(hey_bob): return hey_bob.isupper() def _is_question(hey_bob): return hey_bob.endswith('?')
20.555556
54
0.612613
79
555
3.962025
0.392405
0.249201
0.230032
0.153355
0.440895
0
0
0
0
0
0
0
0.275676
555
26
55
21.346154
0.778607
0
0
0.105263
0
0
0.147748
0
0
0
0
0
0
1
0.210526
false
0
0
0.157895
0.631579
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
2d4888b027ef333ce4ca3219620e90288bda458a
12,065
py
Python
longest_increasing_subsequence/_implementation.py
mCodingLLC/longest_increasing_subsequence
65ede89d4e76bc6086bbe1eb1440123df698d1ae
[ "MIT" ]
7
2021-03-23T10:38:35.000Z
2022-03-01T15:38:52.000Z
longest_increasing_subsequence/_implementation.py
mCodingLLC/longest_increasing_subsequence
65ede89d4e76bc6086bbe1eb1440123df698d1ae
[ "MIT" ]
null
null
null
longest_increasing_subsequence/_implementation.py
mCodingLLC/longest_increasing_subsequence
65ede89d4e76bc6086bbe1eb1440123df698d1ae
[ "MIT" ]
3
2021-03-23T10:38:36.000Z
2021-10-09T14:06:57.000Z
"""Implementation of the longest increasing subsequence algorithm.""" import operator from bisect import bisect_right, bisect_left from typing import TypeVar, Optional, List, Any, Iterator, Sequence, Callable T = TypeVar('T') def longest_increasing_subsequence(seq: Sequence[T], strict=False, key: Callable = None) -> List[T]: """ Returns the longest increasing subsequence of the given sequence. There may be other increasing subsequences of the same length. >>> longest_increasing_subsequence([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]) [0, 2, 6, 9, 11, 15] >>> longest_increasing_subsequence([0, 0, 1, 2, 3, 2, 1, 0, 0]) [0, 0, 1, 2, 2] >>> longest_increasing_subsequence([0, 0, 1, 2, 3], strict=True) [0, 1, 2, 3] >>> longest_increasing_subsequence(['A', 'B', 'CC', 'D', 'EEE'], key=len) ['A', 'B', 'D', 'EEE'] >>> "".join(longest_increasing_subsequence('aababbbdccddd')) 'aaabbbccddd' :param seq: A sequence-like container of comparable objects. :param strict: Whether the subsequence must be strictly increasing. :param key: If not None, values in sequence are compared by comparing their keys. :return: The longest increasing subsequence in seq as a list. """ return _longest_monotone_subsequence(seq, True, strict, key) def longest_decreasing_subsequence(seq: Sequence[T], strict=False, key: Callable = None) -> List[T]: """ Returns the longest decreasing subsequence of the given sequence. There may be other decreasing subsequences of the same length. >>> longest_decreasing_subsequence([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]) [12, 10, 9, 5, 3] >>> longest_decreasing_subsequence([0, 0, 1, 2, 3, 2, 1, 0, 0]) [3, 2, 1, 0, 0] >>> longest_decreasing_subsequence([0, 0, 1, 2, 3, 2, 1, 0, 0], strict=True) [3, 2, 1, 0] :param seq: A sequence-like container of comparable objects. :param strict: Whether the subsequence must be strictly decreasing. :param key: If not None, values in sequence are compared by comparing their keys. :return: The longest decreasing subsequence in seq as a list. """ try: return _longest_monotone_subsequence(seq, False, strict, key, True) except TypeError: pass return _longest_monotone_subsequence(seq, False, strict, key, False) def longest_increasing_subsequence_indices(seq: Sequence[T], strict=False, key: Callable = None) -> List[int]: """ Returns the indices of the longest increasing subsequence of the given sequence. There may be other increasing subsequences of the same length. >>> longest_increasing_subsequence_indices([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]) [0, 4, 6, 9, 13, 15] >>> longest_increasing_subsequence_indices([0, 0, 1, 2, 3, 2, 1, 0, 0]) [0, 1, 2, 3, 5] >>> longest_increasing_subsequence_indices([0, 0, 1, 2, 3, 2, 1, 0, 0], strict=True) [0, 2, 3, 4] :param seq: A sequence-like container of comparable objects. :param strict: Whether the subsequence must be strictly increasing. :param key: If not None, values in sequence are compared by comparing their keys. :return: A list of indices of the longest increasing subsequence in seq. """ return _longest_monotone_subsequence_indices(seq, True, strict, key) def longest_decreasing_subsequence_indices(seq: Sequence[T], strict=False, key: Callable = None) -> List[int]: """ Returns the indices of the longest decreasing subsequence of the given sequence. There may be other decreasing subsequences of the same length. >>> longest_decreasing_subsequence_indices([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]) [3, 5, 9, 10, 12] >>> longest_decreasing_subsequence_indices([0, 0, 1, 2, 3, 2, 1, 0, 0]) [4, 5, 6, 7, 8] >>> longest_decreasing_subsequence_indices([0, 0, 1, 2, 3, 2, 1, 0, 0], strict=True) [4, 5, 6, 7] :param seq: A sequence-like container of comparable objects. :param strict: Whether the subsequence must be strictly decreasing. :param key: If not None, values in sequence are compared by comparing their keys. :return: A list of indices of the longest decreasing subsequence in seq. """ try: return _longest_monotone_subsequence_indices(seq, False, strict, key, True) except TypeError: pass return _longest_monotone_subsequence_indices(seq, False, strict, key, False) def _longest_monotone_subsequence(seq: Sequence[T], increasing=True, strict=False, key: Callable = None, assume_negatable=True) -> List[T]: """ Returns the a list of the longest increasing (respectively decreasing) subsequence of the given sequence. There may be other increasing (respectively decreasing) subsequences of the same length. This is not a public function, use a longest_increasing_* or longest_decreasing_* function instead. :param seq: A sequence-like container of comparable objects. :param increasing: Whether the subsequence should be increasing or decreasing. :param strict: Whether the subsequence must be strictly monotone. :param key: If not None, values in sequence are compared by comparing their keys. :param assume_negatable: If True (the default), assume that negation (unary -) is defined and is order-reversing on objects or keys. For non-negatable types, set this option to False. :return: An iterator of indices of the longest monotone subsequence in seq. """ return [seq[idx] for idx in _longest_monotone_subsequence_indices_iter(seq, increasing, strict, key, assume_negatable)] def _longest_monotone_subsequence_indices(seq: Sequence[T], increasing=True, strict=False, key: Callable = None, assume_negatable=True) -> List[int]: """ Gives a list of the indices of the longest increasing (respectively decreasing) subsequence of the given sequence. There may be other increasing (respectively decreasing) subsequences of the same length. This is not a public function, use a longest_increasing_* or longest_decreasing_* function instead. :param seq: A sequence-like container of comparable objects. :param increasing: Whether the subsequence should be increasing or decreasing. :param strict: Whether the subsequence must be strictly monotone. :param key: If not None, values in sequence are compared by comparing their keys. :param assume_negatable: If True (the default), assume that negation (unary -) is defined and is order-reversing on objects or keys. For non-negatable types, set this option to False. :return: An iterator of indices of the longest monotone subsequence in seq. """ return list(_longest_monotone_subsequence_indices_iter(seq, increasing, strict, key, assume_negatable)) def _longest_monotone_subsequence_indices_iter(seq: Sequence[T], increasing=True, strict=False, key: Callable = None, assume_negatable=True) -> Iterator[int]: """ Yields the indices of the longest increasing (respectively decreasing) subsequence of the given sequence. There may be other monotone subsequences of the same length. This is not a public function, use a longest_increasing_* or longest_decreasing_* function instead. :param seq: A sequence-like container of comparable objects. :param increasing: Whether the subsequence should be increasing or decreasing. :param strict: Whether the subsequence must be strictly monotone. :param key: If not None, values in sequence are compared by comparing their keys. :param assume_negatable: If True (the default), assume that negation (unary -) is defined and is order-reversing on objects or keys. For non-negatable types, set this option to False. :return: An iterator of indices of the longest monotone subsequence in seq. """ if not seq: return (_ for _ in []) idx_prev_longest: List[Optional[int]] = [] idx_min_of_len_plus1: List[int] = [] # the index of the smallest value ending a subsequence of a given length+1 val_min_of_len_plus1: List[Any] = [] # the smallest value ending a subsequence of a given length+1 bisect = bisect_right if not strict else bisect_left key_fn = _choose_key_function(key, increasing, assume_negatable) keys = seq if key_fn is None else map(key_fn, seq) for i, curr_key in enumerate(keys): len_longest_extendable = bisect(val_min_of_len_plus1, curr_key) if len_longest_extendable == len(val_min_of_len_plus1): idx_min_of_len_plus1.append(i) val_min_of_len_plus1.append(curr_key) elif curr_key < val_min_of_len_plus1[len_longest_extendable]: idx_min_of_len_plus1[len_longest_extendable] = i val_min_of_len_plus1[len_longest_extendable] = curr_key idx_longest_extendable = idx_min_of_len_plus1[len_longest_extendable - 1] if len_longest_extendable else None idx_prev_longest.append(idx_longest_extendable) longest_subsequence_indices = _make_subsequence_indices(prev_indices=idx_prev_longest, terminal_idx=idx_min_of_len_plus1[-1]) return longest_subsequence_indices class _OrderReversed: """ A wrapper around any object that swaps its < and > operators (without touching the actual object). >>> _OrderReversed(0) > _OrderReversed(1) True >>> repr(_OrderReversed(0)) '_OrderReversed(0)' """ __slots__ = ('obj',) def __init__(self, o): self.obj = o def __lt__(self, other): return self.obj > other.obj def __gt__(self, other): return self.obj < other.obj def __repr__(self): return f'{self.__class__.__name__}({self.obj!r})' def _choose_key_function(key: Optional[Callable], increasing: bool, assume_negatable: bool) -> Optional[Callable]: """ Gives back the key function with its order optionally reversed. None represents the identity function. >>> _choose_key_function(None, True, True) is None True >>> _choose_key_function(None, True, False) is None True >>> fn = _choose_key_function(None, False, True) >>> fn(0) > fn(1) True >>> fn = _choose_key_function(None, False, False) >>> fn(0) > fn(1) True >>> fn = _choose_key_function(len, True, False) >>> fn("X") < fn("AA") True >>> fn = _choose_key_function(len, True, True) >>> fn("X") < fn("AA") True >>> fn = _choose_key_function(len, False, False) >>> fn("AA") < fn("X") True """ if key is None: if increasing: key_fn = None elif assume_negatable: key_fn = operator.neg else: def key_fn(v): return _OrderReversed(v) else: orig_key = key if increasing: key_fn = orig_key elif assume_negatable: def key_fn(v): return -orig_key(v) else: def key_fn(v): return _OrderReversed(orig_key(v)) return key_fn def _make_reversed_subsequence_indices(prev_indices: List[Optional[int]], terminal_idx: int) -> Iterator[int]: """ Given a list of indices representing pointers to parent, and given a terminal pointer, yields indices from the terminal to the root. >>> list(_make_reversed_subsequence_indices([None, 0, 0, 1, 2, 1], 5)) [5, 1, 0] """ idx: Optional[int] = terminal_idx while idx is not None: yield idx idx = prev_indices[idx] def _make_subsequence_indices(prev_indices: List[Optional[int]], terminal_idx: int) -> Iterator[int]: """ Given a list of indices representing pointers to parent, and given a terminal pointer, yields indices from the root to the terminal index. >>> list(_make_subsequence_indices([None, 0, 0, 1, 2, 1], 5)) [0, 1, 5] """ return reversed(list(_make_reversed_subsequence_indices(prev_indices, terminal_idx)))
41.603448
158
0.685371
1,693
12,065
4.706438
0.108092
0.016943
0.052711
0.006024
0.791667
0.751506
0.72239
0.704066
0.66742
0.645206
0
0.027887
0.218317
12,065
289
159
41.747405
0.816987
0.581517
0
0.192771
0
0
0.009622
0.008727
0
0
0
0
0
1
0.204819
false
0.024096
0.036145
0.072289
0.481928
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
1
0
0
0
0
0
0
0
5
2d5011c10a3c49eaed53c90bf000cdcefd5ebfbc
51
py
Python
visualdet3d/networks/detectors/__init__.py
tamnguyenvan/visualdet3d-tf
0c5b88e1aa61a75c1a8e3e1032aa7bcbd04b3bea
[ "Apache-2.0" ]
null
null
null
visualdet3d/networks/detectors/__init__.py
tamnguyenvan/visualdet3d-tf
0c5b88e1aa61a75c1a8e3e1032aa7bcbd04b3bea
[ "Apache-2.0" ]
null
null
null
visualdet3d/networks/detectors/__init__.py
tamnguyenvan/visualdet3d-tf
0c5b88e1aa61a75c1a8e3e1032aa7bcbd04b3bea
[ "Apache-2.0" ]
null
null
null
from .yolostereo3d_detector import YOLOStereo3DCore
51
51
0.921569
5
51
9.2
1
0
0
0
0
0
0
0
0
0
0
0.041667
0.058824
51
1
51
51
0.916667
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
2d77f1fde3a230ee5bcd78349c99a210bca0f69e
644
py
Python
aula7_classes_calculadora2.py
clovisdanielcosta/dio-python
764eaac06320c0531c3038e301eb4c002fe8afce
[ "MIT" ]
null
null
null
aula7_classes_calculadora2.py
clovisdanielcosta/dio-python
764eaac06320c0531c3038e301eb4c002fe8afce
[ "MIT" ]
null
null
null
aula7_classes_calculadora2.py
clovisdanielcosta/dio-python
764eaac06320c0531c3038e301eb4c002fe8afce
[ "MIT" ]
null
null
null
# Sem passar valores pelo init class Calculadora: # def __init__(self): # pass def soma(self, valor_a, valor_b): return valor_a + valor_b def subtracao(self, valor_a, valor_b): return valor_a - valor_b def multiplicacao(self, valor_a, valor_b): return valor_a * valor_b def divisao(self, valor_a, valor_b): return valor_a / valor_b if __name__ == '__main__': # Instanciando uma classe calculadora = Calculadora() print(calculadora.soma(10, 2)) print(calculadora.subtracao(10, 2)) print(calculadora.multiplicacao(10, 2)) print(calculadora.divisao(10, 2))
24.769231
46
0.661491
87
644
4.574713
0.310345
0.120603
0.221106
0.241206
0.364322
0.364322
0.364322
0.364322
0.364322
0.364322
0
0.02449
0.23913
644
26
47
24.769231
0.787755
0.125776
0
0
0
0
0.014311
0
0
0
0
0
0
1
0.266667
false
0
0
0.266667
0.6
0.266667
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
2da8aa8abcf15d665df739a031acd23037c32e66
148
py
Python
Python/Programming Fundamentals/Text Processing/13. Substring.py
teodoramilcheva/softuni-software-engineering
98dc9faa66f42570f6538fd7ef186d2bd1d39bff
[ "MIT" ]
null
null
null
Python/Programming Fundamentals/Text Processing/13. Substring.py
teodoramilcheva/softuni-software-engineering
98dc9faa66f42570f6538fd7ef186d2bd1d39bff
[ "MIT" ]
null
null
null
Python/Programming Fundamentals/Text Processing/13. Substring.py
teodoramilcheva/softuni-software-engineering
98dc9faa66f42570f6538fd7ef186d2bd1d39bff
[ "MIT" ]
null
null
null
first_str = input() second_str = input() while first_str in second_str: second_str = second_str.replace(first_str, '') print(second_str)
21.142857
51
0.716216
22
148
4.454545
0.363636
0.459184
0.306122
0.367347
0
0
0
0
0
0
0
0
0.175676
148
7
52
21.142857
0.803279
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.2
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2dec5ea7bf0248390057b295993ff4db6ec688e2
29
py
Python
editor.py
Commander07/Magnitude
2b793d0d9946f6b35c5935ae5921592e287bbbe7
[ "MIT" ]
6
2020-12-06T20:21:39.000Z
2021-06-29T06:37:40.000Z
editor.py
Commander07/Magnitude
2b793d0d9946f6b35c5935ae5921592e287bbbe7
[ "MIT" ]
null
null
null
editor.py
Commander07/Magnitude
2b793d0d9946f6b35c5935ae5921592e287bbbe7
[ "MIT" ]
null
null
null
import editor editor.start()
9.666667
14
0.793103
4
29
5.75
0.75
0
0
0
0
0
0
0
0
0
0
0
0.103448
29
2
15
14.5
0.884615
0
0
0
0
0
0
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
930840abae58f570788e4a4d4e3d260f0cec9bf1
156
py
Python
bayesiancoresets/coreset/__init__.py
trevorcampbell/hilbert-coresets
63354127953a432c0f35087cf5b75166f652a5f5
[ "MIT" ]
118
2018-02-10T21:33:57.000Z
2022-03-22T14:20:53.000Z
bayesiancoresets/coreset/__init__.py
trevorcampbell/hilbert-coresets
63354127953a432c0f35087cf5b75166f652a5f5
[ "MIT" ]
3
2018-09-07T16:13:22.000Z
2020-04-11T14:35:47.000Z
bayesiancoresets/coreset/__init__.py
trevorcampbell/hilbert-coresets
63354127953a432c0f35087cf5b75166f652a5f5
[ "MIT" ]
30
2018-03-11T02:37:55.000Z
2022-01-31T14:51:37.000Z
from .hilbert import HilbertCoreset from .sampling import UniformSamplingCoreset from .sparsevi import SparseVICoreset from .bpsvi import BatchPSVICoreset
26
44
0.865385
16
156
8.4375
0.625
0
0
0
0
0
0
0
0
0
0
0
0.108974
156
5
45
31.2
0.971223
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
9311781e5801a866e09b81d5366ba3fdcafbd49f
100
py
Python
src/modeling/__init__.py
clazaro97chosen/American-Community-Survey-Project
ac3f8c1231ea71bdd7fc7b8eceb8e69cd6d7b842
[ "MIT" ]
2
2019-07-22T20:53:47.000Z
2019-07-23T07:35:00.000Z
src/modeling/__init__.py
clazaro97chosen/American-Community-Survey-Project
ac3f8c1231ea71bdd7fc7b8eceb8e69cd6d7b842
[ "MIT" ]
null
null
null
src/modeling/__init__.py
clazaro97chosen/American-Community-Survey-Project
ac3f8c1231ea71bdd7fc7b8eceb8e69cd6d7b842
[ "MIT" ]
null
null
null
from .model_tryout import * from .prep_or_featureselection import * from .train_and_predict import *
33.333333
39
0.83
14
100
5.571429
0.714286
0.25641
0
0
0
0
0
0
0
0
0
0
0.11
100
3
40
33.333333
0.876404
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
9319d7925b2fbbe3bce92f3722a80861d80dbfcd
307
py
Python
Part_2_intermediate/mod_2/lesson_5/homework_3/shop/product.py
Mikma03/InfoShareacademy_Python_Courses
3df1008c8c92831bebf1625f960f25b39d6987e6
[ "MIT" ]
null
null
null
Part_2_intermediate/mod_2/lesson_5/homework_3/shop/product.py
Mikma03/InfoShareacademy_Python_Courses
3df1008c8c92831bebf1625f960f25b39d6987e6
[ "MIT" ]
null
null
null
Part_2_intermediate/mod_2/lesson_5/homework_3/shop/product.py
Mikma03/InfoShareacademy_Python_Courses
3df1008c8c92831bebf1625f960f25b39d6987e6
[ "MIT" ]
null
null
null
class Product: def __init__(self, name, category_name, unit_price): self.name = name self.category_name = category_name self.unit_price = unit_price def __str__(self): return f"Nazwa: {self.name} | Kategoria: {self.category_name} | Cena: {self.unit_price} PLN/szt"
30.7
104
0.664495
41
307
4.585366
0.414634
0.255319
0.170213
0
0
0
0
0
0
0
0
0
0.228013
307
9
105
34.111111
0.793249
0
0
0
0
0.142857
0.28013
0
0
0
0
0
0
1
0.285714
false
0
0
0.142857
0.571429
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
0
0
1
0
0
0
1
1
0
0
5
9331b255e437ab7681f4ec5d2447a1cee9ae7991
163
py
Python
diet/admin.py
EspeIgira/Health-Diet
a0314beb787e981a50946c64f6da30bd34897cc3
[ "MIT" ]
null
null
null
diet/admin.py
EspeIgira/Health-Diet
a0314beb787e981a50946c64f6da30bd34897cc3
[ "MIT" ]
null
null
null
diet/admin.py
EspeIgira/Health-Diet
a0314beb787e981a50946c64f6da30bd34897cc3
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Image,Category,Comment admin.site.register(Image) admin.site.register(Category) admin.site.register(Comment)
23.285714
42
0.828221
23
163
5.869565
0.478261
0.2
0.377778
0
0
0
0
0
0
0
0
0
0.07362
163
6
43
27.166667
0.89404
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
9358369c31df4ae4a01b224b2e773a052a7a8a91
43
py
Python
lib/pyfrc/wpilib/__init__.py
VikingRobotics/pyfrc
8db0f778586684cc6477a4c0b9600621a1a6a78f
[ "MIT" ]
1
2015-12-23T04:25:19.000Z
2015-12-23T04:25:19.000Z
lib/pyfrc/wpilib/__init__.py
VikingRobotics/pyfrc
8db0f778586684cc6477a4c0b9600621a1a6a78f
[ "MIT" ]
null
null
null
lib/pyfrc/wpilib/__init__.py
VikingRobotics/pyfrc
8db0f778586684cc6477a4c0b9600621a1a6a78f
[ "MIT" ]
null
null
null
from .core import * from ..main import run
14.333333
22
0.72093
7
43
4.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.186047
43
2
23
21.5
0.885714
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
fa85cc4a201b5e86ee944f20d89b535ab601281b
46
py
Python
MYgames_package/MYgames/__main__.py
MandiYang/MYgames
9e6f56d35b1dba9c77c2703d9497f52a15d7773a
[ "MIT" ]
1
2021-04-06T10:51:44.000Z
2021-04-06T10:51:44.000Z
MYgames_package/MYgames/__main__.py
MandiYang/MYgames
9e6f56d35b1dba9c77c2703d9497f52a15d7773a
[ "MIT" ]
null
null
null
MYgames_package/MYgames/__main__.py
MandiYang/MYgames
9e6f56d35b1dba9c77c2703d9497f52a15d7773a
[ "MIT" ]
null
null
null
print('Hello') print('Package name: MYgames')
15.333333
30
0.717391
6
46
5.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.086957
46
2
31
23
0.785714
0
0
0
0
0
0.565217
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
facf749e9986898c70d727ba5e4ef521e3a8fe89
201
py
Python
replica/contrib/whisper/urls.py
underlost/Replica
2f092d3fc215b950fa6e409980a3f3e7c3633f7c
[ "MIT" ]
null
null
null
replica/contrib/whisper/urls.py
underlost/Replica
2f092d3fc215b950fa6e409980a3f3e7c3633f7c
[ "MIT" ]
null
null
null
replica/contrib/whisper/urls.py
underlost/Replica
2f092d3fc215b950fa6e409980a3f3e7c3633f7c
[ "MIT" ]
null
null
null
from __future__ import absolute_import from django.conf.urls import * from django.views.generic import TemplateView from django.views.decorators.cache import cache_page urlpatterns = patterns('', )
20.1
52
0.81592
26
201
6.076923
0.576923
0.189873
0.202532
0
0
0
0
0
0
0
0
0
0.114428
201
9
53
22.333333
0.88764
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
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
faec3380f42e1e36b9d15f0c84d075132519f2d2
53
py
Python
pun/__main__.py
Unviray/pun
ee943e0bb6f659913a9ce6403ebb375582327a11
[ "MIT" ]
2
2020-05-12T18:44:18.000Z
2020-05-16T19:56:31.000Z
pun/__main__.py
Unviray/pun
ee943e0bb6f659913a9ce6403ebb375582327a11
[ "MIT" ]
null
null
null
pun/__main__.py
Unviray/pun
ee943e0bb6f659913a9ce6403ebb375582327a11
[ "MIT" ]
null
null
null
import sys from .cli import main sys.exit(main())
7.571429
21
0.698113
9
53
4.111111
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.188679
53
6
22
8.833333
0.860465
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
877e42200d3c70035d99f65300fe05e8d2cbdc0d
654
py
Python
Node3D/base/data/Math.py
ArnoChenFx/Node3D
30fe58cced3a8580eb129475925eb797e6065067
[ "MIT" ]
3
2020-09-09T15:42:46.000Z
2021-07-24T13:58:56.000Z
Node3D/base/data/Math.py
ArnoChenFx/Node3D
30fe58cced3a8580eb129475925eb797e6065067
[ "MIT" ]
null
null
null
Node3D/base/data/Math.py
ArnoChenFx/Node3D
30fe58cced3a8580eb129475925eb797e6065067
[ "MIT" ]
1
2021-10-17T12:21:39.000Z
2021-10-17T12:21:39.000Z
import numpy as np def clamp(value, min, max): return np.clip(value, min, max) def lerp(a, b, fraction): fraction = clamp(fraction, 0, 1) return a * (1 - fraction) + b * fraction def fit(value, omin, omax, nmin, nmax): v = (value - omin) / (omax - omin) return v * (nmax - nmin) + nmin def fit01(value, min, max): return value * (max - min) + min def fit10(value, min, max): return (1.0 - value) * (max - min) + min def fit11(value, min, max): return fit(value, -1, 1, min, max) def fit_to_01(value, min, max): return (value - min) / (max - min) def fit_11_to_01(value): return (value + 1.0) * 0.5
18.166667
44
0.588685
106
654
3.584906
0.283019
0.126316
0.202632
0.223684
0.192105
0
0
0
0
0
0
0.047131
0.253823
654
35
45
18.685714
0.731557
0
0
0
0
0
0
0
0
0
0
0
0
1
0.421053
false
0
0.052632
0.315789
0.894737
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
87c002aa3b675c02715b1c61fecb47896095690b
17,669
py
Python
tests/ut/python/mindrecord/test_tfrecord_to_mr.py
shaolei-wang/mindspore
2d50a43be9d17269f6adb41e51b8f7a540ebc9f1
[ "Apache-2.0" ]
1
2020-06-20T06:22:41.000Z
2020-06-20T06:22:41.000Z
tests/ut/python/mindrecord/test_tfrecord_to_mr.py
shaolei-wang/mindspore
2d50a43be9d17269f6adb41e51b8f7a540ebc9f1
[ "Apache-2.0" ]
null
null
null
tests/ut/python/mindrecord/test_tfrecord_to_mr.py
shaolei-wang/mindspore
2d50a43be9d17269f6adb41e51b8f7a540ebc9f1
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Huawei Technologies Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """test tfrecord to mindrecord tool""" import collections from importlib import import_module import os import numpy as np import pytest from mindspore import log as logger from mindspore.mindrecord import FileReader from mindspore.mindrecord import TFRecordToMR SupportedTensorFlowVersion = '2.1.0' try: tf = import_module("tensorflow") # just used to convert tfrecord to mindrecord except ModuleNotFoundError: logger.warning("tensorflow module not found.") tf = None TFRECORD_DATA_DIR = "../data/mindrecord/testTFRecordData" TFRECORD_FILE_NAME = "test.tfrecord" MINDRECORD_FILE_NAME = "test.mindrecord" PARTITION_NUM = 1 def verify_data(transformer, reader): """Verify the data by read from mindrecord""" tf_iter = transformer.tfrecord_iterator() mr_iter = reader.get_next() count = 0 for tf_item, mr_item in zip(tf_iter, mr_iter): count = count + 1 assert len(tf_item) == 6 assert len(mr_item) == 6 for key, value in tf_item.items(): logger.info("key: {}, tfrecord: value: {}, mindrecord: value: {}".format(key, value, mr_item[key])) if isinstance(value, np.ndarray): assert (value == mr_item[key]).all() else: assert value == mr_item[key] assert count == 10 def generate_tfrecord(): def create_int_feature(values): if isinstance(values, list): feature = tf.train.Feature(int64_list=tf.train.Int64List(value=list(values))) # values: [int, int, int] else: feature = tf.train.Feature(int64_list=tf.train.Int64List(value=[values])) # values: int return feature def create_float_feature(values): if isinstance(values, list): feature = tf.train.Feature(float_list=tf.train.FloatList(value=list(values))) # values: [float, float] else: feature = tf.train.Feature(float_list=tf.train.FloatList(value=[values])) # values: float return feature def create_bytes_feature(values): if isinstance(values, bytes): feature = tf.train.Feature(bytes_list=tf.train.BytesList(value=[values])) # values: bytes else: # values: string feature = tf.train.Feature(bytes_list=tf.train.BytesList(value=[bytes(values, encoding='utf-8')])) return feature writer = tf.io.TFRecordWriter(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) example_count = 0 for i in range(10): file_name = "000" + str(i) + ".jpg" image_bytes = bytes(str("aaaabbbbcccc" + str(i)), encoding="utf-8") int64_scalar = i float_scalar = float(i) int64_list = [i, i+1, i+2, i+3, i+4, i+1234567890] float_list = [float(i), float(i+1), float(i+2.8), float(i+3.2), float(i+4.4), float(i+123456.9), float(i+98765432.1)] features = collections.OrderedDict() features["file_name"] = create_bytes_feature(file_name) features["image_bytes"] = create_bytes_feature(image_bytes) features["int64_scalar"] = create_int_feature(int64_scalar) features["float_scalar"] = create_float_feature(float_scalar) features["int64_list"] = create_int_feature(int64_list) features["float_list"] = create_float_feature(float_list) tf_example = tf.train.Example(features=tf.train.Features(feature=features)) writer.write(tf_example.SerializeToString()) example_count += 1 writer.close() logger.info("Write {} rows in tfrecord.".format(example_count)) def test_tfrecord_to_mindrecord(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([], tf.int64), "float_scalar": tf.io.FixedLenFeature([], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) tfrecord_transformer.transform() assert os.path.exists(MINDRECORD_FILE_NAME) assert os.path.exists(MINDRECORD_FILE_NAME + ".db") fr_mindrecord = FileReader(MINDRECORD_FILE_NAME) verify_data(tfrecord_transformer, fr_mindrecord) os.remove(MINDRECORD_FILE_NAME) os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_scalar_with_1(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([1], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) tfrecord_transformer.transform() assert os.path.exists(MINDRECORD_FILE_NAME) assert os.path.exists(MINDRECORD_FILE_NAME + ".db") fr_mindrecord = FileReader(MINDRECORD_FILE_NAME) verify_data(tfrecord_transformer, fr_mindrecord) os.remove(MINDRECORD_FILE_NAME) os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_scalar_with_1_list_small_len_exception(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([1], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([2], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") with pytest.raises(ValueError): tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) tfrecord_transformer.transform() if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_list_with_diff_type_exception(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([1], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.float32), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") with pytest.raises(ValueError): tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) tfrecord_transformer.transform() if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_list_without_bytes_type(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([1], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict) tfrecord_transformer.transform() assert os.path.exists(MINDRECORD_FILE_NAME) assert os.path.exists(MINDRECORD_FILE_NAME + ".db") fr_mindrecord = FileReader(MINDRECORD_FILE_NAME) verify_data(tfrecord_transformer, fr_mindrecord) os.remove(MINDRECORD_FILE_NAME) os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_scalar_with_2_exception(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([2], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) with pytest.raises(ValueError): tfrecord_transformer.transform() if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_scalar_string_with_1_exception(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([1], tf.string), "image_bytes": tf.io.FixedLenFeature([], tf.string), "int64_scalar": tf.io.FixedLenFeature([1], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") with pytest.raises(ValueError): tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) tfrecord_transformer.transform() if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) def test_tfrecord_to_mindrecord_scalar_bytes_with_10_exception(): """test transform tfrecord to mindrecord.""" if not tf or tf.__version__ < SupportedTensorFlowVersion: # skip the test logger.warning("Module tensorflow is not found or version wrong, \ please use pip install it / reinstall version >= {}.".format(SupportedTensorFlowVersion)) return generate_tfrecord() assert os.path.exists(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME)) feature_dict = {"file_name": tf.io.FixedLenFeature([], tf.string), "image_bytes": tf.io.FixedLenFeature([10], tf.string), "int64_scalar": tf.io.FixedLenFeature([1], tf.int64), "float_scalar": tf.io.FixedLenFeature([1], tf.float32), "int64_list": tf.io.FixedLenFeature([6], tf.int64), "float_list": tf.io.FixedLenFeature([7], tf.float32), } if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") with pytest.raises(ValueError): tfrecord_transformer = TFRecordToMR(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME), MINDRECORD_FILE_NAME, feature_dict, ["image_bytes"]) tfrecord_transformer.transform() if os.path.exists(MINDRECORD_FILE_NAME): os.remove(MINDRECORD_FILE_NAME) if os.path.exists(MINDRECORD_FILE_NAME + ".db"): os.remove(MINDRECORD_FILE_NAME + ".db") os.remove(os.path.join(TFRECORD_DATA_DIR, TFRECORD_FILE_NAME))
44.062344
116
0.65929
2,143
17,669
5.19412
0.090527
0.081215
0.1229
0.063247
0.792561
0.782769
0.780433
0.777109
0.777109
0.773426
0
0.016025
0.226555
17,669
400
117
44.1725
0.798478
0.068482
0
0.696246
0
0
0.058666
0.002137
0
0
0
0
0.064846
1
0.044369
false
0
0.030717
0
0.112628
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
87d4f9c826f08464fc765d8905f55854046c868e
147
py
Python
app/views.py
configuresystems/restful-api-with-flask
b6e4da905446fac8f899653a6f7a5408d6419fc4
[ "MIT" ]
2
2015-05-07T18:39:12.000Z
2016-07-01T20:06:06.000Z
app/views.py
configuresystems/restful-api-with-flask
b6e4da905446fac8f899653a6f7a5408d6419fc4
[ "MIT" ]
null
null
null
app/views.py
configuresystems/restful-api-with-flask
b6e4da905446fac8f899653a6f7a5408d6419fc4
[ "MIT" ]
2
2016-03-02T05:33:51.000Z
2021-02-24T02:28:26.000Z
"""So that we can modularize our application, we will use this as our our master file for application endpoints""" from .modules.todo import views
36.75
69
0.782313
24
147
4.791667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.156463
147
3
70
49
0.927419
0.734694
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