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
200a527463fed1c5236d79c39552011d474fda80
300
py
Python
server/azure_text_fetcher.py
indjev99/Manga-Reader
60073a4cd90a584b1cb97e4f4b55b5bd16491694
[ "MIT" ]
5
2019-11-18T16:41:07.000Z
2022-03-21T12:41:42.000Z
server/azure_text_fetcher.py
indjev99/Manga-Reader
60073a4cd90a584b1cb97e4f4b55b5bd16491694
[ "MIT" ]
1
2022-01-23T15:19:22.000Z
2022-01-23T15:23:12.000Z
server/azure_text_fetcher.py
indjev99/Manga-Reader
60073a4cd90a584b1cb97e4f4b55b5bd16491694
[ "MIT" ]
null
null
null
# azure_text_fetcher.py from azure_english_text_fetcher import analyze_english_text from azure_japanese_text_fetcher import analyze_japanese_text def analyze_text(image_url, in_lang): if in_lang == 'ja': return analyze_japanese_text(image_url) else: return analyze_english_text(image_url)
30
63
0.836667
46
300
4.978261
0.391304
0.144105
0.157205
0.209607
0
0
0
0
0
0
0
0
0.11
300
9
64
33.333333
0.857678
0.07
0
0
0
0
0.007246
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.6
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
20141ebeecc35d75df03a924a565a9dfdd305924
97
py
Python
venv/src/initialPage/apps.py
YUVRAJ-GIT-ZERO-HERO/Case-Study
499c32800648f5fc28c9f163f97ea41b474ac71b
[ "MIT" ]
null
null
null
venv/src/initialPage/apps.py
YUVRAJ-GIT-ZERO-HERO/Case-Study
499c32800648f5fc28c9f163f97ea41b474ac71b
[ "MIT" ]
null
null
null
venv/src/initialPage/apps.py
YUVRAJ-GIT-ZERO-HERO/Case-Study
499c32800648f5fc28c9f163f97ea41b474ac71b
[ "MIT" ]
null
null
null
from django.apps import AppConfig class InitialpageConfig(AppConfig): name = 'initialPage'
16.166667
35
0.773196
10
97
7.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.154639
97
5
36
19.4
0.914634
0
0
0
0
0
0.113402
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
201bf7a195011fb737ba54c4913960dfe2990d32
4,571
py
Python
tests/datastore/test_dataset_descriptor.py
VizierDB/web-api-async
e99f43df3df80ad5647f57d805c339257336ac73
[ "ECL-2.0", "Apache-2.0" ]
2
2019-10-21T03:01:39.000Z
2020-06-05T01:43:00.000Z
tests/datastore/test_dataset_descriptor.py
VizierDB/web-api-async
e99f43df3df80ad5647f57d805c339257336ac73
[ "ECL-2.0", "Apache-2.0" ]
56
2019-07-12T21:16:03.000Z
2020-11-06T23:29:22.000Z
tests/datastore/test_dataset_descriptor.py
VizierDB/web-api-async
e99f43df3df80ad5647f57d805c339257336ac73
[ "ECL-2.0", "Apache-2.0" ]
2
2020-02-07T19:56:55.000Z
2020-08-07T11:17:51.000Z
"""Test functionality of the dataset descriptor.""" import os import shutil import unittest from vizier.datastore.dataset import DatasetColumn, DatasetDescriptor class TestDatasetDescriptor(unittest.TestCase): def test_column_index(self): """Test access to columns based on identifier and name.""" ds = DatasetDescriptor( identifier='0', name='0', columns=[ DatasetColumn(identifier=0, name='ABC'), DatasetColumn(identifier=1, name='A'), DatasetColumn(identifier=2, name='ABC'), DatasetColumn(identifier=3, name='DEF'), DatasetColumn(identifier=4, name='xyz'), ] ) # Get column by identifier self.assertEqual(ds.column_by_id(0).name, 'ABC') self.assertEqual(ds.column_by_id(1).name, 'A') self.assertEqual(ds.column_by_id(2).name, 'ABC') self.assertEqual(ds.column_by_id(3).name, 'DEF') self.assertEqual(ds.column_by_id(4).name, 'xyz') with self.assertRaises(ValueError): ds.column_by_id(6) with self.assertRaises(ValueError): ds.column_by_id(-1) # Get column by name self.assertEqual(ds.column_by_name('ABC').identifier, 0) self.assertEqual(ds.column_by_name('A').identifier, 1) self.assertEqual(ds.column_by_name('abc', ignore_case=True).identifier, 0) self.assertEqual(ds.column_by_name('XYZ', ignore_case=True).identifier, 4) self.assertIsNone(ds.column_by_name('4')) # Get column index self.assertEqual(ds.column_index(0), 0) self.assertEqual(ds.column_index(1), 1) self.assertEqual(ds.column_index('DEF'), 3) self.assertEqual(ds.column_index('XYZ'), 4) self.assertEqual(ds.column_index('A'), 1) self.assertEqual(ds.column_index('B'), 1) self.assertEqual(ds.column_index('C'), 2) self.assertEqual(ds.column_index('D'), 3) self.assertEqual(ds.column_index('E'), 4) for i in range(len(ds.columns)): self.assertEqual(ds.get_index(i), i) with self.assertRaises(ValueError): ds.column_index('ABC') with self.assertRaises(ValueError): ds.column_index('abc') # Create a descriptor when column identifier does not match the index # position in the schema ds = DatasetDescriptor( identifier='0', name='0', columns=[ DatasetColumn(identifier=4, name='ABC'), DatasetColumn(identifier=2, name='A'), DatasetColumn(identifier=3, name='ABC'), DatasetColumn(identifier=0, name='DEF'), DatasetColumn(identifier=1, name='xyz'), ] ) self.assertEqual(ds.column_by_id(0).name, 'DEF') self.assertEqual(ds.column_by_id(1).name, 'xyz') self.assertEqual(ds.column_by_id(2).name, 'A') self.assertEqual(ds.column_by_id(3).name, 'ABC') self.assertEqual(ds.column_by_id(4).name, 'ABC') self.assertEqual(ds.column_index(0), 0) self.assertEqual(ds.column_index(1), 1) self.assertEqual(ds.column_index('DEF'), 3) self.assertEqual(ds.column_index('XYZ'), 4) self.assertEqual(ds.column_index('A'), 1) self.assertEqual(ds.column_index('B'), 1) self.assertEqual(ds.column_index('C'), 2) self.assertEqual(ds.column_index('D'), 3) self.assertEqual(ds.column_index('E'), 4) self.assertEqual(ds.get_index(0), 3) self.assertEqual(ds.get_index(1), 4) self.assertEqual(ds.get_index(2), 1) self.assertEqual(ds.get_index(3), 2) self.assertEqual(ds.get_index(4), 0) def test_unique_name(self): """Test method that computes unique column names.""" ds = DatasetDescriptor( identifier='0', name='0', columns=[ DatasetColumn(identifier=0, name='ABC'), DatasetColumn(identifier=1, name='A'), DatasetColumn(identifier=2, name='ABC_1'), DatasetColumn(identifier=3, name='DEF'), DatasetColumn(identifier=4, name='xyz'), ] ) self.assertEqual(ds.get_unique_name('Age'), 'Age') self.assertEqual(ds.get_unique_name('XYZ'), 'XYZ_1') self.assertEqual(ds.get_unique_name('xyz'), 'xyz_1') self.assertEqual(ds.get_unique_name('ABC'), 'ABC_2') if __name__ == '__main__': unittest.main()
41.18018
82
0.602713
560
4,571
4.766071
0.133929
0.236043
0.267516
0.275759
0.735107
0.696516
0.665043
0.641064
0.440989
0.390408
0
0.021797
0.257274
4,571
110
83
41.554545
0.764359
0.065194
0
0.446809
0
0
0.035269
0
0
0
0
0
0.5
1
0.021277
false
0
0.042553
0
0.074468
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
6469d1e6007e8a63eefb35620ae04d9cf89cc980
353
py
Python
clubadmin/shared/utils/ui_valid.py
rpmoseley/clubadmin
35d0094ea5e97e8478ca021ab8e422cebbc26263
[ "MIT" ]
null
null
null
clubadmin/shared/utils/ui_valid.py
rpmoseley/clubadmin
35d0094ea5e97e8478ca021ab8e422cebbc26263
[ "MIT" ]
null
null
null
clubadmin/shared/utils/ui_valid.py
rpmoseley/clubadmin
35d0094ea5e97e8478ca021ab8e422cebbc26263
[ "MIT" ]
null
null
null
''' This module provides validators that are shared across all the sub-packages of the clubadmin package in order to reduce the duplication of code. ''' def PhoneValidator(value, *args, **kwds): pass def MobileValidator(value, *args, **kwds): pass def EmailValidator(value, *args, **kwds): pass def LifeValidator(value, *args, **kwds): pass
20.764706
82
0.725212
48
353
5.333333
0.625
0.140625
0.203125
0.265625
0.234375
0
0
0
0
0
0
0
0.161473
353
16
83
22.0625
0.864865
0.407932
0
0.5
0
0
0
0
0
0
0
0
0
1
0.5
false
0.5
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
64931232004072883ce851b48a242675e2519397
265
py
Python
nntoolbox/utils/__init__.py
nhatsmrt/nn-toolbox
689b9924d3c88a433f8f350b89c13a878ac7d7c3
[ "Apache-2.0" ]
16
2019-07-11T15:57:41.000Z
2020-09-08T13:52:45.000Z
nntoolbox/utils/__init__.py
nhatsmrt/nn-toolbox
689b9924d3c88a433f8f350b89c13a878ac7d7c3
[ "Apache-2.0" ]
1
2022-01-18T22:21:57.000Z
2022-01-18T22:21:57.000Z
nntoolbox/utils/__init__.py
nhatsmrt/nn-toolbox
689b9924d3c88a433f8f350b89c13a878ac7d7c3
[ "Apache-2.0" ]
1
2019-08-07T10:07:09.000Z
2019-08-07T10:07:09.000Z
"""Some generic utilities function for neural networks""" from .lr_finder import * from .utils import * from .gradient import * from .data import * from .sampler import * from .colab import * from .transfer import * from .norm_dist import * from .download import *
24.090909
57
0.74717
36
265
5.444444
0.555556
0.408163
0
0
0
0
0
0
0
0
0
0
0.162264
265
10
58
26.5
0.882883
0.192453
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
b37bb63b2c812a9ff3541b74efa123f9e80832f1
167
py
Python
src/untp/__init__.py
coder-lipenghui/untp
e2535af0167ea83054b045328630b9d372025223
[ "MIT" ]
161
2015-04-19T00:45:38.000Z
2022-03-13T04:46:25.000Z
src/untp/__init__.py
coder-lipenghui/untp
e2535af0167ea83054b045328630b9d372025223
[ "MIT" ]
22
2016-01-30T13:37:05.000Z
2021-06-13T11:51:30.000Z
src/untp/__init__.py
coder-lipenghui/untp
e2535af0167ea83054b045328630b9d372025223
[ "MIT" ]
79
2015-04-20T05:46:03.000Z
2022-02-16T08:56:21.000Z
# -*- coding: utf-8 -*- try: from untp import unpacker_dir, unpacker except: from untp.untp import unpacker_dir, unpacker __all__ = [ "unpacker_dir", "unpacker" ]
16.7
45
0.706587
22
167
5.045455
0.5
0.297297
0.513514
0.378378
0.522523
0
0
0
0
0
0
0.007143
0.161677
167
10
46
16.7
0.785714
0.125749
0
0
0
0
0.137931
0
0
0
0
0
0
1
0
false
0
0.285714
0
0.285714
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b39008a8069879ec4d9e451b1d7226440f40bd36
100
py
Python
algorithm/numberTheory/fibonacci.py
joway/PyAlgorithm
0420fbcbebad3b746db63b9e9a5878b4af8ad6ac
[ "MIT" ]
1
2016-08-23T14:24:44.000Z
2016-08-23T14:24:44.000Z
algorithm/numberTheory/fibonacci.py
joway/PyAlgorithm
0420fbcbebad3b746db63b9e9a5878b4af8ad6ac
[ "MIT" ]
null
null
null
algorithm/numberTheory/fibonacci.py
joway/PyAlgorithm
0420fbcbebad3b746db63b9e9a5878b4af8ad6ac
[ "MIT" ]
null
null
null
import numpy def fibonacci_log_n(n): mat = numpy.matrix([[1, 1], [1, 0]]) return mat ** n
14.285714
40
0.58
17
100
3.294118
0.647059
0.071429
0
0
0
0
0
0
0
0
0
0.052632
0.24
100
6
41
16.666667
0.684211
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
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
b3b03d577fb1f71d5138f08d1d1f9cae173f3e91
646
py
Python
logs/admin.py
luisza/vcl_django
43d04f7951cb8805502e51f6f6360c7ec63215cc
[ "Apache-2.0" ]
null
null
null
logs/admin.py
luisza/vcl_django
43d04f7951cb8805502e51f6f6360c7ec63215cc
[ "Apache-2.0" ]
null
null
null
logs/admin.py
luisza/vcl_django
43d04f7951cb8805502e51f6f6360c7ec63215cc
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin # Register your models here. from logs.models import (Log, Sublog, Loginlog, Querylog, Connectlog, Computerloadlog, Changelog, Xmlrpclog, Natlog) admin.site.register([Log, Sublog, Loginlog, Querylog, Connectlog, Computerloadlog, Changelog, Xmlrpclog, Natlog])
29.363636
40
0.363777
34
646
6.911765
0.588235
0.076596
0.144681
0.212766
0.629787
0.629787
0.629787
0.629787
0.629787
0
0
0
0.592879
646
22
41
29.363636
0.893536
0.040248
0
0.736842
0
0
0
0
0
0
0
0
0
1
0
true
0
0.105263
0
0.105263
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
373fd87593e64609dc4d7ee79ae25445b8555b20
91
py
Python
peryton/Swift/__init__.py
jweinst1/Peryton
250fba0bf35d27c9d0e9a96d4adfdf92987189e0
[ "Apache-2.0" ]
97
2016-05-30T08:02:53.000Z
2022-03-25T05:38:19.000Z
peryton/Swift/__init__.py
jweinst1/Peryton
250fba0bf35d27c9d0e9a96d4adfdf92987189e0
[ "Apache-2.0" ]
3
2016-12-26T05:18:06.000Z
2022-03-20T22:52:41.000Z
peryton/Swift/__init__.py
jweinst1/Peryton
250fba0bf35d27c9d0e9a96d4adfdf92987189e0
[ "Apache-2.0" ]
30
2016-10-13T05:42:02.000Z
2022-03-05T05:22:55.000Z
#Package that contains the tools to write parsed python code into the desired Swift format
45.5
90
0.824176
15
91
5
0.933333
0
0
0
0
0
0
0
0
0
0
0
0.164835
91
1
91
91
0.986842
0.978022
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
37662e04a7e5bc65e68fa83ec850906370221572
163
py
Python
tour/filters.py
wesokes/django-tour
fbe1d2eefb80507cf3468c7dc9900a991e27b42c
[ "MIT" ]
24
2015-02-20T23:56:13.000Z
2021-10-06T18:01:22.000Z
tour/filters.py
wesokes/django-tour
fbe1d2eefb80507cf3468c7dc9900a991e27b42c
[ "MIT" ]
4
2015-01-05T16:03:42.000Z
2016-01-23T08:48:16.000Z
tour/filters.py
wesokes/django-tour
fbe1d2eefb80507cf3468c7dc9900a991e27b42c
[ "MIT" ]
12
2015-04-01T19:11:27.000Z
2021-09-18T12:59:18.000Z
import django_filters from tour.models import Tour class TourFilter(django_filters.FilterSet): class Meta: model = Tour fields = ('name',)
14.818182
43
0.674847
19
163
5.684211
0.684211
0.240741
0
0
0
0
0
0
0
0
0
0
0.245399
163
10
44
16.3
0.878049
0
0
0
0
0
0.02454
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
377fce90b08acc5b911e495f5e9711156199d5fc
5,846
py
Python
examples/ex1_bitmap_bender.py
sparkfun/Qwiic_OLED_Base_Py
d804695ce0091160b21b254349f73a41ce373182
[ "MIT" ]
null
null
null
examples/ex1_bitmap_bender.py
sparkfun/Qwiic_OLED_Base_Py
d804695ce0091160b21b254349f73a41ce373182
[ "MIT" ]
null
null
null
examples/ex1_bitmap_bender.py
sparkfun/Qwiic_OLED_Base_Py
d804695ce0091160b21b254349f73a41ce373182
[ "MIT" ]
1
2021-06-28T15:45:10.000Z
2021-06-28T15:45:10.000Z
#!/usr/bin/env python #----------------------------------------------------------------------------- # ex1_bitmap_bender.py # # Simple Example for the Qwiic Micro OLED display #------------------------------------------------------------------------ # # Written by SparkFun Electronics, May 2021 # # This python library supports the SparkFun Electroncis qwiic # qwiic sensor/board ecosystem on a Raspberry Pi (and compatable) single # board computers. # # More information on qwiic is at https:# www.sparkfun.com/qwiic # # Do you like this library? Help support SparkFun. Buy a board! # #================================================================================== # Copyright (c) 2021 SparkFun Electronics # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. #================================================================================== # Example 1 - Simple example to display a bitmap on the Qwiic Micro OLED board. # from __future__ import print_function import qwiic_oled_base import time import sys bender = [ \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xBF, 0xDF, 0x5F, 0x5F, 0x5F, 0x5F,\ 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F,\ 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F,\ 0x5F, 0xDF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xF9, 0xFE, 0x07, 0x01, 0x00, 0x00, 0xF8, 0xFE, 0xFF,\ 0xFF, 0xFF, 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00,\ 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0x1F, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF8,\ 0x00, 0x00, 0x01, 0x07, 0xFE, 0xF9, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF9, 0xE7, 0xDC, 0xB0, 0xA0, 0x40, 0x41, 0x47, 0x4F,\ 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x4F, 0x47, 0x43, 0x40, 0x40, 0x40, 0x40,\ 0x43, 0x47, 0x4F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x4F, 0x47, 0x43, 0x40,\ 0x40, 0xA0, 0xB0, 0xDE, 0xE7, 0xF9, 0xFE, 0x1F, 0x0F, 0x07, 0x73, 0x79, 0xFF, 0xFF, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F,\ 0xBF, 0x5F, 0xEF, 0x0F, 0xEF, 0xEF, 0xDF, 0xDF, 0x1F, 0xDF, 0xDF, 0xDF, 0xDF, 0x1F, 0xDF, 0xDF,\ 0xDF, 0xDF, 0xDF, 0x1F, 0xDF, 0xDF, 0xDF, 0xEF, 0x0F, 0xEF, 0xDF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFF,\ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xBE, 0x9C, 0xC0, 0xE0, 0xF0, 0xF9, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0,\ 0xB7, 0x6F, 0xEE, 0x00, 0xDE, 0xDE, 0xDE, 0xDD, 0x00, 0xDD, 0xDD, 0xDD, 0xDD, 0x00, 0xDD, 0xDD,\ 0xDD, 0xC5, 0xC1, 0x00, 0xC9, 0xC5, 0xC1, 0x01, 0xC8, 0xC4, 0x42, 0x80, 0xC0, 0xE8, 0xE4, 0xE2,\ 0xE0, 0xE0, 0xEF, 0xEF, 0xE6, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFE, 0xFE, 0xFD, 0xFD, 0xFD, 0xFB, 0xF8, 0xFB, 0xFB, 0xFB, 0xFB, 0xF8, 0xFB, 0xFB,\ 0xFB, 0xFB, 0xFB, 0xF8, 0xFB, 0xFD, 0xFD, 0xFC, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ] def runExample(): # These three lines of code are all you need to initialize the # OLED and print the splash screen. # Before you can start using the OLED, call begin() to init # all of the pins and configure the OLED. print("\nSparkFun Micro OLED Bitmap Example\n") myOLED = qwiic_oled_base.QwiicOledBase() # By default, the superclass/base Python package loads the parameters # for the Qwiic Micro OLED board. if not myOLED.connected: print("The Qwiic Micro OLED device isn't connected to the system. Please check your connection", \ file=sys.stderr) return myOLED.begin() # clear(ALL) will clear out the OLED's graphic memory. myOLED.clear(myOLED.ALL) # Clear the display's memory (gets rid of artifacts) # Display buffer contents myOLED.display() time.sleep(3) # clear(PAGE) will clear the Arduino's display buffer. myOLED.clear(myOLED.PAGE) # Clear the display's buffer # Display buffer contents myOLED.display() time.sleep(3) # Draw Bitmap # --------------------------------------------------------------------------- # Add bitmap to buffer myOLED.draw_bitmap(bender) # To actually draw anything on the display, you must call the display() function. myOLED.display() if __name__ == '__main__': try: runExample() except (KeyboardInterrupt, SystemExit) as exErr: print("\nEnding OLED bitmap Example") sys.exit(0)
47.145161
102
0.653267
838
5,846
4.533413
0.312649
0.277968
0.375888
0.454857
0.325086
0.293762
0.269545
0.251645
0.21374
0.21374
0
0.124534
0.174478
5,846
123
103
47.528455
0.662661
0.442525
0
0.134615
0
0
0.050281
0
0
0
0.4797
0
0
1
0.019231
false
0
0.076923
0
0.115385
0.076923
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
1
0
0
0
0
0
0
0
0
0
0
0
4
37c851530cb11eef30b83adde767f4d40d9c1812
112
py
Python
projects/PointsColletion/pointscollection/layers/emd/__init__.py
li-haoran/detectron2
84aebaaed19b07cce9dfd579f98b09ad4ed22e90
[ "Apache-2.0" ]
null
null
null
projects/PointsColletion/pointscollection/layers/emd/__init__.py
li-haoran/detectron2
84aebaaed19b07cce9dfd579f98b09ad4ed22e90
[ "Apache-2.0" ]
null
null
null
projects/PointsColletion/pointscollection/layers/emd/__init__.py
li-haoran/detectron2
84aebaaed19b07cce9dfd579f98b09ad4ed22e90
[ "Apache-2.0" ]
null
null
null
from .functions.emd import emd_function from .modules.emd import emdModule __all__=['emd_function','emdModule']
28
39
0.8125
15
112
5.666667
0.533333
0.211765
0
0
0
0
0
0
0
0
0
0
0.080357
112
4
40
28
0.825243
0
0
0
0
0
0.185841
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
0
0
0
4
808cb3c61f85a555c15ce3e7e9089f1c71ff3641
446
py
Python
gym_vr/gym_vr/__init__.py
ndawlab/vectorRPE
d4cd6734b6d71e93e66f2e98edd745951866d8ac
[ "MIT" ]
null
null
null
gym_vr/gym_vr/__init__.py
ndawlab/vectorRPE
d4cd6734b6d71e93e66f2e98edd745951866d8ac
[ "MIT" ]
null
null
null
gym_vr/gym_vr/__init__.py
ndawlab/vectorRPE
d4cd6734b6d71e93e66f2e98edd745951866d8ac
[ "MIT" ]
null
null
null
# only need this the FIRST time I register. # from gym.envs.registration import register # register( # id='vrgym-v0', # entry_point='gym_vr.envs:VRShapingEnv', # ) # register( # id='vrgym-v1', # entry_point='gym_vr.envs:VRShapingEnv2', # ) # register( # id='vrgym-v2', # entry_point='gym_vr.envs:VRShapingEnv3', # ) # register( # id='vrgym-v3', # entry_point='gym_vr.envs:VRShapingEnv4', # )
21.238095
47
0.612108
54
446
4.907407
0.481481
0.150943
0.226415
0.226415
0.286792
0
0
0
0
0
0
0.020231
0.224215
446
21
48
21.238095
0.745665
0.867713
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
809129b4a5333d3ff7dd1222109503e7fbf035f8
100
py
Python
7_kyu/SevenAte9.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/SevenAte9.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
7_kyu/SevenAte9.py
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
import re ATE9 = re.compile(r"79(?=7)") def seven_ate9(s: str) -> str: return ATE9.sub("7", s)
16.666667
30
0.6
19
100
3.105263
0.684211
0
0
0
0
0
0
0
0
0
0
0.085366
0.18
100
6
31
16.666667
0.634146
0
0
0
0
0
0.079208
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
0
0
0
4
809ad17723223d69760f037c5514b7b41d308a18
120
py
Python
dsfp/tests/test_data.py
mjn693/demo-repository-for-DSFP
6e7046f5edb59b0408953ff34ca01ebbdfbaf0d0
[ "BSD-3-Clause" ]
null
null
null
dsfp/tests/test_data.py
mjn693/demo-repository-for-DSFP
6e7046f5edb59b0408953ff34ca01ebbdfbaf0d0
[ "BSD-3-Clause" ]
null
null
null
dsfp/tests/test_data.py
mjn693/demo-repository-for-DSFP
6e7046f5edb59b0408953ff34ca01ebbdfbaf0d0
[ "BSD-3-Clause" ]
null
null
null
from dsfp.data import get_photometry def test_get_photometry(): data = get_photometry(10) assert len(data)==10
20
36
0.741667
18
120
4.722222
0.611111
0.458824
0
0
0
0
0
0
0
0
0
0.04
0.166667
120
5
37
24
0.81
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
false
0
0.25
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
80bbe54fc30860193e5853b1a6090c5d0011fea3
591
py
Python
tests/test_paul.py
teeg82/name_generator3
203d367092c6b61d766f865f2b9b3749dff8e163
[ "BSD-3-Clause" ]
null
null
null
tests/test_paul.py
teeg82/name_generator3
203d367092c6b61d766f865f2b9b3749dff8e163
[ "BSD-3-Clause" ]
null
null
null
tests/test_paul.py
teeg82/name_generator3
203d367092c6b61d766f865f2b9b3749dff8e163
[ "BSD-3-Clause" ]
null
null
null
import unittest import generator class TestPaul(unittest.TestCase): pass # def test_paul(self): # is_paul = False # while not is_paul: # word = generator.generate_word(pattern="CVVC") # print(word) # if "paul" == word: # is_paul = True # def test_heather(self): # is_heather = False # while not is_heather: # word = generator.generate_word(pattern="CVVCCVC") # print(word) # if "heather" == word: # is_heather = True
25.695652
64
0.507614
59
591
4.915254
0.40678
0.062069
0.089655
0.103448
0.22069
0
0
0
0
0
0
0
0.394247
591
22
65
26.863636
0.810056
0.681895
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.5
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
80d0bea03acf5a9f00dc07c21c5ff02c0676f6de
153
py
Python
numerik/code/harmonic.py
arimiftari/notes
737b95ed6a4163bd1d395c0379410513dcb03ef1
[ "CC-BY-4.0" ]
null
null
null
numerik/code/harmonic.py
arimiftari/notes
737b95ed6a4163bd1d395c0379410513dcb03ef1
[ "CC-BY-4.0" ]
2
2018-05-24T07:31:37.000Z
2018-08-31T12:58:14.000Z
numerik/code/harmonic.py
arimiftari/notes
737b95ed6a4163bd1d395c0379410513dcb03ef1
[ "CC-BY-4.0" ]
6
2018-05-15T19:28:53.000Z
2020-11-05T19:07:29.000Z
sum = np.float16(1.0) i = 1. old = np.float16(0.0) while (sum != old): old = sum i += 1. diff = np.float16(1./i) sum += diff print (sum)
15.3
27
0.51634
28
153
2.821429
0.357143
0.341772
0.253165
0
0
0
0
0
0
0
0
0.118182
0.281046
153
9
28
17
0.6
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.111111
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
0
0
4
03826264e1311ce093b25205b8efba2aafaadf06
271
py
Python
spectroscope/model/notification.py
neukind/ethmonitor
42828a9b2811d97b3c134244b905353a7bf42660
[ "Apache-2.0" ]
6
2021-01-29T02:28:44.000Z
2021-02-17T14:08:14.000Z
spectroscope/model/notification.py
neukind/ethmonitor
42828a9b2811d97b3c134244b905353a7bf42660
[ "Apache-2.0" ]
3
2021-07-26T10:03:12.000Z
2021-07-26T11:48:47.000Z
spectroscope/model/notification.py
neukind/ethmonitor
42828a9b2811d97b3c134244b905353a7bf42660
[ "Apache-2.0" ]
3
2021-04-19T09:34:11.000Z
2021-04-22T06:23:39.000Z
from pydantic import BaseModel from spectroscope.model import Action class Notification(BaseModel): pass class Notify(Action): notification: Notification def __init__(self, notification: Notification): super().__init__(notification=notification)
19.357143
51
0.763838
27
271
7.37037
0.555556
0.361809
0
0
0
0
0
0
0
0
0
0
0.166052
271
13
52
20.846154
0.880531
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0.125
0.25
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
0396ed4560a36d3705b5a81ebb15fe45a02dcf69
356
py
Python
project1/module2/variable.py
pmitche/it3105-aiprogramming
79f3b4a5f624d473b461548b263bcf7ecc0846dc
[ "MIT" ]
3
2015-12-12T15:33:39.000Z
2019-01-17T13:44:09.000Z
project1/module2/variable.py
pmitche/it3105-aiprogramming
79f3b4a5f624d473b461548b263bcf7ecc0846dc
[ "MIT" ]
null
null
null
project1/module2/variable.py
pmitche/it3105-aiprogramming
79f3b4a5f624d473b461548b263bcf7ecc0846dc
[ "MIT" ]
null
null
null
__author__ = 'sondredyvik' class Variable: def __init__(self, index, x, y): self.index = index self.x = x self.y = y def __repr__(self): return 'n' + str(self.index) def __hash__(self): return hash((self.index, self.x, self.y)) def __eq__(self, other): return self.index == other.index
18.736842
49
0.570225
47
356
3.893617
0.361702
0.245902
0.10929
0
0
0
0
0
0
0
0
0
0.303371
356
18
50
19.777778
0.737903
0
0
0
0
0
0.033708
0
0
0
0
0
0
1
0.333333
false
0
0
0.25
0.666667
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
03abf3f04638d91187e822e4594159ea3440ea0d
67
py
Python
sapy_script/__init__.py
fkfouri/sapy_script
476041288367e2098b955bc2377f442ce503e822
[ "MIT" ]
3
2018-12-03T15:51:54.000Z
2020-11-20T01:05:39.000Z
sapy_script/__init__.py
whrocha/sapy_script
476041288367e2098b955bc2377f442ce503e822
[ "MIT" ]
null
null
null
sapy_script/__init__.py
whrocha/sapy_script
476041288367e2098b955bc2377f442ce503e822
[ "MIT" ]
3
2018-07-28T21:53:32.000Z
2018-08-22T13:51:17.000Z
#para ser importado como biblioteca from sapy_script.SAP import SAP
33.5
35
0.850746
11
67
5.090909
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.119403
67
2
36
33.5
0.949153
0.507463
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
03c418c53801ed201139c9518c1afd4ffeca4bc9
48
py
Python
my_pyqt/hello.py
sjj1019/car
d6699e3d368c173e09bd641f1af42a4cf0160419
[ "MIT" ]
null
null
null
my_pyqt/hello.py
sjj1019/car
d6699e3d368c173e09bd641f1af42a4cf0160419
[ "MIT" ]
null
null
null
my_pyqt/hello.py
sjj1019/car
d6699e3d368c173e09bd641f1af42a4cf0160419
[ "MIT" ]
null
null
null
name = 'hello' def say(): print('hello')
6.857143
18
0.520833
6
48
4.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.270833
48
7
18
6.857143
0.714286
0
0
0
0
0
0.212766
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0.333333
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
03dd007164943fe97041d427391085133bb31653
169
py
Python
django_blog/__init__.py
hsyao/django_blog
3fe8215e627960e933abe9548eda123987e94f13
[ "MIT" ]
137
2017-05-05T11:57:11.000Z
2021-01-06T18:56:56.000Z
django_blog/__init__.py
hsyao/django_blog
3fe8215e627960e933abe9548eda123987e94f13
[ "MIT" ]
10
2018-05-20T06:36:10.000Z
2022-03-11T23:19:21.000Z
django_blog/__init__.py
wangchaocc21/django_blog
3fe8215e627960e933abe9548eda123987e94f13
[ "MIT" ]
24
2017-06-19T18:08:59.000Z
2019-02-02T04:15:13.000Z
from __future__ import absolute_import, unicode_literals import pymysql from .celery import app as celery_app pymysql.install_as_MySQLdb() __all__ = ['celery_app']
28.166667
57
0.810651
23
169
5.347826
0.565217
0.146341
0
0
0
0
0
0
0
0
0
0
0.130178
169
6
58
28.166667
0.836735
0
0
0
0
0
0.060606
0
0
0
0
0
0
1
0
false
0
0.6
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
0
0
1
0
1
0
0
4
03e91ea684cecfee4310716668a37d761cea562c
337
py
Python
paperboy/scheduler/airflow/airflow_operators/__init__.py
chris-aeviator/paperboy
604c912c3530cd37fb07dcf22321d9dde15465ee
[ "Apache-2.0" ]
233
2018-11-01T09:17:08.000Z
2022-03-22T08:27:24.000Z
paperboy/scheduler/airflow/airflow_operators/__init__.py
chris-aeviator/paperboy
604c912c3530cd37fb07dcf22321d9dde15465ee
[ "Apache-2.0" ]
99
2018-10-17T21:48:42.000Z
2021-05-07T08:33:36.000Z
paperboy/scheduler/airflow/airflow_operators/__init__.py
chris-aeviator/paperboy
604c912c3530cd37fb07dcf22321d9dde15465ee
[ "Apache-2.0" ]
29
2018-11-01T11:33:08.000Z
2022-01-12T22:12:19.000Z
from .common import JobOperator, JobCleanupOperator, ReportOperator # noqa: F401 from .dokku import DokkuOperator # noqa: F401 from .nbconvert import NBConvertOperator # noqa: F401 from .papermill import PapermillOperator # noqa: F401 from .post import ReportPostOperator # noqa: F401 from .voila import VoilaOperator # noqa: F401
48.142857
81
0.792285
38
337
7.026316
0.473684
0.179775
0.224719
0
0
0
0
0
0
0
0
0.062718
0.148368
337
6
82
56.166667
0.867596
0.192878
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
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
03fc477e09741008649e3d0d3f2da92307d9ae1e
2,426
py
Python
src/pylol_simulator/buff.py
ABostrom/pylol-simulator
1e47dd277a1c61782e6eb9a6edc4fd9512431dbe
[ "MIT" ]
1
2021-05-17T17:33:52.000Z
2021-05-17T17:33:52.000Z
src/pylol_simulator/buff.py
ABostrom/pylol-simulator
1e47dd277a1c61782e6eb9a6edc4fd9512431dbe
[ "MIT" ]
null
null
null
src/pylol_simulator/buff.py
ABostrom/pylol-simulator
1e47dd277a1c61782e6eb9a6edc4fd9512431dbe
[ "MIT" ]
1
2021-03-26T14:49:51.000Z
2021-03-26T14:49:51.000Z
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from .summoner import Summoner from .damage import Damage # this will be a class to apply a buff to a Summoner # regular buffs will be permanent class Buff: def __init__(self, name: str, duration: float, consumes_on_atk = False) -> None: self.name = name self.permanent = duration == None self.duration = duration if not self.permanent else 0 self.duration_remaining = self.duration self.expired = False self.consumes_on_atk = consumes_on_atk # need to be able to tick. def update(self, delta_time: float): # don't need ticking behaviour if permanent. if self.permanent: return self.duration_remaining -= delta_time if self.duration_remaining <= 0: self.expired = True # need some function to refresh/reset buffs def refresh(self): self.duration_remaining = self.duration # is this buff consumed on basic attacking. def consumes_on_attack(self) -> bool: return self.consumes_on_atk def on_basic_attack(self, attacker: Summoner, defender: Summoner): pass # TODO: is this buff consumed on abilities # check buffs are equal def __eq__(self, o: Buff) -> bool: return self.name == o.name def __hash__(self) -> int: return hash(self.name) # consider how internal CD might work for Sheen items. class SheenSpellBlade(Buff): def __init__(self) -> None: super().__init__("Spell Blade", duration=10.0, consumes_on_atk=True) def on_basic_attack(self, attacker: Summoner, defender: Summoner): #100% of base ad return Damage(physical_damage=attacker.base_ad) class TriforceSpellBlade(Buff): def __init__(self) -> None: super().__init__("Spell Blade", duration=10.0, consumes_on_atk=True) def on_basic_attack(self, attacker: Summoner, defender: Summoner): # 200% of base ad return Damage(physical_damage=attacker.base_ad * 2) class LichBaneSpellBlade(Buff): def __init__(self) -> None: super().__init__("Spell Blade", duration=10.0, consumes_on_atk=True) def on_basic_attack(self, attacker: Summoner, defender: Summoner): # 150% of base ad + 40% of AP return Damage(physical_damage=attacker.base_ad * 1.5, magic_damage=attacker.ap * 0.4)
29.950617
93
0.677246
326
2,426
4.797546
0.312883
0.051151
0.058184
0.038363
0.414322
0.346547
0.346547
0.320972
0.320972
0.287724
0
0.014571
0.236191
2,426
80
94
30.325
0.829466
0.16859
0
0.272727
0
0
0.016467
0
0
0
0
0.0125
0
1
0.295455
false
0.022727
0.090909
0.136364
0.636364
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
03ffd49c10671008387de881144726823143d5ae
244
py
Python
DailyData/time_management/__main__.py
JEElsner/DailyData
17d430af52922cc0b60ba57abb8e42de576d942c
[ "MIT" ]
1
2021-01-04T07:05:07.000Z
2021-01-04T07:05:07.000Z
DailyData/time_management/__main__.py
JEElsner/DailyData
17d430af52922cc0b60ba57abb8e42de576d942c
[ "MIT" ]
null
null
null
DailyData/time_management/__main__.py
JEElsner/DailyData
17d430af52922cc0b60ba57abb8e42de576d942c
[ "MIT" ]
null
null
null
if __name__ == '__main__': # Redirect the execution of the module to to the entry point for timelog # This will then parse system arguments and do magic in general from .timelog import timelog_entry_point timelog_entry_point()
34.857143
76
0.745902
36
244
4.722222
0.722222
0.176471
0.2
0
0
0
0
0
0
0
0
0
0.213115
244
6
77
40.666667
0.885417
0.540984
0
0
0
0
0.073395
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
20b152d253e42f9c7b9ea2a44e0e9bfd7fed3b8f
432
py
Python
testing/test_pytest_example.py
matthew-cheney/crowd-sorting-single-threaded
f32f05641821f5770dd95787c459888101b93d05
[ "MIT" ]
1
2019-10-14T18:24:39.000Z
2019-10-14T18:24:39.000Z
testing/test_pytest_example.py
mchen95/crowd-sorting
f32f05641821f5770dd95787c459888101b93d05
[ "MIT" ]
2
2019-10-14T17:16:46.000Z
2019-10-21T23:14:32.000Z
testing/test_pytest_example.py
matthew-cheney/crowd-sorting-single-threaded
f32f05641821f5770dd95787c459888101b93d05
[ "MIT" ]
null
null
null
import os import tempfile import pytest import crowdsorting @pytest.fixture def client(): db_fd, crowdsorting.app.config['DATABASE'] = tempfile.mkstemp() crowdsorting.app.config['TESTING'] = True with crowdsorting.app.test_client() as client: with crowdsorting.app.app_context(): crowdsorting.init_db() yield client os.close(db_fd) os.unlink(crowdsorting.app.config['DATABASE'])
21.6
67
0.699074
52
432
5.711538
0.461538
0.252525
0.212121
0.195286
0
0
0
0
0
0
0
0
0.189815
432
20
68
21.6
0.848571
0
0
0
0
0
0.053118
0
0
0
0
0
0
1
0.071429
true
0
0.285714
0
0.357143
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
454604b55d9ca540fd6f21b92acdc4748e566f84
420
py
Python
nflows/transforms/splines/__init__.py
Tennessee-Wallaceh/nflows
ac0bf432fc7904458a933ed14180f0ac26e3f93d
[ "MIT" ]
522
2020-02-26T16:51:51.000Z
2022-03-31T15:38:48.000Z
nflows/transforms/splines/__init__.py
Tennessee-Wallaceh/nflows
ac0bf432fc7904458a933ed14180f0ac26e3f93d
[ "MIT" ]
47
2020-03-24T18:36:59.000Z
2022-03-25T09:47:18.000Z
nflows/transforms/splines/__init__.py
Tennessee-Wallaceh/nflows
ac0bf432fc7904458a933ed14180f0ac26e3f93d
[ "MIT" ]
77
2020-03-21T21:00:44.000Z
2022-03-31T00:41:51.000Z
from nflows.transforms.splines.cubic import cubic_spline, unconstrained_cubic_spline from nflows.transforms.splines.linear import linear_spline, unconstrained_linear_spline from nflows.transforms.splines.quadratic import ( quadratic_spline, unconstrained_quadratic_spline, ) from nflows.transforms.splines.rational_quadratic import ( rational_quadratic_spline, unconstrained_rational_quadratic_spline, )
38.181818
87
0.852381
47
420
7.297872
0.234043
0.116618
0.233236
0.314869
0.28863
0
0
0
0
0
0
0
0.095238
420
10
88
42
0.902632
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
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
0
0
0
4
4556ad52d52fc795cb62f2631e21d6f9700cdc60
47
py
Python
tests/conftest.py
SoCal-Software-Labs/statetrace_django
9fd1e58527ed8a129fd62ae733784c14ceb07b63
[ "MIT" ]
1
2021-07-29T13:36:43.000Z
2021-07-29T13:36:43.000Z
tests/conftest.py
SoCal-Software-Labs/statetrace_django
9fd1e58527ed8a129fd62ae733784c14ceb07b63
[ "MIT" ]
null
null
null
tests/conftest.py
SoCal-Software-Labs/statetrace_django
9fd1e58527ed8a129fd62ae733784c14ceb07b63
[ "MIT" ]
null
null
null
pytest_plugins = ("tracestate_django.pytest",)
23.5
46
0.787234
5
47
7
0.8
0
0
0
0
0
0
0
0
0
0
0
0.06383
47
1
47
47
0.795455
0
0
0
0
0
0.510638
0.510638
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
455778c2766b6117a6022aeb9d321cf97370f714
54
py
Python
exhaustive_search/04_double-loop/04-04.py
fumiyanll23/algo-method
d86ea1d399cbc5a1db0ae49d0c82e41042f661ab
[ "MIT" ]
null
null
null
exhaustive_search/04_double-loop/04-04.py
fumiyanll23/algo-method
d86ea1d399cbc5a1db0ae49d0c82e41042f661ab
[ "MIT" ]
null
null
null
exhaustive_search/04_double-loop/04-04.py
fumiyanll23/algo-method
d86ea1d399cbc5a1db0ae49d0c82e41042f661ab
[ "MIT" ]
null
null
null
# input # compute # output print(len(set(input())))
7.714286
24
0.62963
7
54
4.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.166667
54
6
25
9
0.755556
0.37037
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
455b36728b70ddee669ac2b247448f30d2f1013f
515
py
Python
pipescaler/core/sorter.py
KarlTDebiec/PipeScaler
b990ece8f3dd2c3506c226ed871871997fc57beb
[ "BSD-3-Clause" ]
1
2022-02-07T03:47:53.000Z
2022-02-07T03:47:53.000Z
pipescaler/core/sorter.py
KarlTDebiec/PipeScaler
b990ece8f3dd2c3506c226ed871871997fc57beb
[ "BSD-3-Clause" ]
49
2022-01-17T15:16:22.000Z
2022-03-28T03:00:39.000Z
pipescaler/core/sorter.py
KarlTDebiec/PipeScaler
b990ece8f3dd2c3506c226ed871871997fc57beb
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # pipescaler/core/sorter.py # # Copyright (C) 2020-2021 Karl T Debiec # All rights reserved. # # This software may be modified and distributed under the terms of the # BSD license. from __future__ import annotations from abc import ABC from pipescaler.core.stage import Stage class Sorter(Stage, ABC): """Base class for sorters.""" def __call__(self, infile: str) -> str: raise NotImplementedError() @property def inlets(self): return ["inlet"]
20.6
72
0.683495
68
515
5.058824
0.764706
0.081395
0
0
0
0
0
0
0
0
0
0.019901
0.219417
515
24
73
21.458333
0.835821
0.429126
0
0
0
0
0.017794
0
0
0
0
0
0
1
0.222222
false
0
0.333333
0.111111
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
455d6e9a52f3b65636a2bc541f25c03def6362ff
949
py
Python
tinygrad/functional.py
LuanAdemi/tinygrad
00387ea0254bdf91c8de3018822fca1e58628891
[ "MIT" ]
null
null
null
tinygrad/functional.py
LuanAdemi/tinygrad
00387ea0254bdf91c8de3018822fca1e58628891
[ "MIT" ]
null
null
null
tinygrad/functional.py
LuanAdemi/tinygrad
00387ea0254bdf91c8de3018822fca1e58628891
[ "MIT" ]
null
null
null
from tinygrad.tensor import Tensor from tinygrad.base import Activation, Loss ## define some common loss functions class RMSE(Loss): def __init__(self, root=True): super().__init__() def forward(self, gt, out): squared_mean_error = out.sub(gt).pow(2).mean() if root: return squared_error.sqrt() return squared_error ## define some common activation functions class Sigmoid(Activation): def __init__(self): super().__init__() def forward(self, x): return self.sigmoid() class Tanh(Activation): def __init__(self): super().__init__() def forward(self, x): return x.tanh() class ReLU(Activation): def __init__(self): super().__init__() def forward(self, x): return x.relu() class Softmax(Activation): def __init__(self): super().__init__() def forward(self, x): return x.softmax()
21.088889
54
0.618546
114
949
4.763158
0.315789
0.064457
0.101289
0.174954
0.423573
0.381215
0.381215
0.381215
0.381215
0.381215
0
0.001433
0.264489
949
44
55
21.568182
0.776504
0.076923
0
0.433333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.066667
0.133333
0.766667
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
4566798e7a5b45c74c1861e7cf816d3bf44f1c6d
105
py
Python
pick_kernel/exceptions.py
nteract/pick
657059a1ba79a09a5cee07a75a3f02fd055456e3
[ "BSD-3-Clause" ]
30
2020-04-22T07:42:07.000Z
2022-02-09T17:09:46.000Z
pick_kernel/exceptions.py
rgbkrk/proxy-kernel
657059a1ba79a09a5cee07a75a3f02fd055456e3
[ "BSD-3-Clause" ]
19
2020-04-22T05:21:13.000Z
2021-07-23T05:39:26.000Z
pick_kernel/exceptions.py
rgbkrk/proxy-kernel
657059a1ba79a09a5cee07a75a3f02fd055456e3
[ "BSD-3-Clause" ]
7
2020-04-24T03:12:57.000Z
2021-09-29T03:28:45.000Z
class PickRegistrationException(Exception): """Raised when there is an issue registering a kernel"""
35
60
0.771429
12
105
6.75
1
0
0
0
0
0
0
0
0
0
0
0
0.142857
105
2
61
52.5
0.9
0.47619
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
4591752a372fbdf3acce5c719d16253abdd10c9b
65
py
Python
FUNDAMENTALS_MODULE/Functions/LAB/01_Absolute_Values.py
sleepychild/ProgramingBasicsPython
d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16
[ "MIT" ]
null
null
null
FUNDAMENTALS_MODULE/Functions/LAB/01_Absolute_Values.py
sleepychild/ProgramingBasicsPython
d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16
[ "MIT" ]
1
2022-01-15T10:33:56.000Z
2022-01-15T10:33:56.000Z
FUNDAMENTALS_MODULE/Functions/LAB/01_Absolute_Values.py
sleepychild/ProgramingBasicsPython
d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16
[ "MIT" ]
null
null
null
print([ abs(y) for y in [float(x) for x in input().split(' ')]])
32.5
64
0.569231
13
65
2.846154
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.169231
65
1
65
65
0.685185
0
0
0
0
0
0.015385
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
45a5ebc4c355d097a6c9a016f56c3e8b3e4f8bed
242
py
Python
core/admin.py
aldwyn/effigia
eb456656949bf68934530bbec9c15ebc6d0236b8
[ "MIT" ]
1
2018-11-15T05:17:30.000Z
2018-11-15T05:17:30.000Z
core/admin.py
aldwyn/effigia
eb456656949bf68934530bbec9c15ebc6d0236b8
[ "MIT" ]
5
2021-06-09T17:20:01.000Z
2022-03-11T23:18:06.000Z
core/admin.py
aldwyn/effigia
eb456656949bf68934530bbec9c15ebc6d0236b8
[ "MIT" ]
1
2018-10-05T19:03:27.000Z
2018-10-05T19:03:27.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth.models import Permission from .models import Category admin.site.register(Permission) admin.site.register(Category)
20.166667
49
0.797521
32
242
5.875
0.53125
0.106383
0.180851
0
0
0
0
0
0
0
0
0.004651
0.11157
242
11
50
22
0.869767
0.086777
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
45d2ff95d1250dc3c16c7ea49aa0d7c98dfe74d5
209
py
Python
granule/granular/signals.py
mr-robot/granule
95a7ca037b721790e6e182f4a703b7a2f7556e59
[ "MIT" ]
null
null
null
granule/granular/signals.py
mr-robot/granule
95a7ca037b721790e6e182f4a703b7a2f7556e59
[ "MIT" ]
null
null
null
granule/granular/signals.py
mr-robot/granule
95a7ca037b721790e6e182f4a703b7a2f7556e59
[ "MIT" ]
null
null
null
__author__ = 'beast' from blinker import Namespace granule_signals = Namespace() post_save_activity = granule_signals.signal('post_save_activity') post_save_result = granule_signals.signal('post_save_result')
34.833333
65
0.837321
27
209
5.925926
0.481481
0.2
0.2
0.3
0.35
0
0
0
0
0
0
0
0.076555
209
6
66
34.833333
0.829016
0
0
0
0
0
0.185714
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
afdafeb6b4ae7b0b50e5a2329742ec2fdb85f9dd
60
py
Python
gyan42/siamese/main.py
gyan42/dl_siamese_network
b46920d67c3b24fd4e3b062578291d47ed5e6843
[ "Apache-2.0" ]
1
2021-09-22T19:40:54.000Z
2021-09-22T19:40:54.000Z
gyan42/siamese/main.py
gyan42/dl_siamese_network
b46920d67c3b24fd4e3b062578291d47ed5e6843
[ "Apache-2.0" ]
null
null
null
gyan42/siamese/main.py
gyan42/dl_siamese_network
b46920d67c3b24fd4e3b062578291d47ed5e6843
[ "Apache-2.0" ]
null
null
null
import fire def main(batch_size, epochs): pass
12
20
0.616667
8
60
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.316667
60
5
21
12
0.878049
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0.25
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
afef6bc81f8650bd8761c66401df995cb53bcf3b
363
py
Python
download.py
JacksonOsvaldo/download_malhas_municpio
18b41b1a590fba0a5b3a8c7b4fb4bf4c7f46e2c3
[ "MIT" ]
null
null
null
download.py
JacksonOsvaldo/download_malhas_municpio
18b41b1a590fba0a5b3a8c7b4fb4bf4c7f46e2c3
[ "MIT" ]
null
null
null
download.py
JacksonOsvaldo/download_malhas_municpio
18b41b1a590fba0a5b3a8c7b4fb4bf4c7f46e2c3
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- ecoding: utf-8 -*- import os # Definindo variável com url do diretório de todos os arquivos do servidor FTP. url = 'ftp://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2019/UFs/' # Fazendo download de todos os arquivos utilizando o wget do Linux. os.system("wget -r {}".format(url))
30.25
116
0.754821
55
363
4.890909
0.745455
0.052045
0.066915
0.126394
0
0
0
0
0
0
0
0.018868
0.123967
363
11
117
33
0.827044
0.517906
0
0
0
0
0.690058
0.631579
0
0
0
0.090909
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
1
0
0
0
0
0
1
0
0
0
0
4
aff14bb4e96829e825f261d11790886eaa8f5dff
116
py
Python
tf/tf.py
Tree-Some/template-touch-file
ebdff1a09154e0456d775aa8228a803e1e5115a3
[ "MIT" ]
1
2020-07-28T13:59:02.000Z
2020-07-28T13:59:02.000Z
tf/tf.py
Tree-Some/template-touch-file
ebdff1a09154e0456d775aa8228a803e1e5115a3
[ "MIT" ]
null
null
null
tf/tf.py
Tree-Some/template-touch-file
ebdff1a09154e0456d775aa8228a803e1e5115a3
[ "MIT" ]
null
null
null
""" " {{file}} " Created on {{date}} " " Copyright (c) {{author}}. Licensed under the {{license}} License. """
14.5
68
0.543103
12
116
5.25
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.198276
116
7
69
16.571429
0.677419
0.87931
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
aff602c4e0c1d77fbcfb79a54399d479ff8bdccb
122
py
Python
terrascript/provider/consul.py
jackluo923/python-terrascript
ed4b626e6d28621ea1b02fc16f7277a094d89830
[ "BSD-2-Clause" ]
4
2022-02-07T21:08:14.000Z
2022-03-03T04:41:28.000Z
terrascript/provider/consul.py
jackluo923/python-terrascript
ed4b626e6d28621ea1b02fc16f7277a094d89830
[ "BSD-2-Clause" ]
null
null
null
terrascript/provider/consul.py
jackluo923/python-terrascript
ed4b626e6d28621ea1b02fc16f7277a094d89830
[ "BSD-2-Clause" ]
2
2022-02-06T01:49:42.000Z
2022-02-08T14:15:00.000Z
# terrascript/provider/consul.py import terrascript class consul(terrascript.Provider): pass __all__ = ["consul"]
12.2
35
0.745902
13
122
6.692308
0.615385
0.436782
0
0
0
0
0
0
0
0
0
0
0.147541
122
9
36
13.555556
0.836538
0.245902
0
0
0
0
0.066667
0
0
0
0
0
0
1
0
false
0.25
0.25
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
0
1
0
0
0
0
0
4
b317a1acc718c349f23ad2921b1f6b31e9a1f756
309
py
Python
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/course_date_signals/admin.py
osoco/better-ways-of-thinking-about-software
83e70d23c873509e22362a09a10d3510e10f6992
[ "MIT" ]
3
2021-12-15T04:58:18.000Z
2022-02-06T12:15:37.000Z
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/course_date_signals/admin.py
osoco/better-ways-of-thinking-about-software
83e70d23c873509e22362a09a10d3510e10f6992
[ "MIT" ]
null
null
null
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/course_date_signals/admin.py
osoco/better-ways-of-thinking-about-software
83e70d23c873509e22362a09a10d3510e10f6992
[ "MIT" ]
1
2019-01-02T14:38:50.000Z
2019-01-02T14:38:50.000Z
""" Django Admin pages for SelfPacedRelativeDatesConfig. """ from django.contrib import admin from openedx.core.djangoapps.config_model_utils.admin import StackedConfigModelAdmin from .models import SelfPacedRelativeDatesConfig admin.site.register(SelfPacedRelativeDatesConfig, StackedConfigModelAdmin)
22.071429
84
0.854369
29
309
9.034483
0.62069
0
0
0
0
0
0
0
0
0
0
0
0.087379
309
13
85
23.769231
0.929078
0.168285
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
b32444013a863bb5542d381bf3c357b24bdd014d
685
py
Python
classifier/trainer/preprocess_data.py
nxphi47/eye_gesture_app_wth
1fce0f0e76c6e1bbdc555d8f4affe3234f102a59
[ "MIT" ]
3
2017-10-04T05:13:07.000Z
2018-09-15T15:53:03.000Z
classifier/trainer/preprocess_data.py
nxphi47/eye_gesture_app_wth
1fce0f0e76c6e1bbdc555d8f4affe3234f102a59
[ "MIT" ]
null
null
null
classifier/trainer/preprocess_data.py
nxphi47/eye_gesture_app_wth
1fce0f0e76c6e1bbdc555d8f4affe3234f102a59
[ "MIT" ]
null
null
null
"""The purpose of this file is to preprocess zip data into tfRecord data""" # Important: We are using PIL to read .png files later. # This was done on purpose to read indexed png files # in a special way -- only indexes and not map the indexes # to actual rgb values. This is specific to PASCAL VOC # dataset data. If you don't want thit type of behaviour # consider using skimage.io.imread() from PIL import Image import numpy as np # import skimage.io as io import tensorflow as tf def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
32.619048
75
0.763504
117
685
4.418803
0.606838
0.054159
0.069633
0.077369
0.123791
0.123791
0
0
0
0
0
0.010363
0.154745
685
20
76
34.25
0.882556
0.582482
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.428571
0.285714
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
b33a7092e04833550253dcf297ed337511fca70d
943
py
Python
dataStructures/infixPostfixConvert.py
KarlParkinson/practice
6bbbd4a8e320732523d83297c1021f52601a20d8
[ "MIT" ]
null
null
null
dataStructures/infixPostfixConvert.py
KarlParkinson/practice
6bbbd4a8e320732523d83297c1021f52601a20d8
[ "MIT" ]
null
null
null
dataStructures/infixPostfixConvert.py
KarlParkinson/practice
6bbbd4a8e320732523d83297c1021f52601a20d8
[ "MIT" ]
null
null
null
import stack def infixToPostfix(expr): s = stack.Stack() prec = {"*":3, "/":3, "+":2, "-":2, "(":1} ops = "*/+-(" postfixString = "" for char in expr: if (char in ops): lower = False while (not s.isEmpty() and not lower and char != '('): op = s.peek() if (prec[op] < prec[char]): lower = True else: postfixString += s.pop() s.push(char) elif (char == ')'): op = s.pop() while (op != '('): postfixString += op op = s.pop() else: postfixString += char while (not s.isEmpty()): postfixString += s.pop() return postfixString #print infixToPostfix("A+B*C") #print infixToPostfix("A+B+C+D") #print infixToPostfix("A+B*C+D") print infixToPostfix("(A+B)*(C+D)") #print infixToPostfix("A*B+C*D")
26.194444
66
0.45281
105
943
4.066667
0.333333
0.222482
0.234192
0.245902
0.266979
0.215457
0.215457
0.215457
0.215457
0.215457
0
0.008446
0.372216
943
35
67
26.942857
0.712838
0.129374
0
0.222222
0
0
0.029412
0
0
0
0
0
0
0
null
null
0
0.037037
null
null
0.037037
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
b33d4c6090a7c000be0d55f50498d47bd991c926
50
py
Python
redrugs/__init__.py
dlmcguinness/redrugs
d49857b1f291c0b3bdd0b25417ba42068ca73c62
[ "MIT" ]
5
2015-01-23T15:28:59.000Z
2017-10-23T12:01:36.000Z
redrugs/__init__.py
dlmcguinness/redrugs
d49857b1f291c0b3bdd0b25417ba42068ca73c62
[ "MIT" ]
14
2015-02-03T21:20:58.000Z
2015-10-13T02:32:18.000Z
redrugs/__init__.py
dlmcguinness/redrugs
d49857b1f291c0b3bdd0b25417ba42068ca73c62
[ "MIT" ]
5
2015-01-28T17:55:44.000Z
2018-12-03T02:47:05.000Z
# -*- coding: utf-8 -*- """The redrugs package"""
16.666667
25
0.54
6
50
4.5
1
0
0
0
0
0
0
0
0
0
0
0.02381
0.16
50
2
26
25
0.619048
0.84
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b34ab8b757290ba45e5b5c8823d8e00fc6a195b8
418
py
Python
Pattern/Capitals_Alphabetical/Printing Stars in X Shape.py
reddyprasade/PYTHON-BASIC-FOR-ALL
4fa4bf850f065e9ac1cea0365b93257e1f04e2cb
[ "MIT" ]
21
2019-06-28T05:11:17.000Z
2022-03-16T02:02:28.000Z
Pattern/Capitals_Alphabetical/Printing Stars in X Shape.py
reddyprasade/PYTHON-BASIC-FOR-ALL
4fa4bf850f065e9ac1cea0365b93257e1f04e2cb
[ "MIT" ]
2
2021-12-28T14:15:58.000Z
2021-12-28T14:16:02.000Z
Pattern/Capitals_Alphabetical/Printing Stars in X Shape.py
reddyprasade/PYTHON-BASIC-FOR-ALL
4fa4bf850f065e9ac1cea0365b93257e1f04e2cb
[ "MIT" ]
18
2019-07-07T03:20:33.000Z
2021-05-08T10:44:18.000Z
result_str=""; for row in range(0,7): for column in range(0,7): if (((column == 1 or column == 5) and (row > 4 or row < 2)) or row == column and column > 0 and column < 6 or (column == 2 and row == 4) or (column == 4 and row == 2)): result_str=result_str+"*" else: result_str=result_str+" " result_str=result_str+"\n" print(result_str);
41.8
178
0.519139
64
418
3.265625
0.3125
0.344498
0.287081
0.344498
0.172249
0.172249
0
0
0
0
0
0.05036
0.334928
418
9
179
46.444444
0.701439
0
0
0
0
0
0.009569
0
0
0
0
0
0
1
0
false
0
0
0
0
0.111111
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b3528287e649514c1e279326315502f4571a039f
192
py
Python
dlkit/filesystem_adapter/repository/settings.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
2
2018-02-23T12:16:11.000Z
2020-10-08T17:54:24.000Z
dlkit/filesystem_adapter/repository/settings.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
87
2017-04-21T18:57:15.000Z
2021-12-13T19:43:57.000Z
dlkit/filesystem_adapter/repository/settings.py
UOC/dlkit
a9d265db67e81b9e0f405457464e762e2c03f769
[ "MIT" ]
1
2018-03-01T16:44:25.000Z
2018-03-01T16:44:25.000Z
"""Settings for Filesystem Adapter repository implementation""" # -*- coding: utf-8 -*- ANCHOR_PATH = 'dlkit.filesystem_adapter' PROVIDER_MANAGER_MODULE_PATH = '..json_.repository.managers'
27.428571
63
0.765625
21
192
6.714286
0.809524
0.241135
0
0
0
0
0
0
0
0
0
0.00578
0.098958
192
6
64
32
0.809249
0.416667
0
0
0
0
0.481132
0.481132
0
0
0
0
0
1
0
false
0
0
0
0
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
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b35f8d862a74315f5335ad066ee9d572c8952a57
123
py
Python
canvas_client/section.py
pszabolcs/canvas_client
a9493604988dbc49b4afc84c95b844d91cc63951
[ "MIT" ]
2
2020-11-09T16:59:14.000Z
2021-01-07T10:21:44.000Z
canvas_client/section.py
pszabolcs/canvas_client
a9493604988dbc49b4afc84c95b844d91cc63951
[ "MIT" ]
null
null
null
canvas_client/section.py
pszabolcs/canvas_client
a9493604988dbc49b4afc84c95b844d91cc63951
[ "MIT" ]
4
2020-11-09T17:06:38.000Z
2021-09-13T18:50:42.000Z
class Section(object): def __init__(self, name, students): self.name = name self.students = students
30.75
40
0.626016
14
123
5.214286
0.571429
0.219178
0
0
0
0
0
0
0
0
0
0
0.276423
123
4
41
30.75
0.820225
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
2fc5510e0d1c957e534efc67498fcac56b70471c
145
py
Python
signuser/apps.py
Hannidiot/wepost
98c8a30812bef1a7682b3641048f7c3aa65ba8f9
[ "MIT" ]
null
null
null
signuser/apps.py
Hannidiot/wepost
98c8a30812bef1a7682b3641048f7c3aa65ba8f9
[ "MIT" ]
1
2022-03-02T18:16:12.000Z
2022-03-02T23:39:14.000Z
signuser/apps.py
Hannidiot/wepost
98c8a30812bef1a7682b3641048f7c3aa65ba8f9
[ "MIT" ]
null
null
null
from django.apps import AppConfig class SignuserConfig(AppConfig): name = 'signuser' def ready(self): import signuser.signals
16.111111
33
0.703448
16
145
6.375
0.8125
0
0
0
0
0
0
0
0
0
0
0
0.22069
145
8
34
18.125
0.902655
0
0
0
0
0
0.055172
0
0
0
0
0
0
1
0.2
false
0
0.4
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
64238f28732a73d7a76e48d84296d560b3536805
1,725
py
Python
chat_wars_database/app/web/db_results.py
ricardochaves/chat-wars-database
597f192fb6ddf290c6c7477cf8c7d0ca654925f6
[ "MIT" ]
1
2019-12-30T19:16:52.000Z
2019-12-30T19:16:52.000Z
chat_wars_database/app/web/db_results.py
ricardochaves/chat-wars-database
597f192fb6ddf290c6c7477cf8c7d0ca654925f6
[ "MIT" ]
null
null
null
chat_wars_database/app/web/db_results.py
ricardochaves/chat-wars-database
597f192fb6ddf290c6c7477cf8c7d0ca654925f6
[ "MIT" ]
null
null
null
from typing import List from typing import Optional from django.db.models import Avg from django.db.models.functions import TruncDate from chat_wars_database.app.business_auction.models import AuctionLot from chat_wars_database.app.business_core.models import Item def get_more_expensive_lot() -> AuctionLot: return AuctionLot.objects.order_by("-price").first() def get_first_lot_in_db() -> AuctionLot: return AuctionLot.objects.order_by("lot_id").first() def get_total_active_lots() -> int: return AuctionLot.objects.filter(status=1).count() def get_all_items() -> List[Item]: return Item.objects.filter(command__isnull=False).all() def get_items_from_command(command: str) -> List[AuctionLot]: return AuctionLot.objects.filter(item__command=command).order_by("message_date").all() def get_item_from_command(command: str) -> Optional[Item]: return Item.objects.filter(command=command).first() def get_auctions_average(command: str) -> List: return ( AuctionLot.objects.filter(item__command=command) .annotate(d=TruncDate("message_date")) .values("d") .annotate(Avg("price")) ) def get_first_lot(command: str) -> AuctionLot: return AuctionLot.objects.filter(item__command=command).order_by("message_date").first() def get_last_lot(command: str) -> AuctionLot: return AuctionLot.objects.filter(item__command=command).order_by("-message_date").first() def get_cheaper_lot(command: str) -> AuctionLot: return AuctionLot.objects.filter(item__command=command).order_by("price").first() def get_more_expensive(command: str) -> AuctionLot: return AuctionLot.objects.filter(item__command=command).order_by("-price").first()
27.380952
93
0.752464
231
1,725
5.359307
0.242424
0.053312
0.167205
0.186591
0.584006
0.584006
0.396607
0.358643
0.358643
0.358643
0
0.000661
0.122319
1,725
62
94
27.822581
0.817041
0
0
0
0
0
0.045217
0
0
0
0
0
0
1
0.333333
false
0
0.181818
0.333333
0.848485
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
ff2382fa0759146568032a6fa0a4cfb65072363b
177
py
Python
catana/core/email_templates.py
MRmlik12/biblioteczka
3fcde24cd42d0155c3a20585d20ac0d0a7989101
[ "MIT" ]
null
null
null
catana/core/email_templates.py
MRmlik12/biblioteczka
3fcde24cd42d0155c3a20585d20ac0d0a7989101
[ "MIT" ]
3
2021-07-29T08:34:09.000Z
2021-07-29T10:12:34.000Z
catana/core/email_templates.py
MRmlik12/catana
3fcde24cd42d0155c3a20585d20ac0d0a7989101
[ "MIT" ]
null
null
null
"""Email templates""" RETURN_BORROWED_BOOK_SUBJECT = "Return book to library!" RETURN_BORROWED_BOOK = """ Hi! You have borrowed book. Please return book today to library! """
19.666667
60
0.745763
24
177
5.291667
0.541667
0.283465
0.283465
0
0
0
0
0
0
0
0
0
0.141243
177
8
61
22.125
0.835526
0.084746
0
0
0
0
0.576923
0
0
0
0
0
0
1
0
false
0
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
0
0
0
0
0
0
4
ff2d5db30138fdba4629c10d005100d3bdc4792a
269
py
Python
Source/main.py
Zuricos/SRFMeteoDiscordBot
70d1b06e356d09dff8b4cffc75b8b6070e1834fd
[ "MIT" ]
null
null
null
Source/main.py
Zuricos/SRFMeteoDiscordBot
70d1b06e356d09dff8b4cffc75b8b6070e1834fd
[ "MIT" ]
null
null
null
Source/main.py
Zuricos/SRFMeteoDiscordBot
70d1b06e356d09dff8b4cffc75b8b6070e1834fd
[ "MIT" ]
null
null
null
############################## # created: 08.02.2022 # author: Zuricos # Copyright (c) 2022 Zuricos ############################## #import discord #import requests #import json # get AccessToken import requests from requests.structures import CaseInsensitiveDict
14.944444
51
0.598513
25
269
6.44
0.68
0.173913
0
0
0
0
0
0
0
0
0
0.051064
0.126394
269
17
52
15.823529
0.634043
0.438662
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
ff5b2115d0cef7553a3146df31fb4a28d3fa7aff
250
py
Python
write_a_number_in_expanded_form.py
Kunalpod/codewars
8dc1af2f3c70e209471045118fd88b3ea1e627e5
[ "MIT" ]
null
null
null
write_a_number_in_expanded_form.py
Kunalpod/codewars
8dc1af2f3c70e209471045118fd88b3ea1e627e5
[ "MIT" ]
null
null
null
write_a_number_in_expanded_form.py
Kunalpod/codewars
8dc1af2f3c70e209471045118fd88b3ea1e627e5
[ "MIT" ]
null
null
null
#Kunal Gautam #Codewars : @Kunalpod #Problem name: Write a number in expanded form #Problem level: 6 kyu def expanded_form(num): return ' + '.join([str(num)[x] + '0'* (len(str(num)) - 1 - x) for x in range(len(str(num))) if str(num)[x] != '0'])
31.25
119
0.632
43
250
3.651163
0.627907
0.152866
0.089172
0.101911
0
0
0
0
0
0
0
0.019324
0.172
250
7
120
35.714286
0.73913
0.388
0
0
0
0
0.033557
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
ff5e9a011adf2581ce9860a04e89ff9f752bd10e
97
py
Python
initializer/apps.py
ay4m/patientProfiling
b56b0fe49076414c332c6318891776e8ddfa18d6
[ "Apache-2.0" ]
null
null
null
initializer/apps.py
ay4m/patientProfiling
b56b0fe49076414c332c6318891776e8ddfa18d6
[ "Apache-2.0" ]
null
null
null
initializer/apps.py
ay4m/patientProfiling
b56b0fe49076414c332c6318891776e8ddfa18d6
[ "Apache-2.0" ]
1
2018-08-06T13:36:11.000Z
2018-08-06T13:36:11.000Z
from django.apps import AppConfig class InitializerConfig(AppConfig): name = 'initializer'
16.166667
35
0.773196
10
97
7.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.154639
97
5
36
19.4
0.914634
0
0
0
0
0
0.113402
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
ff6229f1fb6e601f21ca0481c8327beee9a0ab4e
416
py
Python
test/test_charge.py
qwerty29544/Py_Nonstationary_EM_integralEq
c90514019fa3bf0db400f72df837f41bfcb946fb
[ "MIT" ]
2
2021-09-12T07:56:55.000Z
2021-09-18T05:22:02.000Z
test/test_charge.py
qwerty29544/Py_Nonstationary_EM_integralEq
c90514019fa3bf0db400f72df837f41bfcb946fb
[ "MIT" ]
null
null
null
test/test_charge.py
qwerty29544/Py_Nonstationary_EM_integralEq
c90514019fa3bf0db400f72df837f41bfcb946fb
[ "MIT" ]
2
2021-09-11T07:16:38.000Z
2021-09-17T08:21:53.000Z
import src.charge as charge import numpy as np import os def test_f_function(): assert (charge.f_function(1 / 22, 1) == 0) assert (charge.f_function(1 / 21, 1) == 0) assert (charge.f_function(1 / 20, 1) != 0) assert (charge.f_function(0, 1) == 0) assert (charge.f_function(1, 1) == 0) def test_index(): array = np.arange(9) assert array[-1] == 8 assert array[0] == 0 test_index()
21.894737
46
0.620192
70
416
3.557143
0.314286
0.216867
0.261044
0.421687
0.46988
0.381526
0.289157
0
0
0
0
0.080495
0.223558
416
19
47
21.894737
0.690402
0
0
0
0
0
0
0
0
0
0
0
0.5
1
0.142857
false
0
0.214286
0
0.357143
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
ff869b6f159ede98e681a21b19eb2d8d8789f299
115
py
Python
V2RaycSpider1025/funcBase/get_v2ray_link.py
caicai166/V2RayCloudSpider
b263490407814c9e67e34fcce821af01a22405f1
[ "MIT" ]
4
2020-11-18T00:25:54.000Z
2022-03-14T11:54:13.000Z
V2RaycSpider1025/funcBase/get_v2ray_link.py
caicai166/V2RayCloudSpider
b263490407814c9e67e34fcce821af01a22405f1
[ "MIT" ]
null
null
null
V2RaycSpider1025/funcBase/get_v2ray_link.py
caicai166/V2RayCloudSpider
b263490407814c9e67e34fcce821af01a22405f1
[ "MIT" ]
3
2021-01-03T03:16:29.000Z
2021-06-02T04:09:59.000Z
# windows10 下不可用 from spiderNest.defender import Defender if __name__ == '__main__': Defender('v2ray').run()
16.428571
40
0.721739
13
115
5.769231
0.846154
0
0
0
0
0
0
0
0
0
0
0.030928
0.156522
115
6
41
19.166667
0.742268
0.121739
0
0
0
0
0.131313
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
441e36a443f58eb1d1769864a8c0160fbf1e4c30
96
py
Python
src/synctogit/__init__.py
KostyaEsmukov/SyncToG
053f4b1c8dfe20a1567d4b675a58ea3055a89bf3
[ "MIT" ]
8
2016-12-01T12:03:41.000Z
2021-11-23T19:03:13.000Z
src/synctogit/__init__.py
kostya0shift/SyncToGit
b3f2ec7e1167a0b032d4d40726de625d31a02354
[ "MIT" ]
1
2020-04-30T17:00:00.000Z
2020-04-30T17:00:00.000Z
src/synctogit/__init__.py
kostya0shift/SyncToGit
b3f2ec7e1167a0b032d4d40726de625d31a02354
[ "MIT" ]
1
2021-03-04T16:35:48.000Z
2021-03-04T16:35:48.000Z
from pkg_resources import get_distribution __version__ = get_distribution("synctogit").version
24
51
0.854167
11
96
6.818182
0.727273
0.4
0
0
0
0
0
0
0
0
0
0
0.083333
96
3
52
32
0.852273
0
0
0
0
0
0.09375
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
44525031885c59d3dcfc016c420cb786888f7a49
2,410
py
Python
unit_tests/test_decorators.py
LandRegistry/maintain-frontend
d92446a9972ebbcd9a43a7a7444a528aa2f30bf7
[ "MIT" ]
1
2019-10-03T13:58:29.000Z
2019-10-03T13:58:29.000Z
unit_tests/test_decorators.py
LandRegistry/maintain-frontend
d92446a9972ebbcd9a43a7a7444a528aa2f30bf7
[ "MIT" ]
null
null
null
unit_tests/test_decorators.py
LandRegistry/maintain-frontend
d92446a9972ebbcd9a43a7a7444a528aa2f30bf7
[ "MIT" ]
1
2021-04-11T05:24:57.000Z
2021-04-11T05:24:57.000Z
from flask_testing import TestCase from unittest.mock import patch from unit_tests.utilities import Utilities from maintain_frontend.decorators import requires_two_factor_authentication from maintain_frontend import main @requires_two_factor_authentication() def redirect_test_route(): return 'route body' class TestDecorators(TestCase): def create_app(self): Utilities.mock_session_cookie_flask_test(self) return main.app @patch('maintain_frontend.decorators.g') @patch('maintain_frontend.decorators.request') @patch('maintain_frontend.decorators.redirect') @patch('maintain_frontend.decorators.config') def test_two_factor_authentication_redirects( self, mock_config, mock_redirect, mock_request, mock_g ): mock_config.ENABLE_TWO_FACTOR_AUTHENTICATION = True mock_g.session.two_factor_authentication_passed = False mock_request.path = 'test-path' redirect_test_route() self.assertEqual(mock_g.session.two_factor_authentication_redirect_url, 'test-path') self.assertEqual(len(mock_g.session.commit_2fa_state.mock_calls), 1) mock_redirect.assert_called_with('/check-your-email') @patch('maintain_frontend.decorators.g') @patch('maintain_frontend.decorators.request') @patch('maintain_frontend.decorators.redirect') @patch('maintain_frontend.decorators.config') def test_two_factor_authentication_passes_if_disabled( self, mock_config, mock_redirect, mock_request, mock_g ): mock_config.ENABLE_TWO_FACTOR_AUTHENTICATION = False mock_g.session.two_factor_authentication_passed = False response = redirect_test_route() self.assertEqual(response, 'route body') self.assertEqual(len(mock_redirect.mock_calls), 0) @patch('maintain_frontend.decorators.g') @patch('maintain_frontend.decorators.request') @patch('maintain_frontend.decorators.redirect') @patch('maintain_frontend.decorators.config') def test_two_factor_authentication_passes_subsequent_checks( self, mock_config, mock_redirect, mock_request, mock_g ): mock_config.ENABLE_TWO_FACTOR_AUTHENTICATION = True mock_g.session.two_factor_authentication_passed = True response = redirect_test_route() self.assertEqual(response, 'route body') self.assertEqual(len(mock_redirect.mock_calls), 0)
37.65625
92
0.756432
286
2,410
6.01049
0.216783
0.130308
0.196626
0.216405
0.689354
0.670739
0.650378
0.650378
0.62071
0.62071
0
0.001971
0.158091
2,410
63
93
38.253968
0.845244
0
0
0.56
0
0
0.198755
0.171784
0
0
0
0
0.14
1
0.1
false
0.1
0.1
0.02
0.26
0
0
0
0
null
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
447562b9d21ac46ebf9d5be98f32cc7dd69587da
23
py
Python
auth0/__init__.py
matthewarmand/auth0-python
1571b18535c46502e39e70f988f96624f2dfef21
[ "MIT" ]
14
2019-03-13T19:13:48.000Z
2021-11-16T11:05:30.000Z
tinydb/version.py
vstoykov/tinydb
c3553af48d10f7b691bac89ff7a4dc9e42eb1e58
[ "MIT" ]
140
2019-03-14T19:49:40.000Z
2022-03-21T11:14:03.000Z
tinydb/version.py
vstoykov/tinydb
c3553af48d10f7b691bac89ff7a4dc9e42eb1e58
[ "MIT" ]
22
2019-05-08T14:50:08.000Z
2022-01-13T10:32:06.000Z
__version__ = '3.12.0'
11.5
22
0.652174
4
23
2.75
1
0
0
0
0
0
0
0
0
0
0
0.2
0.130435
23
1
23
23
0.35
0
0
0
0
0
0.26087
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
44870fefe14d25cee44baca9171b28e7bf939602
62
py
Python
tests/__init__.py
cthoyt/income2019
b336a31d2b15e5ec504fcb57a141602ceea0249e
[ "MIT" ]
null
null
null
tests/__init__.py
cthoyt/income2019
b336a31d2b15e5ec504fcb57a141602ceea0249e
[ "MIT" ]
8
2019-11-27T23:12:17.000Z
2020-02-12T16:28:31.000Z
tests/__init__.py
BradleyScrim/table-validator
5c2287f0769b2edf633c96e2911f12fdbea35caa
[ "MIT" ]
3
2019-08-07T10:09:19.000Z
2019-11-27T22:26:06.000Z
# -*- coding: utf-8 -*- """Tests for ``table_validator``."""
15.5
36
0.532258
7
62
4.571429
1
0
0
0
0
0
0
0
0
0
0
0.018868
0.145161
62
3
37
20.666667
0.584906
0.854839
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
4498557c9a55c39e2d10ff7706b2c1d077f10166
78
py
Python
tests/asl_Map/workflow_map_state_iro_paths_processing_test/paymentFailed.py
lhoste-bell/knix
8d3f0ed3b8a09e62b7d5098b10851b9fa42d7ce1
[ "Apache-2.0" ]
167
2020-04-20T22:16:29.000Z
2022-03-15T22:53:43.000Z
tests/asl_Map/workflow_map_state_iro_paths_processing_test/paymentFailed.py
lhoste-bell/knix
8d3f0ed3b8a09e62b7d5098b10851b9fa42d7ce1
[ "Apache-2.0" ]
98
2020-05-07T03:34:44.000Z
2022-01-04T21:30:49.000Z
tests/asl_Map/workflow_map_state_iro_paths_processing_test/paymentFailed.py
lhoste-bell/knix
8d3f0ed3b8a09e62b7d5098b10851b9fa42d7ce1
[ "Apache-2.0" ]
20
2020-04-29T14:45:29.000Z
2021-09-26T09:51:04.000Z
#!/usr/bin/python def handle(event, context): return "payment failed!"
11.142857
28
0.666667
10
78
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.179487
78
6
29
13
0.8125
0.205128
0
0
0
0
0.25
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
0
0
0
4
92286074042f102dfb21653a4f81912f5634373f
306
py
Python
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
Galland/kivy
95a6bf279883d706f645e4629c16d5ee1038f0ec
[ "MIT" ]
13,889
2015-01-01T06:43:41.000Z
2022-03-31T17:37:56.000Z
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
Galland/kivy
95a6bf279883d706f645e4629c16d5ee1038f0ec
[ "MIT" ]
4,570
2015-01-01T17:58:52.000Z
2022-03-31T18:42:16.000Z
kivy/tools/packaging/pyinstaller_hooks/hook-kivy.py
Galland/kivy
95a6bf279883d706f645e4629c16d5ee1038f0ec
[ "MIT" ]
3,786
2015-01-01T09:20:45.000Z
2022-03-30T21:15:05.000Z
from kivy.tools.packaging.pyinstaller_hooks import ( add_dep_paths, excludedimports, datas, get_deps_all, get_factory_modules, kivy_modules) add_dep_paths() hiddenimports = [] # get_deps_all()['hiddenimports'] hiddenimports = list(set( get_factory_modules() + kivy_modules + hiddenimports))
30.6
58
0.771242
37
306
5.972973
0.540541
0.054299
0.099548
0.190045
0.253394
0
0
0
0
0
0
0
0.127451
306
9
59
34
0.827715
0.101307
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.714286
0
0.714286
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
924c7d247fdc7039a9c97dba77074bf9915fb0d6
336
py
Python
Data.py
tanishq1g/San_Francisco_Crime_Classification__kaggle
68f46c9b647c366a5bfe0701959bac5faab3cf47
[ "MIT" ]
null
null
null
Data.py
tanishq1g/San_Francisco_Crime_Classification__kaggle
68f46c9b647c366a5bfe0701959bac5faab3cf47
[ "MIT" ]
null
null
null
Data.py
tanishq1g/San_Francisco_Crime_Classification__kaggle
68f46c9b647c366a5bfe0701959bac5faab3cf47
[ "MIT" ]
null
null
null
import pandas as pd class Data: def __init__(self, file_train, file_test = None): self.file_train = file_train self.file_test = file_test def data_import(self): self.train = pd.read_csv(self.file_train, parse_dates = ['Dates']) self.test = pd.read_csv(self.file_test, parse_dates = ['Dates'])
28
74
0.66369
50
336
4.12
0.34
0.194175
0.18932
0.165049
0.165049
0
0
0
0
0
0
0
0.223214
336
11
75
30.545455
0.789272
0
0
0
0
0
0.029762
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.625
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
0
1
0
0
4
925e88ca56a38d387eec786509682606529339e0
1,536
py
Python
simplemes/mesfactory/migrations/0004_auto_20190915_0043.py
saulshao/simplemes
fb317570666f776231c1ffd48c6114b9697e47f1
[ "MIT" ]
null
null
null
simplemes/mesfactory/migrations/0004_auto_20190915_0043.py
saulshao/simplemes
fb317570666f776231c1ffd48c6114b9697e47f1
[ "MIT" ]
null
null
null
simplemes/mesfactory/migrations/0004_auto_20190915_0043.py
saulshao/simplemes
fb317570666f776231c1ffd48c6114b9697e47f1
[ "MIT" ]
null
null
null
# Generated by Django 2.2.5 on 2019-09-14 22:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mesfactory', '0003_auto_20190915_0042'), ] operations = [ migrations.AddField( model_name='factory', name='updated_on', field=models.DateTimeField(auto_now=True), ), migrations.AddField( model_name='line', name='updated_on', field=models.DateTimeField(auto_now=True), ), migrations.AddField( model_name='station', name='updated_on', field=models.DateTimeField(auto_now=True), ), migrations.AddField( model_name='workshop', name='updated_on', field=models.DateTimeField(auto_now=True), ), migrations.AlterField( model_name='factory', name='created_on', field=models.DateTimeField(auto_now_add=True), ), migrations.AlterField( model_name='line', name='created_on', field=models.DateTimeField(auto_now_add=True), ), migrations.AlterField( model_name='station', name='created_on', field=models.DateTimeField(auto_now_add=True), ), migrations.AlterField( model_name='workshop', name='created_on', field=models.DateTimeField(auto_now_add=True), ), ]
28.444444
58
0.557292
145
1,536
5.689655
0.275862
0.087273
0.126061
0.252121
0.718788
0.695758
0.695758
0.695758
0.695758
0.695758
0
0.030214
0.332031
1,536
53
59
28.981132
0.773879
0.029297
0
0.851064
1
0
0.110813
0.015447
0
0
0
0
0
1
0
false
0
0.021277
0
0.085106
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
9278be1d62ce2824a9c8ba6121b264d62bd55b04
1,586
py
Python
application/KitchenMagician/kitchen_magician/recipe/admin.py
AsuPaul19/Kitchen-Magician
8c22bc1a45942d22c183096f8e92f858983d351d
[ "MIT" ]
null
null
null
application/KitchenMagician/kitchen_magician/recipe/admin.py
AsuPaul19/Kitchen-Magician
8c22bc1a45942d22c183096f8e92f858983d351d
[ "MIT" ]
8
2021-04-08T20:50:25.000Z
2022-03-12T00:53:18.000Z
application/KitchenMagician/kitchen_magician/recipe/admin.py
AsuPaul19/Kitchen-Magician
8c22bc1a45942d22c183096f8e92f858983d351d
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Recipe from .models import RecipeCourse from .models import RecipeCourseItem from .models import RecipeIngredient from .models import RecipeIngredientItem from .models import RecipeInformation from .models import RecipeInstruction from .models import RecipeImage from .models import RecipeVideo from .models import RecipeFavorite from .models import RecipeUpvote from .models import RecipeComment from .models import RecipeOccasion from .models import RecipeOccasionItem from .models import RecipeDiet from .models import RecipeDietItem from .models import RecipePreparationTime from .models import RecipePreparationTimeItem from .models import RecipeCookingTime from .models import RecipeCookingTimeItem from .models import RecipeQuantityServe admin.site.register(Recipe) admin.site.register(RecipeCourse) admin.site.register(RecipeCourseItem) admin.site.register(RecipeIngredient) admin.site.register(RecipeIngredientItem) admin.site.register(RecipeInformation) admin.site.register(RecipeInstruction) admin.site.register(RecipeImage) admin.site.register(RecipeVideo) admin.site.register(RecipeFavorite) admin.site.register(RecipeUpvote) admin.site.register(RecipeComment) admin.site.register(RecipeOccasion) admin.site.register(RecipeOccasionItem) admin.site.register(RecipeDiet) admin.site.register(RecipeDietItem) admin.site.register(RecipeQuantityServe) admin.site.register(RecipePreparationTime) admin.site.register(RecipePreparationTimeItem) admin.site.register(RecipeCookingTime) admin.site.register(RecipeCookingTimeItem)
34.478261
46
0.863178
173
1,586
7.913295
0.16763
0.153397
0.245435
0.052593
0
0
0
0
0
0
0
0
0.069987
1,586
46
47
34.478261
0.928136
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.511628
0
0.511628
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
92820fb76d1bca9412748373661f6626a5e65d8f
78
py
Python
testes/def.py
yurixf/Python
d1f91d52235dcba73deff281d80af0b44f028735
[ "MIT" ]
null
null
null
testes/def.py
yurixf/Python
d1f91d52235dcba73deff281d80af0b44f028735
[ "MIT" ]
null
null
null
testes/def.py
yurixf/Python
d1f91d52235dcba73deff281d80af0b44f028735
[ "MIT" ]
null
null
null
def soma(a, b): s = a + b print(s) soma (2*3, 4) soma (2, 3)
11.142857
15
0.397436
16
78
1.9375
0.5625
0.129032
0.387097
0
0
0
0
0
0
0
0
0.108696
0.410256
78
7
16
11.142857
0.565217
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0
0.2
0.2
1
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
92a66f2f33513a1f7cfee09d25b03b2c664b82ce
490
py
Python
app/models/SignUp.py
AmlAlx007/FagitoPython
e94010c7bf12fd26991062dae423219e4b7e33f4
[ "MIT" ]
null
null
null
app/models/SignUp.py
AmlAlx007/FagitoPython
e94010c7bf12fd26991062dae423219e4b7e33f4
[ "MIT" ]
null
null
null
app/models/SignUp.py
AmlAlx007/FagitoPython
e94010c7bf12fd26991062dae423219e4b7e33f4
[ "MIT" ]
null
null
null
from database import db class SignUp(db.Model): __tablename__ = 'sign_up' sign_up_id = db.Column(db.String, primary_key=True) email = db.Column(db.String) password = db.Column(db.String) user_id = db.Column(db.String) @classmethod def find_all(cls): return cls.query.all() @classmethod def order_data(cls): return cls.query.group_by(cls.sign_up_id) def commit_data(self): db.session.add(self) db.session.commit()
22.272727
55
0.653061
71
490
4.295775
0.478873
0.104918
0.131148
0.209836
0.118033
0
0
0
0
0
0
0
0.230612
490
22
56
22.272727
0.809019
0
0
0.125
0
0
0.014257
0
0
0
0
0
0
1
0.1875
false
0.0625
0.0625
0.125
0.75
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
1
1
0
0
4
92add0c219267778d722d5604d2cd6c5cec4515f
673
py
Python
tableschema/types/__init__.py
vincentchevrier/tableschema-py
d47b6d73ab3ea1051c866b93b6e2b9202bbd40b1
[ "MIT" ]
224
2017-04-11T11:29:48.000Z
2022-03-26T18:34:50.000Z
tableschema/types/__init__.py
vincentchevrier/tableschema-py
d47b6d73ab3ea1051c866b93b6e2b9202bbd40b1
[ "MIT" ]
111
2017-03-28T19:02:01.000Z
2021-12-20T08:42:21.000Z
tableschema/types/__init__.py
vincentchevrier/tableschema-py
d47b6d73ab3ea1051c866b93b6e2b9202bbd40b1
[ "MIT" ]
40
2017-04-01T08:21:57.000Z
2021-02-28T23:52:07.000Z
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # Module API from .any import cast_any from .array import cast_array from .boolean import cast_boolean from .date import cast_date from .datetime import cast_datetime from .duration import cast_duration from .geojson import cast_geojson from .geopoint import cast_geopoint from .integer import cast_integer from .number import cast_number from .object import cast_object from .string import cast_string from .time import cast_time from .year import cast_year from .yearmonth import cast_yearmonth
26.92
39
0.833581
99
673
5.323232
0.30303
0.28463
0.121442
0
0
0
0
0
0
0
0
0.001706
0.129272
673
24
40
28.041667
0.897611
0.047548
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.052632
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
2b93601ced5f02d6a0d4aff2135e1e2fba4edd76
247
py
Python
tests/api/api_v1/conftest.py
javi-cortes/linkedon
3021e2d737ac1c71b2bda3a74a0d8a8b0db37158
[ "MIT" ]
null
null
null
tests/api/api_v1/conftest.py
javi-cortes/linkedon
3021e2d737ac1c71b2bda3a74a0d8a8b0db37158
[ "MIT" ]
null
null
null
tests/api/api_v1/conftest.py
javi-cortes/linkedon
3021e2d737ac1c71b2bda3a74a0d8a8b0db37158
[ "MIT" ]
null
null
null
import pytest from app.services.job import JobCRUD from app.services.user import UserCRUD @pytest.fixture(scope="function") def job_crud(db): return JobCRUD(db) @pytest.fixture(scope="function") def user_crud(db): return UserCRUD(db)
16.466667
38
0.753036
36
247
5.111111
0.444444
0.076087
0.163043
0.282609
0.315217
0
0
0
0
0
0
0
0.133603
247
14
39
17.642857
0.859813
0
0
0.222222
0
0
0.064777
0
0
0
0
0
0
1
0.222222
false
0
0.333333
0.222222
0.777778
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
0
0
0
4
2bb0a9788d211cf41032d34d59b982574e54e3d4
7,926
py
Python
aiotdlib/api/types/input_passport_element.py
jraylan/aiotdlib
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
[ "MIT" ]
37
2021-05-04T10:41:41.000Z
2022-03-30T13:48:05.000Z
aiotdlib/api/types/input_passport_element.py
jraylan/aiotdlib
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
[ "MIT" ]
13
2021-07-17T19:54:51.000Z
2022-02-26T06:50:00.000Z
aiotdlib/api/types/input_passport_element.py
jraylan/aiotdlib
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
[ "MIT" ]
7
2021-09-22T21:27:11.000Z
2022-02-20T02:33:19.000Z
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # # # =============================================================================== # from __future__ import annotations from pydantic import Field from .address import Address from .input_identity_document import InputIdentityDocument from .input_personal_document import InputPersonalDocument from .personal_details import PersonalDetails from ..base_object import BaseObject class InputPassportElement(BaseObject): """ Contains information about a Telegram Passport element to be saved """ ID: str = Field("inputPassportElement", alias="@type") class InputPassportElementAddress(InputPassportElement): """ A Telegram Passport element to be saved containing the user's address :param address: The address to be saved :type address: :class:`Address` """ ID: str = Field("inputPassportElementAddress", alias="@type") address: Address @staticmethod def read(q: dict) -> InputPassportElementAddress: return InputPassportElementAddress.construct(**q) class InputPassportElementBankStatement(InputPassportElement): """ A Telegram Passport element to be saved containing the user's bank statement :param bank_statement: The bank statement to be saved :type bank_statement: :class:`InputPersonalDocument` """ ID: str = Field("inputPassportElementBankStatement", alias="@type") bank_statement: InputPersonalDocument @staticmethod def read(q: dict) -> InputPassportElementBankStatement: return InputPassportElementBankStatement.construct(**q) class InputPassportElementDriverLicense(InputPassportElement): """ A Telegram Passport element to be saved containing the user's driver license :param driver_license: The driver license to be saved :type driver_license: :class:`InputIdentityDocument` """ ID: str = Field("inputPassportElementDriverLicense", alias="@type") driver_license: InputIdentityDocument @staticmethod def read(q: dict) -> InputPassportElementDriverLicense: return InputPassportElementDriverLicense.construct(**q) class InputPassportElementEmailAddress(InputPassportElement): """ A Telegram Passport element to be saved containing the user's email address :param email_address: The email address to be saved :type email_address: :class:`str` """ ID: str = Field("inputPassportElementEmailAddress", alias="@type") email_address: str @staticmethod def read(q: dict) -> InputPassportElementEmailAddress: return InputPassportElementEmailAddress.construct(**q) class InputPassportElementIdentityCard(InputPassportElement): """ A Telegram Passport element to be saved containing the user's identity card :param identity_card: The identity card to be saved :type identity_card: :class:`InputIdentityDocument` """ ID: str = Field("inputPassportElementIdentityCard", alias="@type") identity_card: InputIdentityDocument @staticmethod def read(q: dict) -> InputPassportElementIdentityCard: return InputPassportElementIdentityCard.construct(**q) class InputPassportElementInternalPassport(InputPassportElement): """ A Telegram Passport element to be saved containing the user's internal passport :param internal_passport: The internal passport to be saved :type internal_passport: :class:`InputIdentityDocument` """ ID: str = Field("inputPassportElementInternalPassport", alias="@type") internal_passport: InputIdentityDocument @staticmethod def read(q: dict) -> InputPassportElementInternalPassport: return InputPassportElementInternalPassport.construct(**q) class InputPassportElementPassport(InputPassportElement): """ A Telegram Passport element to be saved containing the user's passport :param passport: The passport to be saved :type passport: :class:`InputIdentityDocument` """ ID: str = Field("inputPassportElementPassport", alias="@type") passport: InputIdentityDocument @staticmethod def read(q: dict) -> InputPassportElementPassport: return InputPassportElementPassport.construct(**q) class InputPassportElementPassportRegistration(InputPassportElement): """ A Telegram Passport element to be saved containing the user's passport registration :param passport_registration: The passport registration page to be saved :type passport_registration: :class:`InputPersonalDocument` """ ID: str = Field("inputPassportElementPassportRegistration", alias="@type") passport_registration: InputPersonalDocument @staticmethod def read(q: dict) -> InputPassportElementPassportRegistration: return InputPassportElementPassportRegistration.construct(**q) class InputPassportElementPersonalDetails(InputPassportElement): """ A Telegram Passport element to be saved containing the user's personal details :param personal_details: Personal details of the user :type personal_details: :class:`PersonalDetails` """ ID: str = Field("inputPassportElementPersonalDetails", alias="@type") personal_details: PersonalDetails @staticmethod def read(q: dict) -> InputPassportElementPersonalDetails: return InputPassportElementPersonalDetails.construct(**q) class InputPassportElementPhoneNumber(InputPassportElement): """ A Telegram Passport element to be saved containing the user's phone number :param phone_number: The phone number to be saved :type phone_number: :class:`str` """ ID: str = Field("inputPassportElementPhoneNumber", alias="@type") phone_number: str @staticmethod def read(q: dict) -> InputPassportElementPhoneNumber: return InputPassportElementPhoneNumber.construct(**q) class InputPassportElementRentalAgreement(InputPassportElement): """ A Telegram Passport element to be saved containing the user's rental agreement :param rental_agreement: The rental agreement to be saved :type rental_agreement: :class:`InputPersonalDocument` """ ID: str = Field("inputPassportElementRentalAgreement", alias="@type") rental_agreement: InputPersonalDocument @staticmethod def read(q: dict) -> InputPassportElementRentalAgreement: return InputPassportElementRentalAgreement.construct(**q) class InputPassportElementTemporaryRegistration(InputPassportElement): """ A Telegram Passport element to be saved containing the user's temporary registration :param temporary_registration: The temporary registration document to be saved :type temporary_registration: :class:`InputPersonalDocument` """ ID: str = Field("inputPassportElementTemporaryRegistration", alias="@type") temporary_registration: InputPersonalDocument @staticmethod def read(q: dict) -> InputPassportElementTemporaryRegistration: return InputPassportElementTemporaryRegistration.construct(**q) class InputPassportElementUtilityBill(InputPassportElement): """ A Telegram Passport element to be saved containing the user's utility bill :param utility_bill: The utility bill to be saved :type utility_bill: :class:`InputPersonalDocument` """ ID: str = Field("inputPassportElementUtilityBill", alias="@type") utility_bill: InputPersonalDocument @staticmethod def read(q: dict) -> InputPassportElementUtilityBill: return InputPassportElementUtilityBill.construct(**q)
32.35102
88
0.709563
692
7,926
8.065029
0.124277
0.018635
0.041928
0.060204
0.362301
0.296542
0.213582
0.168249
0.168249
0.168249
0
0
0.196694
7,926
244
89
32.483607
0.876551
0.358567
0
0.149425
1
0
0.113004
0.093595
0
0
0
0
0
1
0.149425
false
0.655172
0.08046
0.149425
0.850575
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
1
1
0
0
4
920842083e8e2ad9a0214274f707b02e72186f8b
60
py
Python
nssrc/com/citrix/netscaler/nitro/resource/stat/tm/__init__.py
guardicore/nitro-python
5346a5086134aead80968f15a41ff527adaa0ec1
[ "Apache-2.0" ]
2
2020-08-24T18:04:22.000Z
2020-08-24T18:04:47.000Z
nitro/resource/stat/tm/__init__.py
HanseMerkur/nitro-python
d03eb11f492a35a2a8b2a140322fbce22d25a8f7
[ "Apache-2.0" ]
null
null
null
nitro/resource/stat/tm/__init__.py
HanseMerkur/nitro-python
d03eb11f492a35a2a8b2a140322fbce22d25a8f7
[ "Apache-2.0" ]
null
null
null
__all__ = ['tmsessionpolicy_stats', 'tmtrafficpolicy_stats']
60
60
0.816667
5
60
8.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.05
60
1
60
60
0.754386
0
0
0
0
0
0.688525
0.688525
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a60dda6ff28d0866ecc630590317683b088d60c3
257
py
Python
src/util/run.py
sudoursa/textMining
57ae49cb1aaa59a901e8c69cd47ee01c5a2d32bd
[ "MIT" ]
null
null
null
src/util/run.py
sudoursa/textMining
57ae49cb1aaa59a901e8c69cd47ee01c5a2d32bd
[ "MIT" ]
null
null
null
src/util/run.py
sudoursa/textMining
57ae49cb1aaa59a901e8c69cd47ee01c5a2d32bd
[ "MIT" ]
null
null
null
"""Entry point""" import sys from analyzer import normalize, read_file, word_freq, computeTfIDF if __name__ == '__main__': TFIDF = normalize(read_file(sys.argv[1])) FREQ = word_freq(read_file(sys.argv[1])) # print(FREQ) computeTfIDF(TFIDF)
25.7
66
0.70428
35
257
4.8
0.542857
0.142857
0.202381
0.178571
0.190476
0
0
0
0
0
0
0.009259
0.159533
257
9
67
28.555556
0.768519
0.093385
0
0
0
0
0.035242
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
a618ae9c4a4b91fe0f210e5763838d35ecd96fdf
1,864
py
Python
test_calc.py
itsadok/calc
98b29faece531d15f6e1ac10f51c3311e8336507
[ "CC0-1.0" ]
null
null
null
test_calc.py
itsadok/calc
98b29faece531d15f6e1ac10f51c3311e8336507
[ "CC0-1.0" ]
null
null
null
test_calc.py
itsadok/calc
98b29faece531d15f6e1ac10f51c3311e8336507
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/env python3 import calc import unittest class TestCalc(unittest.TestCase): def test_assign(self): self.assertEqual('(i=1)', calc.run('i=1')) def test_whitespace(self): self.assertEqual('(i=1)', calc.run('\n\n\ti = 1\n')) def test_add(self): self.assertEqual('(i=3)', calc.run('i=1+2')) def test_sub(self): self.assertEqual('(i=-1)', calc.run('i=1-2')) def test_mul(self): self.assertEqual('(i=12)', calc.run('i=6*2')) def test_div(self): self.assertEqual('(i=3)', calc.run('i=6/2')) def test_multiterm(self): self.assertEqual('(i=22)', calc.run('i=3*4+2*5')) self.assertEqual('(i=0)', calc.run('i=1+2+3-3-2-1')) def test_negative(self): self.assertEqual('(i=1)', calc.run('i = -1*3 - 4*-3 + -8')) self.assertEqual('(i=-4)', calc.run('i = -2-2')) def test_multiline(self): self.assertEqual('(i=3,j=4)', calc.run('i=3\nj=4')) def test_assign_plus(self): self.assertEqual('(i=4)', calc.run('i=3\ni+=1')) def test_ident_value(self): self.assertEqual('(i=3,j=3)', calc.run('i=3\nj=i')) def test_pre_inc(self): self.assertEqual('(i=4,j=4)', calc.run('i=3\nj=++i')) self.assertEqual('(i=4,j=6)', calc.run('i=3\nj=2+++i')) def test_post_inc(self): self.assertEqual('(i=4,j=3)', calc.run('i=3\nj=i++')) def test_program(self): program = ''' i = 0 j = ++i x = i++ + 5 y = 5 + 3 * 10 i += y ''' self.assertEqual('(i=37,j=1,x=6,y=35)', calc.run(program)) def test_invalid(self): self.assertRaises(calc.ParseError, calc.run, '3') def test_ref_before_assign(self): self.assertRaises(KeyError, calc.run, 'i=j') if __name__ == '__main__': unittest.main()
27.820896
67
0.542918
299
1,864
3.284281
0.204013
0.135438
0.276986
0.264766
0.480652
0.435845
0.392057
0.193483
0.13442
0.04277
0
0.051049
0.232833
1,864
66
68
28.242424
0.635664
0.011266
0
0
0
0
0.214441
0
0
0
0
0
0.404255
1
0.340426
false
0
0.042553
0
0.404255
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
0
0
0
4
a61c8de3f3d04d2493f98147c2290ac5731132a3
68
py
Python
test_apps/python_app/example/flows/o1_testcases/components/deep_nested.py
Origen-SDK/o2
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
[ "MIT" ]
null
null
null
test_apps/python_app/example/flows/o1_testcases/components/deep_nested.py
Origen-SDK/o2
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
[ "MIT" ]
127
2019-11-23T17:09:35.000Z
2021-09-02T11:06:20.000Z
test_apps/python_app/example/flows/o1_testcases/components/deep_nested.py
Origen-SDK/o2
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
[ "MIT" ]
null
null
null
with Flow() as flow: flow.add_test("deep_test", id="deep_test")
22.666667
46
0.676471
12
68
3.583333
0.583333
0.372093
0
0
0
0
0
0
0
0
0
0
0.147059
68
2
47
34
0.741379
0
0
0
0
0
0.264706
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
a642932933d16672dcd769c203858b2617210676
80
py
Python
utensor_cgen/backend/__init__.py
dboyliao/utensor_cgen
aacd3adf4ee2a521a8eb2e75807fe3c1c0d1e1e5
[ "Apache-2.0" ]
1
2017-12-29T17:40:49.000Z
2017-12-29T17:40:49.000Z
utensor_cgen/backend/__init__.py
dboyliao/utensor_cgen
aacd3adf4ee2a521a8eb2e75807fe3c1c0d1e1e5
[ "Apache-2.0" ]
1
2017-12-28T02:25:45.000Z
2017-12-28T02:25:45.000Z
utensor_cgen/backend/__init__.py
dboyliao/utensor_cgen
aacd3adf4ee2a521a8eb2e75807fe3c1c0d1e1e5
[ "Apache-2.0" ]
3
2017-12-27T17:15:38.000Z
2017-12-29T06:43:00.000Z
from .code_generator import CodeGenerator from .operators import OperatorFactory
40
41
0.8875
9
80
7.777778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.0875
80
2
42
40
0.958904
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a655de9291c66c575a6be9429a7894f201c9e077
61
py
Python
scripts/salary.py
dantaylor688/dantaylor688.github.io
f430224693c94a7469826f88b88bd9b1460e1cc9
[ "MIT" ]
null
null
null
scripts/salary.py
dantaylor688/dantaylor688.github.io
f430224693c94a7469826f88b88bd9b1460e1cc9
[ "MIT" ]
null
null
null
scripts/salary.py
dantaylor688/dantaylor688.github.io
f430224693c94a7469826f88b88bd9b1460e1cc9
[ "MIT" ]
null
null
null
from pylab import * if __name__ == "__main__": celebs =
15.25
26
0.639344
7
61
4.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.245902
61
4
27
15.25
0.673913
0
0
0
0
0
0.129032
0
0
0
0
0
0
0
null
null
0
0.333333
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
a694cd092a0ae0c903ae54a604697a2df86dc3fd
401
py
Python
spec/python/test_valid_fail_inst.py
DarkShadow44/kaitai_struct_tests
4bb13cef82965cca66dda2eb2b77cd64e9f70a12
[ "MIT" ]
11
2018-04-01T03:58:15.000Z
2021-08-14T09:04:55.000Z
spec/python/test_valid_fail_inst.py
DarkShadow44/kaitai_struct_tests
4bb13cef82965cca66dda2eb2b77cd64e9f70a12
[ "MIT" ]
73
2016-07-20T10:27:15.000Z
2020-12-17T18:56:46.000Z
spec/python/test_valid_fail_inst.py
DarkShadow44/kaitai_struct_tests
4bb13cef82965cca66dda2eb2b77cd64e9f70a12
[ "MIT" ]
37
2016-08-15T08:25:56.000Z
2021-08-28T14:48:46.000Z
# Autogenerated from KST: please remove this line if doing any edits by hand! import unittest import kaitaistruct from valid_fail_inst import ValidFailInst class TestValidFailInst(unittest.TestCase): def test_valid_fail_inst(self): with self.assertRaises(kaitaistruct.ValidationNotEqualError): with ValidFailInst.from_file('src/fixed_struct.bin') as r: pass
30.846154
77
0.753117
49
401
6.020408
0.755102
0.061017
0.088136
0
0
0
0
0
0
0
0
0
0.189526
401
12
78
33.416667
0.907692
0.187032
0
0
1
0
0.061728
0
0
0
0
0
0.125
1
0.125
false
0.125
0.375
0
0.625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
4
a6c42394a8c62b468259b44d476bac3455faf3b8
97
py
Python
demo.py
jerrykan/herder
381f51198f21d232cc05d7c458638d78c0f25366
[ "MIT" ]
20
2016-06-16T15:34:21.000Z
2021-11-17T10:02:09.000Z
demo.py
jerrykan/herder
381f51198f21d232cc05d7c458638d78c0f25366
[ "MIT" ]
2
2018-12-02T01:32:22.000Z
2021-12-09T20:30:04.000Z
demo.py
jerrykan/herder
381f51198f21d232cc05d7c458638d78c0f25366
[ "MIT" ]
8
2016-12-08T09:21:05.000Z
2021-02-04T05:13:14.000Z
#!/usr/bin/env python import sys import roundup from roundup.demo import main sys.exit(main())
12.125
29
0.752577
16
97
4.5625
0.6875
0
0
0
0
0
0
0
0
0
0
0
0.134021
97
7
30
13.857143
0.869048
0.206186
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a6c8028b4193b8cce4eb7e5544b33f32a72d9c56
910
py
Python
mod.py
insane0hflex/ModLinkerRedditBot
17060eef7488d52e38a3b54a5c760b98e6a66519
[ "MIT" ]
null
null
null
mod.py
insane0hflex/ModLinkerRedditBot
17060eef7488d52e38a3b54a5c760b98e6a66519
[ "MIT" ]
null
null
null
mod.py
insane0hflex/ModLinkerRedditBot
17060eef7488d52e38a3b54a5c760b98e6a66519
[ "MIT" ]
null
null
null
""" Mod class defines a mod. TODO: alias_names needs work/implementation """ class Mod: def __init__(self, mod_name, nexus_id, game_name, alias_names=[]): self.mod_name = mod_name self.nexus_id = nexus_id self.game_name = game_name # for common abbreviations/aliases like "iHUD" to "Immersive HUD", or "SKSE" for "Skyrim Script Extender" # or vice versa self.alias_names = [] def print_out(self): print (self.mod_name + "\t" + str(self.nexus_id) + "\t") def get_mod_link(self): return "[" + self.mod_name + "](https://www.nexusmods.com/" + self.game_name + "/mods/" + str(self.nexus_id) + ")" """ Returns JSON output {'alias_names': [], 'game_name': 'skyrim', 'mod_name': 'iHUD', 'nexus_id': 3222} """ def get_mod_info_as_json(self): return self.__dict__
29.354839
123
0.587912
119
910
4.193277
0.436975
0.084168
0.088176
0.056112
0
0
0
0
0
0
0
0.006042
0.272527
910
30
124
30.333333
0.747734
0.205495
0
0
0
0
0.07286
0
0
0
0
0.033333
0
1
0.333333
false
0
0
0.166667
0.583333
0.166667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
a6e53b6754879f7439c24ee0a5a4d1a96a0d44b9
206
py
Python
reference/lvenc/__init__.py
tuxzz/lightvideo
3654d7a452ec42a7e2d40129ef571375e5f93ddb
[ "MIT" ]
2
2019-05-05T22:37:19.000Z
2021-05-17T03:32:44.000Z
reference/lvenc/__init__.py
tuxzz/lightvideo
3654d7a452ec42a7e2d40129ef571375e5f93ddb
[ "MIT" ]
null
null
null
reference/lvenc/__init__.py
tuxzz/lightvideo
3654d7a452ec42a7e2d40129ef571375e5f93ddb
[ "MIT" ]
null
null
null
from .encoder import Encoder from .deccore import DecoderCore from . import struct from .cyuv import YUVPToRGBI, RGBIToYUVP from .encaseq import EncoderASTCSeq from .decaseq import DecoderCoreASTCSeq
29.428571
41
0.815534
24
206
7
0.541667
0
0
0
0
0
0
0
0
0
0
0
0.150485
206
6
42
34.333333
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
0
0
0
4
a6ef334029a3283f0e49036db9407a798eee3829
137
py
Python
tests/benchmarks/bench_discovery.py
exler/verdandi
631ca177cb374547e5ee48265f1cd74385bae22d
[ "MIT" ]
null
null
null
tests/benchmarks/bench_discovery.py
exler/verdandi
631ca177cb374547e5ee48265f1cd74385bae22d
[ "MIT" ]
null
null
null
tests/benchmarks/bench_discovery.py
exler/verdandi
631ca177cb374547e5ee48265f1cd74385bae22d
[ "MIT" ]
null
null
null
from verdandi import Benchmark class BenchmarkDiscovery(Benchmark): def bench_discovery(self) -> None: print("Discovered")
19.571429
38
0.729927
14
137
7.071429
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.182482
137
6
39
22.833333
0.883929
0
0
0
0
0
0.072993
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
4712f377e4fb23f3bbb8b650017d73075664c9dc
521
py
Python
fiasco/util/exceptions.py
dstansby/fiasco
7d46ed92e692709cd90af805c4f6f57014e754ed
[ "BSD-3-Clause" ]
14
2017-08-19T17:58:09.000Z
2022-03-22T17:46:34.000Z
fiasco/util/exceptions.py
dstansby/fiasco
7d46ed92e692709cd90af805c4f6f57014e754ed
[ "BSD-3-Clause" ]
161
2017-09-01T16:16:37.000Z
2022-03-20T18:51:48.000Z
fiasco/util/exceptions.py
dstansby/fiasco
7d46ed92e692709cd90af805c4f6f57014e754ed
[ "BSD-3-Clause" ]
10
2017-09-01T16:15:12.000Z
2022-03-22T17:46:42.000Z
""" Custom exceptions """ class MissingIonError(Exception): """ An error to raise if an ion cannot be found in the database """ pass class MissingDatabaseError(Exception): """ An error to raise when the database file cannot be found. """ class MissingASCIIFileError(Exception): """ An error to raise when one of the CHIANTI ASCII files cannot be found. """ class MissingDatasetException(Exception): """ An error to raise when a dataset file is missing. """
17.366667
64
0.658349
63
521
5.444444
0.507937
0.12828
0.186589
0.209913
0.303207
0.236152
0
0
0
0
0
0
0.255278
521
29
65
17.965517
0.884021
0.491363
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0
0
0.8
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
5b3bb0c674a5d97ba4749ef01b115210910d1da6
6,348
py
Python
tests/test_ast_builder/test_conditional_call.py
fossilfree/Numerous
121cd00456f263cab9def10cb99a21655f5832c9
[ "BSD-3-Clause" ]
null
null
null
tests/test_ast_builder/test_conditional_call.py
fossilfree/Numerous
121cd00456f263cab9def10cb99a21655f5832c9
[ "BSD-3-Clause" ]
null
null
null
tests/test_ast_builder/test_conditional_call.py
fossilfree/Numerous
121cd00456f263cab9def10cb99a21655f5832c9
[ "BSD-3-Clause" ]
null
null
null
import ast import numpy as np from numerous.engine.model.lowering.ast_builder import ASTBuilder from numerous.engine.model.utils import Imports from pytest import approx initial_values = np.arange(1, 10, dtype=np.float64) number_of_derivatives = 3 number_of_states = 3 variable_names = { "oscillator1.mechanics.x": 0, "oscillator1.mechanics.y": 1, "oscillator1.mechanics.z": 2, "oscillator1.mechanics.a": 3, "oscillator1.mechanics.b": 4, "oscillator1.mechanics.c": 5, "oscillator1.mechanics.x_dot": 6, "oscillator1.mechanics.y_dot": 7, "oscillator1.mechanics.z_dot": 8, } variable_distributed = { "oscillator1.mechanics.a": 0, "oscillator1.mechanics.x_dot": 1, "oscillator1.mechanics.y_dot": 2, "oscillator1.mechanics.z_dot": 3, "oscillator1.mechanics.x": 4, "oscillator1.mechanics.b": 5, "oscillator1.mechanics.c": 6, "oscillator1.mechanics.y": 7, "oscillator1.mechanics.z": 8, } DERIVATIVES = ["oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot", "oscillator1.mechanics.z_dot"] STATES = ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.z"] eval_ast_signature = 'void(float64, float64, CPointer(float64), CPointer(float64))' eval_ast = ast.parse('''def eval_ast(s_x1, s_x2, s_x2_dot, s_x3_dot): s_x2_dot = -100 if s_x1 > s_x2 else 50 s_x3_dot = -s_x2_dot return s_x2_dot,s_x3_dot''').body[0] other_signature = 'void(float64, float64, CPointer(float64), CPointer(float64))' other = ast.parse('''def other(s_x1, s_x2, s_x2_dot, s_x3_dot): return s_x2_dot,s_x3_dot''').body[0] imports = Imports() imports.add_as_import("numpy", "np") def test_ast_set_unset(): ast_program = ASTBuilder(initial_values, variable_names, STATES, DERIVATIVES) ast_program.add_external_function(eval_ast, eval_ast_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(eval_ast.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], [2, 3], 'call_1') assert ast_program.get_call_enabled('call_1') ast_program.set_call_enabled('call_1', False) assert not ast_program.get_call_enabled('call_1') def test_ast_defaults(): ast_program = ASTBuilder(initial_values, variable_names, STATES, DERIVATIVES) ast_program.add_external_function(eval_ast, eval_ast_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(eval_ast.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], [2, 3], 'call_1') assert 'def global_kernel(states, eval_ast_flag=True):' in ast_program.unparse(imports) ast_program.set_call_enabled('call_1', False) assert 'def global_kernel(states, eval_ast_flag=False):' in ast_program.unparse(imports) def test_diff_results(): ast_program = ASTBuilder(initial_values, variable_names, STATES, DERIVATIVES) ast_program.add_external_function(eval_ast, eval_ast_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(eval_ast.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], target_ids=[2, 3], tag='eval_ast') diff, _, _ = ast_program.generate(imports) assert approx(diff(np.array([2.1, 2.2, 2.3]), eval_ast_flag=False)) == np.array([7.,8.,9.]) assert approx(diff(np.array([2.1, 2.2, 2.3]))) == np.array([50.,-50.,9.]) def test_arguments(): ast_program = ASTBuilder(initial_values, variable_names, STATES, DERIVATIVES) ast_program.add_external_function(eval_ast, eval_ast_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(eval_ast.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], target_ids=[2, 3], tag='eval_ast') ast_program.add_external_function(other, other_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(other.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], target_ids=[2, 3], tag='other') def test_multifunction_default(): ast_program = ASTBuilder(initial_values, variable_names, STATES, DERIVATIVES) ast_program.add_external_function(eval_ast, eval_ast_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(eval_ast.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], target_ids=[2, 3], tag='eval_ast') ast_program.add_external_function(other, other_signature, number_of_args=4, target_ids=[2, 3]) ast_program.add_conditional_call(other.name, ["oscillator1.mechanics.x", "oscillator1.mechanics.y", "oscillator1.mechanics.x_dot", "oscillator1.mechanics.y_dot"], target_ids=[2, 3], tag='other') assert 'def global_kernel(states, eval_ast_flag=True, other_flag=True):' in ast_program.unparse(imports) ast_program.set_call_enabled('other', False) assert 'def global_kernel(states, eval_ast_flag=True, other_flag=False):' in ast_program.unparse(imports)
51.609756
114
0.617675
765
6,348
4.827451
0.128105
0.281614
0.113729
0.035743
0.738424
0.731654
0.727593
0.695099
0.634444
0.601679
0
0.038181
0.265595
6,348
123
115
51.609756
0.753968
0
0
0.462264
0
0
0.308816
0.223703
0
0
0
0
0.075472
1
0.04717
false
0
0.113208
0
0.179245
0
0
0
0
null
1
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5b4f91cb1ab68a85400f15a8d8ff7bfb4c22bb43
573
py
Python
bluebox/converters/amp/amp_converter.py
duner/django-bluebox
2921e809b7c81074fb8233e95bce31546ee058d6
[ "MIT" ]
3
2015-10-30T03:38:11.000Z
2016-02-10T20:49:23.000Z
bluebox/converters/amp/amp_converter.py
duner/django-bluebox
2921e809b7c81074fb8233e95bce31546ee058d6
[ "MIT" ]
null
null
null
bluebox/converters/amp/amp_converter.py
duner/django-bluebox
2921e809b7c81074fb8233e95bce31546ee058d6
[ "MIT" ]
null
null
null
from bluebox.converters import Converter from bluebox.converters.amp.amp_sanitizer import AMPSanitizer class AMPConverter(Converter): output_type = 'amp' sanitizer = AMPSanitizer def transform(self): pass def convert(self): pass def get_canonical_url(self): pass def get_amp_url(self): pass def get_amp_css(self): pass def render_amp_page(self): pass def convert_html_tags_to_amp(self): pass class AMPVideo(AMPConverter): pass class AMPPost(AMPConverter): pass
15.916667
61
0.663176
69
573
5.304348
0.405797
0.153005
0.180328
0.114754
0.10929
0.10929
0
0
0
0
0
0
0.270506
573
35
62
16.371429
0.875598
0
0
0.391304
0
0
0.005236
0
0
0
0
0
0
1
0.304348
false
0.391304
0.086957
0
0.608696
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
5b57a05efeced2d5fd81839f374d5153709a9f32
155
py
Python
pyVkBotApiV2/__init__.py
AndreyLev/py_vk_bot_api_fix
611917ed45ecbea679e4f1889decaec00fd305fd
[ "MIT" ]
4
2020-09-08T02:38:21.000Z
2021-09-13T18:30:53.000Z
pyVkBotApiV2/__init__.py
AndreyLev/py_vk_bot_api_fix
611917ed45ecbea679e4f1889decaec00fd305fd
[ "MIT" ]
null
null
null
pyVkBotApiV2/__init__.py
AndreyLev/py_vk_bot_api_fix
611917ed45ecbea679e4f1889decaec00fd305fd
[ "MIT" ]
1
2021-10-20T09:28:35.000Z
2021-10-20T09:28:35.000Z
from .api import api from .upload import upload from .botslongpoll import botsLongPoll from .session import * __author__ = 'Airkek' __version__ = '1.3.1'
19.375
38
0.767742
21
155
5.285714
0.52381
0
0
0
0
0
0
0
0
0
0
0.022727
0.148387
155
7
39
22.142857
0.818182
0
0
0
0
0
0.070968
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5b71bdc4457d5591a888be2d0220b7157900dcc2
128
py
Python
placement/admin.py
r00tDada/Mini_Project_Semester_7
fd84be13d91c9ffca8288c7787a0330a5aee7950
[ "MIT" ]
null
null
null
placement/admin.py
r00tDada/Mini_Project_Semester_7
fd84be13d91c9ffca8288c7787a0330a5aee7950
[ "MIT" ]
null
null
null
placement/admin.py
r00tDada/Mini_Project_Semester_7
fd84be13d91c9ffca8288c7787a0330a5aee7950
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import application # Register your models here. admin.site.register(application)
21.333333
32
0.820313
17
128
6.176471
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.117188
128
5
33
25.6
0.929204
0.203125
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5b85a2be4fa08091586e008e12e9ff64f2d0f799
22,599
py
Python
telegram_quiz_test.py
rdidukh/chgk_telegram_bot
c374a7e70258abd6f7c73986af351e3dbca777fa
[ "Apache-2.0" ]
null
null
null
telegram_quiz_test.py
rdidukh/chgk_telegram_bot
c374a7e70258abd6f7c73986af351e3dbca777fa
[ "Apache-2.0" ]
19
2020-04-10T23:34:24.000Z
2020-05-16T15:20:07.000Z
telegram_quiz_test.py
rdidukh/quiz_telegram_bot
c374a7e70258abd6f7c73986af351e3dbca777fa
[ "Apache-2.0" ]
null
null
null
from datetime import datetime from telegram_quiz import QuizStatus, TelegramQuiz, TelegramQuizError from quiz_db import Answer, Message, QuizDb, Team import tempfile import telegram import telegram.ext import textwrap import unittest import os from unittest.mock import patch, MagicMock STRINGS = textwrap.dedent(''' { "lang": { "registration_invitation": "Hello!", "registration_confirmation": "Good luck, {team}!", "answer_confirmation": "Confirmed #{question}: {answer}.", "send_results_zero_correct_answers": "Zero answers.", "send_results_correct_answers": "Correct answers: {correctly_answered_questions}. Total: {total_score}." } } ''') class BaseTestCase(unittest.TestCase): def setUp(self): self.test_dir = tempfile.TemporaryDirectory() self.db_path = os.path.join(self.test_dir.name, 'quiz.db') self.strings_file = os.path.join(self.test_dir.name, 'strings.json') with open(self.strings_file, 'w') as file: file.write(STRINGS) self.quiz_db = QuizDb(db_path=self.db_path) self.quiz = TelegramQuiz(strings_file=self.strings_file, quiz_db=self.quiz_db) def tearDown(self): self.test_dir.cleanup() def _updater_factory(bot_api_token: str) -> telegram.ext.Updater: updater = telegram.ext.Updater(bot_api_token, use_context=True) updater.start_polling = MagicMock() updater.stop = MagicMock() return updater class StartedQuizBaseTestCase(BaseTestCase): def setUp(self): super().setUp() self.quiz.start(quiz_id='test', bot_api_token='123:TOKEN', language='lang', updater_factory=_updater_factory) class StartTest(BaseTestCase): def test_starts(self): sub = MagicMock() self.quiz.add_updates_subscriber(sub) update_id = self.quiz.status_update_id self.quiz.start(quiz_id='test', bot_api_token='123:TOKEN', language='lang', updater_factory=_updater_factory) self.assertIn(self.quiz._handle_error, self.quiz._updater.dispatcher.error_handlers) self.assertEqual(self.quiz._handle_log_update, self.quiz._updater.dispatcher.handlers[0][0].callback) self.quiz._updater.start_polling.assert_called_with() self.assertEqual('test', self.quiz._id) self.assertEqual('lang', self.quiz._language) self.assertEqual('Hello!', self.quiz._strings.registration_invitation) self.assertEqual(update_id+1, self.quiz.status_update_id) sub.assert_called_with() def test_raises_when_already_started(self): self.quiz.start(quiz_id='test', bot_api_token='123:TOKEN', language='lang', updater_factory=_updater_factory) sub = MagicMock() self.quiz.add_updates_subscriber(sub) update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.start, quiz_id='test', bot_api_token='123:TOKEN', language='lang') self.assertEqual(update_id, self.quiz.status_update_id) sub.assert_not_called() def test_drops_old_handlers_on_restart(self): self.quiz.start(quiz_id='test', bot_api_token='123:TOKEN', language='lang', updater_factory=_updater_factory) self.quiz.start_question(1) self.quiz.stop() self.quiz.start(quiz_id='test', bot_api_token='123:TOKEN', language='lang', updater_factory=_updater_factory) self.assertNotIn(1, self.quiz._updater.dispatcher.handlers) class StopTest(StartedQuizBaseTestCase): def test_stops(self): sub = MagicMock() self.quiz.add_updates_subscriber(sub) update_id = self.quiz.status_update_id old_updater = self.quiz._updater self.quiz.stop() old_updater.stop.assert_called_with() self.assertIsNone(self.quiz._id) self.assertIsNone(self.quiz._language) self.assertIsNone(self.quiz._strings) self.assertIsNone(self.quiz._updater) self.assertEqual(update_id+1, self.quiz.status_update_id) sub.assert_called_with() def test_raises_when_already_stopped(self): self.quiz.stop() sub = MagicMock() self.quiz.add_updates_subscriber(sub) update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.stop) self.assertEqual(update_id, self.quiz.status_update_id) sub.assert_not_called() def test_stops_registration(self): self.quiz.stop() self.assertIsNone(self.quiz._registration_handler) def test_stops_question(self): self.quiz.stop() self.assertIsNone(self.quiz._question_handler) class StartRegistrationTest(StartedQuizBaseTestCase): def test_starts_registration(self): update_id = self.quiz.status_update_id self.quiz.start_registration() self.assertEqual(self.quiz._handle_registration_update, self.quiz._updater.dispatcher.handlers[1][0].callback) self.assertGreater(self.quiz.status_update_id, update_id) def test_raises_when_starting_twice(self): self.quiz.start_registration() update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.start_registration) self.assertEqual(self.quiz._handle_registration_update, self.quiz._updater.dispatcher.handlers[1][0].callback) self.assertEqual(update_id, self.quiz.status_update_id) def test_raises_when_question_is_on(self): self.quiz.start_question(question=1) update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.start_registration) self.assertEqual(update_id, self.quiz.status_update_id) def test_raises_when_quiz_not_started(self): self.quiz.stop() self.assertRaisesRegex(TelegramQuizError, 'not started', self.quiz.start_registration) class StopRegistrationTest(StartedQuizBaseTestCase): def test_stops_registration(self): self.quiz.start_registration() update_id = self.quiz.status_update_id self.quiz.stop_registration() self.assertNotIn(1, self.quiz._updater.dispatcher.handlers) self.assertGreater(self.quiz.status_update_id, update_id) def test_raises_when_stopping_twice(self): self.quiz.start_registration() self.quiz.stop_registration() update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.stop_registration) self.assertEqual(update_id, self.quiz.status_update_id) def test_raises_when_quiz_not_started(self): self.quiz.stop() self.assertRaisesRegex(TelegramQuizError, 'not started', self.quiz.stop_registration) class StartQuestionTest(StartedQuizBaseTestCase): def test_starts_question(self): update_id = self.quiz.status_update_id self.quiz.start_question(question=1) self.assertEqual(self.quiz._handle_answer_update, self.quiz._updater.dispatcher.handlers[1][0].callback) self.assertEqual(1, self.quiz._question) self.assertGreater(self.quiz.status_update_id, update_id) def test_start_question_twice_raises(self): self.quiz.start_question(question=1) update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.start_question, question=1) self.assertEqual(update_id, self.quiz.status_update_id) def test_start_raises_when_registration_is_on(self): self.quiz.start_registration() update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.start_question, question=1) self.assertEqual(update_id, self.quiz.status_update_id) def test_raises_when_quiz_not_started(self): self.quiz.stop() self.assertRaisesRegex(TelegramQuizError, 'not started', self.quiz.start_question, 1) class StopQuestionTest(StartedQuizBaseTestCase): def test_stops_question(self): self.quiz.start_question(question=1) update_id = self.quiz.status_update_id self.quiz.stop_question() self.assertNotIn(1, self.quiz._updater.dispatcher.handlers) self.assertIsNone(self.quiz._question) self.assertGreater(self.quiz.status_update_id, update_id) def test_stop_question_twice_raises(self): self.quiz.start_question(question=1) self.quiz.stop_question() update_id = self.quiz.status_update_id self.assertRaises(TelegramQuizError, self.quiz.stop_question) self.assertEqual(update_id, self.quiz.status_update_id) def test_raises_when_quiz_not_started(self): self.quiz.stop() self.assertRaisesRegex(TelegramQuizError, 'not started', self.quiz.stop_question) class HandleLogUpdateTest(BaseTestCase): def test_logs_update(self): self.quiz_db.insert_message( Message(timestamp=1, update_id=2, chat_id=3, text='existing')) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(1001001001), chat=telegram.Chat(5001, 'private'), text='Hello, Юнікод! 😎')) self.quiz._handle_log_update(update, context=None) self.assertListEqual([ Message(timestamp=1, update_id=2, chat_id=3, text='existing'), Message(timestamp=1001001001, update_id=1001, chat_id=5001, text='Hello, Юнікод! 😎'), ], self.quiz_db.select_messages()) class HandleRegistrationUpdateTest(StartedQuizBaseTestCase): @patch('telegram.ext.CallbackContext') def test_sends_invitation(self, mock_callback_context): update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(1001001001), chat=telegram.Chat(5001, 'private'), text='/start')) update.message.reply_text = MagicMock() context = mock_callback_context() context.chat_data = {'typing_name': False} self.quiz.start_registration() self.quiz._handle_registration_update(update, context) self.assertListEqual([], self.quiz_db.get_teams(quiz_id='test')) self.assertEqual(True, context.chat_data['typing_name']) update.message.reply_text.assert_called_with('Hello!') @patch('telegram.ext.CallbackContext') def test_registers_team(self, mock_callback_context): update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(123), chat=telegram.Chat(5001, 'private'), text='\n Unicode \n \n\n Юнікод\n 😎 \n \n')) update.message.reply_text = MagicMock() context = mock_callback_context() context.chat_data = {'typing_name': True} self.quiz.start_registration() self.quiz._handle_registration_update(update, context) self.assertListEqual([ Team(update_id=2, quiz_id='test', id=5001, name='Unicode Юнікод 😎', timestamp=123) ], self.quiz_db.get_teams(quiz_id='test')) self.assertNotIn('typing_name', context.chat_data) update.message.reply_text.assert_called_with( 'Good luck, Unicode Юнікод 😎!') @patch('telegram.ext.CallbackContext') def test_updates_team(self, mock_callback_context): self.quiz_db.update_team( quiz_id='test', team_id=5001, name='Apple', registration_time=122) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(123), chat=telegram.Chat(5001, 'private'), text='Banana')) update.message.reply_text = MagicMock() context = mock_callback_context() context.chat_data = {'typing_name': True} self.quiz.start_registration() self.quiz._handle_registration_update(update, context) self.assertListEqual([ Team(quiz_id='test', id=5001, name='Banana', timestamp=123) ], self.quiz_db.get_teams(quiz_id='test')) self.assertNotIn('typing_name', context.chat_data) update.message.reply_text.assert_called_with('Good luck, Banana!') @patch('telegram.ext.CallbackContext') def test_outdated_registration(self, mock_callback_context): self.quiz_db.update_team( quiz_id='test', team_id=5001, name='Apple', registration_time=124) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(123), chat=telegram.Chat(5001, 'private'), text='Banana')) update.message.reply_text = MagicMock() context = mock_callback_context() context.chat_data = {'typing_name': True} self.quiz.start_registration() self.quiz._handle_registration_update(update, context) self.assertListEqual([ Team(quiz_id='test', id=5001, name='Apple', timestamp=124) ], self.quiz_db.get_teams(quiz_id='test')) self.assertNotIn('typing_name', context.chat_data) update.message.reply_text.assert_not_called() def test_registration_not_started(self): self.quiz._handle_registration_update(None, None) self.assertListEqual([], self.quiz_db.get_teams(quiz_id='test')) class HandleAnswerUpdateTest(StartedQuizBaseTestCase): @patch('telegram.ext.CallbackContext') def test_inserts_answer(self, mock_callback_context): self.quiz_db.update_team( quiz_id='test', team_id=5001, name='Liverpool', registration_time=1) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(4), chat=telegram.Chat(5001, 'private'), text=' \nUnicode\n Юнікод 😎 \n\n ')) update.message.reply_text = MagicMock() self.quiz._updater.dispatcher.run_async = MagicMock() self.quiz.start_question(question=1) self.quiz._handle_answer_update(update, context=None) self.quiz.stop_question() self.assertListEqual([ Answer(quiz_id='test', question=1, team_id=5001, answer='Unicode Юнікод 😎', timestamp=4), ], self.quiz_db.get_answers(quiz_id='test')) self.quiz._updater.dispatcher.run_async.assert_called_with( update.message.reply_text, 'Confirmed #1: Unicode Юнікод 😎.') @patch('telegram.ext.CallbackContext') def test_updates_answer(self, mock_callback_context): self.quiz_db.update_team( quiz_id='test', team_id=5001, name='Liverpool', registration_time=1) self.quiz_db.update_answer( quiz_id='test', question=4, team_id=5001, answer='Apple', answer_time=1) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(4), chat=telegram.Chat(5001, 'private'), text='Banana')) update.message.reply_text = MagicMock() self.quiz._updater.dispatcher.run_async = MagicMock() self.quiz.start_question(question=4) self.quiz._handle_answer_update(update, context=None) self.quiz.stop_question() expected_answers = [ Answer(quiz_id='test', question=4, team_id=5001, answer='Banana', timestamp=4), ] self.assertListEqual( expected_answers, self.quiz_db.get_answers(quiz_id='test')) self.quiz._updater.dispatcher.run_async.assert_called_with( update.message.reply_text, 'Confirmed #4: Banana.') @patch('telegram.ext.CallbackContext') def test_non_registered_team(self, mock_callback_context): self.quiz_db.update_team( quiz_id='test', team_id=5001, name='Liverpool', registration_time=1) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(4), chat=telegram.Chat(5002, 'private'), text='Banana')) update.message.reply_text = MagicMock() self.quiz.start_question(question=1) self.quiz._handle_answer_update(update, context=None) self.quiz.stop_question() self.assertListEqual([], self.quiz_db.get_answers(quiz_id='test')) update.message.reply_text.assert_not_called() @patch('telegram.ext.CallbackContext') def test_outdated_answer(self, mock_callback_context): self.quiz_db.update_team( quiz_id='test', team_id=5001, name='Liverpool', registration_time=1) self.quiz_db.update_answer( quiz_id='test', question=1, team_id=5001, answer='Banana', answer_time=5) update = telegram.update.Update(1001, message=telegram.message.Message( 2001, None, datetime.fromtimestamp(4), chat=telegram.Chat(5001, 'private'), text='Apple')) update.message.reply_text = MagicMock() self.quiz.start_question(question=1) self.quiz._handle_answer_update(update, context=None) self.quiz.stop_question() self.assertListEqual([ Answer(quiz_id='test', question=1, team_id=5001, answer='Banana', timestamp=5), ], self.quiz_db.get_answers(quiz_id='test')) update.message.reply_text.assert_not_called() def test_question_not_started(self): self.quiz._handle_answer_update(update=None, context=None) self.assertListEqual([], self.quiz_db.get_answers(quiz_id='test')) class GetStatusTest(StartedQuizBaseTestCase): def test_returns_status(self): status = self.quiz.get_status() self.assertEqual( QuizStatus( update_id=self.quiz.status_update_id, quiz_id='test', language='lang', question=None, registration=False, ), status ) self.assertIsInstance(status.time, str) self.assertGreater(len(status.time), 0) def test_registration(self): self.quiz.start_registration() status = self.quiz.get_status() self.assertTrue(status.registration) def test_question(self): self.quiz.start_question(question=1) status = self.quiz.get_status() self.assertEqual(1, status.question) def test_stop(self): self.quiz.stop() status = self.quiz.get_status() self.assertIsNone(status.quiz_id) self.assertIsNone(status.language) class SendResultsTest(StartedQuizBaseTestCase): def test_answers(self): self.quiz_db.get_teams = MagicMock(return_value=[ Team(quiz_id='test', id=5001, name='Liverpool', timestamp=123), ]) self.quiz_db.get_answers = MagicMock(return_value=[ Answer(quiz_id='test', question=3, team_id=5001, answer='Apple', timestamp=123, points=1), Answer(quiz_id='test', question=5, team_id=5001, answer='Banana', timestamp=123, points=1) ]) self.quiz._updater.bot.send_message = MagicMock() self.quiz.send_results(team_id=5001) self.quiz_db.get_teams.assert_called_with(quiz_id='test', team_id=5001) self.quiz_db.get_answers.assert_called_with( quiz_id='test', team_id=5001) self.quiz._updater.bot.send_message.assert_called_with( 5001, 'Correct answers: 3, 5. Total: 2.') def test_zero_answers(self): self.quiz_db.get_teams = MagicMock(return_value=[ Team(quiz_id='test', id=5001, name='Liverpool', timestamp=123), ]) self.quiz_db.get_answers = MagicMock(return_value=[ Answer(quiz_id='test', question=3, team_id=5001, answer='Apple', timestamp=123), Answer(quiz_id='test', question=5, team_id=5001, answer='Banana', timestamp=123, points=0) ]) self.quiz._updater.bot.send_message = MagicMock() self.quiz.send_results(team_id=5001) self.quiz_db.get_teams.assert_called_with(quiz_id='test', team_id=5001) self.quiz_db.get_answers.assert_called_with( quiz_id='test', team_id=5001) self.quiz._updater.bot.send_message.assert_called_with( 5001, 'Zero answers.') def test_one_answer(self): self.quiz_db.get_teams = MagicMock(return_value=[ Team(quiz_id='test', id=5001, name='Liverpool', timestamp=123), ]) self.quiz_db.get_answers = MagicMock(return_value=[ Answer(quiz_id='test', question=3, team_id=5001, answer='Apple', timestamp=123, points=1), ]) self.quiz._updater.bot.send_message = MagicMock() self.quiz.send_results(team_id=5001) self.quiz._updater.bot.send_message.assert_called_with( 5001, 'Correct answers: 3. Total: 1.') def test_send_message_raises(self): self.quiz_db.get_teams = MagicMock(return_value=[ Team(quiz_id='test', id=5001, name='Liverpool', timestamp=123), ]) self.quiz_db.get_answers = MagicMock(return_value=[ Answer(quiz_id='test', question=3, team_id=5001, answer='Apple', timestamp=123, points=1), ]) self.quiz._updater.bot.send_message = MagicMock( side_effect=telegram.error.TelegramError('Error.')) self.assertRaisesRegex(TelegramQuizError, 'Could not send', self.quiz.send_results, team_id=5001) def test_team_does_not_exist(self): self.quiz_db.get_teams = MagicMock(return_value=[ ]) self.quiz_db.get_answers = MagicMock(return_value=[ Answer(quiz_id='test', question=3, team_id=5001, answer='Apple', timestamp=123, points=1), ]) self.quiz._updater.bot.send_message = MagicMock() self.assertRaisesRegex(TelegramQuizError, 'does not exist', self.quiz.send_results, team_id=5001) def test_raises_when_quiz_not_started(self): self.quiz.stop() self.assertRaisesRegex(TelegramQuizError, 'not started', self.quiz.send_results, team_id=5001) if __name__ == '__main__': unittest.main()
40.211744
121
0.666003
2,687
22,599
5.342017
0.072572
0.103664
0.032047
0.040407
0.784311
0.767521
0.740421
0.701407
0.686011
0.669569
0
0.02547
0.221691
22,599
561
122
40.283422
0.790153
0
0
0.603982
0
0
0.075136
0.017611
0
0
0
0
0.201327
1
0.10177
false
0
0.022124
0
0.154867
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5b942894f0ea87a138100d1c543435fca217f4d6
330
py
Python
flpy_bank/parser/registry.py
rGunti/flpy_bank
4917bdf790cefc84c26f8af67e3f86b0a2b9ccb2
[ "MIT" ]
null
null
null
flpy_bank/parser/registry.py
rGunti/flpy_bank
4917bdf790cefc84c26f8af67e3f86b0a2b9ccb2
[ "MIT" ]
null
null
null
flpy_bank/parser/registry.py
rGunti/flpy_bank
4917bdf790cefc84c26f8af67e3f86b0a2b9ccb2
[ "MIT" ]
null
null
null
from flpy_bank.parser import DataParser from flpy_bank.parser.bunq import BunqDataParser from flpy_bank.parser.sparkasse import SparkasseDataParser PARSER_REGISTRY = { 'sparkasse': SparkasseDataParser, 'bunq': BunqDataParser } def construct_parser_from_name(name: str) -> DataParser: return PARSER_REGISTRY[name]()
25.384615
58
0.79697
38
330
6.710526
0.421053
0.094118
0.141176
0.211765
0
0
0
0
0
0
0
0
0.127273
330
12
59
27.5
0.885417
0
0
0
0
0
0.039394
0
0
0
0
0
0
1
0.111111
false
0
0.333333
0.111111
0.555556
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
5ba174c1a23b5eeebbee8047ce5a54c96a25e4f2
154
py
Python
zhihu_spider/urls.py
dreamgod2016/Zhihu_Spider
5cded270a6a1d6bc55668c20dba976bf32ed2149
[ "MIT" ]
null
null
null
zhihu_spider/urls.py
dreamgod2016/Zhihu_Spider
5cded270a6a1d6bc55668c20dba976bf32ed2149
[ "MIT" ]
null
null
null
zhihu_spider/urls.py
dreamgod2016/Zhihu_Spider
5cded270a6a1d6bc55668c20dba976bf32ed2149
[ "MIT" ]
null
null
null
from django.conf.urls import url from django.contrib import admin import zhihu_spider.views urlpatterns = [ url(r'^$', zhihu_spider.views.spider), ]
19.25
42
0.753247
22
154
5.181818
0.590909
0.175439
0.280702
0
0
0
0
0
0
0
0
0
0.136364
154
7
43
22
0.857143
0
0
0
0
0
0.012987
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
7507611ea00aab67ecd6a7d9055afa0aeaf23f09
172
py
Python
test/resources/configparser-rw.py
JaBuoniak/java-configparser
cb4a318a3dee0dd4bbb5fa4084aef0a49e19196b
[ "Apache-2.0" ]
16
2015-09-10T13:38:42.000Z
2022-01-19T03:28:44.000Z
test/resources/configparser-rw.py
JaBuoniak/java-configparser
cb4a318a3dee0dd4bbb5fa4084aef0a49e19196b
[ "Apache-2.0" ]
4
2020-02-27T17:54:56.000Z
2020-10-28T15:45:10.000Z
test/resources/configparser-rw.py
JaBuoniak/java-configparser
cb4a318a3dee0dd4bbb5fa4084aef0a49e19196b
[ "Apache-2.0" ]
7
2016-01-14T14:15:59.000Z
2021-04-30T17:06:09.000Z
#!/usr/bin/env python3 import sys import configparser config = configparser.ConfigParser() config.read(sys.argv[1]) with open(sys.argv[2], 'w') as f: config.write(f)
17.2
36
0.715116
27
172
4.555556
0.666667
0.292683
0
0
0
0
0
0
0
0
0
0.02
0.127907
172
9
37
19.111111
0.8
0.122093
0
0
0
0
0.006667
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
7545a37ccac1595620752ca8b208b02a5e811bff
63
py
Python
yourface/__init__.py
bbriggs/yourface
fad1d3902c40c146c9c03ee1d8f78dc104af0b4d
[ "MIT" ]
1
2018-10-29T02:57:45.000Z
2018-10-29T02:57:45.000Z
yourface/__init__.py
bbriggs/yourface
fad1d3902c40c146c9c03ee1d8f78dc104af0b4d
[ "MIT" ]
null
null
null
yourface/__init__.py
bbriggs/yourface
fad1d3902c40c146c9c03ee1d8f78dc104af0b4d
[ "MIT" ]
1
2018-10-25T02:16:07.000Z
2018-10-25T02:16:07.000Z
import webbrowser webbrowser.open("https://yourface.fraq.io")
15.75
43
0.777778
8
63
6.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.063492
63
3
44
21
0.830508
0
0
0
0
0
0.380952
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
755edb68e69bf5efec2b8c38eca6c0da9b54d7d4
187
py
Python
LeetCodeSolutions/058 - Length of Last Word(easy) - Python3.py
aashishdugar/LeetCodeSolutions
5e4433b9ccdc9a5952a28facbb302774754812b8
[ "Apache-2.0" ]
null
null
null
LeetCodeSolutions/058 - Length of Last Word(easy) - Python3.py
aashishdugar/LeetCodeSolutions
5e4433b9ccdc9a5952a28facbb302774754812b8
[ "Apache-2.0" ]
null
null
null
LeetCodeSolutions/058 - Length of Last Word(easy) - Python3.py
aashishdugar/LeetCodeSolutions
5e4433b9ccdc9a5952a28facbb302774754812b8
[ "Apache-2.0" ]
null
null
null
class Solution: def lengthOfLastWord(self, s: str) -> int: if len(s.strip()) == 0: return 0 else: return len(s.strip().split(' ')[-1])
31.166667
48
0.465241
22
187
3.954545
0.727273
0.091954
0.206897
0
0
0
0
0
0
0
0
0.025641
0.374332
187
6
48
31.166667
0.717949
0
0
0
0
0
0.005464
0
0
0
0
0
0
1
0.166667
false
0
0
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
0
0
1
0
0
4
75604d00909e8bdf4a19ebc3d727e63c13d83d89
1,010
py
Python
easytext/utils/bert_tokenizer.py
cjopengler/easytext
5561b9a51e7b0aa5d10b7af451374359b559e9b6
[ "MIT" ]
17
2020-06-19T12:12:13.000Z
2022-01-28T02:07:01.000Z
easytext/utils/bert_tokenizer.py
cjopengler/easytext
5561b9a51e7b0aa5d10b7af451374359b559e9b6
[ "MIT" ]
24
2020-06-08T08:51:36.000Z
2022-02-08T03:30:19.000Z
easytext/utils/bert_tokenizer.py
cjopengler/easytext
5561b9a51e7b0aa5d10b7af451374359b559e9b6
[ "MIT" ]
7
2020-07-20T06:40:00.000Z
2022-01-28T03:52:49.000Z
#!/usr/bin/env python 3 # -*- coding: utf-8 -*- # # Copyright (c) 2020 PanXu, Inc. All Rights Reserved # """ bert tokenizer component Authors: PanXu Date: 2020/11/03 18:11:00 """ from typing import List, Tuple from transformers import BertTokenizerFast from easytext.component.register import ComponentRegister from easytext.component.component_builtin_key import ComponentBuiltinKey @ComponentRegister.register(typename="BertTokenizer", name_space=ComponentBuiltinKey.EASYTEXT_NAME_SPACE) def bert_tokenizer(bert_dir: str): return BertTokenizerFast.from_pretrained(bert_dir) def mapping_label(token_offset_mapping: List[Tuple[int, int]], labels: List) -> List: """ bert tokenizer 会对 index 进行转化, 所以需要将其转换后的 index 与 label 对应起来。 转换前 index = label index -> 转换后 index -> 转换后的 label index :param token_offset_mapping: bert tokenizer 返回的 offset_mapping, [(being, end), ...], 其 list index 就是 转换前的 token index :param labels: 标签列表 :return: """
28.857143
105
0.724752
127
1,010
5.645669
0.551181
0.072524
0.058577
0
0
0
0
0
0
0
0
0.024096
0.178218
1,010
34
106
29.705882
0.839759
0.453465
0
0
0
0
0.025794
0
0
0
0
0
0
1
0.25
false
0
0.5
0.125
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
7561b79b6c56c22ca2ab35f305e1f522c2428ebe
149
py
Python
codigo/Live04/exemplo.py
cassiasamp/live-de-python
00b5e51793097544ba9b75c97a0d30e63970bf45
[ "MIT" ]
572
2018-04-03T03:17:08.000Z
2022-03-31T19:05:32.000Z
codigo/Live04/exemplo.py
cassiasamp/live-de-python
00b5e51793097544ba9b75c97a0d30e63970bf45
[ "MIT" ]
176
2018-05-18T15:56:16.000Z
2022-03-28T20:39:07.000Z
codigo/Live04/exemplo.py
cassiasamp/live-de-python
00b5e51793097544ba9b75c97a0d30e63970bf45
[ "MIT" ]
140
2018-04-18T13:59:11.000Z
2022-03-29T00:43:49.000Z
def externa(func): def interna(x, y): return func(x, y) return interna @externa def soma(x, y): return x + y print(soma(2,2))
12.416667
25
0.577181
25
149
3.44
0.4
0.093023
0.27907
0
0
0
0
0
0
0
0
0.018692
0.281879
149
11
26
13.545455
0.785047
0
0
0
0
0
0
0
0
0
0
0
0
1
0.375
false
0
0
0.25
0.75
0.125
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
0
0
1
0
0
0
4
f35f16f036b2f05d26e60edccf6796f3e8b01c0c
103
py
Python
olc_webportalv2/cowbat/apps.py
OLC-Bioinformatics/olc_genomics_portal
d70ec669a3a49106f8290fff5dee089726259a23
[ "MIT" ]
3
2019-01-03T21:22:21.000Z
2019-04-23T15:47:29.000Z
olc_webportalv2/cowbat/apps.py
lowandrew/olc_webportalv2
e75ba1b7af85bb25b59138d31e268ecde6616208
[ "MIT" ]
49
2019-01-03T18:15:12.000Z
2022-03-11T23:37:20.000Z
olc_webportalv2/cowbat/apps.py
OLC-Bioinformatics/olc_webportalv2
d70ec669a3a49106f8290fff5dee089726259a23
[ "MIT" ]
58
2019-01-03T21:21:59.000Z
2021-11-02T18:00:20.000Z
from django.apps import AppConfig class CowbatConfig(AppConfig): name = 'olc_webportalv2.cowbat'
17.166667
35
0.776699
12
103
6.583333
0.916667
0
0
0
0
0
0
0
0
0
0
0.011364
0.145631
103
5
36
20.6
0.886364
0
0
0
0
0
0.213592
0.213592
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
f35f433c4437a7fcbc976c55067c046a49f5ed7e
172
py
Python
tests/test_ui.py
mmanhertz/eloimage
438b9e48371e37bf09fe79448dd24594ead3c2a3
[ "BSD-2-Clause" ]
null
null
null
tests/test_ui.py
mmanhertz/eloimage
438b9e48371e37bf09fe79448dd24594ead3c2a3
[ "BSD-2-Clause" ]
null
null
null
tests/test_ui.py
mmanhertz/eloimage
438b9e48371e37bf09fe79448dd24594ead3c2a3
[ "BSD-2-Clause" ]
null
null
null
from .context.elopic import ui import unittest class TestUI(unittest.TestCase): """Test cases for the UI package""" if __name__ == '__main__': unittest.main()
14.333333
39
0.697674
22
172
5.090909
0.772727
0
0
0
0
0
0
0
0
0
0
0
0.186047
172
11
40
15.636364
0.8
0.168605
0
0
0
0
0.058394
0
0
0
0
0
0
1
0
true
0
0.4
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
f377794679026104569ee271ea8838949b847c16
311
py
Python
House3D/__init__.py
rrobbyflya330/House3D
258d155ba4d6c7399ed463de73bb1f1fae52979f
[ "Apache-2.0" ]
1,163
2017-12-07T17:45:44.000Z
2022-03-29T13:34:42.000Z
House3D/__init__.py
rrobbyflya330/House3D
258d155ba4d6c7399ed463de73bb1f1fae52979f
[ "Apache-2.0" ]
55
2018-01-11T20:01:48.000Z
2021-03-10T08:41:01.000Z
House3D/__init__.py
harunpehlivan/House3D
dea99540cf8edde41820718863429c58d9189b3f
[ "Apache-2.0" ]
181
2017-12-07T18:25:31.000Z
2022-03-25T12:51:43.000Z
# Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from .core import Environment, MultiHouseEnv from .common import load_config, create_default_config from .house import House
34.555556
61
0.797428
46
311
5.326087
0.73913
0.081633
0
0
0
0
0
0
0
0
0
0.015152
0.151125
311
8
62
38.875
0.912879
0.562701
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
f3837a885dd989f95a5fa9d6b7603a030789351f
269
py
Python
accounts/models.py
SNFernandes24/church-ims
944b7e65e926276adfe376ace01cf0adf135b954
[ "MIT" ]
1
2021-09-11T17:22:37.000Z
2021-09-11T17:22:37.000Z
accounts/models.py
SNFernandes24/church-ims
944b7e65e926276adfe376ace01cf0adf135b954
[ "MIT" ]
39
2021-06-26T02:01:37.000Z
2021-07-14T17:11:53.000Z
accounts/models.py
SNFernandes24/church-ims
944b7e65e926276adfe376ace01cf0adf135b954
[ "MIT" ]
2
2021-07-19T08:00:58.000Z
2022-02-05T16:38:02.000Z
from django.contrib.auth.models import AbstractUser from people.utils import get_personal_details class User(AbstractUser): class Meta: # noqa ordering = ["email"] @property def personal_details(self): return get_personal_details(self)
20.692308
51
0.72119
32
269
5.90625
0.6875
0.238095
0.190476
0
0
0
0
0
0
0
0
0
0.204461
269
12
52
22.416667
0.883178
0.01487
0
0
0
0
0.019011
0
0
0
0
0
0
1
0.125
false
0
0.25
0.125
0.75
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
0
0
0
0
1
1
0
0
4
f38efe5e1eae4fe930fc53c418e028a3bb117c65
2,419
py
Python
tests/pipeline/test_sql_products.py
edublancas/python-ds-tools
1da2337961db9c50562349c28c9115d3a7cc6c0c
[ "MIT" ]
1
2021-11-02T05:48:00.000Z
2021-11-02T05:48:00.000Z
tests/pipeline/test_sql_products.py
edublancas/python-ds-tools
1da2337961db9c50562349c28c9115d3a7cc6c0c
[ "MIT" ]
8
2016-05-25T01:50:14.000Z
2021-03-03T14:52:36.000Z
tests/pipeline/test_sql_products.py
edublancas/dstools
1da2337961db9c50562349c28c9115d3a7cc6c0c
[ "MIT" ]
null
null
null
from datetime import datetime from pathlib import Path from dstools.pipeline.products import SQLiteRelation from dstools.pipeline.clients import SQLAlchemyClient import pandas as pd import numpy as np def test_sqlite_product_exists(tmp_directory): """ >>> import tempfile >>> tmp_directory = tempfile.mkdtemp() """ tmp = Path(tmp_directory) # create a db conn = SQLAlchemyClient('sqlite:///{}'.format(tmp / "database.db")) numbers = SQLiteRelation((None, 'numbers', 'table'), conn) numbers.render({}) assert not numbers.exists() df = pd.DataFrame({'a': np.arange(0, 100), 'b': np.arange(100, 200)}) df.to_sql('numbers', conn.engine) assert numbers.exists() def test_sqlite_product_delete(tmp_directory): """ >>> import tempfile >>> tmp_directory = tempfile.mkdtemp() """ tmp = Path(tmp_directory) conn = SQLAlchemyClient('sqlite:///{}'.format(tmp / "database.db")) df = pd.DataFrame({'a': np.arange(0, 100), 'b': np.arange(100, 200)}) df.to_sql('numbers', conn.engine) numbers = SQLiteRelation((None, 'numbers', 'table'), conn) numbers.render({}) numbers.delete() assert not numbers.exists() def test_sqlite_product_fetch_metadata_none_if_not_exists(tmp_directory): tmp = Path(tmp_directory) conn = SQLAlchemyClient('sqlite:///{}'.format(tmp / "database.db")) numbers = SQLiteRelation((None, 'numbers', 'table'), conn) numbers.render({}) assert numbers.fetch_metadata() is None def test_sqlite_product_fetch_metadata_none_if_empty_metadata(tmp_directory): tmp = Path(tmp_directory) conn = SQLAlchemyClient('sqlite:///{}'.format(tmp / "database.db")) df = pd.DataFrame({'a': np.arange(0, 100), 'b': np.arange(100, 200)}) df.to_sql('numbers', conn.engine) numbers = SQLiteRelation((None, 'numbers', 'table'), conn) numbers.render({}) assert numbers.fetch_metadata() is None def test_sqlite_product_save_metadata(tmp_directory): tmp = Path(tmp_directory) conn = SQLAlchemyClient('sqlite:///{}'.format(tmp / "database.db")) numbers = SQLiteRelation((None, 'numbers', 'table'), conn) numbers.render({}) numbers.metadata['timestamp'] = datetime.now().timestamp() numbers.metadata['stored_source_code'] = 'some code' numbers.save_metadata() fetched = numbers.fetch_metadata() assert fetched == numbers.metadata
27.179775
77
0.676726
290
2,419
5.482759
0.210345
0.090566
0.040881
0.062893
0.736478
0.736478
0.707547
0.707547
0.671069
0.662264
0
0.014918
0.168665
2,419
88
78
27.488636
0.775733
0.053741
0
0.625
0
0
0.105825
0
0
0
0
0
0.125
1
0.104167
false
0
0.125
0
0.229167
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f39f47ac6327d89094492a220da3a6b510daa2a7
130
py
Python
src/cba/helpers.py
osipov-andrey/control_bot_actuator
687131489beb3256107443f89ef5cf53998d069c
[ "MIT" ]
1
2021-04-24T08:56:17.000Z
2021-04-24T08:56:17.000Z
src/cba/helpers.py
osipov-andrey/control_bot_actuator
687131489beb3256107443f89ef5cf53998d069c
[ "MIT" ]
null
null
null
src/cba/helpers.py
osipov-andrey/control_bot_actuator
687131489beb3256107443f89ef5cf53998d069c
[ "MIT" ]
null
null
null
from collections import namedtuple ClientInfo = namedtuple("ClientInfo", "name, verbose_name, hide_name", defaults=(False, ""))
26
92
0.761538
14
130
6.928571
0.714286
0.412371
0
0
0
0
0
0
0
0
0
0
0.107692
130
4
93
32.5
0.836207
0
0
0
0
0
0.3
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
f3a2229b2c4be18da1cbb9be7e6a7281aac8ad6b
253
py
Python
platform/core/polyaxon/crons/tasks/health.py
hackerwins/polyaxon
ff56a098283ca872abfbaae6ba8abba479ffa394
[ "Apache-2.0" ]
null
null
null
platform/core/polyaxon/crons/tasks/health.py
hackerwins/polyaxon
ff56a098283ca872abfbaae6ba8abba479ffa394
[ "Apache-2.0" ]
null
null
null
platform/core/polyaxon/crons/tasks/health.py
hackerwins/polyaxon
ff56a098283ca872abfbaae6ba8abba479ffa394
[ "Apache-2.0" ]
null
null
null
import workers from checks import health_task from polyaxon.settings import CronsCeleryTasks @workers.app.task(name=CronsCeleryTasks.CRONS_HEALTH, ignore_result=False) def crons_health(x: int, y: int) -> int: return health_task.health_task(x, y)
25.3
74
0.798419
37
253
5.297297
0.540541
0.153061
0
0
0
0
0
0
0
0
0
0
0.114625
253
9
75
28.111111
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.5
0.166667
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
f3b8dd39e45e6a1776e9f56b289e969404c1913e
109
py
Python
scripts/codes/__init__.py
arblox/SLAC
0a2609fc08c2d6b7b847dc93f374b5a736b98995
[ "MIT" ]
null
null
null
scripts/codes/__init__.py
arblox/SLAC
0a2609fc08c2d6b7b847dc93f374b5a736b98995
[ "MIT" ]
null
null
null
scripts/codes/__init__.py
arblox/SLAC
0a2609fc08c2d6b7b847dc93f374b5a736b98995
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 9 12:02:48 2018 @author: ablaas """
12.111111
35
0.587156
18
109
3.555556
1
0
0
0
0
0
0
0
0
0
0
0.147727
0.192661
109
8
36
13.625
0.579545
0.880734
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4