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
e55615aa05e1ce1ce7853e73fc177018f9fa1a7b
99
py
Python
back-end/app/api/__init__.py
liaoherui/flask-vue-microblog
e34672d834013fc9a4919607bbfdc103048581a4
[ "Apache-2.0" ]
null
null
null
back-end/app/api/__init__.py
liaoherui/flask-vue-microblog
e34672d834013fc9a4919607bbfdc103048581a4
[ "Apache-2.0" ]
null
null
null
back-end/app/api/__init__.py
liaoherui/flask-vue-microblog
e34672d834013fc9a4919607bbfdc103048581a4
[ "Apache-2.0" ]
null
null
null
from flask import Blueprint bp=Blueprint('api',__name__) from app.api import ping, users, tokens
16.5
39
0.777778
15
99
4.866667
0.733333
0
0
0
0
0
0
0
0
0
0
0
0.131313
99
5
40
19.8
0.848837
0
0
0
0
0
0.030303
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
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
1
0
5
e584a93589ba6b55b1e87d927419a05ec2621581
90
py
Python
dynamicRooms/__init__.py
MichaelBoshell/RSCBot
6a77a76e7beab073bc40e8cab300b3031279298b
[ "MIT" ]
12
2018-12-19T17:00:00.000Z
2021-06-10T13:27:01.000Z
dynamicRooms/__init__.py
MichaelBoshell/RSCBot
6a77a76e7beab073bc40e8cab300b3031279298b
[ "MIT" ]
37
2020-03-10T18:42:29.000Z
2021-09-29T19:36:42.000Z
dynamicRooms/__init__.py
MichaelBoshell/RSCBot
6a77a76e7beab073bc40e8cab300b3031279298b
[ "MIT" ]
14
2018-12-31T02:12:18.000Z
2021-11-13T01:49:53.000Z
from .dynamicRooms import DynamicRooms def setup(bot): bot.add_cog(DynamicRooms(bot))
22.5
38
0.777778
12
90
5.75
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.122222
90
4
39
22.5
0.873418
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
e589d52bda020ef4213d6f06e65a6e58ffa9fcdc
641
py
Python
ee/clickhouse/views/session_recordings.py
lalitkale/posthog
25163d0bdbef22fb254cd10f0cd7afd6a3cdc346
[ "MIT" ]
null
null
null
ee/clickhouse/views/session_recordings.py
lalitkale/posthog
25163d0bdbef22fb254cd10f0cd7afd6a3cdc346
[ "MIT" ]
null
null
null
ee/clickhouse/views/session_recordings.py
lalitkale/posthog
25163d0bdbef22fb254cd10f0cd7afd6a3cdc346
[ "MIT" ]
null
null
null
from ee.clickhouse.queries.session_recordings.session_recording import ClickhouseSessionRecording from ee.clickhouse.queries.session_recordings.session_recording_list import ClickhouseSessionRecordingList from posthog.api.session_recording import SessionRecordingViewSet class ClickhouseSessionRecordingViewSet(SessionRecordingViewSet): def _get_session_recording_list(self, filter): return ClickhouseSessionRecordingList(filter=filter, team=self.team).run() def _get_session_recording(self, session_recording_id): return ClickhouseSessionRecording(team=self.team, session_recording_id=session_recording_id).run()
53.416667
106
0.856474
66
641
8.030303
0.363636
0.241509
0.101887
0.086792
0.211321
0.211321
0.211321
0.211321
0
0
0
0
0.082683
641
11
107
58.272727
0.901361
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.375
0.25
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
1
0
0
1
1
1
0
0
5
e59c0465392b25fc9b9fb4ba747a681387bab4d4
2,768
py
Python
resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtCore/QXmlStreamWriter.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
1
2020-04-20T02:27:20.000Z
2020-04-20T02:27:20.000Z
resources/dot_PyCharm/system/python_stubs/cache/16012662ddca113c1f50140f9e0d3bd290a511015767475cf362e5267760f062/PySide/QtCore/QXmlStreamWriter.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
null
null
null
resources/dot_PyCharm/system/python_stubs/cache/16012662ddca113c1f50140f9e0d3bd290a511015767475cf362e5267760f062/PySide/QtCore/QXmlStreamWriter.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
null
null
null
# encoding: utf-8 # module PySide.QtCore # from C:\Python27\lib\site-packages\PySide\QtCore.pyd # by generator 1.147 # no doc # imports import Shiboken as __Shiboken class QXmlStreamWriter(__Shiboken.Object): # no doc def autoFormatting(self, *args, **kwargs): # real signature unknown pass def autoFormattingIndent(self, *args, **kwargs): # real signature unknown pass def codec(self, *args, **kwargs): # real signature unknown pass def device(self, *args, **kwargs): # real signature unknown pass def hasError(self, *args, **kwargs): # real signature unknown pass def setAutoFormatting(self, *args, **kwargs): # real signature unknown pass def setAutoFormattingIndent(self, *args, **kwargs): # real signature unknown pass def setCodec(self, *args, **kwargs): # real signature unknown pass def setDevice(self, *args, **kwargs): # real signature unknown pass def writeAttribute(self, *args, **kwargs): # real signature unknown pass def writeAttributes(self, *args, **kwargs): # real signature unknown pass def writeCDATA(self, *args, **kwargs): # real signature unknown pass def writeCharacters(self, *args, **kwargs): # real signature unknown pass def writeComment(self, *args, **kwargs): # real signature unknown pass def writeCurrentToken(self, *args, **kwargs): # real signature unknown pass def writeDefaultNamespace(self, *args, **kwargs): # real signature unknown pass def writeDTD(self, *args, **kwargs): # real signature unknown pass def writeEmptyElement(self, *args, **kwargs): # real signature unknown pass def writeEndDocument(self, *args, **kwargs): # real signature unknown pass def writeEndElement(self, *args, **kwargs): # real signature unknown pass def writeEntityReference(self, *args, **kwargs): # real signature unknown pass def writeNamespace(self, *args, **kwargs): # real signature unknown pass def writeProcessingInstruction(self, *args, **kwargs): # real signature unknown pass def writeStartDocument(self, *args, **kwargs): # real signature unknown pass def writeStartElement(self, *args, **kwargs): # real signature unknown pass def writeTextElement(self, *args, **kwargs): # real signature unknown pass def __init__(self, *args, **kwargs): # real signature unknown pass @staticmethod # known case of __new__ def __new__(S, *more): # real signature unknown; restored from __doc__ """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ pass
27.68
83
0.647038
304
2,768
5.8125
0.243421
0.205999
0.316921
0.275042
0.624788
0.624788
0.624788
0.603282
0
0
0
0.003362
0.247832
2,768
99
84
27.959596
0.845341
0.319003
0
0.474576
0
0
0
0
0
0
0
0
0
1
0.474576
false
0.474576
0.016949
0
0.508475
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
5
e5e3a93573493fafca9b274491e85e7facbe8ae7
86
py
Python
pdat/templates/__init__.py
Christine8888/PulsarDataToolbox
d4c4a508f90fec77cc60be48776bf8300e98aeaa
[ "MIT" ]
1
2019-02-07T20:05:15.000Z
2019-02-07T20:05:15.000Z
pdat/templates/__init__.py
Christine8888/PulsarDataToolbox
d4c4a508f90fec77cc60be48776bf8300e98aeaa
[ "MIT" ]
2
2017-09-29T22:31:44.000Z
2017-10-12T07:41:13.000Z
pdat/templates/__init__.py
Hazboun6/pypsrfits
d4c4a508f90fec77cc60be48776bf8300e98aeaa
[ "MIT" ]
null
null
null
""" __init__.py file to make templates a module""" from .template import get_template
28.666667
50
0.767442
13
86
4.692308
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.139535
86
2
51
43
0.824324
0.5
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f906a8b803ebf94ab8ab014071ba16a935e9c0c9
57
py
Python
gym_gridworld/envs/__init__.py
utilForever/2021-AIFrenz-RLEnv
f6936ef0ca753a63af0133102d0c2b840d8d299b
[ "MIT" ]
6
2021-05-11T12:07:17.000Z
2021-06-18T03:46:02.000Z
gym_gridworld/envs/__init__.py
utilForever/2021-AIFrenz-RLEnv
f6936ef0ca753a63af0133102d0c2b840d8d299b
[ "MIT" ]
null
null
null
gym_gridworld/envs/__init__.py
utilForever/2021-AIFrenz-RLEnv
f6936ef0ca753a63af0133102d0c2b840d8d299b
[ "MIT" ]
5
2021-05-11T11:42:57.000Z
2022-03-22T04:49:22.000Z
from gym_gridworld.envs.env_gridworld import GridworldEnv
57
57
0.912281
8
57
6.25
0.875
0
0
0
0
0
0
0
0
0
0
0
0.052632
57
1
57
57
0.925926
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
00db727d31e9e3c1771f2742ff8d3a494951402e
64
py
Python
apps/api/v2/mixins/__init__.py
blockomat2100/vulnman
835ff3aae1168d8e2fa5556279bc86efd2e46472
[ "MIT" ]
3
2021-12-22T07:02:24.000Z
2022-01-27T20:19:11.000Z
apps/api/v2/mixins/__init__.py
vulnman/vulnman
d48ee022bc0e4368060a990a527b1c7a5e437504
[ "MIT" ]
44
2021-12-14T07:24:29.000Z
2022-03-23T07:01:16.000Z
apps/api/v2/mixins/__init__.py
blockomat2100/vulnman
835ff3aae1168d8e2fa5556279bc86efd2e46472
[ "MIT" ]
1
2022-01-21T16:29:56.000Z
2022-01-21T16:29:56.000Z
from apps.api.v2.mixins.testcase import VulnmanAPITestCaseMixin
32
63
0.875
8
64
7
1
0
0
0
0
0
0
0
0
0
0
0.016667
0.0625
64
1
64
64
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
da9ee415e998b955293bc0ab4637d217cf655b3b
183
py
Python
show_news/admin.py
QuocHung52/daily_news
b051dfad82bc1b53b30ddf7895473b732ff3ad24
[ "MIT" ]
null
null
null
show_news/admin.py
QuocHung52/daily_news
b051dfad82bc1b53b30ddf7895473b732ff3ad24
[ "MIT" ]
null
null
null
show_news/admin.py
QuocHung52/daily_news
b051dfad82bc1b53b30ddf7895473b732ff3ad24
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import * # Register your models here. admin.site.register(Articles) admin.site.register(Source_Of_News) admin.site.register(Skip_List)
20.333333
35
0.808743
27
183
5.37037
0.592593
0.186207
0.351724
0
0
0
0
0
0
0
0
0
0.098361
183
8
36
22.875
0.878788
0.142077
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
dadff7f18518c720199f9f12d36fe88ab13c3e70
118
py
Python
scripts/programa-pedidos.py
pblocz/programa-pedidos-san-cecilio
8af64c4988dcfc0cdfb9d92867e4650b268a547a
[ "CC-BY-3.0" ]
null
null
null
scripts/programa-pedidos.py
pblocz/programa-pedidos-san-cecilio
8af64c4988dcfc0cdfb9d92867e4650b268a547a
[ "CC-BY-3.0" ]
null
null
null
scripts/programa-pedidos.py
pblocz/programa-pedidos-san-cecilio
8af64c4988dcfc0cdfb9d92867e4650b268a547a
[ "CC-BY-3.0" ]
null
null
null
#! /usr/bin/python2 import sys import hospital.hospital_gui as gui if __name__ == "__main__": sys.exit(gui.main())
14.75
47
0.720339
18
118
4.222222
0.666667
0
0
0
0
0
0
0
0
0
0
0.009804
0.135593
118
7
48
16.857143
0.735294
0.152542
0
0
0
0
0.081633
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
daee65e5f32990e09418f0c544685e2b2f60a5d7
236
py
Python
electionnight/models/__init__.py
The-Politico/politico-civic-election-night
a8aaf5be43872a7b84d2b0d7c2b6151d32d4d8b6
[ "MIT" ]
null
null
null
electionnight/models/__init__.py
The-Politico/politico-civic-election-night
a8aaf5be43872a7b84d2b0d7c2b6151d32d4d8b6
[ "MIT" ]
55
2018-03-19T20:56:04.000Z
2018-10-10T21:28:26.000Z
electionnight/models/__init__.py
The-Politico/politico-civic-election-night
a8aaf5be43872a7b84d2b0d7c2b6151d32d4d8b6
[ "MIT" ]
null
null
null
# flake8: noqa from .candidate_color_order import CandidateColorOrder from .page_content_block import PageContentBlock from .page_content_type import PageContentType from .page_content import PageContent from .page_type import PageType
33.714286
54
0.872881
30
236
6.6
0.533333
0.161616
0.227273
0
0
0
0
0
0
0
0
0.004695
0.097458
236
6
55
39.333333
0.924883
0.050847
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
1
0
0
5
9704a9e23821654ac78f093771c9d60e001972e5
37
py
Python
tests/__init__.py
MustardForBreakfast/safetywrap
170f836e12df455aed9b6dce5e7c634f6b9e8f87
[ "Apache-2.0" ]
21
2019-10-31T17:43:18.000Z
2022-03-19T13:46:05.000Z
tests/__init__.py
MustardForBreakfast/safetywrap
170f836e12df455aed9b6dce5e7c634f6b9e8f87
[ "Apache-2.0" ]
null
null
null
tests/__init__.py
MustardForBreakfast/safetywrap
170f836e12df455aed9b6dce5e7c634f6b9e8f87
[ "Apache-2.0" ]
3
2019-11-01T17:50:07.000Z
2021-12-15T07:23:21.000Z
"""Test modules for result types."""
18.5
36
0.675676
5
37
5
1
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
1
37
37
0.78125
0.810811
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
97382fbebb7181474fda91ae6ab830ba41edb89e
322
py
Python
datasets/transformations/utils/__init__.py
bytedance/Hammer
388ed20b3d9b34f33f5357d75f8fe5d726782ec8
[ "MIT" ]
97
2022-02-08T09:00:57.000Z
2022-03-23T05:33:35.000Z
datasets/transformations/utils/__init__.py
bytedance/Hammer
388ed20b3d9b34f33f5357d75f8fe5d726782ec8
[ "MIT" ]
null
null
null
datasets/transformations/utils/__init__.py
bytedance/Hammer
388ed20b3d9b34f33f5357d75f8fe5d726782ec8
[ "MIT" ]
7
2022-02-08T15:13:02.000Z
2022-03-19T19:11:13.000Z
# python3.7 """Collects dataset related utility functions.""" from .affine_transform import generate_affine_transformation from .polygon import generate_polygon_contour from .polygon import generate_polygon_mask __all__ = [ 'generate_affine_transformation', 'generate_polygon_contour', 'generate_polygon_mask' ]
26.833333
65
0.81677
36
322
6.833333
0.472222
0.243902
0.227642
0.203252
0.260163
0
0
0
0
0
0
0.006993
0.111801
322
11
66
29.272727
0.853147
0.167702
0
0
1
0
0.28626
0.28626
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
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
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
9740447e71ae7bc5fec243575d6796817504f535
104
py
Python
megumi/db/__init__.py
dev-techmoe/megumi
67d5626b168dada5f42671a81eca46ea8b7a603c
[ "MIT" ]
4
2020-10-28T08:37:49.000Z
2022-03-30T05:39:27.000Z
megumi/db/__init__.py
dev-techmoe/megumi
67d5626b168dada5f42671a81eca46ea8b7a603c
[ "MIT" ]
null
null
null
megumi/db/__init__.py
dev-techmoe/megumi
67d5626b168dada5f42671a81eca46ea8b7a603c
[ "MIT" ]
null
null
null
from .db import db, get_db, clean_db from .dao import DAO __all__ = ['db', 'get_db', 'DAO', 'clean_db']
26
45
0.673077
19
104
3.263158
0.368421
0.16129
0.225806
0
0
0
0
0
0
0
0
0
0.153846
104
4
45
26
0.704545
0
0
0
0
0
0.180952
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
97539a1cd265a0c047da45d1965dcd6eba244899
24
py
Python
cryopicls/autorefine/__init__.py
kttn8769/cryopicls
29a8b4d6cc43c592576ded781462ca84276fd4c1
[ "MIT" ]
null
null
null
cryopicls/autorefine/__init__.py
kttn8769/cryopicls
29a8b4d6cc43c592576ded781462ca84276fd4c1
[ "MIT" ]
null
null
null
cryopicls/autorefine/__init__.py
kttn8769/cryopicls
29a8b4d6cc43c592576ded781462ca84276fd4c1
[ "MIT" ]
null
null
null
from . import cryosparc
12
23
0.791667
3
24
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
0.95
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
976005978200d1c46755b983d1fbc74222f383c8
58
py
Python
gym_tictactoe/envs/__init__.py
LudwigStumpp/gym-tic-tac-toe
2c41f14249d0336b35467010be1957d3b018ae71
[ "MIT" ]
4
2020-07-24T11:47:16.000Z
2020-10-10T18:44:44.000Z
gym_tictactoe/envs/__init__.py
LudwigStumpp/gym-tic-tac-toe
2c41f14249d0336b35467010be1957d3b018ae71
[ "MIT" ]
null
null
null
gym_tictactoe/envs/__init__.py
LudwigStumpp/gym-tic-tac-toe
2c41f14249d0336b35467010be1957d3b018ae71
[ "MIT" ]
null
null
null
from gym_tictactoe.envs.tictactoe_env import TictactoeEnv
29
57
0.896552
8
58
6.25
0.875
0
0
0
0
0
0
0
0
0
0
0
0.068966
58
1
58
58
0.925926
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
97ab313baa15535a569f83dbcb95e7f7fe5cf452
20,167
py
Python
models/vgg_pytorch.py
AffectAnalysisGroup/AUNets
dc3c6ad937b4ced5564a4b002e8adc7e36979e13
[ "MIT" ]
2
2021-04-12T09:57:39.000Z
2021-11-30T16:42:48.000Z
models/vgg_pytorch.py
AffectAnalysisGroup/AUNets
dc3c6ad937b4ced5564a4b002e8adc7e36979e13
[ "MIT" ]
null
null
null
models/vgg_pytorch.py
AffectAnalysisGroup/AUNets
dc3c6ad937b4ced5564a4b002e8adc7e36979e13
[ "MIT" ]
null
null
null
import torch.nn as nn import torch.utils.model_zoo as model_zoo import math import torch import glob, pdb """ We provide pre-trained models, using the PyTorch :mod:`torch.utils.model_zoo`. These can be constructed by passing ``pretrained=True``: .. code:: python import torchvision.models as models vgg16 = models.vgg16(pretrained=True) All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (3 x H x W), where H and W are expected to be at least 224. The images have to be loaded in to a range of [0, 1] and then normalized using ``mean = [0.485, 0.456, 0.406]`` and ``std = [0.229, 0.224, 0.225]``. You can use the following transform to normalize:: normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) An example of such normalization can be found in the imagenet example `here <https://github.com/pytorch/examples/blob/\ 42e5b996718797e45c46a25c55b031e6768f8440/imagenet/main.py#L89-L101>`_ """ __all__ = ['VGG', 'vgg16'] model_urls = { 'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth', } # ========================================================================# # ========================================================================# # ========================================================================# def make_layers(cfg, in_channels=3, batch_norm=False): layers = [] for v in cfg: if v == 'M': layers += [nn.MaxPool2d(kernel_size=2, stride=2)] else: conv2d = nn.Conv2d(in_channels, v, kernel_size=3, padding=1) if batch_norm: layers += [conv2d, nn.BatchNorm2d(v), nn.ReLU(inplace=True)] else: layers += [conv2d, nn.ReLU(inplace=True)] in_channels = v return nn.Sequential(*layers) cfg = { 'A': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'B': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'D': [ 64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M' ], 'E': [ 64, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 512, 512, 512, 512, 'M', 512, 512, 512, 512, 'M' ], } # ========================================================================# class VGG(nn.Module): def __init__(self, features, num_classes=2): super(VGG, self).__init__() self.features = features self.classifier = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, num_classes), ) self._initialize_weights() def forward(self, x): x = self.features(x) x = x.view(x.size(0), -1) x = self.classifier(x) return x def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# class VGG_ALONE(nn.Module): def __init__(self, features, num_classes=2): super(VGG_ALONE, self).__init__() self.features = features self.classifier = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, num_classes), ) self._initialize_weights() def forward(self, x, OF=None): OF = self.features(OF) OF = OF.view(OF.size(0), -1) OF = self.classifier(OF) return OF def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# class VGG_IMAGE(nn.Module): def __init__(self, features, num_classes=2, OF_option='horizontal'): # img = torch.from_numpy(np.zeros((4,3,448,224), dtype=np.float32)) super(VGG_IMAGE, self).__init__() self.OF_option = OF_option self.features = features self.classifier = nn.Sequential( nn.Linear(512 * 14 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, num_classes), ) self._initialize_weights() def forward(self, x, OF=None): if self.OF_option.lower() == 'horizontal': dim = 3 else: dim = 2 img_of = torch.cat([x, OF], dim=dim) x = self.features(img_of) x = x.view(x.size(0), -1) x = self.classifier(x) return x def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# class VGG_CHANNELS(nn.Module): def __init__(self, features, num_classes=2): # img = torch.from_numpy(np.zeros((4,6,224,224), dtype=np.float32)) super(VGG_CHANNELS, self).__init__() self.features = features self.classifier = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, num_classes), ) self._initialize_weights() def forward(self, x, OF=None): img_of = torch.cat([x, OF], dim=1) out = self.features(img_of) out = out.view(out.size(0), -1) out = self.classifier(out) return out def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# class VGG_CONV(nn.Module): def __init__(self, features_rgb, features_of, num_classes=2): # img = torch.from_numpy(np.zeros((4,3,224,224), dtype=np.float32)) super(VGG_CONV, self).__init__() self.features_rgb = features_rgb self.features_of = features_of self.classifier = nn.Sequential( nn.Linear(1024 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, num_classes), ) self._initialize_weights() def forward(self, x, OF=None): conv_rgb = self.features_rgb(x) conv_of = self.features_of(OF) conv_out = torch.cat([conv_rgb, conv_of], dim=1) conv_out = conv_out.view(conv_out.size(0), -1) out = self.classifier(conv_out) return out def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# class VGG_FC6(nn.Module): def __init__(self, features_rgb, features_of, num_classes=2): super(VGG_FC6, self).__init__() self.features_rgb = features_rgb self.features_of = features_of self.classifier_rgb = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), ) self.classifier_of = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), ) self.classifier = nn.Sequential( nn.Linear(8192, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, num_classes), ) self._initialize_weights() def forward(self, x, OF=None): conv_rgb = self.features_rgb(x) conv_rgb = conv_rgb.view(conv_rgb.size(0), -1) fc6_rgb = self.classifier_rgb(conv_rgb) conv_of = self.features_of(OF) conv_of = conv_of.view(conv_of.size(0), -1) fc6_of = self.classifier_of(conv_of) fc_cat = torch.cat([fc6_rgb, fc6_of], dim=1) out = self.classifier(fc_cat) return out def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# class VGG_FC7(nn.Module): def __init__(self, features_rgb, features_of, num_classes=2): super(VGG_FC7, self).__init__() self.features_rgb = features_rgb self.features_of = features_of self.classifier_rgb = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), ) self.classifier_of = nn.Sequential( nn.Linear(512 * 7 * 7, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, 4096), nn.ReLU(True), nn.Dropout(), ) self.classifier = nn.Sequential(nn.Linear(8192, num_classes), ) self._initialize_weights() def forward(self, x, OF=None): conv_rgb = self.features_rgb(x) conv_rgb = conv_rgb.view(conv_rgb.size(0), -1) fc7_rgb = self.classifier_rgb(conv_rgb) conv_of = self.features_of(OF) conv_of = conv_of.view(conv_of.size(0), -1) fc7_of = self.classifier_rgb(conv_of) fc_cat = torch.cat([fc7_rgb, fc7_of], dim=1) out = self.classifier(fc_cat) return out def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) if m.bias is not None: m.bias.data.zero_() elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_() elif isinstance(m, nn.Linear): m.weight.data.normal_(0, 0.01) m.bias.data.zero_() # ========================================================================# # ========================================================================# # ========================================================================# # ========================================================================# def vgg16(pretrained='', OF_option='None', model_save_path='', **kwargs): """VGG 16-layer model (configuration "D") Args: pretrained (str): If '', returns a model pre-trained on ImageNet """ # ========================================================================# # ========================================================================# # pdb.set_trace() if pretrained == 'ImageNet': model_zoo_ = model_zoo.load_url(model_urls['vgg16']) model_zoo_ = {k.encode("utf-8"): v for k, v in model_zoo_.iteritems()} elif pretrained == 'emotionnet' and OF_option == 'None': emo_file = sorted( glob.glob('/home/afromero/datos2/EmoNet/snapshot/models/\ EmotionNet/normal/fold_all/Imagenet/*.pth'))[-1] pddb.set_trace() model_zoo_ = torch.load(emo_file) # print("Finetuning from: "+emo_file) model_zoo_ = { k.replace('model.', ''): v for k, v in model_zoo_.iteritems() } elif pretrained == 'emotionnet' and OF_option != 'None': au_rgb_file = sorted( glob.glob(model_save_path.replace(OF_option, 'None') + '/*.pth'))[-1] model_zoo_ = torch.load(au_rgb_file) # print("Finetuning from: "+os.path.abspath(au_rgb_file)) model_zoo_ = { k.replace('model.', ''): v for k, v in model_zoo_.iteritems() } # ========================================================================# # ========================================================================# if OF_option == 'None': model = VGG(make_layers(cfg['D']), **kwargs) if pretrained: model.load_state_dict(model_zoo_) # ========================================================================# elif OF_option == 'Alone': model = VGG_ALONE(make_layers(cfg['D']), **kwargs) if pretrained: model.load_state_dict(model_zoo_) # ========================================================================# elif OF_option == 'Vertical' or OF_option == 'Horizontal': #pdb.set_trace() model = VGG_IMAGE(make_layers(cfg['D']), **kwargs) if pretrained: model_zoo_['classifier.0.weight'] = model_zoo_[ 'classifier.0.weight'].repeat(1, 2) model.load_state_dict(model_zoo_) # ========================================================================# elif OF_option == 'Channels': model = VGG_CHANNELS(make_layers(cfg['D'], in_channels=6), **kwargs) if pretrained: model_zoo_['features.0.weight'] = model_zoo_[ 'features.0.weight'].repeat(1, 2, 1, 1) model.load_state_dict(model_zoo_) # ========================================================================# elif OF_option == 'Conv': model = VGG_CONV( make_layers(cfg['D']), make_layers(cfg['D']), **kwargs) if pretrained: model_zoo_2 = {} model_zoo_2['classifier.0.weight'] = model_zoo_[ 'classifier.0.weight'].repeat(1, 2) conv_rgb_params = { k.replace('features', 'features_rgb'): v for k, v in model_zoo_.iteritems() if 'features' in k } model_zoo_2.update(conv_rgb_params) conv_of_params = { k.replace('features', 'features_of'): v for k, v in model_zoo_.iteritems() if 'features' in k } model_zoo_2.update(conv_of_params) fc_params = { k: v for k, v in model_zoo_.iteritems() if 'classifier' in k and 'classifier.0.weight' not in k } model_zoo_2.update(fc_params) model.load_state_dict(model_zoo_2) # ========================================================================# elif OF_option == 'FC6': model = VGG_FC6(make_layers(cfg['D']), make_layers(cfg['D']), **kwargs) if pretrained: model_zoo_2 = {} conv_rgb_params = { k.replace('features', 'features_rgb'): v for k, v in model_zoo_.iteritems() if 'features' in k } model_zoo_2.update(conv_rgb_params) fc_rgb_params = { k.replace('classifier', 'classifier_rgb'): v for k, v in model_zoo_.iteritems() if 'classifier.0' in k } model_zoo_2.update(fc_rgb_params) conv_of_params = { k.replace('features', 'features_of'): v for k, v in model_zoo_.iteritems() if 'features' in k } model_zoo_2.update(conv_of_params) fc_of_params = { k.replace('classifier', 'classifier_of'): v for k, v in model_zoo_.iteritems() if 'classifier.0' in k } model_zoo_2.update(fc_of_params) model_zoo_2['classifier.0.weight'] = model_zoo_[ 'classifier.3.weight'].repeat(1, 2) model_zoo_2['classifier.0.bias'] = model_zoo_['classifier.3.bias'] model_zoo_2['classifier.3.weight'] = model_zoo_[ 'classifier.6.weight'] model_zoo_2['classifier.3.bias'] = model_zoo_['classifier.6.bias'] model.load_state_dict(model_zoo_2) # ========================================================================# elif OF_option == 'FC7': model = VGG_FC7(make_layers(cfg['D']), make_layers(cfg['D']), **kwargs) if pretrained: model_zoo_2 = {} conv_rgb_params = { k.replace('features', 'features_rgb'): v for k, v in model_zoo_.iteritems() if 'features' in k } model_zoo_2.update(conv_rgb_params) fc_rgb_params = { k.replace('classifier', 'classifier_rgb'): v for k, v in model_zoo_.iteritems() if 'classifier.0' in k or 'classifier.3' in k } model_zoo_2.update(fc_rgb_params) conv_of_params = { k.replace('features', 'features_of'): v for k, v in model_zoo_.iteritems() if 'features' in k } model_zoo_2.update(conv_of_params) fc_of_params = { k.replace('classifier', 'classifier_of'): v for k, v in model_zoo_.iteritems() if 'classifier.0' in k or 'classifier.3' in k } model_zoo_2.update(fc_of_params) model_zoo_2['classifier.0.weight'] = model_zoo_[ 'classifier.6.weight'].repeat(1, 2) model_zoo_2['classifier.0.bias'] = model_zoo_['classifier.6.bias'] model.load_state_dict(model_zoo_2) return model
37.277264
79
0.491397
2,401
20,167
3.916285
0.097043
0.0536
0.022971
0.029033
0.772732
0.757418
0.744762
0.713283
0.709561
0.684675
0
0.046368
0.301681
20,167
540
80
37.346296
0.621316
0.108345
0
0.663529
0
0
0.054444
0
0
0
0
0
0
1
0.054118
false
0
0.011765
0
0.103529
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
8af737b707cc932c68d03ea6384465730e8864e7
36
py
Python
CURSO PYTHON/Modulos/aula 01.py
Sabrinaparussoli/PYTHON
77436608ffd799e9e2bbe4fa5084443fb7382793
[ "MIT" ]
null
null
null
CURSO PYTHON/Modulos/aula 01.py
Sabrinaparussoli/PYTHON
77436608ffd799e9e2bbe4fa5084443fb7382793
[ "MIT" ]
null
null
null
CURSO PYTHON/Modulos/aula 01.py
Sabrinaparussoli/PYTHON
77436608ffd799e9e2bbe4fa5084443fb7382793
[ "MIT" ]
null
null
null
from modulos import teste teste(10)
12
25
0.805556
6
36
4.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0.064516
0.138889
36
3
26
12
0.870968
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
c17144a4f4bc8516961f7b80a8aa761bb5b7d088
120
py
Python
tensornet/model/__init__.py
Pandinosaurus/Depth-Estimation-Segmentation
2eea883c96bf106774ea94464fc16c6baea86a95
[ "MIT" ]
4
2020-06-18T13:07:19.000Z
2022-01-07T10:51:10.000Z
tensornet/model/__init__.py
Pandinosaurus/Depth-Estimation-Segmentation
2eea883c96bf106774ea94464fc16c6baea86a95
[ "MIT" ]
1
2021-07-31T04:34:46.000Z
2021-08-11T05:55:57.000Z
tensornet/model/__init__.py
Pandinosaurus/Depth-Estimation-Segmentation
2eea883c96bf106774ea94464fc16c6baea86a95
[ "MIT" ]
2
2020-07-21T18:41:58.000Z
2021-05-28T09:40:02.000Z
from .basicnet import BasicNet from .resnet import ResNet18 from .masknet import MaskNet from .dsresnet import DSResNet
24
30
0.833333
16
120
6.25
0.4375
0
0
0
0
0
0
0
0
0
0
0.019231
0.133333
120
4
31
30
0.942308
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c171d481e58e1ea708b2a8074b860068241212d9
42
py
Python
wrappers/weather/__init__.py
Yat-o/Aoi
51215c2f9fa2049ceee224ab8997e7673cb6e3d6
[ "MIT" ]
5
2020-10-18T02:25:47.000Z
2021-07-01T04:58:58.000Z
wrappers/weather/__init__.py
Yat-o/Aoi
51215c2f9fa2049ceee224ab8997e7673cb6e3d6
[ "MIT" ]
58
2020-09-26T03:16:23.000Z
2021-11-01T18:41:56.000Z
wrappers/weather/__init__.py
Yat-o/Aoi
51215c2f9fa2049ceee224ab8997e7673cb6e3d6
[ "MIT" ]
5
2020-11-25T09:07:11.000Z
2021-08-21T10:25:31.000Z
from .api import * from .helpers import *
14
22
0.714286
6
42
5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.190476
42
2
23
21
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
c1b0d2c7f17e16af5e574640d4ece6e4c5723af7
107
py
Python
src/utils/common.py
rustam-azimov/CFPQ_PyAlgo
1f40c300a2dfeded5297ca48d0ddde26cfa8887c
[ "Apache-2.0" ]
11
2020-08-16T15:29:32.000Z
2022-01-26T12:45:39.000Z
src/utils/common.py
rustam-azimov/CFPQ_PyAlgo
1f40c300a2dfeded5297ca48d0ddde26cfa8887c
[ "Apache-2.0" ]
4
2021-02-10T13:35:54.000Z
2021-06-04T07:14:32.000Z
src/utils/common.py
rustam-azimov/CFPQ_PyAlgo
1f40c300a2dfeded5297ca48d0ddde26cfa8887c
[ "Apache-2.0" ]
3
2021-02-23T16:08:38.000Z
2021-12-10T12:47:06.000Z
def chunkify(xs, chunk_size): for i in range(0, len(xs), chunk_size): yield xs[i:i+chunk_size]
26.75
43
0.64486
20
107
3.3
0.6
0.409091
0.333333
0
0
0
0
0
0
0
0
0.011905
0.214953
107
3
44
35.666667
0.77381
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
c1d7580d805161f5fb129f384e690308b48c38ef
132
py
Python
danesfield/core/apps.py
girder/Danesfield
04b0e991cae52bda758de4ee3f7e04dab45f3ff9
[ "Apache-2.0" ]
null
null
null
danesfield/core/apps.py
girder/Danesfield
04b0e991cae52bda758de4ee3f7e04dab45f3ff9
[ "Apache-2.0" ]
24
2021-10-29T21:03:34.000Z
2022-03-18T02:07:57.000Z
danesfield/core/apps.py
girder/Danesfield
04b0e991cae52bda758de4ee3f7e04dab45f3ff9
[ "Apache-2.0" ]
1
2022-01-26T09:31:48.000Z
2022-01-26T09:31:48.000Z
from django.apps import AppConfig class CoreConfig(AppConfig): name = 'danesfield.core' verbose_name = 'Danesfield: Core'
18.857143
37
0.734848
15
132
6.4
0.733333
0.291667
0.375
0
0
0
0
0
0
0
0
0
0.174242
132
6
38
22
0.880734
0
0
0
0
0
0.234848
0
0
0
0
0
0
1
0
false
0
0.25
0
1
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
1
0
0
5
c1f627ad1cd0e0d45610bee4b71f0a5cff58fceb
83
py
Python
cloudbridge/providers/gcp/__init__.py
MosheFriedland/cloudbridge
af7644322044863d401645311c0d1f2556bccb63
[ "MIT" ]
61
2018-07-10T18:32:43.000Z
2022-03-06T04:50:20.000Z
cloudbridge/providers/gcp/__init__.py
MosheFriedland/cloudbridge
af7644322044863d401645311c0d1f2556bccb63
[ "MIT" ]
134
2018-07-02T16:46:29.000Z
2022-02-03T17:05:43.000Z
cloudbridge/providers/gcp/__init__.py
MosheFriedland/cloudbridge
af7644322044863d401645311c0d1f2556bccb63
[ "MIT" ]
23
2018-08-07T17:33:16.000Z
2021-12-25T01:44:20.000Z
""" Exports from this provider """ from .provider import GCPCloudProvider # noqa
13.833333
46
0.73494
9
83
6.777778
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.168675
83
5
47
16.6
0.884058
0.385542
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
de0342e65a2ea6393f5513c040f5f5393d5c686d
141
py
Python
mfa/__init__.py
limeburst/mfa
d33c9bd801a4aa7b2c494d3c17fb9933c93e313d
[ "MIT" ]
36
2015-02-09T17:18:51.000Z
2022-01-29T05:51:50.000Z
mfa/__init__.py
limeburst/mfa
d33c9bd801a4aa7b2c494d3c17fb9933c93e313d
[ "MIT" ]
2
2015-03-06T04:04:17.000Z
2019-07-22T05:51:00.000Z
mfa/__init__.py
limeburst/mfa
d33c9bd801a4aa7b2c494d3c17fb9933c93e313d
[ "MIT" ]
9
2015-06-26T15:43:40.000Z
2021-12-06T04:11:15.000Z
""":mod:`mfa` --- Multi-factor authentication on your command line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """
28.2
67
0.340426
9
141
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.078014
141
4
68
35.25
0.369231
0.93617
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
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
a9c8ab242d1191351b0b33fb852cfad70d7648e7
174
py
Python
src/walker/topicmodeling.py
ucd-plse/func2vec-fse2018-artifact
a17e22f247a03b77931751dd55d429f26c8f293c
[ "BSD-3-Clause" ]
7
2019-06-01T18:34:53.000Z
2020-07-17T04:11:45.000Z
src/walker/topicmodeling.py
ucd-plse/func2vec-fse2018-artifact
a17e22f247a03b77931751dd55d429f26c8f293c
[ "BSD-3-Clause" ]
1
2018-12-05T14:17:13.000Z
2020-02-24T14:11:01.000Z
src/walker/topicmodeling.py
ucd-plse/func2vec-fse2018-artifact
a17e22f247a03b77931751dd55d429f26c8f293c
[ "BSD-3-Clause" ]
7
2018-07-19T05:49:22.000Z
2021-01-07T01:26:48.000Z
from gensim.models import KeyedVectors from gensim.models.ldamodel import LdaModel def lda(walks_list, numtopics): lda = LdaModel(walks_list, numtopics) return lda
21.75
43
0.781609
23
174
5.826087
0.521739
0.149254
0.238806
0
0
0
0
0
0
0
0
0
0.155172
174
7
44
24.857143
0.911565
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
e702745099e21ab935185238ebb77951ab53dedf
36
py
Python
alexa_skills/__init__.py
johnyob/Alexa-Skills
3679a887bb519042511a16fbb848254dc0ee43a0
[ "MIT" ]
null
null
null
alexa_skills/__init__.py
johnyob/Alexa-Skills
3679a887bb519042511a16fbb848254dc0ee43a0
[ "MIT" ]
null
null
null
alexa_skills/__init__.py
johnyob/Alexa-Skills
3679a887bb519042511a16fbb848254dc0ee43a0
[ "MIT" ]
null
null
null
from alexa_skills.Skill import Skill
36
36
0.888889
6
36
5.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.083333
36
1
36
36
0.939394
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e7a87c82fdc6bd23aa71134c05ef471d7b7ccc5e
4,101
py
Python
tests/graph-algo/test_path_selection.py
yonch/fastpass
07e620d6e9a16af731fc5e267c04ac03c5286f94
[ "MIT" ]
61
2015-01-16T00:19:50.000Z
2022-01-25T03:05:56.000Z
tests/graph-algo/test_path_selection.py
yonch/fastpass
07e620d6e9a16af731fc5e267c04ac03c5286f94
[ "MIT" ]
3
2016-09-13T22:51:45.000Z
2019-03-24T16:53:48.000Z
tests/graph-algo/test_path_selection.py
yonch/fastpass
07e620d6e9a16af731fc5e267c04ac03c5286f94
[ "MIT" ]
26
2015-01-18T17:35:43.000Z
2022-01-29T04:17:15.000Z
''' Created on January 3, 2014 @author: aousterh ''' import random import sys import unittest sys.path.insert(0, '../../bindings/graph-algo') sys.path.insert(0, '../../src/graph-algo') from graph_util import graph_util import pathselection import structures class Test(unittest.TestCase): def test_regular_graph(self): """Basic test involving graphs that are already regular.""" generator = graph_util() num_experiments = 10 n_nodes = 256 # network with 8 racks of 32 nodes each n_racks = n_nodes / structures.MAX_NODES_PER_RACK for i in range(num_experiments): # generate admitted traffic g_p = generator.generate_random_regular_bipartite(n_nodes, 1) admitted = structures.create_admitted_traffic() admitted_copy = structures.create_admitted_traffic() for edge in g_p.edges_iter(): structures.insert_admitted_edge(admitted, edge[0], edge[1] - n_nodes) structures.insert_admitted_edge(admitted_copy, edge[0], edge[1] - n_nodes) # select paths pathselection.select_paths(admitted, n_racks) # check that path assignments are valid self.assertTrue(pathselection.paths_are_valid(admitted, n_racks)) # check that src addrs and lower bits of destination addrs are unchanged for e in range(admitted.size): edge = structures.get_admitted_edge(admitted, e) edge_copy = structures.get_admitted_edge(admitted_copy, e) self.assertEqual(edge.src, edge_copy.src) self.assertEqual(edge.dst & pathselection.PATH_MASK, edge_copy.dst & pathselection.PATH_MASK) # clean up structures.destroy_admitted_traffic(admitted) pass def test_irregular_graph(self): """Tests graphs that are not necessarily regular - some number of sources and destinations have no edges.""" generator = graph_util() num_experiments = 100 n_nodes = 256 # network with 8 racks of 32 nodes each n_racks = n_nodes / structures.MAX_NODES_PER_RACK for i in range(num_experiments): # generate admitted traffic g_p = generator.generate_random_regular_bipartite(n_nodes, 1) # choose a number of edges to remove num_edges_to_remove = random.randint(1, 256) # remove edges for j in range(num_edges_to_remove): while (True): # choose an edge index at random index = random.randint(0, n_nodes - 1) edge = g_p.edges(index) if edge != []: edge_tuple = edge[0] g_p.remove_edge(edge_tuple[0], edge_tuple[1]) break admitted = structures.create_admitted_traffic() admitted_copy = structures.create_admitted_traffic() for edge in g_p.edges_iter(): structures.insert_admitted_edge(admitted, edge[0], edge[1] - n_nodes) structures.insert_admitted_edge(admitted_copy, edge[0], edge[1] - n_nodes) # select paths pathselection.select_paths(admitted, n_racks) # check that path assignments are valid self.assertTrue(pathselection.paths_are_valid(admitted, n_racks)) # check that src addrs and lower bits of destination addrs are unchanged for e in range(admitted.size): edge = structures.get_admitted_edge(admitted, e) edge_copy = structures.get_admitted_edge(admitted_copy, e) self.assertEqual(edge.src, edge_copy.src) self.assertEqual(edge.dst & pathselection.PATH_MASK, edge_copy.dst & pathselection.PATH_MASK) # clean up structures.destroy_admitted_traffic(admitted) pass if __name__ == "__main__": unittest.main()
37.281818
90
0.613509
484
4,101
4.956612
0.239669
0.027511
0.066694
0.051688
0.728637
0.701959
0.701959
0.701959
0.701959
0.701959
0
0.015227
0.311387
4,101
109
91
37.623853
0.834278
0.163862
0
0.625
0
0
0.015639
0.007377
0
0
0
0
0.09375
1
0.03125
false
0.03125
0.09375
0
0.140625
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
e7a9ab8229d01671bcaa878bf8e1d456d4cf245a
73
py
Python
social/pipeline/partial.py
raccoongang/python-social-auth
81c0a542d158772bd3486d31834c10af5d5f08b0
[ "BSD-3-Clause" ]
1,987
2015-01-01T16:12:45.000Z
2022-03-29T14:24:25.000Z
social/pipeline/partial.py
raccoongang/python-social-auth
81c0a542d158772bd3486d31834c10af5d5f08b0
[ "BSD-3-Clause" ]
731
2015-01-01T22:55:25.000Z
2022-03-10T15:07:51.000Z
virtual/lib/python3.6/site-packages/social/pipeline/partial.py
dennismwaniki67/awards
80ed10541f5f751aee5f8285ab1ad54cfecba95f
[ "MIT" ]
1,082
2015-01-01T16:27:26.000Z
2022-03-22T21:18:33.000Z
from social_core.pipeline.partial import save_status_to_session, partial
36.5
72
0.890411
11
73
5.545455
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.068493
73
1
73
73
0.897059
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
99eff6c8829b9ff6b97475129e35549be7e980c7
700
py
Python
Day12/art.py
Abubutt/My100DaysOfCode
d049185547f0101f5b97517399efdbbb3a5c6496
[ "MIT" ]
null
null
null
Day12/art.py
Abubutt/My100DaysOfCode
d049185547f0101f5b97517399efdbbb3a5c6496
[ "MIT" ]
null
null
null
Day12/art.py
Abubutt/My100DaysOfCode
d049185547f0101f5b97517399efdbbb3a5c6496
[ "MIT" ]
null
null
null
logo = """ _ _ _ ____ _____ ____ _____ _ _____ ____ ____ _ _ _____ _____ ____ _ _____ / \ /|/ \ /\/ \__/|/ _ \/ __// __\ / __// \ /\/ __// ___\/ ___\/ \/ \ /|/ __/ / __// _ \/ \__/|/ __/ | |\ ||| | ||| |\/||| | //| \ | \/| | | _| | ||| \ | \| \| || |\ ||| | _ | | _| / \|| |\/||| \ | | \||| \_/|| | ||| |_\\| /_ | / | |_//| \_/|| /_ \___ |\___ || || | \||| |_// | |_//| |-||| | ||| /_ \_/ \|\____/\_/ \|\____/\____\\_/\_\ \____\\____/\____\\____/\____/\_/\_/ \|\____\ \____\\_/ \|\_/ \|\____\ """
77.777778
113
0.224286
1
700
4
1
0
0
0
0
0
0
0
0
0
0
0
0.455714
700
8
114
87.5
0.010499
0
0
0
0
0.571429
0.98
0.051429
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
1
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
821154455e8342cf8f08350dac88cb6979093d5f
92
py
Python
enthought/mayavi/filters/metadata.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/mayavi/filters/metadata.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/mayavi/filters/metadata.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from __future__ import absolute_import from mayavi.filters.metadata import *
23
38
0.836957
12
92
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.119565
92
3
39
30.666667
0.888889
0.130435
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
824066770568ab07e20c47702f44f04c2546b72c
176
py
Python
data_vis/tests.py
jneuendorf/dkb_pdf2csv
836257403054242fe2971fb3e9c0dfd909b2d199
[ "MIT" ]
null
null
null
data_vis/tests.py
jneuendorf/dkb_pdf2csv
836257403054242fe2971fb3e9c0dfd909b2d199
[ "MIT" ]
null
null
null
data_vis/tests.py
jneuendorf/dkb_pdf2csv
836257403054242fe2971fb3e9c0dfd909b2d199
[ "MIT" ]
null
null
null
from django.test import TestCase # Create your tests here. # class ExampleTestCase(TestCase): # # def test_upper(self): # self.assertEqual('foo'.upper(), 'FOO')
17.6
48
0.670455
21
176
5.571429
0.761905
0
0
0
0
0
0
0
0
0
0
0
0.193182
176
9
49
19.555556
0.823944
0.732955
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
41b2c886fdc9f2ffc4472718657a28d9a397bfe3
798
py
Python
record/cd/migrations/0002_auto_20210603_2030.py
Brayton-Han/Brayton-s-Record
67cb6f7b17d8cb2c5f428079afb091f12b015f5c
[ "MIT" ]
null
null
null
record/cd/migrations/0002_auto_20210603_2030.py
Brayton-Han/Brayton-s-Record
67cb6f7b17d8cb2c5f428079afb091f12b015f5c
[ "MIT" ]
null
null
null
record/cd/migrations/0002_auto_20210603_2030.py
Brayton-Han/Brayton-s-Record
67cb6f7b17d8cb2c5f428079afb091f12b015f5c
[ "MIT" ]
null
null
null
# Generated by Django 3.2.3 on 2021-06-03 12:30 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cd', '0001_initial'), ] operations = [ migrations.AlterField( model_name='cd', name='cost', field=models.FloatField(), ), migrations.AlterField( model_name='cd', name='price', field=models.FloatField(), ), migrations.AlterField( model_name='vinyl', name='cost', field=models.FloatField(), ), migrations.AlterField( model_name='vinyl', name='price', field=models.FloatField(), ), ]
23.470588
48
0.487469
67
798
5.731343
0.462687
0.208333
0.260417
0.302083
0.645833
0.565104
0.46875
0.46875
0.46875
0
0
0.039337
0.394737
798
33
49
24.181818
0.755694
0.056391
0
0.740741
1
0
0.064067
0
0
0
0
0
0
1
0
false
0
0.037037
0
0.148148
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
41b3393f5dd1c4462f3b4e54d191975c9014f11b
85
py
Python
sec.py
rikamble/pythonpro
9c1c1be561b9cd9b8f562f52733138bdc3d7a9fa
[ "MIT" ]
1
2019-05-01T08:22:37.000Z
2019-05-01T08:22:37.000Z
sec.py
rikamble/pythonpro
9c1c1be561b9cd9b8f562f52733138bdc3d7a9fa
[ "MIT" ]
1
2019-05-01T16:46:57.000Z
2019-05-01T16:46:57.000Z
sec.py
rikamble/pythonpro
9c1c1be561b9cd9b8f562f52733138bdc3d7a9fa
[ "MIT" ]
null
null
null
print("Enter number") a=input() print("Enter B") b=input() print('enter C') print(c)
12.142857
21
0.658824
15
85
3.733333
0.466667
0.535714
0.535714
0
0
0
0
0
0
0
0
0
0.105882
85
6
22
14.166667
0.736842
0
0
0
0
0
0.305882
0
0
0
0
0
0
1
0
false
0
0
0
0
0.666667
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
68b7c49c9cadc7311f3ab163266476fd80ec8c9b
801
py
Python
Lib/fontParts/fontshell/__init__.py
sanjaymsh/fontParts
dda5b23336d0d04f2ba5ffa371813991de20635d
[ "MIT" ]
66
2019-01-17T13:50:12.000Z
2022-03-19T15:57:43.000Z
Lib/fontParts/fontshell/__init__.py
sanjaymsh/fontParts
dda5b23336d0d04f2ba5ffa371813991de20635d
[ "MIT" ]
311
2016-03-03T19:52:56.000Z
2019-01-15T12:44:59.000Z
Lib/fontParts/fontshell/__init__.py
sanjaymsh/fontParts
dda5b23336d0d04f2ba5ffa371813991de20635d
[ "MIT" ]
28
2019-02-21T01:54:19.000Z
2022-03-10T09:29:48.000Z
from fontParts.base.errors import FontPartsError from fontParts.fontshell.font import RFont from fontParts.fontshell.info import RInfo from fontParts.fontshell.groups import RGroups from fontParts.fontshell.kerning import RKerning from fontParts.fontshell.features import RFeatures from fontParts.fontshell.lib import RLib from fontParts.fontshell.layer import RLayer from fontParts.fontshell.glyph import RGlyph from fontParts.fontshell.contour import RContour from fontParts.fontshell.point import RPoint from fontParts.fontshell.segment import RSegment from fontParts.fontshell.bPoint import RBPoint from fontParts.fontshell.component import RComponent from fontParts.fontshell.anchor import RAnchor from fontParts.fontshell.guideline import RGuideline from fontParts.fontshell.image import RImage
44.5
52
0.872659
102
801
6.852941
0.382353
0.316166
0.503577
0
0
0
0
0
0
0
0
0
0.084894
801
17
53
47.117647
0.953615
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
68f2cc228e870d82a31ea289243abe094754a082
74
py
Python
libs/src/evalib/gradcam/__init__.py
gantir/eva4-2
e95d7f614d21931150d4c0b6b5437c90a742d408
[ "Apache-2.0" ]
null
null
null
libs/src/evalib/gradcam/__init__.py
gantir/eva4-2
e95d7f614d21931150d4c0b6b5437c90a742d408
[ "Apache-2.0" ]
null
null
null
libs/src/evalib/gradcam/__init__.py
gantir/eva4-2
e95d7f614d21931150d4c0b6b5437c90a742d408
[ "Apache-2.0" ]
1
2021-04-10T05:03:53.000Z
2021-04-10T05:03:53.000Z
from . import gradcam from . import utils __all__ = ["gradcam", "utils"]
14.8
30
0.689189
9
74
5.222222
0.555556
0.425532
0
0
0
0
0
0
0
0
0
0
0.175676
74
4
31
18.5
0.770492
0
0
0
0
0
0.162162
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
ec0f2a56854cf4ac0c3aa9892f5e73b4dfc1fd6f
128
py
Python
hm/main.py
owl2/kaggle
f02e1bb12ffed143ef801821d1c9b3e75ad45dab
[ "Unlicense" ]
null
null
null
hm/main.py
owl2/kaggle
f02e1bb12ffed143ef801821d1c9b3e75ad45dab
[ "Unlicense" ]
null
null
null
hm/main.py
owl2/kaggle
f02e1bb12ffed143ef801821d1c9b3e75ad45dab
[ "Unlicense" ]
null
null
null
from preparation.utils import spark_daily_sales df = spark_daily_sales(begin="2018-09-24", end="2020-09-01") print(df.head())
21.333333
60
0.757813
22
128
4.227273
0.772727
0.215054
0.322581
0
0
0
0
0
0
0
0
0.136752
0.085938
128
5
61
25.6
0.65812
0
0
0
0
0
0.15625
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.333333
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
ec26c086690d2319f26d731d9920aedd5489801e
155
py
Python
scrapy/utils/multipart.py
HyunTruth/scrapy
9bc5fab870aaee23905057002276fc0e1a48485f
[ "BSD-3-Clause" ]
32
2019-11-14T07:49:33.000Z
2022-02-16T00:49:22.000Z
scrapy/utils/multipart.py
HyunTruth/scrapy
9bc5fab870aaee23905057002276fc0e1a48485f
[ "BSD-3-Clause" ]
48
2018-11-08T01:31:33.000Z
2019-03-08T01:18:18.000Z
scrapy/utils/multipart.py
HyunTruth/scrapy
9bc5fab870aaee23905057002276fc0e1a48485f
[ "BSD-3-Clause" ]
16
2019-06-25T13:26:43.000Z
2022-03-07T07:29:12.000Z
""" Transitional module for moving to the w3lib library. For new code, always import from w3lib.form instead of this module """ from w3lib.form import *
19.375
66
0.754839
24
155
4.875
0.708333
0.153846
0.222222
0
0
0
0
0
0
0
0
0.023438
0.174194
155
7
67
22.142857
0.890625
0.774194
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ec320917b255dd78d9649c2aceef62b39e47b79e
388
py
Python
Grass.py
KRHS-GameProgramming-2015/Adlez
8912da1ee4b3c7b105851dbcc00579ff0c3cf33e
[ "BSD-2-Clause" ]
null
null
null
Grass.py
KRHS-GameProgramming-2015/Adlez
8912da1ee4b3c7b105851dbcc00579ff0c3cf33e
[ "BSD-2-Clause" ]
4
2016-04-01T15:12:31.000Z
2016-04-18T15:05:29.000Z
Grass.py
KRHS-GameProgramming-2015/Adlez
8912da1ee4b3c7b105851dbcc00579ff0c3cf33e
[ "BSD-2-Clause" ]
null
null
null
from SoftBlock import * class Grass(SoftBlock): def __init__(self, pos=[0,0], blockSize = 25): image = "Block/Block Images/grass.png" SoftBlock.__init__(self, image, pos, blockSize) class BigGrass(SoftBlock): def __init__(self, pos=[0,0], blockSize = 25): image = "Block/Block Images/grass5x5.png" SoftBlock.__init__(self, image, pos, blockSize)
32.333333
55
0.667526
49
388
4.959184
0.367347
0.131687
0.131687
0.164609
0.773663
0.773663
0.773663
0.469136
0.469136
0.469136
0
0.032258
0.201031
388
11
56
35.272727
0.751613
0
0
0.444444
0
0
0.152062
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0
0.555556
0
0
0
0
null
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
ec36b8d62f218dae6f33e34434273fb85e662b88
225
py
Python
08-read files.py
ghost098/LearnPythonTheHardWay
93fd4f116e09d15ecea637a74f8216be135d3af8
[ "MIT" ]
null
null
null
08-read files.py
ghost098/LearnPythonTheHardWay
93fd4f116e09d15ecea637a74f8216be135d3af8
[ "MIT" ]
null
null
null
08-read files.py
ghost098/LearnPythonTheHardWay
93fd4f116e09d15ecea637a74f8216be135d3af8
[ "MIT" ]
null
null
null
from sys import argv script, filename = argv txt = open(filename) print "Here's your file %r: " % filename print txt.read() print "Type the filname again:" filename = raw_input("> ") txt = open(filename) print txt.read()
16.071429
40
0.697778
34
225
4.588235
0.617647
0.25
0.192308
0.25641
0
0
0
0
0
0
0
0
0.173333
225
14
41
16.071429
0.83871
0
0
0.444444
0
0
0.20354
0
0
0
0
0
0
0
null
null
0
0.111111
null
null
0.444444
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
1
0
5
6b5d82e7835eee4277e0b4828006b4b4a9b7535a
91
py
Python
molsysmt/demo_systems/__init__.py
uibcdf/MolSysMT
9866a6fb090df9fff36af113a45164da4b674c09
[ "MIT" ]
3
2020-06-02T03:55:52.000Z
2022-03-21T04:43:52.000Z
molsysmt/demo_systems/__init__.py
uibcdf/MolSysMT
9866a6fb090df9fff36af113a45164da4b674c09
[ "MIT" ]
28
2020-06-24T00:55:53.000Z
2021-07-16T22:09:19.000Z
molsysmt/demo_systems/__init__.py
uibcdf/MolSysMT
9866a6fb090df9fff36af113a45164da4b674c09
[ "MIT" ]
1
2021-06-17T18:55:25.000Z
2021-06-17T18:55:25.000Z
from .files import files from .classes import metenkephalin, pentalanine, pentalanine_traj
30.333333
65
0.846154
11
91
6.909091
0.636364
0
0
0
0
0
0
0
0
0
0
0
0.10989
91
2
66
45.5
0.938272
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
6b65dc7cd40f3862b2a75200df06cd6db593cfbb
152
py
Python
tests/web_platform/CSS2/positioning/test_bottom_applies_to.py
jonboland/colosseum
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
[ "BSD-3-Clause" ]
71
2015-04-13T09:44:14.000Z
2019-03-24T01:03:02.000Z
tests/web_platform/CSS2/positioning/test_bottom_applies_to.py
jonboland/colosseum
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
[ "BSD-3-Clause" ]
35
2019-05-06T15:26:09.000Z
2022-03-28T06:30:33.000Z
tests/web_platform/CSS2/positioning/test_bottom_applies_to.py
jonboland/colosseum
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
[ "BSD-3-Clause" ]
139
2015-05-30T18:37:43.000Z
2019-03-27T17:14:05.000Z
from tests.utils import W3CTestCase class TestBottomAppliesTo(W3CTestCase): vars().update(W3CTestCase.find_tests(__file__, 'bottom-applies-to-'))
25.333333
73
0.789474
17
152
6.764706
0.823529
0
0
0
0
0
0
0
0
0
0
0.021739
0.092105
152
5
74
30.4
0.811594
0
0
0
0
0
0.118421
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
6b6cdb72c0cc6662595b6cd1a85b9ae6f37952ed
111
py
Python
main.py
tgb20/RemoteEV3
2188caab742a915251c58a539a836b28cc6384c5
[ "MIT" ]
null
null
null
main.py
tgb20/RemoteEV3
2188caab742a915251c58a539a836b28cc6384c5
[ "MIT" ]
null
null
null
main.py
tgb20/RemoteEV3
2188caab742a915251c58a539a836b28cc6384c5
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 from ev3dev2.sound import Sound sound = Sound() sound.speak('This is a test project!')
18.5
38
0.72973
18
111
4.5
0.777778
0.37037
0.37037
0
0
0
0
0
0
0
0
0.03125
0.135135
111
5
39
22.2
0.8125
0.189189
0
0
0
0
0.258427
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
6b888081c89dd94fc6bc6d58af5b9d9cadfbe614
36
py
Python
app/__init__.py
smuggy/webapp
4fa62af5788157be171bf457a8e1a9b617057c78
[ "MIT" ]
null
null
null
app/__init__.py
smuggy/webapp
4fa62af5788157be171bf457a8e1a9b617057c78
[ "MIT" ]
1
2021-06-02T00:37:38.000Z
2021-06-02T00:37:38.000Z
app/__init__.py
smuggy/webapp
4fa62af5788157be171bf457a8e1a9b617057c78
[ "MIT" ]
null
null
null
from app.webapp import appcontainer
18
35
0.861111
5
36
6.2
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
1
36
36
0.96875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
6b8ac3ba59afed063eb9cb193d2ce0c3e349cde9
158
py
Python
micromelon/_robot_comms/ble/__init__.py
timmyhadwen/mm-pymodule
da14b5a77bf58fa364274f8722d51e5affe2e7df
[ "MIT" ]
3
2021-04-15T10:02:41.000Z
2021-12-01T00:22:51.000Z
micromelon/_robot_comms/ble/__init__.py
timmyhadwen/mm-pymodule
da14b5a77bf58fa364274f8722d51e5affe2e7df
[ "MIT" ]
1
2021-05-24T02:06:51.000Z
2021-05-24T02:06:51.000Z
micromelon/_robot_comms/ble/__init__.py
timmyhadwen/mm-pymodule
da14b5a77bf58fa364274f8722d51e5affe2e7df
[ "MIT" ]
1
2021-05-21T10:34:12.000Z
2021-05-21T10:34:12.000Z
from ._ble_controller import BleController from ._ble_controller_threadwrapped import BleControllerThread __all__ = ["BleController", "BleControllerThread"]
31.6
62
0.85443
14
158
9
0.571429
0.111111
0.269841
0
0
0
0
0
0
0
0
0
0.082278
158
4
63
39.5
0.868966
0
0
0
0
0
0.202532
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
6bf1b967c34bf9a5818e41f978a8c7350f8eb485
75
py
Python
src/addnn/benchmark/cli.py
MatthiasJReisinger/addnn
1d68648e81faf478cfb1f7d9a3f944a014fa3867
[ "MIT" ]
4
2022-01-25T23:09:24.000Z
2022-03-30T20:57:18.000Z
src/addnn/benchmark/cli.py
MatthiasJReisinger/addnn
1d68648e81faf478cfb1f7d9a3f944a014fa3867
[ "MIT" ]
null
null
null
src/addnn/benchmark/cli.py
MatthiasJReisinger/addnn
1d68648e81faf478cfb1f7d9a3f944a014fa3867
[ "MIT" ]
1
2022-01-25T23:08:50.000Z
2022-01-25T23:08:50.000Z
from addnn.cli import cli @cli.group() def benchmark() -> None: pass
10.714286
25
0.653333
11
75
4.454545
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.213333
75
6
26
12.5
0.830508
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
true
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
1
1
0
0
0
0
0
5
d41018b19f891ff7eca84279a7ede44cafdd960b
91
py
Python
2935.py
dayaelee/baekjoon
cf0e2b8b29dcd759c90f4736f6c26dd1982c72a3
[ "MIT" ]
null
null
null
2935.py
dayaelee/baekjoon
cf0e2b8b29dcd759c90f4736f6c26dd1982c72a3
[ "MIT" ]
null
null
null
2935.py
dayaelee/baekjoon
cf0e2b8b29dcd759c90f4736f6c26dd1982c72a3
[ "MIT" ]
null
null
null
a=int(input()) b=input() c=int(input()) if b=='*': print(a*c) elif b=='+': print(a+c)
10.111111
14
0.505495
18
91
2.555556
0.444444
0.347826
0.304348
0.347826
0
0
0
0
0
0
0
0
0.153846
91
8
15
11.375
0.597403
0
0
0
0
0
0.021978
0
0
0
0
0
0
1
0
false
0
0
0
0
0.285714
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d456f8ff96108b887d8bdf3ca5f7420aac8a6308
222
py
Python
src/suton/toncontrol/mqueue/azureservicebus/core.py
jarig/suton
a946779bdee61f62de28da666ce01dba03ab9128
[ "MIT" ]
4
2020-08-24T21:20:21.000Z
2021-02-20T16:53:11.000Z
src/suton/toncontrol/mqueue/azureservicebus/core.py
jarig/suton
a946779bdee61f62de28da666ce01dba03ab9128
[ "MIT" ]
null
null
null
src/suton/toncontrol/mqueue/azureservicebus/core.py
jarig/suton
a946779bdee61f62de28da666ce01dba03ab9128
[ "MIT" ]
null
null
null
from mqueue.interfaces.tonqueue import TonControllQueueAbstract class ServiceBusQueueProvider(TonControllQueueAbstract): pass class QueueProvider(ServiceBusQueueProvider): # entry-point for TonControl pass
20.181818
63
0.81982
18
222
10.111111
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.135135
222
10
64
22.2
0.947917
0.117117
0
0.4
0
0
0
0
0
0
0
0
0
1
0
true
0.4
0.2
0
0.6
0
1
0
1
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
0
0
1
0
0
5
d4640b28d50ba8805cb61d807a2811da66ef8c84
78
py
Python
Python-3/multiprocessing_examples/multiprocessing_cpu_count.py
ghiloufibelgacem/jornaldev
b9b27f9f7da595892520314b4ed1d2675556310a
[ "MIT" ]
1,139
2018-05-09T11:54:36.000Z
2022-03-31T06:52:50.000Z
Python-3/multiprocessing_examples/multiprocessing_cpu_count.py
ghiloufibelgacem/jornaldev
b9b27f9f7da595892520314b4ed1d2675556310a
[ "MIT" ]
56
2018-06-20T03:52:53.000Z
2022-02-09T22:57:41.000Z
Python-3/multiprocessing_examples/multiprocessing_cpu_count.py
ghiloufibelgacem/jornaldev
b9b27f9f7da595892520314b4ed1d2675556310a
[ "MIT" ]
2,058
2018-05-09T09:32:17.000Z
2022-03-29T13:19:42.000Z
import multiprocessing print("Number of cpu : ", multiprocessing.cpu_count())
26
54
0.782051
9
78
6.666667
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.102564
78
3
54
26
0.857143
0
0
0
0
0
0.202532
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
d47953986653c2e087bc786b9ba5bc7fcf307651
3,445
py
Python
contacts-api/Errors/errors.py
GibranHL0/contacts-api
dfb81cc08ed5a9cc7cd45c1d1b663dbeacfb1d25
[ "MIT" ]
null
null
null
contacts-api/Errors/errors.py
GibranHL0/contacts-api
dfb81cc08ed5a9cc7cd45c1d1b663dbeacfb1d25
[ "MIT" ]
null
null
null
contacts-api/Errors/errors.py
GibranHL0/contacts-api
dfb81cc08ed5a9cc7cd45c1d1b663dbeacfb1d25
[ "MIT" ]
1
2021-08-23T17:46:44.000Z
2021-08-23T17:46:44.000Z
"""Define contact-api defined exceptions.""" from abc import ABC from http import HTTPStatus class Error(ABC, Exception): """Base error class raised when a custom error happened.""" def __init__( self, message='', code=HTTPStatus.INTERNAL_SERVER_ERROR, ) -> None: """ Initialize the exception. Args: message: Explanation of the error. code: HTTP code error. """ self.msg = message self.code = code super().__init__(self.msg) class EmailNotValid(Error): """Exception raised when the email is not valid.""" def __init__( self, message='Email is not valid', code=HTTPStatus.PARTIAL_CONTENT, ) -> None: """ Inititalize the exception. Args: message: Explanation of the error. code: HTTP code error. """ self.msg = message self.code = code super().__init__(self.msg, self.code) class EmailNotFound(Error): """Exception raised when the email is not found in the DB.""" def __init__( self, message='Email not found', code=HTTPStatus.PARTIAL_CONTENT, ) -> None: """ Inititalize the exception. Args: message: Explanation of the error. code: HTTP code error. """ self.msg = message self.code = code super().__init__(self.msg, self.code) class EmailAlreadyExists(Error): """Exception raised when the email is already in the Contacts list.""" def __init__( self, message='Email already exists', code=HTTPStatus.PARTIAL_CONTENT, ) -> None: """ Initialize the exception. Args: message: Explation of the error. code: HTTP error code. """ self.msg = message self.code = code super().__init__(self.msg, self.code) class NameNotValid(Error): """Exception raised when the name is not in the appropiate format.""" def __init__( self, message='Name is not valid', code=HTTPStatus.PARTIAL_CONTENT, ) -> None: """ Initialize the exception. Args: message: Explanation of the error. code: HTTP error code. """ self.msg = message self.code = code super().__init__(self.msg, self.code) class LastNameNotValid(Error): """Exception raised when the last name is not in the appropiate format.""" def __init__( self, message='Last name is not valid', code=HTTPStatus.PARTIAL_CONTENT, ) -> None: """ Initialize the exception. Args: message: Explanation of the error. code: HTTP error code. """ self.msg = message self.code = code super().__init__(self.msg, self.code) class InternalError(Error): """Exception raised when something unexpected happened.""" def __init__( self, message='Something wrong happened', code=HTTPStatus.INTERNAL_SERVER_ERROR, ) -> None: """ Initialize the exception. Args: message: Explanation of the error. code: HTTP error code. """ self.msg = message self.code = code super().__init__(self.msg, self.code)
22.966667
78
0.561974
363
3,445
5.15427
0.170799
0.059861
0.041154
0.067344
0.804917
0.711384
0.711384
0.693212
0.648316
0.648316
0
0
0.340493
3,445
149
79
23.120805
0.823504
0.330334
0
0.738462
0
0
0.059886
0
0
0
0
0
0
1
0.107692
false
0
0.030769
0
0.246154
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2e0a0f07cb94391a1874202ddac98cbd9bbd0e56
637
py
Python
components/studio/controller/tasks.py
aitmlouk/stackn
c8029394a15b03796a4864938f9db251b65c7354
[ "Apache-2.0" ]
25
2020-05-08T22:24:54.000Z
2022-03-11T18:16:58.000Z
components/studio/controller/tasks.py
aitmlouk/stackn
c8029394a15b03796a4864938f9db251b65c7354
[ "Apache-2.0" ]
75
2020-05-08T22:15:59.000Z
2021-11-22T10:00:04.000Z
components/studio/controller/tasks.py
aitmlouk/stackn
c8029394a15b03796a4864938f9db251b65c7354
[ "Apache-2.0" ]
12
2020-11-04T13:09:46.000Z
2022-03-14T16:22:40.000Z
from registrar.celery import app def on_alliance_save_spawn_aggregator(): pass def on_alliance_delete_destroy_aggregator(): pass def on_model_save_notify_aggregator(): pass def on_member_save_notify_aggregator(): pass def on_endpoint_save_notify_aggregator(): pass def member_request_contribution(): pass def member_request_validation(): pass from registrar.celery import app #TODO remove? @app.task def train_remote(node_id): import subprocess import os cmd = "python3 train.py" args = "--node-id={}".format(node_id) cwd = os.cwd() subprocess.run(cmd, args, cwd=cwd)
14.813953
44
0.723705
87
637
4.988506
0.425287
0.096774
0.195853
0.175115
0.324885
0.133641
0
0
0
0
0
0.001934
0.188383
637
42
45
15.166667
0.837524
0.018838
0
0.375
0
0
0.044872
0
0
0
0
0.02381
0
1
0.333333
false
0.291667
0.166667
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
1
0
0
1
0
1
0
0
0
0
0
5
2e3e2f73c069e240f4a688b1f94825ffba31b88a
160
py
Python
leap/leap.py
vietanhtran2710/python-exercism
1f88dfca56928276ab81a274e8259ce465a2d425
[ "MIT" ]
null
null
null
leap/leap.py
vietanhtran2710/python-exercism
1f88dfca56928276ab81a274e8259ce465a2d425
[ "MIT" ]
null
null
null
leap/leap.py
vietanhtran2710/python-exercism
1f88dfca56928276ab81a274e8259ce465a2d425
[ "MIT" ]
null
null
null
""" Leap year exercise """ from calendar import isleap def leap_year(year): """ Check if a year is a leap year """ return isleap(year)
14.545455
38
0.59375
22
160
4.272727
0.590909
0.255319
0
0
0
0
0
0
0
0
0
0
0.3
160
10
39
16
0.839286
0.30625
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
1
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
1
0
0
1
0
1
0
0
5
2e747880330e004a3dd94874a2544f68d7a4626c
231
py
Python
wandb/xgboost/__init__.py
borisgrafx/client
c079f7816947a3092b500751eb920fda3866985f
[ "MIT" ]
null
null
null
wandb/xgboost/__init__.py
borisgrafx/client
c079f7816947a3092b500751eb920fda3866985f
[ "MIT" ]
1
2021-11-15T10:15:16.000Z
2021-11-17T10:01:59.000Z
wandb/xgboost/__init__.py
borisgrafx/client
c079f7816947a3092b500751eb920fda3866985f
[ "MIT" ]
1
2022-01-03T16:19:52.000Z
2022-01-03T16:19:52.000Z
""" Compatibility xgboost module. In the future use: from wandb.integration.xgboost import wandb_callback """ from wandb.integration.xgboost import wandb_callback, WandbCallback __all__ = ["wandb_callback", "WandbCallback"]
21
67
0.78355
26
231
6.692308
0.538462
0.224138
0.229885
0.310345
0.528736
0.528736
0.528736
0
0
0
0
0
0.125541
231
10
68
23.1
0.861386
0.458874
0
0
0
0
0.230769
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
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
1
0
0
0
0
5
cf22cadee1d3a97a68dff68d5dbef591542aa8e9
1,844
py
Python
pyoop/5/1.py
yc19890920/Learn
3990e75b469225ba7b430539ef9a16abe89eb863
[ "Apache-2.0" ]
1
2021-01-11T06:30:44.000Z
2021-01-11T06:30:44.000Z
pyoop/5/1.py
yc19890920/Learn
3990e75b469225ba7b430539ef9a16abe89eb863
[ "Apache-2.0" ]
23
2020-02-12T02:35:49.000Z
2022-02-11T03:45:40.000Z
pyoop/5/1.py
yc19890920/Learn
3990e75b469225ba7b430539ef9a16abe89eb863
[ "Apache-2.0" ]
2
2020-04-08T15:39:46.000Z
2020-10-10T10:13:09.000Z
import collections.abc class Power(collections.abc.Callable): def __call__(self, x, n): if n==0: return 1 elif n%2==1: return self.__call__(x, n-1)*x else: t = self.__call__(x, n//2) return t*t # p = Power() class Power2(collections.abc.Callable): _caches = {} def __call__(self, x, n): if (x, n) not in self._caches: if n==0: self._caches[x,n] = 1 elif n%2==1: self._caches[x,n] = self.__call__(x, n-1)*x else: t = self.__call__(x, n//2) self._caches[x,n] = t*t return self._caches[x,n] # p = Power2() # print(p(5,20)) from functools import lru_cache @lru_cache(maxsize=128) def power(x, n): if n==0: return 1 elif n%2==1: return power(x, n-1)*x else: t = power(x, n//2) return t*t # print(power(5,20)) import timeit it1 = timeit.timeit("power(2, 128)", """ from functools import lru_cache @lru_cache(maxsize=5) def power(x, n): if n==0: return 1 elif n%2==1: return power(x, n-1)*x else: t = power(x, n//2) return t*t """, number=1000000) it2 = timeit.timeit("p(2, 1024)", """ import collections.abc class Power2(collections.abc.Callable): _caches = {} def __call__(self, x, n): if (x, n) not in self._caches: if n==0: self._caches[x,n] = 1 elif n%2==1: self._caches[x,n] = self.__call__(x, n-1)*x else: t = self.__call__(x, n//2) self._caches[x,n] = t*t return self._caches[x,n] p = Power2() """, number=1000000) print(it1, it2)
21.952381
60
0.47885
267
1,844
3.11236
0.146067
0.060168
0.105897
0.115523
0.761733
0.761733
0.738869
0.738869
0.637786
0.637786
0
0.061578
0.374729
1,844
83
61
22.216867
0.65915
0.031453
0
0.854839
0
0
0.39646
0.031858
0
0
0
0
0
1
0.048387
false
0
0.080645
0
0.354839
0.016129
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
cf2b1f36ecbcac575e62a40f4338e775bd2fa34b
333
py
Python
ib_tws_server/codegen/__init__.py
ncpenke/ib_wrapper_py
62af6170dcf80a1491e0f6a1bef3f98e62da5d79
[ "MIT" ]
1
2022-03-06T19:24:13.000Z
2022-03-06T19:24:13.000Z
ib_tws_server/codegen/__init__.py
ncpenke/ib_wrapper_py
62af6170dcf80a1491e0f6a1bef3f98e62da5d79
[ "MIT" ]
null
null
null
ib_tws_server/codegen/__init__.py
ncpenke/ib_wrapper_py
62af6170dcf80a1491e0f6a1bef3f98e62da5d79
[ "MIT" ]
3
2021-07-30T10:49:16.000Z
2021-08-29T06:20:43.000Z
from ib_tws_server.codegen.asyncio_client_generator import AsyncioClientGenerator from ib_tws_server.codegen.response_types_generator import ResponseTypesGenerator from ib_tws_server.codegen.graphql_schema_generator import GraphQLSchemaGenerator from ib_tws_server.codegen.graphql_resolver_generator import GraphQLResolverGenerator
55.5
85
0.924925
40
333
7.3
0.45
0.082192
0.123288
0.205479
0.349315
0.19863
0
0
0
0
0
0
0.051051
333
5
86
66.6
0.924051
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
cf564632cf94ebcff92bafed9e4769f7b8290f38
331
py
Python
api/barriers/serializers/__init__.py
uktrade/market-access-api
850a59880f8f62263784bcd9c6b3362e447dbc7a
[ "MIT" ]
null
null
null
api/barriers/serializers/__init__.py
uktrade/market-access-api
850a59880f8f62263784bcd9c6b3362e447dbc7a
[ "MIT" ]
51
2018-05-31T12:16:31.000Z
2022-03-08T09:36:48.000Z
api/barriers/serializers/__init__.py
uktrade/market-access-api
850a59880f8f62263784bcd9c6b3362e447dbc7a
[ "MIT" ]
2
2019-12-24T09:47:42.000Z
2021-02-09T09:36:51.000Z
from .barriers import BarrierDetailSerializer, BarrierListSerializer # noqa from .csv import BarrierCsvExportSerializer # noqa from .data_workspace import DataWorkspaceSerializer # noqa from .public_barriers import PublicBarrierSerializer, PublishedVersionSerializer # noqa from .reports import BarrierReportSerializer # noqa
55.166667
88
0.851964
29
331
9.655172
0.551724
0.114286
0
0
0
0
0
0
0
0
0
0
0.111782
331
5
89
66.2
0.952381
0.072508
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
cf688d74d5a82b61eead435f24493b41776d696f
54
py
Python
boilerplate/app/controllers/__init__.py
davideasaf/effortless_rest_flask
ee96069614aa670837152db36616b847f1cb5f73
[ "MIT" ]
6
2019-10-31T17:10:06.000Z
2020-07-01T15:18:46.000Z
boilerplate/app/controllers/__init__.py
davideasaf/effortless_rest_flask
ee96069614aa670837152db36616b847f1cb5f73
[ "MIT" ]
1
2019-11-07T20:31:27.000Z
2019-11-07T20:31:27.000Z
boilerplate/app/controllers/__init__.py
pydatacharlotte/effortless_rest_flask
4691d2ffda3f4eebae2ba1f089fdce087750c984
[ "MIT" ]
2
2019-11-07T20:26:02.000Z
2019-12-09T01:29:32.000Z
from .user import user_api from .iris import iris_api
18
26
0.814815
10
54
4.2
0.5
0
0
0
0
0
0
0
0
0
0
0
0.148148
54
2
27
27
0.913043
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
cf6b1988b6da793372876436ca4e213715d3d6c8
1,939
py
Python
fullwavepy/__init__.py
kmch/FullwavePy
3c704b9b6ae2c6c585adb61e57991caf30ab240e
[ "MIT" ]
2
2020-12-24T01:02:16.000Z
2021-02-17T10:00:58.000Z
fullwavepy/__init__.py
kmch/FullwavePy
3c704b9b6ae2c6c585adb61e57991caf30ab240e
[ "MIT" ]
null
null
null
fullwavepy/__init__.py
kmch/FullwavePy
3c704b9b6ae2c6c585adb61e57991caf30ab240e
[ "MIT" ]
null
null
null
import numpy as np # import pandas as pd # pd.set_option('display.max_columns', 50) import matplotlib.pyplot as plt # from matplotlib.gridspec import GridSpec # from mpl_toolkits.mplot3d import Axes3D # import cmocean.cm as cm # import plotly.express as px # import plotly.graph_objects as go # from ipywidgets import (interactive, interact, interact_manual, fixed, # IntSlider, FloatSlider, BoundedIntText, Dropdown, # SelectMultiple, Checkbox, # Layout, TwoByTwoLayout) # from fullwavepy.config.logging import * # from fullwavepy.dsp.su import su_filter # from fullwavepy.generic.system import * # from fullwavepy.generic.parse import * # from fullwavepy.numeric.generic import * # from fullwavepy.numeric.funcs import * # from fullwavepy.ioapi.generic import save_txt, read_txt, read_any # from fullwavepy.ioapi.fw3d import TtrFile, VtrFile, read_vtr, save_vtr from fullwavepy.ioapi.memmap import read_mmp, save_mmp # from fullwavepy.ioapi.segy import SgyFile # from fullwavepy.ioapi.su import * # from fullwavepy.ndat.arrays import * # from fullwavepy.ndat.manifs import * # from fullwavepy.ndat.points import * # from fullwavepy.plot.generic import * # from fullwavepy.plot.plt1d import * # from fullwavepy.plot.plt2d import * # from fullwavepy.plot.plt3d import * # from fullwavepy.plot.misc import time_freq from fullwavepy.project.types.basic import * # from fullwavepy.project.types.deriv import * # from fullwavepy.project.types.extra import * from fullwavepy.seismic.data import Dat, DataSet from fullwavepy.seismic.proteus import PROTEUS # from fullwavepy.seismic.metadata import * from fullwavepy.seismic.misc import BoxFactory, Box3d from fullwavepy.seismic.models import * # from fullwavepy.seismic.srcrec import * # from fullwavepy.seismic.wavefields import * # from fullwavepy.seismic.wavelets import * from fullwavepy.utils import *
32.316667
76
0.76328
246
1,939
5.95935
0.386179
0.296044
0.286494
0.081855
0.043656
0
0
0
0
0
0
0.005505
0.156782
1,939
59
77
32.864407
0.891132
0.763796
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
cf7e571c28038496a4a821ecfae55d47ec102baf
408
py
Python
src/Diagnostics.AIProjects/SearchAPI/SearchModule/Exceptions.py
hannaatmsft/Azure-AppServices-Diagnostics
d5dc281219bdd56e6c832b927e961ddbd1a1469f
[ "MIT" ]
41
2018-03-21T01:58:38.000Z
2022-03-17T01:16:30.000Z
src/Diagnostics.AIProjects/SearchAPI/SearchModule/Exceptions.py
hannaatmsft/Azure-AppServices-Diagnostics
d5dc281219bdd56e6c832b927e961ddbd1a1469f
[ "MIT" ]
138
2018-03-21T16:52:32.000Z
2022-03-21T18:36:18.000Z
src/Diagnostics.AIProjects/SearchAPI/SearchModule/Exceptions.py
hannaatmsft/Azure-AppServices-Diagnostics
d5dc281219bdd56e6c832b927e961ddbd1a1469f
[ "MIT" ]
35
2018-07-26T23:35:52.000Z
2022-03-14T19:44:04.000Z
class ModelDownloadFailed(Exception): pass class ModelFileConfigFailed(Exception): pass class ModelFileVerificationFailed(Exception): pass class ModelFileLoadFailed(Exception): pass class ResourceConfigDownloadFailed(Exception): pass class ModelRefreshException(Exception): pass class CopySourceFolderNotFoundException(Exception): pass class CopyTaskException(Exception): pass
25.5
51
0.806373
32
408
10.28125
0.34375
0.316109
0.382979
0
0
0
0
0
0
0
0
0
0.134804
408
16
52
25.5
0.932011
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
1
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
d886241ffa64152533038b7fc80f0249a3a9cb54
21
py
Python
rbql_core/rbql/__init__.py
neilsustc/vscode_rainbow_csv
025db053200355f33f2dc57d757f7033840c5d73
[ "MIT" ]
2
2020-04-28T07:50:54.000Z
2021-01-23T00:56:14.000Z
rbql_core/rbql/__init__.py
neilsustc/vscode_rainbow_csv
025db053200355f33f2dc57d757f7033840c5d73
[ "MIT" ]
null
null
null
rbql_core/rbql/__init__.py
neilsustc/vscode_rainbow_csv
025db053200355f33f2dc57d757f7033840c5d73
[ "MIT" ]
null
null
null
from .rbql import *
7
19
0.666667
3
21
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.238095
21
2
20
10.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
d8962a845d6e664181f64cbb879f7445de722438
51
py
Python
quantum_computer_simulator/helpers/Exceptions.py
johnyob/Quantum-Computer-Simulator
9dfe219f855da61ac21ca27db1b10385b77f235e
[ "MIT" ]
2
2019-05-26T15:26:33.000Z
2021-03-19T02:37:49.000Z
quantum_computer_simulator/helpers/Exceptions.py
johnyob/Quantum-Computer-Simulator
9dfe219f855da61ac21ca27db1b10385b77f235e
[ "MIT" ]
null
null
null
quantum_computer_simulator/helpers/Exceptions.py
johnyob/Quantum-Computer-Simulator
9dfe219f855da61ac21ca27db1b10385b77f235e
[ "MIT" ]
null
null
null
class QuantumRegisterException(Exception): pass
25.5
42
0.823529
4
51
10.5
1
0
0
0
0
0
0
0
0
0
0
0
0.117647
51
2
43
25.5
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
d8a603012281743973b71f72151f716cf5ce7a2b
115
py
Python
mastering/log/__init__.py
julian-medve/Audio-Mastering
5c79118902db5d2f2053f0d1f3b740fc4cf708b6
[ "Apache-2.0" ]
null
null
null
mastering/log/__init__.py
julian-medve/Audio-Mastering
5c79118902db5d2f2053f0d1f3b740fc4cf708b6
[ "Apache-2.0" ]
null
null
null
mastering/log/__init__.py
julian-medve/Audio-Mastering
5c79118902db5d2f2053f0d1f3b740fc4cf708b6
[ "Apache-2.0" ]
null
null
null
from .codes import Code from .handlers import warning, info, debug, debug_line from .exceptions import ModuleError
28.75
54
0.817391
16
115
5.8125
0.6875
0
0
0
0
0
0
0
0
0
0
0
0.130435
115
3
55
38.333333
0.93
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d8b4a65e3f6a3ca74a0f4ac63b0823e5344e70b7
92
py
Python
dates.py
abkumarggn/python-learning-1
df45396cd14f5762053728760953b3806d0069b6
[ "Apache-2.0" ]
null
null
null
dates.py
abkumarggn/python-learning-1
df45396cd14f5762053728760953b3806d0069b6
[ "Apache-2.0" ]
null
null
null
dates.py
abkumarggn/python-learning-1
df45396cd14f5762053728760953b3806d0069b6
[ "Apache-2.0" ]
null
null
null
import datetime print (datetime.date.today().strftime("%w-%d-%m-%Y-Day:%A")) print("Hello")
23
60
0.673913
15
92
4.133333
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.054348
92
4
61
23
0.712644
0
0
0
0
0
0.247312
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.666667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
2b05a6b2295bc8dbe8281ed6deccbed1eb4f1cf7
252
py
Python
ibmcli/tests/func/test_cli.py
powellquiring/pycli
ecc5beec84833b978dfa41259ab3ac306617fc55
[ "Apache-2.0" ]
null
null
null
ibmcli/tests/func/test_cli.py
powellquiring/pycli
ecc5beec84833b978dfa41259ab3ac306617fc55
[ "Apache-2.0" ]
2
2021-04-06T18:19:56.000Z
2021-06-02T03:28:55.000Z
ibmcli/tests/func/test_cli.py
powellquiring/pycli
ecc5beec84833b978dfa41259ab3ac306617fc55
[ "Apache-2.0" ]
null
null
null
import ibmcli def test_cli(): #ibmcli.uninstall_plugins(True) # dryrun True #ibmcli.log_help_commands(True, 'cs') # dryrun True #ibmcli.sl_vs_cancel() #ibmcli.resource_service_instances_delete() ibmcli.docker_ps_a_delete() pass
28
55
0.730159
34
252
5.058824
0.705882
0.116279
0.186047
0
0
0
0
0
0
0
0
0
0.162698
252
9
56
28
0.815166
0.615079
0
0
0
0
0
0
0
0
0
0
0
1
0.25
true
0.25
0.25
0
0.5
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
1
1
1
0
0
0
0
0
5
2b0f1796babd3ad6b14af9ba6394455470934e60
18
py
Python
app.py
monkeyhjy/HjyOwn
c2d387d701066a5f45e108fd314179c5c54272f7
[ "MIT" ]
null
null
null
app.py
monkeyhjy/HjyOwn
c2d387d701066a5f45e108fd314179c5c54272f7
[ "MIT" ]
null
null
null
app.py
monkeyhjy/HjyOwn
c2d387d701066a5f45e108fd314179c5c54272f7
[ "MIT" ]
null
null
null
# This is app.py.
9
17
0.611111
4
18
2.75
1
0
0
0
0
0
0
0
0
0
0
0
0.222222
18
1
18
18
0.785714
0.833333
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
2b29d0a86dee7fb2c34e11ca1249abd796e4db24
15
py
Python
tap_csv/__init__.py
MeltanoLabs/tap-csv
0994dbe2181071163fd63358961d5877c9b9f0df
[ "Apache-2.0" ]
3
2021-11-02T20:57:30.000Z
2022-03-05T09:36:12.000Z
tap_csv/__init__.py
MeltanoLabs/tap-csv
0994dbe2181071163fd63358961d5877c9b9f0df
[ "Apache-2.0" ]
25
2022-01-24T19:46:51.000Z
2022-03-28T18:18:50.000Z
tap_csv/__init__.py
MeltanoLabs/tap-csv
0994dbe2181071163fd63358961d5877c9b9f0df
[ "Apache-2.0" ]
1
2022-03-07T10:33:34.000Z
2022-03-07T10:33:34.000Z
"""Tap-csv."""
7.5
14
0.4
2
15
3
1
0
0
0
0
0
0
0
0
0
0
0
0.066667
15
1
15
15
0.428571
0.533333
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
2b2aa07cfa78da15b49ac25f23577b3de5e960b6
103
py
Python
pyEX/caching/tests/test_common.py
timkpaine/pyEX-caching
966201687c99cc42d6ecbc31079cf8df44ae3abd
[ "Apache-2.0" ]
8
2020-09-23T15:43:05.000Z
2022-03-09T04:22:03.000Z
pyEX/caching/tests/test_common.py
timkpaine/pyEX-caching
966201687c99cc42d6ecbc31079cf8df44ae3abd
[ "Apache-2.0" ]
10
2019-06-24T16:57:50.000Z
2020-12-29T17:32:20.000Z
pyEX/caching/tests/test_common.py
timkpaine/pyEX-caching
966201687c99cc42d6ecbc31079cf8df44ae3abd
[ "Apache-2.0" ]
1
2019-11-27T17:32:36.000Z
2019-11-27T17:32:36.000Z
# for Coverage from mock import patch, MagicMock class TestAll: def test_all(self): pass
12.875
33
0.679612
14
103
4.928571
1
0
0
0
0
0
0
0
0
0
0
0
0.262136
103
7
34
14.714286
0.907895
0.116505
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
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
1
0
0
1
0
0
5
2b4b22a1c32be4f7cd8ff64c0f9f942a403e3671
117
py
Python
funniest_ieee/joke.py
axel-sirota/IEEE-CICD
3a3e65af4d9c8267b1e4967fe4f372ac1ac8ba87
[ "MIT" ]
null
null
null
funniest_ieee/joke.py
axel-sirota/IEEE-CICD
3a3e65af4d9c8267b1e4967fe4f372ac1ac8ba87
[ "MIT" ]
null
null
null
funniest_ieee/joke.py
axel-sirota/IEEE-CICD
3a3e65af4d9c8267b1e4967fe4f372ac1ac8ba87
[ "MIT" ]
null
null
null
"""Joke module inside funniest""" def joke(): """Funniest joke in the world""" return 'Habia una vez truz'
16.714286
36
0.632479
16
117
4.625
0.8125
0
0
0
0
0
0
0
0
0
0
0
0.222222
117
6
37
19.5
0.813187
0.461538
0
0
0
0
0.346154
0
0
0
0
0
0
1
0.5
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
1
1
0
0
0
1
0
0
5
2b5818dd07599780b3280c497979eaf65926c4f4
6,061
py
Python
silo/benchmarks/results/istc3-7-31-13.py
anshsarkar/TailBench
25845756aee9a892229c25b681051591c94daafd
[ "MIT" ]
274
2015-01-23T16:24:09.000Z
2022-02-22T03:16:14.000Z
silo/benchmarks/results/istc3-7-31-13.py
anshsarkar/TailBench
25845756aee9a892229c25b681051591c94daafd
[ "MIT" ]
3
2015-03-17T11:52:36.000Z
2019-07-22T23:04:25.000Z
silo/benchmarks/results/istc3-7-31-13.py
anshsarkar/TailBench
25845756aee9a892229c25b681051591c94daafd
[ "MIT" ]
94
2015-01-07T06:55:36.000Z
2022-01-22T08:14:15.000Z
RESULTS = [({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 1, 'name': 'scale_tpcc', 'numa_memory': '4G', 'persist': True, 'threads': 1, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(29172.5, 29172.5, 0.0341824, 43.0112, 0.0), (29398.3, 29398.3, 0.0339165, 42.9486, 0.0), (28847.7, 28847.7, 0.0345633, 42.8973, 0.0)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 1, 'name': 'scale_tpcc', 'numa_memory': '4G', 'persist': False, 'threads': 1, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(30468.6, 30468.6, 0.0327431, 0.0, 0.0), (29992.4, 29992.4, 0.0332567, 0.0, 0.0), (31170.2, 31170.2, 0.0320002, 0.0, 0.0)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 4, 'name': 'scale_tpcc', 'numa_memory': '16G', 'persist': True, 'threads': 4, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(103422.0, 103422.0, 0.0385643, 85.2116, 4.06392), (105666.0, 105666.0, 0.0377509, 60.8138, 3.93148), (104045.0, 104045.0, 0.0383381, 69.674, 4.63118)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 4, 'name': 'scale_tpcc', 'numa_memory': '16G', 'persist': False, 'threads': 4, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(113136.0, 113136.0, 0.0352708, 0.0, 4.78329), (114626.0, 114626.0, 0.0348127, 0.0, 4.7333), (114772.0, 114772.0, 0.0347643, 0.0, 5.1833)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 8, 'name': 'scale_tpcc', 'numa_memory': '32G', 'persist': True, 'threads': 8, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(197185.0, 197185.0, 0.0404586, 94.891, 8.41167), (197842.0, 197842.0, 0.0403221, 115.439, 7.94573), (197553.0, 197553.0, 0.0402832, 145.298, 8.4924)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 8, 'name': 'scale_tpcc', 'numa_memory': '32G', 'persist': False, 'threads': 8, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(216956.0, 216956.0, 0.0367886, 0.0, 9.64994), (216944.0, 216944.0, 0.0367856, 0.0, 9.98321), (215150.0, 215150.0, 0.0370956, 0.0, 9.59995)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 12, 'name': 'scale_tpcc', 'numa_memory': '48G', 'persist': True, 'threads': 12, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(296988.0, 296988.0, 0.0402945, 167.935, 12.127), (297616.0, 297616.0, 0.0402009, 213.303, 12.1242), (295502.0, 295502.0, 0.0404885, 258.694, 12.6107)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 12, 'name': 'scale_tpcc', 'numa_memory': '48G', 'persist': False, 'threads': 12, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(316547.0, 316547.0, 0.0377822, 0.0, 13.4998), (321822.0, 321822.0, 0.0371894, 0.0, 13.4833), (318126.0, 318126.0, 0.037625, 0.0, 13.4665)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 16, 'name': 'scale_tpcc', 'numa_memory': '64G', 'persist': True, 'threads': 16, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(391746.0, 391746.0, 0.0407244, 169.879, 16.0217), (386561.0, 386561.0, 0.041277, 181.483, 15.2751), (389939.0, 389939.0, 0.0409258, 162.949, 15.6935)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 16, 'name': 'scale_tpcc', 'numa_memory': '64G', 'persist': False, 'threads': 16, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(423632.0, 423632.0, 0.0376798, 0.0, 18.3165), (425391.0, 425391.0, 0.0375244, 0.0, 18.3499), (422392.0, 422392.0, 0.0377958, 0.0, 17.9999)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 20, 'name': 'scale_tpcc', 'numa_memory': '80G', 'persist': True, 'threads': 20, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(477401.0, 477401.0, 0.0417748, 99.8102, 18.5246), (484175.0, 484175.0, 0.0411903, 195.776, 19.9578), (485011.0, 485011.0, 0.0411185, 265.607, 20.8213)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 20, 'name': 'scale_tpcc', 'numa_memory': '80G', 'persist': False, 'threads': 20, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(536948.0, 536948.0, 0.0371455, 0.0, 22.483), (538513.0, 538513.0, 0.0370509, 0.0, 23.383), (532447.0, 532447.0, 0.0374746, 0.0, 22.3997)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 24, 'name': 'scale_tpcc', 'numa_memory': '96G', 'persist': True, 'threads': 24, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(573385.0, 573385.0, 0.0413281, 431.492, 23.0567), (570228.0, 570228.0, 0.041975, 220.776, 22.7373), (573395.0, 573395.0, 0.0417394, 145.422, 23.4863)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 24, 'name': 'scale_tpcc', 'numa_memory': '96G', 'persist': False, 'threads': 24, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(632495.0, 632495.0, 0.0378555, 0.0, 27.383), (638658.0, 638658.0, 0.0374896, 0.0, 26.983), (631381.0, 631381.0, 0.0379224, 0.0, 26.5997)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 28, 'name': 'scale_tpcc', 'numa_memory': '112G', 'persist': True, 'threads': 28, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(644206.0, 644206.0, 0.0427002, 1196.09, 26.5088), (635368.0, 635368.0, 0.0431587, 940.665, 26.4838), (645459.0, 645459.0, 0.0421841, 1584.15, 25.8248)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 28, 'name': 'scale_tpcc', 'numa_memory': '112G', 'persist': False, 'threads': 28, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(728954.0, 728954.0, 0.0383087, 0.0, 31.2495), (730546.0, 730546.0, 0.0382386, 0.0, 30.0829), (731333.0, 731333.0, 0.0381883, 0.0, 32.0495)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 32, 'name': 'scale_tpcc', 'numa_memory': '128G', 'persist': True, 'threads': 32, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(681638.0, 681638.0, 0.0464162, 935.341, 28.1929), (683559.0, 683559.0, 0.0464315, 731.81, 29.2552), (678029.0, 678029.0, 0.0468788, 612.582, 27.1238)]), ({'par_load': False, 'bench_opts': '', 'retry': False, 'scale_factor': 32, 'name': 'scale_tpcc', 'numa_memory': '128G', 'persist': False, 'threads': 32, 'db': 'ndb-proto2', 'bench': 'tpcc'}, [(799321.0, 799321.0, 0.0399277, 0.0, 34.0809), (799648.0, 799648.0, 0.0399073, 0.0, 35.415), (803230.0, 803230.0, 0.0397377, 0.0, 34.6826)])]
3,030.5
6,060
0.619205
991
6,061
3.696266
0.264379
0.045864
0.058968
0.083538
0.519247
0.519247
0.519247
0.378378
0.378378
0.378378
0
0.330263
0.104273
6,061
1
6,061
6,061
0.344446
0
0
0
0
0
0.291371
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2b79923752433d3b8c359916f39a4d19417fba80
621
py
Python
Projects/PlantMaker/archive/20100516/src/schedule.py
fredmorcos/attic
0da3b94aa525df59ddc977c32cb71c243ffd0dbd
[ "Unlicense" ]
2
2021-01-24T09:00:51.000Z
2022-01-23T20:52:17.000Z
Projects/PlantMaker/archive/20100516/src/schedule.py
fredmorcos/attic
0da3b94aa525df59ddc977c32cb71c243ffd0dbd
[ "Unlicense" ]
6
2020-02-29T01:59:03.000Z
2022-02-15T10:25:40.000Z
Projects/PlantMaker/archive/20100516/src/schedule.py
fredmorcos/attic
0da3b94aa525df59ddc977c32cb71c243ffd0dbd
[ "Unlicense" ]
1
2019-03-22T14:41:21.000Z
2019-03-22T14:41:21.000Z
class Schedule(object): def __init__(self): self.schedule = [] self.finishTime = [] self.report = {} self.fitness = None def representation(self): return (self.schedule, self.finishTime) def __repr__(self): return str((self.schedule, self.finishTime)) + str(self.fitness) def sort(self, func): self.schedule.sort(func) def __getitem__(self, key): return self.schedule[key] def __setitem__(self, key, value): self.schedule[key] = value def __eq__(self, s): for i in s.schedule: for j in self.schedule: if i[0] == j[0]: if i[1] != j[1]: return False return True
20.7
66
0.652174
88
621
4.375
0.352273
0.218182
0.124675
0.202597
0
0
0
0
0
0
0
0.008114
0.206119
621
29
67
21.413793
0.772819
0
0
0
0
0
0
0
0
0
0
0
0
1
0.304348
false
0
0
0.130435
0.565217
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
9959898705f0e89b4b0bd4433dbfcbf25d2daf20
53
py
Python
storage/__init__.py
moehrenzahn/worktimer
ab92e8625652d94987c7da8ccdbf29be72bf3612
[ "MIT" ]
3
2018-07-29T20:48:15.000Z
2019-03-29T10:42:19.000Z
storage/__init__.py
moehrenzahn/worktimer
ab92e8625652d94987c7da8ccdbf29be72bf3612
[ "MIT" ]
null
null
null
storage/__init__.py
moehrenzahn/worktimer
ab92e8625652d94987c7da8ccdbf29be72bf3612
[ "MIT" ]
null
null
null
from storage.json import * from storage.yaml import *
26.5
26
0.792453
8
53
5.25
0.625
0.52381
0
0
0
0
0
0
0
0
0
0
0.132075
53
2
27
26.5
0.913043
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
99accd22d07f7a211447c2d236b9c8e8f074dac1
42
py
Python
wsgi.py
vurl/vurl-webapi
77fb7ed95c17355d5e98e5ca5318335a3eb93962
[ "MIT" ]
3
2020-01-30T16:22:58.000Z
2020-02-05T00:53:45.000Z
wsgi.py
vurl/vurl-webapi
77fb7ed95c17355d5e98e5ca5318335a3eb93962
[ "MIT" ]
null
null
null
wsgi.py
vurl/vurl-webapi
77fb7ed95c17355d5e98e5ca5318335a3eb93962
[ "MIT" ]
null
null
null
from vurlwebapi import app app.ready()
7
26
0.738095
6
42
5.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.190476
42
5
27
8.4
0.911765
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
51060fabeaaea50a79715f830eb5e11974a14149
275
py
Python
models/backbones/__init__.py
jhaochenz/spectral_contrastive_learning
ee431bdba9bb62ad00a7e55792213ee37712784c
[ "MIT" ]
null
null
null
models/backbones/__init__.py
jhaochenz/spectral_contrastive_learning
ee431bdba9bb62ad00a7e55792213ee37712784c
[ "MIT" ]
null
null
null
models/backbones/__init__.py
jhaochenz/spectral_contrastive_learning
ee431bdba9bb62ad00a7e55792213ee37712784c
[ "MIT" ]
null
null
null
from .cifar_resnet_1 import resnet18 as resnet18_cifar_variant1 from .cifar_resnet_2 import ResNet18 as resnet18_cifar_variant2 from .cifar_resnet_1_mlp_norelu import resnet18_cifar_variant1_mlp1000_norelu from .resnet_mlp_norelu_3layer import resnet50_mlp8192_norelu_3layer
55
77
0.912727
42
275
5.452381
0.380952
0.117904
0.196507
0.139738
0.253275
0
0
0
0
0
0
0.109804
0.072727
275
4
78
68.75
0.788235
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
5120e77cd6904e2ad60a433ce6bbe8c1bba1a88b
3,407
py
Python
utils/twitter_api.py
kazumasa-kusaba/TwitterCrawler
ef17e907093908448e6137f273c47a03461caa63
[ "MIT" ]
null
null
null
utils/twitter_api.py
kazumasa-kusaba/TwitterCrawler
ef17e907093908448e6137f273c47a03461caa63
[ "MIT" ]
1
2022-02-13T15:49:06.000Z
2022-02-13T15:49:06.000Z
utils/twitter_api.py
kazumasa-kusaba/TwitterCrawler
ef17e907093908448e6137f273c47a03461caa63
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import sys import logging import json import time import datetime from requests_oauthlib import OAuth1Session class TwitterApi(): def __init__(self, access_token, access_token_secret, consumer_key, consumer_secret, logging_level): self.oauth = OAuth1Session(consumer_key, consumer_secret, access_token, access_token_secret) log_handler = logging.StreamHandler(sys.stdout) log_handler.setFormatter(logging.Formatter('[%(asctime)s][%(levelname)s] %(message)s')) self.logger = logging.getLogger(__name__) self.logger.addHandler(log_handler) self.logger.setLevel(logging_level) def retrieve_user_timeline(self, screen_name, count): params = {"screen_name":screen_name, "count":count} response = self.oauth.get("https://api.twitter.com/1.1/statuses/user_timeline.json", params=params) if "X-Rate-Limit-Remaining" in response.headers: rate_limit_remaining = response.headers["X-Rate-Limit-Remaining"] self.logger.debug("rate_limit_remaining: %s" % rate_limit_remaining) wait_sec = int(int(response.headers["X-Rate-Limit-Reset"]) - time.time()) + 10 self.logger.debug("wait_sec: %d" % wait_sec) if rate_limit_remaining == "0": self.logger.warning("twitter api rate-limit error occured. wait %s seconds for rate-limit be lifted. " % wait_sec) time.sleep(wait_sec) if "status" in response.headers: if response.headers["status"] != "200 OK": self.logger.error("status: %s" % response.headers["status"]) return None json_dict = json.loads(response.text) if "errors" in json_dict: for error in json_dict["errors"]: self.logger.critical("message: %s, code: %d" % (error["message"], error["code"])) self.logger.critical("check if the access_token infomartion in config.json is correct") sys.exit(1) return json_dict def retrieve_favorites(self, screen_name, count): params = {"screen_name":screen_name, "count":count} response = self.oauth.get("https://api.twitter.com/1.1/favorites/list.json", params=params) if "X-Rate-Limit-Remaining" in response.headers: rate_limit_remaining = response.headers["X-Rate-Limit-Remaining"] self.logger.debug("rate_limit_remaining: %s" % rate_limit_remaining) wait_sec = int(int(response.headers["X-Rate-Limit-Reset"]) - time.time()) + 10 self.logger.debug("wait_sec: %d" % wait_sec) if rate_limit_remaining == "0": self.logger.warning("twitter api rate-limit error occured. wait %s seconds for rate-limit be lifted. " % wait_sec) time.sleep(wait_sec) if "status" in response.headers: if response.headers["status"] != "200 OK": self.logger.error("status: %s" % response.headers["status"]) return None json_dict = json.loads(response.text) if "errors" in json_dict: for error in json_dict["errors"]: self.logger.critical("message: %s, code: %d" % (error["message"], error["code"])) self.logger.critical("check if the access_token infomartion in config.json is correct") sys.exit(1) return json_dict
46.671233
130
0.638098
428
3,407
4.915888
0.226636
0.076996
0.102662
0.036122
0.769962
0.743346
0.743346
0.743346
0.743346
0.743346
0
0.008077
0.236865
3,407
72
131
47.319444
0.801154
0.006164
0
0.689655
0
0
0.240615
0.046704
0
0
0
0
0
1
0.051724
false
0
0.103448
0
0.241379
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
516897a00f40c69433ae0251d2bfcdd3a824275f
121
py
Python
TRDWLL/settings/__init__.py
trdwll/TRDWLL.com
b4b2bbf3178d42ce8f854518d6d09274c8af8fc4
[ "MIT" ]
1
2020-06-15T19:54:06.000Z
2020-06-15T19:54:06.000Z
TRDWLL/settings/__init__.py
trdwll/TRDWLL.com
b4b2bbf3178d42ce8f854518d6d09274c8af8fc4
[ "MIT" ]
null
null
null
TRDWLL/settings/__init__.py
trdwll/TRDWLL.com
b4b2bbf3178d42ce8f854518d6d09274c8af8fc4
[ "MIT" ]
null
null
null
from TRDWLL.settings.base import * if os.environ['TRDWLL'] == 'prod': from .prod import * else: from .dev import *
20.166667
34
0.661157
17
121
4.705882
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.190083
121
6
35
20.166667
0.816327
0
0
0
0
0
0.081967
0
0
0
0
0
0
1
0
true
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
1
0
1
0
1
0
0
5
5a8f4e1c4de3709059240970c573a20741a029ae
10,227
py
Python
2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/autogen/GrammarLexer.py
danperazzo/compilers-cin
c23dfe637175be8fe3d23312cb8a28f714aabfee
[ "MIT" ]
null
null
null
2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/autogen/GrammarLexer.py
danperazzo/compilers-cin
c23dfe637175be8fe3d23312cb8a28f714aabfee
[ "MIT" ]
null
null
null
2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/autogen/GrammarLexer.py
danperazzo/compilers-cin
c23dfe637175be8fe3d23312cb8a28f714aabfee
[ "MIT" ]
null
null
null
# Generated from antlr4-python3-runtime-4.7.2/src/autogen/Grammar.g4 by ANTLR 4.7.2 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2*") buf.write("\u00fb\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r") buf.write("\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23") buf.write("\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30") buf.write("\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36") buf.write("\t\36\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%") buf.write("\4&\t&\4\'\t\'\4(\t(\4)\t)\3\2\3\2\3\3\3\3\3\4\3\4\3\5") buf.write("\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3") buf.write("\t\3\t\3\n\3\n\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\16") buf.write("\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21") buf.write("\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\26\3\26\3\27") buf.write("\3\27\3\30\3\30\3\30\3\31\3\31\3\31\3\32\3\32\3\32\3\33") buf.write("\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\36\3\36\3\37") buf.write("\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3!\3!\3!\3!\3") buf.write("!\3!\3!\3\"\3\"\3\"\3\"\7\"\u00b6\n\"\f\"\16\"\u00b9\13") buf.write("\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\7#\u00c3\n#\f#\16#\u00c6") buf.write("\13#\3#\3#\3#\3#\3#\3$\3$\7$\u00cf\n$\f$\16$\u00d2\13") buf.write("$\3$\3$\3$\3$\3%\3%\7%\u00da\n%\f%\16%\u00dd\13%\3&\6") buf.write("&\u00e0\n&\r&\16&\u00e1\3\'\6\'\u00e5\n\'\r\'\16\'\u00e6") buf.write("\3\'\3\'\6\'\u00eb\n\'\r\'\16\'\u00ec\3(\3(\7(\u00f1\n") buf.write("(\f(\16(\u00f4\13(\3(\3(\3)\3)\3)\3)\6\u00b7\u00c4\u00d0") buf.write("\u00f2\2*\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25") buf.write("\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+") buf.write("\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E") buf.write("$G%I&K\'M(O)Q*\3\2\6\5\2C\\aac|\6\2\62;C\\aac|\3\2\62") buf.write(";\5\2\13\f\17\17\"\"\2\u0102\2\3\3\2\2\2\2\5\3\2\2\2\2") buf.write("\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3") buf.write("\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2") buf.write("\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2") buf.write("\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2") buf.write("\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63") buf.write("\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2") buf.write("\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2") buf.write("\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3") buf.write("\2\2\2\2Q\3\2\2\2\3S\3\2\2\2\5U\3\2\2\2\7W\3\2\2\2\tY") buf.write("\3\2\2\2\13\\\3\2\2\2\r^\3\2\2\2\17`\3\2\2\2\21e\3\2\2") buf.write("\2\23i\3\2\2\2\25k\3\2\2\2\27m\3\2\2\2\31p\3\2\2\2\33") buf.write("s\3\2\2\2\35v\3\2\2\2\37y\3\2\2\2!|\3\2\2\2#\177\3\2\2") buf.write("\2%\u0081\3\2\2\2\'\u0083\3\2\2\2)\u0085\3\2\2\2+\u0087") buf.write("\3\2\2\2-\u0089\3\2\2\2/\u008b\3\2\2\2\61\u008e\3\2\2") buf.write("\2\63\u0091\3\2\2\2\65\u0094\3\2\2\2\67\u0097\3\2\2\2") buf.write("9\u0099\3\2\2\2;\u009b\3\2\2\2=\u009f\3\2\2\2?\u00a5\3") buf.write("\2\2\2A\u00aa\3\2\2\2C\u00b1\3\2\2\2E\u00be\3\2\2\2G\u00cc") buf.write("\3\2\2\2I\u00d7\3\2\2\2K\u00df\3\2\2\2M\u00e4\3\2\2\2") buf.write("O\u00ee\3\2\2\2Q\u00f7\3\2\2\2ST\7=\2\2T\4\3\2\2\2UV\7") buf.write("}\2\2V\6\3\2\2\2WX\7\177\2\2X\b\3\2\2\2YZ\7k\2\2Z[\7h") buf.write("\2\2[\n\3\2\2\2\\]\7*\2\2]\f\3\2\2\2^_\7+\2\2_\16\3\2") buf.write("\2\2`a\7g\2\2ab\7n\2\2bc\7u\2\2cd\7g\2\2d\20\3\2\2\2e") buf.write("f\7h\2\2fg\7q\2\2gh\7t\2\2h\22\3\2\2\2ij\7?\2\2j\24\3") buf.write("\2\2\2kl\7.\2\2l\26\3\2\2\2mn\7-\2\2no\7?\2\2o\30\3\2") buf.write("\2\2pq\7/\2\2qr\7?\2\2r\32\3\2\2\2st\7,\2\2tu\7?\2\2u") buf.write("\34\3\2\2\2vw\7\61\2\2wx\7?\2\2x\36\3\2\2\2yz\7-\2\2z") buf.write("{\7-\2\2{ \3\2\2\2|}\7/\2\2}~\7/\2\2~\"\3\2\2\2\177\u0080") buf.write("\7/\2\2\u0080$\3\2\2\2\u0081\u0082\7-\2\2\u0082&\3\2\2") buf.write("\2\u0083\u0084\7,\2\2\u0084(\3\2\2\2\u0085\u0086\7\61") buf.write("\2\2\u0086*\3\2\2\2\u0087\u0088\7>\2\2\u0088,\3\2\2\2") buf.write("\u0089\u008a\7@\2\2\u008a.\3\2\2\2\u008b\u008c\7>\2\2") buf.write("\u008c\u008d\7?\2\2\u008d\60\3\2\2\2\u008e\u008f\7@\2") buf.write("\2\u008f\u0090\7?\2\2\u0090\62\3\2\2\2\u0091\u0092\7?") buf.write("\2\2\u0092\u0093\7?\2\2\u0093\64\3\2\2\2\u0094\u0095\7") buf.write("#\2\2\u0095\u0096\7?\2\2\u0096\66\3\2\2\2\u0097\u0098") buf.write("\7]\2\2\u00988\3\2\2\2\u0099\u009a\7_\2\2\u009a:\3\2\2") buf.write("\2\u009b\u009c\7k\2\2\u009c\u009d\7p\2\2\u009d\u009e\7") buf.write("v\2\2\u009e<\3\2\2\2\u009f\u00a0\7h\2\2\u00a0\u00a1\7") buf.write("n\2\2\u00a1\u00a2\7q\2\2\u00a2\u00a3\7c\2\2\u00a3\u00a4") buf.write("\7v\2\2\u00a4>\3\2\2\2\u00a5\u00a6\7x\2\2\u00a6\u00a7") buf.write("\7q\2\2\u00a7\u00a8\7k\2\2\u00a8\u00a9\7f\2\2\u00a9@\3") buf.write("\2\2\2\u00aa\u00ab\7t\2\2\u00ab\u00ac\7g\2\2\u00ac\u00ad") buf.write("\7v\2\2\u00ad\u00ae\7w\2\2\u00ae\u00af\7t\2\2\u00af\u00b0") buf.write("\7p\2\2\u00b0B\3\2\2\2\u00b1\u00b2\7\61\2\2\u00b2\u00b3") buf.write("\7\61\2\2\u00b3\u00b7\3\2\2\2\u00b4\u00b6\13\2\2\2\u00b5") buf.write("\u00b4\3\2\2\2\u00b6\u00b9\3\2\2\2\u00b7\u00b8\3\2\2\2") buf.write("\u00b7\u00b5\3\2\2\2\u00b8\u00ba\3\2\2\2\u00b9\u00b7\3") buf.write("\2\2\2\u00ba\u00bb\7\f\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00bd") buf.write("\b\"\2\2\u00bdD\3\2\2\2\u00be\u00bf\7\61\2\2\u00bf\u00c0") buf.write("\7,\2\2\u00c0\u00c4\3\2\2\2\u00c1\u00c3\13\2\2\2\u00c2") buf.write("\u00c1\3\2\2\2\u00c3\u00c6\3\2\2\2\u00c4\u00c5\3\2\2\2") buf.write("\u00c4\u00c2\3\2\2\2\u00c5\u00c7\3\2\2\2\u00c6\u00c4\3") buf.write("\2\2\2\u00c7\u00c8\7,\2\2\u00c8\u00c9\7\61\2\2\u00c9\u00ca") buf.write("\3\2\2\2\u00ca\u00cb\b#\2\2\u00cbF\3\2\2\2\u00cc\u00d0") buf.write("\7%\2\2\u00cd\u00cf\13\2\2\2\u00ce\u00cd\3\2\2\2\u00cf") buf.write("\u00d2\3\2\2\2\u00d0\u00d1\3\2\2\2\u00d0\u00ce\3\2\2\2") buf.write("\u00d1\u00d3\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d4\7") buf.write("\f\2\2\u00d4\u00d5\3\2\2\2\u00d5\u00d6\b$\2\2\u00d6H\3") buf.write("\2\2\2\u00d7\u00db\t\2\2\2\u00d8\u00da\t\3\2\2\u00d9\u00d8") buf.write("\3\2\2\2\u00da\u00dd\3\2\2\2\u00db\u00d9\3\2\2\2\u00db") buf.write("\u00dc\3\2\2\2\u00dcJ\3\2\2\2\u00dd\u00db\3\2\2\2\u00de") buf.write("\u00e0\t\4\2\2\u00df\u00de\3\2\2\2\u00e0\u00e1\3\2\2\2") buf.write("\u00e1\u00df\3\2\2\2\u00e1\u00e2\3\2\2\2\u00e2L\3\2\2") buf.write("\2\u00e3\u00e5\t\4\2\2\u00e4\u00e3\3\2\2\2\u00e5\u00e6") buf.write("\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7") buf.write("\u00e8\3\2\2\2\u00e8\u00ea\7\60\2\2\u00e9\u00eb\t\4\2") buf.write("\2\u00ea\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec\u00ea") buf.write("\3\2\2\2\u00ec\u00ed\3\2\2\2\u00edN\3\2\2\2\u00ee\u00f2") buf.write("\7$\2\2\u00ef\u00f1\13\2\2\2\u00f0\u00ef\3\2\2\2\u00f1") buf.write("\u00f4\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f2\u00f0\3\2\2\2") buf.write("\u00f3\u00f5\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f5\u00f6\7") buf.write("$\2\2\u00f6P\3\2\2\2\u00f7\u00f8\t\5\2\2\u00f8\u00f9\3") buf.write("\2\2\2\u00f9\u00fa\b)\2\2\u00faR\3\2\2\2\13\2\u00b7\u00c4") buf.write("\u00d0\u00db\u00e1\u00e6\u00ec\u00f2\3\b\2\2") return buf.getvalue() class GrammarLexer(Lexer): atn = ATNDeserializer().deserialize(serializedATN()) decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] T__0 = 1 T__1 = 2 T__2 = 3 T__3 = 4 T__4 = 5 T__5 = 6 T__6 = 7 T__7 = 8 T__8 = 9 T__9 = 10 T__10 = 11 T__11 = 12 T__12 = 13 T__13 = 14 T__14 = 15 T__15 = 16 T__16 = 17 T__17 = 18 T__18 = 19 T__19 = 20 T__20 = 21 T__21 = 22 T__22 = 23 T__23 = 24 T__24 = 25 T__25 = 26 T__26 = 27 T__27 = 28 INT = 29 FLOAT = 30 VOID = 31 RETURN = 32 COMMENT = 33 MULTILINE_COMMENT = 34 DIRECTIVE = 35 IDENTIFIER = 36 INTEGER = 37 FLOATING = 38 STRING = 39 WHITESPACE = 40 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] modeNames = [ "DEFAULT_MODE" ] literalNames = [ "<INVALID>", "';'", "'{'", "'}'", "'if'", "'('", "')'", "'else'", "'for'", "'='", "','", "'+='", "'-='", "'*='", "'/='", "'++'", "'--'", "'-'", "'+'", "'*'", "'/'", "'<'", "'>'", "'<='", "'>='", "'=='", "'!='", "'['", "']'", "'int'", "'float'", "'void'", "'return'" ] symbolicNames = [ "<INVALID>", "INT", "FLOAT", "VOID", "RETURN", "COMMENT", "MULTILINE_COMMENT", "DIRECTIVE", "IDENTIFIER", "INTEGER", "FLOATING", "STRING", "WHITESPACE" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", "T__26", "T__27", "INT", "FLOAT", "VOID", "RETURN", "COMMENT", "MULTILINE_COMMENT", "DIRECTIVE", "IDENTIFIER", "INTEGER", "FLOATING", "STRING", "WHITESPACE" ] grammarFileName = "Grammar.g4" def __init__(self, input=None, output:TextIO = sys.stdout): super().__init__(input, output) self.checkVersion("4.7.2") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None
52.446154
103
0.532805
2,350
10,227
2.262553
0.14766
0.151213
0.09479
0.097047
0.255031
0.163062
0.09291
0.076359
0.066391
0.050592
0
0.310898
0.164662
10,227
194
104
52.716495
0.311483
0.00792
0
0
1
0.409091
0.57326
0.51055
0
0
0
0
0
1
0.011364
false
0
0.022727
0
0.318182
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
1
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5ab131a6cbe1f93b08cd0ceee134b07c3b009b9c
72
py
Python
widgets/MainWindow/__init__.py
ChineseWriter/MiddleSchool
a27525564574b083aff751a3bc16dea08b9eca8b
[ "MIT" ]
null
null
null
widgets/MainWindow/__init__.py
ChineseWriter/MiddleSchool
a27525564574b083aff751a3bc16dea08b9eca8b
[ "MIT" ]
null
null
null
widgets/MainWindow/__init__.py
ChineseWriter/MiddleSchool
a27525564574b083aff751a3bc16dea08b9eca8b
[ "MIT" ]
null
null
null
# coding = UTF-8 from widgets.MainWindow.Controller import MainWindow
14.4
52
0.791667
9
72
6.333333
0.888889
0
0
0
0
0
0
0
0
0
0
0.016129
0.138889
72
4
53
18
0.903226
0.194444
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
85100ed15ec5ed3b243c31ca7227cff2d666a964
106
py
Python
tests/pyutgenerator/data/pattern02.py
shigeshige/py-ut-generator
95faba39418a2ac52f58433c0f980a5e03ac29cf
[ "MIT" ]
2
2021-11-03T09:46:09.000Z
2021-12-28T12:48:58.000Z
tests/pyutgenerator/data/pattern02.py
shigeshige/py-ut-generator
95faba39418a2ac52f58433c0f980a5e03ac29cf
[ "MIT" ]
16
2020-05-01T13:25:56.000Z
2021-11-25T13:24:30.000Z
tests/pyutgenerator/data/pattern02.py
shigeshige/py-ut-generator
95faba39418a2ac52f58433c0f980a5e03ac29cf
[ "MIT" ]
1
2022-01-31T07:44:56.000Z
2022-01-31T07:44:56.000Z
""" test pattern 02 """ def p01(): x = f01(f01(f01)) return x def f01(prm1): return prm1
7.571429
21
0.528302
16
106
3.5
0.5625
0.214286
0
0
0
0
0
0
0
0
0
0.191781
0.311321
106
13
22
8.153846
0.575342
0.141509
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0.2
0.8
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
1
0
0
0
1
1
0
0
5
a400abb0b8a5b39df8d2ef685f74bf0712a0e506
211
py
Python
app/config/wsgi.py
FormatMemory/django_api_backend
690439ad612598c86c22a837bc0f2e5bea74f2d2
[ "MIT" ]
null
null
null
app/config/wsgi.py
FormatMemory/django_api_backend
690439ad612598c86c22a837bc0f2e5bea74f2d2
[ "MIT" ]
8
2021-03-18T23:26:33.000Z
2022-03-11T23:44:22.000Z
app/config/wsgi.py
FormatMemory/django_api_backend
690439ad612598c86c22a837bc0f2e5bea74f2d2
[ "MIT" ]
null
null
null
import os from django.core.wsgi import get_wsgi_application from config.environment import SETTINGS_MODULE os.environ.setdefault("DJANGO_SETTINGS_MODULE", SETTINGS_MODULE) application = get_wsgi_application()
26.375
64
0.85782
28
211
6.178571
0.5
0.242775
0.208092
0
0
0
0
0
0
0
0
0
0.080569
211
7
65
30.142857
0.891753
0
0
0
0
0
0.104265
0.104265
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
cfa7fb2a8417b2a702287f5232fe7df3a4151cdc
227
py
Python
orchestration/dashboard/mpi.py
monkey-H/nap-core
50d23b0431682f276990db04527deae3b6d84661
[ "Apache-2.0" ]
null
null
null
orchestration/dashboard/mpi.py
monkey-H/nap-core
50d23b0431682f276990db04527deae3b6d84661
[ "Apache-2.0" ]
null
null
null
orchestration/dashboard/mpi.py
monkey-H/nap-core
50d23b0431682f276990db04527deae3b6d84661
[ "Apache-2.0" ]
null
null
null
from orchestration import config from orchestration.nap_api import create_from_table def create_mpi(username, password, mpi_name, slaves): args = ['slaves':slaves] create_from_table(username, password, mpi_name, args)
32.428571
57
0.792952
31
227
5.548387
0.483871
0.197674
0.174419
0.267442
0
0
0
0
0
0
0
0
0.127753
227
6
58
37.833333
0.868687
0
0
0
0
0
0.026432
0
0
0
0
0
0
0
null
null
0.4
0.4
null
null
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
1
0
0
1
1
0
0
0
0
5
cfea60984b1153d39b3b7323a0972b9adc017114
9,773
py
Python
tests/sklearn_data/datasets.py
wmonteiro92/xmoai-examples
0286d57e15cb60693f57cdff386cbb246787442b
[ "MIT" ]
1
2021-03-22T11:31:00.000Z
2021-03-22T11:31:00.000Z
tests/sklearn_data/datasets.py
wmonteiro92/xmoai-examples
0286d57e15cb60693f57cdff386cbb246787442b
[ "MIT" ]
null
null
null
tests/sklearn_data/datasets.py
wmonteiro92/xmoai-examples
0286d57e15cb60693f57cdff386cbb246787442b
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Thu Jul 2 21:37:05 2020 @author: wmont """ from sklearn.datasets import load_breast_cancer, load_boston, load_diabetes, \ load_digits, load_iris, load_wine, fetch_california_housing import numpy as np def get_dataset(dataset_name='breast_cancer'): """Retrieve one of the standard datasets in sklearn. :param dataset_name: the dataset name to use from sklearn. Valid values are `breast_cancer`, `digits`, `iris`, `wine` for classification and `boston`, `diabetes` and `california` for regression. Default is `breast_cancer`. :type dataset_name: str :return: Five variables are returned. First is the dataset itself without the target values; second includes the target values; third has all the categorical columns; fourth has all the integer columns and the last informs if it is a classification problem (True) or a regression problem (False). :rtype: np.array, np.array, np.array, np.array, Boolean """ if dataset_name == 'breast_cancer': # loading the dataset X, y = load_breast_cancer(return_X_y=True) # informing categorical columns and their available values categorical_columns = {} integer_columns = [] is_classification = True elif dataset_name == 'digits': # loading the dataset X, y = load_digits(return_X_y=True) # informing categorical columns and their available values categorical_columns = {} integer_columns = list(range(64)) is_classification = True elif dataset_name == 'iris': # loading the dataset X, y = load_iris(return_X_y=True) # informing categorical columns and their available values categorical_columns = {} integer_columns = [] is_classification = True elif dataset_name == 'wine': # loading the dataset X, y = load_wine(return_X_y=True) # informing categorical columns and their available values categorical_columns = {} integer_columns = [4, 12] is_classification = True elif dataset_name == 'boston': X, y = load_boston(return_X_y=True) # informing categorical columns and their available values categorical_columns = {3: [0, 1]} integer_columns = [8, 9] is_classification = False elif dataset_name == 'diabetes': # loading the dataset X, y = load_diabetes(return_X_y=True) # informing categorical columns and their available values categorical_columns = {1: [ 0.05068012, -0.04464164]} integer_columns = [] is_classification = False elif dataset_name == 'california': # loading the dataset X, y = fetch_california_housing(return_X_y=True) # informing categorical columns and their available values categorical_columns = {} integer_columns = [1, 4] is_classification = False return X, y, categorical_columns, integer_columns, is_classification def get_instance_from_dataset(X, index, dataset_name='breast_cancer'): """Retrieve one of the instances from the dataset to generate the counterfactuals. :param X: the input samples. :type X: np.array :param index: the index relative to the sample to be retrieved. :type index: Integer :param dataset_name: the dataset name to use from sklearn. Valid values are `breast_cancer`, `digits`, `iris`, `wine` for classification and `boston`, `diabetes` and `california` for regression. Default is `breast_cancer`. :type dataset_name: str :return: Six variables are returned. First is the instance from the dataset in reference to the index provided; second is the list of columns that cannot be modified; third and fourth are the upper and lower bounds for each variable, respectively; fifth includes the acceptable range to be considered with the desired target; sixth is the desired target (outcome). :rtype: np.array, np.array, np.array, np.array, np.array, Integer """ # get a instance in the i-th row X_current = X[index, :].flatten() if dataset_name == 'breast_cancer': count_class = 2 # define which columns must remain untouched immutable_column_indexes = [] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 1 y_acceptable_range = np.array([1.0/count_class, 1.0]) elif dataset_name == 'boston': # define which columns must remain untouched immutable_column_indexes = [1, 5] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 30 y_acceptable_range = np.array([y_desired * 0.98, y_desired * 1.02]) elif dataset_name == 'diabetes': # define which columns must remain untouched immutable_column_indexes = [1, 4, 5, 6] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 200 y_acceptable_range = np.array([y_desired * 0.95, y_desired * 1.05]) elif dataset_name == 'digits': count_class = 10 # define which columns must remain untouched immutable_column_indexes = [2, 5, 10, 20, 30, 40, 50] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 9 y_acceptable_range = np.array([1.0/count_class, 1.0]) elif dataset_name == 'iris': count_class = 3 # define which columns must remain untouched immutable_column_indexes = [] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 2 y_acceptable_range = np.array([1.0/count_class, 1.0]) elif dataset_name == 'wine': count_class = 3 # define which columns must remain untouched immutable_column_indexes = [7, 8, 9] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 2 y_acceptable_range = np.array([1.0/count_class, 1.0]) elif dataset_name == 'california': # define which columns must remain untouched immutable_column_indexes = [0, 1, 2] # defining how much can we modify the input values upper_bounds = np.max(X, axis=0) lower_bounds = np.min(X, axis=0) # defining what are the tolerable output values y_desired = 1.5 y_acceptable_range = np.array([y_desired * 0.95, y_desired * 1.05]) return X_current, immutable_column_indexes, \ upper_bounds, lower_bounds, y_acceptable_range, y_desired def load_sample_from_dataset(index, dataset_name='breast_cancer'): """Retrieve one of the instances from the dataset to generate the counterfactuals as well as other dataset metadata and multiobjective optimization (MOO) design space info relative to the sample. :param index: the index relative to the sample to be retrieved. :type index: Integer :param dataset_name: the dataset name to use from sklearn. Valid values are `breast_cancer`, `digits`, `iris`, `wine` for classification and `boston`, `diabetes` and `california` for regression. Default is `breast_cancer`. :type dataset_name: str :return: Ten variables are returned. First is the dataset itself without the target values; second includes the target values; third is the instance from the dataset in reference to the index provided; fourth is the desired target (outcome); fifth is the list of columns that cannot be modified; sixth and seventh are the upper and lower bounds for each variable, respectively; eigth includes the acceptable range to be considered with the desired target; ninth has all the categorical columns and tenth has all the integer columns. :rtype: np.array, np.array, np.array, Integer, np.array, np.array, np.array, np.array, np.array, np.array """ # get a dataset X, y, categorical_columns, integer_columns, \ is_classification = get_dataset(dataset_name) # get a instance from the dataset in the i-th row (defined in index) # as well as its predicted output X_current, immutable_column_indexes, upper_bounds, lower_bounds, \ y_acceptable_range, y_desired = get_instance_from_dataset(X, index, dataset_name) return X, y, X_current, y_desired, immutable_column_indexes, \ upper_bounds, lower_bounds, y_acceptable_range, categorical_columns, \ integer_columns
41.587234
90
0.638801
1,264
9,773
4.784019
0.149525
0.050934
0.020837
0.032413
0.827849
0.784356
0.737721
0.731106
0.692575
0.654209
0
0.018841
0.28855
9,773
235
91
41.587234
0.850856
0.46168
0
0.561224
0
0
0.029572
0
0
0
0
0
0
1
0.030612
false
0
0.020408
0
0.081633
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5cca29ceec24e8b5613cc69d9e6612e21966849c
147
py
Python
constants.py
gleybersonandrade/TOA
42482671fda780f18441bb47f1946feabae5ccb8
[ "MIT" ]
null
null
null
constants.py
gleybersonandrade/TOA
42482671fda780f18441bb47f1946feabae5ccb8
[ "MIT" ]
null
null
null
constants.py
gleybersonandrade/TOA
42482671fda780f18441bb47f1946feabae5ccb8
[ "MIT" ]
null
null
null
"""Traffic Occurrence Analyzer constants.""" MAIN_DESC = "Traffic Occurrence Analyzer" METHOD_DESC = "method to be executed (construct, execute)"
29.4
58
0.768707
17
147
6.529412
0.705882
0.306306
0.45045
0
0
0
0
0
0
0
0
0
0.122449
147
4
59
36.75
0.860465
0.258503
0
0
0
0
0.669903
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7a392977f22caa70283b7ea112ea3ad834067e2d
77
py
Python
snippets/python-number-minmax.py
district10/snippet-manager
bebe45a601368947168e3ee6e6ab8c1fc2ee2055
[ "MIT" ]
7
2018-08-04T09:28:19.000Z
2020-10-19T17:46:34.000Z
snippets/python-number-minmax.py
district10/snippet-manager
bebe45a601368947168e3ee6e6ab8c1fc2ee2055
[ "MIT" ]
null
null
null
snippets/python-number-minmax.py
district10/snippet-manager
bebe45a601368947168e3ee6e6ab8c1fc2ee2055
[ "MIT" ]
2
2018-07-31T04:14:55.000Z
2020-04-02T01:22:39.000Z
# min max for python float sys.float_info.max (> 0) sys.float_info.min (> 0)
19.25
26
0.701299
15
77
3.466667
0.533333
0.307692
0.461538
0
0
0
0
0
0
0
0
0.030769
0.155844
77
3
27
25.666667
0.769231
0.311688
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
7a446ae9c0317bb31bf7eb0af37453002ecf04f6
160
py
Python
Escolas/Curso em Video/Back-End/Curso de Python/Mundos/Mundo 01/Exercicio_21.py
c4st1lh0/Projetos-de-Aula
e8abc9f4bce6cc8dbc6d7fb5da0f549ac8ef5302
[ "MIT" ]
null
null
null
Escolas/Curso em Video/Back-End/Curso de Python/Mundos/Mundo 01/Exercicio_21.py
c4st1lh0/Projetos-de-Aula
e8abc9f4bce6cc8dbc6d7fb5da0f549ac8ef5302
[ "MIT" ]
null
null
null
Escolas/Curso em Video/Back-End/Curso de Python/Mundos/Mundo 01/Exercicio_21.py
c4st1lh0/Projetos-de-Aula
e8abc9f4bce6cc8dbc6d7fb5da0f549ac8ef5302
[ "MIT" ]
null
null
null
import pygame pygame.init() pygame.mixer.music.load('Exercicio_21.mp3') pygame.mixer.music.set_volume(0.1) pygame.mixer.music.play() input() pygame.event.wait()
22.857143
43
0.78125
26
160
4.730769
0.653846
0.268293
0.390244
0
0
0
0
0
0
0
0
0.03268
0.04375
160
7
44
22.857143
0.771242
0
0
0
0
0
0.099379
0
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
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
1
0
0
0
0
0
0
5
7a5f724dc558f7d7c014a18512388c6218d42656
81
py
Python
Python/advanced_tree.py
jiangzhengshen/AlgorithmCollection
beac5c39bd91c3686db3db533e6e601598e7e730
[ "MIT" ]
null
null
null
Python/advanced_tree.py
jiangzhengshen/AlgorithmCollection
beac5c39bd91c3686db3db533e6e601598e7e730
[ "MIT" ]
null
null
null
Python/advanced_tree.py
jiangzhengshen/AlgorithmCollection
beac5c39bd91c3686db3db533e6e601598e7e730
[ "MIT" ]
null
null
null
class Trie: pass class BalanceTree: pass class RedBlackTree: pass
8.1
19
0.666667
9
81
6
0.555556
0.333333
0
0
0
0
0
0
0
0
0
0
0.296296
81
9
20
9
0.947368
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
7aa44a25b12f8ab1561dc9d1aca2159d62ceeccf
65
py
Python
lscom/__init__.py
joshschmelzle/lscom
7c83b6f685278210293e1b5f5dd2d1b5a7982e6d
[ "MIT" ]
null
null
null
lscom/__init__.py
joshschmelzle/lscom
7c83b6f685278210293e1b5f5dd2d1b5a7982e6d
[ "MIT" ]
null
null
null
lscom/__init__.py
joshschmelzle/lscom
7c83b6f685278210293e1b5f5dd2d1b5a7982e6d
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # | _ _ _ ._ _ # | _> (_ (_) | | |
13
23
0.276923
3
65
3.333333
1
0
0
0
0
0
0
0
0
0
0
0.025
0.384615
65
4
24
16.25
0.225
0.861538
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
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
8f86e0354bd3437ae38eb026e1eac42e281da2e4
102
py
Python
Tools/MassSpectrometry/__init__.py
deaconjs/SPADE
da28cb927ae14f60aaf847591f81a86c9796d95e
[ "BSD-3-Clause" ]
3
2017-09-26T03:09:14.000Z
2022-03-20T11:12:34.000Z
Tools/MassSpectrometry/__init__.py
deaconjs/SPADE
da28cb927ae14f60aaf847591f81a86c9796d95e
[ "BSD-3-Clause" ]
null
null
null
Tools/MassSpectrometry/__init__.py
deaconjs/SPADE
da28cb927ae14f60aaf847591f81a86c9796d95e
[ "BSD-3-Clause" ]
1
2020-01-15T03:05:36.000Z
2020-01-15T03:05:36.000Z
import MassSpecWindow import ExperimentalConditionViewer import ModifyAAViewer import PeakRationalizer
25.5
34
0.931373
8
102
11.875
0.625
0
0
0
0
0
0
0
0
0
0
0
0.068627
102
4
35
25.5
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8fa78e8f6f40556373d535021bb95c85d35c38f9
18
py
Python
pyscript/torch/optimizer/__init__.py
takuto0831/Competition-utils
c738e199c6a771a0c58b9cd237660bb76b4be4fb
[ "MIT" ]
105
2019-04-09T21:57:51.000Z
2022-03-12T11:39:55.000Z
pyscript/torch/optimizer/__init__.py
takuto0831/Competition-utils
c738e199c6a771a0c58b9cd237660bb76b4be4fb
[ "MIT" ]
5
2020-01-10T09:08:05.000Z
2022-02-08T23:14:40.000Z
pyscript/torch/optimizer/__init__.py
takuto0831/Competition-utils
c738e199c6a771a0c58b9cd237660bb76b4be4fb
[ "MIT" ]
18
2020-01-12T06:50:41.000Z
2022-02-27T02:21:41.000Z
from .sam import *
18
18
0.722222
3
18
4.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.166667
18
1
18
18
0.866667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8f53dbcade00af34eeefad61b6d0abbeecfb3ce8
327
py
Python
rapid/__init__.py
limetreeleon/RAPID
6f922496ccbad84a8594af83cc63e8c7535cc804
[ "MIT" ]
2
2021-01-14T04:44:51.000Z
2021-01-14T13:43:38.000Z
rapid/__init__.py
limetreeleon/RAPID
6f922496ccbad84a8594af83cc63e8c7535cc804
[ "MIT" ]
null
null
null
rapid/__init__.py
limetreeleon/RAPID
6f922496ccbad84a8594af83cc63e8c7535cc804
[ "MIT" ]
1
2020-11-09T02:25:50.000Z
2020-11-09T02:25:50.000Z
"""RAPID (Robustness Analysis Producing Intelligent Decisions) This software package contains two sub-packages: 1. robustness - contains sub-packages for calculation and analysis of robustness values. 2. examples - examples of the use of the RAPID software package. """ from . import robustness from . import examples
36.333333
92
0.776758
42
327
6.047619
0.595238
0.11811
0
0
0
0
0
0
0
0
0
0.007326
0.165138
327
8
93
40.875
0.923077
0.828746
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
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
56b6d75741dc0ba325f311d67defe7903b7c8606
26
py
Python
StatsTest/__init__.py
Nickroll/SALMetrics
3b346013516a6e25761cdabee1d6ff389901951c
[ "MIT" ]
null
null
null
StatsTest/__init__.py
Nickroll/SALMetrics
3b346013516a6e25761cdabee1d6ff389901951c
[ "MIT" ]
null
null
null
StatsTest/__init__.py
Nickroll/SALMetrics
3b346013516a6e25761cdabee1d6ff389901951c
[ "MIT" ]
null
null
null
from . import SalMetrics
8.666667
24
0.769231
3
26
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.192308
26
2
25
13
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
56cfb8d7509268d6340a2d1c24b712ad540cb4b2
27,499
py
Python
tests/resource_tests/generator_tests/test_consent_metrics.py
all-of-us/raw-data-repository
d28ad957557587b03ff9c63d55dd55e0508f91d8
[ "BSD-3-Clause" ]
39
2017-10-13T19:16:27.000Z
2021-09-24T16:58:21.000Z
tests/resource_tests/generator_tests/test_consent_metrics.py
all-of-us/raw-data-repository
d28ad957557587b03ff9c63d55dd55e0508f91d8
[ "BSD-3-Clause" ]
312
2017-09-08T15:42:13.000Z
2022-03-23T18:21:40.000Z
tests/resource_tests/generator_tests/test_consent_metrics.py
all-of-us/raw-data-repository
d28ad957557587b03ff9c63d55dd55e0508f91d8
[ "BSD-3-Clause" ]
19
2017-09-15T13:58:00.000Z
2022-02-07T18:33:20.000Z
# # This file is subject to the terms and conditions defined in the # file 'LICENSE', which is part of this source code package. # from datetime import datetime, date from tests.helpers.unittest_base import BaseTestCase from rdr_service.dao.resource_dao import ResourceDataDao from rdr_service.model.consent_file import ConsentSyncStatus, ConsentType, ConsentOtherErrors import rdr_service.resource.generators class ConsentMetricGeneratorTest(BaseTestCase): def setUp(self, *args, **kwargs) -> None: super(ConsentMetricGeneratorTest, self).setUp(*args, **kwargs) self.resource_data_dao = ResourceDataDao() def _create_participant_with_all_consents_authored(self, **kwargs): """ Populate a participant_summary record with provided data """ defaults = { 'consentForStudyEnrollmentAuthored': datetime.strptime('2020-01-01 01:00:00', "%Y-%m-%d %H:%M:%S"), 'consentForStudyEnrollmentFirstYesAuthored': datetime.strptime('2020-01-01 01:00:00', "%Y-%m-%d %H:%M:%S"), 'consentForCABoRAuthored': datetime.strptime('2020-01-01 02:00:00', "%Y-%m-%d %H:%M:%S"), 'consentForElectronicHealthRecordsAuthored': datetime.strptime('2020-01-01 03:00:00', "%Y-%m-%d %H:%M:%S"), 'consentForElectronicHealthRecordsFirstYesAuthored': \ datetime.strptime('2020-01-01 03:00:00', "%Y-%m-%d %H:%M:%S"), 'consentForGenomicsRORAuthored': datetime.strptime('2020-01-01 04:00:00', "%Y-%m-%d %H:%M:%S"), 'participantOrigin': 'vibrent' } # Merge the kwargs and defaults dicts; kwargs values take precedence over default values for key in defaults.keys(): if key not in kwargs.keys(): kwargs = dict(**{key: defaults[key]}, **kwargs) participant = self.data_generator.create_database_participant_summary(**kwargs) return participant def _create_participant_with_custom_primary_consent_authored(self, authored, **kwargs): participant = self.data_generator.create_database_participant_summary( consentForStudyEnrollmentAuthored=authored, consentForStudyEnrollmentFirstYesAuthored=authored, **kwargs ) return participant @staticmethod def _create_expected_metrics_dict(participant, consent_type=ConsentType.PRIMARY, consent_status=ConsentSyncStatus.READY_FOR_SYNC, expected_errors=[]): """ Set up a dictionary of values to compare against resource data dictionary from ConsentMetricGenerator; does not include created, modified, or id (auto-generated values) """ expected_values_dict = {'hpo_id': participant.hpoId, 'organization_id': participant.organizationId, 'participant_id': f'P{participant.participantId}', 'consent_type': str(consent_type), 'consent_type_id': int(consent_type), 'sync_status': str(consent_status), 'sync_status_id': int(consent_status), 'missing_file': ('missing_file' in expected_errors), 'signature_missing': ('signature_missing' in expected_errors), 'invalid_signing_date': ('invalid_signing_date' in expected_errors), 'checkbox_unchecked': ('checkbox_unchecked' in expected_errors), 'non_va_consent_for_va': ('non_va_consent_for_va' in expected_errors), 'va_consent_for_non_va': ('va_consent_for_non_va' in expected_errors), 'invalid_dob': ('invalid_dob' in expected_errors), 'invalid_age_at_consent': ('invalid_age_at_consent' in expected_errors) } return expected_values_dict def test_consent_metrics_generator_no_errors(self): """ Test the consent_metrics generator with no error conditions """ # Use a valid datOfBirth for participant summary data participant = self._create_participant_with_all_consents_authored( dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), ) # Create consent_file record with no error conditions consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.READY_FOR_SYNC, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1 ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() resource_data = res_gen.make_resource(consent_file_rec.id).get_data() # No expected_errors provided, all error conditions default to False expected = self._create_expected_metrics_dict(participant, expected_errors=[]) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) # Also check that the authored date matches the date from the participant_summary record self.assertEqual(resource_data.get('consent_authored_date', None), datetime.date(participant.consentForElectronicHealthRecordsFirstYesAuthored)) def test_consent_metrics_generator_dob_invalid(self): """ invalid_dob error calculated from participant_summary data, sync_status can still be READY_TO_SYNC """ # Create participant summary data with (1) DOB missing, and (2) DOB > 124 years from primary consent authored participant_1 = self._create_participant_with_all_consents_authored(dateOfBirth=None) participant_2 = self._create_participant_with_all_consents_authored( participantOrigin='example', dateOfBirth=datetime.date(datetime.strptime('1895-12-31', '%Y-%m-%d')) ) # Create consent_file records for each participant's primary consent with no other error conditions consent_file_rec_1 = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.READY_FOR_SYNC, participant_id=participant_1.participantId, signing_date=participant_1.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1 ) consent_file_rec_2 = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.READY_FOR_SYNC, participant_id=participant_2.participantId, signing_date=participant_2.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1 ) self.assertIsNotNone(consent_file_rec_1.id) self.assertIsNotNone(consent_file_rec_2.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() # Expected: Invalid DOB because DOB is missing resource_data = res_gen.make_resource(consent_file_rec_1.id).get_data() expected = self._create_expected_metrics_dict(participant_1, expected_errors=['invalid_dob']) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) # Expected: Invalid DOB because DOB is > 124 years before primary consent authored date resource_data = res_gen.make_resource(consent_file_rec_2.id).get_data() expected = self._create_expected_metrics_dict(participant_2, expected_errors=['invalid_dob']) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) def test_consent_metrics_generator_invalid_age_at_consent(self): """ invalid_age_at_consent errors come from participant_summary data, sync_status can still be READY_TO_SYNC """ # Create participant summary data with a DOB less than 18 years from primary consent authored date participant = self._create_participant_with_all_consents_authored( dateOfBirth=datetime.date(datetime.strptime('2014-01-01', '%Y-%m-%d')), ) # Create consent_file record with no other error conditions consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.READY_FOR_SYNC, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1 ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() # Expected: invalid_age_at_consent (less than 18 years of age) resource_data = res_gen.make_resource(consent_file_rec.id).get_data() expected = self._create_expected_metrics_dict(participant, expected_errors=['invalid_age_at_consent']) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) def test_consent_metrics_generator_missing_file(self): """ Consent metrics missing_file error based on consent_file having file_exists = 0 """ # Create participant summary data (valid DOB) participant = self._create_participant_with_all_consents_authored( dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=0, is_signature_valid=0, is_signing_date_valid=0 ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() # Expected: invalid_age_at_consent (less than 18 years of age) resource_data = res_gen.make_resource(consent_file_rec.id).get_data() # Note: if file is missing, neither the signature_missing or invalid_signing_date errors should be set expected = self._create_expected_metrics_dict(participant, consent_status=ConsentSyncStatus.NEEDS_CORRECTING, expected_errors=['missing_file']) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) def test_consent_metrics_generator_dob_and_file_errors(self): """ Consent metrics signature_missing error + invalid_age_at_consent error from primary consent """ # Create participant summary data (DOB < 18 years from primary consent authored date) participant = self._create_participant_with_all_consents_authored( dateOfBirth=datetime.date(datetime.strptime('2004-01-01', '%Y-%m-%d')), ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=0, # Because there wasn't a signature detected, this downstream signing date error is ignored in metrics code is_signing_date_valid=0 ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() # Expected: invalid_age_at_consent and signature_missing errors resource_data = res_gen.make_resource(consent_file_rec.id).get_data() expected = self._create_expected_metrics_dict(participant, consent_status=ConsentSyncStatus.NEEDS_CORRECTING, expected_errors=['invalid_age_at_consent', 'signature_missing']) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) def test_consent_metrics_generator_other_errors(self): """ Consent metrics errors that are extracted from the consent_file other_errors string field """ # Create participant summary data (valid DOB) participant = self._create_participant_with_all_consents_authored( dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), ) # Create consent_file record with missing check error, status NEEDS_CORRECTING consent_file_rec_1 = self.data_generator.create_database_consent_file( type=ConsentType.GROR, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1, other_errors=ConsentOtherErrors.MISSING_CONSENT_CHECK_MARK ) # Create consent_file record with non-veteran consent for veteran participant error consent_file_rec_2 = self.data_generator.create_database_consent_file( type=ConsentType.EHR, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1, other_errors=ConsentOtherErrors.VETERAN_CONSENT_FOR_NON_VETERAN ) self.assertIsNotNone(consent_file_rec_2.id) # Create consent_file record with both missing check mark and non-veteran consent for veteran participant error consent_file_rec_3 = self.data_generator.create_database_consent_file( type=ConsentType.EHR, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, signing_date=participant.consentForStudyEnrollmentFirstYesAuthored.date(), expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1, other_errors=", ".join([ConsentOtherErrors.NON_VETERAN_CONSENT_FOR_VETERAN, ConsentOtherErrors.MISSING_CONSENT_CHECK_MARK]) ) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() # Expected: checkbox_unchecked error for consent_file_rec_1 resource_data = res_gen.make_resource(consent_file_rec_1.id).get_data() expected = self._create_expected_metrics_dict(participant, consent_type=ConsentType.GROR, consent_status=ConsentSyncStatus.NEEDS_CORRECTING, expected_errors=\ ['checkbox_unchecked'] ) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) # Also validate the resource data consent_authored_date matches the participant_summary GROR authored date self.assertEqual(resource_data.get('consent_authored_date', None), datetime.date(participant.consentForGenomicsRORAuthored)) # Expected: non_va_consent_for_va for consent_file_rec_2 resource_data = res_gen.make_resource(consent_file_rec_2.id).get_data() expected = self._create_expected_metrics_dict(participant, consent_type=ConsentType.EHR, consent_status=ConsentSyncStatus.NEEDS_CORRECTING, expected_errors=\ ['va_consent_for_non_va'] ) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) # Also validate the resource data consent_authored_date matches the participant_summary EHR authored date self.assertEqual(resource_data.get('consent_authored_date', None), datetime.date(participant.consentForElectronicHealthRecordsFirstYesAuthored)) # Expected: checkbox_unchecked, non_va_for_va_consent for consent_file_rec_3 resource_data=res_gen.make_resource(consent_file_rec_3.id).get_data() expected = self._create_expected_metrics_dict(participant, consent_type=ConsentType.EHR, consent_status=ConsentSyncStatus.NEEDS_CORRECTING, expected_errors=\ ['checkbox_unchecked', 'non_va_consent_for_va'] ) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) # Also validate the resource data consent_authored_date matches the participant_summary EHR authored date self.assertEqual(resource_data.get('consent_authored_date', None), datetime.date(participant.consentForElectronicHealthRecordsFirstYesAuthored)) def test_consent_metrics_generator_resolved_date(self): """ For OBSOLETE sync status, confirm the resolved date equals the last modified date from consent_file record """ # Create participant summary data (valid DOB) participant = self._create_participant_with_all_consents_authored( dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.EHR, sync_status=ConsentSyncStatus.OBSOLETE, participant_id=participant.participantId, expected_sign_date=date(year=2020, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1, other_errors=ConsentOtherErrors.MISSING_CONSENT_CHECK_MARK ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() # Expected: checkbox_unchecked error resource_data = res_gen.make_resource(consent_file_rec.id).get_data() expected = self._create_expected_metrics_dict(participant, consent_type=ConsentType.EHR, consent_status=ConsentSyncStatus.OBSOLETE, expected_errors=['checkbox_unchecked']) generated = {k: v for k, v in resource_data.items() if k in expected} self.assertDictEqual(generated, expected) # Confirm the consent authored date matches the date from the participant_summary record, and that the # resolved date matches the consent_file record modified date self.assertEqual(resource_data.get('consent_authored_date', None), datetime.date(participant.consentForElectronicHealthRecordsFirstYesAuthored)) self.assertEqual(resource_data.get('resolved_date', None), datetime.date(consent_file_rec.modified)) def test_consent_metrics_generator_signature_missing_error_filtered(self): """ Ignore known potential false positives for missing signatures, for consents authored before 2018-07-13 """ # Create participant summary data with a primary consent authored date before the false positive cutoff participant = self._create_participant_with_custom_primary_consent_authored( datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, expected_sign_date=date(year=2018, month=1, day=1), file_exists=1, is_signature_valid=0, ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() resource_data = res_gen.make_resource(consent_file_rec.id).get_data() # Confirm this record's ignore flag was set due to filtering the signature_missing error self.assertEqual(resource_data['ignore'], True) def test_consent_metrics_generator_special_sync_status_filtered(self): """ Ignore consent records whose current sync_status is a special case status such as UNKNOWN or DELAYING_SYNC """ # Create participant summary data with a primar consent authored date before the false positive cutoff participant = self._create_participant_with_all_consents_authored( consentForStudyEnrollmentAuthored=datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), consentForStudyEnrollmentFirstYesAuthored=datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')) ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.DELAYING_SYNC, participant_id=participant.participantId, expected_sign_date=date(year=2018, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1 ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() resource_data = res_gen.make_resource(consent_file_rec.id).get_data() # Confirm this record's ignore flag was set due to filtering on the special sync_status self.assertEqual(resource_data['ignore'], True) def test_consent_metrics_generator_va_consent_for_non_va_filtered(self): """ Ignore va_consent_for_non_va errors if that's the only error and participant's current pairing is to the VA HPO """ va_hpo = self.data_generator.create_database_hpo(hpoId=2000, name='VA') participant = self._create_participant_with_all_consents_authored( consentForStudyEnrollmentAuthored=datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), consentForStudyEnrollmentFirstYesAuthored=datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), hpoId=va_hpo.hpoId ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.NEEDS_CORRECTING, participant_id=participant.participantId, expected_sign_date=date(year=2018, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1, other_errors=ConsentOtherErrors.VETERAN_CONSENT_FOR_NON_VETERAN ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() resource_data = res_gen.make_resource(consent_file_rec.id).get_data() # Confirm this record's ignore flag was set due to filtering the va_consent_for_non_va error self.assertEqual(resource_data['ignore'], True) def test_consent_metrics_generator_test_participant(self): """ Confirm test_participant flag is set by generator if participant is paired to TEST hpo """ test_hpo = self.data_generator.create_database_hpo(hpoId=2000, name='TEST') participant = self._create_participant_with_all_consents_authored( consentForStudyEnrollmentFirstYesAuthored=datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), consentForStudyEnrollmentAuthored=datetime.strptime('2018-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'), dateOfBirth=datetime.date(datetime.strptime('1999-01-01', '%Y-%m-%d')), hpoId=test_hpo.hpoId ) # Create consent_file record with file_exists set to false, status NEEDS_CORRECTING consent_file_rec = self.data_generator.create_database_consent_file( type=ConsentType.PRIMARY, sync_status=ConsentSyncStatus.READY_FOR_SYNC, participant_id=participant.participantId, expected_sign_date=date(year=2018, month=1, day=1), file_exists=1, is_signature_valid=1, is_signing_date_valid=1 ) self.assertIsNotNone(consent_file_rec.id) res_gen = rdr_service.resource.generators.ConsentMetricGenerator() resource_data = res_gen.make_resource(consent_file_rec.id).get_data() self.assertTrue(resource_data.get('test_participant'))
56.698969
119
0.665261
3,065
27,499
5.674062
0.083524
0.048071
0.035421
0.023805
0.782474
0.753206
0.739635
0.72572
0.713127
0.692945
0
0.022121
0.256955
27,499
484
120
56.816116
0.829002
0.176261
0
0.629944
0
0
0.074434
0.025199
0
0
0
0
0.090395
1
0.042373
false
0
0.014124
0
0.067797
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
56d7536990ef49df5b12e95c1da803f3c598255f
72
py
Python
test_src/test_proj/wapp.py
FloThinksPi-Forks/vstutils
eeb4d7a4d280cb8b844d9c9ab212e88f7bbe5d38
[ "Apache-2.0" ]
36
2018-05-29T22:55:45.000Z
2021-11-18T22:59:29.000Z
test_src/test_proj/wapp.py
FloThinksPi-Forks/vstutils
eeb4d7a4d280cb8b844d9c9ab212e88f7bbe5d38
[ "Apache-2.0" ]
19
2020-03-05T01:31:52.000Z
2022-01-21T08:22:19.000Z
test_src/test_proj/wapp.py
FloThinksPi-Forks/vstutils
eeb4d7a4d280cb8b844d9c9ab212e88f7bbe5d38
[ "Apache-2.0" ]
10
2018-07-30T10:14:30.000Z
2022-01-08T12:07:20.000Z
from vstutils.environment import get_celery_app app = get_celery_app()
18
47
0.833333
11
72
5.090909
0.636364
0.321429
0.428571
0
0
0
0
0
0
0
0
0
0.111111
72
3
48
24
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
56f74d2047ce0222a536cc79024816b3a0296e70
92
py
Python
fitlins/utils/__init__.py
poldracklab/fitlins
3f6cea2f18db176cbd471419313b974e2bcd52ed
[ "Apache-2.0" ]
60
2018-03-05T17:14:07.000Z
2022-03-25T22:08:57.000Z
fitlins/utils/__init__.py
poldracklab/fitlins
3f6cea2f18db176cbd471419313b974e2bcd52ed
[ "Apache-2.0" ]
292
2018-03-07T16:28:22.000Z
2022-03-30T12:56:01.000Z
fitlins/utils/__init__.py
poldracklab/fitlins
3f6cea2f18db176cbd471419313b974e2bcd52ed
[ "Apache-2.0" ]
34
2018-03-02T17:15:22.000Z
2021-10-02T18:48:19.000Z
from .strings import snake_to_camel, to_alphanum from .collections import dict_intersection
30.666667
48
0.869565
13
92
5.846154
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.097826
92
2
49
46
0.915663
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
71011230c980b33e94eee9255a08aa515ffb124a
86
py
Python
backend/apps/projects/__init__.py
wuchaofan1654/tester
ff38d42e06cbdfa04882e8e95ada2dd93e6609f2
[ "MIT" ]
null
null
null
backend/apps/projects/__init__.py
wuchaofan1654/tester
ff38d42e06cbdfa04882e8e95ada2dd93e6609f2
[ "MIT" ]
null
null
null
backend/apps/projects/__init__.py
wuchaofan1654/tester
ff38d42e06cbdfa04882e8e95ada2dd93e6609f2
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Create by sandy at 15:54 09/12/2021 Description: ToDo """
14.333333
35
0.604651
14
86
3.714286
1
0
0
0
0
0
0
0
0
0
0
0.183099
0.174419
86
5
36
17.2
0.549296
0.883721
0
null
0
null
0
0
null
0
0
0.2
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
0
0
0
0
0
5
712d00e6f98e5c3d535be7658e02f8ce98d609c6
10,919
py
Python
build/lib/rsnapsim/ssa_cpp/benchmark_ssas.py
MunskyGroup/rSNAPsim
af3e496d5252e1d2e1da061277123233a5d609b4
[ "MIT" ]
1
2022-01-28T18:17:37.000Z
2022-01-28T18:17:37.000Z
rsnapsim/defunct/ssa_cpp/benchmark_ssas.py
MunskyGroup/rSNAPsim
af3e496d5252e1d2e1da061277123233a5d609b4
[ "MIT" ]
null
null
null
rsnapsim/defunct/ssa_cpp/benchmark_ssas.py
MunskyGroup/rSNAPsim
af3e496d5252e1d2e1da061277123233a5d609b4
[ "MIT" ]
1
2020-12-02T06:36:17.000Z
2020-12-02T06:36:17.000Z
# -*- coding: utf-8 -*- """ Created on Thu May 21 16:02:42 2020 @author: willi """ import numpy as np import ssa_translation_lowmem import ssa_translation_lowmem_leaky import ssa_translation_lowmem_nostats import ssa_translation import matplotlib.pyplot as plt import time import os os.chdir('..') from rss import ProbeVectorFactory as pvf from rss import PropensityFactory as pff os.chdir('ssa_cpp') # load the elongation kelong = np.loadtxt('elongationrates.txt') kbind = kelong[0] kcompl = kelong[-1] kelong = kelong[1:-1] ncolor = 2 t_array = np.array([0,10,20,30,50,100,250,500],dtype=np.float64) t0 = 15 t_array = np.linspace(0,1000,1000,dtype=np.float64) N_rib = 200 result = np.zeros((len(t_array)*ncolor),dtype=np.int32 ) #kelong = np.array([3.1,3.2,3.3,3.4,3.5,3.1,3.2,3.3,3.4,3.5],dtype=np.float64) n_trajectories = 100 #preallocated arrays here all_results = np.zeros((n_trajectories,len(t_array),ncolor),dtype=np.int32) lenfrap = len(np.intersect1d(np.where(t_array>0)[0],np.where(t_array<20)[0])) all_frapresults = np.zeros((n_trajectories,N_rib*len(t_array)),dtype=np.int32) all_ribtimes = np.zeros((n_trajectories,400),dtype=np.float64) all_coltimes = np.zeros((n_trajectories,400),dtype=np.int32) nribs = np.array([0],dtype=np.int32) all_ribs = np.zeros((n_trajectories,1)) seeds = np.random.randint(0,0x7FFFFFF,n_trajectories) x0 = np.zeros((N_rib),dtype=np.int32) pl = np.zeros((len(kelong),ncolor), dtype=np.int32) pl[ [10,20,30,100,120,140],0 ] = 1 #pl[ [10,140],1 ] = 1 pl = np.cumsum(pl,axis=0) pl = pl.T.copy(order='C') print('-----------------------') print('GENERATING REPORT') print('-----------------------') print('1 cpu core, 2 color') print('{0} base pairs'.format(len(kelong)-2)) print('-----------------------') all_col_points = [] start = time.time() for i in range(n_trajectories): result = np.zeros((ncolor,len(t_array)),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ribtimes = np.zeros((400),dtype=np.float64) coltimes = np.zeros((400),dtype=np.int32) colpointsx = np.zeros(len(kelong)*400,dtype=np.int32) colpointst = np.zeros(len(kelong)*400,dtype=np.float64) ssa_translation_lowmem.run_SSA(result,ribtimes,coltimes,colpointsx,colpointst, kelong,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],nribs,x0,9, pl,2) all_results[i,:,:] = result.T all_frapresults[i,:] = frapresult all_coltimes[i,:] = coltimes all_ribtimes[i,:] = ribtimes all_ribs[i,:] = nribs[0] endcolrec = np.where(colpointsx == 0)[0][0] colpoints = np.vstack((colpointsx[:endcolrec],colpointst[:endcolrec])) all_col_points.append(colpoints.T) print('low memory w/recording_stats: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) #plt.hist(result[result>0]) #plt.show() #traj = result.reshape((N_rib,len(t_array))).T ##print('The result is \n {0}'.format(result.reshape((N_rib,len(t_array))).T)) #plt.plot(traj[-1,:]) #plt.show() plt.plot(result.T,'--') start = time.time() for i in range(n_trajectories): result = np.zeros((ncolor,len(t_array)),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ssa_translation_lowmem_nostats.run_SSA(result, kelong,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],x0,9, pl,2) all_results[i,:,:] = result.T all_frapresults[i,:] = frapresult print('Low memory w/o recording stats: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) plt.plot(result.T) pl_2color = np.atleast_2d(pl) probe_loc = (pl_2color[:,1:]-pl_2color[:,:-1] > 0).astype(int) inds = pff.intellegent_bin(np.atleast_2d(probe_loc),100) bpv,bpl = pvf.bin_probe_vecs(probe_loc,inds) kelong_2color = kelong k_bin = pff.bin_k(kelong, inds) start = time.time() for i in range(n_trajectories): result = np.zeros((ncolor,len(t_array)),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ssa_translation_lowmem_nostats.run_SSA(result, k_bin,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],x0,9, bpl,2) #all_results[i,:,:] = result.T #all_frapresults[i,:] = frapresult print('Low memory 100 bins: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) plt.plot(result.T,'.') plt.legend(['w/ stats color 1','w/ stats color 2','w/o stats color 1','w/o stats color 2']) plt.xlabel('time') plt.ylabel('intensity') print('-----------------------') print('1 cpu core, 1 color') print('-----------------------') all_results = np.zeros((n_trajectories,N_rib*len(t_array)),dtype=np.int32) lenfrap = len(np.intersect1d(np.where(t_array>0)[0],np.where(t_array<20)[0])) all_frapresults = np.zeros((n_trajectories,N_rib*len(t_array)),dtype=np.int32) all_ribtimes = np.zeros((n_trajectories,400),dtype=np.float64) all_coltimes = np.zeros((n_trajectories,400),dtype=np.int32) nribs = np.array([0],dtype=np.int32) all_ribs = np.zeros((n_trajectories,1)) seeds = np.random.randint(0,0x7FFFFFF,n_trajectories) x0 = np.zeros((N_rib),dtype=np.int32) pv = np.loadtxt('probe_design.txt') all_col_points = [] start = time.time() for i in range(n_trajectories): result = np.zeros((len(t_array)*N_rib),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ribtimes = np.zeros((400),dtype=np.float64) coltimes = np.zeros((400),dtype=np.int32) colpointsx = np.zeros(len(kelong)*400,dtype=np.int32) colpointst = np.zeros(len(kelong)*400,dtype=np.float64) print(result.shape) print(kelong.shape) print(frapresult.shape) print(ribtimes.shape) print(coltimes.shape) print(colpointsx.shape) print(colpointst.shape) ssa_translation.run_SSA(result,ribtimes,coltimes,colpointsx,colpointst, kelong,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],nribs,x0,9,N_rib) all_results[i,:] = result all_frapresults[i,:] = frapresult all_coltimes[i,:] = coltimes all_ribtimes[i,:] = ribtimes all_ribs[i,:] = nribs[0] endcolrec = np.where(colpointsx == 0)[0][0] colpoints = np.vstack((colpointsx[:endcolrec],colpointst[:endcolrec])) all_col_points.append(colpoints.T) ntimes = len(t_array) intensity_vec = np.zeros(ntimes) tstart = 0 I = np.zeros((n_trajectories,ntimes-tstart)) for i in range(n_trajectories): traj = all_results[i,:].reshape((N_rib,len(t_array))).T for j in range(tstart,ntimes): temp_output = traj[j,:] I[i,j] = np.sum(pv[temp_output[temp_output>0]-1]) print('Full SSA with Recording: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) plt.figure() plt.plot(I[-1,:],'x') pl = np.atleast_2d(pv.astype(int)) ncolor=1 all_results = np.zeros((n_trajectories,len(t_array),ncolor),dtype=np.int32) lenfrap = len(np.intersect1d(np.where(t_array>0)[0],np.where(t_array<20)[0])) all_frapresults = np.zeros((n_trajectories,N_rib*len(t_array)),dtype=np.int32) all_ribtimes = np.zeros((n_trajectories,400),dtype=np.float64) all_coltimes = np.zeros((n_trajectories,400),dtype=np.int32) nribs = np.array([0],dtype=np.int32) all_ribs = np.zeros((n_trajectories,1)) #seeds = np.random.randint(0,0x7FFFFFF,n_trajectories) x0 = np.zeros((N_rib),dtype=np.int32) all_col_points = [] start = time.time() for i in range(n_trajectories): result = np.zeros((ncolor,len(t_array)),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ribtimes = np.zeros((400),dtype=np.float64) coltimes = np.zeros((400),dtype=np.int32) colpointsx = np.zeros(len(kelong)*400,dtype=np.int32) colpointst = np.zeros(len(kelong)*400,dtype=np.float64) ssa_translation_lowmem.run_SSA(result,ribtimes,coltimes,colpointsx,colpointst, kelong,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],nribs,x0,9, pl,1) all_results[i,:] = result.T all_frapresults[i,:] = frapresult all_coltimes[i,:] = coltimes all_ribtimes[i,:] = ribtimes all_ribs[i,:] = nribs[0] endcolrec = np.where(colpointsx == 0)[0][0] colpoints = np.vstack((colpointsx[:endcolrec],colpointst[:endcolrec])) all_col_points.append(colpoints.T) print('Low memory w/recording_stats: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) #plt.hist(result[result>0]) #plt.show() #traj = result.reshape((N_rib,len(t_array))).T ##print('The result is \n {0}'.format(result.reshape((N_rib,len(t_array))).T)) #plt.plot(traj[-1,:]) #plt.show() plt.plot(result.T,'o') start = time.time() for i in range(n_trajectories): result = np.zeros((ncolor,len(t_array)),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ssa_translation_lowmem_nostats.run_SSA(result, kelong,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],x0,9, pl,1) all_results[i,:] = result.T all_frapresults[i,:] = frapresult print('Low memory w/o recording stats: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) plt.plot(result.T) pl = pl.flatten() probe_loc = (np.where(pv[1:]-pv[:-1] > 0)[0]+1).astype(np.int32) k_probe = .2 all_results = np.zeros((n_trajectories,len(t_array)),dtype=np.int32) lenfrap = len(np.intersect1d(np.where(t_array>0)[0],np.where(t_array<20)[0])) all_frapresults = np.zeros((n_trajectories,N_rib*len(t_array)),dtype=np.int32) all_ribtimes = np.zeros((n_trajectories,400),dtype=np.float64) all_coltimes = np.zeros((n_trajectories,400),dtype=np.int32) nribs = np.array([0],dtype=np.int32) all_ribs = np.zeros((n_trajectories,1)) seeds = np.random.randint(0,0x7FFFFFF,n_trajectories) x0 = np.zeros((N_rib),dtype=np.int32) start = time.time() for i in range(n_trajectories): result = np.zeros((len(t_array)),dtype=np.int32) frapresult = np.zeros((len(t_array)*N_rib),dtype=np.int32) ribtimes = np.zeros((400),dtype=np.float64) coltimes = np.zeros((400),dtype=np.int32) colpointsx = np.zeros(len(kelong)*400,dtype=np.int32) colpointst = np.zeros(len(kelong)*400,dtype=np.float64) ssa_translation_lowmem_leaky.run_SSA(result,ribtimes,coltimes,colpointsx,colpointst, kelong,frapresult,t_array,.03,kcompl, 1,0,300, seeds[i],nribs,x0,9, pl,k_probe,probe_loc ) all_results[i,:] = result all_frapresults[i,:] = frapresult all_coltimes[i,:] = coltimes all_ribtimes[i,:] = ribtimes all_ribs[i,:] = nribs[0] endcolrec = np.where(colpointsx == 0)[0][0] colpoints = np.vstack((colpointsx[:endcolrec],colpointst[:endcolrec])) all_col_points.append(colpoints.T) print('Low memory w/ leaky probes: time for {0} trajectories {1}'.format(n_trajectories,time.time()-start)) plt.plot(result.T) plt.legend(['full ssa','lowmem w/ stats','lowmem w/o stats','lowmem leaky']) plt.xlabel('time') plt.ylabel('intensity')
29.833333
179
0.684495
1,732
10,919
4.180716
0.101617
0.057036
0.072918
0.058003
0.791603
0.786632
0.771579
0.76495
0.76495
0.760807
0
0.050601
0.131239
10,919
366
180
29.833333
0.712735
0.064658
0
0.614286
0
0
0.076387
0.011291
0
0
0.002651
0
0
1
0
false
0
0.047619
0
0.047619
0.109524
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
71431221493b1d8b33028e167a2e6fae4494a823
38
py
Python
tests/__init__.py
stsievert/scikeras
9a17b476f34809d5a436c048a5d145a8c55e7b55
[ "MIT" ]
null
null
null
tests/__init__.py
stsievert/scikeras
9a17b476f34809d5a436c048a5d145a8c55e7b55
[ "MIT" ]
null
null
null
tests/__init__.py
stsievert/scikeras
9a17b476f34809d5a436c048a5d145a8c55e7b55
[ "MIT" ]
1
2021-05-21T12:46:23.000Z
2021-05-21T12:46:23.000Z
"""Unit test package for scikeras."""
19
37
0.684211
5
38
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.131579
38
1
38
38
0.787879
0.815789
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
85878a53de34b389372879b5035af56ce0c31f3d
41
py
Python
experimentor/views/exceptions.py
aquilesC/experimentor
1a70760912ef40f0e2aaee44ed1a1e5594fd5b45
[ "MIT" ]
4
2020-05-15T04:07:25.000Z
2020-09-30T22:20:46.000Z
experimentor/views/exceptions.py
aquilesC/experimentor
1a70760912ef40f0e2aaee44ed1a1e5594fd5b45
[ "MIT" ]
null
null
null
experimentor/views/exceptions.py
aquilesC/experimentor
1a70760912ef40f0e2aaee44ed1a1e5594fd5b45
[ "MIT" ]
null
null
null
class ViewException(Exception): pass
13.666667
31
0.756098
4
41
7.75
1
0
0
0
0
0
0
0
0
0
0
0
0.170732
41
2
32
20.5
0.911765
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
859740999b00b35376f5da7f09e91d0dba7b8e39
1,322
py
Python
lib/systems/l-lysine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/l-lysine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/l-lysine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
import pulsar as psr def load_ref_system(): """ Returns l-lysine as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" N 1.1027 -2.1223 0.2103 C 0.8799 -0.9837 -0.7101 C 2.1653 -0.5233 -1.3940 O 2.0015 0.1019 -2.5808 C 0.2612 0.2130 0.0260 C -1.1667 -0.0696 0.4666 C -1.7674 1.1389 1.1684 C -3.1924 0.8435 1.6233 N -3.7558 1.9940 2.3635 O 3.3165 -0.6536 -1.0164 H 1.6562 -1.8371 0.9909 H 1.5630 -2.8629 -0.2743 H 0.1669 -1.3483 -1.4928 H 2.8473 0.3657 -2.9306 H 0.2731 1.0970 -0.6439 H 0.8809 0.4945 0.9025 H -1.1933 -0.9499 1.1397 H -1.7864 -0.3461 -0.4106 H -1.7516 2.0153 0.4883 H -1.1378 1.4238 2.0355 H -3.2011 -0.0264 2.3108 H -3.8121 0.5488 0.7478 H -4.6963 1.7877 2.6259 H -3.7507 2.8057 1.7814 """)
41.3125
64
0.396369
198
1,322
2.631313
0.540404
0.023033
0
0
0
0
0
0
0
0
0
0.550459
0.505295
1,322
31
65
42.645161
0.246177
0.079425
0
0
0
0
0.929825
0
0
0
0
0
0
1
0.035714
true
0
0.035714
0
0.107143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
859b10ffe755d2aa9ff69c208cfaecd13bf85923
464
py
Python
server/src/controller/verify.py
y-yu/qrand
b041c3c9cccaf20ee24a0ad90c81b89d3dc753bf
[ "MIT" ]
3
2020-02-02T09:04:21.000Z
2020-02-09T07:25:59.000Z
server/src/controller/verify.py
y-yu/qrand
b041c3c9cccaf20ee24a0ad90c81b89d3dc753bf
[ "MIT" ]
null
null
null
server/src/controller/verify.py
y-yu/qrand
b041c3c9cccaf20ee24a0ad90c81b89d3dc753bf
[ "MIT" ]
null
null
null
from ..service import verify from flask import json, jsonify class VerifyQRandController: def __init__(self, verify_service_impl: verify.VerifyQRandService): self.verify_service_impl = verify_service_impl # クライアントはサーバーに対して公開した`a`と`x`と # サーバーのセッションに保存された1 qubitの測定結果を元に # コイントスが正常に行なわれたかを判定する。 def post_ax(self, a: int, x: int) -> json: return jsonify( {'is_valid': self.verify_service_impl.verify(a, x)} )
30.933333
71
0.702586
54
464
5.777778
0.5
0.166667
0.217949
0.201923
0.259615
0
0
0
0
0
0
0.002725
0.209052
464
14
72
33.142857
0.847411
0.174569
0
0
0
0
0.021108
0
0
0
0
0
0
1
0.222222
false
0
0.222222
0.111111
0.666667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
85a431c8e4830ca7d44f5bc7c52553d2024d7797
234
py
Python
sturn/utils.py
m32/sturn
ffc252db2a434daef33c5e819444b1d929a8599b
[ "MIT" ]
2
2021-07-11T21:24:37.000Z
2021-12-23T18:30:50.000Z
sturn/utils.py
m32/sturn
ffc252db2a434daef33c5e819444b1d929a8599b
[ "MIT" ]
null
null
null
sturn/utils.py
m32/sturn
ffc252db2a434daef33c5e819444b1d929a8599b
[ "MIT" ]
1
2021-12-24T01:07:21.000Z
2021-12-24T01:07:21.000Z
import hashlib def saslprep(string): #TODO return string def ha1(username, realm, password): data = b':'.join((username.encode('utf-8'), realm, saslprep(password.encode('utf-8')))) return hashlib.md5(data).digest()
21.272727
91
0.67094
31
234
5.064516
0.612903
0.11465
0.127389
0
0
0
0
0
0
0
0
0.020305
0.15812
234
10
92
23.4
0.77665
0.017094
0
0
0
0
0.048035
0
0
0
0
0.1
0
1
0.333333
false
0.333333
0.166667
0.166667
0.833333
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
1
0
1
1
0
0
5
a4393d3c37b2e742985f737029320ead5079d8fa
230
py
Python
src/__init__.py
nirvanesque/streaming-ML-benchmark
689e818da070b6f48c51b17cac6be69a0669f277
[ "Apache-2.0" ]
null
null
null
src/__init__.py
nirvanesque/streaming-ML-benchmark
689e818da070b6f48c51b17cac6be69a0669f277
[ "Apache-2.0" ]
null
null
null
src/__init__.py
nirvanesque/streaming-ML-benchmark
689e818da070b6f48c51b17cac6be69a0669f277
[ "Apache-2.0" ]
1
2018-11-12T10:22:34.000Z
2018-11-12T10:22:34.000Z
# -*- coding: utf-8 -*- # ------------------------------------------------------------------ # Author : Baruch AMOUSSOU-DJANGBAN # Data Scientist # ------------------------------------------------------------------
23
68
0.221739
9
230
5.666667
1
0
0
0
0
0
0
0
0
0
0
0.005051
0.13913
230
9
69
25.555556
0.252525
0.934783
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
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
a4423f45b5632f29a9a1736775d6f4fd96838cc8
48
py
Python
test.py
lzqlzzq/GinPlum
a19cd9d84d37c11426ba87a0ea51d8382ab0525c
[ "MIT" ]
null
null
null
test.py
lzqlzzq/GinPlum
a19cd9d84d37c11426ba87a0ea51d8382ab0525c
[ "MIT" ]
null
null
null
test.py
lzqlzzq/GinPlum
a19cd9d84d37c11426ba87a0ea51d8382ab0525c
[ "MIT" ]
null
null
null
from index import * from api import service
12
24
0.729167
7
48
5
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.25
48
3
25
16
0.972222
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5