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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4d9157319b66bba873f45428ff904995f748f650 | 2,149 | py | Python | bib/views.py | acdh-oeaw/thunau-old | a3023885470e80f7312e43561028398bffd713e0 | [
"MIT"
] | 1 | 2021-09-20T12:51:47.000Z | 2021-09-20T12:51:47.000Z | bib/views.py | acdh-oeaw/cbab | 7cd25f057913dccf85f851e448b1dbc2c5f8d624 | [
"MIT"
] | 9 | 2020-02-12T00:19:18.000Z | 2021-12-13T19:46:51.000Z | bib/views.py | acdh-oeaw/thunau-old | a3023885470e80f7312e43561028398bffd713e0 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# following line has to match the settings-file you are using
def sync_zotero(request):
""" renders a simple template with a button to trigger sync_zotero_action function """
return render(request, 'bib/synczotero.html')
| 33.061538 | 91 | 0.590507 | import requests
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .models import Book
# following line has to match the settings-file you are using
from django.conf import settings
def sync_zotero(request):
""" renders a simple template with a button to trigger sy... | 2 | 1,724 | 0 | 0 | 0 | 0 | 0 | 44 | 112 |
0f06c5989c3c2521bfde65ac17818d8908b5e3a6 | 229 | py | Python | contextManager/file_handler.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | contextManager/file_handler.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | contextManager/file_handler.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | import os
import subprocess
file = "some_file.txt"
with open(file, 'w') as opened_file:
opened_file.write('Hola!')
subprocess.run(["cat", file])
if os.path.exists(file):
os.remove(file)
assert not os.path.exists(file)
| 17.615385 | 36 | 0.703057 | import os
import subprocess
file = "some_file.txt"
with open(file, 'w') as opened_file:
opened_file.write('Hola!')
subprocess.run(["cat", file])
if os.path.exists(file):
os.remove(file)
assert not os.path.exists(file)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d088d3c2844363762dc3f4b36fd7e8b3eb3c010 | 133 | py | Python | task/constants.py | suvajitsarkar/taskManagement | 0054c20fba8dd8eb3c4c83abdded8fc778a8b62b | [
"Apache-2.0"
] | null | null | null | task/constants.py | suvajitsarkar/taskManagement | 0054c20fba8dd8eb3c4c83abdded8fc778a8b62b | [
"Apache-2.0"
] | 1 | 2021-06-10T23:00:14.000Z | 2021-06-10T23:00:14.000Z | task/constants.py | suvajitsarkar/taskManagement | 0054c20fba8dd8eb3c4c83abdded8fc778a8b62b | [
"Apache-2.0"
] | null | null | null | TASK_STAGES = (
('n', 'Not Started'),
('i', 'In Progress'),
('r', 'In Review'),
('d', 'Done'),
)
| 19 | 29 | 0.353383 | TASK_STAGES = (
('n', 'Not Started'),
('i', 'In Progress'),
('r', 'In Review'),
('d', 'Done'),
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c467b1c943e7b0098db2795f9c7ce4d0d502e039 | 2,687 | py | Python | core/helpers.py | quis/exceptional-review-procedure | adf34fb72b2d3357f4f1da320019f729cc1ae653 | [
"MIT"
] | null | null | null | core/helpers.py | quis/exceptional-review-procedure | adf34fb72b2d3357f4f1da320019f729cc1ae653 | [
"MIT"
] | null | null | null | core/helpers.py | quis/exceptional-review-procedure | adf34fb72b2d3357f4f1da320019f729cc1ae653 | [
"MIT"
] | null | null | null |
CACHE_KEY_USER = 'wizard-user-cache-key'
# unusual character that is unlikely to be included in each product label
PRODUCT_DELIMITER = ''
| 29.206522 | 115 | 0.717529 | from urllib.parse import urlencode
import uuid
from formtools.wizard.storage.base import BaseStorage
from formtools.wizard.storage.session import SessionStorage
import requests
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.cache import cache
from dj... | 2 | 0 | 0 | 907 | 0 | 1,073 | 0 | 150 | 407 |
ba6f4ebec266f13af50b4b48401bae096b80e262 | 49,610 | py | Python | hsm_software/sw/rpc_handling.py | DiamondKeySecurity/HSM | 6b6a0d691a22863411e048c7c211ac63bf9ffaa7 | [
"BSD-3-Clause"
] | null | null | null | hsm_software/sw/rpc_handling.py | DiamondKeySecurity/HSM | 6b6a0d691a22863411e048c7c211ac63bf9ffaa7 | [
"BSD-3-Clause"
] | null | null | null | hsm_software/sw/rpc_handling.py | DiamondKeySecurity/HSM | 6b6a0d691a22863411e048c7c211ac63bf9ffaa7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2018, 2019 Diamond Key Security, NFP
# 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 not... | 41.724138 | 141 | 0.668373 | #!/usr/bin/env python
# Copyright (c) 2018, 2019 Diamond Key Security, NFP
# 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 not... | 0 | 90 | 0 | 46,831 | 0 | 0 | 0 | 345 | 341 |
9a2f9bbcdef5df4bf28982e51a41ce770ed56584 | 745 | py | Python | texttospeak.py | PoomGamerE/Text-To-Speak-With-Python-Pitch-Supported- | 452a7a9bfaa22306da436832ea8e91185481d9d5 | [
"WTFPL"
] | 1 | 2021-12-31T15:50:08.000Z | 2021-12-31T15:50:08.000Z | texttospeak.py | PoomGamerE/Text-To-Speak-With-Python-Pitch-Supported | 452a7a9bfaa22306da436832ea8e91185481d9d5 | [
"WTFPL"
] | null | null | null | texttospeak.py | PoomGamerE/Text-To-Speak-With-Python-Pitch-Supported | 452a7a9bfaa22306da436832ea8e91185481d9d5 | [
"WTFPL"
] | 1 | 2020-05-07T16:07:55.000Z | 2020-05-07T16:07:55.000Z | from gtts import gTTS
from pydub import AudioSegment
AudioSegment.converter = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffprobe ="C:\\ffmpeg\\bin\\ffprobe.exe"
from pydub.playback import play
import playsound
tts = gTTS(text='Test Hatsune Miku', lang='en', slow=True... | 25.689655 | 87 | 0.754362 | from gtts import gTTS
from pydub import AudioSegment
AudioSegment.converter = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffprobe ="C:\\ffmpeg\\bin\\ffprobe.exe"
from pydub.playback import play
import playsound
tts = gTTS(text='Test Hatsune Miku', lang='en', slow=True... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9ad6c19f7ef674e649f00e8e4202cdc498e8bfb | 3,721 | py | Python | __init__.py | krisgesling/device-initiated-interaction-skill | e961aeadc3af1c5c3d10c0bb90e392cbe4ecb54a | [
"Apache-2.0"
] | null | null | null | __init__.py | krisgesling/device-initiated-interaction-skill | e961aeadc3af1c5c3d10c0bb90e392cbe4ecb54a | [
"Apache-2.0"
] | null | null | null | __init__.py | krisgesling/device-initiated-interaction-skill | e961aeadc3af1c5c3d10c0bb90e392cbe4ecb54a | [
"Apache-2.0"
] | null | null | null |
API_ENDPOINT = "https://example.com/api"
API_KEY = "XXXXXXXXXXXXXXXXX"
MINUTES = 60 # seconds
HOURS = 60 * MINUTES
| 41.344444 | 145 | 0.689331 | from datetime import datetime
from time import sleep
import requests
from mycroft import MycroftSkill, intent_handler
from mycroft.audio import wait_while_speaking
from mycroft.util.format import nice_duration, TimeResolution
API_ENDPOINT = "https://example.com/api"
API_KEY = "XXXXXXXXXXXXXXXXX"
MINUTES = 60 # secon... | 0 | 1,394 | 0 | 1,898 | 0 | 38 | 0 | 94 | 180 |
88d3e7a0d8ea1590d06630c3b732f4ca8621ff36 | 319 | py | Python | code/array_absurdity/array_absurdity.py | rafalmierzwiak/yearn | 4f173f9c326bc742d90de26ad23af500713cd6a1 | [
"Unlicense"
] | 1 | 2021-04-06T17:39:28.000Z | 2021-04-06T17:39:28.000Z | code/array_absurdity/array_absurdity.py | rafalmierzwiak/yearn | 4f173f9c326bc742d90de26ad23af500713cd6a1 | [
"Unlicense"
] | null | null | null | code/array_absurdity/array_absurdity.py | rafalmierzwiak/yearn | 4f173f9c326bc742d90de26ad23af500713cd6a1 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
from sys import argv
with open(argv[1]) as f:
for line in f:
length, numbers = line.rstrip("\n").split(";")
duplicates = {}
for n in numbers.split(","):
if n in duplicates:
print(n)
break
duplicates[n] = True
| 21.266667 | 54 | 0.492163 | #!/usr/bin/env python3
from sys import argv
with open(argv[1]) as f:
for line in f:
length, numbers = line.rstrip("\n").split(";")
duplicates = {}
for n in numbers.split(","):
if n in duplicates:
print(n)
break
duplicates[n] = True
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2ef113d54b817448e697c5115dc69a977e0e9aa | 107 | py | Python | 1. Python/2. Flow of Control/14.multiple_of_10.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | 1 | 2021-12-05T18:02:15.000Z | 2021-12-05T18:02:15.000Z | 1. Python/2. Flow of Control/14.multiple_of_10.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null | 1. Python/2. Flow of Control/14.multiple_of_10.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null |
#Print multiples of 10 for numbers in a given range
for num in range(5):
if num > 0:
print(num * 10) | 21.4 | 51 | 0.663551 |
#Print multiples of 10 for numbers in a given range
for num in range(5):
if num > 0:
print(num * 10) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dc7d4c67f2d423199d46c7b7ac45785d73c591e2 | 412 | py | Python | SpaceHabitRPG/Tests/ForTestHelpers/Test_SpaceUnitTest.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | null | null | null | SpaceHabitRPG/Tests/ForTestHelpers/Test_SpaceUnitTest.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | 13 | 2016-07-19T04:13:20.000Z | 2016-08-17T06:06:47.000Z | SpaceHabitRPG/Tests/ForTestHelpers/Test_SpaceUnitTest.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
unittest.main()
| 29.428571 | 71 | 0.696602 | from SpaceUnitTest import SpaceUnitTest
class Test_SpaceUnitTest(SpaceUnitTest):
def test_assertBool(self):
t1 = None
t2 = 6
self.assertRaises(AssertionError, lambda :self.assertFalse(t1))
self.assertRaises(AssertionError, lambda :self.assertTrue(t2))
self.assertNotEqual(t1,... | 0 | 0 | 0 | 301 | 0 | 0 | 0 | 18 | 45 |
78ecea3a7cd48bf6116ebbd160f009bb753182bc | 1,288 | py | Python | mpltex/mpltex.py | bluesquall/mpltex | b4794c601ac085fe3b89b4fdb46eb92ae06a3e15 | [
"MIT"
] | 1 | 2021-12-01T15:21:39.000Z | 2021-12-01T15:21:39.000Z | mpltex/mpltex.py | bluesquall/mpltex | b4794c601ac085fe3b89b4fdb46eb92ae06a3e15 | [
"MIT"
] | null | null | null | mpltex/mpltex.py | bluesquall/mpltex | b4794c601ac085fe3b89b4fdb46eb92ae06a3e15 | [
"MIT"
] | null | null | null | """
mpltex
======
"""
golden_ratio = (5**.5-1.0)/2.0
packages = ['amsmath', 'amssymb', 'amsfonts', 'amsbsy', 'bm']
usepackages = [r'\usepackage{{{0}}}'.format(pkg) for pkg in packages]
def get_rcParams(fig_width_pt = 232.0, scale = 1.0, dpi = 600):
"""TODO: write a description
Parameters
---------... | 27.404255 | 70 | 0.559006 | """
mpltex
======
"""
golden_ratio = (5**.5-1.0)/2.0
packages = ['amsmath', 'amssymb', 'amsfonts', 'amsbsy', 'bm']
usepackages = [r'\usepackage{{{0}}}'.format(pkg) for pkg in packages]
def pt_to_in(pt):
return pt / 72.27
def pt_to_mm(pt):
raise NotImplementedError
def get_rcParams(fig_width_pt = 232.0, s... | 0 | 0 | 0 | 0 | 0 | 44 | 0 | 0 | 46 |
a2361bc10b2d2184556a466dee04a4a83a83384d | 4,167 | py | Python | garam.py | albus137/csp_python_tests | 952b68ea4dc22b1f87a40bfa9a54bf17d305e235 | [
"MIT"
] | null | null | null | garam.py | albus137/csp_python_tests | 952b68ea4dc22b1f87a40bfa9a54bf17d305e235 | [
"MIT"
] | null | null | null | garam.py | albus137/csp_python_tests | 952b68ea4dc22b1f87a40bfa9a54bf17d305e235 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pyexcel as pe
from time import time
# create the problem object
problem = Problem(RecursiveBacktrackingSolver())
# import the Garam grid
grid = pe.get_array(file_name='csp_grid.ods')
n_lines, n_cols = len(grid), len(grid[0])
# display the Garam grid nicely
print('Initial grid:')
print()... | 31.330827 | 112 | 0.521718 | #!/usr/bin/env python3
from constraint import *
import pyexcel as pe
from time import time
# create the problem object
problem = Problem(RecursiveBacktrackingSolver())
# import the Garam grid
grid = pe.get_array(file_name='csp_grid.ods')
n_lines, n_cols = len(grid), len(grid[0])
# display the Garam grid nicely
prin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 23 |
60a0943dd24d4687989fb3460f5ca8fc22c02667 | 1,045 | py | Python | venv/0713.py | JungHwan-Park21/python_workspace | 7463724d6b9955bd594d8538c9636de7748f7ece | [
"MIT"
] | null | null | null | venv/0713.py | JungHwan-Park21/python_workspace | 7463724d6b9955bd594d8538c9636de7748f7ece | [
"MIT"
] | null | null | null | venv/0713.py | JungHwan-Park21/python_workspace | 7463724d6b9955bd594d8538c9636de7748f7ece | [
"MIT"
] | null | null | null | # data = list(range(1, 46))
#
# import random
#
#
# def random_pop(data):
# number = random.randint(0, len(data) - 1)
# return data.pop(number)
#
#
# for i in range(1, 7):
# print(random_pop(data))
##
# import webbrowser
#
# url = "https://coastwatch.pfeg.noaa.gov/erddap/griddap/erdMH1chlamday.geotif?chlor... | 23.75 | 277 | 0.68134 | # data = list(range(1, 46))
#
# import random
#
#
# def random_pop(data):
# number = random.randint(0, len(data) - 1)
# return data.pop(number)
#
#
# for i in range(1, 7):
# print(random_pop(data))
##
# import webbrowser
#
# url = "https://coastwatch.pfeg.noaa.gov/erddap/griddap/erdMH1chlamday.geotif?chlor... | 45 | 0 | 0 | 0 | 110 | 0 | 0 | 11 | 22 |
86b2b9be4c907cd7e31be2fd93d8800322a78cf9 | 739 | py | Python | wagtaildemo/settings/production.py | caputomarcos/wagtaildemo | 08cca1dbc44bb836c0923ff2720a8a3195f4042b | [
"BSD-3-Clause"
] | 3 | 2015-12-03T21:34:59.000Z | 2017-08-12T16:53:33.000Z | wagtaildemo/settings/production.py | caputomarcos/wagtaildemo | 08cca1dbc44bb836c0923ff2720a8a3195f4042b | [
"BSD-3-Clause"
] | null | null | null | wagtaildemo/settings/production.py | caputomarcos/wagtaildemo | 08cca1dbc44bb836c0923ff2720a8a3195f4042b | [
"BSD-3-Clause"
] | 4 | 2015-12-03T21:35:01.000Z | 2020-11-14T09:29:29.000Z |
DEBUG = False
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'INDEX': 'wagtaildemo'
}
}
CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.RedisCache',
'LOCATION': '127.0.0.1:6379',
'KEY_PREFIX'... | 19.447368 | 80 | 0.618403 | from .base import *
DEBUG = False
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'INDEX': 'wagtaildemo'
}
}
CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.RedisCache',
'LOCATION': '127.0.0.1:6379',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 45 |
cacd68ed453b920081ba00b225a82efbfcad337e | 590 | py | Python | algorithms/decisiontree/decisiontree.classification.py | Marcnuth/DataScienceInterestGroup | cae73aa9f6ab1588b565492225a1086b93e121f6 | [
"Apache-2.0"
] | null | null | null | algorithms/decisiontree/decisiontree.classification.py | Marcnuth/DataScienceInterestGroup | cae73aa9f6ab1588b565492225a1086b93e121f6 | [
"Apache-2.0"
] | null | null | null | algorithms/decisiontree/decisiontree.classification.py | Marcnuth/DataScienceInterestGroup | cae73aa9f6ab1588b565492225a1086b93e121f6 | [
"Apache-2.0"
] | null | null | null | from sklearn import tree
from sklearn.datasets import load_iris
from sklearn.externals.six import StringIO
import pydot
from IPython.display import Image
if __name__ == '__main__':
iris = load_iris()
print predictByDTC(iris.data, iris.target, iris.data[0:,])
| 22.692308 | 62 | 0.713559 | from sklearn import tree
from sklearn.datasets import load_iris
from sklearn.externals.six import StringIO
import pydot
from IPython.display import Image
def predictByDTC(X,Y,test):
clf = tree.DecisionTreeClassifier().fit(X, Y)
#Visualize decision tree
#dot_data = StringIO()
#tree.export_graphvi... | 0 | 0 | 0 | 0 | 0 | 286 | 0 | 0 | 23 |
8718ddc93fcc419c4999d37a997527ee8f0ed08c | 846 | py | Python | ktts.py | Jeyadevanjd/ktts | 3e6aef7546abfbdf08b533b757e8353aae9caa7e | [
"MIT"
] | 1 | 2020-05-15T08:21:42.000Z | 2020-05-15T08:21:42.000Z | ktts.py | Jeyadevanjd/ktts | 3e6aef7546abfbdf08b533b757e8353aae9caa7e | [
"MIT"
] | null | null | null | ktts.py | Jeyadevanjd/ktts | 3e6aef7546abfbdf08b533b757e8353aae9caa7e | [
"MIT"
] | null | null | null | import os
from configparser import ConfigParser
configr = ConfigParser()
pp = os.getcwd()
config = ConfigParser()
val = []
path = pp
para = path + "/det.ini"
print(para)
val2 = []
config.read(para)
ad = config['installation']['installation']
print(pp)
if ad == "False":
pas = input("pleae enter your password for roo... | 24.882353 | 84 | 0.605201 | import os
import sys
from configparser import ConfigParser
configr = ConfigParser()
from subprocess import Popen as pop
pp = os.getcwd()
config = ConfigParser()
val = []
path = pp
para = path + "/det.ini"
print(para)
val2 = []
config.read(para)
ad = config['installation']['installation']
print(pp)
if ad == "False":
... | 0 | 0 | 0 | 0 | 0 | 130 | 0 | 3 | 66 |
6d684bef9ff874d142d8e3ac37ec1b10bc574e68 | 675 | py | Python | funds/migrations/0008_auto_20211205_0852.py | cnlis/lib_books | 05bed0f9775826e0b1f968a766ddf5c2d1d55f40 | [
"MIT"
] | null | null | null | funds/migrations/0008_auto_20211205_0852.py | cnlis/lib_books | 05bed0f9775826e0b1f968a766ddf5c2d1d55f40 | [
"MIT"
] | null | null | null | funds/migrations/0008_auto_20211205_0852.py | cnlis/lib_books | 05bed0f9775826e0b1f968a766ddf5c2d1d55f40 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-12-05 08:52
| 23.275862 | 49 | 0.551111 | # Generated by Django 3.2.9 on 2021-12-05 08:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funds', '0007_document_type'),
]
operations = [
migrations.RenameField(
model_name='fund',
old_name='fund_count',
... | 0 | 0 | 0 | 561 | 0 | 0 | 0 | 19 | 46 |
8ad2d2a254ba090cf3c2576f441bf3cfe9241a0a | 1,117 | py | Python | web/practicas/practica2/parser.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | null | null | null | web/practicas/practica2/parser.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | null | null | null | web/practicas/practica2/parser.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | 1 | 2020-03-03T04:16:42.000Z | 2020-03-03T04:16:42.000Z |
text = " <option>lvaro Obregn</option>\n" +" <option>Azcapotzalco</option>\n" +" <option>Benito Jurez</option>\n" +" <option>Coyoacn</option>\n" +" <option>Cuajimalpa de Morelos</option>\n" +" <option>Cuauhtmoc</option>\n" +... | 101.545455 | 909 | 0.45658 |
text = " <option>Álvaro Obregón</option>\n" +" <option>Azcapotzalco</option>\n" +" <option>Benito Juárez</option>\n" +" <option>Coyoacán</option>\n" +" <option>Cuajimalpa de Morelos</option>\n" +" <option>Cuauhtémoc</option>... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13ffa40792c9a2978d3b11a7f70c68598ebefae1 | 254 | py | Python | Aulas/Aula13/tk01.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | Aulas/Aula13/tk01.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | Aulas/Aula13/tk01.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | # tk01.py
main()
| 18.142857 | 45 | 0.590551 | # tk01.py
import tkinter as tk
def main():
# Cria a janela
janela = tk.Tk()
janela.title('Primeira janela')
# Entra no mainloop, o que faz com que
# a janela seja renderizada na tela
janela.mainloop()
main()
| 0 | 0 | 0 | 0 | 0 | 192 | 0 | -1 | 45 |
1bf61e9ce9b3a3f64582a8b86bf57fcde353dd25 | 3,411 | py | Python | stash/database.py | fkolacek/Stash | 58c2e38306a89bf1b1b63d427ac5db9134471cc4 | [
"MIT"
] | null | null | null | stash/database.py | fkolacek/Stash | 58c2e38306a89bf1b1b63d427ac5db9134471cc4 | [
"MIT"
] | null | null | null | stash/database.py | fkolacek/Stash | 58c2e38306a89bf1b1b63d427ac5db9134471cc4 | [
"MIT"
] | null | null | null | #
# Author: Frantisek Kolacek <work@kolacek.it
# Version: 1.0
#
| 29.66087 | 128 | 0.577543 | #
# Author: Frantisek Kolacek <work@kolacek.it
# Version: 1.0
#
import logging
import sqlite3
from datetime import datetime
from .exception import StashDatabaseException
class StashDatabase:
config = None
connection = None
cursor = None
def __init__(self, **config):
try:
self.c... | 0 | 133 | 0 | 3,082 | 0 | 0 | 0 | 18 | 113 |
3d9ba12ebbec8fcf3abd7c138d26883b8b57674c | 1,321 | py | Python | Flask/learnflask.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | 1 | 2022-01-14T18:03:42.000Z | 2022-01-14T18:03:42.000Z | Flask/learnflask.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | null | null | null | Flask/learnflask.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | null | null | null | """
Handle only one request one time
not good for developer
Flask is a small and lightweight Python web framework that provides useful tools and features that make creating web applications in Python easier.
It gives developers flexibility and is a more accessible framework for new developers since you can build a
web... | 32.219512 | 147 | 0.761544 | """
Handle only one request one time
not good for developer
Flask is a small and lightweight Python web framework that provides useful tools and features that make creating web applications in Python easier.
It gives developers flexibility and is a more accessible framework for new developers since you can build a
web... | 0 | 96 | 0 | 0 | 0 | 22 | 0 | 0 | 68 |
734d4660acd1fa981bb20e9452efd630f2edbc0e | 17,263 | py | Python | platformio/platforms/base.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | 2 | 2020-05-12T15:10:37.000Z | 2021-07-02T15:41:56.000Z | platformio/platforms/base.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | null | null | null | platformio/platforms/base.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | 1 | 2018-11-30T22:34:24.000Z | 2018-11-30T22:34:24.000Z | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# 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... | 33.070881 | 78 | 0.573307 | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# 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... | 0 | 2,024 | 0 | 9,717 | 0 | 27 | 0 | 81 | 427 |
ae7911041f957339b7880da7f8a77caa9715da61 | 2,462 | py | Python | kedb/files/settings.py | salt-formulas/salt-formula-kedb | 0739d4c8c5278ede0275820b8c5ba810e746c8f1 | [
"Apache-2.0"
] | null | null | null | kedb/files/settings.py | salt-formulas/salt-formula-kedb | 0739d4c8c5278ede0275820b8c5ba810e746c8f1 | [
"Apache-2.0"
] | null | null | null | kedb/files/settings.py | salt-formulas/salt-formula-kedb | 0739d4c8c5278ede0275820b8c5ba810e746c8f1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{%- set app = pillar.kedb.server %}
from os.path import join, dirname, abspath, normpath
DATABASES = {
'default': {
{%- if app.database.engine == 'mysql' %}
'ENGINE': 'django.db.backends.mysql',
'PORT': '3306',
'OPTIONS': {'init_command': 'SET storage_engine... | 28.627907 | 134 | 0.561738 | # -*- coding: utf-8 -*-
{%- set app = pillar.kedb.server %}
from os.path import join, dirname, abspath, normpath
DATABASES = {
'default': {
{%- if app.database.engine == 'mysql' %}
'ENGINE': 'django.db.backends.mysql',
'PORT': '3306',
'OPTIONS': {'init_command': 'SET storage_engine... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
276b2b75102958887a594dd0dc549f5b1e092d4b | 6,243 | py | Python | snesc_checker.py | wminner/SNES-Classic-Checker | 9b9fc1b72ad4d64969d3456cd1b5d05cd03c7d46 | [
"MIT"
] | 3 | 2017-08-23T01:32:31.000Z | 2018-01-09T03:11:24.000Z | snesc_checker.py | wminner/SNES-Classic-Checker | 9b9fc1b72ad4d64969d3456cd1b5d05cd03c7d46 | [
"MIT"
] | null | null | null | snesc_checker.py | wminner/SNES-Classic-Checker | 9b9fc1b72ad4d64969d3456cd1b5d05cd03c7d46 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
# import browser_cookie3
# Create email with subject and body, then sends via gmail address provided
# Gets and caches your gmail address
# Gets your gmail password (does not cache)
# Strip off script name in arg list
if __name__ == "__main__":
main(sys.argv[1:])
| 31.852041 | 168 | 0.682364 | #!/usr/bin/env python3
import re, sys
import getopt, pickle
import time, datetime
import urllib.request
import smtplib
from email.mime.text import MIMEText
import getpass
# import browser_cookie3
def main(argv):
default_send_email = "<your_sender_gmail>@gmail.com"
default_receive_email = "<your_receiver_gmail>@gma... | 0 | 0 | 0 | 0 | 0 | 5,708 | 0 | 5 | 222 |
0ecd9b1334e318b4ccffc4b6eeae536b6e03414f | 186 | py | Python | python-flask-server-generated/swagger_server/controllers/__init__.py | procube-open/pdns_certbot_server | 516207b2416781c94a8620bb3a1d0897c773142d | [
"MIT"
] | null | null | null | python-flask-server-generated/swagger_server/controllers/__init__.py | procube-open/pdns_certbot_server | 516207b2416781c94a8620bb3a1d0897c773142d | [
"MIT"
] | null | null | null | python-flask-server-generated/swagger_server/controllers/__init__.py | procube-open/pdns_certbot_server | 516207b2416781c94a8620bb3a1d0897c773142d | [
"MIT"
] | null | null | null | import threading
import logging
LOCK = threading.Lock()
logger = logging.getLogger("CERTBOT")
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| 20.666667 | 37 | 0.801075 | import threading
import logging
LOCK = threading.Lock()
logger = logging.getLogger("CERTBOT")
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a09b9af2b847bf39b063ead0a72aab28cd93427e | 126 | py | Python | wtpy/apps/__init__.py | Huijun-Cui/wtpy | 9a8243a20b944fbb37aa33d81215b7b36ac7b1e2 | [
"MIT"
] | null | null | null | wtpy/apps/__init__.py | Huijun-Cui/wtpy | 9a8243a20b944fbb37aa33d81215b7b36ac7b1e2 | [
"MIT"
] | null | null | null | wtpy/apps/__init__.py | Huijun-Cui/wtpy | 9a8243a20b944fbb37aa33d81215b7b36ac7b1e2 | [
"MIT"
] | null | null | null | from .WtBtAnalyst import WtBtAnalyst
from .WtCtaOptimizer import WtCtaOptimizer
__all__ = ["WtBtAnalyst","WtCtaOptimizer"] | 31.5 | 43 | 0.809524 | from .WtBtAnalyst import WtBtAnalyst
from .WtCtaOptimizer import WtCtaOptimizer
__all__ = ["WtBtAnalyst","WtCtaOptimizer"] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86633a33a9926907327bdb9b93dde0ee954c35a3 | 729 | py | Python | tests/debugger.py | fferri/pygolog | 98a4c5d9de053ee2e43ae2f61fa9f098eb38598a | [
"BSD-3-Clause"
] | 7 | 2017-06-15T14:56:37.000Z | 2021-11-12T22:27:47.000Z | tests/debugger.py | fferri/pygolog | 98a4c5d9de053ee2e43ae2f61fa9f098eb38598a | [
"BSD-3-Clause"
] | null | null | null | tests/debugger.py | fferri/pygolog | 98a4c5d9de053ee2e43ae2f61fa9f098eb38598a | [
"BSD-3-Clause"
] | 1 | 2021-05-14T11:13:01.000Z | 2021-05-14T11:13:01.000Z | #!/usr/bin/env python3
from domains.math1 import S
s = S(0)
p = Sequence(
Choose(
Exec(S.incr()),
Exec(S.double())
),
Choose(
Exec(S.incr()),
Exec(S.double())
),
Test(lambda s: s.n == 1)
)
debug(p, s)
| 22.78125 | 71 | 0.489712 | #!/usr/bin/env python3
from collections import defaultdict
from copy import copy
from strips import *
from golog_program import *
from domains.math1 import S
s = S(0)
p = Sequence(
Choose(
Exec(S.incr()),
Exec(S.double())
),
Choose(
Exec(S.incr()... | 0 | 0 | 0 | 0 | 0 | 291 | 0 | 19 | 112 |
c7b05272d678883c8d35b24c852e7ccef6f65d43 | 12,515 | py | Python | tests/test_utf8inputtext.py | polm/SudachiPy | 9eae063baa65d230cd89e382685fe9e410577125 | [
"Apache-2.0"
] | 3 | 2017-09-21T14:56:30.000Z | 2017-11-10T05:44:30.000Z | tests/test_utf8inputtext.py | polm/SudachiPy | 9eae063baa65d230cd89e382685fe9e410577125 | [
"Apache-2.0"
] | null | null | null | tests/test_utf8inputtext.py | polm/SudachiPy | 9eae063baa65d230cd89e382685fe9e410577125 | [
"Apache-2.0"
] | 1 | 2021-12-17T05:39:38.000Z | 2021-12-17T05:39:38.000Z | # Copyright (c) 2019 Works Applications 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 a... | 48.886719 | 111 | 0.703076 | # Copyright (c) 2019 Works Applications 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 a... | 277 | 0 | 0 | 11,661 | 0 | 0 | 0 | -17 | 69 |
9694a2f313620b91b57ba7cf9877cc25e3d3f26a | 8,996 | py | Python | mtil/reward_injection_wrappers.py | qxcv/mtil | 62608046efb570b53f8107b8de9a7a1f28aee28a | [
"0BSD"
] | 1 | 2021-01-18T23:57:07.000Z | 2021-01-18T23:57:07.000Z | mtil/reward_injection_wrappers.py | qxcv/mtil | 62608046efb570b53f8107b8de9a7a1f28aee28a | [
"0BSD"
] | null | null | null | mtil/reward_injection_wrappers.py | qxcv/mtil | 62608046efb570b53f8107b8de9a7a1f28aee28a | [
"0BSD"
] | null | null | null | """Wrappers for rlpyt algorithms that inject reward from a custom reward model
at execution time.
TODO: need to figure out exactly how I'm going to do this for algorithms other
than PG. Some notes:
- For PG algorithms (PPO + A2C) it's easy to override the reward used at
training time by subclassing & overriding the... | 39.113043 | 79 | 0.626723 | """Wrappers for rlpyt algorithms that inject reward from a custom reward model
at execution time.
TODO: need to figure out exactly how I'm going to do this for algorithms other
than PG. Some notes:
- For PG algorithms (PPO + A2C) it's easy to override the reward used at
training time by subclassing & overriding the... | 3 | 231 | 0 | 7,046 | 0 | 0 | 0 | 110 | 249 |
3594e17236136b711372a9945750692b0c864ddd | 1,701 | py | Python | src/apps/alarm_clock/tests/test_alarm_time.py | stefanhoelzl/alarm-clock | efba84e71fcade26bef020dc7eaa10181ea9f96c | [
"MIT"
] | 1 | 2019-07-31T12:39:53.000Z | 2019-07-31T12:39:53.000Z | src/apps/alarm_clock/tests/test_alarm_time.py | stefanhoelzl/alarm-clock | efba84e71fcade26bef020dc7eaa10181ea9f96c | [
"MIT"
] | null | null | null | src/apps/alarm_clock/tests/test_alarm_time.py | stefanhoelzl/alarm-clock | efba84e71fcade26bef020dc7eaa10181ea9f96c | [
"MIT"
] | 1 | 2019-10-04T04:32:20.000Z | 2019-10-04T04:32:20.000Z |
# time.localtime(126000) 35*60*60
# time.struct_time(tm_year=1970, tm_mon=1, tm_mday=2,
# tm_hour=12, tm_min=0, tm_sec=0,
# tm_wday=4, tm_yday=2, tm_isdst=0)
| 30.375 | 80 | 0.633157 | import pytest
from unittest.mock import patch
from ..alarm_time import diff_between_weekdays, get_next_weekday, next_time
# time.localtime(126000) 35*60*60
# time.struct_time(tm_year=1970, tm_mon=1, tm_mday=2,
# tm_hour=12, tm_min=0, tm_sec=0,
# tm_wday=4, tm_yday=2, tm_isdst=0)
def... | 0 | 236 | 0 | 971 | 0 | 57 | 0 | 56 | 184 |
8dcff54d0b2c4427d452f34f93a80e755ff0e5b6 | 422 | py | Python | Array/python/reverse_aryasoni98.py | CodeTrophs/450DSA | 84ab1b13cd837b860c4b747d567e3507b29291b3 | [
"MIT"
] | 5 | 2021-05-15T13:35:33.000Z | 2021-07-21T09:35:51.000Z | Array/python/reverse_aryasoni98.py | CodeTrophs/450DSA | 84ab1b13cd837b860c4b747d567e3507b29291b3 | [
"MIT"
] | 1 | 2021-07-17T12:20:09.000Z | 2021-07-20T08:25:02.000Z | Array/python/reverse_aryasoni98.py | CodeTrophs/450DSA | 84ab1b13cd837b860c4b747d567e3507b29291b3 | [
"MIT"
] | 8 | 2021-05-26T22:22:07.000Z | 2021-12-16T04:35:32.000Z | # Approach 1
# reverseList([1, 2, 3, 4, 5, 6], 0, 5) = [6 5 4 3 2 1]
# Approach 2
# reverseList([1, 2, 3, 4, 5, 6], 0, 5) = [6 5 4 3 2 1]
| 20.095238 | 55 | 0.509479 | # Approach 1
def reverseList(A, start, end):
while start < end:
A[start], A[end] = A[end], A[start]
start += 1
end -= 1
# reverseList([1, 2, 3, 4, 5, 6], 0, 5) = [6 5 4 3 2 1]
# Approach 2
def reverseList(A, start, end):
if start >= end:
return
A[start], A[end] = A[end],... | 0 | 0 | 0 | 0 | 0 | 234 | 0 | 0 | 46 |
9022b4a37c85bb12d4642e5a3cdab4efa2f30215 | 1,140 | py | Python | apps/comment/models.py | aplot249/my_blog | 7cfcd67991f0a6dc861847514e8d0fca2213fa8b | [
"MIT"
] | null | null | null | apps/comment/models.py | aplot249/my_blog | 7cfcd67991f0a6dc861847514e8d0fca2213fa8b | [
"MIT"
] | 5 | 2021-06-02T01:30:26.000Z | 2022-03-12T00:24:27.000Z | apps/comment/models.py | qq1788lover/my_blog | 7cfcd67991f0a6dc861847514e8d0fca2213fa8b | [
"MIT"
] | null | null | null | # django-ckeditor
# from ckeditor.fields import RichTextField
# django-mptt
#
| 40.714286 | 117 | 0.740351 | from django.db import models
from django.contrib.auth.models import User
from article.models import ArticlePost
# django-ckeditor
# from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
# django-mptt
from mptt.models import MPTTModel, TreeForeignKey
# 博文的评论
class Commen... | 147 | 0 | 0 | 766 | 0 | 0 | 0 | 112 | 132 |
70dc5ccb8c9fff90f926591a0f6bb044989fa3fa | 1,490 | py | Python | test_city.py | wang-xinyu/csp.pytorch | 8d5187358c1eb0fbf7ba5f184b9afed6c2518ad3 | [
"MIT"
] | 13 | 2020-03-29T13:35:55.000Z | 2021-04-11T10:45:53.000Z | test_city.py | wang-xinyu/csp.pytorch | 8d5187358c1eb0fbf7ba5f184b9afed6c2518ad3 | [
"MIT"
] | 2 | 2020-09-08T09:53:08.000Z | 2020-09-16T04:18:03.000Z | test_city.py | wang-xinyu/csp.pytorch | 8d5187358c1eb0fbf7ba5f184b9afed6c2518ad3 | [
"MIT"
] | 6 | 2020-05-24T21:49:17.000Z | 2021-07-06T09:14:42.000Z | import torch
import cv2
import numpy as np
import os
from models.cspnet import CSPNet_p3p4p5
from utils.keras_weights_loader import load_keras_weights
if __name__ == '__main__':
device = 'cuda:0'
weights_path = 'net_e121_l0.hdf5'
out_path = 'output/valresults/city/h/off/121'
input_dim = [1024, 2048]
... | 29.215686 | 102 | 0.599329 | import torch
import cv2
import numpy as np
import os
from models.cspnet import CSPNet_p3p4p5
from utils.keras_weights_loader import load_keras_weights
from utils.utils import *
if __name__ == '__main__':
device = 'cuda:0'
weights_path = 'net_e121_l0.hdf5'
out_path = 'output/valresults/city/h/off/121'
i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
ba2439d9eddd4585f46a35effe33046144c873b1 | 18 | py | Python | blockhash/constants.py | dsoprea/blockhash-python | bc322658d55c62b96255edc63ae05dbac7cf5ab7 | [
"MIT"
] | 3 | 2017-11-26T18:33:23.000Z | 2020-08-03T16:11:02.000Z | blockhash/constants.py | dsoprea/blockhash-python | bc322658d55c62b96255edc63ae05dbac7cf5ab7 | [
"MIT"
] | null | null | null | blockhash/constants.py | dsoprea/blockhash-python | bc322658d55c62b96255edc63ae05dbac7cf5ab7 | [
"MIT"
] | null | null | null | DEFAULT_BITS = 16
| 9 | 17 | 0.777778 | DEFAULT_BITS = 16
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
818414fc073b5bab726dc3956d8e5e9d22029c67 | 580 | py | Python | config/zuul/zuul_functions.py | javierpena/SF-DLRN-poc | 8b71e1b4a07caee0e3f079ce446d5bb84302e6a1 | [
"Apache-2.0"
] | null | null | null | config/zuul/zuul_functions.py | javierpena/SF-DLRN-poc | 8b71e1b4a07caee0e3f079ce446d5bb84302e6a1 | [
"Apache-2.0"
] | null | null | null | config/zuul/zuul_functions.py | javierpena/SF-DLRN-poc | 8b71e1b4a07caee0e3f079ce446d5bb84302e6a1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
| 32.222222 | 63 | 0.624138 | #!/usr/bin/python
def set_node_reuse(item, job, params):
print "zuul_functions: set_node_reuse(", item, job, "): "
params['OFFLINE_NODE_WHEN_COMPLETE'] = '0'
def set_node_options(item, job, params):
if job.name in ('config-check', 'config-update',
'sf-mirror-update',
... | 0 | 0 | 0 | 0 | 0 | 514 | 0 | 0 | 46 |
116cd4ba8597e8948b72678be0c30f5b943dca3f | 611 | py | Python | Desafio015.py | sidneyalex/Desafios-do-Curso | 11605caf59fb8b456adaca78a41eae2f7469ab7b | [
"MIT"
] | null | null | null | Desafio015.py | sidneyalex/Desafios-do-Curso | 11605caf59fb8b456adaca78a41eae2f7469ab7b | [
"MIT"
] | null | null | null | Desafio015.py | sidneyalex/Desafios-do-Curso | 11605caf59fb8b456adaca78a41eae2f7469ab7b | [
"MIT"
] | null | null | null | #Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preo a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado.
dias = int(input('Por quantos dias o carro foi alugado? '))
km = float(input('Quantos quilometr... | 61.1 | 225 | 0.682488 | #Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado.
dias = int(input('Por quantos dias o carro foi alugado? '))
km = float(input('Quantos quilomet... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d96aa39beae0b4f6ee0866534b868f4a600e92a9 | 63 | py | Python | 98_tools/training_ram/day2/ex14.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | 1 | 2020-05-11T18:39:54.000Z | 2020-05-11T18:39:54.000Z | 98_tools/training_ram/day2/ex14.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | null | null | null | 98_tools/training_ram/day2/ex14.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | null | null | null | s='Some text with spaces'
x=s.split()
{i:x.count(i) for i in x} | 21 | 25 | 0.650794 | s='Some text with spaces'
x=s.split()
{i:x.count(i) for i in x} | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
09163ecf781ce0d1e17ae2ffc234afc93fa21d10 | 518 | py | Python | examples/weather_data_extraction.py | spelap/sport-activities-features | c9d99b94509d8f0dd988b41be6ef45eec291ef7d | [
"MIT"
] | null | null | null | examples/weather_data_extraction.py | spelap/sport-activities-features | c9d99b94509d8f0dd988b41be6ef45eec291ef7d | [
"MIT"
] | null | null | null | examples/weather_data_extraction.py | spelap/sport-activities-features | c9d99b94509d8f0dd988b41be6ef45eec291ef7d | [
"MIT"
] | null | null | null | from sport_activities_features.weather_identification import WeatherIdentification
from sport_activities_features.tcx_manipulation import TCXFile
#read TCX file
tcx_file = TCXFile()
tcx_data = tcx_file.read_one_file("path_to_the_file")
#configure visual crossing api key
visual_crossing_api_key = "API_KEY" # https://w... | 39.846154 | 103 | 0.841699 | from sport_activities_features.weather_identification import WeatherIdentification
from sport_activities_features.tcx_manipulation import TCXFile
#read TCX file
tcx_file = TCXFile()
tcx_data = tcx_file.read_one_file("path_to_the_file")
#configure visual crossing api key
visual_crossing_api_key = "API_KEY" # https://w... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c768407e58ef331f29e4cf8bf8152406b9d9f5b4 | 27,330 | py | Python | teslakit/numerical_models/swan/io.py | teslakit/teslak | 3f3dda08c5c5998cb2a7debbf22f2be675a4ff8b | [
"MIT"
] | 12 | 2019-11-14T22:19:12.000Z | 2022-03-04T01:25:33.000Z | teslakit/numerical_models/swan/io.py | anderdyl/teslaCoSMoS | 1495bfa2364ddbacb802d145b456a35213abfb7c | [
"MIT"
] | 5 | 2020-03-24T18:21:41.000Z | 2021-08-23T20:39:43.000Z | teslakit/numerical_models/swan/io.py | anderdyl/teslaCoSMoS | 1495bfa2364ddbacb802d145b456a35213abfb7c | [
"MIT"
] | 2 | 2021-03-06T07:54:41.000Z | 2021-06-30T14:33:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from .geo import gc_distance
#AUX. FUNCTIONs
def geo_distance_azimuth(lat_matrix, lon_matrix, lat_point, lon_point):
'''
Returns geodesic distance and azimuth between lat,lon matrix and lat,lon
point in degrees
'''
arcl = np.zeros... | 33.248175 | 149 | 0.530809 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path as op
import shutil as su
from datetime import datetime
import numpy as np
import pandas as pd
import xarray as xr
from scipy.io import loadmat
from .geo import gc_distance
# AUX. FUNCTIONs
def geo_distance_azimuth(lat_matrix, lon_matrix, lat_p... | 36 | 0 | 0 | 26,416 | 0 | 0 | 0 | -4 | 224 |
ed273aa6cd016beba627f472a2c9db37c8bc9752 | 5,588 | py | Python | RL_testing_ground.py | sonic597/rl-testing-ground | c875ae640adb0de0dbe06aa152432aa0d49faed2 | [
"MIT"
] | null | null | null | RL_testing_ground.py | sonic597/rl-testing-ground | c875ae640adb0de0dbe06aa152432aa0d49faed2 | [
"MIT"
] | null | null | null | RL_testing_ground.py | sonic597/rl-testing-ground | c875ae640adb0de0dbe06aa152432aa0d49faed2 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
k = 100
iters = 1000
episodes = 50
eps_01_rewards = np.zeros(iters)
eps_1_rewards = np.zeros(iters)
eps_decay_rewards = np.zeros(iters)
ucb_rewards = np.zeros(iters)
for i in range(episodes):
random_test_list = [x for x in np.random.normal(0, 1, k)]
eps_0... | 38.013605 | 115 | 0.65247 | import numpy as np
import matplotlib.pyplot as plt
k = 100
iters = 1000
episodes = 50
class greedy_bandit:
def __init__(self, arms, elipson, iterations, avg_arm_rewards):
self.arms = arms
self.elipson = elipson
self.iterations = iterations
self.steps = 0
self.step_per_arm ... | 0 | 0 | 0 | 4,255 | 0 | 0 | 0 | 0 | 69 |
7c27aeb1bb208e81c2c11b9d2d0a8d3764e5179a | 68,168 | py | Python | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | jubick1337/NeMo | 9d50733ba0e698b98d0019e9e697686e0a24b90e | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | jubick1337/NeMo | 9d50733ba0e698b98d0019e9e697686e0a24b90e | [
"Apache-2.0"
] | 1 | 2022-03-06T14:09:02.000Z | 2022-03-06T14:09:02.000Z | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | jubick1337/NeMo | 9d50733ba0e698b98d0019e9e697686e0a24b90e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 49.147801 | 254 | 0.640594 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 40,864 | 0 | 24,770 | 0 | 0 | 0 | 1,120 | 774 |
ef3cd10a2068b30a9a75bed4bcdf212132ef1fe0 | 2,429 | py | Python | tests/xoto3/utils/oncall_default_test.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 16 | 2020-05-23T15:23:38.000Z | 2022-03-18T19:28:37.000Z | tests/xoto3/utils/oncall_default_test.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 9 | 2020-08-19T23:08:36.000Z | 2021-10-06T17:16:35.000Z | tests/xoto3/utils/oncall_default_test.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 2 | 2020-12-12T08:23:53.000Z | 2021-09-03T20:25:54.000Z | # pylint: disable=unused-argument,unused-variable
from datetime import datetime
import pytest
from xoto3.utils.oncall_default import NotSafeToDefaultError, OnCallDefault
utcnow = OnCallDefault(datetime.utcnow)
def test_disallow_positional_without_default():
"""A positional-possible argument without a defaul... | 26.692308 | 75 | 0.650473 | # pylint: disable=unused-argument,unused-variable
from datetime import datetime
import pytest
from xoto3.utils.oncall_default import NotSafeToDefaultError, OnCallDefault
utcnow = OnCallDefault(datetime.utcnow)
def test_oncall_default_works_with_pos_or_kw():
@utcnow.apply_to("when")
def final(a: str, when: ... | 0 | 469 | 0 | 0 | 0 | 1,211 | 0 | 0 | 169 |
9359e5c4e3e3bd39554fe97f058252575fbac126 | 4,385 | py | Python | pointcloud/sample_points.py | ziyedy/category-priornet | 5aa080eeff936ce3939f0d5458a2936677c15726 | [
"MIT"
] | 72 | 2020-06-11T13:06:56.000Z | 2021-12-07T02:57:51.000Z | pointcloud/sample_points.py | ziyedy/category-priornet | 5aa080eeff936ce3939f0d5458a2936677c15726 | [
"MIT"
] | 8 | 2020-07-24T09:13:14.000Z | 2021-07-02T06:55:25.000Z | pointcloud/sample_points.py | ziyedy/category-priornet | 5aa080eeff936ce3939f0d5458a2936677c15726 | [
"MIT"
] | 11 | 2020-03-13T12:44:44.000Z | 2021-05-12T05:13:26.000Z |
if __name__ == '__main__':
main()
| 40.981308 | 122 | 0.618472 | import os
import sys
import argparse
import numpy as np
import pandas as pd
from pyntcloud.io import write_ply
def get_skip_vertice_face_num(path):
with open(path) as file:
for i, line in enumerate(file):
if i == 0 and len(line) > 4: # not just "OFF\n"
digits = line[3:].split(" ... | 0 | 0 | 0 | 0 | 0 | 4,120 | 0 | -21 | 247 |
c762f4be6db752ec413c9782ce94a363b079178f | 3,915 | py | Python | xquotient/test/test_signup.py | twisted/quotient | 95f2515219da99a77905852bc01deeb27e93466e | [
"MIT"
] | 6 | 2016-02-15T07:33:39.000Z | 2018-12-03T17:20:58.000Z | xquotient/test/test_signup.py | DalavanCloud/quotient | 95f2515219da99a77905852bc01deeb27e93466e | [
"MIT"
] | 1 | 2021-02-18T20:01:02.000Z | 2021-02-18T20:01:02.000Z | xquotient/test/test_signup.py | DalavanCloud/quotient | 95f2515219da99a77905852bc01deeb27e93466e | [
"MIT"
] | 4 | 2015-11-15T17:28:20.000Z | 2018-12-03T17:20:48.000Z | """
Test installation of the Quotient offering, as well as testing
signup with different combinations of selected benefactor factories
"""
| 32.625 | 92 | 0.662835 | """
Test installation of the Quotient offering, as well as testing
signup with different combinations of selected benefactor factories
"""
from time import time
from twisted.trial.unittest import TestCase
from twisted.python.reflect import qual
from axiom.scripts import axiomatic
from axiom.store import Store
from a... | 0 | 0 | 0 | 2,339 | 0 | 864 | 0 | 190 | 383 |
b26bad7359609958551c3b742dcd0172c900dc22 | 138,774 | py | Python | blackfynn/models.py | Blackfynn/blackfynn-python | ab982e63f2cfe68d41ae269a59da629fec90bf68 | [
"Apache-2.0"
] | 6 | 2018-01-05T16:38:11.000Z | 2020-06-03T00:28:04.000Z | blackfynn/models.py | Blackfynn/blackfynn-python | ab982e63f2cfe68d41ae269a59da629fec90bf68 | [
"Apache-2.0"
] | 119 | 2018-03-07T18:32:58.000Z | 2021-02-03T16:10:55.000Z | blackfynn/models.py | Blackfynn/blackfynn-python | ab982e63f2cfe68d41ae269a59da629fec90bf68 | [
"Apache-2.0"
] | 6 | 2018-01-19T17:09:31.000Z | 2021-03-10T21:46:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from future.utils import PY2, string_types
import datetime
try: # Python 3
from inspect import getfullargspec
except ImportError: # Python 2
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Helpers
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ... | 30.14205 | 133 | 0.557893 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from builtins import object, zip
from future.utils import PY2, as_native_str, string_types
import datetime
import io
import os
import re
import sys
from uuid import uuid4
import dateutil
import pytz
import requests
from dateutil.... | 0 | 24,648 | 0 | 106,871 | 0 | 922 | 0 | 144 | 1,588 |
ff45a14b78903909a6ffd1b4566901c7dab86a97 | 3,024 | py | Python | api/tests/cards/test_card_read.py | onecrayon/api.ashes.live | 72709fb4e53220aa9b48749a51f5b834ebb2ca42 | [
"0BSD"
] | 11 | 2020-09-13T16:49:21.000Z | 2021-07-29T06:17:58.000Z | api/tests/cards/test_card_read.py | onecrayon/api.ashes.live | 72709fb4e53220aa9b48749a51f5b834ebb2ca42 | [
"0BSD"
] | 49 | 2020-09-11T05:23:02.000Z | 2022-03-02T18:31:00.000Z | api/tests/cards/test_card_read.py | onecrayon/api.ashes.live | 72709fb4e53220aa9b48749a51f5b834ebb2ca42 | [
"0BSD"
] | 1 | 2022-03-27T22:11:29.000Z | 2022-03-27T22:11:29.000Z | from fastapi import status
from fastapi.testclient import TestClient
from api import db
from api.models import Card
def test_get_legacy_card(client: TestClient, session: db.Session):
"""Must be able to read JSON for a legacy card"""
# This is handled by a migration normally (legacy cards can't normally be cr... | 39.789474 | 98 | 0.737765 | from fastapi import status
from fastapi.testclient import TestClient
from api import db
from api.models import Card
def test_get_legacy_card(client: TestClient, session: db.Session):
"""Must be able to read JSON for a legacy card"""
# This is handled by a migration normally (legacy cards can't normally be cr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
793d046d209b11ed4917626afa99782cc07d3bdf | 13,796 | py | Python | cbm/foi/foi_v1.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/foi/foi_v1.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/foi/foi_v1.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Gilbert Voican, Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import psycopg2
# from psycopg2... | 40.696165 | 100 | 0.683531 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Gilbert Voican, Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import psycopg2
# from psycopg2... | 6 | 0 | 0 | 0 | 0 | 196 | 0 | 0 | 27 |
e549886f38a359ea6d5cf82b0fcbe44d7f043c7e | 3,657 | py | Python | laylm/trainer/task.py | nunenuh/layoutlm.pytorch | 30853b0a37247b5463836156d9f345d84da050f0 | [
"MIT"
] | 1 | 2021-01-25T16:31:54.000Z | 2021-01-25T16:31:54.000Z | laylm/trainer/task.py | nunenuh/layoutlm.pytorch | 30853b0a37247b5463836156d9f345d84da050f0 | [
"MIT"
] | null | null | null | laylm/trainer/task.py | nunenuh/layoutlm.pytorch | 30853b0a37247b5463836156d9f345d84da050f0 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.optim as optim
| 33.550459 | 104 | 0.570686 | import torch
import torch.nn as nn
import torch.optim as optim
from transformers import (
AdamW,
get_linear_schedule_with_warmup,
)
from .metrics import FullMetrics
import pytorch_lightning as pl
from pytorch_lightning import loggers as pl_loggers
class TaskLayoutLM(pl.LightningModule):
def __init__(sel... | 0 | 0 | 0 | 3,371 | 0 | 0 | 0 | 96 | 135 |
85c4f894595399211d734bb79e045b6413317d18 | 557 | py | Python | 2020/Day_10/part1.py | Adilius/adventofcode | d0d3ad1a0430c3732d108ad8ef2b4d218a37944b | [
"MIT"
] | 2 | 2020-12-01T14:50:51.000Z | 2020-12-03T17:08:43.000Z | 2020/Day_10/part1.py | Adilius/adventofcode | d0d3ad1a0430c3732d108ad8ef2b4d218a37944b | [
"MIT"
] | null | null | null | 2020/Day_10/part1.py | Adilius/adventofcode | d0d3ad1a0430c3732d108ad8ef2b4d218a37944b | [
"MIT"
] | null | null | null | input_file = open("input.txt", "r")
lines = input_file.read().splitlines() #Read whole file, split by newlines
lines = [int(i) for i in lines]
lines.sort()
lines.append(lines[-1]+3)
oneDifference = 0
threeDifference = 0
previousJoltage = 0
for outlet in lines:
if outlet - 3 == previousJoltage:
threeDiffer... | 26.52381 | 75 | 0.709156 | input_file = open("input.txt", "r")
lines = input_file.read().splitlines() #Read whole file, split by newlines
lines = [int(i) for i in lines]
lines.sort()
lines.append(lines[-1]+3)
oneDifference = 0
threeDifference = 0
previousJoltage = 0
for outlet in lines:
if outlet - 3 == previousJoltage:
threeDiffer... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e82f452914c75b9c2ebe56457a4ddeef9877b340 | 1,231 | py | Python | yeti.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | null | null | null | yeti.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | null | null | null | yeti.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | 1 | 2021-11-16T13:21:56.000Z | 2021-11-16T13:21:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logging.basicConfig(format='%(levelname)s:%(module)s:%(message)s', level=logging.ERROR)
COMMANDS = {
'webserver': webserver,
'syncdb': syncdb,
}
if __name__ == '__main__':
main()
| 25.122449 | 112 | 0.682372 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import argparse
from core.web import webapp
logging.basicConfig(format='%(levelname)s:%(module)s:%(message)s', level=logging.ERROR)
def webserver(args):
# Enable debug and autoreload in dev
webapp.debug = args.debug
if webapp.debug:
w... | 0 | 0 | 0 | 0 | 0 | 858 | 0 | 0 | 114 |
d4dc1d4acf798618eb4e02139f69296e021d2d15 | 1,261 | py | Python | main.py | MunityVR/Game | d22f3dcf8a394eca26cf90d4be38b6c328c8e707 | [
"CC0-1.0"
] | null | null | null | main.py | MunityVR/Game | d22f3dcf8a394eca26cf90d4be38b6c328c8e707 | [
"CC0-1.0"
] | null | null | null | main.py | MunityVR/Game | d22f3dcf8a394eca26cf90d4be38b6c328c8e707 | [
"CC0-1.0"
] | null | null | null | # Spaces
minsp = 0
maxsp = 500
# Admin's configuration
print("Hey Admin!")
sw = str(input("Make up a word : "))
guesses = float(input("How many guesses should the user have : "))
h = str(input("Do you want to give the user a hint? y/n : "))
guess = ''
gc = 0
# Admin's hint
if h == 'y':
hint = str(input("What hin... | 24.25 | 101 | 0.547978 | # Spaces
minsp = 0
maxsp = 500
# Admin's configuration
print("Hey Admin!")
sw = str(input("Make up a word : "))
guesses = float(input("How many guesses should the user have : "))
h = str(input("Do you want to give the user a hint? y/n : "))
guess = ''
gc = 0
# Admin's hint
if h == 'y':
hint = str(input("What hin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
185a70f8f9c5531ed16ad5da0552a6bd1da2bbad | 4,294 | py | Python | pycspr/client/events.py | MrKrautee/casper-python-sdk | 13e9da83de8892583da7ada91e4231e6f85e5e13 | [
"Apache-2.0"
] | 2 | 2021-10-05T07:50:20.000Z | 2021-10-06T09:58:19.000Z | pycspr/client/events.py | MrKrautee/casper-python-sdk | 13e9da83de8892583da7ada91e4231e6f85e5e13 | [
"Apache-2.0"
] | null | null | null | pycspr/client/events.py | MrKrautee/casper-python-sdk | 13e9da83de8892583da7ada91e4231e6f85e5e13 | [
"Apache-2.0"
] | null | null | null |
# Map: channel type <-> event type.
_CHANNEL_TO_TYPE = {
NodeSseChannelType.deploys: {
NodeSseEventType.ApiVersion,
NodeSseEventType.DeployAccepted
},
NodeSseChannelType.main: {
NodeSseEventType.ApiVersion,
NodeSseEventType.BlockAdded,
NodeSseEventType.DeployProce... | 34.629032 | 78 | 0.62599 | import enum
import requests
import sseclient
from json import loads
from typing import Callable
from typing import Generator
from typing import Tuple
from pycspr.api import NodeConnectionInfo
class NodeSseChannelType(enum.Enum):
""" Enumeration over set of exposed node SEE event types. """
deploys = enum.aut... | 0 | 0 | 0 | 3,517 | 0 | 0 | 0 | 16 | 246 |
562a96982f8632cd52e3eb1b793d70b9c95e52cb | 2,400 | py | Python | truck_microservice/truck/models.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck/models.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck/models.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | # library imports
# property imports
# import socket # Koennte die richtige Loesung sein...
| 37.5 | 135 | 0.737083 | # library imports
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
# property imports
from .properties import *
class TruckEntity(models.Model):
# Params
id = models.PositiveIntegerField(default=ID, primary_key=True)
address = models.TextField(default=AD... | 0 | 176 | 0 | 1,980 | 0 | 0 | 0 | 61 | 89 |
96a9acf8dbfedc8c99c78a3eb9a85b6b5ebf731b | 1,106 | py | Python | x1/append_nop.py | pepepper/lab | 63b15a9455681353560b176256b59715a44aa6e0 | [
"CC0-1.0"
] | null | null | null | x1/append_nop.py | pepepper/lab | 63b15a9455681353560b176256b59715a44aa6e0 | [
"CC0-1.0"
] | 1 | 2021-06-28T06:30:13.000Z | 2021-06-28T06:30:13.000Z | x1/append_nop.py | pepepper/lab | 63b15a9455681353560b176256b59715a44aa6e0 | [
"CC0-1.0"
] | 1 | 2021-06-27T20:36:07.000Z | 2021-06-27T20:36:07.000Z | #!/usr/bin/env python3
main()
| 30.722222 | 139 | 0.512658 | #!/usr/bin/env python3
import sys
def main():
if len(sys.argv) < 5:
print(f'Usage: {sys.argv[0]} top.bin bottom_loop.bin bottom_reset.bin out.bin reset_fill_from reset_fill_to', file=sys.stderr)
sys.exit(1)
with open(sys.argv[1], 'rb') as tf, open(sys.argv[2], 'rb') as btmlf, open(sys.argv[3... | 0 | 0 | 0 | 0 | 0 | 1,038 | 0 | -11 | 46 |
818ccd30f153dce67753185ecd7905c078fbf3f3 | 4,310 | py | Python | tests/test_task.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | tests/test_task.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | tests/test_task.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | import unittest
TASKS = ['hello world',
'I hate VMware',
'me too',
'This is a very long task name, a very very long name',
'school sucks',
'one more',
'last one']
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testHosts']
unittest.main()
| 35.04065 | 91 | 0.655452 | import unittest, types
from pyvisdk import Vim
from tests.common import get_options
from pyvisdk.facade.task import TaskManager
def nothing():
pass
def random_string(n):
import random
import string
return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(n))
TASKS = ['hello... | 0 | 520 | 0 | 3,127 | 0 | 130 | 0 | 46 | 170 |
30eaa2105d07e43d9a8ec898704e63e5994f330e | 12,680 | py | Python | MyUtils/ImageProcessing.py | mairob/Semantic-segmentation-and-Depth-estimation | d9624cdbde000a0c41e1025f89aa6edfdf947045 | [
"MIT"
] | 6 | 2018-06-15T21:18:58.000Z | 2021-07-05T08:41:21.000Z | MyUtils/ImageProcessing.py | mairob/Semantic-segmentation-and-Depth-estimation | d9624cdbde000a0c41e1025f89aa6edfdf947045 | [
"MIT"
] | null | null | null | MyUtils/ImageProcessing.py | mairob/Semantic-segmentation-and-Depth-estimation | d9624cdbde000a0c41e1025f89aa6edfdf947045 | [
"MIT"
] | 4 | 2018-06-15T21:19:08.000Z | 2021-07-05T08:41:23.000Z | #! /usr/bin/python3
#############################################################
### Helper File for TFRecords and Image manipulation ########
#############################################################
import tensorflow as tf
import numpy as np
## Label mapping for Cityscapes (34 classes)
Cityscapes34_I... | 44.181185 | 133 | 0.593612 | #! /usr/bin/python3
#############################################################
### Helper File for TFRecords and Image manipulation ########
#############################################################
import tensorflow as tf
import numpy as np
## Label mapping for Cityscapes (34 classes)
Cityscapes34_I... | 0 | 0 | 0 | 0 | 0 | 2,685 | 0 | 0 | 75 |
6ea46e439fa32f14f73fb96fd66ffd82937d8f5e | 3,149 | py | Python | analyser/analyser.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | analyser/analyser.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | analyser/analyser.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | import data_connector.model_sentence
import data_connector.model_word
import sys
sys.path.append("../")
| 36.616279 | 119 | 0.58463 | import analyser.caption_factory
import data_connector.model_sentence
import data_connector.model_word
import data_connector.data_manager
from xml.etree.ElementTree import *
import re
import sys
sys.path.append("../")
from log_writer import LogWriter
class Analyser:
@property
def sentence_list(self):
... | 180 | 232 | 0 | 2,583 | 0 | 0 | 0 | 36 | 133 |
90c849bc94c70a99e4e373256b50144ecdba6cd3 | 13,498 | py | Python | python38/Lib/site-packages/openpyxl/reader/worksheet.py | alextusinean/TikTokCommentScraper | 94ae7d5e20129f33a18857197794758b62909b22 | [
"MIT"
] | 28 | 2021-07-23T16:08:55.000Z | 2022-03-15T16:19:32.000Z | python38/Lib/site-packages/openpyxl/reader/worksheet.py | alextusinean/TikTokCommentScraper | 94ae7d5e20129f33a18857197794758b62909b22 | [
"MIT"
] | 4 | 2021-10-08T03:28:30.000Z | 2022-02-08T13:01:40.000Z | python38/Lib/site-packages/openpyxl/reader/worksheet.py | alextusinean/TikTokCommentScraper | 94ae7d5e20129f33a18857197794758b62909b22 | [
"MIT"
] | 11 | 2021-07-15T04:40:27.000Z | 2022-03-19T14:01:12.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Reader for a single worksheet."""
from io import BytesIO
# compatibility imports
# package imports
from openpyxl.worksheet import Worksheet
from openpyxl.worksheet.iter_worksheet import IterableWorksheet
def _get_xml_iter(xml_source):
... | 41.027356 | 106 | 0.602682 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Reader for a single worksheet."""
from io import BytesIO
# compatibility imports
from openpyxl.xml.functions import iterparse
# package imports
from openpyxl.cell import Cell
from openpyxl.worksheet import Worksheet, ColumnDimension, RowDim... | 0 | 0 | 0 | 11,371 | 0 | 194 | 0 | 408 | 288 |
86cd014089a67861caf0503440063d428b748d8d | 6,297 | py | Python | tutorials/tutorial_4_adding_a_dataset.py | AliAbdulHussain/moabb | d308f024636802c21b06726457ce5ddacd418e16 | [
"BSD-3-Clause"
] | null | null | null | tutorials/tutorial_4_adding_a_dataset.py | AliAbdulHussain/moabb | d308f024636802c21b06726457ce5ddacd418e16 | [
"BSD-3-Clause"
] | null | null | null | tutorials/tutorial_4_adding_a_dataset.py | AliAbdulHussain/moabb | d308f024636802c21b06726457ce5ddacd418e16 | [
"BSD-3-Clause"
] | null | null | null | """
=================================
Creating a dataset class in MOABB
=================================
"""
# Authors: Pedro L. C. Rodrigues, Sylvain Chevallier
#
# https://github.com/plcrodrigues/Workshop-MOABB-BCI-Graz-2019
import numpy as np
from scipy.io import savemat
from moabb.paradigms import Left... | 37.706587 | 143 | 0.610767 | """
=================================
Creating a dataset class in MOABB
=================================
"""
# Authors: Pedro L. C. Rodrigues, Sylvain Chevallier
#
# https://github.com/plcrodrigues/Workshop-MOABB-BCI-Graz-2019
import numpy as np
from scipy.io import savemat, loadmat
import mne
from moab... | 0 | 0 | 0 | 1,542 | 0 | 0 | 0 | 40 | 95 |
f4f59e9616efbd52c782c87011c67a4852f64da0 | 486 | py | Python | test/sqlalchemy_filterparams_tests/database_test.py | cbrand/python-sqlalchemy-filterparams | 6e555cfe9e2f0f2c5f6d6606485de50bc76aaf73 | [
"MIT"
] | 2 | 2016-02-24T03:07:26.000Z | 2016-05-22T22:00:40.000Z | test/sqlalchemy_filterparams_tests/database_test.py | cbrand/python-sqlalchemy-filterparams | 6e555cfe9e2f0f2c5f6d6606485de50bc76aaf73 | [
"MIT"
] | null | null | null | test/sqlalchemy_filterparams_tests/database_test.py | cbrand/python-sqlalchemy-filterparams | 6e555cfe9e2f0f2c5f6d6606485de50bc76aaf73 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
| 20.25 | 50 | 0.713992 | # -*- encoding: utf-8 -*-
from unittest import TestCase
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy_filterparams_tests.models import (
Base,
)
class BaseDatabaseTest(TestCase):
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engi... | 0 | 0 | 0 | 263 | 0 | 0 | 0 | 82 | 113 |
49aaf3536a9b3013f2535a7951571b5299a8099f | 604 | py | Python | heisen/core/__init__.py | HeisenCore/heisen | 0cd4d27822960553a8e83a72c7dfeefa76e65c06 | [
"MIT"
] | 5 | 2016-08-30T07:51:08.000Z | 2021-09-13T11:30:05.000Z | heisen/core/__init__.py | HeisenCore/heisen | 0cd4d27822960553a8e83a72c7dfeefa76e65c06 | [
"MIT"
] | 15 | 2016-09-15T19:21:24.000Z | 2016-10-22T16:22:15.000Z | heisen/core/__init__.py | HeisenCore/heisen | 0cd4d27822960553a8e83a72c7dfeefa76e65c06 | [
"MIT"
] | null | null | null |
rpc_call = get_rpc_connection()
| 27.454545 | 80 | 0.692053 | from heisen.config import settings
from jsonrpclib.request import ConnectionPool
def get_rpc_connection():
if settings.CREDENTIALS:
username, passowrd = settings.CREDENTIALS[0]
else:
username = passowrd = None
servers = {'self': []}
for instance_number in range(settings.INSTANCE_COUNT... | 0 | 0 | 0 | 0 | 0 | 465 | 0 | 37 | 67 |
5bc89390a9afb112693a9caadb722ffe80a659c2 | 1,331 | py | Python | pytition/petition/management/commands/update.py | lpoujade/Pytition | b66a4b358dc4e7dc368ec30e34e124f21920371e | [
"BSD-3-Clause"
] | 1 | 2020-08-13T23:01:48.000Z | 2020-08-13T23:01:48.000Z | pytition/petition/management/commands/update.py | lpoujade/Pytition | b66a4b358dc4e7dc368ec30e34e124f21920371e | [
"BSD-3-Clause"
] | 14 | 2020-08-05T17:27:54.000Z | 2020-09-25T02:11:32.000Z | pytition/petition/management/commands/update.py | lpoujade/Pytition | b66a4b358dc4e7dc368ec30e34e124f21920371e | [
"BSD-3-Clause"
] | null | null | null | import subprocess
from functools import partial
run = partial(subprocess.run, shell=True, check=True)
| 34.128205 | 156 | 0.593539 | import subprocess
from functools import partial
from django.core.management.base import BaseCommand
from django.conf import settings
from pathlib import Path
import os
run = partial(subprocess.run, shell=True, check=True)
class Command(BaseCommand):
"""Update pytition install
"""
def handle(self, *args,... | 0 | 0 | 0 | 1,084 | 0 | 0 | 0 | 32 | 111 |
d8a9231416df4329b68705f67027a39e5c572589 | 3,401 | py | Python | bcml4pheno/ttbarzp.py | sheride/bcml4pheno | c9629dafcdbee0a4c28ceb7b28c9862de8479a24 | [
"Apache-2.0"
] | null | null | null | bcml4pheno/ttbarzp.py | sheride/bcml4pheno | c9629dafcdbee0a4c28ceb7b28c9862de8479a24 | [
"Apache-2.0"
] | null | null | null | bcml4pheno/ttbarzp.py | sheride/bcml4pheno | c9629dafcdbee0a4c28ceb7b28c9862de8479a24 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: ttbarzp.ipynb (unless otherwise specified).
__all__ = ['get_elijah_ttbarzp_cs', 'get_manuel_ttbarzp_cs', 'import47Ddata', 'get47Dfeatures']
# Cell
import numpy as np
import tensorflow as tf
# Cell
def get_elijah_ttbarzp_cs():
r"""
Contains cross section information... | 41.987654 | 121 | 0.614525 | # AUTOGENERATED! DO NOT EDIT! File to edit: ttbarzp.ipynb (unless otherwise specified).
__all__ = ['get_elijah_ttbarzp_cs', 'get_manuel_ttbarzp_cs', 'import47Ddata', 'get47Dfeatures']
# Cell
import numpy as np
import tensorflow as tf
# Cell
def get_elijah_ttbarzp_cs():
r"""
Contains cross section information... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
27d6a8f043d6d02fb9eb37d08984a8c17e445752 | 457 | py | Python | backend_application/app/wikisearch/migrations/0005_article_urls.py | cdeler/woogle | 5774ce380947734bf0ed82bd27cdc5359bc1a646 | [
"MIT"
] | null | null | null | backend_application/app/wikisearch/migrations/0005_article_urls.py | cdeler/woogle | 5774ce380947734bf0ed82bd27cdc5359bc1a646 | [
"MIT"
] | 54 | 2018-07-05T13:39:48.000Z | 2018-09-24T09:58:40.000Z | backend_application/app/wikisearch/migrations/0005_article_urls.py | cdeler/woogle | 5774ce380947734bf0ed82bd27cdc5359bc1a646 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-08-06 02:02
| 24.052632 | 121 | 0.621444 | # Generated by Django 2.0.7 on 2018-08-06 02:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wikisearch', '0004_auto_20180730_2216'),
]
operations = [
migrations.AddField(
model_name='article',
name='urls',
... | 0 | 0 | 0 | 343 | 0 | 0 | 0 | 19 | 46 |
aa0c45fc09b8a64070231bbbba2d3e138ed5f826 | 1,172 | py | Python | setup.py | EKT/pyrundeck | cfc5140d6ef336a54efcf1915df202ff35a7a492 | [
"BSD-3-Clause"
] | 2 | 2016-10-19T07:26:27.000Z | 2021-02-04T10:26:15.000Z | setup.py | EKT/pyrundeck | cfc5140d6ef336a54efcf1915df202ff35a7a492 | [
"BSD-3-Clause"
] | null | null | null | setup.py | EKT/pyrundeck | cfc5140d6ef336a54efcf1915df202ff35a7a492 | [
"BSD-3-Clause"
] | 2 | 2016-10-19T07:26:35.000Z | 2017-07-24T10:14:29.000Z | from setuptools import setup, find_packages
setup(
name="PyRundeck",
version="0.3.7",
description="A thin, pure Python wrapper for the Rundeck API",
author="Panagiotis Koutsourakis",
author_email="kutsurak@ekt.gr",
license='BSD',
url='https://github.com/EKT/pyrundeck',
classifiers=[
... | 33.485714 | 71 | 0.583618 | from setuptools import setup, find_packages
setup(
name="PyRundeck",
version="0.3.7",
description="A thin, pure Python wrapper for the Rundeck API",
author="Panagiotis Koutsourakis",
author_email="kutsurak@ekt.gr",
license='BSD',
url='https://github.com/EKT/pyrundeck',
classifiers=[
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
335a7affe187d0655121af5cae9cd6180241399b | 3,928 | py | Python | src/product/migrations/0001_initial.py | gabriel-gn/magalu-favorites-api | c9e2e3c6752530272198ef8c12357016149c1d34 | [
"MIT"
] | null | null | null | src/product/migrations/0001_initial.py | gabriel-gn/magalu-favorites-api | c9e2e3c6752530272198ef8c12357016149c1d34 | [
"MIT"
] | null | null | null | src/product/migrations/0001_initial.py | gabriel-gn/magalu-favorites-api | c9e2e3c6752530272198ef8c12357016149c1d34 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.2 on 2021-05-16 03:23
import django.core.validators
| 46.761905 | 176 | 0.580193 | # Generated by Django 3.2.2 on 2021-05-16 03:23
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | 6 | 0 | 0 | 3,715 | 0 | 0 | 0 | 41 | 90 |
2ccf31155892bd9aa8de51d4885b66f2bda3d3f0 | 12,401 | py | Python | pysnmp/APPN-DLUR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/APPN-DLUR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/APPN-DLUR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module APPN-DLUR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APPN-DLUR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 127.845361 | 1,703 | 0.756149 | #
# PySNMP MIB module APPN-DLUR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APPN-DLUR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43c22f960b133202f8a7111b1fe3f2235264bfa8 | 136 | py | Python | planning/urls.py | essanpupil/moneytracker | 506424ff287d4c093430e93169fedb7ee7da34f7 | [
"MIT"
] | null | null | null | planning/urls.py | essanpupil/moneytracker | 506424ff287d4c093430e93169fedb7ee7da34f7 | [
"MIT"
] | null | null | null | planning/urls.py | essanpupil/moneytracker | 506424ff287d4c093430e93169fedb7ee7da34f7 | [
"MIT"
] | null | null | null | from django.urls import path
from planning.views import main
app_name = 'planning'
urlpatterns = [
path('', main, name='main'),
]
| 15.111111 | 32 | 0.691176 | from django.urls import path
from planning.views import main
app_name = 'planning'
urlpatterns = [
path('', main, name='main'),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
838292766d385db372fa0d4af4505071b2dc24b9 | 610 | py | Python | baseConverter.py | Alex0Blackwell/python-projects | 2abb51d1267913bcdd4807e1a10b931c90eb1bef | [
"MIT"
] | 2 | 2019-11-13T17:45:53.000Z | 2020-02-23T02:25:30.000Z | baseConverter.py | Alex0Blackwell/python-projects | 2abb51d1267913bcdd4807e1a10b931c90eb1bef | [
"MIT"
] | null | null | null | baseConverter.py | Alex0Blackwell/python-projects | 2abb51d1267913bcdd4807e1a10b931c90eb1bef | [
"MIT"
] | null | null | null | # Base conversion algorithm
# Fastest way to convert bases
# Note this does it in reverse so the strings and the strings elements
# must be reversed
usrNum = int(input("Enter a number to convert:\n"))
usrBase = int(input("Enter a base:\n"))
print(baseConvert(usrNum, usrBase))
| 27.727273 | 77 | 0.639344 | # Base conversion algorithm
# Fastest way to convert bases
# Note this does it in reverse so the strings and the strings elements
# must be reversed
def baseConvert(num, base):
# Given a number and a base to convert to
res = ''
q = num
while(q > 0):
r = q % base
# Reverse string becaus... | 0 | 0 | 0 | 0 | 0 | 307 | 0 | 0 | 23 |
0ed91efc5dacfde2c285ab9386a5f5ce32dd3da1 | 1,785 | py | Python | backend/classification/features/extraction.py | PolyCortex/polydodo | 473d5a8b89e9bdb68ba9592241e45d30b86b471c | [
"MIT"
] | 13 | 2020-06-02T03:17:10.000Z | 2022-03-23T04:06:52.000Z | backend/classification/features/extraction.py | PolyCortex/polydodo | 473d5a8b89e9bdb68ba9592241e45d30b86b471c | [
"MIT"
] | 43 | 2020-07-15T04:21:06.000Z | 2022-03-06T00:32:19.000Z | backend/classification/features/extraction.py | PolyCortex/polydodo | 473d5a8b89e9bdb68ba9592241e45d30b86b471c | [
"MIT"
] | 2 | 2020-12-27T07:21:18.000Z | 2021-09-16T20:06:47.000Z | """Feature extraction tools based off a two channel EEG recording"""
import numpy as np
from classification.config.constants import (EEG_CHANNELS, AGE_FEATURE_BINS)
from classification.features.pipeline import get_feature_union
def get_eeg_features(epochs, in_bed_seconds, out_of_bed_seconds):
"""Returns the cont... | 30.775862 | 75 | 0.707003 | """Feature extraction tools based off a two channel EEG recording"""
import numpy as np
from classification.config.constants import (
EEG_CHANNELS,
AGE_FEATURE_BINS,
)
from classification.features.pipeline import get_feature_union
def get_eeg_features(epochs, in_bed_seconds, out_of_bed_seconds):
"""Retur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 |
f052b9fc28af42e699049bdfe2b0ac01d467c316 | 187 | py | Python | user_details/give_default.py | Shreyanshsachan/College-Predictor | 87068aa1d1a889ced586ff155bc2b5d9a78340f7 | [
"MIT"
] | null | null | null | user_details/give_default.py | Shreyanshsachan/College-Predictor | 87068aa1d1a889ced586ff155bc2b5d9a78340f7 | [
"MIT"
] | null | null | null | user_details/give_default.py | Shreyanshsachan/College-Predictor | 87068aa1d1a889ced586ff155bc2b5d9a78340f7 | [
"MIT"
] | null | null | null | preference_list_of_user=[] | 20.777778 | 31 | 0.84492 | preference_list_of_user=[]
def give(def_list):
Def=def_list
global preference_list_of_user
preference_list_of_user=Def
return Def
def give_to_model():
return preference_list_of_user | 0 | 0 | 0 | 0 | 0 | 116 | 0 | 0 | 45 |
58988f8f98d9e6ccb12c9b0191a886bc9755df2f | 669 | py | Python | OPTED2fiveletter.py | caranha/wordle_helper | 731259e14f704a48bd84f528085dc8a70898adee | [
"RSA-MD"
] | null | null | null | OPTED2fiveletter.py | caranha/wordle_helper | 731259e14f704a48bd84f528085dc8a70898adee | [
"RSA-MD"
] | null | null | null | OPTED2fiveletter.py | caranha/wordle_helper | 731259e14f704a48bd84f528085dc8a70898adee | [
"RSA-MD"
] | null | null | null | import re
from bs4 import BeautifulSoup
from string import ascii_lowercase
base_file = "OPTED/words_X.html"
fiveletter = []
for letter in ascii_lowercase:
file = base_file.replace("X",letter)
with open(file, "r") as f:
html = f.read()
words = BeautifulSoup(html, "html.parser").find_all("b")
... | 22.3 | 60 | 0.617339 | import os
import re
from bs4 import BeautifulSoup
from string import ascii_lowercase
base_file = "OPTED/words_X.html"
fiveletter = []
for letter in ascii_lowercase:
file = base_file.replace("X",letter)
with open(file, "r") as f:
html = f.read()
words = BeautifulSoup(html, "html.parser").find_al... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
4861261a51c5c31e103d20e20adeece80de4bce7 | 1,198 | py | Python | rotate/ciphers.py | Noxell-zs/ROT13 | 36f1b788616979d6644448e0a8cc728bb2c15ad9 | [
"MIT"
] | null | null | null | rotate/ciphers.py | Noxell-zs/ROT13 | 36f1b788616979d6644448e0a8cc728bb2c15ad9 | [
"MIT"
] | null | null | null | rotate/ciphers.py | Noxell-zs/ROT13 | 36f1b788616979d6644448e0a8cc728bb2c15ad9 | [
"MIT"
] | null | null | null | """Realization of algorithms for char-by-char text encryption.
Functions:
rot_13(str) -> str
Character offset by 13 positions.
caesar_1(str) -> str
Character offset by 1 position.
"""
def rot_13(char_in: str) -> str:
"""Character offset by 13 positions.
Parameters:
char_in :... | 20.655172 | 62 | 0.551753 | """Realization of algorithms for char-by-char text encryption.
Functions:
rot_13(str) -> str
Character offset by 13 positions.
caesar_1(str) -> str
Character offset by 1 position.
"""
def rot_13(char_in: str) -> str:
"""Character offset by 13 positions.
Parameters:
char_in :... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6776cf0bd080254a676d541e382d4eb2f31a05f5 | 7,640 | py | Python | pymatgen/analysis/tests/test_diffusion_analyzer.py | rajeshprasanth/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | null | null | null | pymatgen/analysis/tests/test_diffusion_analyzer.py | rajeshprasanth/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | null | null | null | pymatgen/analysis/tests/test_diffusion_analyzer.py | rajeshprasanth/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | 1 | 2018-10-28T01:41:38.000Z | 2018-10-28T01:41:38.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest2 as unittest
import os
"""
TODO: Change the module doc.
"""
__author__ = "shyuepingong"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong... | 41.978022 | 85 | 0.610602 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest2 as unittest
import os
import json
import random
import numpy as np
import csv
import scipy.constants as const
from pymatgen.analysis.diffusio... | 0 | 0 | 0 | 6,710 | 0 | 0 | 0 | 131 | 245 |
d94e383e015801e9caaa411360f5d5c3c970581d | 9,511 | py | Python | checker/logic.py | ucam-cl-dtg/equality_checker | 6a31d3dd360f821e36c4742e1d5139d7292f8319 | [
"Apache-2.0"
] | 7 | 2020-07-18T08:04:27.000Z | 2022-03-07T06:46:17.000Z | checker/logic.py | ucam-cl-dtg/equality_checker | 6a31d3dd360f821e36c4742e1d5139d7292f8319 | [
"Apache-2.0"
] | 1 | 2022-03-18T17:05:54.000Z | 2022-03-18T17:05:54.000Z | checker/logic.py | ucam-cl-dtg/equality_checker | 6a31d3dd360f821e36c4742e1d5139d7292f8319 | [
"Apache-2.0"
] | 1 | 2020-07-18T08:04:28.000Z | 2020-07-18T08:04:28.000Z | import sympy
from .utils import known_equal_pair, contains_incorrect_symbols
from .utils import EqualityType
from .parsing import logic_parser, UnsafeInputException
__all__ = ["check"]
KNOWN_PAIRS = dict()
def parse_expression(expression_str, *, local_dict=None):
"""Take a string containing a mathematical ex... | 40.819742 | 114 | 0.66134 | import sympy
from .utils import known_equal_pair, contains_incorrect_symbols
from .utils import EqualityType
from .parsing import logic_parser, UnsafeInputException
__all__ = ["check"]
KNOWN_PAIRS = dict()
def parse_expression(expression_str, *, local_dict=None):
"""Take a string containing a mathematical ex... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
559890790ae2649fffcbdb6731e70ef5186638d7 | 222 | py | Python | Kattis/How Many Digits/howmanydigits.py | DeepSpace2/Comptitive-Programming | 13212d9dbc73ab87519b0596fdb0147d40c7eaa8 | [
"MIT"
] | 1 | 2021-11-12T16:39:40.000Z | 2021-11-12T16:39:40.000Z | Kattis/How Many Digits/howmanydigits.py | DeepSpace2/Comptitive-Programming | 13212d9dbc73ab87519b0596fdb0147d40c7eaa8 | [
"MIT"
] | null | null | null | Kattis/How Many Digits/howmanydigits.py | DeepSpace2/Comptitive-Programming | 13212d9dbc73ab87519b0596fdb0147d40c7eaa8 | [
"MIT"
] | 3 | 2021-07-01T11:46:19.000Z | 2021-09-12T13:49:04.000Z | from math import e, log10, pi
while True:
try:
n = int(input())
except EOFError:
break
if n == 0:
print(1)
else:
print(int(n * log10(n / e) + log10(2 * pi * n) / 2) + 1) | 20.181818 | 64 | 0.463964 | from math import e, log10, pi
while True:
try:
n = int(input())
except EOFError:
break
if n == 0:
print(1)
else:
print(int(n * log10(n / e) + log10(2 * pi * n) / 2) + 1) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
72eb43c27020f9c97d40a6a12b90946e9a888bc7 | 10,665 | py | Python | game24/gameconsole.py | Adoyan-Grigor/game24 | 4619e953ed94248669759850b9efb812ecf54786 | [
"Apache-2.0"
] | null | null | null | game24/gameconsole.py | Adoyan-Grigor/game24 | 4619e953ed94248669759850b9efb812ecf54786 | [
"Apache-2.0"
] | null | null | null | game24/gameconsole.py | Adoyan-Grigor/game24 | 4619e953ed94248669759850b9efb812ecf54786 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
try:
import builtins
raw_input = getattr(builtins, 'input')
except ImportError:
pass
MSG_MENU_MAIN = '''1. Play (p)
2. Check answer (c)
3. Quit (q)'''
MSG_MENU_PLAY = '''1. Definitely no solutions... | 30.913043 | 83 | 0.509048 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import argparse
import readline
import random
import traceback
try:
import builtins
raw_input = getattr(builtins, 'input')
except ImportError:
pass
from game24 import calc, game
MSG_ME... | 4 | 983 | 0 | 6,546 | 0 | 1,440 | 0 | -28 | 203 |
ce74a3c506ce96d7da83678be3ac5f3605bd112f | 839 | py | Python | dynamodb-serverless/functions/put/handler.py | koki-nakamura22/serverless-framework-practice | b6fb96cc97ecb7a1fa167c7cccb143510466d350 | [
"MIT"
] | null | null | null | dynamodb-serverless/functions/put/handler.py | koki-nakamura22/serverless-framework-practice | b6fb96cc97ecb7a1fa167c7cccb143510466d350 | [
"MIT"
] | null | null | null | dynamodb-serverless/functions/put/handler.py | koki-nakamura22/serverless-framework-practice | b6fb96cc97ecb7a1fa167c7cccb143510466d350 | [
"MIT"
] | null | null | null | import os
import boto3
# DynamoDB object
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(f"TestUsersTable-{os.environ['STAGE']}")
| 20.463415 | 95 | 0.588796 | import json
import os
import boto3
from faker import Faker
# DynamoDB object
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(f"TestUsersTable-{os.environ['STAGE']}")
def __truncate():
response = table.scan()
key_names = [ x["AttributeName"] for x in table.key_schema ]
delete_keys = [ { k:v ... | 0 | 0 | 0 | 0 | 0 | 586 | 0 | -8 | 113 |
8411765f0f08514141bd4c621bce5644bb0156cd | 398 | py | Python | Chapter07/4985_07_01-logs.py | mapenthusiast/QGIS-Python-Programming-Cookbook-Second-Edition | 1b2fefdb09f614a2005976a451f882a198c6c9c5 | [
"MIT"
] | 43 | 2017-03-27T18:58:26.000Z | 2022-03-25T15:29:45.000Z | Chapter07/4985_07_01-logs.py | mapenthusiast/QGIS-Python-Programming-Cookbook-Second-Edition | 1b2fefdb09f614a2005976a451f882a198c6c9c5 | [
"MIT"
] | 2 | 2018-07-02T09:23:47.000Z | 2018-08-23T13:57:41.000Z | Chapter07/4985_07_01-logs.py | mapenthusiast/QGIS-Python-Programming-Cookbook-Second-Edition | 1b2fefdb09f614a2005976a451f882a198c6c9c5 | [
"MIT"
] | 31 | 2017-03-08T06:37:22.000Z | 2021-12-17T21:51:30.000Z | # Using Log Files
# Settings/Options/System/Environment (use custom variables)
# QGIS_LOG_FILE=/qgis_data/log.txt
# Restart QGIS
# Message to log file:
QgsLogger.logMessageToFile("This is a message to a log file.")
# Message to QGIS Log Window ( yellow triangle icon in the lower right)
QgsMessageLog.logMessage("Thi... | 36.181818 | 107 | 0.776382 | # Using Log Files
# Settings/Options/System/Environment (use custom variables)
# QGIS_LOG_FILE=/qgis_data/log.txt
# Restart QGIS
# Message to log file:
QgsLogger.logMessageToFile("This is a message to a log file.")
# Message to QGIS Log Window ( yellow triangle icon in the lower right)
QgsMessageLog.logMessage("Thi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fad016a754f61df9c72c04956901d978db0b6df6 | 1,500 | py | Python | paddleslim/nas/ofa/utils/utils.py | zhuguiqian/PaddleSlim | c363c91c36bb9ada41f755c0ec4df3282ccdd6f0 | [
"Apache-2.0"
] | null | null | null | paddleslim/nas/ofa/utils/utils.py | zhuguiqian/PaddleSlim | c363c91c36bb9ada41f755c0ec4df3282ccdd6f0 | [
"Apache-2.0"
] | null | null | null | paddleslim/nas/ofa/utils/utils.py | zhuguiqian/PaddleSlim | c363c91c36bb9ada41f755c0ec4df3282ccdd6f0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | 31.914894 | 74 | 0.692667 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | 0 | 0 | 0 | 0 | 0 | 793 | 0 | 0 | 92 |
9e42668859a3e942dd8cf341d42cb36a048ac54f | 3,715 | py | Python | backend/openbd.py | n-yU/shisho | dc99a2d90dde3599af62a6a59a4aabf6b5a72011 | [
"MIT"
] | 1 | 2021-08-20T05:34:31.000Z | 2021-08-20T05:34:31.000Z | backend/openbd.py | n-yU/shisho | dc99a2d90dde3599af62a6a59a4aabf6b5a72011 | [
"MIT"
] | null | null | null | backend/openbd.py | n-yU/shisho | dc99a2d90dde3599af62a6a59a4aabf6b5a72011 | [
"MIT"
] | null | null | null | from logging import getLogger, StreamHandler, DEBUG, Formatter
#
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
logger.addHandler(handler)
logger.propagate = False
handler.setFormatter(Formatter('[openBD] %(asctime)s - %(message)s'))
| 35.04717 | 155 | 0.602692 | from logging import getLogger, StreamHandler, DEBUG, Formatter
from typing import Dict, Union
import re
import json
import requests
import MeCab
from neologdn import normalize
# ロガー設定
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
logger.addHandler(handler)
logger... | 1,134 | 0 | 0 | 2,909 | 0 | 0 | 0 | -19 | 155 |
f7fe38c9a4b8c5796670a8aa33b5cb1b8bbd7c39 | 5,246 | py | Python | src/jetson/Sensors/sensors_simple.py | ichalkiad/VW_challenge | 333222010ecf3d1ca4a0e181239f761c975453e9 | [
"Apache-2.0"
] | 1 | 2017-08-16T08:42:49.000Z | 2017-08-16T08:42:49.000Z | src/jetson/Sensors/sensors_simple.py | ichalkiad/VW_challenge | 333222010ecf3d1ca4a0e181239f761c975453e9 | [
"Apache-2.0"
] | 4 | 2017-08-09T23:01:30.000Z | 2017-08-24T16:44:13.000Z | src/jetson/Sensors/sensors_simple.py | yhalk/vw_challenge_ECR | c1ff50070d0f7367ccfbf473c69e90fd2be5e85e | [
"Apache-2.0"
] | null | null | null | import ev3dev.ev3 as ev3
import sys
#Create camera sensor object
camera = OnBoardCamera()
| 43 | 280 | 0.609989 | import paho.mqtt.client as mqtt
import ev3dev.ev3 as ev3
import ctypes
import numpy as np
import sys
import cv2
from Sensors.mpu6050.mpu6050 import MPU6050
import smbus
from Sensors.odometry import Odometry
import sys, serial
from serial.tools import list_ports
class Sensor(object):
def __init__(self, *args, **kwa... | 0 | 0 | 0 | 4,810 | 0 | 0 | 0 | 28 | 313 |
790f64346cac505157953135acdaf67a66ffe6fe | 23,905 | py | Python | mphys/integrated_forces.py | timryanb/mphys | 74560a163034a0006a17811ba1206bab00f1f775 | [
"Apache-2.0"
] | 8 | 2022-02-22T18:08:56.000Z | 2022-03-14T13:32:46.000Z | mphys/integrated_forces.py | timryanb/mphys | 74560a163034a0006a17811ba1206bab00f1f775 | [
"Apache-2.0"
] | 15 | 2022-02-22T15:10:15.000Z | 2022-03-23T16:15:09.000Z | mphys/integrated_forces.py | timryanb/mphys | 74560a163034a0006a17811ba1206bab00f1f775 | [
"Apache-2.0"
] | 8 | 2022-02-22T18:08:35.000Z | 2022-03-17T16:21:08.000Z |
if __name__ == '__main__':
check_integrated_surface_force_partials()
| 53.004435 | 110 | 0.474001 | import numpy as np
import openmdao.api as om
class IntegratedSurfaceForces(om.ExplicitComponent):
def setup(self):
self.add_input('aoa',desc = 'angle of attack', units='rad',tags=['mphys_input'])
self.add_input('yaw',desc = 'yaw angle',units='rad',tags=['mphys_input'])
self.add_input('ref_a... | 0 | 0 | 0 | 22,882 | 0 | 858 | 0 | 1 | 90 |
7c3b77cba219a97b12762ac1a37f632c5f68d380 | 11,331 | py | Python | platformio/project/commands/init.py | ufo2011/platformio-core | 0ceae62701731f8b32c34d7993a34dea34aea59c | [
"Apache-2.0"
] | null | null | null | platformio/project/commands/init.py | ufo2011/platformio-core | 0ceae62701731f8b32c34d7993a34dea34aea59c | [
"Apache-2.0"
] | null | null | null | platformio/project/commands/init.py | ufo2011/platformio-core | 0ceae62701731f8b32c34d7993a34dea34aea59c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | 31.828652 | 119 | 0.662519 | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | 0 | 2,060 | 0 | 0 | 0 | 7,890 | 0 | 215 | 476 |
c91b624711d1778d78556d13356f05fa1dcaaef7 | 701 | py | Python | exercise_monitoring_camera.py | Guvalif/aidor-acceleration-02 | afa7aa45bf26f1c2b7f189b6320599357f1e17d3 | [
"MIT"
] | 1 | 2018-08-20T02:14:24.000Z | 2018-08-20T02:14:24.000Z | exercise_monitoring_camera.py | Guvalif/imedio_0801 | afa7aa45bf26f1c2b7f189b6320599357f1e17d3 | [
"MIT"
] | null | null | null | exercise_monitoring_camera.py | Guvalif/imedio_0801 | afa7aa45bf26f1c2b7f189b6320599357f1e17d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'Kazuyuki TAKASE'
__copyright__ = 'PLEN Project Company Inc, and all authors.'
__license__ = 'The MIT License (http://opensource.org/licenses/mit-license.php)'
#
# =============================================================================
from cv2 import VideoCapture
... | 23.366667 | 82 | 0.476462 | # -*- coding: utf-8 -*-
__author__ = 'Kazuyuki TAKASE'
__copyright__ = 'PLEN Project Company Inc, and all authors.'
__license__ = 'The MIT License (http://opensource.org/licenses/mit-license.php)'
# 外部プログラムの読み込み
# =============================================================================
from time import sle... | 114 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 44 |
4cc967e9e9d1ac88abda9c1076b57abe84fc47bc | 32,902 | py | Python | src/timeseries.py | AmberCrafter/pythonlib_statistic | 0fd49283c8dd75c5d1ade064be3318eabf74bdfe | [
"MIT"
] | null | null | null | src/timeseries.py | AmberCrafter/pythonlib_statistic | 0fd49283c8dd75c5d1ade064be3318eabf74bdfe | [
"MIT"
] | null | null | null | src/timeseries.py | AmberCrafter/pythonlib_statistic | 0fd49283c8dd75c5d1ade064be3318eabf74bdfe | [
"MIT"
] | null | null | null | #!/bin/python3
# if used ubuntu 20.10 or later, interpreter set as #!/bin/python and use pip instead of pip3
# =================================================================== #
# platfrom check
# dateutil check and import
try:
from dateutil.relativedelta import relativedelta
except:
import os, sys, subproc... | 43.578808 | 159 | 0.554951 | #!/bin/python3
# if used ubuntu 20.10 or later, interpreter set as #!/bin/python and use pip instead of pip3
# =================================================================== #
# platfrom check
# dateutil check and import
try:
from dateutil.relativedelta import relativedelta
except:
import os,sys,subproces... | 0 | 8,533 | 0 | 22,470 | 0 | 0 | 0 | 23 | 97 |
f191d89902854c6a45383db6b705fc612cf47791 | 784 | py | Python | mmdet/models/__init__.py | FelixZhang7/miemiedetection | ca44f33255e0bb9d6150044983a344fb9a288c08 | [
"Apache-2.0"
] | null | null | null | mmdet/models/__init__.py | FelixZhang7/miemiedetection | ca44f33255e0bb9d6150044983a344fb9a288c08 | [
"Apache-2.0"
] | null | null | null | mmdet/models/__init__.py | FelixZhang7/miemiedetection | ca44f33255e0bb9d6150044983a344fb9a288c08 | [
"Apache-2.0"
] | 1 | 2022-02-16T08:35:00.000Z | 2022-02-16T08:35:00.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
| 27.034483 | 63 | 0.811224 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
from .backbones.darknet import CSPDarknet, Darknet
from .backbones.resnet_vd import Resnet18Vd, Resnet50Vd
from .backbones.resnet_vb import Resnet50Vb
from .losses.yolov3_loss import YOLOv3Loss
from .losses.losse... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 318 | 357 |
0468d6c246b239a4fae46a385cc87c22edb5790e | 282 | py | Python | egs/voxceleb/v2.voxceleb1/scp_ark2npy.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | egs/voxceleb/v2.voxceleb1/scp_ark2npy.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | egs/voxceleb/v2.voxceleb1/scp_ark2npy.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import kaldiio
id2mfcc = kaldiio.load_scp('/home/sangjik/kaldi/egs/voxceleb/v2.smallest/mfcc/raw_mfcc_train.10.scp')
for utt_id, mfcc in id2mfcc.items():
#print(utt_id, mfcc.shape)
np.save('./tmp_mfcc/{}.npy'.format(utt_id), mfcc)
| 28.2 | 101 | 0.72695 | #!/usr/bin/env python
import numpy as np
import kaldiio
id2mfcc = kaldiio.load_scp('/home/sangjik/kaldi/egs/voxceleb/v2.smallest/mfcc/raw_mfcc_train.10.scp')
for utt_id, mfcc in id2mfcc.items():
#print(utt_id, mfcc.shape)
np.save('./tmp_mfcc/{}.npy'.format(utt_id), mfcc)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b75db27a80b0122a92a95241b891c75aed56b87b | 38,348 | py | Python | pipeline/publication.py | Yi-61/map-ephys | 8eacd84f67678b05bcc379c7d5a9560ea7a87e46 | [
"MIT"
] | null | null | null | pipeline/publication.py | Yi-61/map-ephys | 8eacd84f67678b05bcc379c7d5a9560ea7a87e46 | [
"MIT"
] | null | null | null | pipeline/publication.py | Yi-61/map-ephys | 8eacd84f67678b05bcc379c7d5a9560ea7a87e46 | [
"MIT"
] | null | null | null |
import logging
import datajoint as dj
from . import experiment
from . import ephys
from . import get_schema_name
PUBLICATION_TRANSFER_TIMEOUT = 10000
schema = dj.schema(get_schema_name('publication'))
log = logging.getLogger(__name__)
__all__ = [experiment, ephys]
| 34.861818 | 80 | 0.49854 |
import logging
import pathlib
import re
import os
from fnmatch import fnmatch
from textwrap import dedent
from collections import defaultdict
import datajoint as dj
from . import lab
from . import experiment
from . import ephys
from . import tracking
from .ingest.tracking import TrackingIngest
from pipeline.globu... | 0 | 36,662 | 0 | 0 | 936 | 0 | 0 | 41 | 430 |
31ae962fdd5c782121ff85fe6854a2b889e2cbfd | 2,334 | py | Python | docs/source/examples/7/sample.py | kumar-pratik/hi-ml | a108cf4ea244a76127adedc0ca60f0a5afdfb3e8 | [
"MIT"
] | 34 | 2021-08-18T13:27:36.000Z | 2022-03-26T01:25:36.000Z | docs/source/examples/7/sample.py | kumar-pratik/hi-ml | a108cf4ea244a76127adedc0ca60f0a5afdfb3e8 | [
"MIT"
] | 111 | 2021-08-18T13:19:46.000Z | 2022-03-30T05:57:01.000Z | docs/source/examples/7/sample.py | kumar-pratik/hi-ml | a108cf4ea244a76127adedc0ca60f0a5afdfb3e8 | [
"MIT"
] | 6 | 2021-09-13T12:07:58.000Z | 2022-03-24T16:31:06.000Z | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 39.559322 | 169 | 0.654242 | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 1,536 | 0 | 77 | 157 |
6599733b0213579573a907d9fc5ab78c8a716ed8 | 510 | py | Python | tests/test_cli.py | vfranca/pp | db9e15a490e5b28a177cdcd8f448d21fd5bec8d7 | [
"MIT"
] | null | null | null | tests/test_cli.py | vfranca/pp | db9e15a490e5b28a177cdcd8f448d21fd5bec8d7 | [
"MIT"
] | null | null | null | tests/test_cli.py | vfranca/pp | db9e15a490e5b28a177cdcd8f448d21fd5bec8d7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 26.842105 | 74 | 0.668627 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from click.testing import CliRunner
from pivotpoint import pp
from pivotpoint import cli
class TestPivotPoint(unittest.TestCase):
def setUp(self):
self.runner = CliRunner()
def tearDown(self):
"""Tear down test fixtures, if any."""... | 0 | 0 | 0 | 335 | 0 | 0 | 0 | 17 | 111 |
6c59951f383e22b4b6dd672512b717c4ad1ef094 | 1,086 | py | Python | rackio/dao/controls.py | crivero7/rackio-framework | d3362041b1fc4c3af7eb51ac06b1f0f1b5aa497c | [
"MIT"
] | null | null | null | rackio/dao/controls.py | crivero7/rackio-framework | d3362041b1fc4c3af7eb51ac06b1f0f1b5aa497c | [
"MIT"
] | null | null | null | rackio/dao/controls.py | crivero7/rackio-framework | d3362041b1fc4c3af7eb51ac06b1f0f1b5aa497c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""rackio/dao/controls.py
This module implements Controls Data Objects Access.
"""
| 18.40678 | 52 | 0.57919 | # -*- coding: utf-8 -*-
"""rackio/dao/controls.py
This module implements Controls Data Objects Access.
"""
from .core import RackioDAO
class ControlsDAO(RackioDAO):
def get_all(self):
app = self.get_app()
manager = app.get_manager("control")
result = list()
for control in ... | 0 | 0 | 0 | 902 | 0 | 0 | 0 | 6 | 68 |
b3ba1dada5fdca8c0505e224c5e297d351338eaf | 721 | py | Python | AddPDFBookmarks/handle_pdf.py | wanghuohuo0716/py-project | b771b8005d72843df1653ce68ddb67ccf77a57a8 | [
"MIT"
] | 92 | 2018-02-26T07:59:27.000Z | 2022-03-31T08:57:51.000Z | AddPDFBookmarks/handle_pdf.py | Linkeer365/py-project | b771b8005d72843df1653ce68ddb67ccf77a57a8 | [
"MIT"
] | 2 | 2020-08-19T00:55:52.000Z | 2021-03-08T07:37:32.000Z | AddPDFBookmarks/handle_pdf.py | Linkeer365/py-project | b771b8005d72843df1653ce68ddb67ccf77a57a8 | [
"MIT"
] | 53 | 2018-09-07T14:26:33.000Z | 2022-03-31T08:57:53.000Z | # coding:utf-8
# PDF
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
if __name__ == '__main__':
main() | 31.347826 | 88 | 0.71706 | # coding:utf-8
# 添加PDF书签
from pdf_utils import MyPDFHandler,PDFHandleMode as mode
import ConfigParser
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def main():
# 从配置文件中读取配置信息
cf = ConfigParser.SafeConfigParser()
cf.read('./info.conf')
pdf_path = cf.get('info','pdf_path')
bookm... | 48 | 0 | 0 | 0 | 0 | 480 | 0 | 33 | 71 |
28cd58401f73165d35b3541ef644b2fdcb572816 | 1,638 | py | Python | openff/utilities/testing.py | openforcefield/openff-utilities | 89255d6cc9513df6ad5293841e86ab1f968f7e3b | [
"MIT"
] | null | null | null | openff/utilities/testing.py | openforcefield/openff-utilities | 89255d6cc9513df6ad5293841e86ab1f968f7e3b | [
"MIT"
] | 17 | 2021-06-09T06:46:20.000Z | 2022-03-02T00:30:41.000Z | openff/utilities/testing.py | openforcefield/openff-utilities | 89255d6cc9513df6ad5293841e86ab1f968f7e3b | [
"MIT"
] | null | null | null | from typing import List, Optional, Union
import pytest
from openff.utilities.utilities import has_executable, has_package
def skip_if_missing(package_name: str, reason: Optional[str] = None):
"""
Helper function to generate a pytest.mark.skipif decorator
for any package. This allows tests to be skipped ... | 32.117647 | 87 | 0.681319 | from typing import List, Optional, Union
import pytest
from openff.utilities.utilities import has_executable, has_package
def skip_if_missing(package_name: str, reason: Optional[str] = None):
"""
Helper function to generate a pytest.mark.skipif decorator
for any package. This allows tests to be skipped ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ef5b889f2b72b0ee8d71a6019e587e98cab7064 | 5,122 | py | Python | projects/Show me the Data Structures/problem_1.py | gmendozah/Data-Structures-and-Algorithms | 07474db45acfe42855cc0f4cc968c0564b2cb91a | [
"MIT"
] | 5 | 2021-10-08T11:21:08.000Z | 2022-01-24T22:40:03.000Z | projects/Show me the Data Structures/problem_1.py | gmendozah/Data-Structures-and-Algorithms | 07474db45acfe42855cc0f4cc968c0564b2cb91a | [
"MIT"
] | null | null | null | projects/Show me the Data Structures/problem_1.py | gmendozah/Data-Structures-and-Algorithms | 07474db45acfe42855cc0f4cc968c0564b2cb91a | [
"MIT"
] | 3 | 2021-12-13T06:50:58.000Z | 2022-02-05T03:38:49.000Z |
if __name__ == '__main__':
test_case_1()
test_case_2()
test_case_3()
| 31.423313 | 115 | 0.557595 | class Node:
def __init__(self, key=None, value=None):
self.key = key
self.value = value
self.next = None
self.prev = None
class LRU_Cache(object):
def __init__(self, capacity):
if capacity < 1:
print('LRUCache should have capacity > 0')
return
... | 0 | 0 | 0 | 3,064 | 0 | 1,858 | 0 | 0 | 125 |
8246e38f21bcb46e020f248157401bcc92b6f2e7 | 45,802 | py | Python | hydrus/tests/test_app.py | vcode11/hydrus | 4ed8ada7ed8fd7d8897e744bae410b312f4cfb83 | [
"MIT"
] | 1 | 2019-12-04T12:54:21.000Z | 2019-12-04T12:54:21.000Z | hydrus/tests/test_app.py | vcode11/hydrus | 4ed8ada7ed8fd7d8897e744bae410b312f4cfb83 | [
"MIT"
] | 3 | 2019-12-21T04:15:23.000Z | 2020-04-07T05:11:05.000Z | hydrus/tests/test_app.py | vcode11/hydrus | 4ed8ada7ed8fd7d8897e744bae410b312f4cfb83 | [
"MIT"
] | null | null | null | """Test for checking if the response format is proper. Run test_crud before running this."""
import unittest
import random
import string
from hydra_python_core.doc_writer import HydraLink
def gen_dummy_object(class_title, doc):
"""Create a dummy object based on the definitions in the API Doc.
:param ... | 51.929705 | 100 | 0.550696 | """Test for checking if the response format is proper. Run test_crud before running this."""
import unittest
import random
import string
import json
import re
import uuid
from hydrus.app_factory import app_factory
from hydrus.socketio_factory import create_socket
from hydrus.utils import set_session, set_doc, ... | 0 | 4,067 | 0 | 39,830 | 0 | 0 | 0 | 195 | 326 |
c06b33ca0266576dd77b1443051d6971f9e82077 | 801 | py | Python | environment.py | LCBRU/hic_covid | eb5a37339185ed71246235e307a81d91dc91f9ec | [
"MIT"
] | null | null | null | environment.py | LCBRU/hic_covid | eb5a37339185ed71246235e307a81d91dc91f9ec | [
"MIT"
] | null | null | null | environment.py | LCBRU/hic_covid | eb5a37339185ed71246235e307a81d91dc91f9ec | [
"MIT"
] | null | null | null | """Environment Variables
"""
import os
from dotenv import load_dotenv
load_dotenv()
HIC_DB_USERNAME = os.environ["HIC_DB_USERNAME"]
HIC_DB_PASSWORD = os.environ["HIC_DB_PASSWORD"]
HIC_DB_HOST = os.environ["HIC_DB_HOST"]
HIC_DB_DATABASE = os.environ["HIC_DB_DATABASE"]
MS_SQL_ODBC_DRIVER = os.environ["MS... | 30.807692 | 64 | 0.781523 | """Environment Variables
"""
import os
from dotenv import load_dotenv
load_dotenv()
HIC_DB_USERNAME = os.environ["HIC_DB_USERNAME"]
HIC_DB_PASSWORD = os.environ["HIC_DB_PASSWORD"]
HIC_DB_HOST = os.environ["HIC_DB_HOST"]
HIC_DB_DATABASE = os.environ["HIC_DB_DATABASE"]
MS_SQL_ODBC_DRIVER = os.environ["MS... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f0682b750b96bf2f312eb6ff9f2bea5aef2c5958 | 390 | py | Python | nbd_app/migrations/0007_alter_socialamenities_hotline_number.py | Kevson102/Nbd-Phoenix | 509a9cf026d24827dccc9a5ec67819ecd86fbf03 | [
"MIT"
] | null | null | null | nbd_app/migrations/0007_alter_socialamenities_hotline_number.py | Kevson102/Nbd-Phoenix | 509a9cf026d24827dccc9a5ec67819ecd86fbf03 | [
"MIT"
] | null | null | null | nbd_app/migrations/0007_alter_socialamenities_hotline_number.py | Kevson102/Nbd-Phoenix | 509a9cf026d24827dccc9a5ec67819ecd86fbf03 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2022-01-03 14:32
| 20.526316 | 47 | 0.605128 | # Generated by Django 3.2.9 on 2022-01-03 14:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nbd_app', '0006_generalposts'),
]
operations = [
migrations.AlterField(
model_name='socialamenities',
name='hotline_... | 0 | 0 | 0 | 276 | 0 | 0 | 0 | 19 | 46 |
a68bccebe211588992d72d7335645e18121c4bf1 | 1,039 | py | Python | python/icp.py | nowtechnologies/ridi_imu | 2d8a8e54d0491c44de7edac662b101db47ad3cfc | [
"MIT"
] | 140 | 2018-05-27T16:11:40.000Z | 2022-03-28T15:49:28.000Z | python/icp.py | nowtechnologies/ridi_imu | 2d8a8e54d0491c44de7edac662b101db47ad3cfc | [
"MIT"
] | 13 | 2018-07-16T20:59:58.000Z | 2021-12-09T08:35:43.000Z | python/icp.py | nowtechnologies/ridi_imu | 2d8a8e54d0491c44de7edac662b101db47ad3cfc | [
"MIT"
] | 58 | 2018-02-14T03:53:51.000Z | 2022-03-07T15:59:41.000Z | import numpy as np
def fit_transformation(source, target):
"""
This function computes the best rigid transformation between two point sets. It assumes that "source" and
"target" are with the same length and "source[i]" corresponds to "target[i]".
:param source: Nxd array.
:param target: Nxd ... | 33.516129 | 109 | 0.627526 | import numpy as np
def fit_transformation(source, target):
"""
This function computes the best rigid transformation between two point sets. It assumes that "source" and
"target" are with the same length and "source[i]" corresponds to "target[i]".
:param source: Nxd array.
:param target: Nxd ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d22e0e78871a5ab8c68a346843dd049461897cb0 | 1,887 | py | Python | codechef/long-challenge/may21/MODEQ.py | ramanaditya/data-structure-and-algorithms | 8dcfeb011e76b2b38b54842e8ccc7a59728141f8 | [
"MIT"
] | 81 | 2020-05-22T14:22:04.000Z | 2021-12-18T10:11:23.000Z | codechef/long-challenge/may21/MODEQ.py | techhub-community/data-structure-and-algorithms | 8dcfeb011e76b2b38b54842e8ccc7a59728141f8 | [
"MIT"
] | 4 | 2020-08-06T21:08:00.000Z | 2021-03-31T16:07:50.000Z | codechef/long-challenge/may21/MODEQ.py | techhub-community/data-structure-and-algorithms | 8dcfeb011e76b2b38b54842e8ccc7a59728141f8 | [
"MIT"
] | 37 | 2020-05-22T14:25:21.000Z | 2021-12-30T03:13:13.000Z | """
[Modular Equation](https://www.codechef.com/MAY21C/problems/MODEQ)
Given integers N and M, find the number of ordered pairs (a,b)
such that 1a<bN and ((M mod a) mod b)=((M mod b) mod a).
Input
The first line contains an integer T, the number of test cases. Then the test cases follow.
The only line of each test ca... | 19.255102 | 91 | 0.569687 | """
[Modular Equation](https://www.codechef.com/MAY21C/problems/MODEQ)
Given integers N and M, find the number of ordered pairs (a,b)
such that 1≤a<b≤N and ((M mod a) mod b)=((M mod b) mod a).
Input
The first line contains an integer T, the number of test cases. Then the test cases follow.
The only line of each test ... | 63 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 23 |