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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3c261aa4447bb3fa1e9312a043e213b1eb8cc077
| 147
|
py
|
Python
|
tests/model_package/models/__init__.py
|
webjunkie/django
|
5dbca13f3baa2e1bafd77e84a80ad6d8a074712e
|
[
"BSD-3-Clause"
] | 790
|
2015-01-03T02:13:39.000Z
|
2020-05-10T19:53:57.000Z
|
AppServer/lib/django-1.5/tests/modeltests/model_package/models/__init__.py
|
nlake44/appscale
|
6944af660ca4cb772c9b6c2332ab28e5ef4d849f
|
[
"Apache-2.0"
] | 1,361
|
2015-01-08T23:09:40.000Z
|
2020-04-14T00:03:04.000Z
|
AppServer/lib/django-1.5/tests/modeltests/model_package/models/__init__.py
|
nlake44/appscale
|
6944af660ca4cb772c9b6c2332ab28e5ef4d849f
|
[
"Apache-2.0"
] | 155
|
2015-01-08T22:59:31.000Z
|
2020-04-08T08:01:53.000Z
|
# Import all the models from subpackages
from __future__ import absolute_import
from .article import Article
from .publication import Publication
| 24.5
| 40
| 0.843537
| 19
| 147
| 6.263158
| 0.526316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136054
| 147
| 5
| 41
| 29.4
| 0.937008
| 0.258503
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3c593c93f7f9baa15ed58e3cc98b0231fef96701
| 2,942
|
py
|
Python
|
wsgi.py
|
p3t3r67x0/zackig-backend
|
6bfbd9a2beeff948cafffff62ca060a57651a460
|
[
"MIT"
] | null | null | null |
wsgi.py
|
p3t3r67x0/zackig-backend
|
6bfbd9a2beeff948cafffff62ca060a57651a460
|
[
"MIT"
] | null | null | null |
wsgi.py
|
p3t3r67x0/zackig-backend
|
6bfbd9a2beeff948cafffff62ca060a57651a460
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# custom imports
from app import app, api, mongo
from resources import resources as res
api.add_resource(res.UserSignup, '/signup')
api.add_resource(res.UserSignin, '/signin')
api.add_resource(res.TokenRefresh, '/token/refresh')
api.add_resource(res.ConfirmToken, '/confirm')
api.add_resource(res.ChangePassword, '/change')
api.add_resource(res.ResetPassword, '/reset')
api.add_resource(res.User, '/user', '/user/<string:id>')
api.add_resource(res.UserList, '/user/list')
api.add_resource(res.UserAvatar, '/user/avatar/<string:id>')
api.add_resource(res.UserProfile, '/user/profile/<string:id>')
api.add_resource(res.UserLastseen, '/user/lastseen/<string:id>')
api.add_resource(res.UserChangePassword, '/user/change/<string:id>')
api.add_resource(res.UserDeleteAccount, '/user/delete/account')
api.add_resource(res.UserChallenge, '/user/challenge')
api.add_resource(res.UserExport, '/user/export')
api.add_resource(res.Challenge, '/challenge', '/challenge/<string:id>')
api.add_resource(res.ChallengeList, '/challenge/list')
api.add_resource(res.ChallengeSubscription, '/challenge/subscription')
api.add_resource(res.ChallengeSubscriptionList, '/challenge/subscription/list')
api.add_resource(res.ChallengeExport, '/challenge/export')
api.add_resource(res.ChallengeTask, '/challenge/task',
'/challenge/task/<string:id>')
api.add_resource(res.ChallengeTaskDetail, '/challenge/task/detail',
'/challenge/task/detail/<string:id>')
api.add_resource(res.ChallengeTaskProgress, '/challenge/task/progress')
api.add_resource(res.ChallengeTaskFormExport, '/challenge/task/form/export')
api.add_resource(res.ChallengeTaskResponseExport,
'/challenge/task/response/export')
api.add_resource(res.ChallengeTaskResponse, '/challenge/task/response',
'/challenge/task/response/<string:id>')
api.add_resource(res.ChallengeTaskFormList, '/challenge/task/form/list')
api.add_resource(res.ChallengeTaskForm, '/challenge/task/form',
'/challenge/task/form/<string:id>')
api.add_resource(res.ChallengeRequestList, '/challenge/request/list')
api.add_resource(res.ChallengeRequest, '/challenge/request',
'/challenge/request/<string:id>')
api.add_resource(res.MailTemplate, '/template', '/template/<string:id>')
api.add_resource(res.MailTemplateList, '/template/list')
api.add_resource(res.WikiEntry, '/wiki/entry', '/wiki/entry/<string:id>')
api.add_resource(res.WikiEntryTag, '/wiki/entry/tag')
api.add_resource(res.WikiEntrySearch, '/wiki/entry/search')
api.add_resource(res.WikiEntryList, '/wiki/entry/list')
api.add_resource(res.LandingPage, '/landing')
api.add_resource(res.Fetch, '/fetch')
# create index on collections
mongo.db.users.create_index([('email', 1)], unique=True)
mongo.db.entries.create_index([('title', 'text'), ('content', 'text')])
if __name__ == '__main__':
# print(app.url_map)
app.run(debug=True)
| 43.264706
| 79
| 0.746091
| 367
| 2,942
| 5.847411
| 0.286104
| 0.106244
| 0.247903
| 0.301025
| 0.262815
| 0.151445
| 0
| 0
| 0
| 0
| 0
| 0.000741
| 0.082937
| 2,942
| 67
| 80
| 43.910448
| 0.794663
| 0.028212
| 0
| 0
| 0
| 0
| 0.316637
| 0.192995
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.06
| 0.04
| 0
| 0.04
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
3c59d6e2119082f4c8f0df1fe8aee1e0a52b901a
| 201
|
py
|
Python
|
src/types/bytearray_item.py
|
ontio-community/ontology-python-vm
|
24ce076aa8b7af0a7988fa7adb4bb12a2f52f0f2
|
[
"MIT"
] | null | null | null |
src/types/bytearray_item.py
|
ontio-community/ontology-python-vm
|
24ce076aa8b7af0a7988fa7adb4bb12a2f52f0f2
|
[
"MIT"
] | null | null | null |
src/types/bytearray_item.py
|
ontio-community/ontology-python-vm
|
24ce076aa8b7af0a7988fa7adb4bb12a2f52f0f2
|
[
"MIT"
] | 1
|
2018-10-08T05:15:01.000Z
|
2018-10-08T05:15:01.000Z
|
from src.types.stack_items import StackItems
class ByteArrayItem(StackItems):
def __init__(self, val: bytearray):
self.value = val
def get_bytearray(self):
return self.value
| 20.1
| 44
| 0.701493
| 25
| 201
| 5.4
| 0.68
| 0.192593
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.218905
| 201
| 10
| 45
| 20.1
| 0.859873
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.166667
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
3c639a797521aa7f5d7329e3c38765036bf93c01
| 128
|
py
|
Python
|
defs/__init__.py
|
scionrep/scioncc_new
|
086be085b69711ee24c4c86ed42f2109ca0db027
|
[
"BSD-2-Clause"
] | 2
|
2015-10-05T20:36:35.000Z
|
2018-11-21T11:45:24.000Z
|
defs/__init__.py
|
scionrep/scioncc_new
|
086be085b69711ee24c4c86ed42f2109ca0db027
|
[
"BSD-2-Clause"
] | 21
|
2015-03-18T14:39:32.000Z
|
2016-07-01T17:16:29.000Z
|
defs/__init__.py
|
scionrep/scioncc_new
|
086be085b69711ee24c4c86ed42f2109ca0db027
|
[
"BSD-2-Clause"
] | 12
|
2015-03-18T10:53:49.000Z
|
2018-06-21T11:19:57.000Z
|
# Declare as Python package, such that setuptools can include the data files
# (YML, SQL, etc) with the binary egg distribution.
| 64
| 76
| 0.773438
| 20
| 128
| 4.95
| 0.95
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164063
| 128
| 2
| 77
| 64
| 0.925234
| 0.96875
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3c6e8746f34b2e1dd925de11988fb63e102ef924
| 93
|
py
|
Python
|
manager/DBManager.py
|
eric2861994/stalestockBEAT
|
abc8a8cb25e38a2bba6f2ef4216142f809421791
|
[
"MIT"
] | null | null | null |
manager/DBManager.py
|
eric2861994/stalestockBEAT
|
abc8a8cb25e38a2bba6f2ef4216142f809421791
|
[
"MIT"
] | null | null | null |
manager/DBManager.py
|
eric2861994/stalestockBEAT
|
abc8a8cb25e38a2bba6f2ef4216142f809421791
|
[
"MIT"
] | null | null | null |
class DBManager(object):
def __init__(self, dbConnection):
self.c = dbConnection
| 23.25
| 37
| 0.688172
| 10
| 93
| 6
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.215054
| 93
| 3
| 38
| 31
| 0.821918
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
3c843b991f84adff6d943fc1053ed42ca0d55180
| 314
|
py
|
Python
|
api/routers/registration.py
|
oil-rope/oil-and-rope
|
6d59c87d4809f120417a90c1624952085486bb06
|
[
"MIT"
] | 8
|
2019-08-27T20:08:22.000Z
|
2021-07-23T22:49:47.000Z
|
api/routers/registration.py
|
oil-rope/oil-and-rope
|
6d59c87d4809f120417a90c1624952085486bb06
|
[
"MIT"
] | 73
|
2020-03-11T18:07:29.000Z
|
2022-03-28T18:07:47.000Z
|
api/routers/registration.py
|
oil-rope/oil-and-rope
|
6d59c87d4809f120417a90c1624952085486bb06
|
[
"MIT"
] | 4
|
2020-02-22T19:44:17.000Z
|
2022-03-08T09:42:45.000Z
|
from ..viewsets.registration import ProfileViewSet, UserViewSet
from .routers import OilAndRopeDefaultRouter
router = OilAndRopeDefaultRouter()
router.register(prefix=r'user', viewset=UserViewSet, basename='user')
router.register(prefix=r'profile', viewset=ProfileViewSet, basename='profile')
urls = router.urls
| 34.888889
| 78
| 0.818471
| 33
| 314
| 7.787879
| 0.515152
| 0.225681
| 0.155642
| 0.163424
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.073248
| 314
| 8
| 79
| 39.25
| 0.883162
| 0
| 0
| 0
| 0
| 0
| 0.070064
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3c881692793fd58b3797653f455d4773779a422a
| 838
|
py
|
Python
|
django-website/agency/migrations/0008_auto_20170801_0717.py
|
evonove/evonove
|
5f5a27245a46a98502f182e3c75aa8e77aa62d42
|
[
"BSD-3-Clause"
] | 9
|
2016-01-07T14:57:55.000Z
|
2019-06-25T11:30:57.000Z
|
django-website/agency/migrations/0008_auto_20170801_0717.py
|
evonove/evonove
|
5f5a27245a46a98502f182e3c75aa8e77aa62d42
|
[
"BSD-3-Clause"
] | 64
|
2015-10-20T21:23:56.000Z
|
2022-01-12T10:03:28.000Z
|
django-website/agency/migrations/0008_auto_20170801_0717.py
|
evonove/evonove
|
5f5a27245a46a98502f182e3c75aa8e77aa62d42
|
[
"BSD-3-Clause"
] | 3
|
2016-08-06T14:29:00.000Z
|
2021-01-27T10:16:53.000Z
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 07:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agency', '0007_auto_20170731_1134'),
]
operations = [
migrations.RemoveField(
model_name='teammember',
name='deviantart',
),
migrations.RemoveField(
model_name='teammember',
name='flickr',
),
migrations.RemoveField(
model_name='teammember',
name='pinterest',
),
migrations.RemoveField(
model_name='teammember',
name='stackoverflow',
),
migrations.RemoveField(
model_name='teammember',
name='tumblr',
),
]
| 23.277778
| 48
| 0.551313
| 71
| 838
| 6.323944
| 0.56338
| 0.233853
| 0.289532
| 0.334076
| 0.489978
| 0.489978
| 0
| 0
| 0
| 0
| 0
| 0.059353
| 0.336516
| 838
| 35
| 49
| 23.942857
| 0.748201
| 0.081146
| 0
| 0.535714
| 1
| 0
| 0.160365
| 0.029987
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.071429
| 0
| 0.178571
| 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
| 0
| 0
| 0
| 0
|
0
| 4
|
3c8aaa3611f5066c501ebb709e132bb523054834
| 98
|
py
|
Python
|
src/dials/array_family/__init__.py
|
dials-src/dials
|
25055c1f6164dc33e672e7c5c6a9c5a35e870660
|
[
"BSD-3-Clause"
] | 1
|
2021-12-10T17:28:16.000Z
|
2021-12-10T17:28:16.000Z
|
src/dials/array_family/__init__.py
|
dials-src/dials
|
25055c1f6164dc33e672e7c5c6a9c5a35e870660
|
[
"BSD-3-Clause"
] | null | null | null |
src/dials/array_family/__init__.py
|
dials-src/dials
|
25055c1f6164dc33e672e7c5c6a9c5a35e870660
|
[
"BSD-3-Clause"
] | 1
|
2021-12-07T12:39:04.000Z
|
2021-12-07T12:39:04.000Z
|
from __future__ import annotations
import dials.model.data # noqa: F401; true import dependency
| 24.5
| 61
| 0.806122
| 13
| 98
| 5.769231
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0.142857
| 98
| 3
| 62
| 32.666667
| 0.857143
| 0.346939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b1b020a1529ec22157cdaf7973b5612347d974fe
| 92
|
py
|
Python
|
jspaste/temporal.py
|
pruebando/jspaste
|
cefe8789b9e1af958adc30cce7b88e991141a134
|
[
"MIT"
] | 1
|
2021-08-29T16:09:27.000Z
|
2021-08-29T16:09:27.000Z
|
jspaste/temporal.py
|
pruebando/jspaste
|
cefe8789b9e1af958adc30cce7b88e991141a134
|
[
"MIT"
] | null | null | null |
jspaste/temporal.py
|
pruebando/jspaste
|
cefe8789b9e1af958adc30cce7b88e991141a134
|
[
"MIT"
] | null | null | null |
from .vares import *
from .errors import InvalidArgs, NotArgs, UnknownError
import requests
| 23
| 54
| 0.815217
| 11
| 92
| 6.818182
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130435
| 92
| 3
| 55
| 30.666667
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b1eb86bbb912e3aa456312510a8eae54ff14a4e2
| 936
|
py
|
Python
|
data-processing/data/Caddell/scripts/12b-generate-B3DM-obj23dtiles.py
|
skolaric/smartcity
|
75ce4f26a0d6fb0296fc675572d2f00e5fa3690a
|
[
"MIT"
] | 1
|
2020-04-11T05:44:10.000Z
|
2020-04-11T05:44:10.000Z
|
data-processing/data/Caddell/scripts/12b-generate-B3DM-obj23dtiles.py
|
skolaric/smartcity
|
75ce4f26a0d6fb0296fc675572d2f00e5fa3690a
|
[
"MIT"
] | 4
|
2021-01-28T19:51:10.000Z
|
2022-03-25T18:42:25.000Z
|
data-processing/data/Caddell/scripts/12b-generate-B3DM-obj23dtiles.py
|
skolaric/dbl-smartcity
|
75ce4f26a0d6fb0296fc675572d2f00e5fa3690a
|
[
"MIT"
] | null | null | null |
import bpy
import os
import mathutils
import math
import sys
import uuid
print()
print("========================================================================================================================================")
print("This is Blender Python script that calls obj23dtiles")
print("Author: Sinisa Kolaric")
print()
#obj23dtiles_command = 'obj23dtiles '
obj23dtiles_command = 'node C:/dev/cesium/objTo3d-tiles-SK/bin/obj23dtiles.js '
obj23dtiles_command += '-i "./../CaddellEnergyZonesSK6.skp.dae.obj.postprocessed.obj" '
obj23dtiles_command += '--tileset '
obj23dtiles_command += '-p "./tileset-3d/CaddellEnergyZonesSK6.skp.dae.obj.postprocessed.obj-customTilesetOptions.json" '
obj23dtiles_command += '-c "./tileset-3d/CaddellEnergyZonesSK6.skp.dae.obj.postprocessed.obj-customBatchtable.json" '
print()
print('Invoking the following command:')
print(obj23dtiles_command)
print()
os.system(obj23dtiles_command)
| 33.428571
| 145
| 0.66453
| 95
| 936
| 6.463158
| 0.473684
| 0.234528
| 0.131922
| 0.14658
| 0.254072
| 0.254072
| 0.179153
| 0.179153
| 0
| 0
| 0
| 0.032407
| 0.076923
| 936
| 27
| 146
| 34.666667
| 0.678241
| 0.03953
| 0
| 0.190476
| 0
| 0.095238
| 0.621229
| 0.472626
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.285714
| 0
| 0.285714
| 0.428571
| 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
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
b1ed03947c41cea83091017677cceb61780bdac1
| 73
|
py
|
Python
|
create_db.py
|
ICS-MU/westlife-accounting
|
34477f7d8122ffb09ba85a53d7491f4b6b6c67a8
|
[
"MIT"
] | null | null | null |
create_db.py
|
ICS-MU/westlife-accounting
|
34477f7d8122ffb09ba85a53d7491f4b6b6c67a8
|
[
"MIT"
] | null | null | null |
create_db.py
|
ICS-MU/westlife-accounting
|
34477f7d8122ffb09ba85a53d7491f4b6b6c67a8
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python3
from db import Database
db = Database()
db.create()
| 10.428571
| 23
| 0.69863
| 11
| 73
| 4.636364
| 0.727273
| 0.392157
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016129
| 0.150685
| 73
| 6
| 24
| 12.166667
| 0.806452
| 0.232877
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
590e836bc67dc59c14be679e949c232e060607d6
| 243
|
py
|
Python
|
wagtailcommerce/carts/apps.py
|
wagtail-commerce/wagtail-commerce
|
308ed8348483806c16062d09a7e69ec44d9a2e73
|
[
"BSD-3-Clause"
] | 3
|
2019-04-12T15:38:43.000Z
|
2019-09-22T10:23:20.000Z
|
wagtailcommerce/carts/apps.py
|
wagtailcommerce/wagtailcommerce
|
308ed8348483806c16062d09a7e69ec44d9a2e73
|
[
"BSD-3-Clause"
] | null | null | null |
wagtailcommerce/carts/apps.py
|
wagtailcommerce/wagtailcommerce
|
308ed8348483806c16062d09a7e69ec44d9a2e73
|
[
"BSD-3-Clause"
] | null | null | null |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class CartsAppConfig(AppConfig):
name = 'wagtailcommerce.carts'
label = 'wagtailcommerce_carts'
verbose_name = _('Wagtail Commerce Carts')
| 27
| 55
| 0.773663
| 27
| 243
| 6.777778
| 0.703704
| 0.10929
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152263
| 243
| 8
| 56
| 30.375
| 0.88835
| 0
| 0
| 0
| 0
| 0
| 0.263374
| 0.17284
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
592a4ea9c11f5f5ee6fd59ccce2a1744719a9926
| 1,190
|
py
|
Python
|
python/tHome/sma/test/acTotalPower.py
|
ZigmundRat/T-Home
|
5dc8689f52d87dac890051e540b338b009293ced
|
[
"BSD-2-Clause"
] | 18
|
2016-04-17T19:39:28.000Z
|
2020-11-19T06:55:20.000Z
|
python/tHome/sma/test/acTotalPower.py
|
ZigmundRat/T-Home
|
5dc8689f52d87dac890051e540b338b009293ced
|
[
"BSD-2-Clause"
] | 6
|
2016-10-31T13:53:45.000Z
|
2019-03-20T20:47:03.000Z
|
python/tHome/sma/test/acTotalPower.py
|
ZigmundRat/T-Home
|
5dc8689f52d87dac890051e540b338b009293ced
|
[
"BSD-2-Clause"
] | 12
|
2016-10-31T12:29:08.000Z
|
2021-12-28T12:18:28.000Z
|
import unittest
from FakeSocket import FakeSocket
import tHome as T
#===========================================================================
#===========================================================================
class TestAcTotalPower ( T.util.test.Case ) :
def test_acTotalPower( self ):
reply = """
53 4D 41 00 00 04 02 A0 00 00
00 01 00 42 00 10 60 65 10 90
7D 00 AB 94 40 3B 00 A0 F7 00
E0 27 06 72 00 00 00 00 00 00
12 80 01 02 00 51 00 00 00 00
00 00 00 00 01 3F 26 40 86 22
AF 53 6A 0F 00 00 6A 0F 00 00
6A 0F 00 00 6A 0F 00 00 01 00
00 00 00 00 00 00
"""
l = T.sma.Link( "fake", connect=False )
try:
l.socket = FakeSocket( T.util.hex.toBytes( reply ) )
o1 = l.acTotalPower()
l.decode = False
buf, decoder = l.acTotalPower()
o2 = decoder( buf )
finally:
l.socket = None
right = T.util.Data(
acPower = 3946.0,
)
print o1
for k in right.keys():
r = right[k]
self.eq( getattr( o1, k ), r, k )
self.eq( getattr( o2, k ), r, k )
#===========================================================================
| 27.045455
| 76
| 0.444538
| 171
| 1,190
| 3.087719
| 0.461988
| 0.189394
| 0.181818
| 0.181818
| 0.140152
| 0.140152
| 0.117424
| 0.060606
| 0.060606
| 0.060606
| 0
| 0.192857
| 0.294118
| 1,190
| 43
| 77
| 27.674419
| 0.435714
| 0.189076
| 0
| 0
| 0
| 0
| 0.273389
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.090909
| null | null | 0.030303
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3ca5ab562ecf6e705906771e6ed5aae7d54a4599
| 82
|
py
|
Python
|
api/constants.py
|
inovizz/sms-api
|
bdfce3407efe2f160d91e305eff50b1565d6b751
|
[
"Apache-2.0"
] | null | null | null |
api/constants.py
|
inovizz/sms-api
|
bdfce3407efe2f160d91e305eff50b1565d6b751
|
[
"Apache-2.0"
] | null | null | null |
api/constants.py
|
inovizz/sms-api
|
bdfce3407efe2f160d91e305eff50b1565d6b751
|
[
"Apache-2.0"
] | null | null | null |
"""Python file to maintain some constants."""
REG_EX = "^STOP(\\r\\n|\\r|\\n)?$"
| 20.5
| 45
| 0.573171
| 13
| 82
| 3.538462
| 0.846154
| 0.086957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121951
| 82
| 3
| 46
| 27.333333
| 0.638889
| 0.47561
| 0
| 0
| 0
| 0
| 0.621622
| 0.621622
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3cddb9e5fc340247efb6488b2f93fd9ae7328248
| 307
|
py
|
Python
|
application/model/entity/aula.py
|
DelgadGuilherme/Ava2.0
|
85e3c660fabb0c6cc57164ff3adf9486ce5cedc7
|
[
"Apache-2.0"
] | null | null | null |
application/model/entity/aula.py
|
DelgadGuilherme/Ava2.0
|
85e3c660fabb0c6cc57164ff3adf9486ce5cedc7
|
[
"Apache-2.0"
] | null | null | null |
application/model/entity/aula.py
|
DelgadGuilherme/Ava2.0
|
85e3c660fabb0c6cc57164ff3adf9486ce5cedc7
|
[
"Apache-2.0"
] | null | null | null |
class Aula:
def __init__(self, id, numero, titulo):
self._id = id
self._numero = numero
self._titulo = titulo
def get_id(self):
return self._id
def get_numero(self):
return self._numero
def get_titulo(self):
return self._titulo
| 21.928571
| 44
| 0.570033
| 38
| 307
| 4.263158
| 0.263158
| 0.111111
| 0.259259
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.348534
| 307
| 14
| 45
| 21.928571
| 0.81
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.363636
| false
| 0
| 0
| 0.272727
| 0.727273
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
3ceea7bcd6d302d69a0d53b0c91549f3e97b6e2e
| 3,380
|
py
|
Python
|
tests/test_config.py
|
alphagov/dockdev
|
ea76bdc3d73422aa326710fd02e2cf688903d940
|
[
"MIT"
] | 1
|
2016-08-06T05:27:36.000Z
|
2016-08-06T05:27:36.000Z
|
tests/test_config.py
|
alphagov/dockdev
|
ea76bdc3d73422aa326710fd02e2cf688903d940
|
[
"MIT"
] | 3
|
2015-09-08T09:54:14.000Z
|
2019-10-14T16:52:05.000Z
|
tests/test_config.py
|
alphagov/dockdev
|
ea76bdc3d73422aa326710fd02e2cf688903d940
|
[
"MIT"
] | 2
|
2019-08-29T11:39:01.000Z
|
2021-04-10T19:32:08.000Z
|
#!/usr/bin/env python
from dockdev.dockdev import parse_config
import os
from nose.tools import assert_equal
from nose.tools import assert_not_equal
from nose.tools import assert_raises
from nose.tools import assert_in
from nose.tools import raises
class TestConfig(object):
def test_empty(self):
parse_config('{ "services": {} }')
def test_basic(self):
services = parse_config('{ "services": { "service1": { "git_repo": "abc", "docker_repo": "def", "build_dir": "ghi" } } }')
assert_equal(1, len(services))
assert_equal("service1", services[0].name)
assert_equal("abc", services[0].git_url)
assert_equal("def", services[0].docker_repo)
assert_equal("ghi", services[0].build_dir)
def test_two(self):
services = parse_config('{ "services": { ' +
'"service1": { "git_repo": "abc", "docker_repo": "def", "build_dir": "ghi" }, ' +
'"service2": { "git_repo": "123", "docker_repo": "456", "build_dir": "789" } ' +
'} }')
assert_equal(2, len(services))
assert_equal("service1", services[1].name)
assert_equal("abc", services[1].git_url)
assert_equal("def", services[1].docker_repo)
assert_equal("ghi", services[1].build_dir)
assert_equal("service2", services[0].name)
assert_equal("123", services[0].git_url)
assert_equal("456", services[0].docker_repo)
assert_equal("789", services[0].build_dir)
def test_name_replacement(self):
services = parse_config('{ "services": { "service1": { "git_repo": "{name}.git", "docker_repo": "def", "build_dir": "ghi" } } }')
assert_equal(1, len(services))
assert_equal("service1.git", services[0].git_url)
def test_env_replacement(self):
os.environ['JUST_FOR_TESTING'] = 'TESTING'
services = parse_config('{ "services": { "service1": { "git_repo": "abc", "docker_repo": "def", "build_dir": "$JUST_FOR_TESTING/foo" } } }')
assert_equal(1, len(services))
assert_equal("TESTING/foo", services[0].build_dir)
def test_template(self):
services = parse_config('{ "template": { "git_repo": "abc", "docker_repo": "def", "build_dir": "ghi" }, "services" : { "service1": {}, "service2" : {} } }')
assert_equal(2, len(services))
assert_equal("service2", services[0].name)
assert_equal("abc", services[0].git_url)
assert_equal("def", services[0].docker_repo)
assert_equal("ghi", services[0].build_dir)
assert_equal("service1", services[1].name)
assert_equal("abc", services[1].git_url)
assert_equal("def", services[1].docker_repo)
assert_equal("ghi", services[1].build_dir)
def test_template_name_replacement(self):
services = parse_config('{ "template": { "git_repo": "{name}.git", "docker_repo": "def", "build_dir": "ghi" }, "services" : { "service1": {} } }')
assert_equal(1, len(services))
assert_equal("service1", services[0].name)
assert_equal("service1.git", services[0].git_url)
def test_template_override(self):
services = parse_config('{ "template": { "git_repo": "abc", "docker_repo": "def", "build_dir": "ghi" }, "services" : { "service1": { "git_repo": "123" } } }')
assert_equal(1, len(services))
assert_equal("123", services[0].git_url)
| 42.78481
| 166
| 0.623077
| 418
| 3,380
| 4.782297
| 0.126794
| 0.181591
| 0.066533
| 0.063032
| 0.838919
| 0.802401
| 0.709355
| 0.618809
| 0.56028
| 0.56028
| 0
| 0.026957
| 0.198817
| 3,380
| 79
| 167
| 42.78481
| 0.711226
| 0.005917
| 0
| 0.483333
| 0
| 0.133333
| 0.30744
| 0.006845
| 0
| 0
| 0
| 0
| 0.6
| 1
| 0.133333
| false
| 0
| 0.116667
| 0
| 0.266667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3cf42200ce1e1bb755b09cda36769a7a7d61507c
| 732
|
py
|
Python
|
routes/resources_routes.py
|
FranGarciaLopez/quizer-api
|
b1fc3f94d417739d0cea2dffb39436701f3c46f5
|
[
"MIT"
] | null | null | null |
routes/resources_routes.py
|
FranGarciaLopez/quizer-api
|
b1fc3f94d417739d0cea2dffb39436701f3c46f5
|
[
"MIT"
] | null | null | null |
routes/resources_routes.py
|
FranGarciaLopez/quizer-api
|
b1fc3f94d417739d0cea2dffb39436701f3c46f5
|
[
"MIT"
] | null | null | null |
from imports import Resources, request
from __main__ import app, db
#resources-------------------------------------------------------#
@app.route('/resources', methods=['POST'])
def resources_post():
return Resources(db).post(request.json)
@app.route('/resources', methods=['GET'])
def resources_get():
return Resources(db).get_all()
@app.route('/resources/<int:topic_id>', methods= ['GET'])
def resource_get(topic_id):
return Resources(db).get_one(topic_id)
@app.route('/resources/<int:topic_id>', methods=['PUT'])
def resource_put(topic_id):
return Resources(db).put(topic_id)
@app.route('/resources/<int:topic_id>', methods=['DELETE'])
def resource_delete(topic_id):
return Resources(db).delete(topic_id)
| 31.826087
| 66
| 0.668033
| 96
| 732
| 4.885417
| 0.239583
| 0.134328
| 0.181237
| 0.127932
| 0.400853
| 0.247335
| 0.247335
| 0.17484
| 0.17484
| 0
| 0
| 0
| 0.090164
| 732
| 23
| 67
| 31.826087
| 0.704204
| 0.087432
| 0
| 0
| 0
| 0
| 0.170915
| 0.112444
| 0
| 0
| 0
| 0
| 0
| 1
| 0.294118
| false
| 0
| 0.117647
| 0.294118
| 0.705882
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
595757b9f17e134a36438cde748d7ac62237df5d
| 83
|
py
|
Python
|
0104/test1.py
|
eto/study
|
95f506569657c174bf2347b5240768fafedaa285
|
[
"BSD-3-Clause"
] | null | null | null |
0104/test1.py
|
eto/study
|
95f506569657c174bf2347b5240768fafedaa285
|
[
"BSD-3-Clause"
] | null | null | null |
0104/test1.py
|
eto/study
|
95f506569657c174bf2347b5240768fafedaa285
|
[
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
import mediapipe as mp
mp_face_mesh = mp.solutions.face_mesh
| 20.75
| 37
| 0.795181
| 15
| 83
| 4.2
| 0.733333
| 0.253968
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 83
| 3
| 38
| 27.666667
| 0.851351
| 0.240964
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
598d9573215bf4384e22de0cfbb591b04ec76a31
| 29
|
py
|
Python
|
doc/version.py
|
DougReeder/remotestorage.js
|
92a3c84264c7d1df2532beb7b9bda300a16a8516
|
[
"MIT"
] | 1,737
|
2015-01-06T18:00:50.000Z
|
2022-03-28T14:49:31.000Z
|
doc/version.py
|
allanavelar/remotestorage.js
|
5b580e8e959a34e7ed2ab89e417929ebb3d04c90
|
[
"MIT"
] | 437
|
2015-01-01T08:38:21.000Z
|
2022-01-21T19:49:00.000Z
|
doc/version.py
|
allanavelar/remotestorage.js
|
5b580e8e959a34e7ed2ab89e417929ebb3d04c90
|
[
"MIT"
] | 119
|
2015-01-13T12:15:20.000Z
|
2022-01-08T15:38:53.000Z
|
__version__ = '2.0.0-beta.1'
| 14.5
| 28
| 0.655172
| 6
| 29
| 2.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 0.103448
| 29
| 1
| 29
| 29
| 0.423077
| 0
| 0
| 0
| 0
| 0
| 0.413793
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
59a073e6425c255ebff4d0dc55f106649ff25364
| 104
|
py
|
Python
|
anomaly/analyze.py
|
roninio1/anomaly
|
85a62cd80728330ff8f6c6f6efd46595ad9b6a0d
|
[
"Apache-2.0"
] | null | null | null |
anomaly/analyze.py
|
roninio1/anomaly
|
85a62cd80728330ff8f6c6f6efd46595ad9b6a0d
|
[
"Apache-2.0"
] | null | null | null |
anomaly/analyze.py
|
roninio1/anomaly
|
85a62cd80728330ff8f6c6f6efd46595ad9b6a0d
|
[
"Apache-2.0"
] | null | null | null |
# AUTOGENERATED! DO NOT EDIT! File to edit: 03_analyze.ipynb (unless otherwise specified).
__all__ = []
| 34.666667
| 90
| 0.75
| 14
| 104
| 5.214286
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022472
| 0.144231
| 104
| 3
| 91
| 34.666667
| 0.797753
| 0.846154
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
59df19433d5fedc855ebdbe95f05e9ec8df92bf5
| 174
|
py
|
Python
|
product/views.py
|
BirdOnTheBranch/-warehouse
|
971d5742f1c66379918e2f58c428ec4c6dba84d3
|
[
"MIT"
] | null | null | null |
product/views.py
|
BirdOnTheBranch/-warehouse
|
971d5742f1c66379918e2f58c428ec4c6dba84d3
|
[
"MIT"
] | null | null | null |
product/views.py
|
BirdOnTheBranch/-warehouse
|
971d5742f1c66379918e2f58c428ec4c6dba84d3
|
[
"MIT"
] | null | null | null |
#from my_app import app
from flask import Blueprint
product = Blueprint('product',__name__)
@product.route('/')
@product.route('/home')
def index():
return "Hola mundo"
| 17.4
| 39
| 0.718391
| 23
| 174
| 5.217391
| 0.652174
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132184
| 174
| 9
| 40
| 19.333333
| 0.794702
| 0.126437
| 0
| 0
| 0
| 0
| 0.152318
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.166667
| 0.166667
| 0.5
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
ab744c1b77d3195f39cf1079317704e8b369de09
| 718
|
py
|
Python
|
Lib/site-packages/spyder/plugins/help/utils/__init__.py
|
hirorin-demon/hirorin-streamlit
|
03fbb6f03ec94f909d451e708a3b30b177607695
|
[
"0BSD"
] | 1
|
2020-08-14T14:11:20.000Z
|
2020-08-14T14:11:20.000Z
|
Lib/site-packages/spyder/plugins/help/utils/__init__.py
|
hirorin-demon/hirorin-streamlit
|
03fbb6f03ec94f909d451e708a3b30b177607695
|
[
"0BSD"
] | null | null | null |
Lib/site-packages/spyder/plugins/help/utils/__init__.py
|
hirorin-demon/hirorin-streamlit
|
03fbb6f03ec94f909d451e708a3b30b177607695
|
[
"0BSD"
] | null | null | null |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Project Contributors and others (see LICENSE.txt)
#
# Licensed under the terms of the MIT and other licenses where noted
# (see LICENSE.txt in this directory and NOTICE.txt in the root for details)
# -----------------------------------------------------------------------------
"""
spyder.plugins.help.utils
=================
Configuration files for the Help plugin rich text mode.
See their headers, LICENSE.txt in this directory or NOTICE.txt for licenses.
"""
import sys
from spyder.config.base import get_module_source_path
sys.path.insert(0, get_module_source_path(__name__))
| 34.190476
| 79
| 0.579387
| 86
| 718
| 4.72093
| 0.639535
| 0.073892
| 0.064039
| 0.078818
| 0.123153
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009449
| 0.115599
| 718
| 20
| 80
| 35.9
| 0.629921
| 0.802228
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ab7572fe59a8c7619c110373274253fef54ac313
| 66
|
py
|
Python
|
python/testData/psi/PatternMatchingMatchLooksLikeIndexing.py
|
06needhamt/intellij-community
|
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
|
[
"Apache-2.0"
] | null | null | null |
python/testData/psi/PatternMatchingMatchLooksLikeIndexing.py
|
06needhamt/intellij-community
|
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
|
[
"Apache-2.0"
] | null | null | null |
python/testData/psi/PatternMatchingMatchLooksLikeIndexing.py
|
06needhamt/intellij-community
|
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
|
[
"Apache-2.0"
] | null | null | null |
match [0]:
case [0]:
if match[0]:
match[0]
| 16.5
| 20
| 0.378788
| 9
| 66
| 2.777778
| 0.444444
| 0.72
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0.454545
| 66
| 4
| 21
| 16.5
| 0.583333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ab9357bdb6b3271397737b1f71460fd349cf542d
| 181
|
py
|
Python
|
util/data/dataloader.py
|
sonic1sonic/PyTorch-CIFAR10
|
a7413a1d05ede550e8a3d0e3d09e3e5f7f67cb23
|
[
"MIT"
] | 10
|
2018-01-07T08:02:11.000Z
|
2021-07-23T00:48:05.000Z
|
util/data/dataloader.py
|
sonic1sonic/PyTorch-CIFAR10
|
a7413a1d05ede550e8a3d0e3d09e3e5f7f67cb23
|
[
"MIT"
] | null | null | null |
util/data/dataloader.py
|
sonic1sonic/PyTorch-CIFAR10
|
a7413a1d05ede550e8a3d0e3d09e3e5f7f67cb23
|
[
"MIT"
] | 3
|
2018-05-26T08:39:57.000Z
|
2021-03-02T04:00:35.000Z
|
from torch.utils.data import DataLoader
class CifarDataloader(DataLoader):
def __init__(self, *args, **kwargs):
super(CifarDataloader, self).__init__(*args, **kwargs)
| 25.857143
| 62
| 0.723757
| 20
| 181
| 6.15
| 0.7
| 0.162602
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149171
| 181
| 6
| 63
| 30.166667
| 0.798701
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
aba38c50d373d795d19737603aea87e8d26cabef
| 193
|
py
|
Python
|
dynamite/__init__.py
|
dynamics-of-stellar-systems/dynamite_release
|
a921d8a1bde98f48daeea78213fb17b3edb223bb
|
[
"MIT"
] | 7
|
2020-10-14T12:22:25.000Z
|
2022-01-31T15:32:59.000Z
|
dynamite/__init__.py
|
dynamics-of-stellar-systems/dynamite_release
|
a921d8a1bde98f48daeea78213fb17b3edb223bb
|
[
"MIT"
] | 4
|
2022-02-25T16:05:40.000Z
|
2022-03-28T15:15:16.000Z
|
dynamite/__init__.py
|
dynamics-of-stellar-systems/dynamite
|
5ccf936e4b1cd907db8dd7070d4ad204ed913337
|
[
"MIT"
] | 2
|
2020-11-04T04:36:40.000Z
|
2021-09-01T01:07:38.000Z
|
from dynamite import data, orblib, physical_system, weight_solvers, parameter_space, model, config_reader, model_iterator, kinematics, plotter, myrand
from dynamite._version import __version__
| 64.333333
| 150
| 0.849741
| 24
| 193
| 6.416667
| 0.791667
| 0.155844
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093264
| 193
| 2
| 151
| 96.5
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
abc64a451b79bbd4635d419a814a1b48af6453f4
| 381
|
py
|
Python
|
avscript/avs/globals.py
|
kenlowrie/avscript
|
7e3550adc46a01785ea89cdcd9ddaa5ac35bdbdd
|
[
"Apache-2.0"
] | 1
|
2021-09-30T19:29:30.000Z
|
2021-09-30T19:29:30.000Z
|
avscript/avs/globals.py
|
kenlowrie/avscript
|
7e3550adc46a01785ea89cdcd9ddaa5ac35bdbdd
|
[
"Apache-2.0"
] | 7
|
2018-07-16T22:52:55.000Z
|
2020-05-20T23:48:36.000Z
|
avscript/avs/globals.py
|
kenlowrie/avscript
|
7e3550adc46a01785ea89cdcd9ddaa5ac35bdbdd
|
[
"Apache-2.0"
] | 1
|
2018-05-24T22:58:44.000Z
|
2018-05-24T22:58:44.000Z
|
#!/usr/bin/env python
from os.path import join, abspath, dirname, realpath
def _getBasepath():
return abspath(dirname(dirname(realpath(__file__))))
def init_globals():
return [
'@var _id="sys" basepath="{}" imports="{}"'.format(_getBasepath(), join(_getBasepath(),'import')),
]
if __name__ == '__main__':
print("Library module. Not directly callable.")
| 25.4
| 106
| 0.669291
| 43
| 381
| 5.534884
| 0.767442
| 0.117647
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15748
| 381
| 14
| 107
| 27.214286
| 0.741433
| 0.052493
| 0
| 0
| 0
| 0
| 0.258333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| true
| 0
| 0.222222
| 0.222222
| 0.666667
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
abd033dd7a9510132a5f07c62cf3d4ac985cb976
| 7,413
|
py
|
Python
|
config.py
|
BrightID/IDChain-Relayer
|
018dccd4c7a14e7f26447a95c6383b03659b4ee6
|
[
"0BSD"
] | 1
|
2020-07-13T21:36:54.000Z
|
2020-07-13T21:36:54.000Z
|
config.py
|
BrightID/IDChain-Relayer
|
018dccd4c7a14e7f26447a95c6383b03659b4ee6
|
[
"0BSD"
] | 1
|
2020-10-04T04:12:17.000Z
|
2020-10-04T04:12:17.000Z
|
config.py
|
BrightID/IDChain-Relayer
|
018dccd4c7a14e7f26447a95c6383b03659b4ee6
|
[
"0BSD"
] | null | null | null |
BRIGHTID_NODE = 'http://node.brightid.org/brightid/v5'
VERIFICATIONS_URL = BRIGHTID_NODE + '/verifications/idchain/'
OPERATION_URL = BRIGHTID_NODE + '/operations/'
CONTEXT = 'idchain'
RPC_URL = 'wss://idchain.one/ws/'
RELAYER_ADDRESS = '0x0df7eDDd60D613362ca2b44659F56fEbafFA9bFB'
DISTRIBUTION_ADDRESS = '0x6E39d7540c2ad4C18Eb29501183AFA79156e79aa'
DISTRIBUTION_ABI = '[{"inputs": [{"internalType": "address payable", "name": "beneficiary", "type": "address"}, {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "claim", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "previousOwner", "type": "address"}, {"indexed": true, "internalType": "address", "name": "newOwner", "type": "address"}], "name": "OwnershipTransferred", "type": "event"}, {"inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [{"internalType": "address", "name": "addr", "type": "address"}], "name": "setBrightid", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [{"internalType": "uint256", "name": "_claimable", "type": "uint256"}], "name": "setClaimable", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [{"internalType": "address", "name": "newOwner", "type": "address"}], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"stateMutability": "payable", "type": "receive"}, {"inputs": [], "name": "brightid", "outputs": [{"internalType": "contract BrightID", "name": "", "type": "address"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "claimable", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}, {"inputs": [{"internalType": "address", "name": "", "type": "address"}], "name": "claimed", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "owner", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "stateMutability": "view", "type": "function"}]'
BRIGHTID_ADDRESS = '0x72a70314C3adD56127413F78402392744af4EF64'
BRIGHTID_ABI = '[{"anonymous": false, "inputs": [{"indexed": false, "internalType": "contract IERC20", "name": "supervisorToken", "type": "address"}, {"indexed": false, "internalType": "contract IERC20", "name": "proposerToken", "type": "address"}], "name": "MembershipTokensSet", "type": "event"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "previousOwner", "type": "address"}, {"indexed": true, "internalType": "address", "name": "newOwner", "type": "address"}], "name": "OwnershipTransferred", "type": "event"}, {"inputs": [{"internalType": "bytes32", "name": "context", "type": "bytes32"}, {"internalType": "address[]", "name": "addrs", "type": "address[]"}, {"internalType": "uint8", "name": "v", "type": "uint8"}, {"internalType": "bytes32", "name": "r", "type": "bytes32"}, {"internalType": "bytes32", "name": "s", "type": "bytes32"}], "name": "propose", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "addr", "type": "address"}], "name": "Proposed", "type": "event"}, {"inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [{"internalType": "contract IERC20", "name": "_supervisorToken", "type": "address"}, {"internalType": "contract IERC20", "name": "_proposerToken", "type": "address"}], "name": "setMembershipTokens", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [{"internalType": "uint256", "name": "_waiting", "type": "uint256"}, {"internalType": "uint256", "name": "_timeout", "type": "uint256"}], "name": "setTiming", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "start", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"anonymous": false, "inputs": [], "name": "Started", "type": "event"}, {"inputs": [], "name": "stop", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "address", "name": "stopper", "type": "address"}], "name": "Stopped", "type": "event"}, {"anonymous": false, "inputs": [{"indexed": false, "internalType": "uint256", "name": "waiting", "type": "uint256"}, {"indexed": false, "internalType": "uint256", "name": "timeout", "type": "uint256"}], "name": "TimingSet", "type": "event"}, {"inputs": [{"internalType": "address", "name": "newOwner", "type": "address"}], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"anonymous": false, "inputs": [{"indexed": true, "internalType": "address", "name": "addr", "type": "address"}], "name": "Verified", "type": "event"}, {"inputs": [{"internalType": "bytes32", "name": "context", "type": "bytes32"}, {"internalType": "address[]", "name": "addrs", "type": "address[]"}], "name": "verify", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [{"internalType": "address", "name": "", "type": "address"}], "name": "history", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "stateMutability": "view", "type": "function"}, {"inputs": [{"internalType": "address", "name": "", "type": "address"}], "name": "isRevoked", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "owner", "outputs": [{"internalType": "address", "name": "", "type": "address"}], "stateMutability": "view", "type": "function"}, {"inputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}], "name": "proposals", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "proposerToken", "outputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "stopped", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "supervisorToken", "outputs": [{"internalType": "contract IERC20", "name": "", "type": "address"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "timeout", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}, {"inputs": [{"internalType": "address", "name": "", "type": "address"}], "name": "verifications", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "waiting", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}]'
NOT_FOUND = 2
NOT_SPONSORED = 4
CHAINID = '0x4a'
GAS = 500000
GAS_PRICE = 10000000000
WAITING_TIME_AFTER_PROPOSING = 15
LINK_CHECK_NUM = 18
LINK_CHECK_PERIOD = 10
SPONSOR_CHECK_NUM = 6
SPONSOR_CHECK_PERIOD = 10
HOST = 'localhost'
PORT = 5000
SPONSORSHIP_PRIVATEKEY = ''
RELAYER_PRIVATE = ''
| 239.129032
| 4,801
| 0.622825
| 651
| 7,413
| 7.043011
| 0.172043
| 0.08157
| 0.095311
| 0.094656
| 0.733043
| 0.730425
| 0.682443
| 0.636859
| 0.597601
| 0.50687
| 0
| 0.032599
| 0.093754
| 7,413
| 30
| 4,802
| 247.1
| 0.649896
| 0
| 0
| 0
| 0
| 0.083333
| 0.930932
| 0.035074
| 0
| 0
| 0.017537
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
abf46998632e82921e9424f605c2569902c00015
| 2,026
|
py
|
Python
|
syngenta_digital_alc/sns/record_client.py
|
syngenta-digital/package-python-alc
|
74c712d8a94078b922aca22e319a0cb4b035228b
|
[
"Apache-2.0"
] | null | null | null |
syngenta_digital_alc/sns/record_client.py
|
syngenta-digital/package-python-alc
|
74c712d8a94078b922aca22e319a0cb4b035228b
|
[
"Apache-2.0"
] | 10
|
2021-10-19T23:08:46.000Z
|
2022-01-12T23:17:19.000Z
|
syngenta_digital_alc/sns/record_client.py
|
syngenta-digital/package-python-alc
|
74c712d8a94078b922aca22e319a0cb4b035228b
|
[
"Apache-2.0"
] | null | null | null |
from syngenta_digital_alc.common import json_helper
class RecordClient:
def __init__(self, record):
self._record = record
@property
def event_source(self):
return self._record.get('EventSource')
@property
def event_version(self):
return self._record.get('EventVersion')
@property
def event_subscription_arn(self):
return self._record.get('EventSubscriptionArn')
@property
def sns_signature_version(self):
return self._record['Sns'].get('SignatureVersion')
@property
def sns_timestamp(self):
return self._record['Sns'].get('Timestamp')
@property
def sns_signature(self):
return self._record['Sns'].get('Signature')
@property
def sns_signing_cert_url(self):
return self._record['Sns'].get('SigningCertUrl')
@property
def sns_message(self):
return json_helper.try_decode_json(self._record['Sns'].get('Message'))
@property
def sns_message_attributes(self):
return self._record['Sns'].get('MessageAttributes')
@property
def sns_type(self):
return self._record['Sns'].get('Type')
@property
def sns_unsubscribe_url(self):
return self._record['Sns'].get('UnsubscribeUrl')
@property
def sns_topic_arn(self):
return self._record['Sns'].get('TopicArn')
@property
def sns_subject(self):
return self._record['Sns'].get('Subject')
def __str__(self):
return str({
'event_source': self.event_source,
'event_version': self.event_version,
'event_subscription_arn': self.event_subscription_arn,
'sns_signature_version': self.sns_signature_version,
'sns_timestamp': self.sns_timestamp,
'sns_signature': self.sns_signature,
'sns_signing_cert_url': self.sns_signing_cert_url,
'sns_message': self.sns_message,
'sns_type': self.sns_type,
'sns_subject': self.sns_subject
})
| 27.378378
| 78
| 0.646594
| 232
| 2,026
| 5.318966
| 0.193966
| 0.121556
| 0.136143
| 0.194489
| 0.294976
| 0.194489
| 0.047002
| 0
| 0
| 0
| 0
| 0
| 0.236426
| 2,026
| 73
| 79
| 27.753425
| 0.797673
| 0
| 0
| 0.232143
| 0
| 0
| 0.158934
| 0.021224
| 0
| 0
| 0
| 0
| 0
| 1
| 0.267857
| false
| 0
| 0.017857
| 0.25
| 0.553571
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
28048d8cbc2cea0ae4d002c4d42569d9a3232cfa
| 941
|
py
|
Python
|
Authentication/migrations/0001_initial.py
|
zhuxiyulu/CloudJudge
|
62ef8d75b0ddd194ea9813ec9df1f7baaa768f69
|
[
"Apache-2.0"
] | 1
|
2018-02-07T05:14:28.000Z
|
2018-02-07T05:14:28.000Z
|
Authentication/migrations/0001_initial.py
|
zhuxiyulu/CloudJudge
|
62ef8d75b0ddd194ea9813ec9df1f7baaa768f69
|
[
"Apache-2.0"
] | null | null | null |
Authentication/migrations/0001_initial.py
|
zhuxiyulu/CloudJudge
|
62ef8d75b0ddd194ea9813ec9df1f7baaa768f69
|
[
"Apache-2.0"
] | null | null | null |
# Generated by Django 2.0.1 on 2018-01-19 06:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=30, verbose_name='username')),
('password', models.CharField(max_length=30, verbose_name='password')),
('nickname', models.CharField(max_length=30, verbose_name='nickname')),
('school', models.CharField(max_length=50, null=True, verbose_name='school')),
('qq', models.CharField(max_length=20, verbose_name='qq')),
('email', models.CharField(max_length=50, verbose_name='email')),
],
),
]
| 34.851852
| 114
| 0.596174
| 101
| 941
| 5.405941
| 0.485149
| 0.141026
| 0.197802
| 0.263736
| 0.298535
| 0.203297
| 0.203297
| 0
| 0
| 0
| 0
| 0.038793
| 0.260361
| 941
| 26
| 115
| 36.192308
| 0.74569
| 0.047821
| 0
| 0
| 1
| 0
| 0.091723
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.052632
| 0.052632
| 0
| 0.263158
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
e61e3add0a90562d7681efd85749a2b821478d56
| 194
|
py
|
Python
|
docs/cookbook/shortcuts/create_shortcut_to_file.py
|
LuD1161/winshell
|
1509d211ab3403dd1cff6113e4e13462d6dec35b
|
[
"MIT"
] | 41
|
2015-02-06T19:15:07.000Z
|
2021-11-10T13:27:43.000Z
|
docs/cookbook/shortcuts/create_shortcut_to_file.py
|
LuD1161/winshell
|
1509d211ab3403dd1cff6113e4e13462d6dec35b
|
[
"MIT"
] | 6
|
2015-04-13T12:36:55.000Z
|
2022-03-28T13:36:16.000Z
|
docs/cookbook/shortcuts/create_shortcut_to_file.py
|
LuD1161/winshell
|
1509d211ab3403dd1cff6113e4e13462d6dec35b
|
[
"MIT"
] | 10
|
2015-01-14T07:20:42.000Z
|
2022-02-14T19:14:26.000Z
|
import os, sys
import winshell
shortcut = winshell.shortcut(sys.executable)
shortcut.working_directory = "c:/temp"
shortcut.write(os.path.join(winshell.desktop(), "python.lnk"))
shortcut.dump()
| 27.714286
| 62
| 0.778351
| 26
| 194
| 5.769231
| 0.653846
| 0.213333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072165
| 194
| 7
| 63
| 27.714286
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0.087179
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e62e8243dff717224aba0fcaf2c13cf442ea413d
| 176
|
py
|
Python
|
_build.py
|
patrick-russell/sottools
|
c63ffdc4b350c87d31260441dd8f4e5229ce123d
|
[
"MIT"
] | null | null | null |
_build.py
|
patrick-russell/sottools
|
c63ffdc4b350c87d31260441dd8f4e5229ce123d
|
[
"MIT"
] | null | null | null |
_build.py
|
patrick-russell/sottools
|
c63ffdc4b350c87d31260441dd8f4e5229ce123d
|
[
"MIT"
] | null | null | null |
import os
import click
import flask_s3
from app import app
@click.command()
def upload_assets():
flask_s3.create_all(app)
if __name__ == '__main__':
upload_assets()
| 13.538462
| 28
| 0.732955
| 26
| 176
| 4.461538
| 0.615385
| 0.12069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013699
| 0.170455
| 176
| 12
| 29
| 14.666667
| 0.780822
| 0
| 0
| 0
| 0
| 0
| 0.045714
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| true
| 0
| 0.444444
| 0
| 0.555556
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e631aa15cd9a7ebfb2dac13139720bd96b687405
| 198
|
py
|
Python
|
simpler_faq/views.py
|
petersanchez/django-simpler-faq
|
f3aa5d48afbbad653d5073b32fb593ad4e5f0e66
|
[
"MIT"
] | null | null | null |
simpler_faq/views.py
|
petersanchez/django-simpler-faq
|
f3aa5d48afbbad653d5073b32fb593ad4e5f0e66
|
[
"MIT"
] | null | null | null |
simpler_faq/views.py
|
petersanchez/django-simpler-faq
|
f3aa5d48afbbad653d5073b32fb593ad4e5f0e66
|
[
"MIT"
] | 2
|
2018-10-05T20:46:34.000Z
|
2021-02-05T16:37:52.000Z
|
from django.views.generic import ListView
from .models import Topic
class Topics(ListView):
template_name = 'simpler_faq/topic_list.html'
context_object_name = 'topics'
model = Topic
| 19.8
| 49
| 0.752525
| 26
| 198
| 5.538462
| 0.730769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171717
| 198
| 9
| 50
| 22
| 0.878049
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 0.136364
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e6481d986ccd23fdefcb3c8f75425f941cdab7fb
| 130
|
py
|
Python
|
yunorm/utils/tools.py
|
yunsonbai/yunorm
|
230fc758ed063359259df9b89b6b21dabe36d47c
|
[
"Apache-2.0"
] | 7
|
2019-03-21T10:37:53.000Z
|
2021-01-23T06:17:07.000Z
|
yunorm/utils/tools.py
|
yunsonbai/yunorm
|
230fc758ed063359259df9b89b6b21dabe36d47c
|
[
"Apache-2.0"
] | 1
|
2020-03-04T06:21:03.000Z
|
2020-03-05T01:27:43.000Z
|
yunorm/utils/tools.py
|
yunsonbai/yunorm
|
230fc758ed063359259df9b89b6b21dabe36d47c
|
[
"Apache-2.0"
] | 2
|
2019-12-26T07:46:39.000Z
|
2021-01-23T06:17:09.000Z
|
import hashlib
def get_md5(s):
sig_md5 = hashlib.md5()
sig_md5.update(s.encode("utf-8"))
return sig_md5.hexdigest()
| 16.25
| 37
| 0.669231
| 21
| 130
| 3.952381
| 0.619048
| 0.216867
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056604
| 0.184615
| 130
| 7
| 38
| 18.571429
| 0.726415
| 0
| 0
| 0
| 0
| 0
| 0.038462
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
050cc18e08f8dffa494bd7e676766323b5dbd7aa
| 51
|
py
|
Python
|
abc/085/A.py
|
tonko2/AtCoder
|
5d617072517881d226d7c8af09cb88684d41af7e
|
[
"Xnet",
"X11",
"CECILL-B"
] | 2
|
2022-01-22T07:56:58.000Z
|
2022-01-24T00:29:37.000Z
|
abc/085/A.py
|
tonko2/AtCoder
|
5d617072517881d226d7c8af09cb88684d41af7e
|
[
"Xnet",
"X11",
"CECILL-B"
] | null | null | null |
abc/085/A.py
|
tonko2/AtCoder
|
5d617072517881d226d7c8af09cb88684d41af7e
|
[
"Xnet",
"X11",
"CECILL-B"
] | null | null | null |
S = input().split("/")
print(f"2018/{S[1]}/{S[2]}")
| 25.5
| 28
| 0.490196
| 10
| 51
| 2.5
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0.058824
| 51
| 2
| 28
| 25.5
| 0.395833
| 0
| 0
| 0
| 0
| 0
| 0.365385
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
0518c0ac0b9e253ab91d3af7967d5ccb73e37984
| 173
|
py
|
Python
|
webserv.py
|
TheQuinton/demo-js
|
d9008efe04d39375e221e8d88e737615b7c0925c
|
[
"MIT"
] | null | null | null |
webserv.py
|
TheQuinton/demo-js
|
d9008efe04d39375e221e8d88e737615b7c0925c
|
[
"MIT"
] | null | null | null |
webserv.py
|
TheQuinton/demo-js
|
d9008efe04d39375e221e8d88e737615b7c0925c
|
[
"MIT"
] | null | null | null |
# Flask webserver framework
# Nothing built or functional yet
# TODO
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
| 15.727273
| 33
| 0.705202
| 23
| 173
| 5.130435
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179191
| 173
| 10
| 34
| 17.3
| 0.830986
| 0.358382
| 0
| 0
| 0
| 0
| 0.130841
| 0
| 0
| 0
| 0
| 0.1
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0.2
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
0519f77dd6963934c6eb57c74bb7b11d25b5a357
| 2,516
|
py
|
Python
|
mozillians/announcements/tests/test_managers.py
|
divyamoncy/mozillians
|
d53d1d05d1f05b74f8533541e37083dcb89b29a8
|
[
"BSD-3-Clause"
] | 202
|
2015-01-14T10:19:55.000Z
|
2021-12-11T06:04:16.000Z
|
mozillians/announcements/tests/test_managers.py
|
divyamoncy/mozillians
|
d53d1d05d1f05b74f8533541e37083dcb89b29a8
|
[
"BSD-3-Clause"
] | 2,924
|
2015-01-07T11:27:32.000Z
|
2021-01-19T14:05:17.000Z
|
mozillians/announcements/tests/test_managers.py
|
divyamoncy/mozillians
|
d53d1d05d1f05b74f8533541e37083dcb89b29a8
|
[
"BSD-3-Clause"
] | 270
|
2015-01-02T18:31:01.000Z
|
2021-02-17T20:57:44.000Z
|
import pytz
from datetime import datetime
from mock import patch
from nose.tools import eq_
from django.utils.timezone import make_aware
from mozillians.announcements.models import Announcement
from mozillians.announcements.tests import AnnouncementFactory, TestCase
class AnnouncementManagerTests(TestCase):
def setUp(self):
AnnouncementFactory.create(
publish_from=make_aware(datetime(2013, 2, 12), pytz.UTC),
publish_until=make_aware(datetime(2013, 2, 18), pytz.UTC))
AnnouncementFactory.create(
publish_from=make_aware(datetime(2013, 2, 15), pytz.UTC),
publish_until=make_aware(datetime(2013, 2, 17), pytz.UTC))
AnnouncementFactory.create(
publish_from=make_aware(datetime(2013, 2, 21), pytz.UTC),
publish_until=make_aware(datetime(2013, 2, 23), pytz.UTC))
@patch('mozillians.announcements.managers.now')
def test_published(self, mock_obj):
"""Test published() of Announcement Manager."""
mock_obj.return_value = make_aware(datetime(2013, 2, 10), pytz.UTC)
eq_(Announcement.objects.published().count(), 0)
mock_obj.return_value = make_aware(datetime(2013, 2, 13), pytz.UTC)
eq_(Announcement.objects.published().count(), 1)
mock_obj.return_value = make_aware(datetime(2013, 2, 16), pytz.UTC)
eq_(Announcement.objects.published().count(), 2)
mock_obj.return_value = make_aware(datetime(2013, 2, 19), pytz.UTC)
eq_(Announcement.objects.published().count(), 0)
mock_obj.return_value = make_aware(datetime(2013, 2, 24), pytz.UTC)
eq_(Announcement.objects.published().count(), 0)
@patch('mozillians.announcements.managers.now')
def test_unpublished(self, mock_obj):
"""Test unpublished() of Announcement Manager."""
mock_obj.return_value = make_aware(datetime(2013, 2, 10), pytz.UTC)
eq_(Announcement.objects.unpublished().count(), 3)
mock_obj.return_value = make_aware(datetime(2013, 2, 13), pytz.UTC)
eq_(Announcement.objects.unpublished().count(), 2)
mock_obj.return_value = make_aware(datetime(2013, 2, 16), pytz.UTC)
eq_(Announcement.objects.unpublished().count(), 1)
mock_obj.return_value = make_aware(datetime(2013, 2, 19), pytz.UTC)
eq_(Announcement.objects.unpublished().count(), 3)
mock_obj.return_value = make_aware(datetime(2013, 2, 24), pytz.UTC)
eq_(Announcement.objects.unpublished().count(), 3)
| 41.933333
| 75
| 0.687997
| 319
| 2,516
| 5.244514
| 0.181818
| 0.091452
| 0.162582
| 0.200837
| 0.780036
| 0.780036
| 0.780036
| 0.701136
| 0.682008
| 0.573819
| 0
| 0.059425
| 0.184022
| 2,516
| 59
| 76
| 42.644068
| 0.75548
| 0.033784
| 0
| 0.5
| 0
| 0
| 0.030579
| 0.030579
| 0
| 0
| 0
| 0
| 0
| 1
| 0.071429
| false
| 0
| 0.166667
| 0
| 0.261905
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
05247bead9705fce318e9840819aec6b9607332f
| 33
|
py
|
Python
|
sheets/python/thread-id-tid.py
|
zgmarx/cheatsheet
|
b29e43a55c5c0fae8763a855025d77a8f46e1208
|
[
"MIT"
] | 1
|
2020-03-31T11:26:05.000Z
|
2020-03-31T11:26:05.000Z
|
sheets/python/thread-id-tid.py
|
zgmarx/cheatsheet
|
b29e43a55c5c0fae8763a855025d77a8f46e1208
|
[
"MIT"
] | null | null | null |
sheets/python/thread-id-tid.py
|
zgmarx/cheatsheet
|
b29e43a55c5c0fae8763a855025d77a8f46e1208
|
[
"MIT"
] | null | null | null |
threading.current_thread().ident
| 16.5
| 32
| 0.848485
| 4
| 33
| 6.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030303
| 33
| 1
| 33
| 33
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
054f3765535d82977affcaa49e0c102c8267939d
| 119
|
py
|
Python
|
Algorithms/Bit Manipulation/Maximizing_XOR.py
|
gauthamkrishna-g/HackerRank
|
472d7a56fc1c1c4f8f03fcabc09d08da4000efde
|
[
"MIT"
] | 1
|
2017-12-02T14:23:44.000Z
|
2017-12-02T14:23:44.000Z
|
Algorithms/Bit Manipulation/Maximizing_XOR.py
|
gauthamkrishna-g/HackerRank
|
472d7a56fc1c1c4f8f03fcabc09d08da4000efde
|
[
"MIT"
] | null | null | null |
Algorithms/Bit Manipulation/Maximizing_XOR.py
|
gauthamkrishna-g/HackerRank
|
472d7a56fc1c1c4f8f03fcabc09d08da4000efde
|
[
"MIT"
] | null | null | null |
L = int(input())
R = int(input())
xor = L ^ R
max_xor = 1
while xor:
xor >>= 1
max_xor <<= 1
print (max_xor-1)
| 13.222222
| 17
| 0.537815
| 23
| 119
| 2.652174
| 0.391304
| 0.262295
| 0.344262
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045977
| 0.268908
| 119
| 8
| 18
| 14.875
| 0.655172
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0550d1e95dfb60920ae29210da687376a482ee58
| 23,563
|
py
|
Python
|
data_reader.py
|
kchng/Quantum_machine_learning
|
7395b0d5415d7633a867a535f9b0b0c79583f738
|
[
"Apache-2.0"
] | 3
|
2017-02-16T17:14:26.000Z
|
2019-05-06T10:11:55.000Z
|
data_reader.py
|
kchng/Quantum_machine_learning
|
7395b0d5415d7633a867a535f9b0b0c79583f738
|
[
"Apache-2.0"
] | null | null | null |
data_reader.py
|
kchng/Quantum_machine_learning
|
7395b0d5415d7633a867a535f9b0b0c79583f738
|
[
"Apache-2.0"
] | 2
|
2018-03-05T22:56:28.000Z
|
2019-05-06T10:11:49.000Z
|
# Author: Kelvin Chng
# (c) 2016
# San Jose State University
import numpy as np
import random
import time
import sys
class insert_file_info :
def __init__(self, full_file_path, filenumber, batch_size = 50,
use_random_seed = False, include_validation_data = False,
load_test_data_only = False) :
""" full_file_path : full file path of the shuffled data
filenumber : An array of file number """
self.filename = full_file_path.rsplit('\\', 1)[-1]
self.filename = self.filename.rsplit('/', 1)[-1]
self.filenumber = filenumber
self.full_file_path = full_file_path
self.include_validation_data = include_validation_data
self.nrows = 0
self.ncols = 0
self.nfile = len(filenumber)
self.batch_size = batch_size
self.current_index = 0
self.load_test_data_only = load_test_data_only
if self.load_test_data_only :
self.include_validation_data = False
self.delimiter = [1 for i in xrange(self.ncols)]
class DataSet(object) :
file_info = None
def __init__(self, images, labels, temps, signs, nrows, nfile_train,
nfile_test, nfile_val, full_file_path, data_type) :
#self.file_into = insert_file_info()
#super(DataSet,self).__init__()
#self.insert_file_info = insert_file_info
self._epochs_completed = 0
self._file_index = 1
self._images = images
self._index_in_datafile = 0
self._index_in_epoch = 0
self._labels = labels
self._ndata = 0
self._temps = temps
self._signs = signs
self.batch_size = 0
self.data_type = data_type
self.full_file_path = full_file_path
self.nrows = nrows
self.shuffle_index_dose = np.arange(0,self.nrows,1)
if self.data_type == 'train' :
self.start_file_index = 1
self.end_file_index = nfile_train
self._ndata = nfile_train*self.nrows
self.convert_to_one_hot = True
self.shuffle_index = np.arange(0,self._ndata,1)
elif self.data_type == 'test' :
self.start_file_index = nfile_train + 1
self.end_file_index = nfile_train + nfile_test
self._ndata = nfile_test*self.nrows
self.convert_to_one_hot = True
self.shuffle_index = np.arange(0,self._ndata,1)
elif self.data_type == 'validation' :
self.start_file_index = nfile_train + nfile_test + 1
self.end_file_index = nfile_train + nfile_test + nfile_val
self._ndata = nfile_val*self.nrows
self.convert_to_one_hot = False
self.shuffle_index = np.arange(0,self._ndata,1)
#@staticmethod
#def feed_self(self, batch_size, nrows) :
# self.batch_size = batch_size
# self.nrows = nrows
#print self.batch_size, self.nrows
@property
def images(self):
return self._images
@property
def labels(self):
return self._labels
@property
def temps(self):
return self._temps
@property
def signs(self):
return self._signs
@property
def ndata(self):
return self._ndata
@property
def epochs_completed(self):
return self._epochs_completed
def next_batch(self, batch_size = 50) :
start = self._index_in_epoch
if ( self._epochs_completed == 0 ) and ( start == 0 ) :
self.batch_size = batch_size
while np.modf(float(self._ndata)/self.batch_size)[0] > 0.0 :
print 'Warning! Number of data/ batch size must be an integer.'
print 'number of data: %d' % self._ndata
print 'batch size: %d' % self.batch_size
self.batch_size = int(input('Input new batch size: '))
print 'batch size : %d' % self.batch_size
print 'number of data: %d' % self._ndata
self._index_in_epoch += self.batch_size
if self._index_in_epoch > self._ndata :
# Number of training epochs completed
self._epochs_completed += 1
# Shuffle data
random.shuffle(self.shuffle_index)
self._images = self._images[self.shuffle_index]
self._labels = self._labels[self.shuffle_index]
# Reinitialize conunter
start = 0
self._index_in_epoch = self.batch_size
assert self.batch_size <= self._ndata
end = self._index_in_epoch
return self._images[start:end], self._labels[start:end]
def next_dose(self, batch_size = 50) :
def convert_to_one_hot( label ) :
label_one_hot = np.zeros((len(label),2))
for i in range(len(label)) :
label_one_hot[i,label[i]] = 1
return label_one_hot
start = self._index_in_datafile
if ( self._file_index == self.start_file_index ) and ( start == 0 ) :
self.batch_size = batch_size
while np.modf(float(self.nrows)/self.batch_size)[0] > 0.0 :
print 'Warning! Number of data per file/ dose size must be an integer.'
print 'number of data per file: %d' % self.nrows
print 'dose size: %d' % self.batch_size
self.batch_size = int(input('Input new dose size: '))
print 'dose size : %d' % self.batch_size
print 'number of data: %d' % self._ndata
# Read in one file at a time
data = np.genfromtxt(self.full_file_path%(self._file_index) ,dtype=int,
skip_header=0, skip_footer=0)
self._images = data[:,:-1].astype('int')
labels = data[:,-1:].astype('int')
if self.convert_to_one_hot :
self._labels = convert_to_one_hot(labels)
self._index_in_datafile += self.batch_size
if self._index_in_datafile > self.nrows :
self._file_index += 1
start = 0
self._index_in_datafile = self.batch_size
assert self.batch_size <= self.nrows
# Read in one file at a time
data = np.genfromtxt(self.full_file_path%(self._file_index) ,dtype=int,
skip_header=0, skip_footer=0)
self._images = data[:,:-1].astype('int')
labels = data[:,-1:].astype('int')
if self.convert_to_one_hot :
self._labels = convert_to_one_hot(labels)
# Shufle data
random.shuffle(self.shuffle_index_dose)
self._images = self._images[self.shuffle_index_dose]
self._labels = self._labels[self.shuffle_index_dose]
if self._file_index > self.end_file_index :
# Number of training epochs completed
self._epochs_completed += 1
self._file_index = self.start_file_index
# Reinitialize conunter
start = 0
self._index_in_datafile = self.batch_size
end = self._index_in_datafile
return self._images[start:end], self._labels[start:end]
def next_dose_old(self, batch_size = 50) :
def convert_to_one_hot( label ) :
label_one_hot = np.zeros((len(label),2))
for i in range(len(label)) :
label_one_hot[i,label[i]] = 1
return label_one_hot
start = self._index_in_datafile
if ( self._file_index == self.start_file_index ) and ( start == 0 ) :
self.batch_size = batch_size
while np.modf(float(self.nrows)/self.batch_size)[0] > 0.0 :
print 'Warning! Number of data per file/ dose size must be an integer.'
print 'number of data per file: %d' % self.nrows
print 'dose size: %d' % self.batch_size
self.batch_size = int(input('Input new dose size: '))
print 'dose size : %d' % self.batch_size
print 'number of data: %d' % self._ndata
self.shuffle_index_dose_old = np.arange(0,self.batch_size,1)
self._index_in_datafile += self.batch_size
if self._index_in_datafile > self.nrows :
self._file_index += 1
start = 0
self._index_in_datafile = self.batch_size
assert self.batch_size <= self.nrows
if self._file_index > self.end_file_index :
# Number of training epochs completed
self._epochs_completed += 1
self._file_index = self.start_file_index
# Reinitialize conunter
start = 0
self._index_in_datafile = self.batch_size
end = self._index_in_datafile
# Read in small dosage of data
data = np.genfromtxt(self.full_file_path%(self._file_index) ,dtype=int,
skip_header=start, skip_footer=self.nrows-end)
self._images = data[:,:-1].astype('int')
labels = data[:,-1:].astype('int')
if self.convert_to_one_hot :
self._labels = convert_to_one_hot(labels)
# Shufle data
random.shuffle(self.shuffle_index_dose_old)
self._images = self._images[self.shuffle_index_dose_old]
self._labels = self._labels[self.shuffle_index_dose_old]
return self._images, self._labels
def categorize_data(self, convert_test_labels_to_one_hot = True, make_spin_down_negative = False) :
class DataSets(object):
pass
data_sets = DataSets()
def convert_to_one_hot( label ) :
label_one_hot = np.zeros((len(label),2))
for i in range(len(label)) :
label_one_hot[i,label[i]] = 1
return label_one_hot
def reindex_data( in_data, L=200 ) :
nrows, ncols = data_shape = np.shape(in_data)
n_x = int(round((float(ncols)/L)**(1/3.)))
index = range(ncols)
new_index = np.zeros(ncols)
count=0
for j in range(L) :
for i in range(n_x**3) :
new_index[count] = index[j+i*L]
count+=1
output_data = np.zeros(np.shape(in_data))
for i in range(ncols) :
output_data[:,int(new_index[i])] = in_data[:,i]
return output_data
data = np.loadtxt(self.full_file_path%1)
self.nrows, self.ncols = np.shape(data)
self.nrows, self.ncols = int(self.nrows), int(self.ncols)
if np.modf(float(self.nrows)/self.batch_size)[0] > 0.0 :
self.batch_size = int(float(self.nrows)/20)
if self.include_validation_data :
# Use 10% of the data each for testing and validating, the remaining for
# training
nfile_train = int(self.nfile*.8)
nfile_test = int(self.nfile*.1)
nfile_val = nfile_test
else :
# Use 15% of the data for testing, the remaining for training
nfile_train = int(self.nfile*.85)
nfile_test = int(self.nfile*.15)
nfile_val = 0
n_data_check = self.nfile - ( nfile_train + nfile_test + nfile_val )
if n_data_check > 0 :
nfile_train += n_data_check
elif n_data_check < 0 :
nfile_train -= n_data_check
start_time = time.time()
if not(self.load_test_data_only) :
TRAIN_DATA = np.zeros((nfile_train*self.nrows,self.ncols))
#train_images = np.zeros((nfile_train*self.nrows,self.ncols-1))
#train_labels = np.zeros((nfile_train*self.nrows,1))
print 'Loading %d/%d files for training data...' % (nfile_train,self.nfile)
for i in range(nfile_train) :
print '%.1fs. Loading file %d.' % (time.time()-start_time, i+1)
TRAIN_DATA[i*self.nrows:(i+1)*self.nrows,:] = np.loadtxt(self.full_file_path%(i+1))
train_images = reindex_data(TRAIN_DATA[:,:-2]).astype('int')
if make_spin_down_negative :
train_images[train_images==0] = -1
train_labels = TRAIN_DATA[:,-2].astype('int')
train_labels = convert_to_one_hot(train_labels)
train_temps = []
train_signs = []
print 'Loading %d/%d files for test data...' % (nfile_test,self.nfile)
TEST_DATA = np.zeros((nfile_test*self.nrows,self.ncols))
#test_images = np.zeros((nfile_test*self.nrows,self.ncols-1))
#test_labels = np.zeros((nfile_test*self.nrows,1))
for i in range(nfile_test) :
print '%.1fs. Loading file %d.' % (time.time()-start_time, i+1)
TEST_DATA[i*self.nrows:(i+1)*self.nrows,:] = np.loadtxt(self.full_file_path%(i+1+nfile_train))
test_images = reindex_data(TEST_DATA[:,:-2]).astype('int')
if make_spin_down_negative :
test_images[test_images==0] = -1
test_labels = TEST_DATA[:,-2].astype('int')
if convert_test_labels_to_one_hot :
test_labels = convert_to_one_hot(test_labels)
test_temps = TEST_DATA[:,-1].astype('int')
test_signs = []
if self.include_validation_data :
print 'Loading %d/%d files for validation data...' % (nfile_val,self.nfile)
VALIDATION_DATA = np.zeros((nfile_val*self.nrows,self.ncols))
#validation_images = np.zeros((nfile_val*self.nrows,self.ncols-1))
#validation_labels = np.zeros((nfile_val*self.nrows,1))
for i in range(nfile_test) :
print '%.1fs. Loading file %d.' % (time.time()-start_time, i+1)
VALIDATION_DATA[i*self.nrows:(i+1)*self.nrows,:] = np.loadtxt(self.full_file_path%(i+1+nfile_train+nfile_test))
validation_images = reindex_data(VALIDATION_DATA[:,:-2]).astype('int')
if make_spin_down_negative :
validation_images[validation_images==0] = -1
validation_labels = VALIDATION_DATA[:,-2].astype('int')
validation_temps = VALIDATION_DATA[:,-1].astype('int')
validation_signs = []
if not(self.load_test_data_only) :
data_sets.train = insert_file_info.DataSet(train_images, train_labels,
train_temps, train_signs, self.nrows, nfile_train,
nfile_test, nfile_val, self.full_file_path,
data_type = 'train')
data_sets.test = insert_file_info.DataSet(test_images, test_labels,
test_temps, test_signs, self.nrows, nfile_train,
nfile_test, nfile_val, self.full_file_path, data_type = 'test')
if self.include_validation_data :
data_sets.validation = insert_file_info.DataSet(validation_images,
validation_labels, validation_temps, validation_signs,
self.nrows, nfile_train, nfile_test, nfile_val,
self.full_file_path, data_type = 'validation')
return data_sets
def categorize_dose_of_data(self) :
class DataSets(object):
pass
data_sets = DataSets()
data = np.loadtxt(self.full_file_path%1)
self.nrows, self.ncols = np.shape(data)
self.nrows, self.ncols = int(self.nrows), int(self.ncols)
if np.modf(float(self.nrows)/self.batch_size)[0] > 0.0 :
self.batch_size = int(float(self.nrows)/20)
if self.include_validation_data :
# Use 10% of the data each for testing and validating, the remaining for
# training
nfile_train = int(self.nfile*.8)
nfile_test = int(self.nfile*.1)
nfile_val = nfile_test
else :
# Use 10% of the data each for testing, the remaining for training
nfile_train = int(self.nfile*.85)
nfile_test = int(self.nfile*.15)
nfile_val = 0
n_data_check = self.nfile - ( nfile_train + nfile_test + nfile_val )
if n_data_check > 0 :
nfile_train += n_data_check
elif n_data_check < 0 :
nfile_train -= n_data_check
if not(self.load_test_data_only) :
train_images = np.array([]).astype('int')
train_labels = np.array([]).astype('int')
train_temps = []
train_signs = []
start_time = time.time()
print 'Loading %d/%d files for test data...' % (nfile_test,self.nfile)
TEST_DATA = np.zeros((nfile_test*self.nrows,self.ncols))
test_images = np.zeros((nfile_test*self.nrows,self.ncols-1))
test_labels = np.zeros((nfile_test*self.nrows,1))
for i in range(nfile_test) :
print '%.1fs. Loading file %d.' % (time.time()-start_time, i+1)
TEST_DATA[i*self.nrows:(i+1)*self.nrows,:] = np.loadtxt(self.full_file_path%(i+1+nfile_train))
test_images = reindex_data(TEST_DATA[:,:-2]).astype('int')
test_labels = TEST_DATA[:,-2].astype('int')
if convert_test_labels_to_one_hot :
test_labels = convert_to_one_hot(test_labels)
test_temps = TEST_DATA[:,-1].astype('int')
test_signs = []
if self.include_validation_data :
print 'Loading %d/%d files for validation data...' % (nfile_val,self.nfile)
VALIDATION_DATA = np.zeros((nfile_val*self.nrows,self.ncols))
validation_images = np.zeros((nfile_val*self.nrows,self.ncols-1))
validation_labels = np.zeros((nfile_val*self.nrows,1))
for i in range(nfile_test) :
print '%.1fs. Loading file %d.' % (time.time()-start_time, i+1)
VALIDATION_DATA[i*self.nrows:(i+1)*self.nrows,:] = np.loadtxt(self.full_file_path%(i+1+nfile_train+nfile_test))
validation_images = reindex_data(VALIDATION_DATA[:,:-2]).astype('int')
validation_labels = VALIDATION_DATA[:,-2].astype('int')
validation_temps = VALIDATION_DATA[:,-1].astype('int')
validation_signs = []
#test_images = np.array([]).astype('int')
#test_labels = np.array([]).astype('int')
#test_temps = np.array([]).astype('int')
#if self.include_validation_data :
# validation_images = np.array([]).astype('int')
# validation_labels = np.array([]).astype('int')
# validation_temps = np.array([]).astype('int')
if not(self.load_test_data_only) :
data_sets.train = insert_file_info.DataSet(train_images, train_labels,
train_temps, train_signs, self.nrows, nfile_train,
nfile_test, nfile_val, self.full_file_path,
data_type = 'train')
data_sets.test = insert_file_info.DataSet(test_images, test_labels,
test_temps, test_signs, self.nrows, nfile_train,
nfile_test, nfile_val, self.full_file_path,
data_type = 'test')
if self.include_validation_data :
data_sets.validation = insert_file_info.DataSet(validation_images,
validation_labels, validation_temps, validation_signs,
self.nrows, nfile_train, nfile_test, nfile_val,
self.full_file_path, data_type = 'validation')
return data_sets
def load_classification_data(self, nrows = 1000, ncols=12800, SkipHeader = 0, load_ndata_per_file = 1000, include_sign=False, make_spin_down_negative = False) :
class DataSets(object):
pass
data_sets = DataSets()
def reindex_data( in_data, L=200 ) :
nrows, ncols = data_shape = np.shape(in_data)
n_x = int(round((float(ncols)/L)**(1/3.)))
index = range(ncols)
new_index = np.zeros(ncols)
count=0
for j in range(L) :
for i in range(n_x**3) :
new_index[count] = index[j+i*L]
count+=1
output_data = np.zeros(np.shape(in_data))
for i in range(ncols) :
output_data[:,int(new_index[i])] = in_data[:,i]
return output_data
start_time = time.time()
self.ncols = ncols
self.nrows = nrows
self.delimiter = [1 for i in xrange(self.ncols)]
#if SkipHeader == 0 :
# load_ndata_per_file = self.nrows
SkipFooter = self.nrows - SkipHeader - load_ndata_per_file
while load_ndata_per_file > self.nrows :
print 'Number of classification data used per temperature must be smaller than number of data per temnperature.'
print 'Number of data per temnperature : %d' % self.nrows
print 'Classification data used per temperature: %d' % load_ndata_per_file
load_ndata_per_file = input('Input new classification data used per temperature: ')
classification_images = np.zeros((self.nfile*load_ndata_per_file,self.ncols))
print 'Loading %d files for classfication data...' % (self.nfile)
for i in range(self.nfile) :
print '%.1fs. Loading file %d.' % (time.time()-start_time, i+1)
classification_images[i*load_ndata_per_file:(i+1)*load_ndata_per_file,:] = np.genfromtxt(self.full_file_path%self.filenumber[i], dtype = int, delimiter=self.delimiter, skip_header=SkipHeader, skip_footer=SkipFooter)
classification_images = reindex_data(classification_images).astype('int')
if make_spin_down_negative :
classification_images[classification_images==0] = -1
classification_labels = []
classification_temps = []
if include_sign :
classification_signs = np.zeros(self.ncols)
for i in range(self.nfile) :
classification_signs[i*load_ndata_per_file:(i+1)*load_ndata_per_file] = np.loadtxt(self.full_file_path%self.filenumber[i])[SkipHeader:(self.nrows-SkipFooter),-1]
else :
classification_signs = []
data_sets.classification = insert_file_info.DataSet(classification_images, classification_labels,
classification_temps, classification_signs, 0, 0, 0, 0, self.full_file_path,
data_type='classification')
return data_sets
| 45.753398
| 227
| 0.565505
| 2,890
| 23,563
| 4.328028
| 0.060554
| 0.04677
| 0.040534
| 0.028142
| 0.794771
| 0.747602
| 0.706348
| 0.675887
| 0.64015
| 0.612648
| 0
| 0.01333
| 0.334592
| 23,563
| 514
| 228
| 45.842412
| 0.784425
| 0.067733
| 0
| 0.675192
| 0
| 0
| 0.055803
| 0
| 0
| 0
| 0
| 0
| 0.007673
| 0
| null | null | 0.007673
| 0.01023
| null | null | 0.076726
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0553b6a15c5c03032ec414974a97d21353f8abdb
| 87
|
py
|
Python
|
web/search/apps.py
|
ChiChou/wiggle
|
df4130d728a980b2d927ae8ec1d9c690dae99d7b
|
[
"MIT"
] | 110
|
2019-05-10T08:37:42.000Z
|
2022-01-10T22:41:52.000Z
|
web/search/apps.py
|
torque59/wiggle
|
df4130d728a980b2d927ae8ec1d9c690dae99d7b
|
[
"MIT"
] | 1
|
2020-04-04T14:26:21.000Z
|
2020-04-04T14:26:21.000Z
|
web/search/apps.py
|
torque59/wiggle
|
df4130d728a980b2d927ae8ec1d9c690dae99d7b
|
[
"MIT"
] | 12
|
2019-05-10T18:15:40.000Z
|
2021-12-21T10:41:13.000Z
|
from django.apps import AppConfig
class WiggleConfig(AppConfig):
name = 'wiggle'
| 14.5
| 33
| 0.747126
| 10
| 87
| 6.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 87
| 5
| 34
| 17.4
| 0.902778
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
057d97d9483d92f227d0107e7a72ea88a442b45b
| 79
|
py
|
Python
|
irods/constants.py
|
trel/python-irodsclient
|
228fd6d39e1e6b5a72fb3a3301105b7bea2422a9
|
[
"Xnet",
"X11"
] | 54
|
2015-03-27T11:16:58.000Z
|
2022-03-05T03:31:49.000Z
|
irods/constants.py
|
trel/python-irodsclient
|
228fd6d39e1e6b5a72fb3a3301105b7bea2422a9
|
[
"Xnet",
"X11"
] | 316
|
2015-02-13T19:57:11.000Z
|
2022-03-31T09:50:53.000Z
|
irods/constants.py
|
trel/python-irodsclient
|
228fd6d39e1e6b5a72fb3a3301105b7bea2422a9
|
[
"Xnet",
"X11"
] | 81
|
2015-01-27T21:58:59.000Z
|
2022-02-25T08:06:56.000Z
|
SYS_SVR_TO_CLI_COLL_STAT = 99999996
SYS_CLI_TO_SVR_COLL_STAT_REPLY = 99999997
| 19.75
| 41
| 0.886076
| 15
| 79
| 3.933333
| 0.6
| 0.271186
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 0.088608
| 79
| 3
| 42
| 26.333333
| 0.597222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
057ea516ef32acea8607ae469ab116cbedef95a0
| 2,091
|
py
|
Python
|
POP1/worksheets/recursion/ex02/test_ex02.py
|
silvafj/BBK-MSCCS-2017-18
|
d97b0f8e7434d19a1a4006989c32c4c1deb93842
|
[
"MIT"
] | 1
|
2021-12-29T19:38:56.000Z
|
2021-12-29T19:38:56.000Z
|
POP1/worksheets/recursion/ex02/test_ex02.py
|
silvafj/BBK-MSCCS-2017-18
|
d97b0f8e7434d19a1a4006989c32c4c1deb93842
|
[
"MIT"
] | null | null | null |
POP1/worksheets/recursion/ex02/test_ex02.py
|
silvafj/BBK-MSCCS-2017-18
|
d97b0f8e7434d19a1a4006989c32c4c1deb93842
|
[
"MIT"
] | 2
|
2021-04-08T22:58:03.000Z
|
2021-04-09T01:16:51.000Z
|
import pytest
from power import power
def test_one():
assert power(2,-3) == 0.125
def test_two():
assert power(2,1) == 2
def test_three():
assert power(2,2) == 4
def test_four():
assert power(2,3) == 8
def test_five():
assert power(2,4) == 16
def test_six():
assert power(2,9) == 512
def test_seven():
assert power(2,10) == 1024
def test_eight():
assert power(2,15) == 32768
def test_nine():
assert power(2,0) == 1
def test_ten():
assert power(3,1) == 3
def test_eleven():
assert power(3,2) == 9
def test_twelve():
assert power(3,3) == 27
def test_thirteen():
assert power(3,10) == 59049
def test_fourteen():
assert power(3,0) == 1
def test_fifteen():
assert power(1.1414,2) == pytest.approx(1.30279, 0.00001)
def test_sixteen():
assert power(1.5,10) == pytest.approx(57.665, 0.001)
def test_seventeen():
assert power(1,-1) == 1
def test_eighteen():
assert power(2,-1) == 0.5
def test_nineteen():
assert power(2,-2) == 0.25
def test_twenty():
assert power(2,-3) == 0.125
def test_twentyone():
assert power(2,-4) == 0.0625
def test_twentytwo():
assert power(2,-8) == 0.00390625
def test_twentythree():
assert power(2,-9) == pytest.approx(0.00195312, 0.00001)
def test_twentyfour():
assert power(2,-10) == pytest.approx(0.000976562, 0.00001)
def test_twentyfive():
assert power(2,-15) == pytest.approx(3.05176e-05)
def test_twentysix():
assert power(3,-1) == pytest.approx(0.333333, 0.00001)
def test_twentyseven():
assert power(3,-2) == pytest.approx(0.111111, 0.00001)
def test_twentyeight():
assert power(3,-3) == pytest.approx(0.037037, 0.00001)
def test_twentynine():
assert power(3,-4) == pytest.approx(0.0123457, 0.00001)
def test_thirty():
assert power(3,-5) == pytest.approx(0.00411523, 0.000001)
def test_thirtyone():
assert power(3,-10) == pytest.approx(1.69351e-05)
def test_thirtytwo():
assert power(3,-6) == pytest.approx(0.00137174, 0.00001)
def test_thirtythree():
assert power(1.1414,-2) == pytest.approx(0.767581, 0.000001)
def test_thirtyfour():
assert power(1.5,-10) == pytest.approx(0.0173415, 0.00001)
| 19.726415
| 61
| 0.677666
| 356
| 2,091
| 3.884831
| 0.233146
| 0.17209
| 0.147505
| 0.075199
| 0.115691
| 0.115691
| 0.115691
| 0.034707
| 0
| 0
| 0
| 0.178889
| 0.139168
| 2,091
| 105
| 62
| 19.914286
| 0.589444
| 0
| 0
| 0.028571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.485714
| 1
| 0.485714
| true
| 0
| 0.028571
| 0
| 0.514286
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
059195a97f826344cc48c8e2b721dd9850af534f
| 207
|
py
|
Python
|
start.py
|
lordLegal/notification-system
|
2bf0c57894ff3e6b90c7aacb3993bd7d25158fe1
|
[
"Apache-2.0"
] | null | null | null |
start.py
|
lordLegal/notification-system
|
2bf0c57894ff3e6b90c7aacb3993bd7d25158fe1
|
[
"Apache-2.0"
] | null | null | null |
start.py
|
lordLegal/notification-system
|
2bf0c57894ff3e6b90c7aacb3993bd7d25158fe1
|
[
"Apache-2.0"
] | null | null | null |
import os
import threading
def main():
os.system("python3 main.py")
def noti():
os.system("python3 notification.py")
threading.Thread(target=main).start()
threading.Thread(target=noti).start()
| 13.8
| 40
| 0.710145
| 28
| 207
| 5.25
| 0.464286
| 0.108844
| 0.204082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011173
| 0.135266
| 207
| 14
| 41
| 14.785714
| 0.810056
| 0
| 0
| 0
| 0
| 0
| 0.183575
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5572ecb37613f417a4a740a395c863914037dbff
| 518
|
py
|
Python
|
calculator/use__simpleeval__module.py
|
DazEB2/SimplePyScripts
|
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
|
[
"CC-BY-4.0"
] | 117
|
2015-12-18T07:18:27.000Z
|
2022-03-28T00:25:54.000Z
|
calculator/use__simpleeval__module.py
|
DazEB2/SimplePyScripts
|
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
|
[
"CC-BY-4.0"
] | 8
|
2018-10-03T09:38:46.000Z
|
2021-12-13T19:51:09.000Z
|
calculator/use__simpleeval__module.py
|
DazEB2/SimplePyScripts
|
1dde0a42ba93fe89609855d6db8af1c63b1ab7cc
|
[
"CC-BY-4.0"
] | 28
|
2016-08-02T17:43:47.000Z
|
2022-03-21T08:31:12.000Z
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install simpleeval
from simpleeval import simple_eval
print(simple_eval("21 + 21")) # 42
print(simple_eval("2 + 2 * 2")) # 6
print(simple_eval('10 ** 123')) # 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
print(simple_eval("21 + 19 / 7 + (8 % 3) ** 9")) # 535.7142857142857
print(simple_eval("square(11)", functions={"square": lambda x: x * x})) # 121
| 32.375
| 159
| 0.720077
| 59
| 518
| 6.152542
| 0.610169
| 0.165289
| 0.206612
| 0.093664
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.37694
| 0.129344
| 518
| 15
| 160
| 34.533333
| 0.427938
| 0.420849
| 0
| 0
| 0
| 0
| 0.256849
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.142857
| 0
| 0.142857
| 0.714286
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
55b40b00b2b91a643148dbca08eac9da1cddf8d1
| 236
|
py
|
Python
|
src/browsers/chrome.py
|
yujhenchen/pytestBDD
|
05345f7130720fc3237aa9b0085676b6d82f42f7
|
[
"MIT"
] | null | null | null |
src/browsers/chrome.py
|
yujhenchen/pytestBDD
|
05345f7130720fc3237aa9b0085676b6d82f42f7
|
[
"MIT"
] | null | null | null |
src/browsers/chrome.py
|
yujhenchen/pytestBDD
|
05345f7130720fc3237aa9b0085676b6d82f42f7
|
[
"MIT"
] | null | null | null |
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
class Chrome(object):
def __init__(self):
super().__init__()
self.driver = webdriver.Chrome(ChromeDriverManager().install())
| 23.6
| 71
| 0.741525
| 24
| 236
| 6.916667
| 0.625
| 0.096386
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.165254
| 236
| 9
| 72
| 26.222222
| 0.84264
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e94abeaee87961de298b4833b088f0c72732a299
| 199
|
py
|
Python
|
mwtext/content_transformers/content_transformer.py
|
HAKSOAT/python-mwtext
|
f812deed7eab9a51ecc43d2940cc8fce37b66bbb
|
[
"MIT"
] | 4
|
2020-05-10T17:29:18.000Z
|
2022-02-25T07:18:35.000Z
|
mwtext/content_transformers/content_transformer.py
|
HAKSOAT/python-mwtext
|
f812deed7eab9a51ecc43d2940cc8fce37b66bbb
|
[
"MIT"
] | 16
|
2020-01-30T09:05:32.000Z
|
2021-03-02T21:52:26.000Z
|
mwtext/content_transformers/content_transformer.py
|
HAKSOAT/python-mwtext
|
f812deed7eab9a51ecc43d2940cc8fce37b66bbb
|
[
"MIT"
] | 5
|
2020-01-30T09:06:22.000Z
|
2020-07-06T11:27:47.000Z
|
class ContentTransformer:
def transform(content):
raise NotImplementedError()
@classmethod
def from_siteinfo(cls, siteinfo, *args, **kwargs):
raise NotImplementedError()
| 24.875
| 54
| 0.693467
| 17
| 199
| 8.058824
| 0.764706
| 0.350365
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.21608
| 199
| 7
| 55
| 28.428571
| 0.878205
| 0
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e94efa6aebd4f429c708d92092788dc693db6038
| 204
|
py
|
Python
|
netbox_bgppeering/admin.py
|
progala/ttl255-netbox-plugin-bgppeering
|
0ce9587e2ccd9df0269201fd7bfac6330d8f1077
|
[
"Apache-2.0"
] | 31
|
2020-12-17T11:29:15.000Z
|
2022-02-24T04:17:05.000Z
|
netbox_bgppeering/admin.py
|
progala/ttl255-netbox-plugin-bgppeering
|
0ce9587e2ccd9df0269201fd7bfac6330d8f1077
|
[
"Apache-2.0"
] | 6
|
2020-12-22T11:45:35.000Z
|
2021-07-14T11:58:32.000Z
|
netbox_bgppeering/admin.py
|
progala/ttl255-netbox-plugin-bgppeering
|
0ce9587e2ccd9df0269201fd7bfac6330d8f1077
|
[
"Apache-2.0"
] | 16
|
2020-12-13T19:58:03.000Z
|
2022-03-29T04:15:31.000Z
|
from django.contrib import admin
from .models import BgpPeering
@admin.register(BgpPeering)
class BgpPeeringAdmin(admin.ModelAdmin):
list_display = ("device", "peer_name", "remote_as", "remote_ip")
| 25.5
| 68
| 0.769608
| 25
| 204
| 6.12
| 0.76
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112745
| 204
| 7
| 69
| 29.142857
| 0.845304
| 0
| 0
| 0
| 0
| 0
| 0.161765
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e993347086333283bf47b788776656adab760e32
| 600
|
py
|
Python
|
Server/website/serializers.py
|
HarshShah1997/Rotary-Website
|
721765d803122959d366a88d195060a9d875ca8b
|
[
"CC-BY-3.0"
] | null | null | null |
Server/website/serializers.py
|
HarshShah1997/Rotary-Website
|
721765d803122959d366a88d195060a9d875ca8b
|
[
"CC-BY-3.0"
] | null | null | null |
Server/website/serializers.py
|
HarshShah1997/Rotary-Website
|
721765d803122959d366a88d195060a9d875ca8b
|
[
"CC-BY-3.0"
] | null | null | null |
"""
Author: harsh
"""
from rest_framework.serializers import ModelSerializer
from website.models import Event, Announcement, BoardMember, Photo
class EventSerializer(ModelSerializer):
class Meta:
model = Event
fields = '__all__'
class AnnouncementSerializer(ModelSerializer):
class Meta:
model = Announcement
fields = '__all__'
class BoardMemberSerializer(ModelSerializer):
class Meta:
model = BoardMember
fields = '__all__'
class PhotoSerializer(ModelSerializer):
class Meta:
model = Photo
fields = '__all__'
| 18.75
| 66
| 0.685
| 52
| 600
| 7.576923
| 0.442308
| 0.203046
| 0.243655
| 0.294416
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.241667
| 600
| 31
| 67
| 19.354839
| 0.865934
| 0.021667
| 0
| 0.444444
| 0
| 0
| 0.048359
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
e99884e6d00fa6a40989fcd1c0678602b330a4cf
| 3,917
|
py
|
Python
|
tests/tags/views.py
|
oberd/pontoon
|
8366905e0e44eabd1f49cf4c57572792d5f2365a
|
[
"BSD-3-Clause"
] | null | null | null |
tests/tags/views.py
|
oberd/pontoon
|
8366905e0e44eabd1f49cf4c57572792d5f2365a
|
[
"BSD-3-Clause"
] | null | null | null |
tests/tags/views.py
|
oberd/pontoon
|
8366905e0e44eabd1f49cf4c57572792d5f2365a
|
[
"BSD-3-Clause"
] | 1
|
2019-07-17T21:21:41.000Z
|
2019-07-17T21:21:41.000Z
|
import pytest
from mock import patch
from django.urls import reverse
@pytest.mark.django_db
@patch('pontoon.tags.admin.views.ProjectTagAdminAjaxView.get_form_class')
def test_view_project_tag_admin_ajax_form(form_mock, client, admin0,
project0, tag0):
form_mock.configure_mock(
**{'return_value.return_value.is_valid.return_value': True,
'return_value.return_value.save.return_value': [7, 23],
'return_value.return_value.errors': []})
client.force_login(admin0)
url = reverse(
'pontoon.admin.project.ajax.tag',
kwargs=dict(
project=project0.slug,
tag=tag0.slug))
response = client.post(
url,
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert form_mock.return_value.return_value.is_valid.called
assert form_mock.return_value.return_value.save.called
assert (
response.json()
== {u'data': [7, 23]})
@pytest.mark.django_db
@patch('pontoon.tags.admin.views.ProjectTagAdminAjaxView.get_form_class')
def test_view_project_tag_admin_ajax_form_bad(form_mock, client, admin0,
project0, tag0):
form_mock.configure_mock(
**{'return_value.return_value.is_valid.return_value': False,
'return_value.return_value.errors': ['BIG PROBLEM']})
client.force_login(admin0)
url = reverse(
'pontoon.admin.project.ajax.tag',
kwargs=dict(
project=project0.slug,
tag=tag0.slug))
response = client.post(
url,
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert response.status_code == 400
assert form_mock.return_value.call_args[1]['project'] == project0
assert (
dict(form_mock.return_value.call_args[1]['data'])
== dict(tag=[u'tag0']))
assert form_mock.return_value.return_value.is_valid.called
assert not form_mock.return_value.return_value.save.called
assert (
response.json()
== {u'errors': [u'BIG PROBLEM']})
form_mock.return_value.reset_mock()
response = client.post(
url,
data=dict(foo='bar', bar='baz'),
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert response.status_code == 400
assert form_mock.return_value.call_args[1]['project'] == project0
assert (
dict(form_mock.return_value.call_args[1]['data'])
== dict(
foo=[u'bar'],
bar=[u'baz'],
tag=[u'tag0']))
assert form_mock.return_value.return_value.is_valid.called
assert not form_mock.return_value.return_value.save.called
assert (
response.json()
== {u'errors': [u'BIG PROBLEM']})
@pytest.mark.django_db
@patch('pontoon.tags.admin.views.ProjectTagAdminAjaxView.get_form')
def test_view_project_tag_admin_ajax(form_mock, clients, project0, tag0):
form_mock.configure_mock(
**{'return_value.save.return_value': 23})
url = reverse(
'pontoon.admin.project.ajax.tag',
kwargs=dict(
project=project0.slug,
tag=tag0.slug))
# no `get` here
response = clients.get(url)
assert response.status_code == 404
# need xhr headers
response = clients.post(url)
assert response.status_code == 400
# must be superuser!
response = clients.post(
url,
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
if not response.wsgi_request.user.is_superuser:
assert not form_mock.called
assert not form_mock.return_value.is_valid.called
if response.wsgi_request.user.is_anonymous:
assert response.status_code == 404
else:
assert response.status_code == 403
return
# Form.get_form was called
assert form_mock.called
assert form_mock.return_value.is_valid.called
assert response.status_code == 200
assert response.json() == {u'data': 23}
| 32.915966
| 73
| 0.65203
| 490
| 3,917
| 4.963265
| 0.183673
| 0.153783
| 0.098684
| 0.101563
| 0.832237
| 0.720395
| 0.712993
| 0.664474
| 0.632401
| 0.632401
| 0
| 0.018358
| 0.235129
| 3,917
| 118
| 74
| 33.194915
| 0.793391
| 0.018892
| 0
| 0.632653
| 0
| 0
| 0.170706
| 0.131353
| 0
| 0
| 0
| 0
| 0.255102
| 1
| 0.030612
| false
| 0
| 0.030612
| 0
| 0.071429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e9bc998c669ce5fcc0649a750b8fe03469cbd6d8
| 52
|
py
|
Python
|
run.py
|
Casper-Smet/turing-route-66
|
b797485586c3491ddbcd76367aff88b7672d8d9a
|
[
"MIT"
] | 3
|
2019-12-03T09:47:02.000Z
|
2019-12-03T09:47:51.000Z
|
run.py
|
Casper-Smet/turing-route-66
|
b797485586c3491ddbcd76367aff88b7672d8d9a
|
[
"MIT"
] | null | null | null |
run.py
|
Casper-Smet/turing-route-66
|
b797485586c3491ddbcd76367aff88b7672d8d9a
|
[
"MIT"
] | null | null | null |
from route_66.server import server
server.launch()
| 13
| 34
| 0.807692
| 8
| 52
| 5.125
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043478
| 0.115385
| 52
| 3
| 35
| 17.333333
| 0.847826
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
756fcefd3d58272f03c6e39be269deb2f7821728
| 831
|
py
|
Python
|
tests/test_util.py
|
dpetz/zettel
|
a16009ddd2fb6179827dd84350e59d1743d07c7d
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_util.py
|
dpetz/zettel
|
a16009ddd2fb6179827dd84350e59d1743d07c7d
|
[
"BSD-3-Clause"
] | 2
|
2020-07-29T12:25:43.000Z
|
2020-07-29T12:26:23.000Z
|
tests/test_util.py
|
dpetz/zettel
|
a16009ddd2fb6179827dd84350e59d1743d07c7d
|
[
"BSD-3-Clause"
] | null | null | null |
from context import zettel
from zettel.util import links_from_markdown
markup_example_3_links = """Table of Content
...
[siyach](evernote:///view/536854/s1/d9b2c4a8-9c77-4202-a6b0-1007f572754f/d9b2c4a8-9c77-4202-a6b0-1007f572754f/) bla
7193. [Predigt Vineyard Dirk: Freude](evernote:///view/536854/s1/a42586cd-3993-4827-8c1f-0e43f5e587a2/a42586cd-3993-4827-8c1f-0e43f5e587a2/)
7194. [Hauskreis (Apr'06)](evernote:///view/536854/s1/2a825cc7-b6d6-469d-95b8-11bf78ad2977/2a825cc7-b6d6-469d-95b8-11bf78ad2977/)
"""
def test_links_from_markdown():
links = links_from_markdown(markup_example_3_links)
print(links)
assert len(links) == 3
assert links[-1].url == 'evernote:///view/536854/s1/2a825cc7-b6d6-469d-95b8-11bf78ad2977/2a825cc7-b6d6-469d-95b8-11bf78ad2977/'
assert links[-1].text == "Hauskreis (Apr'06)"
| 39.571429
| 140
| 0.761733
| 115
| 831
| 5.391304
| 0.443478
| 0.077419
| 0.116129
| 0.129032
| 0.593548
| 0.387097
| 0.387097
| 0.270968
| 0.270968
| 0.270968
| 0
| 0.290407
| 0.084236
| 831
| 21
| 141
| 39.571429
| 0.52431
| 0
| 0
| 0
| 0
| 0.285714
| 0.638221
| 0.521635
| 0
| 0
| 0
| 0
| 0.214286
| 1
| 0.071429
| false
| 0
| 0.142857
| 0
| 0.214286
| 0.071429
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7587023a22f44e0f64499c57c796158fcc478ff1
| 108
|
py
|
Python
|
Python/tutorials/loss_functions.py
|
shiyuli/LibTorchDemo
|
433bb58b533502aa5bae441fbf9d6caf55356355
|
[
"MIT"
] | 1
|
2019-07-08T11:17:28.000Z
|
2019-07-08T11:17:28.000Z
|
Python/tutorials/loss_functions.py
|
shiyuli/LibTorchDemo
|
433bb58b533502aa5bae441fbf9d6caf55356355
|
[
"MIT"
] | null | null | null |
Python/tutorials/loss_functions.py
|
shiyuli/LibTorchDemo
|
433bb58b533502aa5bae441fbf9d6caf55356355
|
[
"MIT"
] | null | null | null |
import torch
torch.nn.MSELoss() # regression
torch.nn.CrossEntropyLoss() # classification
| 21.6
| 48
| 0.666667
| 10
| 108
| 7.2
| 0.7
| 0.194444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.240741
| 108
| 4
| 49
| 27
| 0.878049
| 0.231481
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
759533175307e2dea8bd6f20a633b1dd44a5b9b6
| 290
|
py
|
Python
|
bug_reporting/admin.py
|
DevangS/CoralNet
|
7c56d4ec95a771718175bd94c3ef51c4095082e3
|
[
"BSD-2-Clause"
] | 4
|
2015-12-23T05:14:35.000Z
|
2019-07-09T03:27:10.000Z
|
bug_reporting/admin.py
|
DevangS/CoralNet
|
7c56d4ec95a771718175bd94c3ef51c4095082e3
|
[
"BSD-2-Clause"
] | 3
|
2015-04-07T02:45:15.000Z
|
2015-07-01T19:25:10.000Z
|
bug_reporting/admin.py
|
DevangS/CoralNet
|
7c56d4ec95a771718175bd94c3ef51c4095082e3
|
[
"BSD-2-Clause"
] | 2
|
2016-01-21T17:25:48.000Z
|
2019-08-29T18:42:14.000Z
|
from bug_reporting.models import Feedback
from django.contrib import admin
class FeedbackAdmin(admin.ModelAdmin):
list_display = ('comment', 'type', 'user', 'date', 'error_id')
#TODO: limit comment display to some number of characters
admin.site.register(Feedback, FeedbackAdmin)
| 32.222222
| 66
| 0.765517
| 37
| 290
| 5.918919
| 0.783784
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131034
| 290
| 8
| 67
| 36.25
| 0.869048
| 0.193103
| 0
| 0
| 0
| 0
| 0.11588
| 0
| 0
| 0
| 0
| 0.125
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
759dcc059361d265b122fd011f7e92a2e46df450
| 70
|
py
|
Python
|
rtree/__init__.py
|
bolliger32/rtree
|
1228ddb66435bfefde8b0da65772178b5aac7d88
|
[
"MIT"
] | null | null | null |
rtree/__init__.py
|
bolliger32/rtree
|
1228ddb66435bfefde8b0da65772178b5aac7d88
|
[
"MIT"
] | null | null | null |
rtree/__init__.py
|
bolliger32/rtree
|
1228ddb66435bfefde8b0da65772178b5aac7d88
|
[
"MIT"
] | null | null | null |
from .index import Rtree
from .core import rt
__version__ = '0.9.1'
| 11.666667
| 24
| 0.714286
| 12
| 70
| 3.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 0.185714
| 70
| 5
| 25
| 14
| 0.754386
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
75b62f8d56daec844d02ee96e230da93478acf2f
| 543
|
py
|
Python
|
taskmanager/src/modules/tasks/domain/events.py
|
alice-biometrics/petisco-task-manager
|
2bad52013ab122f8c3e5dce740dcd154883e6940
|
[
"MIT"
] | 1
|
2020-04-14T18:12:11.000Z
|
2020-04-14T18:12:11.000Z
|
taskmanager/src/modules/tasks/domain/events.py
|
alice-biometrics/petisco-task-manager
|
2bad52013ab122f8c3e5dce740dcd154883e6940
|
[
"MIT"
] | 3
|
2020-04-20T10:35:26.000Z
|
2020-06-15T07:45:59.000Z
|
taskmanager/src/modules/tasks/domain/events.py
|
alice-biometrics/petisco-task-manager
|
2bad52013ab122f8c3e5dce740dcd154883e6940
|
[
"MIT"
] | 1
|
2021-03-12T13:48:01.000Z
|
2021-03-12T13:48:01.000Z
|
from petisco import Event
from taskmanager.src.modules.tasks.domain.task_id import TaskId
class TaskCreated(Event):
task_id: str
def __init__(self, task_id: TaskId):
self.task_id = str(task_id)
super().__init__()
class TaskRemoved(Event):
task_id: str
def __init__(self, task_id: TaskId):
self.task_id = str(task_id)
super().__init__()
class TaskRetrieved(Event):
task_id: str
def __init__(self, task_id: TaskId):
self.task_id = str(task_id)
super().__init__()
| 19.392857
| 63
| 0.6593
| 74
| 543
| 4.337838
| 0.283784
| 0.242991
| 0.168224
| 0.130841
| 0.638629
| 0.638629
| 0.638629
| 0.638629
| 0.638629
| 0.638629
| 0
| 0
| 0.232044
| 543
| 27
| 64
| 20.111111
| 0.769784
| 0
| 0
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.176471
| false
| 0
| 0.117647
| 0
| 0.647059
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 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
| 1
| 0
|
0
| 4
|
75de1042d32dc6891004771b375b6d5e8b63dc6d
| 236
|
py
|
Python
|
tests/inspectdb/dependent_model/__init__.py
|
bryancolligan/django-salesforce
|
cec08115f97d75d9b7b96bb34c40e48974c7269f
|
[
"MIT"
] | 251
|
2015-01-15T11:39:21.000Z
|
2022-03-28T10:52:10.000Z
|
tests/inspectdb/dependent_model/__init__.py
|
bryancolligan/django-salesforce
|
cec08115f97d75d9b7b96bb34c40e48974c7269f
|
[
"MIT"
] | 196
|
2015-01-09T01:29:37.000Z
|
2022-03-19T19:35:09.000Z
|
tests/inspectdb/dependent_model/__init__.py
|
bryancolligan/django-salesforce
|
cec08115f97d75d9b7b96bb34c40e48974c7269f
|
[
"MIT"
] | 68
|
2015-01-12T18:13:13.000Z
|
2022-03-23T11:16:14.000Z
|
from django.apps import AppConfig
class AutoModelConf(AppConfig):
name = 'tests.inspectdb'
label = 'auto_model'
class DependentModelConf(AppConfig):
name = 'tests.inspectdb.dependent_model'
label = 'dependent_model'
| 19.666667
| 44
| 0.737288
| 25
| 236
| 6.84
| 0.6
| 0.152047
| 0.210526
| 0.315789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169492
| 236
| 11
| 45
| 21.454545
| 0.872449
| 0
| 0
| 0
| 0
| 0
| 0.300847
| 0.131356
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.142857
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
f935d394f1e7b8c5bbc7aca80f6779ede5f05ef0
| 2,177
|
py
|
Python
|
py/bot/commands/old_dumb_autos.py
|
Team5045/2017-bot
|
e97902c7efa46b8c85245d389ce85e4274c7fd73
|
[
"Unlicense",
"MIT"
] | null | null | null |
py/bot/commands/old_dumb_autos.py
|
Team5045/2017-bot
|
e97902c7efa46b8c85245d389ce85e4274c7fd73
|
[
"Unlicense",
"MIT"
] | null | null | null |
py/bot/commands/old_dumb_autos.py
|
Team5045/2017-bot
|
e97902c7efa46b8c85245d389ce85e4274c7fd73
|
[
"Unlicense",
"MIT"
] | null | null | null |
class DumbDriveForward(Autonomous):
nickname = "Dumb drive forward"
def __init__(self, robot):
super().__init__(robot)
self.addSequential(AutoDumbDrive(robot, time=3, speed=-0.4))
class DumbDriveForwardHighGear(CommandGroup):
nickname = "Dumb drive forward high gear"
def __init__(self, robot):
super().__init__()
self.robot = robot
self.addSequential(ShiftDriveGear(robot,
self.robot.drive_train.HIGH_GEAR))
self.addSequential(AutoDumbDrive(robot, time=0.5, speed=0))
self.addSequential(AutoDumbDrive(robot, time=3, speed=-0.4))
class DumbPlaceGear(Autonomous):
nickname = "Dumb place gear"
def __init__(self, robot):
super().__init__(robot)
self.addSequential(IntakeGear(robot))
self.addSequential(AutoDumbDrive(robot, time=3, speed=-0.4))
self.addSequential(AutoDumbDrive(robot, time=0.5, speed=0))
self.addSequential(DepositGear(robot))
self.addSequential(AutoDumbDrive(robot, time=0.5, speed=0))
# self.addSequential(AutoDumbDrive(robot, time=0.25, speed=-0.4))
self.addSequential(AutoDumbDrive(robot, time=3, speed=0.2))
class DumbPlaceAndShoot(DumbPlaceGear):
nickname = "Dumb place and shoot"
def __init__(self, robot):
super().__init__(robot)
self.addParallel(DumbShoot(robot))
self.addParallel(RunCommandAfterTime(DumbFeed(robot), time=3))
self.addParallel(AutoDumbDrive(robot, speed=0, dont_stop=True))
class DumbDriveAndShoot(Autonomous):
nickname = "Dumb drive and shoot"
def __init__(self, robot):
super().__init__(robot)
self.addSequential(IntakeGear(robot))
self.addSequential(AutoDumbDrive(robot, time=3, speed=-0.4))
self.addParallel(DumbShoot(robot))
self.addParallel(RunCommandAfterTime(DumbFeed(robot), time=3))
self.addParallel(AutoDumbDrive(robot, speed=0, dont_stop=True))
class DumbTurn(Autonomous):
nickname = "Dumb turn"
def __init__(self, robot):
super().__init__(robot)
self.addSequential(AutoRotate(robot, 90)) # Fur lols
| 33.492308
| 76
| 0.672485
| 240
| 2,177
| 5.883333
| 0.204167
| 0.168555
| 0.191218
| 0.223088
| 0.713881
| 0.713881
| 0.709632
| 0.686261
| 0.648725
| 0.597734
| 0
| 0.020231
| 0.205328
| 2,177
| 64
| 77
| 34.015625
| 0.795954
| 0.033073
| 0
| 0.577778
| 0
| 0
| 0.052356
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.133333
| false
| 0
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f94837f2cbf8b3fa88d31b341b6ba70c19b44f57
| 180
|
py
|
Python
|
examples/test.py
|
csulliv9/python_socketio
|
1600aa424c334eb9328dc8ae633ada68f65c3923
|
[
"MIT"
] | 1
|
2022-02-13T13:37:26.000Z
|
2022-02-13T13:37:26.000Z
|
examples/test.py
|
csulliv9/python_socketio
|
1600aa424c334eb9328dc8ae633ada68f65c3923
|
[
"MIT"
] | null | null | null |
examples/test.py
|
csulliv9/python_socketio
|
1600aa424c334eb9328dc8ae633ada68f65c3923
|
[
"MIT"
] | 1
|
2022-02-13T13:37:27.000Z
|
2022-02-13T13:37:27.000Z
|
import socketio
import eventlet
sio = socketio.Server(async_mode='eventlet')
app = socketio.Middleware(sio)
import eventlet
eventlet.wsgi.server(eventlet.listen(('', 8000)), app)
| 22.5
| 54
| 0.777778
| 23
| 180
| 6.043478
| 0.521739
| 0.201439
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02439
| 0.088889
| 180
| 8
| 54
| 22.5
| 0.823171
| 0
| 0
| 0.333333
| 0
| 0
| 0.044199
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f98f4503062df8c1ea9d8bb983983d10f2f92739
| 485
|
py
|
Python
|
programming-laboratory-I/ipjv/limite.py
|
MisaelAugusto/computer-science
|
d21335a2dc824b54ffe828370f0e6717fd0c7c27
|
[
"MIT"
] | null | null | null |
programming-laboratory-I/ipjv/limite.py
|
MisaelAugusto/computer-science
|
d21335a2dc824b54ffe828370f0e6717fd0c7c27
|
[
"MIT"
] | null | null | null |
programming-laboratory-I/ipjv/limite.py
|
MisaelAugusto/computer-science
|
d21335a2dc824b54ffe828370f0e6717fd0c7c27
|
[
"MIT"
] | null | null | null |
# coding: utf-8
# Aluno: Misael Augusto
# Matrícula: 117110525
# Problema: Limite açude
limite = float(raw_input())
nivel_atual = float(raw_input())
while nivel_atual < limite:
operacao = raw_input().split()
if operacao[0] == "chuva" or operacao[0] == "afluente":
nivel_atual += float(operacao[1])
else:
if (nivel_atual - float(operacao[1])) < 0:
continue
else:
nivel_atual -= float(operacao[1])
print "Açude passou a liberar água."
print "Nível: %.2f" % nivel_atual
| 23.095238
| 56
| 0.68866
| 67
| 485
| 4.850746
| 0.507463
| 0.184615
| 0.184615
| 0.212308
| 0.221538
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041872
| 0.162887
| 485
| 20
| 57
| 24.25
| 0.758621
| 0.162887
| 0
| 0.153846
| 0
| 0
| 0.129676
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.076923
| 0
| null | null | 0.153846
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
f998e28f46deae922adf043554b286491a8f5a13
| 164
|
py
|
Python
|
deui/html/view/summary_element.py
|
urushiyama/DeUI
|
14530d2dae7d96a3dee30759f85e02239fb433c5
|
[
"MIT"
] | 1
|
2021-10-17T01:54:18.000Z
|
2021-10-17T01:54:18.000Z
|
deui/html/view/summary_element.py
|
urushiyama/DeUI
|
14530d2dae7d96a3dee30759f85e02239fb433c5
|
[
"MIT"
] | null | null | null |
deui/html/view/summary_element.py
|
urushiyama/DeUI
|
14530d2dae7d96a3dee30759f85e02239fb433c5
|
[
"MIT"
] | null | null | null |
from .element import Element
class Summary(Element):
"""
Represents summary for details element.
"""
def __str__(self):
return "summary"
| 14.909091
| 43
| 0.634146
| 17
| 164
| 5.882353
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.268293
| 164
| 10
| 44
| 16.4
| 0.833333
| 0.237805
| 0
| 0
| 0
| 0
| 0.06422
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
f9abfa010267e9c92ca7620bc0043bb8b5454ba0
| 197
|
py
|
Python
|
Examples/agglomerative_clustering_example.py
|
Udit-git-acc/ML-DL-implementation
|
7514038c76d8e4293554110c604b3336f01356eb
|
[
"BSD-3-Clause"
] | 48
|
2020-08-05T09:49:21.000Z
|
2022-01-16T06:06:57.000Z
|
Examples/agglomerative_clustering_example.py
|
Udit-git-acc/ML-DL-implementation
|
7514038c76d8e4293554110c604b3336f01356eb
|
[
"BSD-3-Clause"
] | 111
|
2020-08-06T08:18:38.000Z
|
2021-10-06T20:05:04.000Z
|
Examples/agglomerative_clustering_example.py
|
Udit-git-acc/ML-DL-implementation
|
7514038c76d8e4293554110c604b3336f01356eb
|
[
"BSD-3-Clause"
] | 122
|
2020-08-05T16:59:23.000Z
|
2022-01-21T04:08:15.000Z
|
from MLlib.models import Agglomerative_clustering
import numpy as np
X = np.genfromtxt('datasets/agglomerative_clustering.txt')
model = Agglomerative_clustering()
model.work(X, 4)
model.plot(X)
| 19.7
| 58
| 0.80203
| 27
| 197
| 5.740741
| 0.62963
| 0.445161
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00565
| 0.101523
| 197
| 9
| 59
| 21.888889
| 0.870057
| 0
| 0
| 0
| 0
| 0
| 0.187817
| 0.187817
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f9e27e34f31683033a151908dd1e6a52889ed57d
| 582
|
py
|
Python
|
converter_webserver/utils.py
|
omrim96/interview
|
0df9d9116bda64b9986d065c3e5aa9aae6e8d05a
|
[
"MIT"
] | null | null | null |
converter_webserver/utils.py
|
omrim96/interview
|
0df9d9116bda64b9986d065c3e5aa9aae6e8d05a
|
[
"MIT"
] | null | null | null |
converter_webserver/utils.py
|
omrim96/interview
|
0df9d9116bda64b9986d065c3e5aa9aae6e8d05a
|
[
"MIT"
] | null | null | null |
import pickle
def get_users():
users_file = open("users_file", "rb")
try:
users = pickle.load(users_file)
except:
import pdb;pdb.set_trace()
username_table = {u.username: u for u in users}
return username_table
class User:
def __init__(self, user_id, username, password):
self.user_id = user_id
self.username = username
self.password = password
def __repr__(self):
return "User(id='{}')".format(self.user_id)
def to_dict(self):
return {"user_id": self.user_id, "username": self.username}
| 23.28
| 67
| 0.630584
| 78
| 582
| 4.423077
| 0.384615
| 0.121739
| 0.115942
| 0.104348
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.250859
| 582
| 24
| 68
| 24.25
| 0.791284
| 0
| 0
| 0
| 0
| 0
| 0.068729
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.111111
| 0.111111
| 0.111111
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
dde49a058ef4ea9ac9bfb62f9f08e4f0f20e76a7
| 5,687
|
py
|
Python
|
scraper/departments.py
|
omarayad1/AUC-Faculty-Scraper
|
1476b2912f547d681d06cd5cd2343f0420dea995
|
[
"MIT"
] | null | null | null |
scraper/departments.py
|
omarayad1/AUC-Faculty-Scraper
|
1476b2912f547d681d06cd5cd2343f0420dea995
|
[
"MIT"
] | 1
|
2015-10-09T13:19:07.000Z
|
2015-10-09T13:40:53.000Z
|
scraper/departments.py
|
omarayad1/AUC-Faculty-Scraper
|
1476b2912f547d681d06cd5cd2343f0420dea995
|
[
"MIT"
] | null | null | null |
departments = ["Academic Advising Center", "Academic Assessment and Accreditation, Office (AAA)", "Accounting Department", "Admissions, Office", "Alumni and Trustee Affairs, Office", "Applied Linguistics", "Arab and Islamic Civilizations, Department", "Arabic Language Instruction, Department", "Arts, Department", "Athletics, Department", "AUC Forum", "AUC Press and Bookstores", "AUC Press Distribution Center", "AVP for Facilities & Operations", "Biology, Department", "Budget and Financial Planning, Office", "Buildings & Grounds", "Business Computer Center", "Business Support Office", "Cairo Papers in Social Science", "Campus Planning & Construction Services", "Career Center", "Center for Learning and Teaching", "Center for Migration and Refugee Studies", "Center for Sustainable Development", "Center for Transaltion Studies ", "Center of Nanoelectronics & Devices (CND)", "Chemistry, Department", "Citadel Capital Financial Services Center", "Classroom Technologies and Media Services", "Communications, Office", "Computer Science and Engineering, Department", "Construction and Architectural Engineering", "Controller, Office", "Core Curriculum, Office", "Counselor, Office", "Cynthia Nelson Institute for Gender and Women's Studies", "Data Analytics and Institutional Research, Office", "Dean of Global Affairs and Public Policy", "Dean of Graduate Studies,Office", "Dean of Humanities and Social Sciences", "Dean of Libraries and Learning Technologies", "Dean of Sciences and Engineering", "Dean of the School of Business", "Dean of the School of Continuing Education", "Dean of Undergraduate Studies, Office", "Development, Office", "Economic and Business History Research Center ", "Economics, Department", "Electronics Engineering, Department", "El-Khazindar Business Research and Case Center", "Employability and Career Development Centers ", "Engineering & Science Services, Department", "English and Comparative Literature, Department", "English Language Instruction, Department ", "Environmental Health and Safety, Office", "Environmental Services, Department ", "Equal Opportunity and Affirmative Action, Office", "Events, Office", "Executive Vice President for Administration and Finance, Office", "External Liasion Office", "Facilities & Operations Downtown", "Facilities and Operations", "Facilities and Operations/ Maintenance, Office", "Facilities and Services, Office", "Facilities and Services/ Mail Office", "Facilities and Services/ Maintenance and Admin", "Facilities and Services/ Services", "Faculty Housing Office", "Faculty Services", "Food Services , University", "GAPP Computer Labs", "Graduate School of Education ", "Graduate Student Services", "History, Department", "Human Resources, Office", "Information Technology, Office", "Institute of Banking & Finance", "Institute of Management Development", "Institutional Development / School Of Business", "Internal Auditors, Office", "International Executive Education Institute", "International Programs, Office", "International Student Affairs Office", "Internationalization, Office", "John D. Gerhart Center for Philanthropy and Civic Engagement", "Journalism and Mass Communication, Department", "Kamal Adham Center for Television and Digital Journalism", "Law, Department", "Legal Affairs, Office", "Main Library", "Maintenance/DT, Office ", "Management Center", "Management, Department", "Mathematics & Actuarial Science, Department", "Mechanical Engineering, Department", "Medical Services, Office", "Middle East Studies Center", "New York Office", "Ombuds, Office", "Petroleum and Energy Engineering, Department", "Philosophy, Department", "Physics, Department", "Political Science, Department", "President, Office", "Printshop", "Property Inventory & Warehouses Control, Office ", "Provost, Office", "Public Policy and Administration, Department ", "Quality Assurance ", "Rare Books and Special Collections Library", "Recruitment and Student Service Center", "Registrar, Office", "Research Institute for a Sustainable Environment (RISE)", "Residential Life, Office", "Rhetoric and Composition, Department", "SCE, Career Development Department ", "SCE, Educational Testing& Assessment Division ", "SCE, Finance", "SCE, Instructional Affairs", "SCE, Languages Department", "SCE, Marketing and Business Development", "SCE, Programs & Partnerships Department", "SCE, Strategic Enrollment Management", "School of Business", "School of Sciences and Engineering", "Science and Technology Research Center", "Security, Office", "Senate, Office", "Social Research Center", "Sociology, Anthropology, Psychology and Egyptology, Department", "Special Advisor to the President", "Sponsored Programs, Office", "SSE, Associate Dean for Graduate Studies and Research", "SSE, Associate Dean for Undergraduate studies", "Strategic and International Initiatives, Office ", "Student Development, Office", "Student Financial Affairs and Scholarships, Office", "Student Life, office", "Student Services - School of Business, Office", "Student Services Online", "Student Support, Office", "Supply Chain Management and Business Support, Office", "Sustainability, Office", "Technology Transfer Office (TTO)", "The Prince Alwaleed for American Studies & Research", "Theban Mapping Project", "Training and Development, Office", "Transportation Services", "Travel Office", "University Academic Computing Technologies", "University Information Systems", "University Technology Infrastructure", "Vice President for Institutional Advancement, Office", "Vice President for Student Affairs, Office", "Yousef Jameel Science and Technology Research Center", "Zamalek Dormitory"]
| 5,687
| 5,687
| 0.781255
| 632
| 5,687
| 7.030063
| 0.39557
| 0.010804
| 0.014405
| 0.018231
| 0.022957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113241
| 5,687
| 1
| 5,687
| 5,687
| 0.881023
| 0
| 0
| 0
| 0
| 0
| 0.886955
| 0.003692
| 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
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
dde968e69072075383d7ad38729d07d6e5566ad0
| 4,048
|
py
|
Python
|
aidApp/models.py
|
PeterGodoy/Medical-Aid-Group2-BE
|
9b39bb4baeeffd2e8a2ff51dc5c96718598936dd
|
[
"MIT"
] | null | null | null |
aidApp/models.py
|
PeterGodoy/Medical-Aid-Group2-BE
|
9b39bb4baeeffd2e8a2ff51dc5c96718598936dd
|
[
"MIT"
] | null | null | null |
aidApp/models.py
|
PeterGodoy/Medical-Aid-Group2-BE
|
9b39bb4baeeffd2e8a2ff51dc5c96718598936dd
|
[
"MIT"
] | null | null | null |
from django.db import models
from django.contrib.auth.models import User # new
class Doctors(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE) # new
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
email = models.CharField(max_length=50)
password = models.CharField(max_length=50)
clinic = models.CharField(max_length=50)
pharmacy = models.CharField(max_length=50)
def __str__(self):
return self.last_name
class Clinics(models.Model):
clinic_name = models.CharField(max_length=50)
open_hours = models.CharField(max_length=50)
phone_number = models.CharField(max_length=50)
address = models.CharField(max_length=50)
city = models.CharField(max_length=50)
state = models.CharField(max_length=2)
zip_code = models.CharField(max_length=50)
def __str__(self):
return self.clinic_name
class Pharmacies(models.Model):
pharmacy_name = models.CharField(max_length=50)
open_hours = models.CharField(max_length=50)
phone_number = models.CharField(max_length=50)
address = models.CharField(max_length=50)
city = models.CharField(max_length=50)
state = models.CharField(max_length=2)
zip_code = models.CharField(max_length=50)
def __str__(self):
return self.pharmacy_name
class Patients(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE) # new
first_name = models.CharField(max_length=50)
patient_last_name = models.CharField(max_length=50)
email = models.CharField(max_length=50)
password = models.CharField(max_length=50)
doctor_last_name = models.ForeignKey(
Doctors, null=True, on_delete=models.SET_NULL)
clinic = models.ForeignKey(Clinics, null=True, on_delete=models.SET_NULL)
pharmacy = models.ForeignKey(
Pharmacies, null=True, on_delete=models.SET_NULL)
phone_number = models.CharField(max_length=50)
zip_code = models.CharField(max_length=50)
def __str__(self):
return f"{self.first_name} {self.patient_last_name}"
# class Admin(models.Model):
# admin_full_name = models.CharField(max_length=50)
# email = models.CharField(max_length=50)
# password = models.CharField(max_length=50)
# clinic = models.ForeignKey(Clinics, null=True, on_delete=models.SET_NULL)
# pharmacy = models.ForeignKey(Pharmacies, null=True, on_delete=models.SET_NULL)
# def __str__(self):
# return self.admin_full_name
class Consultations(models.Model):
last_name = models.ForeignKey(Doctors, on_delete=models.CASCADE)
patient_last_name = models.ForeignKey(Patients, on_delete=models.CASCADE)
clinic = models.ForeignKey(Clinics, null=True, on_delete=models.SET_NULL)
pharmacy = models.ForeignKey(
Pharmacies, null=True, on_delete=models.SET_NULL)
consultation_date = models.DateTimeField(auto_now_add=True, blank=True)
def __str__(self):
return f"{self.patient_last_name}"
class Feedback_Complaint(models.Model):
patient_first_name = models.ForeignKey(Patients, on_delete=models.CASCADE)
feedback_or_complaint = models.CharField(max_length=10)
patient_message = models.CharField(max_length=200)
admin_reply = models.CharField(max_length=200)
def __str__(self):
return self.feedback_or_complaint
class FAQ(models.Model):
question = models.CharField(max_length=400)
answer = models.CharField(max_length=400)
def __str__(self):
return self.question
class Newsletter(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField(unique=True, null=False)
def __str__(self):
return self.email
class ContactUs(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
email = models.EmailField()
message = models.TextField(max_length=500)
time_sent = models.TimeField(auto_now_add=True, blank=True)
def __str__(self):
return str(self.time_sent)
| 34.016807
| 84
| 0.732213
| 539
| 4,048
| 5.226345
| 0.152134
| 0.121406
| 0.236422
| 0.315229
| 0.752929
| 0.631523
| 0.627973
| 0.604544
| 0.569755
| 0.569755
| 0
| 0.023634
| 0.163785
| 4,048
| 118
| 85
| 34.305085
| 0.808567
| 0.099555
| 0
| 0.493827
| 0
| 0
| 0.018442
| 0.013212
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| false
| 0.024691
| 0.024691
| 0.111111
| 0.962963
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
34affbae266d16533638adc8491ef3ea638b3cc8
| 63
|
py
|
Python
|
anymod/exceptions.py
|
kuwv/python-anymod
|
bda5722b763f51510d5ea7cd26e911aed3981ff2
|
[
"Apache-2.0"
] | null | null | null |
anymod/exceptions.py
|
kuwv/python-anymod
|
bda5722b763f51510d5ea7cd26e911aed3981ff2
|
[
"Apache-2.0"
] | null | null | null |
anymod/exceptions.py
|
kuwv/python-anymod
|
bda5722b763f51510d5ea7cd26e911aed3981ff2
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
'''Provide exceiptions for anymore.'''
| 21
| 38
| 0.603175
| 7
| 63
| 5.428571
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018519
| 0.142857
| 63
| 2
| 39
| 31.5
| 0.685185
| 0.873016
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
34db7c276fdf5b10900f6065ea7252a50e07df3c
| 165
|
py
|
Python
|
airports/urls.py
|
illing2005/django-airports-apis
|
234f08838f4abd499549a8ba0bde8cf7f0292d72
|
[
"MIT"
] | 4
|
2015-05-21T15:41:55.000Z
|
2017-10-11T08:25:17.000Z
|
airports/urls.py
|
illing2005/django-airports-apis
|
234f08838f4abd499549a8ba0bde8cf7f0292d72
|
[
"MIT"
] | null | null | null |
airports/urls.py
|
illing2005/django-airports-apis
|
234f08838f4abd499549a8ba0bde8cf7f0292d72
|
[
"MIT"
] | null | null | null |
from django.conf.urls import url, patterns
from .views import airport_list
urlpatterns = patterns('',
url(r'^airports/$', airport_list, name='airport_list'),
)
| 27.5
| 60
| 0.733333
| 22
| 165
| 5.363636
| 0.636364
| 0.279661
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.127273
| 165
| 6
| 61
| 27.5
| 0.819444
| 0
| 0
| 0
| 0
| 0
| 0.138554
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
34e7968217ac6f44c4c82aa3ce7da670580ae54a
| 225
|
py
|
Python
|
Python/hmm/test/__init__.py
|
JohnReid/biopsy
|
1eeb714ba5b53f2ecf776d865d32e2078cbc0338
|
[
"MIT"
] | null | null | null |
Python/hmm/test/__init__.py
|
JohnReid/biopsy
|
1eeb714ba5b53f2ecf776d865d32e2078cbc0338
|
[
"MIT"
] | null | null | null |
Python/hmm/test/__init__.py
|
JohnReid/biopsy
|
1eeb714ba5b53f2ecf776d865d32e2078cbc0338
|
[
"MIT"
] | null | null | null |
#
# Copyright John Reid 2007, 2008
#
"""
Code to test L{hmm}.
"""
import unittest
from test_build_pssm import *
from test_count_mers import *
from test_simple_pssm import *
if __name__ == '__main__':
unittest.main()
| 12.5
| 32
| 0.706667
| 32
| 225
| 4.53125
| 0.65625
| 0.165517
| 0.193103
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043716
| 0.186667
| 225
| 17
| 33
| 13.235294
| 0.748634
| 0.231111
| 0
| 0
| 0
| 0
| 0.04908
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
5504f0de0a39ec11161ae3e0b3ae4381936cc649
| 84
|
py
|
Python
|
manage.py
|
trevorwjames/twitoff
|
ee34bcbd2e04eaee6d619452188e6c4f12574c70
|
[
"MIT"
] | null | null | null |
manage.py
|
trevorwjames/twitoff
|
ee34bcbd2e04eaee6d619452188e6c4f12574c70
|
[
"MIT"
] | null | null | null |
manage.py
|
trevorwjames/twitoff
|
ee34bcbd2e04eaee6d619452188e6c4f12574c70
|
[
"MIT"
] | null | null | null |
"""Application entrypoint."""
from twitoff.app import create_app
app = create_app()
| 21
| 34
| 0.761905
| 11
| 84
| 5.636364
| 0.636364
| 0.290323
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 84
| 4
| 35
| 21
| 0.826667
| 0.27381
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
5520b90bf7636b4ccd6f3b404ae0ed57a311e8ea
| 129
|
py
|
Python
|
store/views.py
|
shaymk1/Wai-Studio-Mandala-Shop
|
94ec741a36f1825da470ba0c6959820172350850
|
[
"MIT"
] | null | null | null |
store/views.py
|
shaymk1/Wai-Studio-Mandala-Shop
|
94ec741a36f1825da470ba0c6959820172350850
|
[
"MIT"
] | null | null | null |
store/views.py
|
shaymk1/Wai-Studio-Mandala-Shop
|
94ec741a36f1825da470ba0c6959820172350850
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
def home(request):
context = {}
return render(request, 'store/home.html', context)
| 18.428571
| 54
| 0.705426
| 16
| 129
| 5.6875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178295
| 129
| 6
| 55
| 21.5
| 0.858491
| 0
| 0
| 0
| 0
| 0
| 0.116279
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
9b3d669deeff80bb24d51774766bd0dc21fd5b49
| 88
|
py
|
Python
|
mymodule.py
|
ACM-SNU/python-workshop-2
|
bdef507e9440eabbdd15bc1505c3b7b44198c36e
|
[
"MIT"
] | 1
|
2016-09-13T16:59:10.000Z
|
2016-09-13T16:59:10.000Z
|
mymodule.py
|
ACM-SNU/python-workshop-2
|
bdef507e9440eabbdd15bc1505c3b7b44198c36e
|
[
"MIT"
] | null | null | null |
mymodule.py
|
ACM-SNU/python-workshop-2
|
bdef507e9440eabbdd15bc1505c3b7b44198c36e
|
[
"MIT"
] | null | null | null |
# Fibonacci numbers module
def greeting(name="stranger"):
print("Hi {}".format(name))
| 17.6
| 30
| 0.704545
| 11
| 88
| 5.636364
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113636
| 88
| 4
| 31
| 22
| 0.794872
| 0.272727
| 0
| 0
| 0
| 0
| 0.209677
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
9b40a7073e8060c29585f383c3399bb57afd1a2c
| 74
|
py
|
Python
|
src/iert/router.py
|
IERT-Prayagraj/iert_django_webapp
|
c0ad52fda672de52f2f18e543f076888d1ead1b3
|
[
"MIT"
] | null | null | null |
src/iert/router.py
|
IERT-Prayagraj/iert_django_webapp
|
c0ad52fda672de52f2f18e543f076888d1ead1b3
|
[
"MIT"
] | null | null | null |
src/iert/router.py
|
IERT-Prayagraj/iert_django_webapp
|
c0ad52fda672de52f2f18e543f076888d1ead1b3
|
[
"MIT"
] | null | null | null |
from iert_news.api.viewsets import newViewset
from rest_framework import
| 24.666667
| 45
| 0.864865
| 11
| 74
| 5.636364
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 74
| 2
| 46
| 37
| 0.939394
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 1
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
9b41fd55540f26db04c61d46075502eae9fa4a90
| 348
|
py
|
Python
|
tests/duration.py
|
tomschr/ics.py
|
f6cb12281bf78e210d51c6ff5bd324d8f2c01aef
|
[
"Apache-2.0"
] | null | null | null |
tests/duration.py
|
tomschr/ics.py
|
f6cb12281bf78e210d51c6ff5bd324d8f2c01aef
|
[
"Apache-2.0"
] | null | null | null |
tests/duration.py
|
tomschr/ics.py
|
f6cb12281bf78e210d51c6ff5bd324d8f2c01aef
|
[
"Apache-2.0"
] | null | null | null |
from ics.utils import parse_duration
from datetime import timedelta
def test_simple():
s = "PT30M"
assert parse_duration(s) == timedelta(minutes=30)
def test_negative():
s = "-PT30M"
assert parse_duration(s) == timedelta(minutes=-30)
def test_no_sign():
s = "P0DT9H0M0S"
assert parse_duration(s) == timedelta(hours=9)
| 19.333333
| 54
| 0.692529
| 47
| 348
| 4.957447
| 0.468085
| 0.223176
| 0.244635
| 0.257511
| 0.562232
| 0.437768
| 0.437768
| 0.437768
| 0.437768
| 0.437768
| 0
| 0.045936
| 0.186782
| 348
| 17
| 55
| 20.470588
| 0.777385
| 0
| 0
| 0
| 0
| 0
| 0.060345
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 1
| 0.272727
| false
| 0
| 0.181818
| 0
| 0.454545
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9b948ffa42765c25775885432190b6897557680c
| 187
|
py
|
Python
|
tests/routes_definitions/routing/__init__.py
|
fizyk/pyramid_routing
|
c5c035c8046b101a6c3f414ba8706bf8bed10241
|
[
"MIT"
] | null | null | null |
tests/routes_definitions/routing/__init__.py
|
fizyk/pyramid_routing
|
c5c035c8046b101a6c3f414ba8706bf8bed10241
|
[
"MIT"
] | 165
|
2016-06-23T20:20:11.000Z
|
2021-03-01T04:33:41.000Z
|
tests/routes_definitions/routing/__init__.py
|
fizyk/pyramid_routing
|
c5c035c8046b101a6c3f414ba8706bf8bed10241
|
[
"MIT"
] | null | null | null |
"""Test's routes definition."""
routes = [
{'name': 'index', 'pattern': '/'},
{'name': 'secret', 'pattern': '/secret'},
{'name': 'very_secret', 'pattern': '/secret/very'},
]
| 23.375
| 55
| 0.524064
| 18
| 187
| 5.388889
| 0.5
| 0.268041
| 0.391753
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171123
| 187
| 7
| 56
| 26.714286
| 0.625806
| 0.13369
| 0
| 0
| 0
| 0
| 0.480769
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
32f43429fe55bfe3daa641436b6d8a1bce8081fa
| 143
|
py
|
Python
|
ToDo/api/views/__init__.py
|
rruss/Simple-ToDo-App
|
4827f18ca40fa049a0dd30de673fbf94687a5598
|
[
"Apache-2.0"
] | null | null | null |
ToDo/api/views/__init__.py
|
rruss/Simple-ToDo-App
|
4827f18ca40fa049a0dd30de673fbf94687a5598
|
[
"Apache-2.0"
] | 5
|
2021-03-30T13:23:12.000Z
|
2021-09-22T19:01:49.000Z
|
ToDo/api/views/__init__.py
|
rruss/Simple-ToDo-App
|
4827f18ca40fa049a0dd30de673fbf94687a5598
|
[
"Apache-2.0"
] | null | null | null |
from .view import taskLists, ExecuteTask, task_list_detail, home, form_alter, form_create, form_login
from .auth import UserList, login, logout
| 71.5
| 101
| 0.825175
| 21
| 143
| 5.380952
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104895
| 143
| 2
| 102
| 71.5
| 0.882813
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
32fd504657389f3636098aa1944042de6b611aae
| 88
|
py
|
Python
|
drsclient/__init__.py
|
uc-cdis/drsclient
|
fd30409fa1392aefcbb2f508a7fc1f22d5bc7c76
|
[
"Apache-2.0"
] | null | null | null |
drsclient/__init__.py
|
uc-cdis/drsclient
|
fd30409fa1392aefcbb2f508a7fc1f22d5bc7c76
|
[
"Apache-2.0"
] | 8
|
2020-07-21T20:03:41.000Z
|
2021-03-08T15:56:58.000Z
|
drsclient/__init__.py
|
uc-cdis/drsclient
|
fd30409fa1392aefcbb2f508a7fc1f22d5bc7c76
|
[
"Apache-2.0"
] | null | null | null |
import pkg_resources
__version__ = pkg_resources.get_distribution("drsclient").version
| 22
| 65
| 0.852273
| 10
| 88
| 6.8
| 0.7
| 0.352941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 88
| 3
| 66
| 29.333333
| 0.829268
| 0
| 0
| 0
| 0
| 0
| 0.102273
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fd0859188213c3cb2e246441ea8b1a09b5a1f887
| 24,555
|
py
|
Python
|
src/bnn/train.py
|
csml2020-01/bayesian-neural-network
|
4343e59da463c682ddd25215a5837b3ec6d45226
|
[
"Apache-2.0"
] | null | null | null |
src/bnn/train.py
|
csml2020-01/bayesian-neural-network
|
4343e59da463c682ddd25215a5837b3ec6d45226
|
[
"Apache-2.0"
] | null | null | null |
src/bnn/train.py
|
csml2020-01/bayesian-neural-network
|
4343e59da463c682ddd25215a5837b3ec6d45226
|
[
"Apache-2.0"
] | null | null | null |
import logging
import math
import os
import click
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from sklearn.metrics import roc_auc_score
from torchvision import datasets, transforms
from tqdm import tqdm, trange
from bnn.metrics import OOD_test, OOD_test_MCBB, test, test_MCBB
from bnn.models import BayesianNetwork, BayesianResNet14, myResNet14
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def train(net, optimizer, epoch, trainLoader, batchSize, nSamples, T):
net.train()
num_batches_train = len(trainLoader)
for batch_idx, (data, target) in enumerate(tqdm(trainLoader)):
data, target = data.to(DEVICE), target.to(DEVICE)
net.zero_grad()
(
loss,
log_prior,
log_variational_posterior,
negative_log_likelihood,
corrects,
) = net.free_energy(data, target, batchSize, num_batches_train, nSamples, T)
loss.backward()
optimizer.step()
accuracy = corrects / batchSize
return accuracy, loss
def reset_net(net, pretrained_net):
net.conv.w_mu.data.copy_(pretrained_net.conv.w_mu.data)
net.block1.conv1.w_mu.data.copy_(pretrained_net.block1.conv1.w_mu.data)
net.block1.conv2.w_mu.data.copy_(pretrained_net.block1.conv2.w_mu.data)
net.block2.conv1.w_mu.data.copy_(pretrained_net.block2.conv1.w_mu.data)
net.block2.conv2.w_mu.data.copy_(pretrained_net.block2.conv2.w_mu.data)
net.block3.conv1.w_mu.data.copy_(pretrained_net.block3.conv1.w_mu.data)
net.block3.conv2.w_mu.data.copy_(pretrained_net.block3.conv2.w_mu.data)
net.block4.conv1.w_mu.data.copy_(pretrained_net.block4.conv1.w_mu.data)
net.block4.conv2.w_mu.data.copy_(pretrained_net.block4.conv2.w_mu.data)
net.block5.conv1.w_mu.data.copy_(pretrained_net.block5.conv1.w_mu.data)
net.block5.conv2.w_mu.data.copy_(pretrained_net.block5.conv2.w_mu.data)
net.block6.conv1.w_mu.data.copy_(pretrained_net.block6.conv1.w_mu.data)
net.block6.conv2.w_mu.data.copy_(pretrained_net.block6.conv2.w_mu.data)
net.fc.w_mu.data.copy_(pretrained_net.fc.w_mu.data)
net.fc.b_mu.data.copy_(pretrained_net.fc.b_mu.data)
return net
def update_lr(optimizer, lr):
for param_group in optimizer.param_groups:
param_group["lr"] = lr
@click.command()
@click.option("--output-dir", required=True, help="Output directory")
@click.option("--pretrained-dir", required=True, help="Directory for pretrained network")
@click.option("--data-set", default="MNIST", help="Dataset used, MNIST or CIFAR-10 or CIFAR-100")
@click.option("--model", default="CBB", help="Models: CBB (default) or MCBB")
def main(**args):
data_set = args["data_set"]
output_dir = args["output_dir"]
model = args["model"]
pretrained_dir = args["pretrained_dir"]
if data_set == "MNIST":
# downloading data
training_data = datasets.MNIST(
root=".data", train=True, download=True, transform=transforms.ToTensor()
)
test_data = datasets.MNIST(
root=".data", train=False, download=True, transform=transforms.ToTensor()
)
training_loader = torch.utils.data.DataLoader(
training_data, batch_size=128, shuffle=True, drop_last=True
)
test_loader = torch.utils.data.DataLoader(
test_data, batch_size=128, shuffle=True, drop_last=True
)
# out-of-distribution dataset: using FashionMNIST instead of notMNIST for simplicity.
fmnist = datasets.FashionMNIST(
root=".data", train=True, download=True, transform=transforms.ToTensor()
)
ood_loader = torch.utils.data.DataLoader(
fmnist, batch_size=128, shuffle=True, drop_last=True
)
if model == "CBB":
# hyper-parameters
n_units = 400
epochs = 50
batch_size = 128
T_list = torch.pow(10, -1 * torch.tensor(range(0, 45, 5)) / 10).to(DEVICE)
sigma_list = torch.tensor([0.2, 0.4, 0.6, 0.8, 1]).to(DEVICE)
n_samples = 1
testECE = torch.zeros([9, 5]).to(DEVICE)
testMCE = torch.zeros([9, 5]).to(DEVICE)
test_accuracy = torch.zeros([9, 5]).to(DEVICE)
test_loss = torch.zeros([9, 5]).to(DEVICE)
test_ROCAUC = torch.zeros([9, 5]).to(DEVICE)
entropy_ave = torch.zeros([9, 5]).to(DEVICE)
entropy_std = torch.zeros([9, 5]).to(DEVICE)
L2D = torch.zeros([9, 5]).to(DEVICE)
ood_ROCAUC1 = torch.zeros([9, 5]).to(DEVICE)
ood_ROCAUC2 = torch.zeros([9, 5]).to(DEVICE)
for j, sigma in enumerate(sigma_list):
for i, T in enumerate(T_list):
net = BayesianNetwork(n_units, sigma, T).to(DEVICE)
optimizer = optim.Adam(net.parameters())
for epoch in range(epochs):
_, _ = train(
net,
optimizer,
epoch,
training_loader,
batch_size,
n_samples,
T,
)
(
test_accuracy[i, j],
test_loss[i, j],
testECE[i, j],
testMCE[i, j],
test_ROCAUC[i, j],
out,
) = test(net, test_loader, batch_size, 50, T)
(
entropy_ave[i, j],
entropy_std[i, j],
L2D[i, j],
ood_ROCAUC1[i, j],
ood_ROCAUC2[i, j],
) = OOD_test(net, ood_loader, out, batch_size, 50, T)
with open(os.path.join(output_dir, f"net{i}{j}.pt"), "wb") as f:
torch.save(net.state_dict(), f)
else:
# hyper-parameter setting
n_units = 400
epochs = 50
batch_size = 128
T_list = torch.pow(10, -1 * torch.tensor(range(0, 45, 5)) / 10).to(DEVICE)
sigma = torch.tensor(1).to(DEVICE)
n_samples = 1
testECE = torch.zeros(
[
9,
]
).to(DEVICE)
testMCE = torch.zeros(
[
9,
]
).to(DEVICE)
test_accuracy = torch.zeros(
[
9,
]
).to(DEVICE)
test_loss = torch.zeros(
[
9,
]
).to(DEVICE)
test_ROCAUC = torch.zeros(
[
9,
]
).to(DEVICE)
entropy_ave = torch.zeros(
[
9,
]
).to(DEVICE)
entropy_std = torch.zeros(
[
9,
]
).to(DEVICE)
L2D = torch.zeros(
[
9,
]
).to(DEVICE)
ood_ROCAUC1 = torch.zeros(
[
9,
]
).to(DEVICE)
ood_ROCAUC2 = torch.zeros(
[
9,
]
).to(DEVICE)
for t, T in enumerate(T_list):
MoG_net = []
for i in range(3):
net = BayesianNetwork(n_units, sigma, T).to(DEVICE)
optimizer = optim.Adam(net.parameters())
for epoch in range(epochs):
_, _ = train(
net,
optimizer,
epoch,
training_loader,
batch_size,
n_samples,
T,
)
with open(os.path.join(output_dir, f"nets/net{t}{i}.pt"), "wb") as f:
torch.save(net.state_dict(), f)
MoG_net.append(net)
(
test_accuracy[t],
test_loss[t],
testECE[t],
_,
test_ROCAUC[t],
out,
) = test_MoG(MoG_net, test_loader, batch_size, 17, T)
(
entropy_ave[t],
entropy_std[t],
L2D[t],
ood_ROCAUC1[t],
ood_ROCAUC2[t],
) = OOD_test_MoG(MoG_net, ood_loader, out, batch_size, 17, T)
elif data_set == "CIFAR-10":
# download data
batch_size = 128
training_data = datasets.CIFAR10(
root=".data", train=True, download=True, transform=transforms.ToTensor()
)
test_data = datasets.CIFAR10(
root=".data", train=False, download=True, transform=transforms.ToTensor()
)
training_loader = torch.utils.data.DataLoader(
training_data, batch_size=batch_size, shuffle=True, drop_last=True
)
test_loader = torch.utils.data.DataLoader(
test_data, batch_size=batch_size, shuffle=True, drop_last=True
)
# ood dataset
svhn_dataset = datasets.SVHN(
root=".data", split="test", transform=transforms.ToTensor(), download=True
)
svhn_loader = torch.utils.data.DataLoader(
svhn_dataset, batch_size=batch_size, drop_last=True
)
# CBB for CIFAR-10
if models == "CBB":
pretrained_net = myResNet14(1).to(DEVICE)
with open(os.path.join(pretrained_dir, "trained10_net0.pkl", "rb")) as f:
pretrained_net.load_state_dict(torch.load(f))
# hyper-parameters
T_list = torch.pow(10, -1 * torch.tensor(range(0, 35, 5)) / 10).to(DEVICE)
sigma_list = torch.tensor([0.2, 0.4, 0.6, 0.8, 1]).to(DEVICE)
n_samples = 1
epochs = 300
testECE = torch.zeros([7, 5]).to(DEVICE)
testMCE = torch.zeros([7, 5]).to(DEVICE)
test_accuracy = torch.zeros([7, 5]).to(DEVICE)
test_loss = torch.zeros([7, 5]).to(DEVICE)
test_ROCAUC = torch.zeros([7, 5]).to(DEVICE)
entropy_ave = torch.zeros([7, 5]).to(DEVICE)
entropy_std = torch.zeros([7, 5]).to(DEVICE)
L2D = torch.zeros([7, 5]).to(DEVICE)
ood_ROCAUC1 = torch.zeros([7, 5]).to(DEVICE)
ood_ROCAUC2 = torch.zeros([7, 5]).to(DEVICE)
for j, sigma in enumerate(sigma_list):
for i, T in enumerate(T_list):
net = BayesianResNet14(ResidualBlock, sigma).to(DEVICE)
net = reset_net(net, pretrained_net)
max_lr = 0.0001
curr_lr = 0.0001
optimizer = optim.Adam(net.parameters(), lr=curr_lr)
for epoch in range(epochs):
_, _ = train(
net,
optimizer,
epoch,
training_loader,
batch_size,
n_samples,
T,
)
# cosine step size
curr_lr = max_lr / 2 * (1 + math.cos((epoch) / epochs * math.pi))
update_lr(optimizer, curr_lr)
with open(os.path.join(output_dir, f"nets/net{i}{j}.pkl"), "wb") as f:
torch.save(net.state_dict(), f)
(
test_accuracy[i, j],
test_loss[i, j],
testECE[i, j],
testMCE[i, j],
test_ROCAUC[i, j],
inDis_output,
) = test(net, test_loader, batch_size, 50, T)
(
entropy_ave[i, j],
entropy_std[i, j],
L2D[i, j],
ood_ROCAUC1[i, j],
ood_ROCAUC2[i, j],
) = OOD_test(net, svhn_loader, inDis_output, batch_size, 50, T)
# MCBB for CIFAR-10
else:
# hyper-parameter setting
batch_size = 128
n_samples = 1
T_list = torch.pow(10, -1 * torch.tensor(range(0, 35, 5)) / 10).to(DEVICE)
sigma = torch.sqrt(torch.tensor(1))
epochs = 300
testECE = torch.zeros(
[
7,
]
).to(DEVICE)
testMCE = torch.zeros(
[
7,
]
).to(DEVICE)
test_accuracy = torch.zeros(
[
7,
]
).to(DEVICE)
test_loss = torch.zeros(
[
7,
]
).to(DEVICE)
test_ROCAUC = torch.zeros(
[
7,
]
).to(DEVICE)
entropy_ave = torch.zeros(
[
7,
]
).to(DEVICE)
entropy_std = torch.zeros(
[
7,
]
).to(DEVICE)
L2D = torch.zeros(
[
7,
]
).to(DEVICE)
ood_ROCAUC1 = torch.zeros(
[
7,
]
).to(DEVICE)
ood_ROCAUC2 = torch.zeros(
[
7,
]
).to(DEVICE)
for t, T in enumerate(T_list):
MoG_net = []
for i in range(3):
net = BayesianResNet14(ResidualBlock, sigma).to(DEVICE)
pretrained_net = myResNet14(1).to(DEVICE)
with open(os.path.join(pretrained_dir, f"trained10_net{i}.pkl"), "rb") as f:
pretrained_net.load_state_dict(torch.load(f))
net = reset_net(net, pretrained_net)
max_lr = 0.0001
curr_lr = 0.0001
optimizer = optim.Adam(net.parameters(), lr=curr_lr)
for epoch in range(epochs):
_, _ = train(
net,
optimizer,
epoch,
training_loader,
batch_size,
n_samples,
T,
)
# cosine step size
curr_lr = max_lr / 2 * (1 + math.cos((epoch) / epochs * math.pi))
update_lr(optimizer, curr_lr)
with open(os.path.join(output_dir, f"nets/net{t}{i}.pkl"), "wb") as f:
torch.save(net.state_dict(), f)
(
test_accuracy[t],
test_loss[t],
testECE[t],
_,
test_ROCAUC[t],
out,
) = test_MoG(MoG_net, test_loader, batch_size, 17, T)
(
entropy_ave[t],
entropy_std[t],
L2D[t],
ood_ROCAUC1[t],
ood_ROCAUC2[t],
) = OOD_test_MoG(MoG_net, svhn_loader, out, batch_size, 17, T)
else:
# download data
batch_size = 128
training_data = datasets.CIFAR100(
root=".data", train=True, download=True, transform=transforms.ToTensor()
)
test_data = datasets.CIFAR100(
root=".data", train=False, download=True, transform=transforms.ToTensor()
)
training_loader = torch.utils.data.DataLoader(
training_data, batch_size=batch_size, shuffle=True, drop_last=True
)
test_loader = torch.utils.data.DataLoader(
test_data, batch_size=batch_size, shuffle=True, drop_last=True
)
# ood dataset
svhn_dataset = datasets.SVHN(
root=".data", split="test", transform=transforms.ToTensor(), download=True
)
svhn_loader = torch.utils.data.DataLoader(
svhn_dataset, batch_size=batch_size, drop_last=True
)
# CBB for CIFAR-100
if model == "CBB":
pretrained_net = myResNet14(1, num_class=100).to(DEVICE)
with open(
os.path.join(pretrained_dir, "trained100_net0.pkl"), "rb"
) as f: # determine the name
pretrained_net.load_state_dict(torch.load(f))
# hyper-parameters
T_list = torch.pow(10, -1 * torch.tensor(range(0, 35, 5)) / 10).to(DEVICE)
sigma_list = torch.tensor([0.2, 0.4, 0.6, 0.8, 1]).to(DEVICE)
n_samples = 1
epochs = 300
testECE = torch.zeros([7, 5]).to(DEVICE)
testMCE = torch.zeros([7, 5]).to(DEVICE)
test_accuracy = torch.zeros([7, 5]).to(DEVICE)
test_loss = torch.zeros([7, 5]).to(DEVICE)
test_ROCAUC = torch.zeros([7, 5]).to(DEVICE)
entropy_ave = torch.zeros([7, 5]).to(DEVICE)
entropy_std = torch.zeros([7, 5]).to(DEVICE)
L2D = torch.zeros([7, 5]).to(DEVICE)
ood_ROCAUC1 = torch.zeros([7, 5]).to(DEVICE)
ood_ROCAUC2 = torch.zeros([7, 5]).to(DEVICE)
for j, sigma in enumerate(sigma_list):
for i, T in enumerate(T_list):
net = BayesianResNet14(ResidualBlock, sigma, num_class=100).to(DEVICE)
net = reset_net(net, pretrained_net)
max_lr = 0.0001
curr_lr = 0.0001
optimizer = optim.Adam(net.parameters(), lr=curr_lr)
for epoch in range(epochs):
_, _ = train(
net,
optimizer,
epoch,
training_loader,
batch_size,
n_samples,
T,
)
# cosine step size
curr_lr = max_lr / 2 * (1 + math.cos((epoch) / epochs * math.pi))
update_lr(optimizer, curr_lr)
with open(os.path.join(output_dir, f"nets/net{i}{j}.pkl"), "wb") as f:
torch.save(net.state_dict(), f)
(
test_accuracy[i, j],
test_loss[i, j],
testECE[i, j],
testMCE[i, j],
test_ROCAUC[i, j],
inDis_output,
) = test(net, test_loader, batch_size, 50, T, num_class=100)
(
entropy_ave[i, j],
entropy_std[i, j],
L2D[i, j],
ood_ROCAUC1[i, j],
ood_ROCAUC2[i, j],
) = OOD_test(net, svhn_loader, inDis_output, batch_size, 50, T, num_class=100)
# MCBB for CIFAR-100
else:
# hyper-parameter setting
batch_size = 128
n_samples = 1
T_list = torch.pow(10, -1 * torch.tensor(range(0, 35, 5)) / 10).to(DEVICE)
sigma = torch.sqrt(torch.tensor(1))
epochs = 300
testECE = torch.zeros(
[
7,
]
).to(DEVICE)
testMCE = torch.zeros(
[
7,
]
).to(DEVICE)
test_accuracy = torch.zeros(
[
7,
]
).to(DEVICE)
test_loss = torch.zeros(
[
7,
]
).to(DEVICE)
test_ROCAUC = torch.zeros(
[
7,
]
).to(DEVICE)
entropy_ave = torch.zeros(
[
7,
]
).to(DEVICE)
entropy_std = torch.zeros(
[
7,
]
).to(DEVICE)
L2D = torch.zeros(
[
7,
]
).to(DEVICE)
ood_ROCAUC1 = torch.zeros(
[
7,
]
).to(DEVICE)
ood_ROCAUC2 = torch.zeros(
[
7,
]
).to(DEVICE)
for t, T in enumerate(T_list):
MoG_net = []
for i in range(3):
net = BayesianResNet14(ResidualBlock, sigma, num_class=100).to(DEVICE)
pretrained_net = myResNet14(1, num_class=100).to(DEVICE)
with open(os.path.join(pretrained_dir, f"trained100_net{i}.pkl"), "rb") as f:
pretrained_net.load_state_dict(torch.load(f))
net = reset_net(net, pretrained_net)
max_lr = 0.0001
curr_lr = 0.0001
optimizer = optim.Adam(net.parameters(), lr=curr_lr)
for epoch in range(epochs):
_, _ = train(
net,
optimizer,
epoch,
training_loader,
batch_size,
n_samples,
T,
)
# cosine step size
curr_lr = max_lr / 2 * (1 + math.cos((epoch) / epochs * math.pi))
update_lr(optimizer, curr_lr)
with open(os.path.join(output_dir, f"nets/net{t}{i}.pkl"), "wb") as f:
torch.save(net.state_dict(), f)
(
test_accuracy[t],
test_loss[t],
testECE[t],
_,
test_ROCAUC[t],
out,
) = test_MoG(MoG_net, test_loader, batch_size, 17, T, num_class=100)
(
entropy_ave[t],
entropy_std[t],
L2D[t],
ood_ROCAUC1[t],
ood_ROCAUC2[t],
) = OOD_test_MoG(MoG_net, svhn_loader, out, batch_size, 17, T, num_class=100)
with open(os.path.join(output_dir, "results/test_accuracy.pt"), "wb") as f:
torch.save(test_accuracy.cpu(), f)
with open(os.path.join(output_dir, "results/test_loss.pt"), "wb") as f:
torch.save(test_loss.cpu(), f)
with open(os.path.join(output_dir, "results/testECE.pt"), "wb") as f:
torch.save(testECE.cpu(), f)
with open(os.path.join(output_dir, "results/testMCE.pt"), "wb") as f:
torch.save(testMCE.cpu(), f)
with open(os.path.join(output_dir, "results/entropy_ave.pt"), "wb") as f:
torch.save(entropy_ave.cpu(), f)
with open(os.path.join(output_dir, "results/entropy_std.pt"), "wb") as f:
torch.save(entropy_std.cpu(), f)
with open(os.path.join(output_dir, "results/L2D.pt"), "wb") as f:
torch.save(L2D.cpu(), f)
with open(os.path.join(output_dir, "results/test_ROCAUC.pt"), "wb") as f:
torch.save(test_ROCAUC.cpu(), f)
with open(os.path.join(output_dir, "results/ood_ROCAUC1.pt"), "wb") as f:
torch.save(ood_ROCAUC1.cpu(), f)
with open(os.path.join(output_dir, "results/ood_ROCAUC2.pt"), "wb") as f:
torch.save(ood_ROCAUC2.cpu(), f)
if __name__ == "__main__":
main()
| 36.377778
| 98
| 0.455182
| 2,611
| 24,555
| 4.104941
| 0.086557
| 0.061205
| 0.041052
| 0.026124
| 0.838309
| 0.827207
| 0.774865
| 0.677552
| 0.666076
| 0.649095
| 0
| 0.034764
| 0.43653
| 24,555
| 674
| 99
| 36.431751
| 0.739881
| 0.017675
| 0
| 0.617094
| 0
| 0
| 0.030126
| 0.006432
| 0
| 0
| 0
| 0
| 0
| 1
| 0.006838
| false
| 0
| 0.023932
| 0
| 0.034188
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fd28ef6056c719c9cbec33561883bb02b250694a
| 728
|
py
|
Python
|
run/script_main.py
|
Asichurter/MalFusionFSL
|
713bf64cc07a3489f42941fd2299837075575ac0
|
[
"MIT"
] | 4
|
2021-08-05T06:49:26.000Z
|
2021-12-02T09:06:41.000Z
|
run/script_main.py
|
Asichurter/MalFusionFSL
|
713bf64cc07a3489f42941fd2299837075575ac0
|
[
"MIT"
] | null | null | null |
run/script_main.py
|
Asichurter/MalFusionFSL
|
713bf64cc07a3489f42941fd2299837075575ac0
|
[
"MIT"
] | null | null | null |
from utils.summary import makeResultSummaryByVerRange, makeResultByTrainConfigCond
# makeResultSummaryByVerRange(dataset='virushare-20',
# version_range=[80, 100])
# makeResultByTrainConfigCond(dataset='virushare-20',
# train_config_cond={
# 'model': {
# # 'model_name': 'ProtoNet',
# 'fusion': {
# 'type': 'add'
# }
# }
# })
makeResultSummaryByVerRange(dataset='virushare-20',
version_range=[318,326])
| 45.5
| 82
| 0.413462
| 36
| 728
| 8.222222
| 0.666667
| 0.162162
| 0.182432
| 0.304054
| 0.385135
| 0.385135
| 0
| 0
| 0
| 0
| 0
| 0.046196
| 0.494505
| 728
| 15
| 83
| 48.533333
| 0.758152
| 0.707418
| 0
| 0
| 0
| 0
| 0.06
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
fd2b0632a57b80259b9529cfedbe6cc7f63f3914
| 6,392
|
py
|
Python
|
inputtensorfi/manipulation/img/utils.py
|
Darkness4/input_tensor_fi
|
66316533044562e01a1bd5d4c2e283a7082b4a0c
|
[
"MIT"
] | null | null | null |
inputtensorfi/manipulation/img/utils.py
|
Darkness4/input_tensor_fi
|
66316533044562e01a1bd5d4c2e283a7082b4a0c
|
[
"MIT"
] | null | null | null |
inputtensorfi/manipulation/img/utils.py
|
Darkness4/input_tensor_fi
|
66316533044562e01a1bd5d4c2e283a7082b4a0c
|
[
"MIT"
] | null | null | null |
"""Utilities for image manipulation."""
import numpy as np
from inputtensorfi.manipulation.img.faults import BitFault, PixelFault
import tensorflow as tf
def build_perturb_image(
pixels: np.ndarray,
):
"""Build a Fault Injector using [pixels] to be faulted.
Args:
pixels (np.ndarray(dtype=PixelFault)):
A list of pixels to be faulted.
"""
for pixel in np.nditer(pixels, flags=["refs_ok"]):
item = pixel.item()
assert isinstance(item, PixelFault)
def perturb_image(img: np.ndarray) -> np.ndarray:
"""Change the pixels of the [img] according to [pixels].
Args:
img (np.ndarray): A 2D RGB image.
An img[x: int, y: int] = (r: int, g: int, b: int)
Returns:
img: 2D RGB image.
"""
img = img.copy()
for pixel in np.nditer(pixels, flags=["refs_ok"]):
item = pixel.item()
img[item.x, item.y] = item.rgb
return img
return perturb_image
def build_perturb_image_by_bit_fault(bit_faults: np.ndarray):
"""Build a Fault Injector using [bit_faults] to be faulted.
Args:
bit_faults (dtype=BitFault):
A list of pixels to be bit-faulted.
"""
for bit_fault in np.nditer(bit_faults, flags=["refs_ok"]):
item = bit_fault.item()
assert isinstance(item, BitFault)
def perturb_image(img: np.ndarray) -> np.ndarray:
"""Change the pixels of the [img] according to [bit_faults].
Args:
img (np.ndarray): A 2D RGB image.
An img[x: int, y: int] = (r: int, g: int, b: int)
Returns:
img: 2D RGB image.
"""
img = img.copy()
for bit_fault in np.nditer(bit_faults, flags=["refs_ok"]):
item = bit_fault.item()
img[item.x, item.y, item.rgb] = item.bit_action.call(
img[item.x, item.y, item.rgb], item.bit
)
return img
return perturb_image
def build_perturb_image_tensor(pixels: np.ndarray):
"""Build a Fault Injector using [bit_faults] to be faulted.
Optimized for tensors.
Args:
bit_faults (dtype=BitFault):
A list of pixels to be bit-faulted.
"""
for pixel in np.nditer(pixels, flags=["refs_ok"]):
item = pixel.item()
assert isinstance(item, PixelFault)
indices = [(pixel.x, pixel.y) for pixel in pixels]
values = np.array([pixel.rgb for pixel in pixels])
def perturb_image(x: tf.Tensor) -> tf.Tensor:
"""Change the pixels of the [x] according to [pixels].
Args:
x (tf.Tensor): A 2D RGB image.
shape = (x, y, rgb=3)
Returns:
tf.Tensor: 2D RGB image.
"""
return tf.tensor_scatter_nd_update(
x,
indices,
values,
)
return perturb_image
def build_perturb_image_by_bit_fault_tensor(bit_faults: np.ndarray):
"""Build a Fault Injector using [bit_faults] to be faulted.
Args:
bit_faults (dtype=BitFault):
A list of pixels to be bit-faulted.
"""
for bit_fault in np.nditer(bit_faults, flags=["refs_ok"]):
item = bit_fault.item()
assert isinstance(item, BitFault)
indices = np.array(
[
(bit_fault.x, bit_fault.y, bit_fault.rgb)
for bit_fault in bit_faults
],
dtype=np.int32,
)
bit_actions = np.array(
[
bit_fault.bit_action.as_tensor(bit_fault.bit)
for bit_fault in bit_faults
],
dtype=object,
)
def perturb_image(x: tf.Tensor) -> tf.Tensor:
"""Change the pixels of the [x] according to [bit_faults].
Args:
x (tf.Tensor): A 2D RGB image.
shape = (x, y, rgb=3)
Returns:
tf.Tensor: 2D RGB image.
"""
updates = [
action(x[indices[i, 0], indices[i, 1], indices[i, 2]])
for i, action in enumerate(bit_actions)
]
return tf.tensor_scatter_nd_update(
x,
indices,
updates,
)
return perturb_image
def original_perturb_image(xs, img):
# If this function is passed just one perturbation vector,
# pack it in a list to keep the computation the same
if xs.ndim < 2:
xs = np.array([xs])
# Copy the image n == len(xs) times so that we can
# create n new perturbed images
tile = [len(xs)] + [1] * (xs.ndim + 1)
imgs = np.tile(img, tile)
# Make sure to floor the members of xs as int types
xs = xs.astype(int)
for x, img in zip(xs, imgs):
# Split x into an array of 5-tuples (perturbation pixels)
# i.e., [[x,y,r,g,b], ...]
pixels = np.split(x, len(x) // 5)
for pixel in pixels:
# At each pixel's x,y position, assign its rgb value
x_pos, y_pos, *rgb = pixel
img[x_pos, y_pos] = rgb
return imgs
def original_perturb_image_by_bit_fault(xs, img):
# If this function is passed just one perturbation vector,
# pack it in a list to keep the computation the same
if xs.ndim < 2:
xs = np.array([xs])
# Copy the image n == len(xs) times so that we can
# create n new perturbed images
tile = [len(xs)] + [1] * (xs.ndim + 1)
imgs = np.tile(img, tile)
# Make sure to floor the members of xs as int types
xs = xs.astype(int)
for x, img in zip(xs, imgs):
# Split x into an array of 5-tuples (perturbation pixels)
# i.e., [[𝑥,𝑦,rgb,bit,action], ...]
bits = np.split(x, len(x) // 5)
for bit2fault in bits:
# At each pixel's x,y position, assign its rgb value
x_pos, y_pos, rgb, bit, action = bit2fault
if action == 1:
img[x_pos, y_pos, rgb] = bit_set(img[x_pos, y_pos, rgb], bit)
elif action == 2:
img[x_pos, y_pos, rgb] = bit_reset(img[x_pos, y_pos, rgb], bit)
elif action == 3:
img[x_pos, y_pos, rgb] = bit_flip(img[x_pos, y_pos, rgb], bit)
return imgs
| 30.438095
| 80
| 0.544431
| 880
| 6,392
| 3.844318
| 0.154545
| 0.037836
| 0.013302
| 0.021283
| 0.797813
| 0.785989
| 0.775939
| 0.730417
| 0.689329
| 0.640851
| 0
| 0.007198
| 0.347935
| 6,392
| 210
| 81
| 30.438095
| 0.804463
| 0.330569
| 0
| 0.52
| 0
| 0
| 0.011224
| 0
| 0
| 0
| 0
| 0
| 0.04
| 1
| 0.1
| false
| 0
| 0.03
| 0
| 0.23
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fd4f7b3ecc513f964f9acc3914951db972963974
| 188
|
py
|
Python
|
daily-q-a/questions/forms.py
|
allyjweir/daily-q-a
|
f5ec240f55776b6555c9f1e62e169067717a98c7
|
[
"MIT"
] | null | null | null |
daily-q-a/questions/forms.py
|
allyjweir/daily-q-a
|
f5ec240f55776b6555c9f1e62e169067717a98c7
|
[
"MIT"
] | null | null | null |
daily-q-a/questions/forms.py
|
allyjweir/daily-q-a
|
f5ec240f55776b6555c9f1e62e169067717a98c7
|
[
"MIT"
] | null | null | null |
from django import forms
from .models import Response
class DailyPromptForm(forms.ModelForm):
class Meta:
model = Response
exclude = ["user", "question", "created"]
| 18.8
| 49
| 0.675532
| 20
| 188
| 6.35
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228723
| 188
| 9
| 50
| 20.888889
| 0.875862
| 0
| 0
| 0
| 0
| 0
| 0.101064
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
fd53add90759c078053cc042de66be3975ff6973
| 28
|
py
|
Python
|
test/__init__.py
|
ryanshoff/python-edi
|
87c820d9170c54c0f9b5b927d6f2069b194fd9bb
|
[
"MIT"
] | 24
|
2018-10-02T23:00:06.000Z
|
2022-03-28T07:00:01.000Z
|
test/__init__.py
|
ryanshoff/python-edi
|
87c820d9170c54c0f9b5b927d6f2069b194fd9bb
|
[
"MIT"
] | 1
|
2018-08-31T19:54:05.000Z
|
2018-09-06T01:01:10.000Z
|
test/__init__.py
|
ryanshoff/python-edi
|
87c820d9170c54c0f9b5b927d6f2069b194fd9bb
|
[
"MIT"
] | 12
|
2018-10-16T15:55:51.000Z
|
2022-03-01T17:56:13.000Z
|
"""
Make tests a package
"""
| 9.333333
| 20
| 0.607143
| 4
| 28
| 4.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178571
| 28
| 3
| 21
| 9.333333
| 0.73913
| 0.714286
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b5d0560ba21ec8142e3e1099902859f9d4e0d58f
| 5,727
|
py
|
Python
|
PyViCare/PyViCareGazBoiler.py
|
paradix/PyViCare
|
6a65f6f9902142584dce8821705e86223e5054a3
|
[
"Apache-2.0"
] | null | null | null |
PyViCare/PyViCareGazBoiler.py
|
paradix/PyViCare
|
6a65f6f9902142584dce8821705e86223e5054a3
|
[
"Apache-2.0"
] | null | null | null |
PyViCare/PyViCareGazBoiler.py
|
paradix/PyViCare
|
6a65f6f9902142584dce8821705e86223e5054a3
|
[
"Apache-2.0"
] | null | null | null |
from PyViCare.PyViCareDevice import Device
from PyViCare.PyViCare import handleNotSupported
class GazBoiler(Device):
@handleNotSupported
def getBurnerActive(self):
return self.service.getProperty("heating.burner")["properties"]["active"]["value"]
@handleNotSupported
def getGasConsumptionHeatingDays(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["day"]["value"]
@handleNotSupported
def getGasConsumptionHeatingToday(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["day"]["value"][0]
@handleNotSupported
def getGasConsumptionHeatingWeeks(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["week"]["value"]
@handleNotSupported
def getGasConsumptionHeatingThisWeek(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["week"]["value"][0]
@handleNotSupported
def getGasConsumptionHeatingMonths(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["month"]["value"]
@handleNotSupported
def getGasConsumptionHeatingThisMonth(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["month"]["value"][0]
@handleNotSupported
def getGasConsumptionHeatingYears(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["year"]["value"]
@handleNotSupported
def getGasConsumptionHeatingThisYear(self):
return self.service.getProperty("heating.gas.consumption.heating")["properties"]["year"]["value"][0]
@handleNotSupported
def getGasConsumptionDomesticHotWaterDays(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["day"]["value"]
@handleNotSupported
def getGasConsumptionDomesticHotWaterToday(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["day"]["value"][0]
@handleNotSupported
def getGasConsumptionDomesticHotWaterWeeks(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["week"]["value"]
@handleNotSupported
def getGasConsumptionDomesticHotWaterThisWeek(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["week"]["value"][0]
@handleNotSupported
def getGasConsumptionDomesticHotWaterMonths(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["month"]["value"]
@handleNotSupported
def getGasConsumptionDomesticHotWaterThisMonth(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["month"]["value"][0]
@handleNotSupported
def getGasConsumptionDomesticHotWaterYears(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["year"]["value"]
@handleNotSupported
def getGasConsumptionDomesticHotWaterThisYear(self):
return self.service.getProperty("heating.gas.consumption.dhw")["properties"]["year"]["value"][0]
@handleNotSupported
def getBoilerTemperature(self):
return self.service.getProperty("heating.boiler.sensors.temperature.main")["properties"]["value"]["value"]
@handleNotSupported
def getPowerConsumptionDays(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["day"]["value"]
@handleNotSupported
def getPowerConsumptionToday(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["day"]["value"][0]
@handleNotSupported
def getPowerConsumptionWeeks(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["week"]["value"]
@handleNotSupported
def getPowerConsumptionThisWeek(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["week"]["value"][0]
@handleNotSupported
def getPowerConsumptionMonths(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["month"]["value"]
@handleNotSupported
def getPowerConsumptionThisMonth(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["month"]["value"][0]
@handleNotSupported
def getPowerConsumptionYears(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["year"]["value"]
@handleNotSupported
def getPowerConsumptionThisYear(self):
return self.service.getProperty("heating.power.consumption.total")["properties"]["year"]["value"][0]
@handleNotSupported
def getBurnerHours(self):
return self.service.getProperty("heating.burners." + str(self.service.circuit) + ".statistics")["properties"]["hours"]["value"]
@handleNotSupported
def getBurnerStarts(self):
return self.service.getProperty("heating.burners." + str(self.service.circuit) + ".statistics")["properties"]["starts"]["value"]
@handleNotSupported
def getBurnerModulation(self):
return self.service.getProperty("heating.burners." + str(self.service.circuit) + ".modulation")["properties"]["value"]["value"]
@handleNotSupported
def getOneTimeCharge(self):
return self.service.getProperty("heating.dhw.oneTimeCharge")["properties"]["active"]["value"]
def deactivateOneTimeCharge(self):
return self.service.setProperty("heating.dhw.oneTimeCharge","deactivate","{}")
def activateOneTimeCharge(self):
return self.service.setProperty("heating.dhw.oneTimeCharge","activate","{}")
| 42.738806
| 136
| 0.727082
| 504
| 5,727
| 8.261905
| 0.14881
| 0.092459
| 0.107589
| 0.161383
| 0.70365
| 0.623439
| 0.53194
| 0.53194
| 0.505524
| 0.505524
| 0
| 0.002399
| 0.126419
| 5,727
| 133
| 137
| 43.06015
| 0.829902
| 0
| 0
| 0.309278
| 0
| 0
| 0.265805
| 0.144254
| 0
| 0
| 0
| 0
| 0
| 1
| 0.329897
| false
| 0
| 0.020619
| 0.329897
| 0.690722
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
b5d1ce730f1c46bba29bea4a87a34a39bd18c1d0
| 144
|
py
|
Python
|
Python Book/8. Loops/05_max_number/max_number.py
|
alexanderivanov2/Softuni-Software-Engineering
|
8adb96f445f1da17dbb6eded9e9594319154c7e7
|
[
"MIT"
] | null | null | null |
Python Book/8. Loops/05_max_number/max_number.py
|
alexanderivanov2/Softuni-Software-Engineering
|
8adb96f445f1da17dbb6eded9e9594319154c7e7
|
[
"MIT"
] | null | null | null |
Python Book/8. Loops/05_max_number/max_number.py
|
alexanderivanov2/Softuni-Software-Engineering
|
8adb96f445f1da17dbb6eded9e9594319154c7e7
|
[
"MIT"
] | null | null | null |
n = int(input())
max_num = -1000000000000
for i in range(n):
num = int(input())
if num > max_num:
max_num = num
print(max_num)
| 16
| 24
| 0.597222
| 24
| 144
| 3.416667
| 0.5
| 0.292683
| 0.219512
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122642
| 0.263889
| 144
| 9
| 25
| 16
| 0.650943
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.142857
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b5d6ad047e4c7a700a2d2f6f298c56ff43670ceb
| 335
|
py
|
Python
|
ListaExercicios1/exercicio3.py
|
GabrielSouzaGit/PythonStudies
|
49ec26d4ae45999695ab32f8e1f27587adb5ca4b
|
[
"MIT"
] | null | null | null |
ListaExercicios1/exercicio3.py
|
GabrielSouzaGit/PythonStudies
|
49ec26d4ae45999695ab32f8e1f27587adb5ca4b
|
[
"MIT"
] | null | null | null |
ListaExercicios1/exercicio3.py
|
GabrielSouzaGit/PythonStudies
|
49ec26d4ae45999695ab32f8e1f27587adb5ca4b
|
[
"MIT"
] | null | null | null |
'''Faça um programa que receba o salário de um funcionário
e o percentual de aumento, calcule e mostre o valor do aumento e o novo salário'''
sal = float(input('Informe seu salario: '))
aum = int(input('Informe o percentual de aumento: '))
print(f'Seu aumento foi de: {sal*aum/100}')
print(f'Seu novo salario é: {sal + sal*aum/100}')
| 47.857143
| 83
| 0.716418
| 59
| 335
| 4.067797
| 0.508475
| 0.016667
| 0.108333
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.158209
| 335
| 7
| 84
| 47.857143
| 0.829787
| 0.402985
| 0
| 0
| 0
| 0
| 0.649485
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
b5f8c76d2b81923ffa0ce6f5f144b9288004363c
| 1,409
|
py
|
Python
|
server/zipper.py
|
eeue56/newer-paper
|
6e6d210bb1249cb3dca902bae87d8908afec9b85
|
[
"BSD-3-Clause"
] | 1
|
2018-02-06T19:29:40.000Z
|
2018-02-06T19:29:40.000Z
|
server/zipper.py
|
eeue56/newer-paper
|
6e6d210bb1249cb3dca902bae87d8908afec9b85
|
[
"BSD-3-Clause"
] | null | null | null |
server/zipper.py
|
eeue56/newer-paper
|
6e6d210bb1249cb3dca902bae87d8908afec9b85
|
[
"BSD-3-Clause"
] | null | null | null |
from typing import List, Dict, Any, Tuple
class Zipper(object):
def __init__(self, current: Any, rest: List[Any]) -> None:
self._current = current
self._before : List[Any] = []
self._after = rest
@property
def current(self) -> Any:
return self._current
@property
def after(self) -> List[Any]:
return self._after
@property
def before(self) -> List[Any]:
return self._before
def first(self) -> None:
if len(self._before) == 0:
return
old_current = self._current
self._current = self._before[0]
self._after = self._before[1:] + [ old_current ] + self._after
self._before = []
def last(self) -> None:
if len(self._after) == 0:
return
old_current = self._current
self._current = self._after[-1]
self._before = self._before + [ old_current ] + self._after[:-1]
self._after = []
def next(self) -> None:
if len(self._after) == 0:
return
old_current = self._current
self._current = self._after[0]
self._before = self._before + [ old_current ] + self._after[1:]
self._after = []
@property
def size(self) -> int:
return len(self._before) + len(self._after) + 1
@property
def current_index(self) -> int:
return len(self._before)
| 26.092593
| 72
| 0.562101
| 168
| 1,409
| 4.452381
| 0.184524
| 0.205882
| 0.112299
| 0.176471
| 0.525401
| 0.445187
| 0.375668
| 0.375668
| 0.375668
| 0.318182
| 0
| 0.01032
| 0.312278
| 1,409
| 54
| 73
| 26.092593
| 0.76161
| 0
| 0
| 0.357143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.214286
| false
| 0
| 0.02381
| 0.119048
| 0.452381
| 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
| 0
| 0
|
0
| 4
|
bd432cac9df611bb0870dfff05185cab7fdfe320
| 606
|
py
|
Python
|
pydrepr/drepr/outputs/base_record.py
|
scorpio975/d-repr
|
1d08024192642233d42d29e1d05f8713ee265bca
|
[
"MIT"
] | 5
|
2019-10-02T01:04:50.000Z
|
2022-03-08T09:39:50.000Z
|
pydrepr/drepr/outputs/base_record.py
|
scorpio975/d-repr
|
1d08024192642233d42d29e1d05f8713ee265bca
|
[
"MIT"
] | 3
|
2020-06-13T22:09:48.000Z
|
2021-04-23T08:23:49.000Z
|
pydrepr/drepr/outputs/base_record.py
|
scorpio975/d-repr
|
1d08024192642233d42d29e1d05f8713ee265bca
|
[
"MIT"
] | 5
|
2019-10-02T03:01:27.000Z
|
2021-02-02T13:34:35.000Z
|
from abc import ABC, abstractmethod
from typing import List, Dict, Tuple, Callable, Any, Optional, Union
class BaseRecord(ABC):
id: Union[str, tuple]
@abstractmethod
def s(self, predicate_uri: str) -> Any:
pass
@abstractmethod
def m(self, predicate_uri: str) -> Any:
pass
@abstractmethod
def us(self, predicate_uri: str, val: Any):
pass
@abstractmethod
def um(self, predicate_uri: str, val: Any):
pass
@abstractmethod
def to_dict(self) -> dict:
"""Return a copied data of this record as a dictionary"""
pass
| 22.444444
| 68
| 0.630363
| 77
| 606
| 4.896104
| 0.467532
| 0.225464
| 0.169761
| 0.201592
| 0.472149
| 0.472149
| 0.472149
| 0.472149
| 0.244032
| 0
| 0
| 0
| 0.273927
| 606
| 27
| 69
| 22.444444
| 0.856818
| 0.084158
| 0
| 0.526316
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.263158
| false
| 0.263158
| 0.105263
| 0
| 0.473684
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
1fd6d3b20896f69542667ac265160166d7e7af8c
| 226
|
py
|
Python
|
flask_dotprof/utils.py
|
nint8835/flask-dotprof
|
8435a9aff652317ef1c7e45b60ed2e3e716f46f2
|
[
"MIT"
] | null | null | null |
flask_dotprof/utils.py
|
nint8835/flask-dotprof
|
8435a9aff652317ef1c7e45b60ed2e3e716f46f2
|
[
"MIT"
] | null | null | null |
flask_dotprof/utils.py
|
nint8835/flask-dotprof
|
8435a9aff652317ef1c7e45b60ed2e3e716f46f2
|
[
"MIT"
] | null | null | null |
from pathlib import Path
from flask.helpers import send_file
from flask.wrappers import Response
def serve_frontend_resource(path: str) -> Response:
return send_file(Path(__file__).parent / "frontend" / "build" / path)
| 25.111111
| 73
| 0.769912
| 31
| 226
| 5.354839
| 0.580645
| 0.108434
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141593
| 226
| 8
| 74
| 28.25
| 0.85567
| 0
| 0
| 0
| 0
| 0
| 0.057522
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.6
| 0.2
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
1fe1cf7a83f186a26294a432f7012ef585af5e08
| 274
|
py
|
Python
|
pyibge/__init__.py
|
renanbirck/pyibge
|
f70ad060ab7d491fa61afa2b01181a2dd176e319
|
[
"MIT"
] | 6
|
2019-06-15T03:40:11.000Z
|
2021-02-27T08:59:04.000Z
|
pyibge/__init__.py
|
renanbirck/pyibge
|
f70ad060ab7d491fa61afa2b01181a2dd176e319
|
[
"MIT"
] | null | null | null |
pyibge/__init__.py
|
renanbirck/pyibge
|
f70ad060ab7d491fa61afa2b01181a2dd176e319
|
[
"MIT"
] | 4
|
2017-10-09T21:30:06.000Z
|
2019-12-18T04:56:53.000Z
|
#!/usr/bin/env python3
#
# pyIBGE: A module to access data from the Brazilian Institute of Geography and Statistics (IBGE)
# (c) 2016 Renan Birck Pinheiro [renan.birck.pinheiro@gmail.com]
from .extra_routines import state_to_id, period_to_date
from .query import IBGEQuery
| 34.25
| 97
| 0.788321
| 43
| 274
| 4.906977
| 0.813953
| 0.094787
| 0.170616
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021008
| 0.131387
| 274
| 7
| 98
| 39.142857
| 0.865546
| 0.656934
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1ff104b48c37da3b4b5a00bd6d7af2444ac5b55d
| 53
|
py
|
Python
|
examples/streaming_project/src/__init__.py
|
joannjacob/PySparkCli
|
12170f9d8a5fc1884cf5c447694b83484430eba8
|
[
"MIT"
] | 2
|
2019-12-31T08:16:38.000Z
|
2021-01-13T16:09:57.000Z
|
examples/streaming_project/src/__init__.py
|
joannjacob/PySparkCli
|
12170f9d8a5fc1884cf5c447694b83484430eba8
|
[
"MIT"
] | 19
|
2020-04-01T13:31:32.000Z
|
2022-02-27T02:43:01.000Z
|
examples/streaming_project/src/__init__.py
|
joannjacob/PySparkCli
|
12170f9d8a5fc1884cf5c447694b83484430eba8
|
[
"MIT"
] | 8
|
2019-11-27T09:18:25.000Z
|
2021-11-24T17:53:47.000Z
|
# from .streaming import twitter_stream, spark_stream
| 53
| 53
| 0.849057
| 7
| 53
| 6.142857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09434
| 53
| 1
| 53
| 53
| 0.895833
| 0.962264
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1ffafd0fbd3bfb738e367b211996ecefbddaee79
| 58
|
py
|
Python
|
src/hommmer/features/bfe.py
|
hammer-mt/hommmer
|
a02cb87841395f30911242a019f28f6ac15f27ec
|
[
"MIT"
] | 4
|
2021-11-09T21:27:30.000Z
|
2021-11-23T00:38:20.000Z
|
src/hommmer/features/bfe.py
|
hammer-mt/hommmer
|
a02cb87841395f30911242a019f28f6ac15f27ec
|
[
"MIT"
] | null | null | null |
src/hommmer/features/bfe.py
|
hammer-mt/hommmer
|
a02cb87841395f30911242a019f28f6ac15f27ec
|
[
"MIT"
] | null | null | null |
def bfe(y, X):
# backward feature elimination
pass
| 19.333333
| 34
| 0.655172
| 8
| 58
| 4.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.258621
| 58
| 3
| 35
| 19.333333
| 0.883721
| 0.482759
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
95120aae0d4c73008d3b5031c0044a422e5b6cec
| 195
|
py
|
Python
|
main/CompuCellPythonTutorial/CellMotility/Simulation/CellMotility.py
|
JulianoGianlupi/nh-cc3d-4x-base-tool
|
c0f4aceebd4c5bf3ec39e831ef851e419b161259
|
[
"CC0-1.0"
] | null | null | null |
main/CompuCellPythonTutorial/CellMotility/Simulation/CellMotility.py
|
JulianoGianlupi/nh-cc3d-4x-base-tool
|
c0f4aceebd4c5bf3ec39e831ef851e419b161259
|
[
"CC0-1.0"
] | null | null | null |
main/CompuCellPythonTutorial/CellMotility/Simulation/CellMotility.py
|
JulianoGianlupi/nh-cc3d-4x-base-tool
|
c0f4aceebd4c5bf3ec39e831ef851e419b161259
|
[
"CC0-1.0"
] | 1
|
2021-02-26T21:50:29.000Z
|
2021-02-26T21:50:29.000Z
|
from cc3d import CompuCellSetup
from .CellMotilitySteppables import CellMotilitySteppable
CompuCellSetup.register_steppable(steppable=CellMotilitySteppable(frequency=10))
CompuCellSetup.run()
| 24.375
| 80
| 0.876923
| 17
| 195
| 10
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016484
| 0.066667
| 195
| 7
| 81
| 27.857143
| 0.917582
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
95307f97c2e78e4d56551ca39bc2f19220b08ab2
| 239
|
py
|
Python
|
tests/data/10.json.py
|
lemon24/reader
|
d226baa5d320bfedee786163730fe23871414ede
|
[
"BSD-3-Clause"
] | 205
|
2018-07-14T12:54:21.000Z
|
2022-03-29T06:47:13.000Z
|
tests/data/10.json.py
|
lemon24/reader
|
d226baa5d320bfedee786163730fe23871414ede
|
[
"BSD-3-Clause"
] | 275
|
2018-01-28T20:57:13.000Z
|
2022-03-29T21:45:11.000Z
|
tests/data/10.json.py
|
lemon24/reader
|
d226baa5d320bfedee786163730fe23871414ede
|
[
"BSD-3-Clause"
] | 12
|
2021-01-01T17:15:53.000Z
|
2022-03-22T09:38:12.000Z
|
import datetime
from reader import Content
from reader import Enclosure
from reader._types import EntryData
from reader._types import FeedData
feed = FeedData(
url='{}10.json'.format(url_base),
version='json10',
)
entries = []
| 15.933333
| 37
| 0.74477
| 31
| 239
| 5.645161
| 0.580645
| 0.228571
| 0.182857
| 0.24
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.16318
| 239
| 14
| 38
| 17.071429
| 0.855
| 0
| 0
| 0
| 0
| 0
| 0.062762
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1f008d0eed686a75ea4ebbe62d759b83f4b85ee6
| 1,605
|
py
|
Python
|
CCBC_Library/ccbclib/migrations/0006_auto_20150319_1457.py
|
comsaint/ccbc
|
594838d6356a7aaeea1cda759781716c58c18824
|
[
"MIT"
] | null | null | null |
CCBC_Library/ccbclib/migrations/0006_auto_20150319_1457.py
|
comsaint/ccbc
|
594838d6356a7aaeea1cda759781716c58c18824
|
[
"MIT"
] | null | null | null |
CCBC_Library/ccbclib/migrations/0006_auto_20150319_1457.py
|
comsaint/ccbc
|
594838d6356a7aaeea1cda759781716c58c18824
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ccbclib', '0005_auto_20150315_1149'),
]
operations = [
migrations.AlterField(
model_name='borrower',
name='email',
field=models.EmailField(max_length=75, blank=True, default=None, null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='transaction',
name='borrow_manager',
field=models.CharField(max_length=32, default=None),
preserve_default=True,
),
migrations.AlterField(
model_name='transaction',
name='renew_date',
field=models.DateField(blank=True, default=None, null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='transaction',
name='renew_manager',
field=models.CharField(max_length=32, blank=True, default=None, null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='transaction',
name='return_date',
field=models.DateField(blank=True, default=None, null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='transaction',
name='return_manager',
field=models.CharField(max_length=32, blank=True, default=None, null=True),
preserve_default=True,
),
]
| 31.470588
| 88
| 0.585047
| 152
| 1,605
| 5.986842
| 0.302632
| 0.131868
| 0.164835
| 0.191209
| 0.723077
| 0.723077
| 0.723077
| 0.681319
| 0.681319
| 0.681319
| 0
| 0.022401
| 0.304673
| 1,605
| 50
| 89
| 32.1
| 0.793011
| 0.013084
| 0
| 0.613636
| 0
| 0
| 0.101138
| 0.014539
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.045455
| 0
| 0.113636
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1f352e9f4d01a0c91791318c0e6820aacc8bd1e7
| 817
|
py
|
Python
|
setup.py
|
effordsbeard/vk-sdk
|
719ef5a1ffa2a0c067dbea5014f40da54f86646b
|
[
"MIT"
] | null | null | null |
setup.py
|
effordsbeard/vk-sdk
|
719ef5a1ffa2a0c067dbea5014f40da54f86646b
|
[
"MIT"
] | null | null | null |
setup.py
|
effordsbeard/vk-sdk
|
719ef5a1ffa2a0c067dbea5014f40da54f86646b
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
from setuptools import setup
setup(
name='vkapi-sdk',
version='0.1.0',
description='This is the Python library for support vkapi.com API.',
author='Anton Petrov',
maintainer='Anton Petrov',
maintainer_email='le4dof@gmail.com',
url='https://github.com/effordsbeard/vkapi-sdk',
license='Apache',
long_description=open("README.md").read(),
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5'
],
install_requires=[
'requests'
],
)
| 31.423077
| 72
| 0.616891
| 90
| 817
| 5.566667
| 0.611111
| 0.227545
| 0.299401
| 0.207585
| 0.107784
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020734
| 0.232558
| 817
| 26
| 73
| 31.423077
| 0.778309
| 0.02448
| 0
| 0.083333
| 0
| 0
| 0.544542
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.041667
| 0
| 0.041667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1f3df0e058295570c59c0cd8636227fb15b23de5
| 753
|
py
|
Python
|
python/codingbat/src/front_back.py
|
christopher-burke/warmups
|
140c96ada87ec5e9faa4622504ddee18840dce4a
|
[
"MIT"
] | null | null | null |
python/codingbat/src/front_back.py
|
christopher-burke/warmups
|
140c96ada87ec5e9faa4622504ddee18840dce4a
|
[
"MIT"
] | 2
|
2022-03-10T03:49:14.000Z
|
2022-03-14T00:49:54.000Z
|
python/codingbat/src/front_back.py
|
christopher-burke/warmups
|
140c96ada87ec5e9faa4622504ddee18840dce4a
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
"""Front Back.
Given a string, return a new string where the
first and last chars have been exchanged.
front_back('code') == 'eodc'
front_back('a') == 'a'
front_back('ab') == 'ba'
"""
def front_back(str_: str) -> str:
"""Swap the first and last characters of a string."""
if len(str_) > 1:
return f'{str_[-1]}{str_[1:-1]}{str_[0]}'
return str_
if __name__ == "__main__":
assert front_back('code') == 'eodc'
assert front_back('a') == 'a'
assert front_back('ab') == 'ba'
assert front_back('abc') == 'cba'
assert front_back('') == ''
assert front_back('Chocolate') == 'ehocolatC'
assert front_back('aavJ') == 'Java'
assert front_back('hello') == 'oellh'
print('Passed')
| 24.290323
| 57
| 0.605578
| 107
| 753
| 4.018692
| 0.439252
| 0.272093
| 0.27907
| 0.069767
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009983
| 0.201859
| 753
| 30
| 58
| 25.1
| 0.705491
| 0.329349
| 0
| 0
| 0
| 0
| 0.204868
| 0.06288
| 0
| 0
| 0
| 0
| 0.571429
| 1
| 0.071429
| false
| 0.071429
| 0
| 0
| 0.214286
| 0.071429
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
1f45db7527df713c0a4c810a57918882a13128a4
| 1,714
|
py
|
Python
|
codewars/8kyu/dinamuh/RemoveFirstAndLastCharacter/test_bench.py
|
dinamuh/Training_one
|
d18e8fb12608ce1753162c20252ca928c4df97ab
|
[
"MIT"
] | null | null | null |
codewars/8kyu/dinamuh/RemoveFirstAndLastCharacter/test_bench.py
|
dinamuh/Training_one
|
d18e8fb12608ce1753162c20252ca928c4df97ab
|
[
"MIT"
] | 2
|
2019-01-22T10:53:42.000Z
|
2019-01-31T08:02:48.000Z
|
codewars/8kyu/dinamuh/RemoveFirstAndLastCharacter/test_bench.py
|
dinamuh/Training_one
|
d18e8fb12608ce1753162c20252ca928c4df97ab
|
[
"MIT"
] | 13
|
2019-01-22T10:37:42.000Z
|
2019-01-25T13:30:43.000Z
|
from main import remove_char
from main import remove_char2
def test(benchmark):
assert benchmark(remove_char, 'country') == 'ountr'
def test2(benchmark):
assert benchmark(remove_char2, 'country') == 'ountr'
'''''''''
---------------------------------------------------------------------------------------- benchmark: 2 tests ---------------------------------------------------------------------------------------
Name (time in ns) Min Max Mean StdDev Median IQR Outliers OPS (Mops/s) Rounds Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test2 161.7800 (1.0) 640.8800 (1.0) 167.3062 (1.0) 21.1217 (1.0) 163.5200 (1.0) 0.6700 (1.0) 1947;4802 5.9771 (1.0) 58738 100
test 213.5454 (1.32) 1,537.6818 (2.40) 224.9972 (1.34) 40.6528 (1.92) 218.3636 (1.34) 6.1818 (9.23) 4547;10752 4.4445 (0.74) 199243 22
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Legend:
Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
OPS: Operations Per Second, computed as 1 / Mean
============================================================================ 2 passed in 4.22 seconds ======================
'''''''''''
| 65.923077
| 195
| 0.326138
| 146
| 1,714
| 3.80137
| 0.616438
| 0.025225
| 0.05045
| 0.072072
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128167
| 0.217036
| 1,714
| 25
| 196
| 68.56
| 0.285395
| 0
| 0
| 0.111111
| 0
| 0.222222
| 0.875878
| 0.388173
| 0
| 0
| 0
| 0
| 0.111111
| 1
| 0.111111
| false
| 0.055556
| 0.111111
| 0
| 0.222222
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
1f70f6cd136c476e118bda2356bbc6d43f72412d
| 124
|
py
|
Python
|
scripts/hello.py
|
professionalhacker/meuiphonegratis
|
3998f889ec9703c4842942953056e1145e307598
|
[
"MIT"
] | null | null | null |
scripts/hello.py
|
professionalhacker/meuiphonegratis
|
3998f889ec9703c4842942953056e1145e307598
|
[
"MIT"
] | null | null | null |
scripts/hello.py
|
professionalhacker/meuiphonegratis
|
3998f889ec9703c4842942953056e1145e307598
|
[
"MIT"
] | null | null | null |
# This si a hello worls script
# written in Python
def main():
print("Hello, world")
if __name__ == "__main__":
main()
| 12.4
| 30
| 0.66129
| 18
| 124
| 4.111111
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.201613
| 124
| 9
| 31
| 13.777778
| 0.747475
| 0.370968
| 0
| 0
| 0
| 0
| 0.27027
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0
| 0
| 0.25
| 0.25
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2f2835070b7f64dfb07c6a6851641636cd56bbca
| 384
|
py
|
Python
|
choreslib/statuses.py
|
Dogeek/chores
|
72d17442a8ad14150dff4a2e962d9b1a9caa829a
|
[
"MIT"
] | null | null | null |
choreslib/statuses.py
|
Dogeek/chores
|
72d17442a8ad14150dff4a2e962d9b1a9caa829a
|
[
"MIT"
] | null | null | null |
choreslib/statuses.py
|
Dogeek/chores
|
72d17442a8ad14150dff4a2e962d9b1a9caa829a
|
[
"MIT"
] | null | null | null |
def _set_status(task_list, task_name, status):
task = task_list.get_task(task_name)
task.status = status
def done(task_list, args):
_set_status(task_list, args.task, "completed")
return
def start(task_list, args):
_set_status(task_list, args.task, "started")
return
def pause(task_list, args):
_set_status(task_list, args.task, "paused")
return
| 19.2
| 50
| 0.703125
| 57
| 384
| 4.403509
| 0.263158
| 0.25498
| 0.286853
| 0.270916
| 0.442231
| 0.442231
| 0.442231
| 0.442231
| 0.442231
| 0
| 0
| 0
| 0.182292
| 384
| 19
| 51
| 20.210526
| 0.799363
| 0
| 0
| 0.25
| 0
| 0
| 0.057441
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.583333
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2f5219b22030bf8d25806c8453cdf23336dbdaa3
| 554
|
py
|
Python
|
openstack_manager/cmd/manager.py
|
syunkitada/openstack-manager
|
d37c611040444352d3947f236f04124e4f548390
|
[
"MIT"
] | null | null | null |
openstack_manager/cmd/manager.py
|
syunkitada/openstack-manager
|
d37c611040444352d3947f236f04124e4f548390
|
[
"MIT"
] | null | null | null |
openstack_manager/cmd/manager.py
|
syunkitada/openstack-manager
|
d37c611040444352d3947f236f04124e4f548390
|
[
"MIT"
] | null | null | null |
# coding: utf-8
from openstack_manager.conf import config
from openstack_manager.service import (k8s_openstack_deploy_manager,
k8s_openstack_monitor_manager,
k8s_rabbitmq_manager)
def k8s_openstack_deploy_manager_main():
config.init()
k8s_openstack_deploy_manager.launch()
def k8s_openstack_monitor_manager_main():
config.init()
k8s_openstack_monitor_manager.launch()
def k8s_rabbitmq_manager_main():
config.init()
k8s_rabbitmq_manager.launch()
| 25.181818
| 69
| 0.693141
| 62
| 554
| 5.725806
| 0.290323
| 0.202817
| 0.152113
| 0.211268
| 0.253521
| 0.185915
| 0
| 0
| 0
| 0
| 0
| 0.02381
| 0.241877
| 554
| 21
| 70
| 26.380952
| 0.821429
| 0.023466
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.230769
| true
| 0
| 0.153846
| 0
| 0.384615
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2f78bf4c3d6d9df72b4d6880be8c4503b3f93453
| 114
|
py
|
Python
|
codeforces/april-fools-day/is_it_rated.py
|
Zenix27/data-structure-and-algorithms
|
7570a65f40c8fbb8a08845be749f507f58ed773f
|
[
"MIT"
] | 81
|
2020-05-22T14:22:04.000Z
|
2021-12-18T10:11:23.000Z
|
codeforces/april-fools-day/is_it_rated.py
|
Zenix27/data-structure-and-algorithms
|
7570a65f40c8fbb8a08845be749f507f58ed773f
|
[
"MIT"
] | 4
|
2020-08-06T21:08:00.000Z
|
2021-03-31T16:07:50.000Z
|
codeforces/april-fools-day/is_it_rated.py
|
Zenix27/data-structure-and-algorithms
|
7570a65f40c8fbb8a08845be749f507f58ed773f
|
[
"MIT"
] | 37
|
2020-05-22T14:25:21.000Z
|
2021-12-30T03:13:13.000Z
|
"""
[A. Is it rated?](https://codeforces.com/contest/1331/problem/A)
"""
print("No") # The contest was not rated
| 22.8
| 64
| 0.657895
| 18
| 114
| 4.166667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04
| 0.122807
| 114
| 4
| 65
| 28.5
| 0.71
| 0.798246
| 0
| 0
| 0
| 0
| 0.133333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
2f9743dd06f2aa8e3f40335279c35f9a61d2f74e
| 259
|
py
|
Python
|
tokenfe/task/views.py
|
jameem-pixel/ticketproject
|
d8ae4c3a0dc924bc99d8ba50eaa722935710ef93
|
[
"Apache-2.0"
] | null | null | null |
tokenfe/task/views.py
|
jameem-pixel/ticketproject
|
d8ae4c3a0dc924bc99d8ba50eaa722935710ef93
|
[
"Apache-2.0"
] | null | null | null |
tokenfe/task/views.py
|
jameem-pixel/ticketproject
|
d8ae4c3a0dc924bc99d8ba50eaa722935710ef93
|
[
"Apache-2.0"
] | 1
|
2022-01-22T18:58:20.000Z
|
2022-01-22T18:58:20.000Z
|
from .models import *
# Create your views here.
from django.shortcuts import render,redirect
from .models import *
def home(request):
return render(request,'task/home.html')
def loginpage(request):
return render(request,'task/login.html')
| 23.545455
| 45
| 0.718147
| 34
| 259
| 5.470588
| 0.558824
| 0.107527
| 0.172043
| 0.27957
| 0.322581
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173745
| 259
| 10
| 46
| 25.9
| 0.869159
| 0.088803
| 0
| 0.285714
| 0
| 0
| 0.130045
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.428571
| 0.285714
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.