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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0584d6f43da520c5c77daa1e83965714f77af218 | 2,050 | py | Python | core/test/mime/test_mime_codec_register.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | 3 | 2021-06-20T02:24:10.000Z | 2022-01-26T23:55:33.000Z | core/test/mime/test_mime_codec_register.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | core/test/mime/test_mime_codec_register.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from unittest import main
if __name__ == "__main__":
main()
| 36.607143 | 71 | 0.692683 | # -*- coding: utf-8 -*-
from unittest import TestCase, main
from recc.mime.mime_codec_register import get_global_mime_register
class _ComplexObject:
def __init__(self):
self.test_data1 = "text"
self.test_data2 = 100
self.test_data3 = 3.14
class MimeCodecRegisterTestCase(TestCase):
d... | 0 | 0 | 0 | 1,834 | 0 | 0 | 0 | 55 | 68 |
59330cfcf5414e3f86a1a7f10c339aa1302b5819 | 4,186 | py | Python | concise_fanyi.py | Yo-gurts/dict | 86e662ba9b7599473332c61de05635e8dce24f83 | [
"MIT"
] | null | null | null | concise_fanyi.py | Yo-gurts/dict | 86e662ba9b7599473332c61de05635e8dce24f83 | [
"MIT"
] | null | null | null | concise_fanyi.py | Yo-gurts/dict | 86e662ba9b7599473332c61de05635e8dce24f83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
import signal
if __name__ == '__main__':
exitflag = False
try:
signal.signal(signal.SIGINT, quit)
signal.signal(signal.SIGTERM, quit)
thread1 = Clipboard()
thread2 = Outinput()
thread1.setDaemon(True)
thread1.start()
... | 29.272727 | 115 | 0.4742 | #!/usr/bin/env python3.7
import sys
import json
import signal
import urllib.request as urllib
import threading
import pyperclip
import time
class Dict:
key = '716426270'
keyFrom = 'wufeifei'
api = 'http://fanyi.youdao.com/openapi.do?keyfrom=wufeifei&key=716426270&type=data&doctype=json&version=1.1&q='
... | 33 | 0 | 0 | 3,476 | 0 | 24 | 0 | -31 | 225 |
ce0cef8e0251b3e6085357fac68c61249be16c60 | 2,512 | py | Python | wikipedia_fetch.py | nik7273/computational-medical-knowledge | 03357fc63382bed49509d7860f87a3d010f03018 | [
"Apache-2.0"
] | null | null | null | wikipedia_fetch.py | nik7273/computational-medical-knowledge | 03357fc63382bed49509d7860f87a3d010f03018 | [
"Apache-2.0"
] | null | null | null | wikipedia_fetch.py | nik7273/computational-medical-knowledge | 03357fc63382bed49509d7860f87a3d010f03018 | [
"Apache-2.0"
] | 1 | 2019-09-17T18:38:44.000Z | 2019-09-17T18:38:44.000Z | # -*- coding: utf-8 -*-
#Search Wikipedia for Heart Attack
import os
relevant_categories = {'medical','emergencies','disease'}
conditions = ["heart attack","palpitations"] #Search all related pages?
make_filename = lambda aStr: aStr.replace(' ','_')
for condition in conditions:
findRelevantArticles(condi... | 55.822222 | 143 | 0.615844 | # -*- coding: utf-8 -*-
#Search Wikipedia for Heart Attack
import wikipedia, codecs, itertools, os, time
from pprint import pprint
relevant_categories = {'medical','emergencies','disease'}
def findRelevantArticles(term,data_path='.'):
articleList = []
articles = wikipedia.search(term) #Setting suggestion = Fa... | 0 | 0 | 0 | 0 | 0 | 2,033 | 0 | 40 | 45 |
dd59d853dc65578a9c1c4b63d4f2b0e492d54f61 | 14,741 | py | Python | accounts/views.py | witty-technologies-empowerment/codeupblood | a0aa1725e5776d80e083b6d4e9e67476bb97e983 | [
"MIT"
] | null | null | null | accounts/views.py | witty-technologies-empowerment/codeupblood | a0aa1725e5776d80e083b6d4e9e67476bb97e983 | [
"MIT"
] | null | null | null | accounts/views.py | witty-technologies-empowerment/codeupblood | a0aa1725e5776d80e083b6d4e9e67476bb97e983 | [
"MIT"
] | 1 | 2022-01-19T11:09:13.000Z | 2022-01-19T11:09:13.000Z |
# Create your views here.
#================= FUCTIONS =================# | 35.86618 | 114 | 0.521606 | from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from datetime import datetime, timedelta
from... | 0 | 243 | 0 | 0 | 0 | 13,488 | 0 | 297 | 629 |
6bdd6d4d7f38f692c96a75ae5e82669cba9cf73b | 1,036 | py | Python | programs_tutorial_2/direct_disks_multirun.py | golu-golu/statistcal-mechanics | 8ff66280ee5a6a816e6ca70934e92001e624dfad | [
"MIT"
] | null | null | null | programs_tutorial_2/direct_disks_multirun.py | golu-golu/statistcal-mechanics | 8ff66280ee5a6a816e6ca70934e92001e624dfad | [
"MIT"
] | null | null | null | programs_tutorial_2/direct_disks_multirun.py | golu-golu/statistcal-mechanics | 8ff66280ee5a6a816e6ca70934e92001e624dfad | [
"MIT"
] | null | null | null | import random, math
N = 16
eta = 0.26
sigma = math.sqrt(eta / N / math.pi)
n_runs = 100
print 'Note that this program might take a while!'
for run in range(n_runs):
iterations, config = direct_disks(N, sigma)
print 'run',run
print iterations - 1, 'tabula rasa wipe-outs before producing the following confi... | 26.564103 | 94 | 0.542471 | import random, math
def dist(x,y):
d_x = abs(x[0] - y[0]) % 1.0
d_x = min(d_x, 1.0 - d_x)
d_y = abs(x[1] - y[1]) % 1.0
d_y = min(d_y, 1.0 - d_y)
return math.sqrt(d_x**2 + d_y**2)
def direct_disks(N, sigma):
n_iter = 0
condition = False
while condition == False:
n_iter += 1... | 0 | 0 | 0 | 0 | 0 | 628 | 0 | 0 | 50 |
9ae56ae95d290db134f2e153096fa8dd43af143f | 190 | py | Python | Python/Topics/Regexp functions in Python/Matching username requirements/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | 5 | 2020-08-29T15:15:31.000Z | 2022-03-01T18:22:34.000Z | Python/Topics/Regexp functions in Python/Matching username requirements/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | null | null | null | Python/Topics/Regexp functions in Python/Matching username requirements/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | 1 | 2020-12-02T11:13:14.000Z | 2020-12-02T11:13:14.000Z | import re
template = r"[a-zA-Z]"
username = input()
match = re.match(template, username)
if match:
print("Thank you!")
else:
print("Oops! The username has to start with a letter.")
| 19 | 59 | 0.668421 | import re
template = r"[a-zA-Z]"
username = input()
match = re.match(template, username)
if match:
print("Thank you!")
else:
print("Oops! The username has to start with a letter.")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac03251cb2681eb1fe70b4d5e22c86a343b0173e | 1,428 | py | Python | tools/get_comm.py | hfingler/ava | 8ade884d82dc1465a24fd1ab682a54afe1765f6e | [
"BSD-2-Clause"
] | null | null | null | tools/get_comm.py | hfingler/ava | 8ade884d82dc1465a24fd1ab682a54afe1765f6e | [
"BSD-2-Clause"
] | null | null | null | tools/get_comm.py | hfingler/ava | 8ade884d82dc1465a24fd1ab682a54afe1765f6e | [
"BSD-2-Clause"
] | 1 | 2021-06-17T16:13:27.000Z | 2021-06-17T16:13:27.000Z |
if __name__ == '__main__':
main()
| 29.75 | 85 | 0.553221 | import argparse
import numpy as np
def load_stats(file_name, stats):
with open(file_name, 'r') as fin:
for line in fin:
sp = line.strip().split(",")
time = sp[1].strip()
namesp = sp[0].split(" ")
name = namesp[1]
if name not in stats:
... | 0 | 0 | 0 | 0 | 0 | 1,305 | 0 | -9 | 90 |
6f33ee5e698e01170b6449db0fd472335c766d53 | 814 | py | Python | src/livecoding/pythonreloader.py | ashwoods/python-qt-live-coding | b87e6fed021c5a9af72dee3b7b32f9c799816b8e | [
"MIT"
] | 37 | 2018-07-08T04:53:12.000Z | 2022-03-17T07:33:21.000Z | src/livecoding/pythonreloader.py | ashwoods/python-qt-live-coding | b87e6fed021c5a9af72dee3b7b32f9c799816b8e | [
"MIT"
] | 2 | 2020-01-07T22:03:29.000Z | 2020-09-28T12:15:57.000Z | src/livecoding/pythonreloader.py | ashwoods/python-qt-live-coding | b87e6fed021c5a9af72dee3b7b32f9c799816b8e | [
"MIT"
] | 6 | 2020-02-12T18:55:13.000Z | 2021-12-31T03:54:40.000Z | # -*- coding: utf-8 -*-
| 30.148148 | 84 | 0.638821 | # -*- coding: utf-8 -*-
import os
import sys
import signal
import inspect
from qtpy.QtCore import QObject, Slot
class PythonReloader(QObject):
def __init__(self, main, parent=None):
super(PythonReloader, self).__init__(parent)
self._main = main
@Slot()
def restart(self):
import_d... | 0 | 519 | 0 | 158 | 0 | 0 | 0 | -22 | 134 |
28dbf580557251c65f5af58073dd31f05369dcdd | 482 | py | Python | sla_cli/src/db/accessors/abbreviations.py | DavidWalshe93/SL-CLI | c92ca8a6e57eb51bf9c9433013ce16d443f8d152 | [
"MIT"
] | 2 | 2022-01-07T09:59:32.000Z | 2022-01-25T12:04:06.000Z | sla_cli/src/db/accessors/abbreviations.py | DavidWalshe93/SL-CLI | c92ca8a6e57eb51bf9c9433013ce16d443f8d152 | [
"MIT"
] | null | null | null | sla_cli/src/db/accessors/abbreviations.py | DavidWalshe93/SL-CLI | c92ca8a6e57eb51bf9c9433013ce16d443f8d152 | [
"MIT"
] | 1 | 2021-04-07T17:14:37.000Z | 2021-04-07T17:14:37.000Z | """
Author: David Walshe
Date: 08 April 2021
"""
import logging
logger = logging.getLogger(__name__)
| 24.1 | 143 | 0.69917 | """
Author: David Walshe
Date: 08 April 2021
"""
import logging
from tabulate import tabulate
from sla_cli.src.db.accessors.base import Accessor
logger = logging.getLogger(__name__)
class Abbreviations(Accessor):
def abbreviations(self, tablefmt: str = "simple") -> str:
"""Returns the abbre... | 0 | 0 | 0 | 262 | 0 | 0 | 0 | 37 | 69 |
2ef452770876cc4be160a58e302e2efdc1a66543 | 20,528 | py | Python | tia/analysis/model/ret.py | lsternlicht/tia | fe74d1876260a946e52bd733bc32da0698749f2c | [
"BSD-3-Clause"
] | null | null | null | tia/analysis/model/ret.py | lsternlicht/tia | fe74d1876260a946e52bd733bc32da0698749f2c | [
"BSD-3-Clause"
] | null | null | null | tia/analysis/model/ret.py | lsternlicht/tia | fe74d1876260a946e52bd733bc32da0698749f2c | [
"BSD-3-Clause"
] | null | null | null |
__all__ = ['RoiiRetCalculator', 'AumRetCalculator', 'FixedAumRetCalculator', 'CumulativeRets', 'Performance']
def return_on_initial_capital(capital, period_pl, leverage=None):
"""Return the daily return series based on the capital"""
if capital <= 0:
raise ValueError('cost must be a positive number ... | 42.589212 | 120 | 0.610581 | from collections import OrderedDict
import pandas as pd
import numpy as np
from tia.util.decorator import lazy_property
from tia.analysis.model.interface import TxnPlColumns as TPL
from tia.analysis.perf import drawdown_info, drawdowns, guess_freq, downside_deviation, periodicity
from tia.analysis.plots import plot_r... | 0 | 859 | 0 | 18,502 | 0 | 0 | 0 | 260 | 338 |
90edd1b0fcff1bcb117d544390d61e218a49058d | 158 | py | Python | lib/solutions/HLO/hello_solution.py | DPNT-Sourcecode/FIZ-rsof01 | a1820f2122c122dbf574077f08014967f83fbd9b | [
"Apache-2.0"
] | null | null | null | lib/solutions/HLO/hello_solution.py | DPNT-Sourcecode/FIZ-rsof01 | a1820f2122c122dbf574077f08014967f83fbd9b | [
"Apache-2.0"
] | null | null | null | lib/solutions/HLO/hello_solution.py | DPNT-Sourcecode/FIZ-rsof01 | a1820f2122c122dbf574077f08014967f83fbd9b | [
"Apache-2.0"
] | null | null | null |
# noinspection PyUnusedLocal
# friend_name = unicode string
#print(hello("Mike"))
| 15.8 | 39 | 0.664557 |
# noinspection PyUnusedLocal
# friend_name = unicode string
def hello(friend_name):
return("Hello, %s!" %friend_name )
#print(hello("Mike"))
| 0 | 0 | 0 | 0 | 0 | 42 | 0 | 0 | 25 |
bd98f8d6beada389f1d1528af29830037c5efe1e | 3,535 | py | Python | sketch/srft.py | wangshusen/PyRLA | 066876545c8501dca8ec857676465553a0ebb822 | [
"MIT"
] | 12 | 2018-06-15T09:49:36.000Z | 2020-05-08T12:42:06.000Z | sketch/srft.py | wangshusen/PyRLA | 066876545c8501dca8ec857676465553a0ebb822 | [
"MIT"
] | 1 | 2020-06-09T11:46:05.000Z | 2020-06-09T12:24:59.000Z | sketch/srft.py | wangshusen/PyRLA | 066876545c8501dca8ec857676465553a0ebb822 | [
"MIT"
] | 3 | 2018-11-05T19:14:21.000Z | 2019-10-23T02:41:10.000Z | import numpy
# Remark:
# Real FFT with even n is faster than real FFT with odd n.
# I do not know why.
def realfft_col(a_mat):
'''
Real Fast Fourier Transform (FFT) Independently Applied to Each Column of A
Input
a_mat: n-by-d dense NumPy matrix.
Output
c_mat: n-by-d matr... | 31.008772 | 79 | 0.604809 | import numpy
# Remark:
# Real FFT with even n is faster than real FFT with odd n.
# I do not know why.
def realfft_col(a_mat):
'''
Real Fast Fourier Transform (FFT) Independently Applied to Each Column of A
Input
a_mat: n-by-d dense NumPy matrix.
Output
c_mat: n-by-d matr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
72f88fd1c8c07e12acd9c900a420a669aa067518 | 1,162 | py | Python | ifsp2019/publication_plot.py | andrekorol/flare-hunter | 530d29275429b934d0ee8a20e21ed3ccc514e40c | [
"MIT"
] | null | null | null | ifsp2019/publication_plot.py | andrekorol/flare-hunter | 530d29275429b934d0ee8a20e21ed3ccc514e40c | [
"MIT"
] | 1 | 2021-08-31T19:17:19.000Z | 2021-08-31T19:17:19.000Z | ifsp2019/publication_plot.py | andrekorol/flare-hunter | 530d29275429b934d0ee8a20e21ed3ccc514e40c | [
"MIT"
] | null | null | null | from urldl import download
from pycallisto import fitsfile
callisto_archives = 'http://soleil80.cs.technik.fhnw.ch/' \
'solarradio/data/2002-20yy_Callisto/'
filelist = [
"BLEN7M_20110216_133009_24.fit.gz", "BLEN7M_20110216_134510_24.fit.gz",
"BLEN7M_20110216_140011_24.fit.gz", "BLEN7M_2011... | 41.5 | 76 | 0.634251 | from urldl import download
from pycallisto import fitsfile
callisto_archives = 'http://soleil80.cs.technik.fhnw.ch/' \
'solarradio/data/2002-20yy_Callisto/'
filelist = [
"BLEN7M_20110216_133009_24.fit.gz", "BLEN7M_20110216_134510_24.fit.gz",
"BLEN7M_20110216_140011_24.fit.gz", "BLEN7M_2011... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
81ae7822a3dffbe5464ea6afa6466f1447ad89c3 | 420 | py | Python | script.py | aptmess/detectime | 8e0eac3c93a984448731b3311741ee22a7e881f4 | [
"MIT"
] | 2 | 2021-07-04T16:08:04.000Z | 2021-08-03T08:42:03.000Z | script.py | aptmess/detectime | 8e0eac3c93a984448731b3311741ee22a7e881f4 | [
"MIT"
] | null | null | null | script.py | aptmess/detectime | 8e0eac3c93a984448731b3311741ee22a7e881f4 | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
CONFIG_PATH = 'config.yml'
if __name__ == '__main__':
main()
| 20 | 51 | 0.747619 | import logging
import yaml
from detectime.detectime import detectron
from definitions import ROOT_DIR
from detectime.utils import convert_dict_to_tuple
log = logging.getLogger(__name__)
CONFIG_PATH = 'config.yml'
def main():
with open(ROOT_DIR / CONFIG_PATH) as f:
data = yaml.safe_load(f)
config = c... | 0 | 0 | 0 | 0 | 0 | 141 | 0 | 49 | 111 |
3fe7567364e0b02ea873d5bd1fc31a5761c15b2e | 2,090 | py | Python | CloneWars.py | hallba/UnicornWrightFisher | 9ed4cc5e21b47cee7f2c70dc8638d031169a4b9c | [
"MIT"
] | 4 | 2021-04-09T19:45:47.000Z | 2021-04-29T11:04:19.000Z | CloneWars.py | hallba/UnicornWrightFisher | 9ed4cc5e21b47cee7f2c70dc8638d031169a4b9c | [
"MIT"
] | null | null | null | CloneWars.py | hallba/UnicornWrightFisher | 9ed4cc5e21b47cee7f2c70dc8638d031169a4b9c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Clone wars simulator.
Simulates the growth of clones in a 2D space.
Mutations are induced by button presses.
Currently untested.
"""
import splash
splash.splashScreen("CloneWars!",rotation=270)
import RPi.GPIO as GPIO
try:
import numpy as np
except ImportError:
# Need to check the pin ... | 29.027778 | 83 | 0.688517 | #!/usr/bin/env python
"""Clone wars simulator.
Simulates the growth of clones in a 2D space.
Mutations are induced by button presses.
Currently untested.
"""
import splash
splash.splashScreen("CloneWars!",rotation=270)
import signal
import sys
import RPi.GPIO as GPIO
try:
import numpy as np
... | 0 | 0 | 0 | 457 | 0 | 156 | 0 | 2 | 240 |
0d008bce694ff1d6c230937c72eb568aa96b7de2 | 3,146 | py | Python | policy/migrations/0001_initial.py | agnihotri7/demo-api | ffccd7e7a21b99cb8282045b4c3343ff5888c527 | [
"RSA-MD"
] | null | null | null | policy/migrations/0001_initial.py | agnihotri7/demo-api | ffccd7e7a21b99cb8282045b4c3343ff5888c527 | [
"RSA-MD"
] | null | null | null | policy/migrations/0001_initial.py | agnihotri7/demo-api | ffccd7e7a21b99cb8282045b4c3343ff5888c527 | [
"RSA-MD"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-06 09:41
| 47.666667 | 219 | 0.579148 | # Generated by Django 4.0.2 on 2022-02-06 09:41
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 0 | 0 | 2,966 | 0 | 0 | 0 | 41 | 90 |
17ff2db4a4ef5d618281004b11bf14de2106dc58 | 885 | py | Python | lh/tdd.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | 3 | 2019-03-25T14:15:30.000Z | 2019-08-29T15:02:47.000Z | lh/tdd.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | null | null | null | lh/tdd.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | null | null | null | from EMAlgorithm import EmAlgorithm
import numpy as np
def create_data(mu0, sigma0, mu1, sigma1, alpha0, alpha1):
'''
:param mu0: 0
:param sigma0: 0
:param mu1: 1
:param sigma1: 1
:param alpha0: 0
:param alpha1: 1
:return:
'''
#1000
length = 1000
#length * a... | 21.071429 | 63 | 0.656497 | from EMAlgorithm import EmAlgorithm
import numpy as np
def create_data(mu0, sigma0, mu1, sigma1, alpha0, alpha1):
'''
初始化数据集
这里通过服从高斯分布的随机函数来伪造数据集
:param mu0: 高斯0的均值
:param sigma0: 高斯0的方差
:param mu1: 高斯1的均值
:param sigma1: 高斯1的方差
:param alpha0: 高斯0的系数
:param alpha1: 高斯1的系数
:retu... | 546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
df7dd05fd77b54c6bccf40f3142f23f5cd3af718 | 662 | py | Python | fcos_core/data/datasets/create_eccv_index.py | touchylk/fcoseccv | f9141bf98ffed6bd1292779ac022742c15d4555d | [
"BSD-2-Clause"
] | null | null | null | fcos_core/data/datasets/create_eccv_index.py | touchylk/fcoseccv | f9141bf98ffed6bd1292779ac022742c15d4555d | [
"BSD-2-Clause"
] | null | null | null | fcos_core/data/datasets/create_eccv_index.py | touchylk/fcoseccv | f9141bf98ffed6bd1292779ac022742c15d4555d | [
"BSD-2-Clause"
] | 1 | 2020-10-04T13:23:33.000Z | 2020-10-04T13:23:33.000Z | import os
xmldir = '/media/e813/E/dataset/eccv/eccv/VisDrone2018-VID-val/xmlannotations'
# datasetdir = '/media/e813/E/dataset/eccv/eccv/VisDrone2018-VID-train'
# file = os.path.join(datasetdir,'index.txt')
# f = open(file,'w')
count=0
for seq in os.listdir(xmldir):
seqpath = os.path.join(xmldir,seq)
for n,xml_... | 30.090909 | 78 | 0.610272 | import os
xmldir = '/media/e813/E/dataset/eccv/eccv/VisDrone2018-VID-val/xmlannotations'
# datasetdir = '/media/e813/E/dataset/eccv/eccv/VisDrone2018-VID-train'
# file = os.path.join(datasetdir,'index.txt')
# f = open(file,'w')
count=0
for seq in os.listdir(xmldir):
seqpath = os.path.join(xmldir,seq)
for n,xml_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b9200d72886d859c7087fdff26f823fe6a74a941 | 4,928 | py | Python | molecule/default/tests/test_default.py | chas0amx/ansible-postfix | b129c57fdddf00447a715cccea0758878de22d0b | [
"Apache-2.0"
] | 1 | 2022-02-28T10:22:07.000Z | 2022-02-28T10:22:07.000Z | molecule/default/tests/test_default.py | chas0amx/ansible-postfix | b129c57fdddf00447a715cccea0758878de22d0b | [
"Apache-2.0"
] | 7 | 2021-11-18T07:25:50.000Z | 2022-03-31T12:25:24.000Z | molecule/default/tests/test_default.py | chas0amx/ansible-postfix | b129c57fdddf00447a715cccea0758878de22d0b | [
"Apache-2.0"
] | 1 | 2022-03-02T10:17:23.000Z | 2022-03-02T10:17:23.000Z | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_directories(host, get_vars):
"""
used config directory
debian based: /etc/mysql
redhat based: /etc/my.cnf.d
... | 26.494624 | 114 | 0.656859 |
from ansible.parsing.dataloader import DataLoader
from ansible.template import Templar
import json
import pytest
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def pp_json(json_thing, sort... | 0 | 1,463 | 0 | 0 | 0 | 528 | 0 | 25 | 159 |
c7055528d28431a2d229dc6240bb39f42df97a2f | 42,845 | py | Python | tests/pydevtest/test_chunkydevtest.py | PlantandFoodResearch/irods | 9dfe7ffe5aa0760b7493bd9392ea1270df9335d4 | [
"BSD-3-Clause"
] | null | null | null | tests/pydevtest/test_chunkydevtest.py | PlantandFoodResearch/irods | 9dfe7ffe5aa0760b7493bd9392ea1270df9335d4 | [
"BSD-3-Clause"
] | null | null | null | tests/pydevtest/test_chunkydevtest.py | PlantandFoodResearch/irods | 9dfe7ffe5aa0760b7493bd9392ea1270df9335d4 | [
"BSD-3-Clause"
] | null | null | null | import sys
if (sys.version_info >= (2,7)):
import unittest
else:
| 49.474596 | 180 | 0.61328 | import sys
if (sys.version_info >= (2,7)):
import unittest
else:
import unittest2 as unittest
import pydevtest_sessions as s
from pydevtest_common import assertiCmd, assertiCmdFail, interruptiCmd
from resource_suite import ResourceBase
import commands
import os, stat
import datetime
import time
import shutil
im... | 0 | 0 | 0 | 42,490 | 0 | 0 | 0 | 39 | 247 |
15c2fef63b2d4ac40cf07d490bc31012681666a9 | 7,940 | py | Python | APC400000/MelodicComponent.py | martinpechmann/APC400000 | 0783dd2f7c3846684f785b15e651c61edf95e27c | [
"BSD-Source-Code"
] | 6 | 2019-09-15T18:46:49.000Z | 2021-09-10T06:36:10.000Z | APC400000/MelodicComponent.py | martinpechmann/APC400000 | 0783dd2f7c3846684f785b15e651c61edf95e27c | [
"BSD-Source-Code"
] | 3 | 2015-06-14T22:47:01.000Z | 2015-06-17T14:24:47.000Z | APC400000/MelodicComponent.py | martinpechmann/APC400000 | 0783dd2f7c3846684f785b15e651c61edf95e27c | [
"BSD-Source-Code"
] | 1 | 2016-12-21T12:18:14.000Z | 2016-12-21T12:18:14.000Z | # Embedded file name: c:\Jenkins\live\output\win_32_static\Release\midi-remote-scripts\Push\MelodicComponent.py
from __future__ import with_statement
NUM_NOTE_EDITORS = 7 | 44.111111 | 233 | 0.693955 | # Embedded file name: c:\Jenkins\live\output\win_32_static\Release\midi-remote-scripts\Push\MelodicComponent.py
from __future__ import with_statement
from _Framework.Util import forward_property, find_if
from _Framework.SubjectSlot import subject_slot
from _Framework.ModesComponent import ModesComponent, LayerMode
from... | 0 | 1,030 | 0 | 6,137 | 0 | 0 | 0 | 338 | 265 |
1b385350022d77771f9fd2a0d89d1eb2b4a50830 | 2,917 | py | Python | coral_deeplab/pretrained.py | xadrianzetx/coral-deeplab | aa685a9b694339685d3fc7510296ecbe513838bb | [
"MIT"
] | 5 | 2021-03-15T10:26:14.000Z | 2022-03-03T14:33:07.000Z | coral_deeplab/pretrained.py | xadrianzetx/coral-deeplab | aa685a9b694339685d3fc7510296ecbe513838bb | [
"MIT"
] | 3 | 2021-06-28T22:07:29.000Z | 2021-10-16T17:48:31.000Z | coral_deeplab/pretrained.py | xadrianzetx/coral-deeplab | aa685a9b694339685d3fc7510296ecbe513838bb | [
"MIT"
] | 2 | 2021-06-29T08:06:02.000Z | 2021-09-30T08:15:08.000Z | # MIT License
# Copyright (c) 2021 xadrianzetx
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 39.418919 | 80 | 0.731231 | # MIT License
# Copyright (c) 2021 xadrianzetx
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 0 | 0 | 0 | 1,720 | 0 | 0 | 0 | 0 | 92 |
73296fabb1841f8ea0d871204567b5801050b15c | 1,619 | py | Python | metalprot/database/database_download.py | lonelu/Metalprot | e51bee472c975aa171bdb6ee426a07ca69f110ee | [
"MIT"
] | null | null | null | metalprot/database/database_download.py | lonelu/Metalprot | e51bee472c975aa171bdb6ee426a07ca69f110ee | [
"MIT"
] | null | null | null | metalprot/database/database_download.py | lonelu/Metalprot | e51bee472c975aa171bdb6ee426a07ca69f110ee | [
"MIT"
] | null | null | null | import os
# Manipulate rcsb file
def organize_rcsb_file(workdir = "/mnt/e/DesignData/ligands/NI_rcsb/"):
'''
The .csv files downloaded from rcsb database will be combined first,
then generate tab deliminated txt file.
'''
all_lines = []
for file in os.listdir(workdir):
if file.endswi... | 30.54717 | 91 | 0.551575 | import os
import prody as pr
# Manipulate rcsb file
def organize_rcsb_file(workdir = "/mnt/e/DesignData/ligands/NI_rcsb/"):
'''
The .csv files downloaded from rcsb database will be combined first,
then generate tab deliminated txt file.
'''
all_lines = []
for file in os.listdir(workdir):
... | 0 | 0 | 0 | 0 | 0 | 879 | 0 | -3 | 45 |
0ce7701a7823d8739f05f92a5128f0b1ff249404 | 2,146 | py | Python | config.py | jackgibson2/lambda-cleaner | 433fbf7b7393a6d49771346e5b48939428ed663a | [
"MIT"
] | null | null | null | config.py | jackgibson2/lambda-cleaner | 433fbf7b7393a6d49771346e5b48939428ed663a | [
"MIT"
] | null | null | null | config.py | jackgibson2/lambda-cleaner | 433fbf7b7393a6d49771346e5b48939428ed663a | [
"MIT"
] | null | null | null | import boto3
REGION = 'us-east-2'
session = boto3.session.Session(profile_name='sandbox')
#iam = boto3.resource('iam', region_name=REGION)
policy = {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:DeleteVolume",
"Resource": "arn:aws:ec... | 26.825 | 75 | 0.536813 | import os
import json
import boto3
REGION = 'us-east-2'
session = boto3.session.Session(profile_name='sandbox')
#iam = boto3.resource('iam', region_name=REGION)
policy = {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:DeleteVolume",
"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -22 | 44 |
35ad11a063628120bac86d92a7d8d61ab2e3bf24 | 11,098 | py | Python | python_modules/dagster-graphql/dagster_graphql/dauphin_registry.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | 1 | 2021-04-30T00:19:20.000Z | 2021-04-30T00:19:20.000Z | python_modules/dagster-graphql/dagster_graphql/dauphin_registry.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/dauphin_registry.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | null | null | null | """
Dauphin is wrapper module around graphene meant to provide a couple additional
features. Most importantly is a type registry. Instead of referring to
the class that corresponds to the GraphQL type everywhere, you are instead
allows to use the GraphQL string. This solves an immediate short term problem
in that it is... | 35.915858 | 100 | 0.67769 | """
Dauphin is wrapper module around graphene meant to provide a couple additional
features. Most importantly is a type registry. Instead of referring to
the class that corresponds to the GraphQL type everywhere, you are instead
allows to use the GraphQL string. This solves an immediate short term problem
in that it is... | 0 | 0 | 0 | 7,372 | 0 | 1,500 | 0 | 252 | 453 |
434f9a60d0158ff1d591eee55a9eecd875a4fe07 | 155 | py | Python | 10/00/7.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | null | null | null | 10/00/7.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | 39 | 2017-07-31T22:54:01.000Z | 2017-08-31T00:19:03.000Z | 10/00/7.py | pylangstudy/201708 | 126b1af96a1d1f57522d5a1d435b58597bea2e57 | [
"CC0-1.0"
] | null | null | null | #!python3.6
print("int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42))
print("int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42))
| 38.75 | 72 | 0.477419 | #!python3.6
print("int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42))
print("int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aa2b998413ca4e625b5b5ade9809014351a9b998 | 1,592 | py | Python | server.py | nagasudhirpulla/grafana_smscountry_webhook | d8ab182b8f5ec12f00eaf966ec15a234782154e0 | [
"MIT"
] | null | null | null | server.py | nagasudhirpulla/grafana_smscountry_webhook | d8ab182b8f5ec12f00eaf966ec15a234782154e0 | [
"MIT"
] | null | null | null | server.py | nagasudhirpulla/grafana_smscountry_webhook | d8ab182b8f5ec12f00eaf966ec15a234782154e0 | [
"MIT"
] | null | null | null | from flask import Flask
from waitress import serve
from src.config.appConfig import loadAppConfig
from src.logs.loggerFactory import getFileLogger
from src.services.smsSender import SmsApi
# get application config
appConf = loadAppConfig()
# setup logging based on application config
backUpCount = appConf["backUpCoun... | 29.481481 | 76 | 0.702261 | from flask import Flask, request
from waitress import serve
from src.config.appConfig import loadAppConfig
from src.logs.loggerFactory import getFileLogger
from src.services.smsSender import SmsApi
# get application config
appConf = loadAppConfig()
# setup logging based on application config
backUpCount = appConf["b... | 0 | 430 | 0 | 0 | 0 | 0 | 0 | 9 | 46 |
2b3d9561450c764cc9dff63f42c7c64befb8dd30 | 1,213 | py | Python | gans/CGAN/loader.py | IvLabs/Variational-DL | cd431564ae77ba42a485db17416a6033b32c48fb | [
"MIT"
] | 37 | 2020-12-24T10:03:16.000Z | 2022-01-18T05:37:07.000Z | gans/CGAN/loader.py | vignesh-creator/Variational-DL | cd431564ae77ba42a485db17416a6033b32c48fb | [
"MIT"
] | 1 | 2021-10-03T20:04:36.000Z | 2021-10-04T17:21:51.000Z | gans/CGAN/loader.py | vignesh-creator/Variational-DL | cd431564ae77ba42a485db17416a6033b32c48fb | [
"MIT"
] | 36 | 2020-12-27T16:38:27.000Z | 2022-03-21T17:20:22.000Z | import torch
from torchvision import transforms, datasets
from torch.utils.data import DataLoader
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
training_data = datasets.CIFAR10(root="data", train=True, download=True,
transform=transforms.Compose([
... | 44.925926 | 96 | 0.575433 | import torch
from torchvision import transforms, datasets
from torch.utils.data import DataLoader
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
training_data = datasets.CIFAR10(root="data", train=True, download=True,
transform=transforms.Compose([
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cc96cf4d5225718933a96ae5b76fe27a222e3d90 | 11,003 | py | Python | eservice/pdo/sservice/block_store_manager.py | sambacha/private-data-objects | 635049918b362ba81ad74469cbea6b2c53380d9e | [
"Apache-2.0"
] | 84 | 2018-05-04T15:07:53.000Z | 2022-03-23T09:38:17.000Z | eservice/pdo/sservice/block_store_manager.py | sambacha/private-data-objects | 635049918b362ba81ad74469cbea6b2c53380d9e | [
"Apache-2.0"
] | 218 | 2018-05-07T20:10:25.000Z | 2022-03-23T17:27:44.000Z | eservice/pdo/sservice/block_store_manager.py | sambacha/private-data-objects | 635049918b362ba81ad74469cbea6b2c53380d9e | [
"Apache-2.0"
] | 33 | 2018-03-02T20:32:18.000Z | 2021-09-17T07:07:57.000Z | # Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 37.42517 | 103 | 0.624375 | # Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0 | 257 | 0 | 9,795 | 0 | 0 | 0 | -9 | 179 |
c47aef6a568a84a910fe9d901ba372f17176b9e3 | 1,435 | py | Python | pymc/examples/gp/PyMCmodel.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | 1 | 2019-03-01T02:47:20.000Z | 2019-03-01T02:47:20.000Z | pymc/examples/gp/PyMCmodel.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | 1 | 2019-08-17T06:58:38.000Z | 2019-08-17T06:58:38.000Z | pymc/examples/gp/PyMCmodel.py | rsumner31/pymc3-23 | 539c0fc04c196679a1cdcbf4bc2dbea4dee10080 | [
"Apache-2.0"
] | null | null | null | import pymc as pm
import pymc.gp as gp
import numpy as np
x = np.arange(-1.,1.,.1)
# Prior parameters of C
diff_degree = pm.Uniform('diff_degree', .1, 3)
amp = pm.Lognormal('amp', mu=.4, tau=1.)
scale = pm.Lognormal('scale', mu=.5, tau=1.)
# The covariance dtrm C is valued as a Covariance object.
# Prior paramet... | 25.625 | 89 | 0.65993 | import pymc as pm
import pymc.gp as gp
from pymc.gp.cov_funs import matern
import numpy as np
import matplotlib.pyplot as pl
from numpy.random import normal
x = np.arange(-1.,1.,.1)
# Prior parameters of C
diff_degree = pm.Uniform('diff_degree', .1, 3)
amp = pm.Lognormal('amp', mu=.4, tau=1.)
scale = pm.Lognormal(... | 0 | 415 | 0 | 0 | 0 | 58 | 0 | 33 | 155 |
1ff0470a82f8e325dec69db737d3ded8bf488a17 | 734 | py | Python | HW4/PyMaxflow-master/examples/simple.py | ardaduz/math-cgv | bc89c0ce9beca9a9f02ca23bcf4a9116be187882 | [
"MIT"
] | null | null | null | HW4/PyMaxflow-master/examples/simple.py | ardaduz/math-cgv | bc89c0ce9beca9a9f02ca23bcf4a9116be187882 | [
"MIT"
] | null | null | null | HW4/PyMaxflow-master/examples/simple.py | ardaduz/math-cgv | bc89c0ce9beca9a9f02ca23bcf4a9116be187882 | [
"MIT"
] | 1 | 2021-02-14T10:41:17.000Z | 2021-02-14T10:41:17.000Z | import maxflow
# Create a graph with integer capacities.
g = maxflow.Graph[int](2, 2)
# Add two (non-terminal) nodes. Get the index to the first one.
nodes = g.add_nodes(2)
# Create two edges (forwards and backwards) with the given capacities.
# The indices of the nodes are always consecutive.
g.add_edge(nodes[0], nod... | 31.913043 | 70 | 0.701635 | import maxflow
# Create a graph with integer capacities.
g = maxflow.Graph[int](2, 2)
# Add two (non-terminal) nodes. Get the index to the first one.
nodes = g.add_nodes(2)
# Create two edges (forwards and backwards) with the given capacities.
# The indices of the nodes are always consecutive.
g.add_edge(nodes[0], nod... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bb753e65a660ad6b0da4c898f341c53f5a413d54 | 395 | py | Python | storm_analysis/diagnostics/frc/analyze_data.py | oxfordni/storm-analysis | 835a5c17497c563c3632db561ae7e7c9144a8dd1 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/frc/analyze_data.py | oxfordni/storm-analysis | 835a5c17497c563c3632db561ae7e7c9144a8dd1 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/frc/analyze_data.py | oxfordni/storm-analysis | 835a5c17497c563c3632db561ae7e7c9144a8dd1 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python
"""
Analyze FRC data.
Hazen 01/18
"""
import glob
import storm_analysis.frc.frc_calc2d as frcCalc2d
dirs = sorted(glob.glob("test*"))
total_time = 0.0
for a_dir in dirs:
print()
print("Analyzing:", a_dir)
print()
hdf5 = a_dir + "/test.hdf5"
frc_text = a_dir + "/frc.txt"... | 15.8 | 49 | 0.643038 | #!/usr/bin/env python
"""
Analyze FRC data.
Hazen 01/18
"""
import glob
import storm_analysis.frc.frc_calc2d as frcCalc2d
dirs = sorted(glob.glob("test*"))
total_time = 0.0
for a_dir in dirs:
print()
print("Analyzing:", a_dir)
print()
hdf5 = a_dir + "/test.hdf5"
frc_text = a_dir + "/frc.txt"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
33522d5a0e5a1a2934f46eb372aaa91d5264c310 | 193 | py | Python | 5. Strings/multi_line_strings.py | VasuGoel/python-personal-notes | 752c84533677e30e2abdaaf288ed7cf43220bd42 | [
"MIT"
] | 1 | 2019-09-04T12:08:29.000Z | 2019-09-04T12:08:29.000Z | 5. Strings/multi_line_strings.py | VasuGoel/python-personal-notes | 752c84533677e30e2abdaaf288ed7cf43220bd42 | [
"MIT"
] | null | null | null | 5. Strings/multi_line_strings.py | VasuGoel/python-personal-notes | 752c84533677e30e2abdaaf288ed7cf43220bd42 | [
"MIT"
] | 2 | 2019-09-04T12:08:30.000Z | 2020-10-13T16:18:58.000Z | greeting_message = '''
Hi John,
We have received your purchase request successfully. We'll email you when after the package is dispatched.
Thanks,
Support Team
'''
print(greeting_message)
| 14.846154 | 106 | 0.766839 | greeting_message = '''
Hi John,
We have received your purchase request successfully. We'll email you when after the package is dispatched.
Thanks,
Support Team
'''
print(greeting_message)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc42ceed708f7435a7fe173be8580c9dbe9c5fd0 | 8,274 | py | Python | daisy/utils/splitter.py | roger-zhe-li/daisyRec | 421d16adbb98a5b75134931b1cde5ac42857ef52 | [
"Apache-2.0"
] | 1 | 2021-04-04T11:52:08.000Z | 2021-04-04T11:52:08.000Z | daisy/utils/splitter.py | roger-zhe-li/daisyRec | 421d16adbb98a5b75134931b1cde5ac42857ef52 | [
"Apache-2.0"
] | null | null | null | daisy/utils/splitter.py | roger-zhe-li/daisyRec | 421d16adbb98a5b75134931b1cde5ac42857ef52 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.model_selection import KFold, train_test_split, GroupShuffleSplit
def split_test(df, test_method='fo', test_size=.2):
"""
method of splitting data into training data and test data
Parameters
----------
df : pd.DataFrame raw data waiting for test ... | 44.967391 | 114 | 0.629321 | import numpy as np
import pandas as pd
from sklearn.model_selection import KFold, train_test_split, GroupShuffleSplit
def split_test(df, test_method='fo', test_size=.2):
"""
method of splitting data into training data and test data
Parameters
----------
df : pd.DataFrame raw data waiting for test ... | 0 | 0 | 0 | 0 | 0 | 477 | 0 | 0 | 60 |
2a552d302442f5a78ca02c89a6511397c0c088c0 | 3,007 | py | Python | ethereum_stats.py | cleardev0829/ethereum-nft-activity | 263f0eb93e6f812c2fd3941ab85c1e56b44e2663 | [
"MIT"
] | 84 | 2021-05-16T00:57:07.000Z | 2022-03-30T21:36:17.000Z | ethereum_stats.py | cleardev0829/ethereum-nft-activity | 263f0eb93e6f812c2fd3941ab85c1e56b44e2663 | [
"MIT"
] | 11 | 2021-05-17T05:31:57.000Z | 2022-03-15T08:34:43.000Z | ethereum_stats.py | cleardev0829/ethereum-nft-activity | 263f0eb93e6f812c2fd3941ab85c1e56b44e2663 | [
"MIT"
] | 6 | 2021-05-16T10:17:04.000Z | 2022-03-23T23:55:01.000Z |
if __name__ == '__main__':
EthereumStats(verbose=True, update=True) | 38.063291 | 71 | 0.62155 | import requests
import os
from collections import defaultdict
import pandas as pd
from io import StringIO
from nearest_dict import NearestDict
from utils import load_stats_endpoint
class EthereumStats:
def __init__(self, update=False, verbose=False):
self.cache_fn = 'data/ethereum_stats.csv'
if upd... | 0 | 0 | 0 | 2,731 | 0 | 0 | 0 | 27 | 177 |
60299346a8dbfa82fe69fd77f6f240edb4338f85 | 575 | py | Python | bitmovin_api_sdk/models/filter_type.py | hofmannben/bitmovin-api-sdk-python | 71aae5cd8a31aa0ad54ca07a6f546a624e8686a9 | [
"MIT"
] | null | null | null | bitmovin_api_sdk/models/filter_type.py | hofmannben/bitmovin-api-sdk-python | 71aae5cd8a31aa0ad54ca07a6f546a624e8686a9 | [
"MIT"
] | 1 | 2020-07-06T07:13:43.000Z | 2020-07-06T07:13:43.000Z | bitmovin_api_sdk/models/filter_type.py | hofmannben/bitmovin-api-sdk-python | 71aae5cd8a31aa0ad54ca07a6f546a624e8686a9 | [
"MIT"
] | 1 | 2020-07-06T07:07:26.000Z | 2020-07-06T07:07:26.000Z | # coding: utf-8
| 25 | 59 | 0.704348 | # coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
class FilterType(Enum):
CROP = "CROP"
CONFORM = "CONFORM"
WATERMARK = "WATERMARK"
ENHANCED_WATERMARK = "ENHANCED_WATERMARK"
ROTATE = "ROTATE"
DEINTERLACE =... | 0 | 0 | 0 | 412 | 0 | 0 | 0 | 56 | 90 |
7bfe5a2bda195f594b3a206467758abb045a880d | 4,171 | py | Python | smartcontract/venv/lib/python3.6/site-packages/bytecode/bytecode.py | simplitech/neoinvoice | bc9a0217858938b49f99fef13b3439f4a537a5f5 | [
"MIT"
] | null | null | null | smartcontract/venv/lib/python3.6/site-packages/bytecode/bytecode.py | simplitech/neoinvoice | bc9a0217858938b49f99fef13b3439f4a537a5f5 | [
"MIT"
] | null | null | null | smartcontract/venv/lib/python3.6/site-packages/bytecode/bytecode.py | simplitech/neoinvoice | bc9a0217858938b49f99fef13b3439f4a537a5f5 | [
"MIT"
] | null | null | null | # alias to keep the 'bytecode' variable free
| 32.333333 | 79 | 0.580676 | # alias to keep the 'bytecode' variable free
import bytecode as _bytecode
from bytecode.instr import UNSET, Label, SetLineno, Instr
class BaseBytecode:
def __init__(self):
self.argcount = 0
self.kwonlyargcount = 0
# FIXME: insane and safe value until _ConvertBytecodeToConcrete is able
... | 0 | 117 | 0 | 3,850 | 0 | 0 | 0 | 43 | 113 |
8a50b79f3cf1186e9c93e7f970e028198d7fafec | 3,276 | py | Python | Totoro/db.py | sdss/Totoro | 74befd99bda47ebb8c03a276b57371b5788e154a | [
"Apache-2.0"
] | 1 | 2018-08-22T00:34:30.000Z | 2018-08-22T00:34:30.000Z | Totoro/db.py | sdss/Totoro | 74befd99bda47ebb8c03a276b57371b5788e154a | [
"Apache-2.0"
] | 4 | 2018-06-06T22:10:14.000Z | 2018-06-14T04:47:23.000Z | Totoro/db.py | sdss/Totoro | 74befd99bda47ebb8c03a276b57371b5788e154a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
db.py
Created by Jos Snchez-Gallego on 25 Oct 2015.
Licensed under a 3-clause BSD license.
Revision history:
25 Oct 2015 J. Snchez-Gallego
Initial version
"""
from __future__ import division, print_function
from SDSSconnect import DatabaseConnection
from Totor... | 32.76 | 87 | 0.639194 | #!/usr/bin/env python
# encoding: utf-8
"""
db.py
Created by José Sánchez-Gallego on 25 Oct 2015.
Licensed under a 3-clause BSD license.
Revision history:
25 Oct 2015 J. Sánchez-Gallego
Initial version
"""
from __future__ import division, print_function
from SDSSconnect import DatabaseConnection
from To... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86555084f95f7e761045b55262c48702cf4fedb8 | 700 | py | Python | Python-desenvolvimento/ex109.py | MarcosMaciel-MMRS/Desenvolvimento-python | 2b2fc54788da3ca110d495b9e80a494f2b31fb09 | [
"MIT"
] | null | null | null | Python-desenvolvimento/ex109.py | MarcosMaciel-MMRS/Desenvolvimento-python | 2b2fc54788da3ca110d495b9e80a494f2b31fb09 | [
"MIT"
] | null | null | null | Python-desenvolvimento/ex109.py | MarcosMaciel-MMRS/Desenvolvimento-python | 2b2fc54788da3ca110d495b9e80a494f2b31fb09 | [
"MIT"
] | null | null | null | # Modifique as funes que form criadas no desafio 107 para que elas aceitem um parmetro a mais,
# informando se o valor retornado por elas vai ser ou no formatado pela funo moeda(), desenvolvida no desafio 108.
import moeda
#Programa Principal
valor = float(input('Digite o preo:R$ '))
print(f' A aumentando 10% ... | 63.636364 | 146 | 0.721429 | # Modifique as funções que form criadas no desafio 107 para que elas aceitem um parâmetro a mais,
# informando se o valor retornado por elas vai ser ou não formatado pela função moeda(), desenvolvida no desafio 108.
import moeda
#Programa Principal
valor = float(input('Digite o preço:R$ '))
print(f' A aumentand... | 30 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db216b646a4720cac5c7bf61c0221fc07bbc28d6 | 3,396 | py | Python | src/sciplot/analysis.py | simonUU/sciplot | 896a7a4efa7911a2bdf303311be674de12171fc4 | [
"MIT"
] | null | null | null | src/sciplot/analysis.py | simonUU/sciplot | 896a7a4efa7911a2bdf303311be674de12171fc4 | [
"MIT"
] | null | null | null | src/sciplot/analysis.py | simonUU/sciplot | 896a7a4efa7911a2bdf303311be674de12171fc4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Analysis tools
"""
import sciplot
import numpy as np
import matplotlib.pyplot as plt
from .functions import _hist_init
def plot_flatness(sig, tag, bins=None, ax=None, xrange=None, percent_step=5):
""" Plotting differences of sig distribution in percentiles of tag distribution
Arg... | 28.066116 | 101 | 0.595701 | # -*- coding: utf-8 -*-
""" Analysis tools
"""
import sciplot
import numpy as np
import matplotlib.pyplot as plt
from .functions import _hist_init
def plot_flatness(sig, tag, bins=None, ax=None, xrange=None, percent_step=5):
""" Plotting differences of sig distribution in percentiles of tag distribution
Arg... | 0 | 0 | 0 | 0 | 0 | 553 | 0 | 0 | 23 |
8de36e68ec6edfa63df90a9c396fa7136e08195b | 1,696 | py | Python | set2/CBCBitflipping.py | arunKumarNOP/Cryptopals-Solutions | 529474679972e17566a233de110f0b47078ef3b9 | [
"MIT"
] | null | null | null | set2/CBCBitflipping.py | arunKumarNOP/Cryptopals-Solutions | 529474679972e17566a233de110f0b47078ef3b9 | [
"MIT"
] | null | null | null | set2/CBCBitflipping.py | arunKumarNOP/Cryptopals-Solutions | 529474679972e17566a233de110f0b47078ef3b9 | [
"MIT"
] | null | null | null | import string
import random
from set2.PkcsPadding import pkcs7_pad_check
from set1.Xor import xorPlain
KEY = ''.join([chr(random.randint(0,255)) for i in range(16)])
IV = ''.join([chr(random.randint(0,255)) for i in range(16)])
if __name__ == '__main__':
# replace d with ; and second d with =
enc = format... | 39.44186 | 121 | 0.719929 | import string
import random
from set1.Aes_cipher import *
from set2.PkcsPadding import pkcs7_pad_check
from set1.Xor import xorPlain
KEY = ''.join([chr(random.randint(0,255)) for i in range(16)])
IV = ''.join([chr(random.randint(0,255)) for i in range(16)])
def format_string(user_input):
user_input = user_input.... | 0 | 0 | 0 | 0 | 0 | 500 | 0 | 8 | 91 |
164a70d52abb92a71df0d32864f77473b5e2decc | 12,608 | py | Python | networks/networks.py | nexuslrf/Tetris-RL | 94e4066ed08e87493141af37f11b1b2387b189a3 | [
"MIT"
] | 3 | 2020-12-15T18:08:22.000Z | 2020-12-18T06:09:49.000Z | networks/networks.py | nexuslrf/Tetris-RL | 94e4066ed08e87493141af37f11b1b2387b189a3 | [
"MIT"
] | null | null | null | networks/networks.py | nexuslrf/Tetris-RL | 94e4066ed08e87493141af37f11b1b2387b189a3 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
########Recurrent Architectures#########
########Actor Critic Architectures#########
| 36.651163 | 152 | 0.633883 | import torch
import torch.nn as nn
import torch.nn.functional as F
from networks.layers import NoisyLinear
from networks.network_bodies import SimpleBody, AtariBody
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class DQN(nn.Module):
def __init__(self, input_shape, num_actions, noisy=False,... | 0 | 0 | 0 | 12,070 | 0 | 0 | 0 | 64 | 277 |
a1dceaf9a2935d1a6ca59068bfb4fc8ca01168e5 | 4,201 | py | Python | orangecontrib/esrf/wofry/widgets/extension/ow_info.py | oasys-esrf-kit/OASYS1-ESRF-Extensions | 5df1ac01a1319d900380196c850504e09e36f9d6 | [
"MIT"
] | null | null | null | orangecontrib/esrf/wofry/widgets/extension/ow_info.py | oasys-esrf-kit/OASYS1-ESRF-Extensions | 5df1ac01a1319d900380196c850504e09e36f9d6 | [
"MIT"
] | null | null | null | orangecontrib/esrf/wofry/widgets/extension/ow_info.py | oasys-esrf-kit/OASYS1-ESRF-Extensions | 5df1ac01a1319d900380196c850504e09e36f9d6 | [
"MIT"
] | 1 | 2020-06-22T05:46:07.000Z | 2020-06-22T05:46:07.000Z | import sys
from PyQt5.QtWidgets import QApplication
if __name__ == "__main__":
import sys
from PyQt5.QtWidgets import QApplication
a = QApplication(sys.argv)
ow = OWWOInfo()
ow.show()
a.exec_()
ow.saveSettings() | 36.215517 | 153 | 0.685313 | import sys
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import QRect
from PyQt5.QtWidgets import QApplication, QFileDialog
from Shadow import ShadowTools as ST
from orangewidget import gui
from oasys.widgets import gui as oasysgui, widget
from oasys.util.oasys_util import EmittingStream
from orangecontrib.wof... | 0 | 0 | 0 | 3,556 | 0 | 0 | 0 | 200 | 201 |
6bfe089b4d6373b2da8ea4381602de6bb894705f | 728 | py | Python | projects/distribution_tools/Glue-and-C-Codec/build-rlglue-uninstall-script.py | sakaimiho/rl-glue-ext | 914b039849544a042f138cea2aa28c2b4af1b049 | [
"Apache-2.0"
] | 1 | 2017-05-26T03:21:24.000Z | 2017-05-26T03:21:24.000Z | projects/distribution_tools/Glue-and-C-Codec/build-rlglue-uninstall-script.py | cameron-upright/rl-glue-ext | 914b039849544a042f138cea2aa28c2b4af1b049 | [
"Apache-2.0"
] | null | null | null | projects/distribution_tools/Glue-and-C-Codec/build-rlglue-uninstall-script.py | cameron-upright/rl-glue-ext | 914b039849544a042f138cea2aa28c2b4af1b049 | [
"Apache-2.0"
] | null | null | null | import os
basePath = './install_root'
RLGlue_Files = []
pythonTemplateFileName='uninstall-rlglue-template.py'
pythonUninstallFileName='uninstall-resources/uninstall-rlglue.py'
for root, dirs, files in os.walk(basePath):
for f in files:
if f.endswith('.h') or f.endswith('.dylib') or f.endswith('a'):
thisName=os.... | 28 | 65 | 0.752747 | import os
basePath = './install_root'
RLGlue_Files = []
pythonTemplateFileName='uninstall-rlglue-template.py'
pythonUninstallFileName='uninstall-resources/uninstall-rlglue.py'
for root, dirs, files in os.walk(basePath):
for f in files:
if f.endswith('.h') or f.endswith('.dylib') or f.endswith('a'):
thisName=os.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1891f09831170e77f4a81261ea5280b9bd506b24 | 1,915 | py | Python | hello-world-book-programs/bank_account.py | kpatell/basic-python | 0a8384913b7baba302b7eeefbb002492bc035048 | [
"MIT"
] | null | null | null | hello-world-book-programs/bank_account.py | kpatell/basic-python | 0a8384913b7baba302b7eeefbb002492bc035048 | [
"MIT"
] | 2 | 2020-05-27T00:08:35.000Z | 2020-06-02T00:15:40.000Z | hello-world-book-programs/bank_account.py | kpatell/basic-python | 0a8384913b7baba302b7eeefbb002492bc035048 | [
"MIT"
] | null | null | null | # Krishan Patel
# Bank Account Class
"""Chaper 14: Objects
From Hello World! Computer Programming for Kids and Beginners
Copyright Warren and Carter Sande, 2009-2013
"""
# Chapter 14 - Try it out
# Testing out BankAccount class
print("----------Testing BankAccount----------")
bankAccount = BankAccount("Krishan Patel... | 25.197368 | 76 | 0.695039 | # Krishan Patel
# Bank Account Class
"""Chaper 14: Objects
From Hello World! Computer Programming for Kids and Beginners
Copyright Warren and Carter Sande, 2009-2013
"""
# Chapter 14 - Try it out
class BankAccount:
"""Creates a bank account"""
def __init__(self, name, account_number):
self.name = name... | 0 | 0 | 0 | 961 | 0 | 0 | 0 | 0 | 45 |
3d18f1d2709ff442b6691439e0c4a467a1de3bb7 | 6,358 | py | Python | lib/blessed/tests/test_wrap.py | AkshayJainG/qark | c9a4c0025a8538bdaf728c152be7052890d52336 | [
"Apache-2.0"
] | 1 | 2020-02-14T02:46:31.000Z | 2020-02-14T02:46:31.000Z | lib/blessed/tests/test_wrap.py | AkshayJainG/qark | c9a4c0025a8538bdaf728c152be7052890d52336 | [
"Apache-2.0"
] | null | null | null | lib/blessed/tests/test_wrap.py | AkshayJainG/qark | c9a4c0025a8538bdaf728c152be7052890d52336 | [
"Apache-2.0"
] | 1 | 2018-05-12T16:01:58.000Z | 2018-05-12T16:01:58.000Z |
def test_SequenceWrapper_invalid_width():
"""Test exception thrown from invalid width"""
WIDTH = -3
child()
def test_SequenceWrapper_drop_whitespace_subsequent_indent():
"""Test that text wrapping matches internal extra options."""
WIDTH = 10
child()
def test_SequenceWrapper_27(all_term... | 37.181287 | 78 | 0.572664 | import platform
import textwrap
import termios
import struct
import fcntl
import sys
from accessories import (
as_subprocess,
TestTerminal,
many_columns,
all_terms,
)
import pytest
def test_SequenceWrapper_invalid_width():
"""Test exception thrown from invalid width"""
WIDTH = -3
@as_su... | 0 | 5,621 | 0 | 0 | 0 | 0 | 0 | 21 | 282 |
cfb0c577d88de71fb6fbf5bae1c992844ad025b8 | 1,483 | py | Python | src/commands.py | Brodevil/Devil-bot | 1d6aab1004902ff9e9e727250006e4ba5b6a92eb | [
"MIT"
] | 2 | 2021-11-07T14:48:53.000Z | 2022-01-22T15:42:46.000Z | src/commands.py | NVS-OS/Devil-bot | 6d5bd63492fda342330012d4fdf664556360c206 | [
"MIT"
] | null | null | null | src/commands.py | NVS-OS/Devil-bot | 6d5bd63492fda342330012d4fdf664556360c206 | [
"MIT"
] | 1 | 2022-01-22T15:42:47.000Z | 2022-01-22T15:42:47.000Z | from logging import getLogger
log = getLogger(__name__)
| 28.519231 | 68 | 0.650034 | from logging import getLogger
from os import system
from discord.ext import commands
import discord
from src.constants import Colours
from src.exts.utils.converter import acute_remover
log = getLogger(__name__)
class Commands(commands.Cog):
"""A couple of simple commands."""
def __init__(self, bot: comma... | 8 | 957 | 0 | 222 | 0 | 39 | 0 | 45 | 158 |
3e892df4eefb7bfec84af46bf91134c50132288f | 763 | py | Python | Level1/Lessons12910/gamjapark.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons12910/gamjapark.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons12910/gamjapark.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | 1 | 2021-04-05T07:35:59.000Z | 2021-04-05T07:35:59.000Z | #
'''
.
1 (0.02ms, 10.2MB)
2 (0.01ms, 10.3MB)
3 (0.02ms, 10.2MB)
4 (0.02ms, 10.2MB)
5 (0.01ms, 10.1MB)
6 (3.22ms, 13.4MB)
7 (0.27ms, 10.3MB)
8 (0.00ms, 10.2MB)
9 (0.19ms, 10.2MB)
10 (0.13ms, 10.2MB)
11 (0.06ms, 10.2MB)
12 (0.06ms, 10.1MB)
13 (0.44ms, 10.3MB)
14 (0.28ms... | 20.621622 | 30 | 0.558322 | #나누어 떨어지는 숫자 배열
def solution(arr, divisor):
answer = []
for num in arr:
if num % divisor == 0:
answer.append(num)
if len(answer) == 0:
answer.append(-1)
else:
answer.sort()
return answer
'''
채점을 시작합니다.
정확성 테스트
테스트 1 〉 통과 (0.02ms, 10.2MB)
테스트 2 〉 통과 (0.01ms, 10... | 390 | 0 | 0 | 0 | 0 | 205 | 0 | 0 | 23 |
27e8a9ac4a7c3696b29b01db8e242a22ea071cad | 225 | py | Python | ogs5py/fileclasses/fct/__init__.py | GeoStat-Framework/ogs5py | 2bc4428c4c485d094e02c129ba5051745df58391 | [
"MIT"
] | 12 | 2018-12-11T15:44:58.000Z | 2022-03-30T19:04:42.000Z | ogs5py/fileclasses/fct/__init__.py | GeoStat-Framework/ogs5py | 2bc4428c4c485d094e02c129ba5051745df58391 | [
"MIT"
] | 4 | 2019-07-09T17:47:05.000Z | 2021-12-27T07:34:07.000Z | ogs5py/fileclasses/fct/__init__.py | MuellerSeb/ogs5py | 752e7bd2298fbd476406d168f6b7d1a85863dccd | [
"MIT"
] | 5 | 2019-04-04T19:47:56.000Z | 2021-04-28T21:56:39.000Z | # -*- coding: utf-8 -*-
"""
Class for the ogs FUNCTION file.
.. currentmodule:: ogs5py.fileclasses.fct
File Class
^^^^^^^^^^
.. autosummary::
FCT
----
"""
from ogs5py.fileclasses.fct.core import FCT
__all__ = ["FCT"]
| 12.5 | 43 | 0.617778 | # -*- coding: utf-8 -*-
"""
Class for the ogs FUNCTION file.
.. currentmodule:: ogs5py.fileclasses.fct
File Class
^^^^^^^^^^
.. autosummary::
FCT
----
"""
from ogs5py.fileclasses.fct.core import FCT
__all__ = ["FCT"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
413d6ea90fc1c4dec6a566570836cdea7bf79d30 | 14,542 | py | Python | main.py | luisjimenez6245/PANhunt | b240738f05534b860ac7631a4f2a8f5a7c56daaf | [
"BSD-3-Clause"
] | null | null | null | main.py | luisjimenez6245/PANhunt | b240738f05534b860ac7631a4f2a8f5a7c56daaf | [
"BSD-3-Clause"
] | null | null | null | main.py | luisjimenez6245/PANhunt | b240738f05534b860ac7631a4f2a8f5a7c56daaf | [
"BSD-3-Clause"
] | 1 | 2021-11-03T00:01:08.000Z | 2021-11-03T00:01:08.000Z | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2014, Dionach Ltd. All rights reserved. See LICENSE file.
#
# PANhunt: search directories and sub directories for documents with PANs
# By BB
import os
import sys
import re
import argparse
import time
import colorama
import psutil
from pathlib import Pa... | 45.021672 | 242 | 0.647022 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2014, Dionach Ltd. All rights reserved. See LICENSE file.
#
# PANhunt: search directories and sub directories for documents with PANs
# By BB
import os
import sys
import re
import argparse
import time
import hashlib
import platform
import colorama
import... | 0 | 288 | 0 | 1,286 | 0 | 6,231 | 0 | -21 | 295 |
b2029cf303c87e0b22674a5f443a78aa1bcde5d9 | 552 | py | Python | source/pacman-6.0.1/test/pacman/tests/sync-failover-404-with-body.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pacman-6.0.1/test/pacman/tests/sync-failover-404-with-body.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pacman-6.0.1/test/pacman/tests/sync-failover-404-with-body.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | self.description = "server failover after 404"
self.require_capability("curl")
p1 = pmpkg('pkg')
self.addpkg2db('sync', p1)
url_broke = self.add_simple_http_server({
'/{}'.format(p1.filename()): {
'code': 404,
'body': 'a',
}
})
url_good = self.add_simple_http_server({
'/{}'.format(p1.filen... | 22.08 | 58 | 0.652174 | self.description = "server failover after 404"
self.require_capability("curl")
p1 = pmpkg('pkg')
self.addpkg2db('sync', p1)
url_broke = self.add_simple_http_server({
'/{}'.format(p1.filename()): {
'code': 404,
'body': 'a',
}
})
url_good = self.add_simple_http_server({
'/{}'.format(p1.filen... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ea2929e2f5d4fee7d55d4896d37cd35be636e2f | 41 | py | Python | Chapter16/cf_rfem_hist_price/venv/lib/python3.6/hmac.py | wtwong316/Mastering-Elasticsearch-7.0 | 8e88f938c9feb201649bd23c4d517bc6af93fbaa | [
"MIT"
] | 25 | 2019-03-08T01:03:03.000Z | 2022-02-14T17:38:32.000Z | Chapter16/cf_rfem_hist_price/venv/lib/python3.6/hmac.py | wtwong316/Mastering-Elasticsearch-7.0 | 8e88f938c9feb201649bd23c4d517bc6af93fbaa | [
"MIT"
] | 2 | 2019-02-15T17:34:37.000Z | 2019-07-11T14:37:02.000Z | Chapter16/cf_rfem_hist_price/venv/lib/python3.6/hmac.py | wtwong316/Mastering-Elasticsearch-7.0 | 8e88f938c9feb201649bd23c4d517bc6af93fbaa | [
"MIT"
] | 31 | 2019-01-15T20:16:50.000Z | 2022-03-01T05:47:38.000Z | /home/wai/anaconda3/lib/python3.6/hmac.py | 41 | 41 | 0.804878 | /home/wai/anaconda3/lib/python3.6/hmac.py | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db4c24f362c99b3cb1df27bc2eb1176b77a4f008 | 7,070 | py | Python | dataset.py | YanWQ/MANet | e2ff92cd56efc25d446f1c0a12589d9cb56622cd | [
"MIT"
] | 12 | 2020-02-11T23:48:10.000Z | 2022-01-10T08:21:24.000Z | dataset.py | YanWQ/MANet | e2ff92cd56efc25d446f1c0a12589d9cb56622cd | [
"MIT"
] | 2 | 2020-06-05T02:30:37.000Z | 2020-07-31T05:52:45.000Z | dataset.py | YanWQ/MANet | e2ff92cd56efc25d446f1c0a12589d9cb56622cd | [
"MIT"
] | 5 | 2020-04-06T10:10:33.000Z | 2021-11-25T07:08:36.000Z | """
# ==================================
# AUTHOR : Yan Li, Qiong Wang
# CREATE DATE : 02.10.2020
# Contact : liyanxian19@gmail.com
# ==================================
# Change History: None
# ==================================
"""
########## Import python libs ##########
########## Import third-party libs... | 44.1875 | 126 | 0.510891 | """
# ==================================
# AUTHOR : Yan Li, Qiong Wang
# CREATE DATE : 02.10.2020
# Contact : liyanxian19@gmail.com
# ==================================
# Change History: None
# ==================================
"""
########## Import python libs ##########
import os
########## Import third... | 0 | 0 | 0 | 0 | 0 | 6,249 | 0 | -26 | 207 |
78c13784d32c761c1b294b5a62c277cbd505dae0 | 412 | py | Python | setup.py | LukeHD/lcd-controller2 | ff14b17794e22d07a906d489f551013c6ae55f87 | [
"MIT"
] | null | null | null | setup.py | LukeHD/lcd-controller2 | ff14b17794e22d07a906d489f551013c6ae55f87 | [
"MIT"
] | null | null | null | setup.py | LukeHD/lcd-controller2 | ff14b17794e22d07a906d489f551013c6ae55f87 | [
"MIT"
] | null | null | null | with open("README.md", "r") as fh:
long_description = fh.read()
from setuptools import setup, find_packages
setup(
name='lcd-controller2',
version='',
packages=find_packages('src'),
package_dir={'': 'src'},
url='',
license='',
author='Lukas Brennauer, Samuel Kroiss',
author_email=... | 19.619048 | 44 | 0.621359 | with open("README.md", "r") as fh:
long_description = fh.read()
from setuptools import setup, find_packages
setup(
name='lcd-controller2',
version='',
packages=find_packages('src'),
package_dir={'': 'src'},
url='',
license='',
author='Lukas Brennauer, Samuel Kroiss',
author_email=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e0dd0e2ac8c34672b793cac46e26e9582672846b | 54,363 | py | Python | chemsys/chemsys.py | tjczec01/symbolgen | e360810e872bb0041407d6d2f252683ea3b0c52d | [
"MIT"
] | null | null | null | chemsys/chemsys.py | tjczec01/symbolgen | e360810e872bb0041407d6d2f252683ea3b0c52d | [
"MIT"
] | null | null | null | chemsys/chemsys.py | tjczec01/symbolgen | e360810e872bb0041407d6d2f252683ea3b0c52d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 01:14:06 2020
Github: https://github.com/tjczec01
@author: Travis J Czechorski
E-mail: tjczec01@gmail.com
"""
import matplotlib.pyplot as plt
import warnings
__all__ = ["gui", "symbolgen", "kJtoJ", "create_pdf"]
warnings.filterwarnings("ignore") #... | 43.420927 | 359 | 0.505583 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 01:14:06 2020
Github: https://github.com/tjczec01
@author: Travis J Czechorski
E-mail: tjczec01@gmail.com
"""
import sympy as sp
from sympy import diff, Matrix, symbols, Add, Mul, Pow, Symbol, Integer, latex, exp, simplify
from sympy.matrices.dense im... | 0 | 0 | 0 | 51,991 | 0 | 531 | 0 | 179 | 355 |
359984d2efcf31862c177b8ad21ea7529ed252f1 | 7,628 | py | Python | tests/test_ethash.py | norswap/execution-specs | c2274790e8ac2d637c7dbe092477a1b21243916c | [
"CC0-1.0"
] | 1 | 2021-09-07T21:30:14.000Z | 2021-09-07T21:30:14.000Z | tests/test_ethash.py | norswap/execution-specs | c2274790e8ac2d637c7dbe092477a1b21243916c | [
"CC0-1.0"
] | null | null | null | tests/test_ethash.py | norswap/execution-specs | c2274790e8ac2d637c7dbe092477a1b21243916c | [
"CC0-1.0"
] | null | null | null | from random import randint
from ethereum.base_types import Uint
from ethereum.ethash import (EPOCH_SIZE, HASH_BYTES, dataset_size, generate_cache, generate_dataset_item, generate_seed)
#
# Geth DAG related functionalities for fuzz testing
#
def test_dataset_generation_random_epoch(tmpdir: str) -> None... | 31.00813 | 105 | 0.662166 | import json
import multiprocessing as mp
import os
import pkgutil
import shutil
import subprocess
import tarfile
import tempfile
from random import randint
from typing import Tuple, cast
import pytest
import requests
from ethereum.base_types import Uint
from ethereum.crypto import keccak256
from ethereum.ethash impor... | 0 | 262 | 0 | 0 | 0 | 4,826 | 0 | 55 | 586 |
8d98c01ed4c6b69f27663952ca8b02969b480b52 | 536 | py | Python | run/wsid_utils.py | osmanbaskaya/wsid | b486fb907a85981aa0d0c30210df1d0c33fcbff2 | [
"MIT"
] | 1 | 2016-12-22T21:41:21.000Z | 2016-12-22T21:41:21.000Z | run/wsid_utils.py | osmanbaskaya/wsid | b486fb907a85981aa0d0c30210df1d0c33fcbff2 | [
"MIT"
] | 4 | 2015-06-20T14:09:35.000Z | 2015-06-26T18:29:26.000Z | run/wsid_utils.py | osmanbaskaya/wsid | b486fb907a85981aa0d0c30210df1d0c33fcbff2 | [
"MIT"
] | 1 | 2018-05-11T00:12:59.000Z | 2018-05-11T00:12:59.000Z | __author__ = 'thorn'
import logging
LOGGER = logging.getLogger()
| 26.8 | 79 | 0.703358 | __author__ = 'thorn'
import logging
import sys
LOGGER = logging.getLogger()
def prepare_logger(log_level, filename=None):
log_level = getattr(logging, log_level.upper(), None)
if filename is None:
filename = sys.stderr
LOGGER.setLevel(level=log_level)
handler = logging.StreamHandler(filename... | 0 | 0 | 0 | 0 | 0 | 436 | 0 | -11 | 45 |
e9453d60c4d848a63a4895b1d3565c53b7257b94 | 2,866 | py | Python | 03_load/load.py | Informasjonsforvaltning/dataservice-publisher-etl | 1368a4036ccfe11a53bcc1d69c44b75e5b896413 | [
"Apache-2.0"
] | null | null | null | 03_load/load.py | Informasjonsforvaltning/dataservice-publisher-etl | 1368a4036ccfe11a53bcc1d69c44b75e5b896413 | [
"Apache-2.0"
] | 1 | 2021-09-14T10:09:55.000Z | 2021-10-01T07:19:32.000Z | 03_load/load.py | Informasjonsforvaltning/dataservice-publisher-etl | 1368a4036ccfe11a53bcc1d69c44b75e5b896413 | [
"Apache-2.0"
] | null | null | null | import json
import logging
from os import environ as env
import requests
from dotenv import load_dotenv
# Get environment
load_dotenv()
DATASERVICE_PUBLISHER_HOST_URL = env.get("DATASERVICE_PUBLISHER_HOST_URL")
ADMIN_USERNAME = env.get("ADMIN_USERNAME", "admin")
ADMIN_PASSWORD = env.get("ADMIN_PASSWORD")
INPUT_FILE =... | 31.844444 | 75 | 0.64201 | import json
import logging
from os import environ as env
import requests
from dotenv import load_dotenv
# Get environment
load_dotenv()
DATASERVICE_PUBLISHER_HOST_URL = env.get("DATASERVICE_PUBLISHER_HOST_URL")
ADMIN_USERNAME = env.get("ADMIN_USERNAME", "admin")
ADMIN_PASSWORD = env.get("ADMIN_PASSWORD")
INPUT_FILE =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
52b1621400649445d9209e1fd07f69c9b102cd5b | 4,602 | py | Python | create_model.py | shenalt/stroke_predictor | ab543200245ee51fce89f71d24e2acee74d6a152 | [
"MIT"
] | null | null | null | create_model.py | shenalt/stroke_predictor | ab543200245ee51fce89f71d24e2acee74d6a152 | [
"MIT"
] | null | null | null | create_model.py | shenalt/stroke_predictor | ab543200245ee51fce89f71d24e2acee74d6a152 | [
"MIT"
] | null | null | null | # Import our libraries
# Import pandas and numpy
import pandas as pd
import pickle
# Helper function to split our data
from sklearn.model_selection import train_test_split
# Import our Logistic Regression model
# Import helper functions to evaluate our model
# Import z-score helper function
import scipy.stat... | 31.958333 | 151 | 0.735115 | # Import our libraries
# Import pandas and numpy
import pandas as pd
import numpy as np
import pickle
import matplotlib.pyplot as plt
# Helper function to split our data
from sklearn.model_selection import train_test_split
# Import our Logistic Regression model
from sklearn.linear_model import LogisticRegressi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 150 | 134 |
38b9046147eb7b92e42ebab58b7eac2ed12093b0 | 2,507 | py | Python | porcupine/_ipc.py | rscales02/porcupine | 91b3c90d19d2291c0a60ddb9dffac931147cde3c | [
"MIT"
] | null | null | null | porcupine/_ipc.py | rscales02/porcupine | 91b3c90d19d2291c0a60ddb9dffac931147cde3c | [
"MIT"
] | null | null | null | porcupine/_ipc.py | rscales02/porcupine | 91b3c90d19d2291c0a60ddb9dffac931147cde3c | [
"MIT"
] | null | null | null | from multiprocessing import connection
import os
from porcupine import dirs
_ADDRESS_FILE = os.path.join(dirs.cachedir, 'ipc_address.txt')
# the addresses contain random junk so they are very unlikely to
# conflict with each other
# example addresses: r'\\.\pipe\pyc-1412-1-7hyryfd_',
# '/tmp/pymp-_lk54sed/listener-... | 29.845238 | 78 | 0.630634 | import contextlib
from multiprocessing import connection
import os
import queue
import threading
from porcupine import dirs
_ADDRESS_FILE = os.path.join(dirs.cachedir, 'ipc_address.txt')
# the addresses contain random junk so they are very unlikely to
# conflict with each other
# example addresses: r'\\.\pipe\pyc-1... | 0 | 669 | 0 | 0 | 0 | 0 | 0 | -18 | 89 |
5ddb4e0b6eb17f491af6b878f4f11a4fce1b453f | 1,700 | py | Python | EE.py | SDRAST/Physics | 09f0c44a86248844c80873922d7f38ef06421cb9 | [
"Apache-2.0"
] | null | null | null | EE.py | SDRAST/Physics | 09f0c44a86248844c80873922d7f38ef06421cb9 | [
"Apache-2.0"
] | null | null | null | EE.py | SDRAST/Physics | 09f0c44a86248844c80873922d7f38ef06421cb9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from Physics import eps_0, mu_0
from math import pi, sqrt
resistivity = {'copper': 1.7e-8, 'aluminum': 2.8e-8, 'iron': 1e-7,
'steel-electrical': 4.6e-7, 'steel-stainless': 6.9e-7,
'gold': 2.44e-8, 'silver': 1.68e-8,
'graphite-min': 2.5e-6, 'graphite-... | 24.637681 | 73 | 0.592353 | # -*- coding: utf-8 -*-
from Physics import eps_0, mu_0
from math import pi, sqrt
resistivity = {'copper': 1.7e-8, 'aluminum': 2.8e-8, 'iron': 1e-7,
'steel-electrical': 4.6e-7, 'steel-stainless': 6.9e-7,
'gold': 2.44e-8, 'silver': 1.68e-8,
'graphite-min': 2.5e-6, 'graphite-... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13fa079fceb6372fb93108ddbe5fa7ac5c341390 | 2,337 | py | Python | t2/test1.py | thagd/matias.exe | 87b5d425bc9a7334179b5fbce9cd5aa41caab302 | [
"MIT"
] | 2 | 2019-10-31T03:51:49.000Z | 2019-12-03T00:53:50.000Z | test1.py | FCChinen/lab2 | b04b4e0788678e4de2365b74db505ef1a72b7103 | [
"MIT"
] | null | null | null | test1.py | FCChinen/lab2 | b04b4e0788678e4de2365b74db505ef1a72b7103 | [
"MIT"
] | 3 | 2019-09-03T00:48:16.000Z | 2019-10-22T17:47:06.000Z | #!/usr/bin/env python3
import random
from mytcp import Servidor
foi_aceita = False
rede = CamadaRede()
dst_port = random.randint(10, 1023)
servidor = Servidor(rede, dst_port)
servidor.registrar_monitor_de_conexoes_aceitas(conexao_aceita)
src_port = random.randint(1024, 0xffff)
seq_no = random.randint(0, 0xffff)
src_... | 38.95 | 123 | 0.746684 | #!/usr/bin/env python3
import random
from mytcputils import *
from mytcp import Servidor
class CamadaRede:
def __init__(self):
self.callback = None
self.fila = []
def registrar_recebedor(self, callback):
self.callback = callback
def enviar(self, segmento, dest_addr):
self.fi... | 14 | 0 | 0 | 241 | 0 | 51 | 0 | 3 | 67 |
28c30ab04f705a434750d94a90d626d4859129fa | 5,245 | py | Python | minigugl/client.py | FraBle/minigugl | 2bfaab8daf1732fc3f2ed43fd743e8a1bfdb5843 | [
"MIT"
] | null | null | null | minigugl/client.py | FraBle/minigugl | 2bfaab8daf1732fc3f2ed43fd743e8a1bfdb5843 | [
"MIT"
] | null | null | null | minigugl/client.py | FraBle/minigugl | 2bfaab8daf1732fc3f2ed43fd743e8a1bfdb5843 | [
"MIT"
] | null | null | null | """Video stream client for Raspberry Pi-powered dash cam."""
import signal
import sys
from pathlib import Path
from typing import Any
import arrow
import cv2
from loguru import logger
from vidgear.gears import VideoGear, WriteGear
from minigugl import config
from minigugl.log import setup_logging
if config.settings.... | 31.596386 | 79 | 0.666921 | """Video stream client for Raspberry Pi-powered dash cam."""
import signal
import sys
from pathlib import Path
from typing import Any, Optional
import arrow
import cv2
from loguru import logger
from vidgear.gears import VideoGear, WriteGear
from minigugl import annotation, config
from minigugl.log import setup_loggin... | 0 | 0 | 0 | 0 | 0 | 1,195 | 0 | 22 | 23 |
11e709083c545777ba448930810585dfa41d391b | 1,770 | py | Python | mjpegserverpython.py | bootrino/maryjane | a1d7a3376a7a03e195e31221f473beeea33b895f | [
"MIT"
] | 63 | 2021-10-06T11:11:56.000Z | 2022-03-27T06:15:09.000Z | mjpegserverpython.py | bootrino/maryjane | a1d7a3376a7a03e195e31221f473beeea33b895f | [
"MIT"
] | 1 | 2021-10-08T20:31:28.000Z | 2021-10-08T20:52:54.000Z | mjpegserverpython.py | bootrino/maryjane | a1d7a3376a7a03e195e31221f473beeea33b895f | [
"MIT"
] | 6 | 2021-10-08T04:54:48.000Z | 2022-03-27T06:15:23.000Z | from sanic import Sanic
# MaryJane is an mjpeg server - it works by fetching *the same* jpeg image over and over from a ram drive
# MIT license
# copyright 2021 Andrew Stuart andrew.stuart@supercoders.com.au
app = Sanic(__name__)
if __name__ == '__main__':
try:
app.run(host="0.0.0.0", port=8080)
exce... | 37.659574 | 105 | 0.660452 | from sanic import response, Sanic
import asyncio
import timeit
# MaryJane is an mjpeg server - it works by fetching *the same* jpeg image over and over from a ram drive
# MIT license
# copyright 2021 Andrew Stuart andrew.stuart@supercoders.com.au
app = Sanic(__name__)
def package_mjpeg(img_bytes):
return (b'--fra... | 0 | 1,185 | 0 | 0 | 0 | 106 | 0 | -5 | 89 |
6756dee5d1d8dd52ec0505aaa5dcd97179cf6a96 | 3,483 | py | Python | test/unit/fixtures_adt_package.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 42 | 2019-01-16T13:16:09.000Z | 2022-03-23T20:13:00.000Z | test/unit/fixtures_adt_package.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 59 | 2019-02-23T07:16:56.000Z | 2022-02-28T09:34:47.000Z | test/unit/fixtures_adt_package.py | jakub-vaclavik-sap/sapcli | a0f40c3b2363bba0d34f705d92dd420d9adf3987 | [
"Apache-2.0"
] | 22 | 2019-03-12T08:15:44.000Z | 2022-01-10T03:56:47.000Z | GET_PACKAGE_ADT_XML='''<?xml version="1.0" encoding="utf-8"?>
<pak:package xmlns:pak="http://www.sap.com/adt/packages" xmlns:adtcore="http://www.sap.com/adt/core" adtcore:masterLanguage="EN" adtcore:name="$IAMTHEKING" adtcore:type="DEVC/K" adtcore:changedAt="2019-01-29T23:00:00Z" adtcore:version="active" adtcore:create... | 102.441176 | 411 | 0.765145 | GET_PACKAGE_ADT_XML='''<?xml version="1.0" encoding="utf-8"?>
<pak:package xmlns:pak="http://www.sap.com/adt/packages" xmlns:adtcore="http://www.sap.com/adt/core" adtcore:masterLanguage="EN" adtcore:name="$IAMTHEKING" adtcore:type="DEVC/K" adtcore:changedAt="2019-01-29T23:00:00Z" adtcore:version="active" adtcore:create... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8c5626a13188adaf0ae62f7ee28e2672a0df440b | 24,186 | py | Python | doctorAI.py | raghutata143/Healthcare_Analytics | bc48e1cb0e89d2956d3808517cf4cf84cc7517bd | [
"BSD-3-Clause"
] | 1 | 2021-02-23T05:10:17.000Z | 2021-02-23T05:10:17.000Z | doctorAI.py | raghutata143/Healthcare_Analytics | bc48e1cb0e89d2956d3808517cf4cf84cc7517bd | [
"BSD-3-Clause"
] | null | null | null | doctorAI.py | raghutata143/Healthcare_Analytics | bc48e1cb0e89d2956d3808517cf4cf84cc7517bd | [
"BSD-3-Clause"
] | 1 | 2021-02-23T05:10:18.000Z | 2021-02-23T05:10:18.000Z | #################################################################
# Code written by Edward Choi (mp2893@gatech.edu)
# For bug report, please contact author using the email address
#################################################################
import sys, random
import numpy as np
import cPickle as pickle
from colle... | 46.156489 | 351 | 0.717398 | #################################################################
# Code written by Edward Choi (mp2893@gatech.edu)
# For bug report, please contact author using the email address
#################################################################
import sys, random
import numpy as np
import cPickle as pickle
from colle... | 0 | 0 | 0 | 0 | 0 | 22,410 | 0 | 0 | 369 |
43ab7978cca3e92874497f2176611c1173d40ade | 2,511 | py | Python | python/pyserial-3.0/test/test_iolib.py | gotnone/hwa | 4648cf6072a06552d22cbf6498b35f3e24ce38d5 | [
"BSD-3-Clause"
] | 25 | 2015-08-05T12:36:24.000Z | 2021-03-26T01:51:58.000Z | python/pyserial-3.0/test/test_iolib.py | gotnone/hwa | 4648cf6072a06552d22cbf6498b35f3e24ce38d5 | [
"BSD-3-Clause"
] | 2 | 2018-09-13T05:45:37.000Z | 2020-06-18T15:00:51.000Z | python/pyserial-3.0/test/test_iolib.py | gotnone/hwa | 4648cf6072a06552d22cbf6498b35f3e24ce38d5 | [
"BSD-3-Clause"
] | 4 | 2016-09-18T08:58:35.000Z | 2020-07-16T11:43:29.000Z | #! /usr/bin/env python
#
# This file is part of pySerial - Cross platform serial port support for Python
# (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
Some tests for the serial module.
Part of pyserial (http://pyserial.sf.net) (C)2001-2009 cliechti@gmx.net
Intended... | 31.78481 | 79 | 0.621266 | #! /usr/bin/env python
#
# This file is part of pySerial - Cross platform serial port support for Python
# (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
Some tests for the serial module.
Part of pyserial (http://pyserial.sf.net) (C)2001-2009 cliechti@gmx.net
Intended... | 0 | 0 | 0 | 511 | 0 | 3 | 0 | 0 | 49 |
3b6e34ed6a4874e788fb9246884ac62a399aee1c | 844 | py | Python | settings/views.py | hudecof/bacchus | 1d7bafa2331535b27b336b42f07f8fe328f6d131 | [
"Apache-2.0"
] | 1 | 2020-04-15T14:31:48.000Z | 2020-04-15T14:31:48.000Z | settings/views.py | hudecof/bacchus | 1d7bafa2331535b27b336b42f07f8fe328f6d131 | [
"Apache-2.0"
] | 4 | 2019-04-13T08:35:51.000Z | 2019-04-13T15:08:47.000Z | settings/views.py | hudecof/bacchus | 1d7bafa2331535b27b336b42f07f8fe328f6d131 | [
"Apache-2.0"
] | 1 | 2019-03-25T07:48:29.000Z | 2019-03-25T07:48:29.000Z | # Create your views here.
| 32.461538 | 100 | 0.726303 | from django.shortcuts import render
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.core import serializers
# Create your views here.
from django.http import HttpResponse
from django.template import loader
from django.views... | 0 | 454 | 0 | 0 | 0 | 0 | 0 | 142 | 221 |
862ff91599547aadbc1b7ad7559acc383025966c | 504 | py | Python | tinder_api/utils/config.py | peterchun2000/TinderBioBot | bf968e1c4923a4d7b201df3b5bd5b9a950a81156 | [
"MIT"
] | null | null | null | tinder_api/utils/config.py | peterchun2000/TinderBioBot | bf968e1c4923a4d7b201df3b5bd5b9a950a81156 | [
"MIT"
] | null | null | null | tinder_api/utils/config.py | peterchun2000/TinderBioBot | bf968e1c4923a4d7b201df3b5bd5b9a950a81156 | [
"MIT"
] | null | null | null | with open("tinder_api/utils/token.txt", "r") as f:
tinder_token = f.read()
# it is best for you to write in the token to save yourself the file I/O
# especially if you have python byte code off
#tinder_token = ""
headers = {
'app_version': '6.9.4',
'platform': 'ios',
'content-type': 'application/json'... | 25.2 | 72 | 0.640873 | with open("tinder_api/utils/token.txt", "r") as f:
tinder_token = f.read()
# it is best for you to write in the token to save yourself the file I/O
# especially if you have python byte code off
#tinder_token = ""
headers = {
'app_version': '6.9.4',
'platform': 'ios',
'content-type': 'application/json'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3560d99e871344d4aeeafd4a7011d5815fffa435 | 250 | py | Python | accounts/referrals/exceptions.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | 2 | 2022-01-24T23:30:18.000Z | 2022-01-26T00:21:22.000Z | accounts/referrals/exceptions.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | accounts/referrals/exceptions.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | """
"""
# -----------------------------------------------------------------------------
| 19.230769 | 79 | 0.532 | """
"""
from revibe.exceptions import RevibeException
# -----------------------------------------------------------------------------
class BaseReferralException(RevibeException):
pass
class ReferralException(BaseReferralException):
pass
| 0 | 0 | 0 | 68 | 0 | 0 | 0 | 24 | 69 |
d7a3fe0014580a864aab1eeba100ec0239d99108 | 413 | py | Python | projects/fred-snyder-examples/windows-utils/auto_shutdown_windows.py | fred-snyder/notes-on-python | 1837a8999ea0d736ff3804417524b8d8cb1955e6 | [
"MIT"
] | 1 | 2022-03-15T22:03:45.000Z | 2022-03-15T22:03:45.000Z | projects/fred-snyder-examples/windows-utils/auto_shutdown_windows.py | fred-snyder/notes-on-python | 1837a8999ea0d736ff3804417524b8d8cb1955e6 | [
"MIT"
] | null | null | null | projects/fred-snyder-examples/windows-utils/auto_shutdown_windows.py | fred-snyder/notes-on-python | 1837a8999ea0d736ff3804417524b8d8cb1955e6 | [
"MIT"
] | null | null | null | """
Automatically shutdown windows after a user defined time period
"""
import subprocess
from time import sleep
print("")
print("Auto Shutdown Windows")
print("=====================")
print("")
seconds = float(raw_input("Specify time in minutes: ")) * 60.0
print("")
print(">>> Computer will force shutdown automatica... | 24.294118 | 85 | 0.670702 | """
Automatically shutdown windows after a user defined time period
"""
import subprocess
from time import sleep
print("")
print("Auto Shutdown Windows")
print("=====================")
print("")
seconds = float(raw_input("Specify time in minutes: ")) * 60.0
print("")
print(">>> Computer will force shutdown automatica... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ed144d022c7f8b2c0e85c46561ea4c039a0e079 | 720 | py | Python | Binary Search/744. Find Smallest Letter Greater Than Target.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 138 | 2020-02-08T05:25:26.000Z | 2021-11-04T11:59:28.000Z | Binary Search/744. Find Smallest Letter Greater Than Target.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | null | null | null | Binary Search/744. Find Smallest Letter Greater Than Target.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 24 | 2021-01-02T07:18:43.000Z | 2022-03-20T08:17:54.000Z | """
744. Find Smallest Letter Greater Than Target
Input:
letters = ["c", "f", "j"]
target = "a"
Output: "c"
Input:
letters = ["c", "f", "j"]
target = "c"
Output: "f"
Input:
letters = ["c", "f", "j"]
target = "d"
Output: "f"
Input:
letters = ["c", "f", "j"]
target = "g"
Output: "j"
Input:
le... | 16.744186 | 98 | 0.519444 | """
744. Find Smallest Letter Greater Than Target
Input:
letters = ["c", "f", "j"]
target = "a"
Output: "c"
Input:
letters = ["c", "f", "j"]
target = "c"
Output: "f"
Input:
letters = ["c", "f", "j"]
target = "d"
Output: "f"
Input:
letters = ["c", "f", "j"]
target = "g"
Output: "j"
Input:
le... | 0 | 0 | 0 | 254 | 0 | 0 | 0 | 0 | 24 |
2b341b6cc86aecc7029b54867d3868098ce9287a | 388 | py | Python | python/edgeNode/menu.py | santosh/.nuke | 1c87f82de0fcfcebfb3396ad65deffc754dae77a | [
"BSD-3-Clause"
] | 1 | 2020-02-06T22:31:39.000Z | 2020-02-06T22:31:39.000Z | python/edgeNode/menu.py | santosh/.nuke | 1c87f82de0fcfcebfb3396ad65deffc754dae77a | [
"BSD-3-Clause"
] | 9 | 2017-08-30T11:20:13.000Z | 2020-02-21T19:41:03.000Z | python/edgeNode/menu.py | santosh/.nuke | 1c87f82de0fcfcebfb3396ad65deffc754dae77a | [
"BSD-3-Clause"
] | 2 | 2019-08-22T07:41:04.000Z | 2021-01-19T14:56:04.000Z | # -*- coding: utf-8 -*-
SantoshMenu.addCommand("edgeNode/Jump to First", "edgeNode.jump_to_edge_node('top')")
SantoshMenu.addCommand("edgeNode/Jump to Last", "edgeNode.jump_to_edge_node('bottom')")
SantoshMenu.addCommand("edgeNode/View First", "edgeNode.view_edge_node('top')")
SantoshMenu.addCommand("edgeNode/View Las... | 48.5 | 87 | 0.773196 | # -*- coding: utf-8 -*-
import nuke
import edgeNode
SantoshMenu.addCommand("edgeNode/Jump to First", "edgeNode.jump_to_edge_node('top')")
SantoshMenu.addCommand("edgeNode/Jump to Last", "edgeNode.jump_to_edge_node('bottom')")
SantoshMenu.addCommand("edgeNode/View First", "edgeNode.view_edge_node('top')")
SantoshMenu.a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -16 | 44 |
c5d1f9fb86149208278b6c383c655979144a9a0e | 5,661 | py | Python | code/multiclient.py | xwan3115/Chat-Room | 1d3415ead06b4f612877909af9da31de327b47fb | [
"MIT"
] | null | null | null | code/multiclient.py | xwan3115/Chat-Room | 1d3415ead06b4f612877909af9da31de327b47fb | [
"MIT"
] | null | null | null | code/multiclient.py | xwan3115/Chat-Room | 1d3415ead06b4f612877909af9da31de327b47fb | [
"MIT"
] | null | null | null | #Python 3
#Usage: python3 UDPClient3.py localhost 12000
#coding: utf-8
import sys
# The argument of client
servername = sys.argv[1]
serverPort = sys.argv[2]
udpPort = sys.argv[3]
serverPort = int(serverPort)
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((servername, serverPort))
iflo... | 39.041379 | 117 | 0.571984 | #Python 3
#Usage: python3 UDPClient3.py localhost 12000
#coding: utf-8
from socket import *
import sys
# The argument of client
servername = sys.argv[1]
serverPort = sys.argv[2]
udpPort = sys.argv[3]
serverPort = int(serverPort)
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((servername... | 0 | 0 | 0 | 0 | 0 | 2,269 | 0 | -1 | 146 |
9254cee6730565f0da3ef736b1d1850ce942a265 | 461 | py | Python | openstack_dashboard/dashboards/techbk_head/dashboard.py | TechBK/horizon-dev | db426842116af515f00b9e7c887f4f3f9f28298c | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/techbk_head/dashboard.py | TechBK/horizon-dev | db426842116af515f00b9e7c887f4f3f9f28298c | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/techbk_head/dashboard.py | TechBK/horizon-dev | db426842116af515f00b9e7c887f4f3f9f28298c | [
"Apache-2.0"
] | null | null | null |
import horizon
horizon.register(Techbk_Head)
| 24.263158 | 86 | 0.704989 | from django.utils.translation import ugettext_lazy as _
import horizon
class Mygroup(horizon.PanelGroup):
slug = "firstgroup"
name = _("First Group")
panels = ('firstpanel','newpanel',)
class Techbk_Head(horizon.Dashboard):
name = _("Techbk Head")
slug = "techbk_head"
panels = (Mygroup,) # ... | 0 | 0 | 0 | 310 | 0 | 0 | 0 | 34 | 68 |
eb1d948d1dba72846fa6a82b0a43ff897a809dbe | 10,254 | py | Python | DA_test.py | selva604/DA_TBN | 240b3561eb5957e2827a5b8ef8fbd991d51489f4 | [
"MIT"
] | 1 | 2021-06-17T12:32:21.000Z | 2021-06-17T12:32:21.000Z | DA_test.py | selva604/DA_TBN | 240b3561eb5957e2827a5b8ef8fbd991d51489f4 | [
"MIT"
] | null | null | null | DA_test.py | selva604/DA_TBN | 240b3561eb5957e2827a5b8ef8fbd991d51489f4 | [
"MIT"
] | null | null | null | import torch.nn.parallel
#label
if __name__ == '__main__':
main()
| 37.423358 | 165 | 0.590014 | import os
import argparse
import time
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim
from sklearn.metrics import confusion_matrix, accuracy_score
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from dataset import TBNDataSet
from DA_model import TBN
from transfor... | 324 | 0 | 0 | 0 | 0 | 9,566 | 0 | 33 | 470 |
f8507130797ddd9ce63f9ec8aba8f0325588ca4a | 2,801 | py | Python | src/napari_morphodynamics/_tests/test_widget.py | guiwitz/napari-morphodynamics | f1300bc9a45864356d83eab95660ae3efec5435b | [
"BSD-3-Clause"
] | null | null | null | src/napari_morphodynamics/_tests/test_widget.py | guiwitz/napari-morphodynamics | f1300bc9a45864356d83eab95660ae3efec5435b | [
"BSD-3-Clause"
] | null | null | null | src/napari_morphodynamics/_tests/test_widget.py | guiwitz/napari-morphodynamics | f1300bc9a45864356d83eab95660ae3efec5435b | [
"BSD-3-Clause"
] | null | null | null | import napari_morphodynamics
import napari_morphodynamics.napari_gui
def test_data_exist(dataset):
"""Test that the data exists."""
assert dataset.joinpath("synth_ch1.h5").is_file()
assert dataset.joinpath("synth_ch2.h5").is_file()
assert dataset.joinpath("synth_ch3.h5").is_file()
def test_set_dataset... | 37.851351 | 110 | 0.717958 | import pytest
import napari_morphodynamics
import napari_morphodynamics.napari_gui
from morphodynamics.data import synth
import numpy as np
import h5py
import napari_morphodynamics
@pytest.fixture(scope="session")
def dataset(tmp_path_factory):
"""Create a dataset for testing."""
new_path = tmp_path_factory.... | 0 | 901 | 0 | 0 | 0 | 1,041 | 0 | 2 | 203 |
2a1405546ed30a2c236a5eefc1d8dcfc524c4fb2 | 2,711 | py | Python | scratch/odf.py | JohnGriffiths/dipy | 5fb38e9b77547cdaf5eb140730444535733ae01d | [
"BSD-3-Clause"
] | 3 | 2015-07-31T20:43:18.000Z | 2019-07-26T13:58:07.000Z | scratch/odf.py | JohnGriffiths/dipy | 5fb38e9b77547cdaf5eb140730444535733ae01d | [
"BSD-3-Clause"
] | 9 | 2015-05-13T17:44:42.000Z | 2018-05-27T20:09:55.000Z | scratch/odf.py | JohnGriffiths/dipy | 5fb38e9b77547cdaf5eb140730444535733ae01d | [
"BSD-3-Clause"
] | 3 | 2016-08-05T22:43:16.000Z | 2017-06-23T18:35:13.000Z | import numpy as np
from enthought.mayavi import mlab
import Image
if __name__ == '__main__':
import dipy.core.qball as qball
from dipy.io.bvectxt import read_bvec_file
filename='/Users/bagrata/HARDI/E1322S8I1.nii.gz'
grad_table_filename='/Users/bagrata/HARDI/E1322S8I1.bvec'
from nipy import load_im... | 32.27381 | 79 | 0.568794 | import numpy as np
from enthought.mayavi import mlab
import Image
def disp_odf(sph_map, theta_res=64, phi_res=32, colormap='RGB', colors=256):
pi = np.pi
sin = np.sin
cos = np.cos
theta, phi = np.mgrid[0:2*pi:theta_res*1j, 0:pi:phi_res*1j]
x = sin(phi)*cos(theta)
y = sin(phi)*sin(theta)
... | 0 | 0 | 0 | 0 | 0 | 1,789 | 0 | 0 | 46 |
50d614b501cdda6de87d46c5e94382c1d58a0243 | 513 | py | Python | word_edit/spellcheck_utils.py | binhetech/PIE-GEC | 99b46f38d11f8c10c3e0c0758c68633729e70ce7 | [
"MIT"
] | 1 | 2021-07-14T07:08:48.000Z | 2021-07-14T07:08:48.000Z | word_edit/spellcheck_utils.py | binhetech/PIE-GEC | 99b46f38d11f8c10c3e0c0758c68633729e70ce7 | [
"MIT"
] | null | null | null | word_edit/spellcheck_utils.py | binhetech/PIE-GEC | 99b46f38d11f8c10c3e0c0758c68633729e70ce7 | [
"MIT"
] | null | null | null | import re
reg_ex = re.compile(r"^[a-z][a-z]*[a-z]$")
no_reg_ex = re.compile(r".*[0-9].*")
mc_reg_ex = re.compile(r".*[A-Z].*[A-Z].*")
def containsNumber(text):
"""."""
return no_reg_ex.match(text)
def containsMultiCapital(text):
"""."""
return mc_reg_ex.match(text)
def can_spellcheck(w: str):
... | 20.52 | 84 | 0.617934 | import re
reg_ex = re.compile(r"^[a-z][a-z]*[a-z]$")
no_reg_ex = re.compile(r".*[0-9].*")
mc_reg_ex = re.compile(r".*[A-Z].*[A-Z].*")
def containsNumber(text):
"""包含数字."""
return no_reg_ex.match(text)
def containsMultiCapital(text):
"""包含多个大写字母."""
return mc_reg_ex.match(text)
def can_spellcheck(... | 72 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9ec7e7ba75545a14f295f33d86c287dc2df77f62 | 1,951 | py | Python | tests/test_community.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 5 | 2022-01-19T12:55:35.000Z | 2022-03-10T13:17:22.000Z | tests/test_community.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 5 | 2022-02-18T08:17:04.000Z | 2022-02-23T13:50:15.000Z | tests/test_community.py | Biomathsys/ncmw | e3a128f15a4183a67f32f9874519c18a319accc8 | [
"MIT"
] | 1 | 2021-12-02T12:23:59.000Z | 2021-12-02T12:23:59.000Z |
from ncmw.utils import get_models
from ncmw.community.community_models import (BagOfReactionsModel, ShuttleCommunityModel)
MODELS = get_models("models")
COMMUNITY_MODELS = [BagOfReactionsModel, ShuttleCommunityModel]
| 32.516667 | 85 | 0.6694 | from pandas.core.algorithms import isin
import pytest
from ncmw.utils import get_models
import numpy as np
from pandas import DataFrame
from ncmw.community.community_models import (
BagOfReactionsModel,
ShuttleCommunityModel,
create_stoichiometry_matrix,
)
MODELS = get_models("models")
CO... | 0 | 1,514 | 0 | 0 | 0 | 0 | 0 | 62 | 142 |
3bbd10b60a915bd390b2704473ef45e5842576df | 1,499 | py | Python | server/assets/ImageRotationCorrection.py | Trafalcon/Parsr | d5aab6d1b4da6c37a30b25062fcaff682daa0a83 | [
"Apache-2.0"
] | 1 | 2020-01-15T03:49:04.000Z | 2020-01-15T03:49:04.000Z | server/assets/ImageRotationCorrection.py | Trafalcon/Parsr | d5aab6d1b4da6c37a30b25062fcaff682daa0a83 | [
"Apache-2.0"
] | null | null | null | server/assets/ImageRotationCorrection.py | Trafalcon/Parsr | d5aab6d1b4da6c37a30b25062fcaff682daa0a83 | [
"Apache-2.0"
] | 1 | 2020-01-25T19:35:34.000Z | 2020-01-25T19:35:34.000Z | # -*- coding: utf-8 -*-
"""
Automatically detect rotation and line spacing of an image of text using
Radon transform
If image is rotated by the inverse of the output, the lines will be
horizontal (though they may be upside-down depending on the original image)
It doesn't work with black borders
Courtesy: https://gist.... | 27.759259 | 75 | 0.691127 | # -*- coding: utf-8 -*-
"""
Automatically detect rotation and line spacing of an image of text using
Radon transform
If image is rotated by the inverse of the output, the lines will be
horizontal (though they may be upside-down depending on the original image)
It doesn't work with black borders
Courtesy: https://gist.... | 0 | 0 | 0 | 0 | 0 | 588 | 0 | 45 | 236 |
015174dcc56a54eb2c9777530571307d3a152bea | 5,016 | py | Python | requestor-python/engine.py | Edhendil/golem-transcoding | 69ef784e7c7b36b45b1e5f2e292dacd9b9dec3bd | [
"MIT"
] | 1 | 2021-10-14T07:48:43.000Z | 2021-10-14T07:48:43.000Z | requestor-python/engine.py | Edhendil/golem-transcoding | 69ef784e7c7b36b45b1e5f2e292dacd9b9dec3bd | [
"MIT"
] | null | null | null | requestor-python/engine.py | Edhendil/golem-transcoding | 69ef784e7c7b36b45b1e5f2e292dacd9b9dec3bd | [
"MIT"
] | null | null | null |
# image hash of the geomandel docker image uploaded to golem
# _IMAGE_LINK = "896909125d8dc19918dc73fe7540ca45cfe87f434ed37f51edb20a4e"
# geomandel image
# _IMAGE_LINK = "47cd0f045333d837304d61f74266a1bcd49ad3cb0690a10f08d37bf4"
# ubuntu ffmpeg
_IMAGE_LINK = "febcd478b3e00b3d40a6d2a69a4932eedcc4440a1fe7658fbb626264"
... | 42.151261 | 121 | 0.691786 | from yapapi.runner import Engine, Task, vm
from yapapi.runner.ctx import WorkContext
from yapapi.log import log_summary, log_event_repr
from datetime import timedelta
import json
import uuid
from core import TranscodingData, TranscodingTask, GolemParameters, SubtaskFinishedEvent
# image hash of the geomandel docker i... | 0 | 563 | 1,944 | 1,542 | 0 | 0 | 0 | 126 | 250 |
dee92484cdddf1c5220a5e6fbd6d1fac63977161 | 4,711 | py | Python | utils/ofb/brioche.py | luis-guilherme/mitra | 18bd935b11dc8fcf594255a96809c05abc324e87 | [
"MIT"
] | 864 | 2020-09-22T18:52:27.000Z | 2022-03-28T19:57:25.000Z | utils/ofb/brioche.py | luis-guilherme/mitra | 18bd935b11dc8fcf594255a96809c05abc324e87 | [
"MIT"
] | 13 | 2020-09-24T10:42:21.000Z | 2021-12-20T14:44:36.000Z | utils/ofb/brioche.py | luis-guilherme/mitra | 18bd935b11dc8fcf594255a96809c05abc324e87 | [
"MIT"
] | 55 | 2020-09-22T19:01:19.000Z | 2022-03-20T09:15:45.000Z | #!/usr/bin/env python3
"""
Take a polyglot from mitra,
generate a OFB ciphertext which decrypts correctly under two different keys.
iv = dec(c0 ^ p0)
"""
import binascii
import os
import argparse
import re
BLOCKLEN = 16
pad16 = lambda s: s + b"\0" * (16-len(s))
b2a = lambda b: repr(b)[2:-1]
dir_path = os.p... | 23.673367 | 112 | 0.645511 | #!/usr/bin/env python3
"""
Take a polyglot from mitra,
generate a OFB ciphertext which decrypts correctly under two different keys.
iv = dec(c0 ^ p0)
"""
import binascii
import os
import argparse
import re
from Crypto.Cipher import AES
from Crypto.Util.number import long_to_bytes,bytes_to_long
from Crypto.Util.numbe... | 0 | 0 | 0 | 0 | 0 | 1,434 | 0 | 105 | 227 |
b74f94271b1a62635133976cb4d4c8f2577f2456 | 3,763 | py | Python | robotcode/utils/event.py | mardukbp/robotcode | 0b34cf6e7931423117036fcf70f74e27da0cfb0f | [
"Apache-2.0"
] | 21 | 2021-03-11T19:37:31.000Z | 2022-02-28T05:26:33.000Z | robotcode/utils/event.py | mardukbp/robotcode | 0b34cf6e7931423117036fcf70f74e27da0cfb0f | [
"Apache-2.0"
] | 46 | 2021-03-11T10:58:38.000Z | 2022-03-31T10:15:54.000Z | robotcode/utils/event.py | mardukbp/robotcode | 0b34cf6e7931423117036fcf70f74e27da0cfb0f | [
"Apache-2.0"
] | 1 | 2021-11-08T10:32:57.000Z | 2021-11-08T10:32:57.000Z | from __future__ import annotations
from typing import (Any, Callable, TypeVar)
__all__ = ["EventIterator", "Event"]
_TResult = TypeVar("_TResult")
_TCallable = TypeVar("_TCallable", bound=Callable[..., Any])
_TEvent = TypeVar("_TEvent")
| 31.358333 | 107 | 0.632208 | from __future__ import annotations
import inspect
import threading
import weakref
from types import MethodType
from typing import (
Any,
Callable,
Generic,
Iterator,
List,
MutableSet,
Optional,
Type,
TypeVar,
cast,
)
__all__ = ["EventIterator", "Event"]
_TResult = TypeVar("_TR... | 0 | 0 | 0 | 3,199 | 0 | 0 | 0 | 90 | 227 |
2060a376f3709a1461c8c0665bd025049e2615a2 | 7,773 | py | Python | stiny/__init__.py | stevearc/stiny | 9577433a167beb548ce1db19d46f163a6624c334 | [
"MIT"
] | null | null | null | stiny/__init__.py | stevearc/stiny | 9577433a167beb548ce1db19d46f163a6624c334 | [
"MIT"
] | null | null | null | stiny/__init__.py | stevearc/stiny | 9577433a167beb548ce1db19d46f163a6624c334 | [
"MIT"
] | null | null | null | """ Stiny - A home automation assistant """
import os
import calendar
import datetime
import logging
from collections import defaultdict
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.config import Configurator
from pyramid.httpexcep... | 34.856502 | 84 | 0.684034 | """ Stiny - A home automation assistant """
import os
import posixpath
import calendar
import datetime
import json
import logging
import requests
from collections import defaultdict
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.conf... | 0 | 0 | 0 | 0 | 0 | 570 | 0 | -21 | 112 |
fcfe2ea3b1145664ae4996cace5cb3b01ec0ed4b | 776 | py | Python | utils/get_params.py | sk1t0n/tg-bot-parser-hhru | abb59ea39ce0fb51fcc14f8b0195d2e9ba8d435e | [
"MIT"
] | null | null | null | utils/get_params.py | sk1t0n/tg-bot-parser-hhru | abb59ea39ce0fb51fcc14f8b0195d2e9ba8d435e | [
"MIT"
] | null | null | null | utils/get_params.py | sk1t0n/tg-bot-parser-hhru | abb59ea39ce0fb51fcc14f8b0195d2e9ba8d435e | [
"MIT"
] | null | null | null | """
Creates a URL to search jobs on specific filters.
"""
experience = {
'No': 'noExperience',
'1-3': 'between1And3',
'3-6': 'between3And6',
'More 6': 'moreThan6'
}
areas = {
'Moscow': '1',
'StPetersburg': '2',
'Krasnodar': '53'
}
| 21.555556 | 59 | 0.596649 | """
Creates a URL to search jobs on specific filters.
"""
from typing import Dict, Union
import config
experience = {
'No': 'noExperience',
'1-3': 'between1And3',
'3-6': 'between3And6',
'More 6': 'moreThan6'
}
areas = {
'Moscow': '1',
'StPetersburg': '2',
'Krasnodar': '53'
}
def create... | 0 | 0 | 0 | 0 | 0 | 444 | 0 | 1 | 69 |
f4115829a9a942fe7b9671300eb6856d3abd38c8 | 2,998 | py | Python | Houdini/Handlers/Play/Item.py | amrmashriqi/Houdini | f91687a305ad88e2043057fd001620639bb5af0a | [
"MIT"
] | null | null | null | Houdini/Handlers/Play/Item.py | amrmashriqi/Houdini | f91687a305ad88e2043057fd001620639bb5af0a | [
"MIT"
] | null | null | null | Houdini/Handlers/Play/Item.py | amrmashriqi/Houdini | f91687a305ad88e2043057fd001620639bb5af0a | [
"MIT"
] | null | null | null |
cardStarterDeckId = 821
fireBoosterDeckId = 8006
waterBoosterDeckId = 8010
boosterDecks = {
cardStarterDeckId: [1, 6, 9, 14, 17, 20, 22, 23, 26, 73, 89, 81],
fireBoosterDeckId: [3, 18, 216, 222, 229, 303, 304, 314, 319, 250, 352],
waterBoosterDeckId: [202, 204, 305, 15, 13, 312, 218, 220, 29, 90]
}
| 34.45977 | 93 | 0.704803 | from beaker.cache import cache_region as Cache, region_invalidate as Invalidate
from Houdini.Handlers import Handlers, XT
from Houdini.Handlers.Play.Moderation import cheatBan
from Houdini.Data.Penguin import Inventory
cardStarterDeckId = 821
fireBoosterDeckId = 8006
waterBoosterDeckId = 8010
boosterDecks = {
ca... | 0 | 2,323 | 0 | 0 | 0 | 0 | 0 | 131 | 227 |
2ec159a3ea2dc9bd376faa5ae61d365d7adf7567 | 20,985 | py | Python | main.py | YOULOF2/Galactika | de1964ae0643590b614d7d8ee721d69926bb1075 | [
"MIT"
] | 1 | 2021-03-25T10:43:55.000Z | 2021-03-25T10:43:55.000Z | main.py | YOULOF2/Galactika | de1964ae0643590b614d7d8ee721d69926bb1075 | [
"MIT"
] | null | null | null | main.py | YOULOF2/Galactika | de1964ae0643590b614d7d8ee721d69926bb1075 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_ckeditor import CKEditor
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_gravatar import Gravatar
import os
import requests
from wallpapers import WALLPAPERS
from dotenv import load_dotenv
import o... | 39.744318 | 121 | 0.530474 | from flask import Flask, request, render_template, redirect, url_for, flash, abort, send_from_directory
from flask_bootstrap import Bootstrap
from flask_ckeditor import CKEditor
from datetime import date
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlche... | 0 | 9,885 | 0 | 4,031 | 0 | 790 | 0 | 316 | 1,017 |
ac50c9f36dcbea9928111afa8816ae2d5946914f | 3,013 | py | Python | SynthQuickstartTemplate.py | aws-quickstart/quickstart-aws-biotech-blueprint-cdk | 3500bf5ec455a034a7d2d1074b68073d13ad76cd | [
"Apache-2.0",
"MIT-0"
] | 8 | 2021-02-18T16:06:56.000Z | 2022-03-11T16:24:42.000Z | SynthQuickstartTemplate.py | paulu-aws/quickstart-aws-biotech-blueprint-cdk | 93cbe2d71dc72530fac99014773fde64bad56495 | [
"Apache-2.0",
"MIT-0"
] | 7 | 2021-04-02T18:05:33.000Z | 2022-02-15T22:48:22.000Z | SynthQuickstartTemplate.py | paulu-aws/quickstart-aws-biotech-blueprint-cdk | 93cbe2d71dc72530fac99014773fde64bad56495 | [
"Apache-2.0",
"MIT-0"
] | 9 | 2021-02-18T16:14:25.000Z | 2022-03-30T20:17:04.000Z | import os
import yaml
folders = []
files = []
for entry in os.scandir('./lambda_functions/source/'):
if entry.is_dir():
if "asset." not in entry.path:
print("WARN: Skipping path...")
else:
folders.append(entry.path)
templateStream = open('./templates/AwsBiotechBlueprint.t... | 41.847222 | 183 | 0.596747 | import os
import yaml
folders = []
files = []
for entry in os.scandir('./lambda_functions/source/'):
if entry.is_dir():
if "asset." not in entry.path:
print("WARN: Skipping path...")
else:
folders.append(entry.path)
templateStream = open('./templates/AwsBiotechBlueprint.t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f19ed7865020b380c9590a1b3e1cccd8d9dbbe49 | 1,425 | py | Python | LeetCode_OneEditDistance.py | amukher3/Problem_solutions | 8fa6014a91f295d08cafb989024caa91d99211d9 | [
"Apache-2.0"
] | 1 | 2021-12-28T08:58:51.000Z | 2021-12-28T08:58:51.000Z | LeetCode_OneEditDistance.py | amukher3/Coding | a330cb04b5dd5cc1c3cf69249417a71586441bc7 | [
"Apache-2.0"
] | null | null | null | LeetCode_OneEditDistance.py | amukher3/Coding | a330cb04b5dd5cc1c3cf69249417a71586441bc7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 08:39:36 2020
@author: abhi0
"""
| 24.152542 | 57 | 0.412632 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 16 08:39:36 2020
@author: abhi0
"""
class Solution:
def isOneEditDistance(self, s: str, t: str) -> bool:
if s==t:
return False
if len(s)-len(t)>1:
return False
if len(t)-len(s)>1:
... | 0 | 0 | 0 | 1,312 | 0 | 0 | 0 | 0 | 24 |
f6a2109f5c8ab12cff7af75ada06b22aa5d208dd | 445 | py | Python | web_app/__init__.py | jasimrashid/airbnb | c78e69050a824d681794459d44a5915710e50153 | [
"MIT"
] | null | null | null | web_app/__init__.py | jasimrashid/airbnb | c78e69050a824d681794459d44a5915710e50153 | [
"MIT"
] | null | null | null | web_app/__init__.py | jasimrashid/airbnb | c78e69050a824d681794459d44a5915710e50153 | [
"MIT"
] | null | null | null | # web_app/__init__.py
if __name__ == "__main__":
my_app = create_app()
my_app.run(debug=True)
| 18.541667 | 52 | 0.750562 | # web_app/__init__.py
from flask import Flask
import os
from dotenv import load_dotenv
from web_app.routes.home_routes import home_routes
from web_app.routes.stats_routes import stats_routes
def create_app():
app = Flask(__name__)
app.register_blueprint(home_routes)
app.register_blueprint(stats_routes)
... | 0 | 0 | 0 | 0 | 0 | 147 | 0 | 59 | 134 |
f9f1195387846bdb0a095420fbab31e4f29f1620 | 1,203 | py | Python | model/backbone.py | aditya0212jain/fast_face_tf | 511e94ef61932ff32d9bfea9ce5d5e45e3e44ac3 | [
"MIT"
] | 2 | 2020-02-28T11:05:25.000Z | 2020-09-16T02:50:34.000Z | model/backbone.py | aditya0212jain/fast_face_tf | 511e94ef61932ff32d9bfea9ce5d5e45e3e44ac3 | [
"MIT"
] | null | null | null | model/backbone.py | aditya0212jain/fast_face_tf | 511e94ef61932ff32d9bfea9ce5d5e45e3e44ac3 | [
"MIT"
] | null | null | null | # import tensorflow.contrib.slim as slim
import tensorflow.keras as keras
def get_feature_extracting_model(input_tensor=None,input_shape=(480,640,3),model_name='resnet50',layer_index=[6,38,80,142,174]):
"""
input_shape : the input size of the image
model_name : which backbone model to be used for feature ... | 44.555556 | 146 | 0.729842 | import numpy as np
import tensorflow as tf
from PIL import Image
import glob
import os
# import tensorflow.contrib.slim as slim
import tensorflow.keras as keras
def get_feature_extracting_model(input_tensor=None,input_shape=(480,640,3),model_name='resnet50',layer_index=[6,38,80,142,174]):
"""
input_shape : the... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -23 | 110 |
ff7e2e3511ce6d7046cc747e90209397c73bb365 | 16,892 | py | Python | streambox/test/test.py | chenzongxiong/streambox | 76f95780d1bf6c02731e39d8ac73937cea352b95 | [
"Unlicense"
] | 3 | 2019-07-03T14:03:31.000Z | 2021-12-19T10:18:49.000Z | streambox/test/test.py | chenzongxiong/streambox | 76f95780d1bf6c02731e39d8ac73937cea352b95 | [
"Unlicense"
] | 6 | 2020-02-17T12:01:30.000Z | 2021-12-09T22:02:33.000Z | streambox/test/test.py | chenzongxiong/streambox | 76f95780d1bf6c02731e39d8ac73937cea352b95 | [
"Unlicense"
] | 2 | 2020-12-03T04:41:18.000Z | 2021-01-11T21:44:42.000Z | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Android system-wide tracing utility.
This is a tool for capturing a trace that includes data from both userland and
the kernel... | 30.381295 | 118 | 0.645749 | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Android system-wide tracing utility.
This is a tool for capturing a trace that includes data from both userland and
the kernel... | 0 | 0 | 0 | 0 | 0 | 11,868 | 0 | 3 | 202 |
7fb19bf16eeaacf9764b0e90d00fecc4871476b5 | 10,182 | py | Python | others/ewm_group_mean.py | rahasayantan/Work-For-Reference | e052da538df84034ec5a0fe3b19c4287de307286 | [
"MIT"
] | null | null | null | others/ewm_group_mean.py | rahasayantan/Work-For-Reference | e052da538df84034ec5a0fe3b19c4287de307286 | [
"MIT"
] | null | null | null | others/ewm_group_mean.py | rahasayantan/Work-For-Reference | e052da538df84034ec5a0fe3b19c4287de307286 | [
"MIT"
] | null | null | null | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn import preprocessing, model_selection, metr... | 50.91 | 147 | 0.585445 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn import preprocessing, model_selection, metr... | 15 | 0 | 0 | 0 | 0 | 8,190 | 0 | 0 | 46 |
b26f47923d5ad384c704a9abb1733c15ca92f5f3 | 433 | py | Python | mobilebdd/webdriver_processor.py | PhoenixWright/MobileBDDCore | b133061cf2c8b8d95ea9164734b726ee8a3c03a0 | [
"Apache-2.0"
] | null | null | null | mobilebdd/webdriver_processor.py | PhoenixWright/MobileBDDCore | b133061cf2c8b8d95ea9164734b726ee8a3c03a0 | [
"Apache-2.0"
] | null | null | null | mobilebdd/webdriver_processor.py | PhoenixWright/MobileBDDCore | b133061cf2c8b8d95ea9164734b726ee8a3c03a0 | [
"Apache-2.0"
] | null | null | null | # spec for webdriver processors
| 27.0625 | 77 | 0.660508 | # spec for webdriver processors
class WebDriverProcessor(object):
"""Allows outside users to have the final say on things like capabilities
that are used to instantiate WebDriver.
"""
def __init__(self):
pass
def process_capabilities(self, capabilities):
"""Process capabilities pas... | 0 | 0 | 0 | 378 | 0 | 0 | 0 | 0 | 23 |
df4ddd8d21c48df995e80724c52440730be17034 | 61 | py | Python | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/A/atomic unit of electric field.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/A/atomic unit of electric field.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/A/atomic unit of electric field.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | constants.physical_constants["atomic unit of electric field"] | 61 | 61 | 0.852459 | constants.physical_constants["atomic unit of electric field"] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a86e9bd2a90888f6e8f5c43dd81e475a2ed2359 | 7,496 | py | Python | freechess/stats.py | captnswing/freechess | c043bc7ba4216be72182762ac2b6c2117f11105d | [
"Apache-2.0"
] | null | null | null | freechess/stats.py | captnswing/freechess | c043bc7ba4216be72182762ac2b6c2117f11105d | [
"Apache-2.0"
] | null | null | null | freechess/stats.py | captnswing/freechess | c043bc7ba4216be72182762ac2b6c2117f11105d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 48.051282 | 125 | 0.655416 | # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.http import HttpResponseServerError
from django.template import RequestContext
from freechess.models import ChessGame
from dateutil.relativedelta import relativedelta
import datetime
def chessStats(request):
# some general variabl... | 0 | 0 | 0 | 0 | 0 | 7,205 | 0 | 111 | 155 |
c61e98f14c9a76d67981dbcf26cd371477e7bf9b | 982 | py | Python | tools/perf/cli_tools/flakiness_cli/cached_api.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | tools/perf/cli_tools/flakiness_cli/cached_api.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | tools/perf/cli_tools/flakiness_cli/cached_api.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import hashlib
from cli_tools.flakiness_cli import frames
def GetBuilders():
"""Get the builders data frame and keep a cached copy."""
... | 31.677419 | 79 | 0.746436 | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import hashlib
from cli_tools.flakiness_cli import api
from cli_tools.flakiness_cli import frames
def GetBuilders():
"""Get the builders... | 0 | 0 | 0 | 0 | 0 | 166 | 0 | 18 | 71 |
04140bf8dad7ca4dcbe83e3c3ccd08b76ceba45a | 1,373 | py | Python | alipay/aop/api/response/AlipayPcreditHuabeiRpacrawlerQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayPcreditHuabeiRpacrawlerQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayPcreditHuabeiRpacrawlerQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 31.930233 | 115 | 0.671522 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.RpaCrawlerTaskVO import RpaCrawlerTaskVO
class AlipayPcreditHuabeiRpacrawlerQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayPcreditHuabeiR... | 0 | 488 | 0 | 668 | 0 | 0 | 0 | 80 | 90 |
f4fd19ffcd413cc3ea9cef920574e76c57546a52 | 1,323 | py | Python | appengine/monorail/api/prpc/grpc/beta/implementations.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | 1 | 2018-01-02T05:47:07.000Z | 2018-01-02T05:47:07.000Z | appengine/monorail/api/prpc/grpc/beta/implementations.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | appengine/monorail/api/prpc/grpc/beta/implementations.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is govered by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""This file exists so that code in gRPC *_pb2.py files is importable.
The protoc compiler for ... | 37.8 | 77 | 0.798942 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is govered by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""This file exists so that code in gRPC *_pb2.py files is importable.
The protoc compiler for ... | 0 | 0 | 0 | 0 | 0 | 535 | 0 | 0 | 92 |