hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bde00d5057eb89869a40de202d4fd01b36be6f4a | 65 | py | Python | src/clld/project_template/{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}/tests/conftest.py | blurks/clld | d9900f88af726eb6a4d2668f517d5af23bcc6f9d | [
"MIT"
] | 32 | 2015-02-22T02:09:29.000Z | 2022-02-18T14:40:16.000Z | src/clld/project_template/{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}/tests/conftest.py | blurks/clld | d9900f88af726eb6a4d2668f517d5af23bcc6f9d | [
"MIT"
] | 199 | 2015-01-05T11:58:38.000Z | 2022-02-22T14:34:52.000Z | src/clld/project_template/{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}/tests/conftest.py | blurks/clld | d9900f88af726eb6a4d2668f517d5af23bcc6f9d | [
"MIT"
] | 18 | 2015-01-23T13:00:47.000Z | 2022-02-21T16:32:36.000Z | from {{cookiecutter.directory_name}} import models
import pytest
| 21.666667 | 50 | 0.830769 | from {{cookiecutter.directory_name}} import models
import pytest
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a66e6dee5ebecb5a3377454d74c3b1873a326bf3 | 1,029 | py | Python | server.py | AlexMout/OptionPricer | 3c95a3758ab9a96027d40c8d7a23c3e4482ff221 | [
"MIT"
] | 1 | 2019-08-21T16:51:59.000Z | 2019-08-21T16:51:59.000Z | server.py | AlexMout/OptionPricer | 3c95a3758ab9a96027d40c8d7a23c3e4482ff221 | [
"MIT"
] | null | null | null | server.py | AlexMout/OptionPricer | 3c95a3758ab9a96027d40c8d7a23c3e4482ff221 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
app.run(debug=True) | 36.75 | 93 | 0.699708 | from flask import Flask, redirect,render_template, request
import json
import view_model as vm
app = Flask(__name__)
@app.route("/")
def main_page():
return render_template("index.html",page_title="Pricer")
@app.route("/get_price",methods=['POST'])
def get_price():
dict_args = {}
dict_args['strategy'] = ... | 0 | 814 | 0 | 0 | 0 | 0 | 0 | 27 | 90 |
fc5fabe4297bec14191b579e187d61fd0988d9f1 | 999 | py | Python | h/migrations/versions/ef3059e0396_add_staff_column_to_feature_table.py | noscripter/h | a7a4095a46683ea08dae62335bbcd53f7ab313e2 | [
"MIT"
] | null | null | null | h/migrations/versions/ef3059e0396_add_staff_column_to_feature_table.py | noscripter/h | a7a4095a46683ea08dae62335bbcd53f7ab313e2 | [
"MIT"
] | null | null | null | h/migrations/versions/ef3059e0396_add_staff_column_to_feature_table.py | noscripter/h | a7a4095a46683ea08dae62335bbcd53f7ab313e2 | [
"MIT"
] | null | null | null | """Add the staff columns to the feature and user tables.
Revision ID: ef3059e0396
Revises: 3bf1c2289e8d
Create Date: 2015-07-30 16:25:14.837823
"""
# revision identifiers, used by Alembic.
revision = 'ef3059e0396'
down_revision = '3bf1c2289e8d'
| 27.75 | 74 | 0.638639 | """Add the staff columns to the feature and user tables.
Revision ID: ef3059e0396
Revises: 3bf1c2289e8d
Create Date: 2015-07-30 16:25:14.837823
"""
# revision identifiers, used by Alembic.
revision = 'ef3059e0396'
down_revision = '3bf1c2289e8d'
from alembic import op
import sqlalchemy as sa
def upgrade():
wit... | 0 | 0 | 0 | 0 | 0 | 655 | 0 | 3 | 91 |
18eaab80515f9d58ded2d73661955aaf052c1aef | 36,651 | py | Python | twistedcaldav/extensions.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | twistedcaldav/extensions.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | twistedcaldav/extensions.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | # -*- test-case-name: twistedcaldav.test.test_extensions -*-
##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | 33.967563 | 153 | 0.587051 | # -*- test-case-name: twistedcaldav.test.test_extensions -*-
##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | 0 | 17,580 | 0 | 14,464 | 0 | 0 | 0 | 603 | 797 |
1ec186044470a12f22d40759ef34223c5f8b558c | 1,428 | py | Python | apps/product/urls.py | asmuratbek/oobamarket | 1053976a13ea84b9aabfcbbcbcffd79549ce9538 | [
"MIT"
] | null | null | null | apps/product/urls.py | asmuratbek/oobamarket | 1053976a13ea84b9aabfcbbcbcffd79549ce9538 | [
"MIT"
] | 7 | 2020-06-05T23:36:01.000Z | 2022-01-13T01:42:07.000Z | apps/product/urls.py | asmuratbek/oobamarket | 1053976a13ea84b9aabfcbbcbcffd79549ce9538 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from .views import ProductCreateView, ProductUpdateView, ProductIndexCreateView, upload_images, remove_uploaded_image, upload_images_product_update, delete_product_images, add_product_review, ProductListView, update_product_review, ProductDetailView, delete_product
urlpatterns = [
... | 62.086957 | 120 | 0.716387 | from django.conf.urls import url, include
from .views import ProductCreateView, ProductUpdateView, ProductIndexCreateView, upload_images, \
remove_uploaded_image, ProductDeleteView, change_publish_status, upload_images_product_update, \
delete_product_images, add_product_review, ProductListView, update_product... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 0 |
c45f7fea9fc7283439b8d96051094b0a4149e1ec | 1,133 | py | Python | account/acct.py | dahanhan/Ad-Insertion-Sample | 12019c70a95f1d83d792e7e03d1dd5f732630558 | [
"BSD-3-Clause"
] | 82 | 2019-04-07T04:27:47.000Z | 2022-02-04T07:35:58.000Z | account/acct.py | dahanhan/Ad-Insertion-Sample | 12019c70a95f1d83d792e7e03d1dd5f732630558 | [
"BSD-3-Clause"
] | 43 | 2019-04-04T22:03:02.000Z | 2020-08-25T10:11:44.000Z | account/acct.py | dahanhan/Ad-Insertion-Sample | 12019c70a95f1d83d792e7e03d1dd5f732630558 | [
"BSD-3-Clause"
] | 54 | 2019-04-04T23:27:05.000Z | 2022-01-30T14:27:16.000Z | #!/usr/bin/python3
| 33.323529 | 199 | 0.533098 | #!/usr/bin/python3
from tornado import web
import random
class AcctHandler(web.RequestHandler):
def __init__(self, app, request, **kwargs):
super(AcctHandler, self).__init__(app, request, **kwargs)
self._users={
"guest": {
"subscription": "basic",
"ad-pr... | 0 | 0 | 0 | 1,052 | 0 | 0 | 0 | -6 | 68 |
d11f0cf6415d468e14983474a46033013201acd7 | 504 | py | Python | src/clientsubscription/urls.py | kaizer88/moltrandashboad | 590b3426ecc3a80aa31a08eb07bed224d0c2562d | [
"MIT"
] | null | null | null | src/clientsubscription/urls.py | kaizer88/moltrandashboad | 590b3426ecc3a80aa31a08eb07bed224d0c2562d | [
"MIT"
] | 4 | 2021-04-08T22:01:45.000Z | 2021-09-22T19:50:53.000Z | src/clientsubscription/urls.py | kaizer88/moltrandashboad | 590b3426ecc3a80aa31a08eb07bed224d0c2562d | [
"MIT"
] | null | null | null | from django.urls import path
from .views import clients, edit_client, edit_client_plan
urlpatterns = [
path('clients', clients, name='clients'),
path('add_client', edit_client, name='add_client'),
path('add_client_plan', edit_client_plan, name='add_client_plan'),
path('edit_client/<id>', edit_client... | 29.647059 | 83 | 0.728175 | from django.urls import path
from .views import clients, edit_client, edit_client_plan
urlpatterns = [
path('clients', clients, name='clients'),
path('add_client', edit_client, name='add_client'),
path('add_client_plan', edit_client_plan, name='add_client_plan'),
path('edit_client/<id>', edit_client... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1374c32f5067399da6487fb75c2e6f20e0f54694 | 2,522 | py | Python | policy/stale_issue_policy.py | kskewes-sf/spinnakerbot | 32a7ad75a0c12e09498d24fe0cc8dd1b810bd6f7 | [
"Apache-2.0"
] | 6 | 2020-03-18T10:33:53.000Z | 2021-05-02T01:58:10.000Z | policy/stale_issue_policy.py | kskewes-sf/spinnakerbot | 32a7ad75a0c12e09498d24fe0cc8dd1b810bd6f7 | [
"Apache-2.0"
] | 8 | 2020-03-28T23:01:00.000Z | 2020-12-01T06:52:00.000Z | policy/stale_issue_policy.py | kskewes-sf/spinnakerbot | 32a7ad75a0c12e09498d24fe0cc8dd1b810bd6f7 | [
"Apache-2.0"
] | 10 | 2020-02-05T16:24:28.000Z | 2022-03-17T21:37:36.000Z |
StaleIssuePolicy()
| 37.088235 | 104 | 0.593973 | from datetime import datetime
import github.Issue
from gh import HasLabel, AddLabel
from .policy import Policy
class StaleIssuePolicy(Policy):
def __init__(self):
super().__init__()
self.stale_days = self.config.get('stale_days')
self.ignore_lifecycle_label = self.config.get('ignore_life... | 0 | 0 | 0 | 2,365 | 0 | 0 | 0 | 23 | 113 |
f677cf2975804dbb775573b4329825da1295a53d | 3,794 | py | Python | rkqc/tools/gui/ui/PLAFile.py | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 158 | 2016-07-21T10:45:05.000Z | 2022-03-25T00:56:20.000Z | rkqc/tools/gui/ui/PLAFile.py | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 35 | 2016-07-25T01:23:07.000Z | 2021-09-27T16:05:50.000Z | rkqc/tools/gui/ui/PLAFile.py | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 62 | 2016-08-29T17:28:11.000Z | 2021-12-29T17:55:58.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PLAFile.ui'
#
# Created: Fri Jun 10 09:11:23 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError... | 49.921053 | 129 | 0.718239 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PLAFile.ui'
#
# Created: Fri Jun 10 09:11:23 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribu... | 0 | 0 | 0 | 3,358 | 0 | 0 | 0 | 40 | 46 |
1ad9a1e9d74f0a233755e761f044ec5a30b35931 | 1,492 | py | Python | idVaildator/core/tests.py | aboueleyes/id-validator | 29ecf517516921f92e9eee85b6f97078a8334509 | [
"MIT"
] | 6 | 2022-03-17T21:18:52.000Z | 2022-03-18T15:57:35.000Z | idVaildator/core/tests.py | aboueleyes/id-validator | 29ecf517516921f92e9eee85b6f97078a8334509 | [
"MIT"
] | 2 | 2022-03-17T20:49:27.000Z | 2022-03-17T22:37:57.000Z | idVaildator/core/tests.py | aboueleyes/id-validator | 29ecf517516921f92e9eee85b6f97078a8334509 | [
"MIT"
] | null | null | null | import unittest
VALID_ID = "30103211203135"
if __name__ == "__main__":
unittest.main()
| 28.692308 | 66 | 0.656836 | import datetime
import unittest
from .EgyptianNationalId import EgyptianNationalId
VALID_ID = "30103211203135"
class TestNationalId(unittest.TestCase):
def setUp(self) -> None:
self.id = EgyptianNationalId(VALID_ID)
def test_validaty(self):
id_2 = "abc123"
id_3 = "301031120135"
... | 0 | 0 | 0 | 1,306 | 0 | 0 | 0 | 23 | 68 |
14651715e8f22cb30846c42b99b85c2b58ee6a19 | 1,333 | py | Python | train.py | tom-doerr/Hindsight-Goal-Generation | 3abd832bcd484da62dcbc72296f9435a3d55397d | [
"MIT"
] | 20 | 2019-09-25T21:20:59.000Z | 2021-12-08T08:32:01.000Z | train.py | tom-doerr/Hindsight-Goal-Generation | 3abd832bcd484da62dcbc72296f9435a3d55397d | [
"MIT"
] | 2 | 2020-01-09T02:52:56.000Z | 2021-05-14T13:23:18.000Z | train.py | tom-doerr/Hindsight-Goal-Generation | 3abd832bcd484da62dcbc72296f9435a3d55397d | [
"MIT"
] | 10 | 2019-12-19T15:37:15.000Z | 2022-03-24T17:21:41.000Z | import time
from common import get_args, experiment_setup
if __name__=='__main__':
args = get_args()
env, env_test, agent, buffer, learner, tester = experiment_setup(args)
args.logger.summary_init(agent.graph, agent.sess)
# Progress info
args.logger.add_item('Epoch')
args.logger.add_item('Cycle')
args.logger.... | 27.204082 | 71 | 0.736684 | import numpy as np
import time
from common import get_args,experiment_setup
if __name__=='__main__':
args = get_args()
env, env_test, agent, buffer, learner, tester = experiment_setup(args)
args.logger.summary_init(agent.graph, agent.sess)
# Progress info
args.logger.add_item('Epoch')
args.logger.add_item('Cyc... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 22 |
a25da8c4cf788af26bbd8f7f6206a46740a73edc | 398 | py | Python | lecture5.py | sterbinsky/APSpyLecture5 | 6319017ab1287dc8e29cfe7fd7ef02675fbebba0 | [
"Apache-2.0"
] | null | null | null | lecture5.py | sterbinsky/APSpyLecture5 | 6319017ab1287dc8e29cfe7fd7ef02675fbebba0 | [
"Apache-2.0"
] | null | null | null | lecture5.py | sterbinsky/APSpyLecture5 | 6319017ab1287dc8e29cfe7fd7ef02675fbebba0 | [
"Apache-2.0"
] | null | null | null | '''
Python code used in APS 2016 Python lecture 5
'''
import h5py
import lecture5_lib
f = h5py.File('writer_1_3.hdf5', 'r')
x = f['/Scan/data/two_theta']
y = f['/Scan/data/counts']
print 'file:', f.filename
print 'peak position:', lecture5_lib.peak_position(x, y)
print 'center-of-mass:', lecture5_lib.center_of_mass(x... | 20.947368 | 58 | 0.683417 | '''
Python code used in APS 2016 Python lecture 5
'''
import h5py
import lecture5_lib
f = h5py.File('writer_1_3.hdf5', 'r')
x = f['/Scan/data/two_theta']
y = f['/Scan/data/counts']
print 'file:', f.filename
print 'peak position:', lecture5_lib.peak_position(x, y)
print 'center-of-mass:', lecture5_lib.center_of_mass(x... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4ae604f13ca9a87e0ca10ccf04abacaf47194f98 | 7,231 | py | Python | priceprobi/geocoding/geocoder.py | ujjwaln/priceprobi | 73acaca303590ebb3eaa01452c7343e5d72cf836 | [
"Apache-2.0"
] | null | null | null | priceprobi/geocoding/geocoder.py | ujjwaln/priceprobi | 73acaca303590ebb3eaa01452c7343e5d72cf836 | [
"Apache-2.0"
] | null | null | null | priceprobi/geocoding/geocoder.py | ujjwaln/priceprobi | 73acaca303590ebb3eaa01452c7343e5d72cf836 | [
"Apache-2.0"
] | null | null | null | __author__ = "ujjwal"
from priceprobi.utils import get_env
from priceprobi.config import get_config
if __name__ == "__main__":
config = get_config(get_env())
geocoder = Geocoder(config=config)
geocoder.check_mandi_locations()
geocoder.create_batch_geocodes()
| 39.086486 | 113 | 0.511824 | __author__ = "ujjwal"
import os
import json
import requests
import urllib
import xmltodict
from priceprobi.utils import get_env
from priceprobi.config import get_config
from priceprobi.db.mongo_helper import MongoHelper
from priceprobi.config import NOMINATIM, CSIS
from priceprobi import logger
def scrape_cics_data()... | 0 | 0 | 0 | 5,877 | 0 | 834 | 0 | 20 | 222 |
9b786af279c83d145ff4e00615157b0533f35625 | 203 | py | Python | api/admin.py | ilovedarknet/BookShoping | 315d2b9996acb3dc1a0743c29728f1d3affd848d | [
"BSD-3-Clause"
] | null | null | null | api/admin.py | ilovedarknet/BookShoping | 315d2b9996acb3dc1a0743c29728f1d3affd848d | [
"BSD-3-Clause"
] | null | null | null | api/admin.py | ilovedarknet/BookShoping | 315d2b9996acb3dc1a0743c29728f1d3affd848d | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
admin.site.register(Book)
admin.site.register(Booking)
admin.site.register(Achievement)
admin.site.register(AboutUs)
admin.site.register(Card)
| 15.615385 | 32 | 0.79803 | from django.contrib import admin
from .models import *
admin.site.register(Book)
admin.site.register(Booking)
admin.site.register(Achievement)
admin.site.register(AboutUs)
admin.site.register(Card)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
a6b85a9fa5b6a9d33c01490e4df617306ecdb1a1 | 818 | py | Python | Algorithms/014_SPLC.py | ChaoticMarauder/Project_Rosalind | 6c70cd32908f3b11285e8505c3b43f1ea222decb | [
"MIT"
] | null | null | null | Algorithms/014_SPLC.py | ChaoticMarauder/Project_Rosalind | 6c70cd32908f3b11285e8505c3b43f1ea222decb | [
"MIT"
] | null | null | null | Algorithms/014_SPLC.py | ChaoticMarauder/Project_Rosalind | 6c70cd32908f3b11285e8505c3b43f1ea222decb | [
"MIT"
] | null | null | null |
if(__name__=='__main__'):
main() | 22.108108 | 65 | 0.655257 | from rosalind import parse_fasta
from rosalind import translate
from rosalind import transcribe
def rna_splicing(dna, intron_list):
for intron in intron_list:
dna=dna.replace(intron,'')
spliced_rna = ''.join(transcribe(dna))
return spliced_rna
def main():
file_name='dataset... | 0 | 0 | 0 | 0 | 0 | 631 | 0 | 30 | 112 |
6cdd182dff528ad72ef2041ff1abe444851d12e2 | 2,658 | py | Python | setup.py | JGoutin/compilertools | f4375238937384a0400cfc618d3b18fc6e7233a9 | [
"BSD-2-Clause"
] | 10 | 2017-09-07T18:53:26.000Z | 2021-02-22T22:05:30.000Z | setup.py | JGoutin/compilertools | f4375238937384a0400cfc618d3b18fc6e7233a9 | [
"BSD-2-Clause"
] | 2 | 2018-08-16T08:42:09.000Z | 2019-01-11T20:20:21.000Z | setup.py | JGoutin/compilertools | f4375238937384a0400cfc618d3b18fc6e7233a9 | [
"BSD-2-Clause"
] | 2 | 2018-05-11T07:44:56.000Z | 2018-05-28T13:08:41.000Z | #! /usr/bin/env python3
"""Setup script
run "./setup.py --help-commands" for help.
"""
from datetime import datetime
from os.path import abspath, dirname, join
PACKAGE_INFO = dict(
name="compilertools",
description="A library for helping optimizing Python extensions compilation.",
long_description_content... | 34.973684 | 82 | 0.640331 | #! /usr/bin/env python3
"""Setup script
run "./setup.py --help-commands" for help.
"""
from datetime import datetime
from os.path import abspath, dirname, join
PACKAGE_INFO = dict(
name="compilertools",
description="A library for helping optimizing Python extensions compilation.",
long_description_content... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
493df341c71de6258d096663ce60490db7df8986 | 6,047 | py | Python | help_func.py | GiladGH/pointcleannet | 1c7f8f00c2062923063de2f796d96e444476d698 | [
"MIT"
] | null | null | null | help_func.py | GiladGH/pointcleannet | 1c7f8f00c2062923063de2f796d96e444476d698 | [
"MIT"
] | null | null | null | help_func.py | GiladGH/pointcleannet | 1c7f8f00c2062923063de2f796d96e444476d698 | [
"MIT"
] | null | null | null | import os
import h5py
import numpy as np
import matplotlib.pyplot as plt
def load_h5_data_label(h5_filename):
""" load the data from the hdf5 files """
f = h5py.File(h5_filename)
data = f['data'][:]
labels = f['label'][:]
# normal = f['normal'][:]
return (data, labels)
def poi... | 39.266234 | 127 | 0.587729 | import os
import h5py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
def load_h5_data_label(h5_filename):
""" load the data from the hdf5 files """
f = h5py.File(h5_filename)
data = f['data'][:]
labels = f['label'][:]
... | 0 | 0 | 0 | 0 | 0 | 534 | 0 | 22 | 71 |
ab6875a1e5f03d7dfe00c29b4051c4828e6cf04b | 5,842 | py | Python | canvas.py | zach-king/GlyphyType | dd930730af4396ad7d5ac12d5011a35a1f5ab9bc | [
"MIT"
] | null | null | null | canvas.py | zach-king/GlyphyType | dd930730af4396ad7d5ac12d5011a35a1f5ab9bc | [
"MIT"
] | null | null | null | canvas.py | zach-king/GlyphyType | dd930730af4396ad7d5ac12d5011a35a1f5ab9bc | [
"MIT"
] | null | null | null | '''
File: canvas.py
Description:
Implements the custom GlyphyType canvas widget
for drawing characters/glyphs.
''' | 31.240642 | 119 | 0.60647 | '''
File: canvas.py
Description:
Implements the custom GlyphyType canvas widget
for drawing characters/glyphs.
'''
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from tools import brush, line
class Canvas(QWidget):
def __init__(self, parent=None):
super(Canvas, self)... | 0 | 0 | 0 | 5,588 | 0 | 0 | 0 | 17 | 91 |
cf852852484ccf979e059170505d800849d97458 | 1,807 | py | Python | app/doll/models/doll.py | Younlab/GFS-Backend | 06bd2d14bc1e3226a458089fb99496516273f296 | [
"MIT"
] | 2 | 2019-03-03T10:59:55.000Z | 2019-03-03T11:00:07.000Z | app/doll/models/doll.py | Younlab/GFS-Backend | 06bd2d14bc1e3226a458089fb99496516273f296 | [
"MIT"
] | null | null | null | app/doll/models/doll.py | Younlab/GFS-Backend | 06bd2d14bc1e3226a458089fb99496516273f296 | [
"MIT"
] | null | null | null |
__all__ = (
'Doll',
'Status',
)
| 28.234375 | 67 | 0.667405 | from django.contrib.postgres.fields import ArrayField
from django.db import models
__all__ = (
'Doll',
'Status',
)
class Doll(models.Model):
id = models.PositiveIntegerField(unique=True, primary_key=True)
code_name = models.CharField(max_length=50)
rank = models.PositiveSmallIntegerField()
ty... | 0 | 0 | 0 | 1,635 | 0 | 0 | 0 | 39 | 90 |
d5644bcae84f74922c59509dd07adf55a2df2457 | 1,762 | py | Python | check_version_increase.py | elbuco1/fen2png | c64263cb5c53eeb33d2d311328256ffe4f1ac1a2 | [
"MIT"
] | 2 | 2021-12-01T03:28:52.000Z | 2022-01-29T19:58:38.000Z | check_version_increase.py | elbuco1/fen2png | c64263cb5c53eeb33d2d311328256ffe4f1ac1a2 | [
"MIT"
] | 1 | 2021-12-01T03:28:21.000Z | 2021-12-01T03:28:21.000Z | check_version_increase.py | elbuco1/fen2png | c64263cb5c53eeb33d2d311328256ffe4f1ac1a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
def version_increased(former_version, current_version):
"""Check that version in the package is greater than version_master
and that only one int has increased of 1.
Args:
version_master (str): former version
"""
current_version_int = int("".join(current_version.spl... | 30.912281 | 146 | 0.692963 | #!/usr/bin/env python
import argparse
import os
import re
import json
def version_increased(former_version, current_version):
"""Check that version in the package is greater than version_master
and that only one int has increased of 1.
Args:
version_master (str): former version
"""
curr... | 0 | 0 | 0 | 0 | 0 | 715 | 0 | -40 | 112 |
dcd65afe1b7d373194d0df45e4433ca60003a021 | 324 | py | Python | testing/urls.py | Joshijax/covidapp | cae6f6fde5c936af2615ff79b6d883f31825a7ee | [
"MIT"
] | null | null | null | testing/urls.py | Joshijax/covidapp | cae6f6fde5c936af2615ff79b6d883f31825a7ee | [
"MIT"
] | null | null | null | testing/urls.py | Joshijax/covidapp | cae6f6fde5c936af2615ff79b6d883f31825a7ee | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from django.urls import path # add this
from testing import views
urlpatterns = [
path('', views.index, name='tester'),
path('/take', views.tester, name='tester1'),
# add this
]
| 20.25 | 49 | 0.654321 | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from django.contrib import admin
from django.urls import path, include # add this
from testing import views
urlpatterns = [
path('', views.index, name='tester'),
path('/take', views.tester, name='tester1'),
# add thi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 23 |
313b0c39616ef4195670de4e815f8d591baba29d | 173 | py | Python | c3i/app/views.py | addinall/python-C3I | be72f026fb7c6b5084404876cd1296d3c3cb9b85 | [
"Unlicense"
] | null | null | null | c3i/app/views.py | addinall/python-C3I | be72f026fb7c6b5084404876cd1296d3c3cb9b85 | [
"Unlicense"
] | null | null | null | c3i/app/views.py | addinall/python-C3I | be72f026fb7c6b5084404876cd1296d3c3cb9b85 | [
"Unlicense"
] | null | null | null | # from django.shortcuts import render
| 21.625 | 74 | 0.780347 | # from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello world - You are in the Python version of C3I")
| 0 | 0 | 0 | 0 | 0 | 73 | 0 | 15 | 46 |
58d550b93e451cd67d33f0ac2c26d92b3d42faae | 2,140 | py | Python | networking_generic_switch/tests/unit/test_config.py | ChameleonCloud/networking-generic-switch | 98ddec1f11eab5197f1443207b13a16f364e5f10 | [
"Apache-2.0"
] | null | null | null | networking_generic_switch/tests/unit/test_config.py | ChameleonCloud/networking-generic-switch | 98ddec1f11eab5197f1443207b13a16f364e5f10 | [
"Apache-2.0"
] | 4 | 2018-11-21T17:54:37.000Z | 2021-10-04T14:40:40.000Z | networking_generic_switch/tests/unit/test_config.py | ChameleonCloud/networking-generic-switch | 98ddec1f11eab5197f1443207b13a16f364e5f10 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 34.516129 | 78 | 0.647664 | # Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 0 | 0 | 0 | 1,233 | 0 | 0 | 0 | 24 | 135 |
7fa4fe2358baef5d84f26905903f3f8b4bb6d5f4 | 12,163 | py | Python | venv/lib/python3.8/site-packages/xdis/load.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Decompiler/xdis/load.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 4 | 2020-10-03T20:37:55.000Z | 2020-10-04T23:11:38.000Z | S4/S4 Decompiler/xdis/load.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | # Copyright (c) 2015-2020 by Rocky Bernstein
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is di... | 33.880223 | 107 | 0.553317 | # Copyright (c) 2015-2020 by Rocky Bernstein
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is di... | 0 | 0 | 0 | 0 | 0 | 1,569 | 0 | 53 | 92 |
be4aedc2ea1f5dae400358c5df45de6791875da8 | 452 | py | Python | envergo/evaluations/migrations/0016_request_parcels.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | null | null | null | envergo/evaluations/migrations/0016_request_parcels.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | 6 | 2021-07-12T14:33:18.000Z | 2022-02-14T10:36:09.000Z | envergo/evaluations/migrations/0016_request_parcels.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-26 14:49
| 22.6 | 86 | 0.599558 | # Generated by Django 3.2.6 on 2021-08-26 14:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('geodata', '0001_initial'),
('evaluations', '0015_request'),
]
operations = [
migrations.AddField(
model_name='request',
... | 0 | 0 | 0 | 338 | 0 | 0 | 0 | 19 | 46 |
d1621eaaee2261fef168153ab19e0c022183ce72 | 830 | py | Python | self_attention/word2vec.py | huangqianfei0916/Attention_classification | a60460771cce640737523d0ea3b9ef22f1c1bcb9 | [
"MIT"
] | 2 | 2021-03-21T02:10:10.000Z | 2021-04-09T09:38:43.000Z | self_attention/word2vec.py | huangqianfei0916/Attention_classification | a60460771cce640737523d0ea3b9ef22f1c1bcb9 | [
"MIT"
] | null | null | null | self_attention/word2vec.py | huangqianfei0916/Attention_classification | a60460771cce640737523d0ea3b9ef22f1c1bcb9 | [
"MIT"
] | 3 | 2020-07-29T05:32:16.000Z | 2022-03-26T07:40:42.000Z |
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-word', required=True,help="word file")
parser.add_argument('-iter', default=3)
parser.add_argument('-sg', default=0)
parser.add_argument('-hs', default=1)
parser.add_argument('-window', defaul... | 31.923077 | 105 | 0.691566 |
from gensim.models import word2vec
def tomodel(train_word, iter1, sg, hs, window, size):
sentences = word2vec.LineSentence(train_word)
model = word2vec.Word2Vec(sentences, iter=iter1, sg=sg, hs=hs, min_count=1, window=window, size=size)
model.wv.save_word2vec_format("word2vec.model", binary=False)
impo... | 0 | 0 | 0 | 0 | 0 | 254 | 0 | 13 | 46 |
44b0ca69529138fdd86fa4389670400d93e53eb5 | 4,372 | py | Python | tests/test_grow_tree.py | stephleighton/placentagen | 968685955fce7ca5503a85713113f62c1e5c74a4 | [
"Apache-2.0"
] | 2 | 2019-06-11T21:35:54.000Z | 2022-03-10T01:53:43.000Z | tests/test_grow_tree.py | stephleighton/placentagen | 968685955fce7ca5503a85713113f62c1e5c74a4 | [
"Apache-2.0"
] | 31 | 2018-03-14T01:43:19.000Z | 2020-07-23T21:23:27.000Z | tests/test_grow_tree.py | stephleighton/placentagen | 968685955fce7ca5503a85713113f62c1e5c74a4 | [
"Apache-2.0"
] | 6 | 2018-04-29T23:42:48.000Z | 2021-09-14T01:33:53.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 45.541667 | 113 | 0.522187 | from unittest import TestCase
import numpy as np
import unittest
import placentagen
import os
class Test_create_trees(TestCase):
def test_umilical_node(self):
thickness = (3.0 * 1 / (4.0 * np.pi)) ** (1.0 / 3.0) * 2.0
data_input = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])
datapoints = p... | 0 | 0 | 0 | 4,136 | 0 | 0 | 0 | -10 | 181 |
1b959ecde2bf0e549c10dc649b1fc3831d79b54e | 2,104 | py | Python | main.py | MostafaAbuelnoor/Facial-Recognitoin | 43c02c8479120aa67a05699c3ba806338398e07c | [
"MIT"
] | 1 | 2021-05-26T08:20:14.000Z | 2021-05-26T08:20:14.000Z | main.py | MostafaAbuelnoor/Facial-Recognitoin | 43c02c8479120aa67a05699c3ba806338398e07c | [
"MIT"
] | null | null | null | main.py | MostafaAbuelnoor/Facial-Recognitoin | 43c02c8479120aa67a05699c3ba806338398e07c | [
"MIT"
] | 1 | 2022-03-07T07:22:08.000Z | 2022-03-07T07:22:08.000Z | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' ##This is used to suppress the warnings given by tensorflow
#Comment the above lines if there's an error and the code isn't working as expected
# Add photos to the photos folder in order to analyse them or do facial recognition on them
#############################... | 40.461538 | 147 | 0.687738 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' ##This is used to suppress the warnings given by tensorflow
import tensorflow as tf
#Comment the above lines if there's an error and the code isn't working as expected
from deepface import DeepFace
import pandas as pd
# Add photos to the photos folder in order to ana... | 0 | 0 | 0 | 0 | 0 | 775 | 0 | 8 | 178 |
fba9a66135210ef0d62d9141e920c64ff6e57ae8 | 2,130 | py | Python | aries_cloudagent/messaging/federatedlearningmessage/messages/federatedlearningmessage.py | harshkasyap/PyAriesFL | dd78dcebc771971abfee301b80cdd5d246c14840 | [
"Apache-2.0"
] | 7 | 2020-07-07T15:44:41.000Z | 2022-03-26T21:20:41.000Z | aries_cloudagent/messaging/federatedlearningmessage/messages/federatedlearningmessage.py | totemprotocol/aries-fl | dd78dcebc771971abfee301b80cdd5d246c14840 | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/messaging/federatedlearningmessage/messages/federatedlearningmessage.py | totemprotocol/aries-fl | dd78dcebc771971abfee301b80cdd5d246c14840 | [
"Apache-2.0"
] | 2 | 2020-08-11T10:02:03.000Z | 2021-12-12T12:19:21.000Z | """Basic message."""
HANDLER_CLASS = (
"aries_cloudagent.messaging.federatedlearningmessage."
+ "handlers.basicmessage_handler.FederatedLearningMessageHandler"
)
| 26.962025 | 84 | 0.667606 | """Basic message."""
from datetime import datetime
from typing import Union
from marshmallow import fields
from ...agent_message import AgentMessage, AgentMessageSchema
from ...util import datetime_now, datetime_to_str
from ...valid import INDY_ISO8601_DATETIME
from ..message_types import FEDERATEDLEARNING_MESSAGE
... | 0 | 0 | 0 | 1,612 | 0 | 0 | 0 | 141 | 204 |
fe951ac780dbde2cba39609a3d5e778c7cb3b4f3 | 626 | py | Python | cms/home/migrations/0007_auto_20201125_1247.py | rkhleics/nhs-ei.website | 9968916a5c442a2b33003f8a48b238df53ebded0 | [
"MIT"
] | 1 | 2021-02-04T13:20:31.000Z | 2021-02-04T13:20:31.000Z | cms/home/migrations/0007_auto_20201125_1247.py | rkhleics/nhs-ei.website | 9968916a5c442a2b33003f8a48b238df53ebded0 | [
"MIT"
] | 77 | 2020-11-29T23:10:16.000Z | 2022-03-23T11:47:51.000Z | cms/home/migrations/0007_auto_20201125_1247.py | rkhleics/nhs-ei.website | 9968916a5c442a2b33003f8a48b238df53ebded0 | [
"MIT"
] | 3 | 2021-03-19T09:23:59.000Z | 2021-08-31T21:49:36.000Z | # Generated by Django 3.1.2 on 2020-11-25 12:47
| 25.04 | 64 | 0.618211 | # Generated by Django 3.1.2 on 2020-11-25 12:47
from django.db import migrations, models
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0006_auto_20201125_1244'),
]
operations = [
migrations.AddField(
model_name='homepage',
... | 0 | 0 | 0 | 485 | 0 | 0 | 0 | 24 | 68 |
38e317f3795b434b14359446540d077599e83168 | 1,476 | py | Python | ex_kerasApi.py | DLVIsualizer/dlvis-flask | e1e22028b2d57fb894d105bd716437a3de8e4e7f | [
"MIT"
] | null | null | null | ex_kerasApi.py | DLVIsualizer/dlvis-flask | e1e22028b2d57fb894d105bd716437a3de8e4e7f | [
"MIT"
] | 13 | 2020-01-28T22:20:14.000Z | 2022-03-11T23:20:14.000Z | ex_kerasApi.py | DLVIsualizer/dlvis-flask | e1e22028b2d57fb894d105bd716437a3de8e4e7f | [
"MIT"
] | null | null | null | # import the necessary packages
from keras.applications import MobileNet
import numpy as np
import cv2
import dlv
if __name__ == "__main__":
test = np.random.rand(500,300)
cv2.imshow('img',test)
cv2.waitKey(0)
resnet50Model = MobileNet(weights="imagenet")
dlvModel = dlv.Model(resnet50Model)
dlvModel.addIn... | 22.707692 | 101 | 0.695122 | # import the necessary packages
from keras.applications import ResNet50
from keras.applications import MobileNet
import matplotlib.pyplot as plt
import numpy as np
import cv2
import dlv
if __name__ == "__main__":
test = np.random.rand(500,300)
cv2.imshow('img',test)
cv2.waitKey(0)
resnet50Model = MobileNet(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 44 |
e3d984eaea5180d35af66b9d17a7e46e5fca15cc | 5,642 | py | Python | python/onos/uenib/__init__.py | ray-milkey/onos-api | 1df48546bba93fc475a080fdb29983c2e36da3c4 | [
"Apache-2.0"
] | null | null | null | python/onos/uenib/__init__.py | ray-milkey/onos-api | 1df48546bba93fc475a080fdb29983c2e36da3c4 | [
"Apache-2.0"
] | null | null | null | python/onos/uenib/__init__.py | ray-milkey/onos-api | 1df48546bba93fc475a080fdb29983c2e36da3c4 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/uenib/ran.proto, onos/uenib/uenib.proto
# plugin: python-betterproto
| 25.645455 | 86 | 0.684864 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: onos/uenib/ran.proto, onos/uenib/uenib.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict, List
import betterproto
import grpclib
class EventType(betterproto.Enum):
NONE = 0
ADDED = ... | 0 | 3,365 | 1,254 | 96 | 0 | 0 | 0 | 77 | 687 |
3e9e7b05c50154f1786818941676949cdcb37843 | 10,027 | py | Python | snp_pipeline/scripts/snp_subsample.py | kelly-sovacool/tiger_salamander_project | fa795f4488aab73564d563c268f1c88969bd2abc | [
"MIT"
] | 1 | 2022-01-31T08:01:12.000Z | 2022-01-31T08:01:12.000Z | snp_pipeline/scripts/snp_subsample.py | kelly-sovacool/tiger_salamander_project | fa795f4488aab73564d563c268f1c88969bd2abc | [
"MIT"
] | null | null | null | snp_pipeline/scripts/snp_subsample.py | kelly-sovacool/tiger_salamander_project | fa795f4488aab73564d563c268f1c88969bd2abc | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
"""
Author: Kelly Sovacool
Email: kellysovacool@uky.edu
28 Sep 2017
Usage:
snp_subsample.py <snp-sites-dir> <output-filename-base> [--abundance-filter=<percent-cutoff> --output-filtered-fasta-dir=<filtered_dir> --skip-filter --num_subsamples=<num> --all-snps-all-loci --missing-cutoff=<perc... | 43.406926 | 263 | 0.61863 | #!/usr/local/bin/python3
"""
Author: Kelly Sovacool
Email: kellysovacool@uky.edu
28 Sep 2017
Usage:
snp_subsample.py <snp-sites-dir> <output-filename-base> [--abundance-filter=<percent-cutoff> --output-filtered-fasta-dir=<filtered_dir> --skip-filter --num_subsamples=<num> --all-snps-all-loci --missing-cutoff=<perc... | 0 | 330 | 0 | 3,661 | 0 | 4,185 | 0 | -25 | 250 |
d17a5c18fe9d56b7bb799e31cc9d3d646de88110 | 2,312 | py | Python | tests/test_models.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | tests/test_models.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | tests/test_models.py | rekt-hard/invenio-userprofiles | 69cbe381a35aca98d398a9673af351b672d41b70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Tests for user profile models."""
import pytest
from invenio_accounts.models impo... | 31.671233 | 72 | 0.679498 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Tests for user profile models."""
import pytest
from invenio_accounts.models impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 0 |
881d4e01c75cf326258781678b4a1ae10cc19b02 | 3,236 | py | Python | libraries/logger.py | tede12/DCNFT | 21871b5abec0498ab4402eae0939a4c212025f53 | [
"MIT"
] | 3 | 2021-11-06T13:17:07.000Z | 2022-03-14T00:01:03.000Z | libraries/logger.py | tede12/DCNFT | 21871b5abec0498ab4402eae0939a4c212025f53 | [
"MIT"
] | null | null | null | libraries/logger.py | tede12/DCNFT | 21871b5abec0498ab4402eae0939a4c212025f53 | [
"MIT"
] | null | null | null | import logging
logging.getLogger('filelock').propagate = False
logging.basicConfig(
# filename='logger.log',
level=logging.INFO,
format='%(message)s'
)
logger = Logger(classic=True, logger_name='Default-Logger')
| 29.962963 | 93 | 0.545426 | import datetime
import logging
import time
from colorama import Fore
logging.getLogger('filelock').propagate = False
logging.basicConfig(
# filename='logger.log',
level=logging.INFO,
format='%(message)s'
)
class Logger:
def __init__(
self, logger_name='Unknown',
classic=False... | 0 | 44 | 0 | 2,886 | 0 | 0 | 0 | -12 | 90 |
96fa01033fa1760e78f5335d4f5adf4376fecb7e | 1,557 | py | Python | test/train/test_train_pairwise_similarity_model.py | mski-iksm/redshells | 1e956fed9b000ea3f6ba1c96e25d5dd953025155 | [
"MIT"
] | null | null | null | test/train/test_train_pairwise_similarity_model.py | mski-iksm/redshells | 1e956fed9b000ea3f6ba1c96e25d5dd953025155 | [
"MIT"
] | null | null | null | test/train/test_train_pairwise_similarity_model.py | mski-iksm/redshells | 1e956fed9b000ea3f6ba1c96e25d5dd953025155 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 29.942308 | 91 | 0.654464 | import unittest
from unittest.mock import MagicMock
import luigi
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from redshells.train import TrainPairwiseSimilarityModel
class _DummyTask(luigi.Task):
pass
class TrainPairwiseSimilarityModelTest(unittest.TestCase):
def setUp(self):
... | 0 | 0 | 0 | 1,264 | 0 | 0 | 0 | 68 | 158 |
43eaa90c3a6818bcb51d39cbf7858f129021fbc3 | 641 | py | Python | tests/queued_scheduler_cancel.py | Gelbpunkt/aiosched | 8bb46be71894c022ce4862212c39636c5789a181 | [
"MIT"
] | 18 | 2020-05-16T18:46:14.000Z | 2022-03-19T18:12:16.000Z | tests/queued_scheduler_cancel.py | Gelbpunkt/aiosched | 8bb46be71894c022ce4862212c39636c5789a181 | [
"MIT"
] | 2 | 2020-10-02T14:35:04.000Z | 2021-12-27T20:47:16.000Z | tests/queued_scheduler_cancel.py | Gelbpunkt/aiosched | 8bb46be71894c022ce4862212c39636c5789a181 | [
"MIT"
] | 4 | 2020-05-29T19:12:07.000Z | 2021-04-13T13:12:10.000Z | import asyncio
import sys
sys.path.insert(0, ".")
asyncio.run(main())
| 19.424242 | 49 | 0.659906 | import asyncio
import sys
sys.path.insert(0, ".")
from aioscheduler import QueuedScheduler
async def work(n: int) -> None:
await asyncio.sleep(60)
print(f"I am doing heavy work: {n}")
async def main() -> None:
scheduler = QueuedScheduler()
scheduler.start()
tasks = []
for i in range(50):
... | 0 | 0 | 478 | 0 | 0 | 0 | 0 | 19 | 69 |
969efcfd98765aae0d9f785d6b09b86bc9087f0a | 6,120 | py | Python | Subreddit.py | LeBruitDesBots/airAnnuaire | fc03a8b38a9e5401bf09b9a3456bccdef158b03a | [
"0BSD"
] | null | null | null | Subreddit.py | LeBruitDesBots/airAnnuaire | fc03a8b38a9e5401bf09b9a3456bccdef158b03a | [
"0BSD"
] | null | null | null | Subreddit.py | LeBruitDesBots/airAnnuaire | fc03a8b38a9e5401bf09b9a3456bccdef158b03a | [
"0BSD"
] | 1 | 2020-05-29T09:16:51.000Z | 2020-05-29T09:16:51.000Z | # encoding: utf-8
DAYS_IN_WEEK = 7
DAYS_IN_MONTH = 28
| 31.06599 | 101 | 0.605065 | # encoding: utf-8
from enum import Enum
from datetime import datetime, timedelta
import math
import pprint
from prawcore import exceptions
import langdetect
DAYS_IN_WEEK = 7
DAYS_IN_MONTH = 28
class SubredditStatus(Enum):
UNKNOWN = 0
PUBLIC = 1
RESTRICTED = 2
QUARANTINED = 3
PRIVATE = 4
BANN... | 2 | 0 | 0 | 5,874 | 0 | 0 | 0 | 7 | 179 |
9012b66c9db87f7ba18fc946415ee83d451d1d15 | 7,247 | py | Python | WORC/featureprocessing/Decomposition.py | MStarmans91/WORC | b6b8fc2ccb7d443a69b5ca20b1d6efb65b3f0fc7 | [
"ECL-2.0",
"Apache-2.0"
] | 47 | 2018-01-28T14:08:15.000Z | 2022-03-24T16:10:07.000Z | WORC/featureprocessing/Decomposition.py | JZK00/WORC | 14e8099835eccb35d49b52b97c0be64ecca3809c | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2018-08-28T13:32:57.000Z | 2020-10-26T16:35:59.000Z | WORC/featureprocessing/Decomposition.py | JZK00/WORC | 14e8099835eccb35d49b52b97c0be64ecca3809c | [
"ECL-2.0",
"Apache-2.0"
] | 16 | 2017-11-13T10:53:36.000Z | 2022-03-18T17:02:04.000Z | #!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 38.547872 | 81 | 0.613357 | #!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
703b2e178dfc582d43a9a15235386cc883ec6042 | 1,766 | py | Python | common/actor_critic.py | IanYHWu/msc_2021 | 0ae09ed392cce5fdf0e85d1f96b7af82900835f8 | [
"MIT"
] | null | null | null | common/actor_critic.py | IanYHWu/msc_2021 | 0ae09ed392cce5fdf0e85d1f96b7af82900835f8 | [
"MIT"
] | null | null | null | common/actor_critic.py | IanYHWu/msc_2021 | 0ae09ed392cce5fdf0e85d1f96b7af82900835f8 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 26.358209 | 100 | 0.606455 | import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from common.utils import init
class CategoricalAC(nn.Module):
def __init__(self, base, recurrent, num_actions):
"""
embedder: (torch.Tensor) model to extract the embedding for observation - probably a... | 0 | 0 | 0 | 1,566 | 0 | 0 | 0 | 40 | 135 |
7073f16f06db3de1ab53d454e076544e515ab1d3 | 1,220 | py | Python | XML/XML_to_dict__xmltodict__examples/dict_to_xml__unparse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | XML/XML_to_dict__xmltodict__examples/dict_to_xml__unparse.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | XML/XML_to_dict__xmltodict__examples/dict_to_xml__unparse.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'
# SOURCE: https://github.com/martinblech/xmltodict#roundtripping
# pip install xmltodict
import xmltodict
my_dict = {
'response': {
'status': 'good',
'last_updated': '2014-02-16T23:10:12Z',
}
}
print(xmltodict.unparse(... | 25.416667 | 109 | 0.663115 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://github.com/martinblech/xmltodict#roundtripping
# pip install xmltodict
import xmltodict
my_dict = {
'response': {
'status': 'good',
'last_updated': '2014-02-16T23:10:12Z',
}
}
print(xmltodict.unparse(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
547250e28386f9801f70b2f1c41a9589aa802d7d | 15,648 | py | Python | resources/libraries/python/QemuManager.py | nidhyanandhan/csit | 2156583b4e66f2c3c35903c854b1823b76a4e9a6 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/QemuManager.py | nidhyanandhan/csit | 2156583b4e66f2c3c35903c854b1823b76a4e9a6 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/QemuManager.py | nidhyanandhan/csit | 2156583b4e66f2c3c35903c854b1823b76a4e9a6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 37.080569 | 79 | 0.522814 | # Copyright (c) 2020 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 0 | 0 | 14,692 | 0 | 0 | 0 | 168 | 135 |
ae12c915e418b34a08c739c078807fd4542718ed | 973 | py | Python | utvsapi/main.py | hroncok/utvsapi-eve | 83fcf9e1d14be2740cfec810c97f662a56a1a0ed | [
"MIT"
] | null | null | null | utvsapi/main.py | hroncok/utvsapi-eve | 83fcf9e1d14be2740cfec810c97f662a56a1a0ed | [
"MIT"
] | null | null | null | utvsapi/main.py | hroncok/utvsapi-eve | 83fcf9e1d14be2740cfec810c97f662a56a1a0ed | [
"MIT"
] | null | null | null | from eve import Eve
from eve_sqlalchemy import SQL
from eve_sqlalchemy.validation import ValidatorSQL
from sqlalchemy.engine.url import URL
try:
from eve_docs import eve_docs
from flask.ext.bootstrap import Bootstrap
except ImportError:
Bootstrap = None
from utvsapi.tables import domain, Base, on_fetched_... | 24.948718 | 79 | 0.758479 | from eve import Eve
from eve_sqlalchemy import SQL
from eve_sqlalchemy.validation import ValidatorSQL
from sqlalchemy.engine.url import URL
try:
from eve_docs import eve_docs
from flask.ext.bootstrap import Bootstrap
except ImportError:
Bootstrap = None
from utvsapi.tables import domain, Base, on_fetched_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bcbe3aaf1f6e1214c4258ecc1fbd37b90e14f66f | 600 | py | Python | class1/create_yaml_json.py | hyoung-dpl/pynet | 3171268fd44bffef4a42e5381f11f2aae7b338d6 | [
"Apache-2.0"
] | null | null | null | class1/create_yaml_json.py | hyoung-dpl/pynet | 3171268fd44bffef4a42e5381f11f2aae7b338d6 | [
"Apache-2.0"
] | null | null | null | class1/create_yaml_json.py | hyoung-dpl/pynet | 3171268fd44bffef4a42e5381f11f2aae7b338d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
Write to a yaml and json file for a list and dictionary variable
'''
if __name__ == "__main__":
main()
| 17.647059 | 66 | 0.64 | #!/usr/bin/env python
'''
Write to a yaml and json file for a list and dictionary variable
'''
import yaml
import json
def main():
yaml_file = 'yaml_write.yml'
json_file = 'json_write.json'
yaml_json_dictionary = {
'code_version': '11.5',
'vlan': '404',
}
yaml_json_list = [
'Locatio... | 0 | 0 | 0 | 0 | 0 | 418 | 0 | -20 | 68 |
639bf8a31fde3adf852d62aede94eb4377ccd087 | 1,211 | py | Python | src/train_emb.py | RowitZou/topic_dialog_summ | 0de31d97b07be4004e08f9755ee66bea47aa7b10 | [
"MIT"
] | 42 | 2020-12-16T07:53:44.000Z | 2022-03-31T06:48:18.000Z | src/train_emb.py | RowitZou/topic_dialog_summ | 0de31d97b07be4004e08f9755ee66bea47aa7b10 | [
"MIT"
] | 25 | 2021-03-26T02:07:36.000Z | 2022-03-29T09:55:55.000Z | src/train_emb.py | RowitZou/topic_dialog_summ | 0de31d97b07be4004e08f9755ee66bea47aa7b10 | [
"MIT"
] | 7 | 2020-12-23T20:07:22.000Z | 2022-03-07T12:47:37.000Z | import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-mode", default='word2vec', type=str, choices=['glove', 'word2vec'])
parser.add_argument("-data_path", default="", type=str)
parser.add_argument("-emb_size", default=100, type=int)
parser.add_argume... | 28.833333 | 93 | 0.659785 | import argparse
import os
import json
import glob
from os.path import join as pjoin
from others.vocab_wrapper import VocabWrapper
def train_emb(args):
data_dir = os.path.abspath(args.data_path)
print("Preparing to process %s ..." % data_dir)
raw_files = glob.glob(pjoin(data_dir, '*.json'))
ex_num = 0... | 0 | 0 | 0 | 0 | 0 | 663 | 0 | 4 | 133 |
f8f0611c9323dcea116a76a266b78b5412d312ca | 1,376 | py | Python | vectorbt/returns/__init__.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | 1 | 2021-01-15T00:02:11.000Z | 2021-01-15T00:02:11.000Z | vectorbt/returns/__init__.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | null | null | null | vectorbt/returns/__init__.py | RileyMShea/vectorbt | 92ce571ce9fd0667f2994a2c922fb4cfcde10c88 | [
"Apache-2.0"
] | null | null | null | """Modules for working with returns.
Offers common financial risk and performance metrics as found in [empyrical](https://github.com/quantopian/empyrical),
but Numba-compiled and optimized for 2-dim arrays.
## Accessors
You can access methods listed in `vectorbt.returns.accessors` as follows:
* `vectorbt.returns.ac... | 29.276596 | 118 | 0.742733 | """Modules for working with returns.
Offers common financial risk and performance metrics as found in [empyrical](https://github.com/quantopian/empyrical),
but Numba-compiled and optimized for 2-dim arrays.
## Accessors
You can access methods listed in `vectorbt.returns.accessors` as follows:
* `vectorbt.returns.ac... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac967be092eb4b64ff1b298ff06388e5136ace2c | 2,819 | py | Python | Fundamentos/Strings.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | Fundamentos/Strings.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | 4 | 2021-04-08T21:54:09.000Z | 2022-02-10T14:35:13.000Z | Fundamentos/Strings.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | #%% [markdown]
## Strings (parte 1)
dir(str)
nome = 'Victor Mello'
nome
#Acessando um caracter de uma string
nome[0]
# nome[0] = 'P' #Erro! Strings so imutveis
"""OBS: quando se tem uma string cujo contedo j possui
aspas simples, para evitar erro de sintaxe, tem-se 2 opes:
1) Delimitar a string com aspas duplas e... | 21.356061 | 99 | 0.719759 | #%% [markdown]
## Strings (parte 1)
dir(str)
nome = 'Victor Mello'
nome
#Acessando um caracter de uma string
nome[0]
# nome[0] = 'P' #Erro! Strings são imutáveis
"""OBS: quando se tem uma string cujo conteúdo já possui
aspas simples, para evitar erro de sintaxe, tem-se 2 opções:
1) Delimitar a string com aspas du... | 78 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
02a06d266080beb3092c464049b0b79657ebae9b | 6,665 | py | Python | tests/test_kinematics.py | tp5uiuc/kinematic_snake | 70a59a431d185a5fbe304b18db17eb3819ddbee1 | [
"MIT"
] | 2 | 2022-01-01T21:12:53.000Z | 2022-01-02T16:23:09.000Z | tests/test_kinematics.py | tp5uiuc/kinematic_snake | 70a59a431d185a5fbe304b18db17eb3819ddbee1 | [
"MIT"
] | null | null | null | tests/test_kinematics.py | tp5uiuc/kinematic_snake | 70a59a431d185a5fbe304b18db17eb3819ddbee1 | [
"MIT"
] | null | null | null |
# TODO Add more tests
| 32.832512 | 87 | 0.628807 | import numpy as np
from numpy.testing import assert_allclose
from scipy.integrate import trapz
import pytest
from kinematic_snake.kinematic_snake import zero_mean_integral, project, KinematicSnake
class TestZeroMeanIntegral:
@pytest.fixture(scope="class", params=[101, np.random.randint(100, 200)])
def load_s... | 0 | 2,401 | 0 | 3,488 | 0 | 380 | 0 | 87 | 282 |
f0bd97a83ef68c7c33ba4c4c35408149131700ab | 1,172 | py | Python | open-ai-gym-lab/1. gym/ex01/gym1.py | hojeong3709/RL | a1c6eab8c3e7f2487e527fe68658d13eea5334af | [
"MIT"
] | null | null | null | open-ai-gym-lab/1. gym/ex01/gym1.py | hojeong3709/RL | a1c6eab8c3e7f2487e527fe68658d13eea5334af | [
"MIT"
] | null | null | null | open-ai-gym-lab/1. gym/ex01/gym1.py | hojeong3709/RL | a1c6eab8c3e7f2487e527fe68658d13eea5334af | [
"MIT"
] | null | null | null | import gym
import numpy as np
print(gym.__file__)
print(dir(gym))
env = gym.make('FrozenLake-v0')
q_table = np.zeros([env.observation_space.n, env.action_space.n])
print(env.render())
if __name__ == "__main__":
lr = 0.8
discount_factor = 0.95
num_episodes = 2000
reward_list = []
for i in rang... | 29.3 | 113 | 0.562287 | import gym
import numpy as np
print(gym.__file__)
print(dir(gym))
env = gym.make('FrozenLake-v0')
q_table = np.zeros([env.observation_space.n, env.action_space.n])
print(env.render())
if __name__ == "__main__":
lr = 0.8
discount_factor = 0.95
num_episodes = 2000
reward_list = []
for i in rang... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a8a0a0e92b9c19993841104fa8221ea7e366c1f | 46,575 | py | Python | peripheral/tcc_u2213/config/tcc.py | Techdisc/Microchip | ea8391c689c4badbe2f9ac5181e21bbd5d9d1e54 | [
"0BSD"
] | null | null | null | peripheral/tcc_u2213/config/tcc.py | Techdisc/Microchip | ea8391c689c4badbe2f9ac5181e21bbd5d9d1e54 | [
"0BSD"
] | null | null | null | peripheral/tcc_u2213/config/tcc.py | Techdisc/Microchip | ea8391c689c4badbe2f9ac5181e21bbd5d9d1e54 | [
"0BSD"
] | null | null | null | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 50.735294 | 212 | 0.704369 | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 0 | 0 | 0 | 0 | 0 | 43,253 | 0 | 0 | 481 |
7c16237489a32a6947682f9416ee999e331bf508 | 1,151 | py | Python | Task2F.py | amyponter/amy_reve | 89c6464d56a96d3430a2b3106fc386a86a8b4512 | [
"MIT"
] | null | null | null | Task2F.py | amyponter/amy_reve | 89c6464d56a96d3430a2b3106fc386a86a8b4512 | [
"MIT"
] | null | null | null | Task2F.py | amyponter/amy_reve | 89c6464d56a96d3430a2b3106fc386a86a8b4512 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
print("*** Task 2F: CUED Part IA Flood Warning System ***")
run() | 29.512821 | 93 | 0.691573 | import datetime
from floodsystem.analysis import polyfit
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.plot import plot_water_level_with_fit
from floodsystem.utils import sorted_by_key
def highest_levels(stations):
... | 0 | 0 | 0 | 0 | 0 | 715 | 0 | 157 | 178 |
97ddfff6de8858ea4f079e934f202617622729a8 | 26,309 | py | Python | putil/plot/series.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 6 | 2015-12-15T04:09:08.000Z | 2020-02-21T01:40:57.000Z | putil/plot/series.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | null | null | null | putil/plot/series.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 2 | 2016-01-21T23:29:17.000Z | 2020-02-21T01:41:05.000Z | # series.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,E0102,E0611,W0105
# PyPI imports
# Putil imports
import putil.misc
###
# Exception tracing initialization code
###
"""
[[[cog
import os, sys
if sys.hexversion < 0x03000000:
import __builtin__
else:... | 36.138736 | 79 | 0.594511 | # series.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0302,E0102,E0611,W0105
# PyPI imports
import numpy
import matplotlib.path
import matplotlib.pyplot as plt
from scipy.stats import linregress
from scipy.interpolate import InterpolatedUnivariateSpline
# Putil ... | 0 | 4,699 | 0 | 20,791 | 0 | 0 | 0 | 97 | 198 |
ba5b2d2a2874a4511323fe0650c36a0e9d8df146 | 313 | py | Python | handlers/FaviconHandler.py | Boss-XP/server_tornado | d25781f8c426ae6ec2af4ecdcfd87c6ba5eaa55f | [
"Apache-2.0"
] | null | null | null | handlers/FaviconHandler.py | Boss-XP/server_tornado | d25781f8c426ae6ec2af4ecdcfd87c6ba5eaa55f | [
"Apache-2.0"
] | null | null | null | handlers/FaviconHandler.py | Boss-XP/server_tornado | d25781f8c426ae6ec2af4ecdcfd87c6ba5eaa55f | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
| 26.083333 | 79 | 0.648562 | # coding: utf-8
from handlers.BaseHandler import RequestBaseHandler
import os
class GetFavicon(RequestBaseHandler):
"""发布数据接口"""
def get(self, *args, **kwargs):
print('---fav')
pic = open(os.path.join(os.path.dirname(__file__), "favicon.png"), 'r')
return self.write(pic.read()) | 18 | 0 | 0 | 205 | 0 | 0 | 0 | 18 | 68 |
accc11b35ac61e2ea056f246d67b34b4dcbe62b1 | 1,194 | py | Python | datasets/Macaws/split.py | yuhongherald/pytorch-CycleGAN-and-pix2pix | 48cb3aa46fde39684db9c24586fcec6781138e2a | [
"BSD-3-Clause"
] | null | null | null | datasets/Macaws/split.py | yuhongherald/pytorch-CycleGAN-and-pix2pix | 48cb3aa46fde39684db9c24586fcec6781138e2a | [
"BSD-3-Clause"
] | null | null | null | datasets/Macaws/split.py | yuhongherald/pytorch-CycleGAN-and-pix2pix | 48cb3aa46fde39684db9c24586fcec6781138e2a | [
"BSD-3-Clause"
] | 1 | 2019-09-28T02:29:58.000Z | 2019-09-28T02:29:58.000Z | import os
import random
import tqdm
import shutil
train_p = 0.9
#val_p = 0.05
test_p = 0.05
root_dir = "contoured-cut-outlines"
all_dir = "all"
train_dir = "train"
val_dir = "val"
test_dir = "test"
if __name__ == "__main__":
data = os.listdir(os.path.join(root_dir, all_dir))
random.shuffle(data)
total_co... | 34.114286 | 109 | 0.688442 | import os
import random
import tqdm
import shutil
train_p = 0.9
#val_p = 0.05
test_p = 0.05
root_dir = "contoured-cut-outlines"
all_dir = "all"
train_dir = "train"
val_dir = "val"
test_dir = "test"
if __name__ == "__main__":
data = os.listdir(os.path.join(root_dir, all_dir))
random.shuffle(data)
total_co... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c5fe05941b7380a3079443f25ac97babdcda178 | 1,169 | py | Python | follow/urls.py | CMPUT404W22AMNRY/CMPUT404-project-socialdistribution | 61d5c8aa2c7f038c137fc86c8b194d92a33d90e3 | [
"W3C-20150513"
] | 1 | 2022-01-14T04:37:54.000Z | 2022-01-14T04:37:54.000Z | follow/urls.py | CMPUT404W22AMNRY/CMPUT404-project-socialdistribution | 61d5c8aa2c7f038c137fc86c8b194d92a33d90e3 | [
"W3C-20150513"
] | 88 | 2022-02-19T00:16:44.000Z | 2022-03-29T03:05:08.000Z | follow/urls.py | CMPUT404W22AMNRY/CMPUT404-project-socialdistribution | 61d5c8aa2c7f038c137fc86c8b194d92a33d90e3 | [
"W3C-20150513"
] | null | null | null | from django.urls import path
from .views import (FriendRequestsView, MyFriendsView, create_follow_request, accept_follow_request, unfollow_request, reject_follow_request, accept_remote_follow_request, reject_remote_follow_request, UsersView)
app_name = 'follow'
urlpatterns = [
path('users/<slug:to_username>/reques... | 44.961538 | 112 | 0.755346 | from django.urls import path
from .views import (
FriendRequestsView,
MyFriendsView,
create_follow_request,
accept_follow_request,
unfollow_request,
reject_follow_request,
accept_remote_follow_request,
reject_remote_follow_request,
UsersView
)
app_name = 'follow'
urlpatterns = [
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 38 | 0 |
1352cd1956b4e01e14016003fe3ea6ede6c23e4f | 352 | py | Python | challenges/array_shift/array_shift.py | dambergn-codefellows/py401_data-structures-and-algorithms | 64ca78a70c9de8bee37459481eb8ce0d359b1bb8 | [
"MIT"
] | null | null | null | challenges/array_shift/array_shift.py | dambergn-codefellows/py401_data-structures-and-algorithms | 64ca78a70c9de8bee37459481eb8ce0d359b1bb8 | [
"MIT"
] | null | null | null | challenges/array_shift/array_shift.py | dambergn-codefellows/py401_data-structures-and-algorithms | 64ca78a70c9de8bee37459481eb8ce0d359b1bb8 | [
"MIT"
] | null | null | null | def insertShiftArray(array, value):
'''
inserts a value in middle of array.
'''
if len(array)%2 !=0:
oddOrEven = 1
else:
oddOrEven = 0
half = len(array)//2 + oddOrEven
# print(array[:half] + [value] + array[half:])
return array[:half] + [value] + array[half:]
#insertShiftArray([1,2,4,5], 3)
#... | 22 | 48 | 0.610795 | def insertShiftArray(array, value):
'''
inserts a value in middle of array.
'''
if len(array)%2 !=0:
oddOrEven = 1
else:
oddOrEven = 0
half = len(array)//2 + oddOrEven
# print(array[:half] + [value] + array[half:])
return array[:half] + [value] + array[half:]
#insertShiftArray([1,2,4,5], 3)
#... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a317b2012cc9cb51be908bfe20411a2c9002cee9 | 1,333 | py | Python | src/others/download_pdb.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/others/download_pdb.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/others/download_pdb.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file_name : download_pdb.py
# time : 3/22/2019 13:54
# author : ruiyang
# email : ww_sry@163.com
# ------------------------------
import sys
import pandas as pd
import os
def download_pdb(name_list,outpath):
"""
:function: download pdb archive by pd... | 28.978261 | 90 | 0.622656 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file_name : download_pdb.py
# time : 3/22/2019 13:54
# author : ruiyang
# email : ww_sry@163.com
# ------------------------------
import sys
import pandas as pd
import os
def download_pdb(name_list,outpath):
"""
:function: download pdb archive by pd... | 48 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
837cb049c36189f05e97e865bab8ef0f9cee3048 | 350 | py | Python | examples/configs/generic_st7735/landscape_128x128.py | russhughes/lv_st7789 | aa5134383250abd7d26285c01cb344374449e5b8 | [
"MIT"
] | 8 | 2021-08-28T01:41:38.000Z | 2022-01-30T15:49:33.000Z | examples/configs/generic_st7735/landscape_128x128.py | russhughes/lv_st7789 | aa5134383250abd7d26285c01cb344374449e5b8 | [
"MIT"
] | 9 | 2021-08-29T03:01:28.000Z | 2022-01-28T11:57:45.000Z | examples/configs/generic_st7735/landscape_128x128.py | russhughes/lv_st7789 | aa5134383250abd7d26285c01cb344374449e5b8 | [
"MIT"
] | 1 | 2022-01-28T11:58:10.000Z | 2022-01-28T11:58:10.000Z | '''
Generic st7735 128x128 LCD module on esp32
'''
from ili9XXX import ili9341, MADCTL_MY, MADCTL_MV
disp = ili9341(
mhz=3,
mosi=18,
clk=19,
cs=13,
dc=12,
rst=4,
power=-1,
backlight=15,
backlight_on=1,
width=128,
height=128,
start_x=2,
start_y=1,
invert=False,
... | 15.217391 | 49 | 0.602857 | '''
Generic st7735 128x128 LCD module on esp32
'''
from ili9XXX import ili9341, MADCTL_MY, MADCTL_MV
disp = ili9341(
mhz=3,
mosi=18,
clk=19,
cs=13,
dc=12,
rst=4,
power=-1,
backlight=15,
backlight_on=1,
width=128,
height=128,
start_x=2,
start_y=1,
invert=False,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f7a31e4bb99aff01ed2a23f058553ba02d108c73 | 945 | py | Python | mne/viz/backends/tests/_utils.py | kalenkovich/mne-python | d5752051b37f74713233929382bcc632d404f837 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/backends/tests/_utils.py | kalenkovich/mne-python | d5752051b37f74713233929382bcc632d404f837 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/backends/tests/_utils.py | kalenkovich/mne-python | d5752051b37f74713233929382bcc632d404f837 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import pytest
import warnings
def has_vtki():
"""Check that... | 27 | 71 | 0.609524 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
#
# License: Simplified BSD
import pytest
import warnings
def has_vtki():
"""Check that... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 91 |
faf6328d3f2235855bce224b41bfd52ccae030e4 | 595 | py | Python | setup.py | bonnland/geocat-comp | cb6e0f6a50ff9542d2f003dd0e9ffa1434d4a561 | [
"Apache-2.0"
] | null | null | null | setup.py | bonnland/geocat-comp | cb6e0f6a50ff9542d2f003dd0e9ffa1434d4a561 | [
"Apache-2.0"
] | null | null | null | setup.py | bonnland/geocat-comp | cb6e0f6a50ff9542d2f003dd0e9ffa1434d4a561 | [
"Apache-2.0"
] | null | null | null | try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
#import distutils.sysconfig
with open("src/geocat/comp/version.py") as f:
exec(f.read())
setup(name="geocat.comp",
package_dir={
'': 'src',
'geocat': 'src/... | 25.869565 | 61 | 0.640336 | try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
#import distutils.sysconfig
with open("src/geocat/comp/version.py") as f:
exec(f.read())
setup(name="geocat.comp",
package_dir={
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 26 |
cb7d2a1e81d6afc89d1b23a6bfa078facb0d862d | 1,469 | py | Python | src/GDNN3_tf.py | gmaggiotti/genetic_deep_learning | 3bade857fa7a1564d2c6ef9519bcd37cfcd2d1a4 | [
"MIT"
] | 13 | 2019-01-01T20:30:56.000Z | 2020-02-13T19:49:21.000Z | src/GDNN3_tf.py | gmaggiotti/genetic_deep_learning | 3bade857fa7a1564d2c6ef9519bcd37cfcd2d1a4 | [
"MIT"
] | 2 | 2019-01-05T15:33:26.000Z | 2019-01-05T15:38:16.000Z | src/GDNN3_tf.py | gmaggiotti/genetic_deep_learning | 3bade857fa7a1564d2c6ef9519bcd37cfcd2d1a4 | [
"MIT"
] | 9 | 2019-01-06T14:37:15.000Z | 2020-12-16T15:34:30.000Z | import numpy as np
from NN3_tf import NN3_tf
from sklearn.model_selection import train_test_split
from nn_utils import crossover, Type, sort_by_fittest, read_dataset
X, Y = read_dataset(180, 500)
train_x, test_x, train_y, test_y = train_test_split(
X, Y, test_size=0.3, random_state=1)
X, Y = read_dataset(180, 5... | 34.162791 | 88 | 0.698434 | import numpy as np
from NN3_tf import NN3_tf
from sklearn.model_selection import train_test_split
from nn_utils import crossover, Type, sort_by_fittest, read_dataset
X, Y = read_dataset(180, 500)
train_x, test_x, train_y, test_y = train_test_split(
X, Y, test_size=0.3, random_state=1)
X, Y = read_dataset(180, 5... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dba5aab41fe191654d0d37097ad32f42312cd355 | 701 | py | Python | smlb/core/features.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 6 | 2020-07-27T21:08:55.000Z | 2021-05-04T07:00:29.000Z | smlb/core/features.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 18 | 2020-09-01T00:47:04.000Z | 2021-09-15T22:16:56.000Z | smlb/core/features.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 2 | 2020-08-24T21:50:16.000Z | 2020-12-06T05:18:57.000Z | """Features
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
2020, Matthias Rupp, Citrine Informatics.
Features transform datasets.
"""
| 21.90625 | 93 | 0.777461 | """Features
Scientific Machine Learning Benchmark:
A benchmark of regression models in chem- and materials informatics.
2020, Matthias Rupp, Citrine Informatics.
Features transform datasets.
"""
from smlb import DataValuedTransformation, IdentityTransformation, DataPipelineTransformation
class Features(DataValue... | 0 | 0 | 0 | 335 | 0 | 0 | 0 | 72 | 92 |
eb656459d5c06345b5b9787e8be6a55e5c9cc130 | 615 | py | Python | _1327/information_pages/urls.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | _1327/information_pages/urls.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | _1327/information_pages/urls.py | Nef10/1327 | 71fb83a3c12ba24a7638acebeeffed80825e0101 | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('_1327.information_pages.views',
url(r"create$", 'create', name='create'),
url(r"(?P<title>[\w-]+)/edit$", 'edit', name='edit'),
url(r"(?P<title>[\w-]+)/autosave$", 'autosave', name='autosave'),
... | 41 | 75 | 0.650407 | from django.conf.urls import patterns, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('_1327.information_pages.views',
url(r"create$", 'create', name='create'),
url(r"(?P<title>[\w-]+)/edit$", 'edit', name='edit'),
url(r"(?P<title>[\w-]+)/autosave$", 'autosave', name='autosave'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
48d60e2dc37de4248f1cec08b57bcbb18f01dd84 | 1,844 | py | Python | environmennt.py | cyroilt/game | 49dba23c8e361f8d870cb3260f3421ca9f9e16de | [
"BSD-3-Clause"
] | null | null | null | environmennt.py | cyroilt/game | 49dba23c8e361f8d870cb3260f3421ca9f9e16de | [
"BSD-3-Clause"
] | null | null | null | environmennt.py | cyroilt/game | 49dba23c8e361f8d870cb3260f3421ca9f9e16de | [
"BSD-3-Clause"
] | null | null | null | forests=[]
forestload=[]
forestmaxload=[]
stones1=[]
stoneload=[]
stonemaxload=[]
frpl=[]
frpl1=[]
| 24.918919 | 73 | 0.703905 | import random
forests=[]
forestload=[]
forestmaxload=[]
stones1=[]
stoneload=[]
stonemaxload=[]
frpl=[]
frpl1=[]
class forest():
def genforest(n,maxgen):
global forests,forestload,forestmaxload
for i in range(n):
forests.append([random.randint(0,maxgen),random.randint(0,maxgen)])
forestload.append... | 0 | 0 | 0 | 1,599 | 0 | 66 | 0 | -8 | 88 |
addfbd51a9bfbe32f25a15f5a5b371e22f592d52 | 8,144 | py | Python | yz/rl_agent_sil.py | yizhouzhao/moca | 2a4c3cb140f59aef94f9cdfce1169089b3aabddf | [
"MIT"
] | null | null | null | yz/rl_agent_sil.py | yizhouzhao/moca | 2a4c3cb140f59aef94f9cdfce1169089b3aabddf | [
"MIT"
] | null | null | null | yz/rl_agent_sil.py | yizhouzhao/moca | 2a4c3cb140f59aef94f9cdfce1169089b3aabddf | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.optim as optim
| 32.189723 | 116 | 0.603635 | from yz.nav_tools import FrameInfo
from yz.params import *
from yz.rl_policy import PolicyNetwork, ValueNetwork
from yz.utils import soft_update_from_to
from ai2thor.controller import Controller
from collections import deque
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as opt... | 0 | 0 | 0 | 7,798 | 0 | 0 | 0 | 73 | 223 |
56741da3d94b0e05476cdd784d626e95cb58ad9b | 1,185 | py | Python | ucb_cs61A/lab/lab09/tests/accumulate.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | null | null | null | ucb_cs61A/lab/lab09/tests/accumulate.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2017-07-31T08:15:26.000Z | 2017-07-31T08:15:26.000Z | ucb_cs61A/lab/lab09/tests/accumulate.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2019-10-06T16:52:31.000Z | 2019-10-06T16:52:31.000Z | test = {
'name': 'accumulate',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
scm> (accumulate + 0 4 square)
30
""",
'hidden': False,
'locked': False
}
],
'scored': False,
'setup': r"""
scm> (load '... | 18.809524 | 42 | 0.347679 | test = {
'name': 'accumulate',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
scm> (accumulate + 0 4 square)
30
""",
'hidden': False,
'locked': False
}
],
'scored': False,
'setup': r"""
scm> (load '... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c20c0b53ab477291ef3dcfbc603ab811174b4302 | 3,328 | py | Python | coderunner/interact.py | zhao-embassy/learn_language | 2719f27dea1877ba1da32f1c1d53ebedd5a81fdf | [
"FSFAP"
] | 48 | 2015-02-05T15:25:47.000Z | 2022-01-07T05:52:03.000Z | coderunner/interact.py | zhao-embassy/learn_language | 2719f27dea1877ba1da32f1c1d53ebedd5a81fdf | [
"FSFAP"
] | null | null | null | coderunner/interact.py | zhao-embassy/learn_language | 2719f27dea1877ba1da32f1c1d53ebedd5a81fdf | [
"FSFAP"
] | 21 | 2015-02-12T23:50:10.000Z | 2019-12-12T08:25:35.000Z | r"""
communicate with interactive subprocess, such as GHCi, and get its output
>>> s = interact('ghci', ':t 1\n' + EOT)
>>> get_ghci_body(s)
'Prelude> :t 1\n1 :: (Num t) => t'
>>> s = interact('swipl', 'X = 1 - 1.\n' + EOT)
>>> get_swipl_body(s)
'?- X = 1 - 1.\nX = 1-1.'
>>> s = interact('python', 'import this\n' + ... | 24.651852 | 73 | 0.555589 | r"""
communicate with interactive subprocess, such as GHCi, and get its output
>>> s = interact('ghci', ':t 1\n' + EOT)
>>> get_ghci_body(s)
'Prelude> :t 1\n1 :: (Num t) => t'
>>> s = interact('swipl', 'X = 1 - 1.\n' + EOT)
>>> get_swipl_body(s)
'?- X = 1 - 1.\nX = 1-1.'
>>> s = interact('python', 'import this\n' + ... | 0 | 0 | 0 | 0 | 0 | 1,158 | 0 | -12 | 183 |
4c27a7ebbbdaa0bf7cc6bd83f0a8e845805c3b62 | 7,168 | py | Python | docx2python/iterators.py | FabianGroeger96/docx2python | 7a43fc4ef15033881203713224e894ae33ef79d7 | [
"MIT"
] | null | null | null | docx2python/iterators.py | FabianGroeger96/docx2python | 7a43fc4ef15033881203713224e894ae33ef79d7 | [
"MIT"
] | null | null | null | docx2python/iterators.py | FabianGroeger96/docx2python | 7a43fc4ef15033881203713224e894ae33ef79d7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Iterate over extracted docx content.
:author: Shay Hill
:created: 6/28/2019
This package extracts docx text as::
[ # tables
[ # table
[ # row
[ # cell
"" # paragraph
]
]
... | 28.787149 | 87 | 0.539063 | #!/usr/bin/env python3
# _*_ coding: utf-8 _*_
"""Iterate over extracted docx content.
:author: Shay Hill
:created: 6/28/2019
This package extracts docx text as::
[ # tables
[ # table
[ # row
[ # cell
"" # paragraph
]
]
... | 0 | 0 | 0 | 0 | 3,020 | 0 | 0 | 10 | 23 |
e48df518cad508f16a41114500431b930ec91a46 | 2,062 | py | Python | tests/test_cli_gui/test_fetch.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | tests/test_cli_gui/test_fetch.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | tests/test_cli_gui/test_fetch.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 33.258065 | 86 | 0.64452 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 0 | 979 | 0 | 0 | 0 | 0 | 0 | 75 | 136 |
77cd887735c4c63ff879ffa44e3e4c4e0b7004b1 | 487 | py | Python | scripts/encode.py | univoid/a3x | 46f48363f191344747fec5e643efe1b467fb04c3 | [
"MIT"
] | null | null | null | scripts/encode.py | univoid/a3x | 46f48363f191344747fec5e643efe1b467fb04c3 | [
"MIT"
] | null | null | null | scripts/encode.py | univoid/a3x | 46f48363f191344747fec5e643efe1b467fb04c3 | [
"MIT"
] | null | null | null | import base64
if __name__ == "__main__":
print convert("in.jpeg")
| 22.136364 | 46 | 0.64271 | import base64
def decode_base64(data):
missing_padding = len(data) % 4
if missing_padding != 0:
data += b'='* (4 - missing_padding)
return base64.decodestring(data)
def convert(image):
f = open(image)
data = f.read()
f.close()
base64_encode_str = base64.b64encode(data)
t = ope... | 0 | 0 | 0 | 0 | 0 | 370 | 0 | 0 | 46 |
a5e6293df4e370dbbceb0976cbcb58cc075c164c | 2,568 | py | Python | scripts/tests/tests1.py | ronan-keane/hav-sim | 0aaf9674e987822ff2dc90c74613d5e68e8ef0ce | [
"Apache-2.0"
] | null | null | null | scripts/tests/tests1.py | ronan-keane/hav-sim | 0aaf9674e987822ff2dc90c74613d5e68e8ef0ce | [
"Apache-2.0"
] | null | null | null | scripts/tests/tests1.py | ronan-keane/hav-sim | 0aaf9674e987822ff2dc90c74613d5e68e8ef0ce | [
"Apache-2.0"
] | 2 | 2020-09-30T22:44:37.000Z | 2021-05-09T07:36:28.000Z |
"""
@author: rlk268@cornell.edu
test helper functions
"""
path_reconngsim = 'C:/Users/rlk268/OneDrive - Cornell University/important misc/pickle files/meng/reconngsim.pkl'
# reconstructed ngsim data
with open(path_reconngsim, 'rb') as f:
data = pickle.load(f)[0]
meas, platooninfo, = makeplatoonlist(data,1,Fal... | 40.125 | 116 | 0.580997 |
"""
@author: rlk268@cornell.edu
test helper functions
"""
from havsim.calibration.helper import makeleadfolinfo, boundaryspeeds, interpolate
path_reconngsim = 'C:/Users/rlk268/OneDrive - Cornell University/important misc/pickle files/meng/reconngsim.pkl'
# reconstructed ngsim data
with open(path_reconngsim, 'rb'... | 0 | 0 | 0 | 0 | 0 | 1,839 | 0 | 61 | 92 |
ce9d97cd2c8d61694d46d2f7ee2e3ee27fbb4bf9 | 1,185 | py | Python | demo/fibonacci.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | demo/fibonacci.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | demo/fibonacci.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | """
Thunk (a.k.a. lazy objects) in PyPy.
To run on top of the thunk object space with the following command-line:
py.py -o thunk fibonacci.py
This is a typical Functional Programming Languages demo, computing the
Fibonacci sequence by using an infinite lazy linked list.
"""
try:
from __pypy__ import thunk ... | 26.931818 | 72 | 0.678481 | """
Thunk (a.k.a. lazy objects) in PyPy.
To run on top of the thunk object space with the following command-line:
py.py -o thunk fibonacci.py
This is a typical Functional Programming Languages demo, computing the
Fibonacci sequence by using an infinite lazy linked list.
"""
try:
from __pypy__ import thunk ... | 0 | 0 | 0 | 156 | 0 | 0 | 0 | 0 | 23 |
aacfde57a3d4e97b3f22201cd2b8b1e04de71e89 | 34,754 | py | Python | websocket_server/wsfile.py | CylonicRaider/websocket-server | 8288edf7f145b6359378c1bf745e92b9aa963791 | [
"MIT"
] | 1 | 2019-06-08T21:25:51.000Z | 2019-06-08T21:25:51.000Z | websocket_server/wsfile.py | CylonicRaider/websocket-server | 8288edf7f145b6359378c1bf745e92b9aa963791 | [
"MIT"
] | null | null | null | websocket_server/wsfile.py | CylonicRaider/websocket-server | 8288edf7f145b6359378c1bf745e92b9aa963791 | [
"MIT"
] | 1 | 2017-03-16T00:40:56.000Z | 2017-03-16T00:40:56.000Z | # websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
WebSocket protocol implementation.
client_handshake() and server_handshake() perform the appropriate operations
on mappings of HTTP headers; the WebSocketFile class implements the framing
protocol.
"""
... | 40.935218 | 78 | 0.567388 | # websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
WebSocket protocol implementation.
client_handshake() and server_handshake() perform the appropriate operations
on mappings of HTTP headers; the WebSocketFile class implements the framing
protocol.
"""
... | 0 | 863 | 0 | 25,449 | 0 | 45 | 0 | 45 | 204 |
e32632230e8d861c619ce796ee13f65c84506eb5 | 1,908 | py | Python | __main__.py | vprzybylo/ai2es | cd54222ca377e15dfada6436564e7f4ee942527c | [
"MIT"
] | null | null | null | __main__.py | vprzybylo/ai2es | cd54222ca377e15dfada6436564e7f4ee942527c | [
"MIT"
] | null | null | null | __main__.py | vprzybylo/ai2es | cd54222ca377e15dfada6436564e7f4ee942527c | [
"MIT"
] | null | null | null | import cocpit
import cocpit.config as config # isort: split
import os
import time
import pandas as pd
import torch
def build_model():
"""
train ML models
"""
# loop through batch sizes, models, epochs, and/or folds
for batch_size in config.BATCH_SIZE:
print("BATCH SIZE: ", batch_size)
... | 26.136986 | 77 | 0.614256 | import cocpit
import cocpit.config as config # isort: split
import os
import time
import pandas as pd
import torch
def build_model():
"""
train ML models
"""
# loop through batch sizes, models, epochs, and/or folds
for batch_size in config.BATCH_SIZE:
print("BATCH SIZE: ", batch_size)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cfa59b7e03a621229d3a7654d9a1137ae714d261 | 2,256 | py | Python | 20-fs-ias-lec/groups/Demo B/src/longFi/src/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/Demo B/src/longFi/src/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/Demo B/src/longFi/src/receiveEther.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | """
receiveEther.py
Faris Ahmetasevic, Marco Banholzer, Nderim Shatri
This code receives raw ethernet packets, which were sent to a network using the scapy library.
"""
"""
This function returns the converted information of the packets.
:param data: the bytes data which gets split up to get the mac-addresses and th... | 27.512195 | 128 | 0.699911 | """
receiveEther.py
Faris Ahmetasevic, Marco Banholzer, Nderim Shatri
This code receives raw ethernet packets, which were sent to a network using the scapy library.
"""
from scapy.all import conf
import struct
"""
This function returns the converted information of the packets.
:param data: the bytes data which get... | 0 | 0 | 0 | 0 | 0 | 1,253 | 0 | -3 | 137 |
624d0d0443d3ba5cb2b1fae2f1dd5f70165b3739 | 2,868 | py | Python | environments/gym_pycolab/protocols/logging.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | 12 | 2019-04-07T02:04:48.000Z | 2022-03-22T12:57:47.000Z | environments/gym_pycolab/protocols/logging.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | null | null | null | environments/gym_pycolab/protocols/logging.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | 7 | 2019-04-07T02:04:49.000Z | 2020-12-28T10:30:27.000Z | # Copyright 2017 the pycolab Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.394366 | 82 | 0.74477 | # Copyright 2017 the pycolab Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
76e13b55d98ab2dbca05ab4638b9827bc2fc8afe | 1,076 | py | Python | pylith/materials/__init__.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | 1 | 2021-01-20T17:18:28.000Z | 2021-01-20T17:18:28.000Z | pylith/materials/__init__.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | pylith/materials/__init__.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | 26.243902 | 72 | 0.546468 | #!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f22a2d7f5fa7d72c3510a14657615fe75aacb01 | 3,193 | py | Python | utils.py | LynnHongLiu/replayed_distillation | 943169e3b37f5453b386ae652af81db935efc7bd | [
"MIT"
] | 79 | 2017-07-20T07:27:59.000Z | 2022-02-13T14:10:35.000Z | utils.py | LynnHongLiu/replayed_distillation | 943169e3b37f5453b386ae652af81db935efc7bd | [
"MIT"
] | 4 | 2018-02-03T14:43:07.000Z | 2018-04-21T08:47:18.000Z | utils.py | iRapha/replayed_distillation | 943169e3b37f5453b386ae652af81db935efc7bd | [
"MIT"
] | 20 | 2017-07-22T16:22:38.000Z | 2021-05-17T14:03:31.000Z | from itertools import zip_longest
def grouper(iterable, batch_size, fill_value=None):
""" Helper method for returning batches of size batch_size of a dataset.
grouper('ABCDEF', 3) -> 'ABC', 'DEF'
"""
args = [iter(iterable)] * batch_size
return zip_longest(*args, fillvalue=fill_value)
| 29.027273 | 76 | 0.658628 | import datetime as dt
import json
import os
import sys
import tensorflow as tf
import numpy as np
from subprocess import check_output
from itertools import zip_longest
def get_logger(f):
if len(f.commit) == 0:
print('No commit hash provided, using most recent on HEAD')
f.commit = check_output(['g... | 0 | 0 | 0 | 0 | 0 | 2,585 | 0 | -20 | 316 |
9d71d09623ea6dba322c262bfb4c0d049a1a2533 | 14,351 | py | Python | src/finn/custom_op/logicnets/truthtable.py | jalezeta/finn-base | 14051a23670834ce41fd19a7134968648d2d112b | [
"BSD-3-Clause"
] | null | null | null | src/finn/custom_op/logicnets/truthtable.py | jalezeta/finn-base | 14051a23670834ce41fd19a7134968648d2d112b | [
"BSD-3-Clause"
] | null | null | null | src/finn/custom_op/logicnets/truthtable.py | jalezeta/finn-base | 14051a23670834ce41fd19a7134968648d2d112b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021 Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the f... | 39.534435 | 88 | 0.594035 | # Copyright (c) 2021 Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the f... | 0 | 0 | 0 | 10,404 | 0 | 0 | 0 | 109 | 177 |
c27a8b95b59e8ad90ba6e52a8fbf028a76e98858 | 1,086 | py | Python | dnm_cohorts/cohorts/oroak_nature.py | jeremymcrae/dnm_cohorts | e968357797d2d370b44904129c32c2e74b36b903 | [
"MIT"
] | 1 | 2020-12-10T05:17:21.000Z | 2020-12-10T05:17:21.000Z | dnm_cohorts/cohorts/oroak_nature.py | jeremymcrae/dnm_cohorts | e968357797d2d370b44904129c32c2e74b36b903 | [
"MIT"
] | null | null | null | dnm_cohorts/cohorts/oroak_nature.py | jeremymcrae/dnm_cohorts | e968357797d2d370b44904129c32c2e74b36b903 | [
"MIT"
] | null | null | null |
import pandas
from dnm_cohorts.person import Person
url = 'https://static-content.springer.com/esm/art%3A10.1038%2Fnature10989/MediaObjects/41586_2012_BFnature10989_MOESM11_ESM.xls'
def open_oroak_cohort():
""" get proband data from the O'Roak et al autism exome study
O'Roak et al. (2012) Nature 485:24... | 31.941176 | 129 | 0.644567 |
import pandas
from dnm_cohorts.person import Person
url = 'https://static-content.springer.com/esm/art%3A10.1038%2Fnature10989/MediaObjects/41586_2012_BFnature10989_MOESM11_ESM.xls'
def open_oroak_cohort():
""" get proband data from the O'Roak et al autism exome study
O'Roak et al. (2012) Nature 485:24... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab66010ad825163ec3980b41cacb3534407aba8b | 414 | py | Python | once/clean-ep-nums.py | erikfastermann/etc | a85ad6f0cb87dab208716dcc5a58c3f71a9b202c | [
"MIT"
] | null | null | null | once/clean-ep-nums.py | erikfastermann/etc | a85ad6f0cb87dab208716dcc5a58c3f71a9b202c | [
"MIT"
] | null | null | null | once/clean-ep-nums.py | erikfastermann/etc | a85ad6f0cb87dab208716dcc5a58c3f71a9b202c | [
"MIT"
] | null | null | null | import os
path = os.getcwd()
content = os.listdir(path)
last = 0
for f in content:
name, ext = os.path.splitext(f)
ep_num = name.split('x', 1)[1]
ep_num = int(ep_num.split(' -', 1)[0])
if ep_num != last + 1:
ep_num = last + 1
last += 1
season = name.split('x', 1)[0]
name = name.split(' - ', 1)[1]
new = f'{... | 21.789474 | 58 | 0.599034 | import os
path = os.getcwd()
content = os.listdir(path)
last = 0
for f in content:
name, ext = os.path.splitext(f)
ep_num = name.split('x', 1)[1]
ep_num = int(ep_num.split(' -', 1)[0])
if ep_num != last + 1:
ep_num = last + 1
last += 1
season = name.split('x', 1)[0]
name = name.split(' - ', 1)[1]
new = f'{... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25e0e8cc87b2e760d45a0a5d8f84d75189109445 | 3,695 | py | Python | projects/realtek/amebaD/IAR/aws_demos/python_custom_ecdsa_D.py | ambiot/ambd_amazon-freertos | 5ac9a8782bdcdd46838459111141fbf483d8aa5a | [
"MIT"
] | 2 | 2020-09-03T02:00:25.000Z | 2021-05-20T07:44:22.000Z | projects/realtek/amebaD/IAR/aws_demos/python_custom_ecdsa_D.py | ambiot/ambd_amazon-freertos | 5ac9a8782bdcdd46838459111141fbf483d8aa5a | [
"MIT"
] | null | null | null | projects/realtek/amebaD/IAR/aws_demos/python_custom_ecdsa_D.py | ambiot/ambd_amazon-freertos | 5ac9a8782bdcdd46838459111141fbf483d8aa5a | [
"MIT"
] | 1 | 2020-08-16T07:14:55.000Z | 2020-08-16T07:14:55.000Z | from OpenSSL import crypto
import os
Major = 0
Minor = 0
Build = 0
with open('../../../../../demos/include/aws_application_version.h') as f:
for line in f:
if line.find('APP_VERSION_MAJOR') != -1:
x = line.split()
Major = int(x[2])
if line.find('APP_VERSION_MINOR'... | 29.798387 | 118 | 0.68498 | from OpenSSL import crypto
from socket import gethostname
import os
import array as arr
import subprocess
Major = 0
Minor = 0
Build = 0
with open('../../../../../demos/include/aws_application_version.h') as f:
for line in f:
if line.find('APP_VERSION_MAJOR') != -1:
x = line.split()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 69 |
bcd3b65d9c0e74bcd69032f281dd72460d9c3725 | 5,133 | py | Python | base/modules/utils/root/sb_utils/general.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | 1 | 2019-04-29T12:47:17.000Z | 2019-04-29T12:47:17.000Z | base/modules/utils/root/sb_utils/general.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | null | null | null | base/modules/utils/root/sb_utils/general.py | g2-inc/openc2-oif-orchestrator | 85102bb41aa0d558a3fa088e4fd6f51613599ad0 | [
"Apache-2.0"
] | null | null | null | import json
import re
import sys
import uuid
from typing import (Any, Callable, Dict, Type, Union)
# Util Functions
def toStr(s: Any) -> str:
"""
Convert a given type to a default string
:param s: item to convert to a string
:return: converted string
"""
return s.decode(sys.getdefaultencoding... | 29.5 | 170 | 0.629651 | import base64
import binascii
import json
import re
import struct
import sys
import uuid
from typing import (
Any,
Callable,
Dict,
Type,
Union
)
# Util Functions
def toStr(s: Any) -> str:
"""
Convert a given type to a default string
:param s: item to convert to a string
:return: c... | 0 | 0 | 0 | 0 | 0 | 945 | 0 | 0 | 135 |
994fbf1a06a98785c519373eb80211528ef9f780 | 1,363 | py | Python | src/elevatorChecker.py | wennycooper/cross_map_navigation | 01564cda841603b7cc81b7bfd10ea0cae1c5a4b7 | [
"Apache-2.0"
] | null | null | null | src/elevatorChecker.py | wennycooper/cross_map_navigation | 01564cda841603b7cc81b7bfd10ea0cae1c5a4b7 | [
"Apache-2.0"
] | null | null | null | src/elevatorChecker.py | wennycooper/cross_map_navigation | 01564cda841603b7cc81b7bfd10ea0cae1c5a4b7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
avalability = False
tagOne = False
tagTwo = False
checkCBPub = rospy.Publisher('/checkEVcb',Bool,queue_size=1)
if __name__=="__main__":
rospy.init_node('elevator_checker')
rospy.Subscriber('/camera_rear/tag_detections',AprilTagDetectionArray,detectionCB)
rospy.Subscr... | 23.101695 | 86 | 0.644901 | #!/usr/bin/env python
from threading import Timer
import rospy
from geometry_msgs.msg import Twist, Pose2D, PoseStamped
from std_msgs.msg import *
from move_base_msgs.msg import *
from actionlib_msgs.msg import *
from apriltags_ros.msg import *
avalability = False
tagOne = False
tagTwo = False
checkCBPub = rospy.Pub... | 0 | 0 | 0 | 0 | 0 | 705 | 0 | 78 | 206 |
26864c90522bcced2776b665faf31d612440e695 | 1,897 | py | Python | beorn_lib/dialog/base/field_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/dialog/base/field_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/dialog/base/field_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# | .-. '| .-. :| .-. || .--'| \
# | `-' |\ --.' '-' '| | ... | 28.313433 | 82 | 0.489193 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# | .-. '| .-. :| .-. || .--'| \
# | `-' |\ --.' '-' '| | ... | 0 | 581 | 0 | 296 | 0 | 0 | 0 | 34 | 68 |
52f575289ebdd1210d2528436783985cff1f850b | 32,153 | py | Python | databaseobjects.py | judev1/sqlitewrapper | 4506c7d51bb8387865443194f690f35ee9d7c823 | [
"MIT"
] | 3 | 2021-08-31T18:33:43.000Z | 2022-01-10T16:26:58.000Z | databaseobjects.py | judev1/sqlitewrapper | 4506c7d51bb8387865443194f690f35ee9d7c823 | [
"MIT"
] | 1 | 2021-08-31T20:31:37.000Z | 2021-09-01T10:53:59.000Z | databaseobjects.py | judev1/sqlitewrapper | 4506c7d51bb8387865443194f690f35ee9d7c823 | [
"MIT"
] | null | null | null |
# TODO: in-code documentation
# TODO: pragma values
QueryObjects = (RawReadObject, RawWriteObject,
CreateTableObject, AddColumnObject,
AddRowObject, RemoveRowObject,
GetObject, SetObject)
LogicObjects = (RemoveRowObject, GetObject, SetObject)
WriteObjects = (RawWriteOb... | 31.491675 | 104 | 0.580755 | import sqlite3
from sqlite3.dbapi2 import DataError
import threading
import random
import string
from .datatypes import *
from .errors import *
# TODO: in-code documentation
def database(path, table=None, daemon=True, await_completion=True):
database = DatabaseObject(path, daemon, await_completion)
if not t... | 0 | 7,427 | 51 | 23,425 | 0 | 295 | 0 | -10 | 546 |
c0daa3074cb06ba61b6b6a5474d78f1a3b93f764 | 413 | py | Python | __examples__/correct_checksums/b.py | jeremywiebe/checksync | e626707492dbcb77fd1b13841e2f261b0c4796ba | [
"MIT"
] | 15 | 2019-09-11T21:44:29.000Z | 2022-01-24T12:54:59.000Z | __examples__/correct_checksums/b.py | jeremywiebe/checksync | e626707492dbcb77fd1b13841e2f261b0c4796ba | [
"MIT"
] | 874 | 2019-09-03T20:17:16.000Z | 2022-03-30T14:04:58.000Z | __examples__/correct_checksums/b.py | jeremywiebe/checksync | e626707492dbcb77fd1b13841e2f261b0c4796ba | [
"MIT"
] | 2 | 2020-11-04T19:16:37.000Z | 2021-06-02T21:30:34.000Z | # Test file in Python style
# sync-start:correct 770446101 __examples__/correct_checksums/a.js
code = 1
# sync-end:correct
# sync-start:correct2 322927876 __examples__/correct_checksums/a.js
genwebpack/khan-apollo/fragment-types.js genfiles/graphql_schema.json: $(shell find */graphql */*/graphql -name '*.py' -a ! -na... | 37.545455 | 142 | 0.774818 | # Test file in Python style
# sync-start:correct 770446101 __examples__/correct_checksums/a.js
code = 1
# sync-end:correct
# sync-start:correct2 322927876 __examples__/correct_checksums/a.js
genwebpack/khan-apollo/fragment-types.js genfiles/graphql_schema.json: $(shell find */graphql */*/graphql -name '*.py' -a ! -na... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7facb7933bd8ce6cda2b29652b8361ed79e2b8ab | 130 | py | Python | src/linakdeskapp/__main__.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 121 | 2018-09-19T20:10:21.000Z | 2022-03-31T08:07:33.000Z | src/feedsfix/__main__.py | anetczuk/thunderbird-feeds-recover | 996536bada6961df87873313e2e4b9a6e1bb9431 | [
"MIT"
] | 13 | 2020-02-19T15:58:37.000Z | 2022-03-05T03:20:42.000Z | src/feedsfix/__main__.py | anetczuk/thunderbird-feeds-recover | 996536bada6961df87873313e2e4b9a6e1bb9431 | [
"MIT"
] | 12 | 2020-02-13T23:55:30.000Z | 2022-01-30T15:11:31.000Z | ##
## Entry file when package is used as the main program.
##
if __name__ == '__main__':
from .main import main
main()
| 13 | 55 | 0.630769 | ##
## Entry file when package is used as the main program.
##
if __name__ == '__main__':
from .main import main
main()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
376d488896fc2ff1dc1e86ef65758221a5f8051d | 783 | py | Python | tests/test_multiple.py | abraia/abraia-python | e49e3869b2ee7e6b1bcb41e0cc1ae126ac39e202 | [
"MIT"
] | 4 | 2018-03-23T22:32:53.000Z | 2020-08-25T12:42:00.000Z | tests/test_multiple.py | abraia/abraia-multiple | e49e3869b2ee7e6b1bcb41e0cc1ae126ac39e202 | [
"MIT"
] | 5 | 2021-02-18T20:29:09.000Z | 2022-03-29T09:28:57.000Z | tests/test_multiple.py | abraia/abraia-python | e49e3869b2ee7e6b1bcb41e0cc1ae126ac39e202 | [
"MIT"
] | 1 | 2021-01-22T23:51:14.000Z | 2021-01-22T23:51:14.000Z |
from abraia import Multiple
multiple = Multiple()
| 23.029412 | 55 | 0.706258 | import numpy as np
from abraia import Multiple
multiple = Multiple()
def test_load_image():
img = multiple.load_image('lion.jpg')
assert isinstance(img, np.ndarray)
def test_load_metadata():
meta = multiple.load_metadata('lion.jpg')
assert meta['MIMEType'] == 'image/jpeg'
def test_save_image():
... | 0 | 0 | 0 | 0 | 0 | 592 | 0 | -3 | 137 |
07fb5058c7a297096cbf1ff7f21aedcf66b7d3ad | 985 | py | Python | shogitk/usikif.py | koji-hirono/pytk-shogi-replayer | a10819a797faecbee5c7b0654beb3694eb522840 | [
"MIT"
] | null | null | null | shogitk/usikif.py | koji-hirono/pytk-shogi-replayer | a10819a797faecbee5c7b0654beb3694eb522840 | [
"MIT"
] | null | null | null | shogitk/usikif.py | koji-hirono/pytk-shogi-replayer | a10819a797faecbee5c7b0654beb3694eb522840 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
RANKNUM = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9
}
| 25.921053 | 74 | 0.450761 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from shogitk.shogi import Coords, Move, BLACK, WHITE, DROP, PROMOTE
RANKNUM = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9
}
def decoder(f):
color = ... | 0 | 0 | 0 | 0 | 671 | 0 | 0 | 46 | 45 |
0b8b5527516fdb912956613a39b881648f901319 | 213 | py | Python | doc/src/modules/mpmath/plots/bessely.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 319 | 2016-09-22T15:54:48.000Z | 2022-03-18T02:36:58.000Z | doc/src/modules/mpmath/plots/bessely.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 9 | 2016-11-03T21:56:41.000Z | 2020-08-09T19:27:37.000Z | doc/src/modules/mpmath/plots/bessely.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 27 | 2016-10-06T16:05:32.000Z | 2022-03-18T02:37:00.000Z | # Bessel function of 2nd kind Y_n(x) on the real line for n=0,1,2,3
y0 = lambda x: bessely(0,x)
y1 = lambda x: bessely(1,x)
y2 = lambda x: bessely(2,x)
y3 = lambda x: bessely(3,x)
plot([y0,y1,y2,y3],[0,10],[-4,1]) | 35.5 | 67 | 0.643192 | # Bessel function of 2nd kind Y_n(x) on the real line for n=0,1,2,3
y0 = lambda x: bessely(0,x)
y1 = lambda x: bessely(1,x)
y2 = lambda x: bessely(2,x)
y3 = lambda x: bessely(3,x)
plot([y0,y1,y2,y3],[0,10],[-4,1]) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7bdc9328f5e2ca030f44bdfe27a9bb538f3ee6b | 2,442 | py | Python | h5flow/modules/__init__.py | peter-madigan/h5flow | b90e93677c6a45495e989cf578c96ddf42ffb3c8 | [
"MIT"
] | null | null | null | h5flow/modules/__init__.py | peter-madigan/h5flow | b90e93677c6a45495e989cf578c96ddf42ffb3c8 | [
"MIT"
] | 7 | 2021-05-21T20:23:22.000Z | 2021-11-24T21:06:34.000Z | h5flow/modules/__init__.py | peter-madigan/h5flow | b90e93677c6a45495e989cf578c96ddf42ffb3c8 | [
"MIT"
] | 1 | 2021-08-13T21:46:05.000Z | 2021-08-13T21:46:05.000Z | from inspect import isclass
import os
import importlib.util
import sys
import logging
from pkgutil import iter_modules
def find_class(classname, directory):
'''
Search the specified directory for a file containing a python
implementation with the specified class name
:param classname: cla... | 33 | 99 | 0.599509 | from inspect import isclass
import os
import importlib.util
import sys
import logging
from pkgutil import iter_modules
def find_class(classname, directory):
'''
Search the specified directory for a file containing a python
implementation with the specified class name
:param classname: cla... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0f7f3a5f87b4462c9b5d7faab0e44b67fbe81c22 | 1,182 | py | Python | nameless/__main__.py | ElliotPenson/Nameless | 54bf7a4d2e8fe6bf73722938970cb1d8c509c97d | [
"MIT"
] | 6 | 2017-08-14T17:22:29.000Z | 2022-01-02T14:54:13.000Z | nameless/__main__.py | ElliotPenson/nameless | 54bf7a4d2e8fe6bf73722938970cb1d8c509c97d | [
"MIT"
] | 1 | 2020-04-13T22:00:40.000Z | 2022-02-24T23:24:12.000Z | nameless/__main__.py | ElliotPenson/nameless | 54bf7a4d2e8fe6bf73722938970cb1d8c509c97d | [
"MIT"
] | 2 | 2017-10-01T17:09:18.000Z | 2019-05-20T06:12:42.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
main.py
@author ejnp
"""
from lexer import Lexer
from parser import Parser, ParserError
from visitors import BetaReduction
def interpret(input_string, print_reductions=False):
"""Performs normal order reduction on the given string lambda calculus
expression. Re... | 24.122449 | 74 | 0.63621 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
main.py
@author ejnp
"""
from lexer import Lexer
from parser import Parser, ParserError
from visitors import BetaReduction
def interpret(input_string, print_reductions=False):
"""Performs normal order reduction on the given string lambda calculus
expression. Re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
98dcc11cfe8014ee9fb08412398f5c5c35e4a380 | 3,350 | py | Python | basic/inlines/parser.py | neechadi/django-basic-apps | 3a90090857549ea4198a72c44f45f6edb238e2a8 | [
"BSD-3-Clause"
] | 548 | 2015-01-02T21:41:29.000Z | 2022-03-23T09:10:04.000Z | basic/inlines/parser.py | neechadi/django-basic-apps | 3a90090857549ea4198a72c44f45f6edb238e2a8 | [
"BSD-3-Clause"
] | 4 | 2015-01-13T16:27:02.000Z | 2016-11-01T01:51:31.000Z | basic/inlines/parser.py | neechadi/django-basic-apps | 3a90090857549ea4198a72c44f45f6edb238e2a8 | [
"BSD-3-Clause"
] | 182 | 2015-01-02T21:41:29.000Z | 2021-08-09T07:01:07.000Z | from django.template import TemplateSyntaxError
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
... | 35.263158 | 134 | 0.624776 | from django.template import TemplateSyntaxError
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.utils.encoding import smart_unicode
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
... | 0 | 0 | 0 | 0 | 0 | 836 | 0 | 0 | 23 |
b643d0886806c4dd0b4e934d942a30b98ea669c2 | 1,015 | py | Python | 033/main.py | jasonmobley/euler-python | cd483da472e525be625c1fe0c791ac075bd3a3ef | [
"Unlicense"
] | null | null | null | 033/main.py | jasonmobley/euler-python | cd483da472e525be625c1fe0c791ac075bd3a3ef | [
"Unlicense"
] | null | null | null | 033/main.py | jasonmobley/euler-python | cd483da472e525be625c1fe0c791ac075bd3a3ef | [
"Unlicense"
] | null | null | null | from math import gcd
fractions = list()
for numerator in range(10, 100):
for denominator in range(numerator+1, 100):
actual = numerator / denominator
a = numerator // 10
b = numerator % 10
c = denominator // 10
d = denominator % 10
if (b == 0 and d == 0) or (a == b and c == d) or (a != d and... | 24.756098 | 73 | 0.591133 | from math import gcd
def intFromList(l):
n = 0
m = 1
for i in range(len(l)-1, -1, -1):
n += m * l[i]
m *= 10
return n
fractions = list()
for numerator in range(10, 100):
for denominator in range(numerator+1, 100):
actual = numerator / denominator
a = numerator // 10
b = numerator % 10
... | 0 | 0 | 0 | 0 | 0 | 91 | 0 | 0 | 23 |
86c037e23ad6dc6e733532c71365e27da825f860 | 1,194 | py | Python | neutron/tests/functional/__init__.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/__init__.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/__init__.py | NeCTAR-RC/neutron | acf78cc3c88aff638180819419a65145a9a79695 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 33.166667 | 78 | 0.711055 | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 0 | 0 | 0 | 0 | 0 | 402 | 0 | -7 | 46 |
65c631fbb803e3fbc0221f0843c0f33c68e1b661 | 8,179 | py | Python | examples/privacy/membership_inference/train.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 139 | 2020-03-28T02:37:07.000Z | 2022-03-24T15:35:39.000Z | examples/privacy/membership_inference/train.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 2 | 2020-04-02T09:50:21.000Z | 2020-05-09T06:52:57.000Z | examples/privacy/membership_inference/train.py | hboshnak/mindarmour | 0609a4eaea875a84667bed279add9305752880cc | [
"Apache-2.0"
] | 12 | 2020-03-28T02:52:42.000Z | 2021-07-15T08:05:06.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.895 | 117 | 0.669275 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
213120ab7d47e5368a0a6d21cf7ba3a46730eda8 | 7,282 | py | Python | src/controllers/mainController.py | shimadasoftware/ATM-Simulator | 2d3b0cdc06f9b5a5ea2ba1b9b17053227e322dc4 | [
"Apache-2.0"
] | 2 | 2021-09-08T16:57:51.000Z | 2021-09-14T19:41:25.000Z | src/controllers/mainController.py | shimadasoftware/ATM-Simulator | 2d3b0cdc06f9b5a5ea2ba1b9b17053227e322dc4 | [
"Apache-2.0"
] | null | null | null | src/controllers/mainController.py | shimadasoftware/ATM-Simulator | 2d3b0cdc06f9b5a5ea2ba1b9b17053227e322dc4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main Controller
Created on Tue Aug 17 14:16:44 2021
Version: 1.0
Universidad Santo Toms Tunja
Simulation
@author: Juana Valentina Mendoza Santamara
@author: Alix Ivonne Chaparro Vasquez
presented to: Martha Susana Contreras Ortiz
"""
from random import randint
impor... | 29.24498 | 100 | 0.633068 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Main Controller
Created on Tue Aug 17 14:16:44 2021
Version: 1.0
Universidad Santo Tomás Tunja
Simulation
@author: Juana Valentina Mendoza Santamaría
@author: Alix Ivonne Chaparro Vasquez
presented to: Martha Susana Contreras Ortiz
"""
from random import randint
imp... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
281ec0bf45a2ac0a1f920b77e99794caa55c4669 | 1,188 | py | Python | tools/harmonics/show.py | jjzhang166/OpenGLEngine | e5d86f41536834499f4dd534c590fbeed045ff7c | [
"MIT"
] | 1 | 2021-08-12T07:35:49.000Z | 2021-08-12T07:35:49.000Z | tools/harmonics/show.py | jjzhang166/OpenGLEngine | e5d86f41536834499f4dd534c590fbeed045ff7c | [
"MIT"
] | null | null | null | tools/harmonics/show.py | jjzhang166/OpenGLEngine | e5d86f41536834499f4dd534c590fbeed045ff7c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: penghuailiang
# @Date : 1/1/20
"""
scipy.special
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
theta_1d = np.linspace(0, np.pi, 181) # colatitude
phi_1d = np.linspace(0, 2 * np.pi, 361) # longitude
theta_2d, phi_2d = np.... | 26.4 | 107 | 0.670875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: penghuailiang
# @Date : 1/1/20
"""
此脚本使用scipy.special绘制球谐函数
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import sph_harm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
theta_1d = np.linspace(0, np.pi, 181) # c... | 33 | 0 | 0 | 0 | 0 | 473 | 0 | 31 | 67 |
f78a15aad41a1b7a1db447dc27b33c377969ed73 | 1,081 | py | Python | uploads/core/migrations/0004_auto_20211123_1244.py | Borna07/IFC2Data | 8a3f287785b165ea4f0090c4f50c08a3d3b0c75c | [
"MIT"
] | null | null | null | uploads/core/migrations/0004_auto_20211123_1244.py | Borna07/IFC2Data | 8a3f287785b165ea4f0090c4f50c08a3d3b0c75c | [
"MIT"
] | null | null | null | uploads/core/migrations/0004_auto_20211123_1244.py | Borna07/IFC2Data | 8a3f287785b165ea4f0090c4f50c08a3d3b0c75c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-11-23 11:44
| 27.717949 | 62 | 0.565217 | # Generated by Django 3.2.7 on 2021-11-23 11:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20211028_1323'),
]
operations = [
migrations.AddField(
model_name='document',
name='author',
... | 0 | 0 | 0 | 967 | 0 | 0 | 0 | 19 | 46 |