hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7f91f182a8ad028e09282b1a10aa2772dc367306 | 208 | py | Python | using_name.py | miaoyinnu/- | 039251f08398ebd18847e44bf8fd07e1178b5688 | [
"MIT"
] | null | null | null | using_name.py | miaoyinnu/- | 039251f08398ebd18847e44bf8fd07e1178b5688 | [
"MIT"
] | null | null | null | using_name.py | miaoyinnu/- | 039251f08398ebd18847e44bf8fd07e1178b5688 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
print("This is program is being run by itself")
else:
print("i am being imported from another module")
from mymodule import sayhi,version
sayhi()
print("Verison",version)
| 20.8 | 52 | 0.721154 | if __name__ == '__main__':
print("This is program is being run by itself")
else:
print("i am being imported from another module")
from mymodule import sayhi,version
sayhi()
print("Verison",version)
| 0 | 0 | 0 |
56ab80db150e9ad8631da73911e4034c96bd9870 | 5,890 | py | Python | q2t/thermo.py | cgrambow/q2t | ab62d8840e1f7bfa30d0dfaa234ad86db0833809 | [
"MIT"
] | null | null | null | q2t/thermo.py | cgrambow/q2t | ab62d8840e1f7bfa30d0dfaa234ad86db0833809 | [
"MIT"
] | null | null | null | q2t/thermo.py | cgrambow/q2t | ab62d8840e1f7bfa30d0dfaa234ad86db0833809 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import numpy as np
import rmgpy.constants as constants
from rmgpy.statmech import Conformer, IdealGasTranslation, LinearRotor, NonlinearRotor, HarmonicOscillator
from rmgpy.qm.qmdata import QMData
from rmgpy.qm.symmetry import PointGroupCalculator
from .qchem import QChem... | 32.541436 | 117 | 0.605772 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import numpy as np
import rmgpy.constants as constants
from rmgpy.statmech import Conformer, IdealGasTranslation, LinearRotor, NonlinearRotor, HarmonicOscillator
from rmgpy.qm.qmdata import QMData
from rmgpy.qm.symmetry import PointGroupCalculator
from .qchem import QChem... | 3,460 | 0 | 23 |
985e48804eec16912f6e851e88c72504c2821d39 | 118 | py | Python | kokki/cookbooks/pip/recipes/default.py | samuel/kokki | da98da55e0bba8db5bda993666a43c6fdc4cacdb | [
"BSD-3-Clause"
] | 11 | 2015-01-14T00:43:26.000Z | 2020-12-29T06:12:51.000Z | kokki/cookbooks/pip/recipes/default.py | samuel/kokki | da98da55e0bba8db5bda993666a43c6fdc4cacdb | [
"BSD-3-Clause"
] | null | null | null | kokki/cookbooks/pip/recipes/default.py | samuel/kokki | da98da55e0bba8db5bda993666a43c6fdc4cacdb | [
"BSD-3-Clause"
] | 3 | 2015-01-14T01:05:56.000Z | 2019-01-26T05:09:37.000Z |
from kokki import Package
Package("pip",
provider = "kokki.providers.package.easy_install.EasyInstallProvider"
) | 19.666667 | 73 | 0.779661 |
from kokki import Package
Package("pip",
provider = "kokki.providers.package.easy_install.EasyInstallProvider"
) | 0 | 0 | 0 |
b8914ec4eb38cef59aa4da0cb839ebb5c3b4206a | 154 | py | Python | siteprefs/signals.py | jayvdb/django-siteprefs | 9cb3026b94a98299d60ccb61baf567b3d0c64a2f | [
"BSD-3-Clause"
] | null | null | null | siteprefs/signals.py | jayvdb/django-siteprefs | 9cb3026b94a98299d60ccb61baf567b3d0c64a2f | [
"BSD-3-Clause"
] | null | null | null | siteprefs/signals.py | jayvdb/django-siteprefs | 9cb3026b94a98299d60ccb61baf567b3d0c64a2f | [
"BSD-3-Clause"
] | null | null | null | from django.dispatch import Signal
prefs_save = Signal(providing_args=['app', 'updated_prefs'])
"""Issued when dynamic preferences models are saved."""
| 25.666667 | 60 | 0.766234 | from django.dispatch import Signal
prefs_save = Signal(providing_args=['app', 'updated_prefs'])
"""Issued when dynamic preferences models are saved."""
| 0 | 0 | 0 |
7b427d803546e23638833b9f5efc283b9528d9c6 | 2,779 | py | Python | question/migrations/0001_initial.py | abrehman90/Student-Portal-LMS-in-Django | fe5f338e309deb7aeaa10d9ff5c60fcdc3844ee1 | [
"MIT"
] | 2 | 2021-09-17T04:10:57.000Z | 2021-12-15T03:47:21.000Z | question/migrations/0001_initial.py | abrehman90/Student-Portal-LMS-in-Django | fe5f338e309deb7aeaa10d9ff5c60fcdc3844ee1 | [
"MIT"
] | null | null | null | question/migrations/0001_initial.py | abrehman90/Student-Portal-LMS-in-Django | fe5f338e309deb7aeaa10d9ff5c60fcdc3844ee1 | [
"MIT"
] | 1 | 2021-07-12T06:42:13.000Z | 2021-07-12T06:42:13.000Z | # Generated by Django 3.2.3 on 2021-06-13 05:29
import ckeditor.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 44.822581 | 148 | 0.611011 | # Generated by Django 3.2.3 on 2021-06-13 05:29
import ckeditor.fields
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... | 0 | 2,576 | 23 |
4ca73c7ffad9ba15f8c868f25c0c291b4e13401f | 1,322 | py | Python | unmaintain/benchmark/benchmark_asyncio_postgres.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 1,176 | 2019-12-24T01:51:22.000Z | 2022-03-29T06:00:25.000Z | unmaintain/benchmark/benchmark_asyncio_postgres.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 33 | 2020-03-06T03:29:46.000Z | 2022-03-11T06:24:26.000Z | unmaintain/benchmark/benchmark_asyncio_postgres.py | zuzhi/rssant | 06d985845f6af3be7097e6d718afba7eeb195ec8 | [
"BSD-3-Clause"
] | 110 | 2019-12-29T05:49:24.000Z | 2022-03-28T06:44:21.000Z | import time
import asyncio
import aiopg
import uvloop
import asyncpg
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
dsn = 'dbname=rssant user=rssant password=rssant host=127.0.0.1'
loop = asyncio.get_event_loop()
loop.run_until_complete(run_aiopg())
loop = asyncio.get_event_loop()
loop.run_until_compl... | 26.44 | 64 | 0.596823 | import time
import asyncio
import aiopg
import uvloop
import asyncpg
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
dsn = 'dbname=rssant user=rssant password=rssant host=127.0.0.1'
async def run_aiopg():
pool = await aiopg.create_pool(dsn, minsize=5, maxsize=5)
t0 = time.time()
for i in range... | 937 | 0 | 46 |
2fcaa636cb43ac39470731a033ff7cb7d8b1c199 | 60,972 | py | Python | deepviz.py | YilongJu/Implicit-Bias-towards-the-Kernel-RegimeCauses-Mode-Collapse-in-GANs | 983fcfde19c17b4d61223df8d7433c286db6b3db | [
"MIT"
] | null | null | null | deepviz.py | YilongJu/Implicit-Bias-towards-the-Kernel-RegimeCauses-Mode-Collapse-in-GANs | 983fcfde19c17b4d61223df8d7433c286db6b3db | [
"MIT"
] | null | null | null | deepviz.py | YilongJu/Implicit-Bias-towards-the-Kernel-RegimeCauses-Mode-Collapse-in-GANs | 983fcfde19c17b4d61223df8d7433c286db6b3db | [
"MIT"
] | null | null | null | from matplotlib import use
# use("Qt5Agg")
# use('TkAgg')
from mpl_toolkits.mplot3d import Axes3D # Not explicitly used, but necessary
from matplotlib.transforms import Affine2D # Not explicitly used, but necessary
import mpl_toolkits.axisartist.floating_axes as floating_axe... | 61.34004 | 384 | 0.599439 | from matplotlib import use
# use("Qt5Agg")
# use('TkAgg')
from mpl_toolkits.mplot3d import Axes3D # Not explicitly used, but necessary
from matplotlib.transforms import Affine2D # Not explicitly used, but necessary
import mpl_toolkits.axisartist.floating_axes as floating_axe... | 59,154 | 2 | 277 |
16846bb53e261f3f34ae5b20388fb957aa7b755f | 2,126 | py | Python | setup.py | melissaboiko/uniscripts | e2daf1a52f307cda3a22387162d098dc98b0d4ad | [
"CC0-1.0"
] | 7 | 2015-05-11T19:53:12.000Z | 2017-11-10T23:45:18.000Z | setup.py | leoboiko/uniscripts | e2daf1a52f307cda3a22387162d098dc98b0d4ad | [
"CC0-1.0"
] | 1 | 2021-12-06T13:01:19.000Z | 2021-12-06T13:46:21.000Z | setup.py | leoboiko/uniscripts | e2daf1a52f307cda3a22387162d098dc98b0d4ad | [
"CC0-1.0"
] | 1 | 2021-10-17T08:51:01.000Z | 2021-10-17T08:51:01.000Z | """setuptools module for uniscripts.
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# adapted from https://coderwall.com/p/qawuyq/use-markdown-readme-s-in-... | 27.973684 | 105 | 0.651929 | """setuptools module for uniscripts.
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# adapted from https://coderwall.com/p/qawuyq/use-markdown-readme-s-in-... | 0 | 0 | 0 |
829be30f7080406860344bcc8a2aeffccedbab47 | 649 | py | Python | misc/util.py | yycdavid/argoverse-forecasting | 0de46d9b39189486469bdf5b1bdde0fb5f0ee184 | [
"BSD-3-Clause-Clear"
] | null | null | null | misc/util.py | yycdavid/argoverse-forecasting | 0de46d9b39189486469bdf5b1bdde0fb5f0ee184 | [
"BSD-3-Clause-Clear"
] | null | null | null | misc/util.py | yycdavid/argoverse-forecasting | 0de46d9b39189486469bdf5b1bdde0fb5f0ee184 | [
"BSD-3-Clause-Clear"
] | null | null | null | import os
import sys
import numpy as np
| 27.041667 | 76 | 0.637904 | import os
import sys
import numpy as np
class OutputManager(object):
def __init__(self, result_path, filename='log.txt'):
self.result_folder = result_path
self.log_file = open(os.path.join(result_path, filename), 'w')
def say(self, s):
self.log_file.write("{}\n".format(s))
self... | 502 | 7 | 99 |
4c269b3844a3d702eeb602612791e1b874638e1f | 236 | py | Python | 2020/sparta08/0614/homework/myShop/init.py | loveAlakazam/TIL | e4f887bc1a6cf5639c361656e22abbe8ccfa314b | [
"Apache-2.0"
] | 1 | 2020-06-22T02:51:11.000Z | 2020-06-22T02:51:11.000Z | 2020/sparta08/0614/homework/myShop/init.py | loveAlakazam/TIL | e4f887bc1a6cf5639c361656e22abbe8ccfa314b | [
"Apache-2.0"
] | 1 | 2020-10-19T12:22:30.000Z | 2020-10-19T12:22:30.000Z | 2020/sparta08/0614/homework/myShop/init.py | loveAlakazam/TIL | e4f887bc1a6cf5639c361656e22abbe8ccfa314b | [
"Apache-2.0"
] | 1 | 2020-12-19T12:46:26.000Z | 2020-12-19T12:46:26.000Z | from pymongo import MongoClient
client= MongoClient('localhost', 27017)
db=client.db_cek
if __name__=='__main__':
main() | 16.857143 | 39 | 0.686441 | from pymongo import MongoClient
client= MongoClient('localhost', 27017)
db=client.db_cek
def delete_all():
# 데이터베이스 안에 있는 것들을 모두 지운다.
db.orders.delete_many({})
def main():
delete_all()
if __name__=='__main__':
main() | 100 | 0 | 46 |
501ac2a7e8cb9f4c023963af10abb5799f160092 | 136 | py | Python | measurement/array-operations/vmul3.py | quepas/performance-estimation-array-operations | b209ba5efebf5dee60ec5fca0fa711ca2e766e17 | [
"MIT"
] | null | null | null | measurement/array-operations/vmul3.py | quepas/performance-estimation-array-operations | b209ba5efebf5dee60ec5fca0fa711ca2e766e17 | [
"MIT"
] | null | null | null | measurement/array-operations/vmul3.py | quepas/performance-estimation-array-operations | b209ba5efebf5dee60ec5fca0fa711ca2e766e17 | [
"MIT"
] | null | null | null | import numpy as np
# Element-wise multiplication of three vectors
| 19.428571 | 46 | 0.698529 | import numpy as np
# Element-wise multiplication of three vectors
def vmul3(V1, V2, V3):
R = np.multiply(V1, np.multiply(V2, V3))
| 46 | 0 | 22 |
4d9157319b66bba873f45428ff904995f748f650 | 2,149 | py | Python | bib/views.py | acdh-oeaw/thunau-old | a3023885470e80f7312e43561028398bffd713e0 | [
"MIT"
] | 1 | 2021-09-20T12:51:47.000Z | 2021-09-20T12:51:47.000Z | bib/views.py | acdh-oeaw/cbab | 7cd25f057913dccf85f851e448b1dbc2c5f8d624 | [
"MIT"
] | 9 | 2020-02-12T00:19:18.000Z | 2021-12-13T19:46:51.000Z | bib/views.py | acdh-oeaw/thunau-old | a3023885470e80f7312e43561028398bffd713e0 | [
"MIT"
] | null | null | null | import requests
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .models import Book
# following line has to match the settings-file you are using
from django.conf import settings
def sync_zotero(request):
""" renders a simple template with a button to trigger sy... | 33.061538 | 91 | 0.590507 | import requests
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .models import Book
# following line has to match the settings-file you are using
from django.conf import settings
def sync_zotero(request):
""" renders a simple template with a button to trigger sy... | 0 | 0 | 0 |
0f06c5989c3c2521bfde65ac17818d8908b5e3a6 | 229 | py | Python | contextManager/file_handler.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | contextManager/file_handler.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | contextManager/file_handler.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | import os
import subprocess
file = "some_file.txt"
with open(file, 'w') as opened_file:
opened_file.write('Hola!')
subprocess.run(["cat", file])
if os.path.exists(file):
os.remove(file)
assert not os.path.exists(file)
| 17.615385 | 36 | 0.703057 | import os
import subprocess
file = "some_file.txt"
with open(file, 'w') as opened_file:
opened_file.write('Hola!')
subprocess.run(["cat", file])
if os.path.exists(file):
os.remove(file)
assert not os.path.exists(file)
| 0 | 0 | 0 |
1d088d3c2844363762dc3f4b36fd7e8b3eb3c010 | 133 | py | Python | task/constants.py | suvajitsarkar/taskManagement | 0054c20fba8dd8eb3c4c83abdded8fc778a8b62b | [
"Apache-2.0"
] | null | null | null | task/constants.py | suvajitsarkar/taskManagement | 0054c20fba8dd8eb3c4c83abdded8fc778a8b62b | [
"Apache-2.0"
] | 1 | 2021-06-10T23:00:14.000Z | 2021-06-10T23:00:14.000Z | task/constants.py | suvajitsarkar/taskManagement | 0054c20fba8dd8eb3c4c83abdded8fc778a8b62b | [
"Apache-2.0"
] | null | null | null | TASK_STAGES = (
('n', 'Not Started'),
('i', 'In Progress'),
('r', 'In Review'),
('d', 'Done'),
)
| 19 | 29 | 0.353383 | TASK_STAGES = (
('n', 'Not Started'),
('i', 'In Progress'),
('r', 'In Review'),
('d', 'Done'),
)
| 0 | 0 | 0 |
c467b1c943e7b0098db2795f9c7ce4d0d502e039 | 2,687 | py | Python | core/helpers.py | quis/exceptional-review-procedure | adf34fb72b2d3357f4f1da320019f729cc1ae653 | [
"MIT"
] | null | null | null | core/helpers.py | quis/exceptional-review-procedure | adf34fb72b2d3357f4f1da320019f729cc1ae653 | [
"MIT"
] | null | null | null | core/helpers.py | quis/exceptional-review-procedure | adf34fb72b2d3357f4f1da320019f729cc1ae653 | [
"MIT"
] | null | null | null | from urllib.parse import urlencode
import uuid
from formtools.wizard.storage.base import BaseStorage
from formtools.wizard.storage.session import SessionStorage
import requests
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.cache import cache
from dj... | 29.206522 | 115 | 0.717529 | from urllib.parse import urlencode
import uuid
from formtools.wizard.storage.base import BaseStorage
from formtools.wizard.storage.session import SessionStorage
import requests
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.cache import cache
from dj... | 1,759 | 195 | 233 |
b3a16eb65f2779355381c31c5e385af2b8202f12 | 5,871 | py | Python | cogs/opgg.py | ZackHart2400/miso-bot | bbdcf65e1c5ed1dfe472f91804dcc39ae556dd83 | [
"MIT"
] | null | null | null | cogs/opgg.py | ZackHart2400/miso-bot | bbdcf65e1c5ed1dfe472f91804dcc39ae556dd83 | [
"MIT"
] | null | null | null | cogs/opgg.py | ZackHart2400/miso-bot | bbdcf65e1c5ed1dfe472f91804dcc39ae556dd83 | [
"MIT"
] | null | null | null | import discord
import aiohttp
from bs4 import BeautifulSoup
from discord.ext import commands
from helpers import utilityfunctions as util
| 35.155689 | 96 | 0.522058 | import discord
import aiohttp
from bs4 import BeautifulSoup
from discord.ext import commands
from helpers import utilityfunctions as util
class GGSoup:
def __init__(self):
self.soup = None
async def create(self, region, summoner_name, sub_url=""):
async with aiohttp.ClientSession() as session... | 5,348 | 206 | 176 |
ba6f4ebec266f13af50b4b48401bae096b80e262 | 49,610 | py | Python | hsm_software/sw/rpc_handling.py | DiamondKeySecurity/HSM | 6b6a0d691a22863411e048c7c211ac63bf9ffaa7 | [
"BSD-3-Clause"
] | null | null | null | hsm_software/sw/rpc_handling.py | DiamondKeySecurity/HSM | 6b6a0d691a22863411e048c7c211ac63bf9ffaa7 | [
"BSD-3-Clause"
] | null | null | null | hsm_software/sw/rpc_handling.py | DiamondKeySecurity/HSM | 6b6a0d691a22863411e048c7c211ac63bf9ffaa7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2018, 2019 Diamond Key Security, NFP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# - Redistributions of source code must retain the above copyright not... | 41.724138 | 141 | 0.668373 | #!/usr/bin/env python
# Copyright (c) 2018, 2019 Diamond Key Security, NFP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# - Redistributions of source code must retain the above copyright not... | 22,232 | 2 | 913 |
eaf62cd7a0895fbd892a7843721fd0f07e26256e | 2,535 | py | Python | models/GCNII_new.py | yiruiliu110/eegnn | 253773c301681bb00b4789c34f48c82468ad16da | [
"MIT"
] | null | null | null | models/GCNII_new.py | yiruiliu110/eegnn | 253773c301681bb00b4789c34f48c82468ad16da | [
"MIT"
] | null | null | null | models/GCNII_new.py | yiruiliu110/eegnn | 253773c301681bb00b4789c34f48c82468ad16da | [
"MIT"
] | null | null | null | import math
import pickle
import torch
import torch.nn.functional as F
from torch import nn
from torch_sparse import SparseTensor
from estimation.sparse_to_dense import scipy_to_dense
from models.GCNII_DenseLayer import GCNIIConv_arxiv
from models.GCNII_layer import GCNIIdenseConv
from estimation.generate_edge_index... | 33.8 | 101 | 0.648521 | import math
import pickle
import torch
import torch.nn.functional as F
from torch import nn
from torch_sparse import SparseTensor
from estimation.sparse_to_dense import scipy_to_dense
from models.GCNII_DenseLayer import GCNIIConv_arxiv
from models.GCNII_layer import GCNIIdenseConv
from estimation.generate_edge_index... | 1,986 | 6 | 76 |
9a2f9bbcdef5df4bf28982e51a41ce770ed56584 | 745 | py | Python | texttospeak.py | PoomGamerE/Text-To-Speak-With-Python-Pitch-Supported- | 452a7a9bfaa22306da436832ea8e91185481d9d5 | [
"WTFPL"
] | 1 | 2021-12-31T15:50:08.000Z | 2021-12-31T15:50:08.000Z | texttospeak.py | PoomGamerE/Text-To-Speak-With-Python-Pitch-Supported | 452a7a9bfaa22306da436832ea8e91185481d9d5 | [
"WTFPL"
] | null | null | null | texttospeak.py | PoomGamerE/Text-To-Speak-With-Python-Pitch-Supported | 452a7a9bfaa22306da436832ea8e91185481d9d5 | [
"WTFPL"
] | 1 | 2020-05-07T16:07:55.000Z | 2020-05-07T16:07:55.000Z | from gtts import gTTS
from pydub import AudioSegment
AudioSegment.converter = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffprobe ="C:\\ffmpeg\\bin\\ffprobe.exe"
from pydub.playback import play
import playsound
tts = gTTS(text='Test Hatsune Miku', lang='en', slow=True... | 25.689655 | 87 | 0.754362 | from gtts import gTTS
from pydub import AudioSegment
AudioSegment.converter = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffprobe ="C:\\ffmpeg\\bin\\ffprobe.exe"
from pydub.playback import play
import playsound
tts = gTTS(text='Test Hatsune Miku', lang='en', slow=True... | 0 | 0 | 0 |
d9ad6c19f7ef674e649f00e8e4202cdc498e8bfb | 3,721 | py | Python | __init__.py | krisgesling/device-initiated-interaction-skill | e961aeadc3af1c5c3d10c0bb90e392cbe4ecb54a | [
"Apache-2.0"
] | null | null | null | __init__.py | krisgesling/device-initiated-interaction-skill | e961aeadc3af1c5c3d10c0bb90e392cbe4ecb54a | [
"Apache-2.0"
] | null | null | null | __init__.py | krisgesling/device-initiated-interaction-skill | e961aeadc3af1c5c3d10c0bb90e392cbe4ecb54a | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from time import sleep
import requests
from mycroft import MycroftSkill, intent_handler
from mycroft.audio import wait_while_speaking
from mycroft.util.format import nice_duration, TimeResolution
API_ENDPOINT = "https://example.com/api"
API_KEY = "XXXXXXXXXXXXXXXXX"
MINUTES = 60 # secon... | 41.344444 | 145 | 0.689331 | from datetime import datetime
from time import sleep
import requests
from mycroft import MycroftSkill, intent_handler
from mycroft.audio import wait_while_speaking
from mycroft.util.format import nice_duration, TimeResolution
API_ENDPOINT = "https://example.com/api"
API_KEY = "XXXXXXXXXXXXXXXXX"
MINUTES = 60 # secon... | 2,776 | 554 | 46 |
88d3e7a0d8ea1590d06630c3b732f4ca8621ff36 | 319 | py | Python | code/array_absurdity/array_absurdity.py | rafalmierzwiak/yearn | 4f173f9c326bc742d90de26ad23af500713cd6a1 | [
"Unlicense"
] | 1 | 2021-04-06T17:39:28.000Z | 2021-04-06T17:39:28.000Z | code/array_absurdity/array_absurdity.py | rafalmierzwiak/yearn | 4f173f9c326bc742d90de26ad23af500713cd6a1 | [
"Unlicense"
] | null | null | null | code/array_absurdity/array_absurdity.py | rafalmierzwiak/yearn | 4f173f9c326bc742d90de26ad23af500713cd6a1 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
from sys import argv
with open(argv[1]) as f:
for line in f:
length, numbers = line.rstrip("\n").split(";")
duplicates = {}
for n in numbers.split(","):
if n in duplicates:
print(n)
break
duplicates[n] = True
| 21.266667 | 54 | 0.492163 | #!/usr/bin/env python3
from sys import argv
with open(argv[1]) as f:
for line in f:
length, numbers = line.rstrip("\n").split(";")
duplicates = {}
for n in numbers.split(","):
if n in duplicates:
print(n)
break
duplicates[n] = True
| 0 | 0 | 0 |
a2ef113d54b817448e697c5115dc69a977e0e9aa | 107 | py | Python | 1. Python/2. Flow of Control/14.multiple_of_10.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | 1 | 2021-12-05T18:02:15.000Z | 2021-12-05T18:02:15.000Z | 1. Python/2. Flow of Control/14.multiple_of_10.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null | 1. Python/2. Flow of Control/14.multiple_of_10.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null |
#Print multiples of 10 for numbers in a given range
for num in range(5):
if num > 0:
print(num * 10) | 21.4 | 51 | 0.663551 |
#Print multiples of 10 for numbers in a given range
for num in range(5):
if num > 0:
print(num * 10) | 0 | 0 | 0 |
dc7d4c67f2d423199d46c7b7ac45785d73c591e2 | 412 | py | Python | SpaceHabitRPG/Tests/ForTestHelpers/Test_SpaceUnitTest.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | null | null | null | SpaceHabitRPG/Tests/ForTestHelpers/Test_SpaceUnitTest.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | 13 | 2016-07-19T04:13:20.000Z | 2016-08-17T06:06:47.000Z | SpaceHabitRPG/Tests/ForTestHelpers/Test_SpaceUnitTest.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | null | null | null | from SpaceUnitTest import SpaceUnitTest
if __name__ == '__main__':
unittest.main()
| 29.428571 | 71 | 0.696602 | from SpaceUnitTest import SpaceUnitTest
class Test_SpaceUnitTest(SpaceUnitTest):
def test_assertBool(self):
t1 = None
t2 = 6
self.assertRaises(AssertionError, lambda :self.assertFalse(t1))
self.assertRaises(AssertionError, lambda :self.assertTrue(t2))
self.assertNotEqual(t1,... | 256 | 19 | 49 |
515fbcc5ffa15982112788b8a28628520915ddc4 | 4,664 | py | Python | bodyhands/modeling/roi_heads/extract_handbody_components.py | cvlab-stonybrook/BodyHands | dcfe470f6fd31a048d4d17d4ae9a2a524538b380 | [
"MIT"
] | 1 | 2022-03-06T08:18:33.000Z | 2022-03-06T08:18:33.000Z | bodyhands/modeling/roi_heads/extract_handbody_components.py | cvlab-stonybrook/BodyHands | dcfe470f6fd31a048d4d17d4ae9a2a524538b380 | [
"MIT"
] | null | null | null | bodyhands/modeling/roi_heads/extract_handbody_components.py | cvlab-stonybrook/BodyHands | dcfe470f6fd31a048d4d17d4ae9a2a524538b380 | [
"MIT"
] | null | null | null | import torch
from detectron2.layers import cat
from bodyhands.utils.extend_utils_boxes import pairwise_ioa
from detectron2.structures import Boxes | 44.846154 | 134 | 0.770154 | import torch
from detectron2.layers import cat
from bodyhands.utils.extend_utils_boxes import pairwise_ioa
from detectron2.structures import Boxes
def extract_handbody_components_training(features, roi_pooler, proposals):
proposal_boxes = []
gt_classes = []
gt_body_ids = []
gt_corr_body_boxes = []
... | 4,471 | 0 | 46 |
78ecea3a7cd48bf6116ebbd160f009bb753182bc | 1,288 | py | Python | mpltex/mpltex.py | bluesquall/mpltex | b4794c601ac085fe3b89b4fdb46eb92ae06a3e15 | [
"MIT"
] | 1 | 2021-12-01T15:21:39.000Z | 2021-12-01T15:21:39.000Z | mpltex/mpltex.py | bluesquall/mpltex | b4794c601ac085fe3b89b4fdb46eb92ae06a3e15 | [
"MIT"
] | null | null | null | mpltex/mpltex.py | bluesquall/mpltex | b4794c601ac085fe3b89b4fdb46eb92ae06a3e15 | [
"MIT"
] | null | null | null | """
mpltex
======
"""
golden_ratio = (5**.5-1.0)/2.0
packages = ['amsmath', 'amssymb', 'amsfonts', 'amsbsy', 'bm']
usepackages = [r'\usepackage{{{0}}}'.format(pkg) for pkg in packages]
def get_rcParams(fig_width_pt = 232.0, scale = 1.0, dpi = 600):
"""TODO: write a description
Parameters
---------... | 27.404255 | 70 | 0.559006 | """
mpltex
======
"""
golden_ratio = (5**.5-1.0)/2.0
packages = ['amsmath', 'amssymb', 'amsfonts', 'amsbsy', 'bm']
usepackages = [r'\usepackage{{{0}}}'.format(pkg) for pkg in packages]
def pt_to_in(pt):
return pt / 72.27
def pt_to_mm(pt):
raise NotImplementedError
def get_rcParams(fig_width_pt = 232.0, s... | 44 | 0 | 46 |
a2361bc10b2d2184556a466dee04a4a83a83384d | 4,167 | py | Python | garam.py | albus137/csp_python_tests | 952b68ea4dc22b1f87a40bfa9a54bf17d305e235 | [
"MIT"
] | null | null | null | garam.py | albus137/csp_python_tests | 952b68ea4dc22b1f87a40bfa9a54bf17d305e235 | [
"MIT"
] | null | null | null | garam.py | albus137/csp_python_tests | 952b68ea4dc22b1f87a40bfa9a54bf17d305e235 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from constraint import *
import pyexcel as pe
from time import time
# create the problem object
problem = Problem(RecursiveBacktrackingSolver())
# import the Garam grid
grid = pe.get_array(file_name='csp_grid.ods')
n_lines, n_cols = len(grid), len(grid[0])
# display the Garam grid nicely
prin... | 31.330827 | 112 | 0.521718 | #!/usr/bin/env python3
from constraint import *
import pyexcel as pe
from time import time
# create the problem object
problem = Problem(RecursiveBacktrackingSolver())
# import the Garam grid
grid = pe.get_array(file_name='csp_grid.ods')
n_lines, n_cols = len(grid), len(grid[0])
# display the Garam grid nicely
prin... | 0 | 0 | 0 |
60a0943dd24d4687989fb3460f5ca8fc22c02667 | 1,045 | py | Python | venv/0713.py | JungHwan-Park21/python_workspace | 7463724d6b9955bd594d8538c9636de7748f7ece | [
"MIT"
] | null | null | null | venv/0713.py | JungHwan-Park21/python_workspace | 7463724d6b9955bd594d8538c9636de7748f7ece | [
"MIT"
] | null | null | null | venv/0713.py | JungHwan-Park21/python_workspace | 7463724d6b9955bd594d8538c9636de7748f7ece | [
"MIT"
] | null | null | null | # data = list(range(1, 46))
#
# import random
#
#
# def random_pop(data):
# number = random.randint(0, len(data) - 1)
# return data.pop(number)
#
#
# for i in range(1, 7):
# print(random_pop(data))
##
# import webbrowser
#
# url = "https://coastwatch.pfeg.noaa.gov/erddap/griddap/erdMH1chlamday.geotif?chlor... | 23.75 | 277 | 0.68134 | # data = list(range(1, 46))
#
# import random
#
#
# def random_pop(data):
# number = random.randint(0, len(data) - 1)
# return data.pop(number)
#
#
# for i in range(1, 7):
# print(random_pop(data))
##
# import webbrowser
#
# url = "https://coastwatch.pfeg.noaa.gov/erddap/griddap/erdMH1chlamday.geotif?chlor... | 110 | 0 | 22 |
86b2b9be4c907cd7e31be2fd93d8800322a78cf9 | 739 | py | Python | wagtaildemo/settings/production.py | caputomarcos/wagtaildemo | 08cca1dbc44bb836c0923ff2720a8a3195f4042b | [
"BSD-3-Clause"
] | 3 | 2015-12-03T21:34:59.000Z | 2017-08-12T16:53:33.000Z | wagtaildemo/settings/production.py | caputomarcos/wagtaildemo | 08cca1dbc44bb836c0923ff2720a8a3195f4042b | [
"BSD-3-Clause"
] | null | null | null | wagtaildemo/settings/production.py | caputomarcos/wagtaildemo | 08cca1dbc44bb836c0923ff2720a8a3195f4042b | [
"BSD-3-Clause"
] | 4 | 2015-12-03T21:35:01.000Z | 2020-11-14T09:29:29.000Z | from .base import *
DEBUG = False
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'INDEX': 'wagtaildemo'
}
}
CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.RedisCache',
'LOCATION': '127.0.0.1:6379',
... | 19.447368 | 80 | 0.618403 | from .base import *
DEBUG = False
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'INDEX': 'wagtaildemo'
}
}
CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.RedisCache',
'LOCATION': '127.0.0.1:6379',
... | 0 | 0 | 0 |
cacd68ed453b920081ba00b225a82efbfcad337e | 590 | py | Python | algorithms/decisiontree/decisiontree.classification.py | Marcnuth/DataScienceInterestGroup | cae73aa9f6ab1588b565492225a1086b93e121f6 | [
"Apache-2.0"
] | null | null | null | algorithms/decisiontree/decisiontree.classification.py | Marcnuth/DataScienceInterestGroup | cae73aa9f6ab1588b565492225a1086b93e121f6 | [
"Apache-2.0"
] | null | null | null | algorithms/decisiontree/decisiontree.classification.py | Marcnuth/DataScienceInterestGroup | cae73aa9f6ab1588b565492225a1086b93e121f6 | [
"Apache-2.0"
] | null | null | null | from sklearn import tree
from sklearn.datasets import load_iris
from sklearn.externals.six import StringIO
import pydot
from IPython.display import Image
if __name__ == '__main__':
iris = load_iris()
print predictByDTC(iris.data, iris.target, iris.data[0:,])
| 22.692308 | 62 | 0.713559 | from sklearn import tree
from sklearn.datasets import load_iris
from sklearn.externals.six import StringIO
import pydot
from IPython.display import Image
def predictByDTC(X,Y,test):
clf = tree.DecisionTreeClassifier().fit(X, Y)
#Visualize decision tree
#dot_data = StringIO()
#tree.export_graphvi... | 286 | 0 | 23 |
627c060739769673d8038b9d1e5389a1aa23a9cb | 3,241 | py | Python | utils/lib/chirp_modbus.py | wedvjin/rs485-moist-sensor | 90930a34d0e6ec977f6083e70cc4bd931d7453fb | [
"Apache-2.0"
] | null | null | null | utils/lib/chirp_modbus.py | wedvjin/rs485-moist-sensor | 90930a34d0e6ec977f6083e70cc4bd931d7453fb | [
"Apache-2.0"
] | null | null | null | utils/lib/chirp_modbus.py | wedvjin/rs485-moist-sensor | 90930a34d0e6ec977f6083e70cc4bd931d7453fb | [
"Apache-2.0"
] | null | null | null | import minimalmodbus
import serial
| 30.575472 | 136 | 0.738661 | import minimalmodbus
import serial
class SoilMoistureSensor:
DEFAULT_BAUDRATE = 19200
DEFAULT_PARITY = serial.PARITY_NONE
DEFAULT_STOPBITS = 2
baudrates=[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200]
parities=[serial.PARITY_NONE, serial.PARITY_EVEN, serial.PARITY_ODD]
def __initSensor(self):
self.sens... | 2,582 | 601 | 23 |
8718ddc93fcc419c4999d37a997527ee8f0ed08c | 846 | py | Python | ktts.py | Jeyadevanjd/ktts | 3e6aef7546abfbdf08b533b757e8353aae9caa7e | [
"MIT"
] | 1 | 2020-05-15T08:21:42.000Z | 2020-05-15T08:21:42.000Z | ktts.py | Jeyadevanjd/ktts | 3e6aef7546abfbdf08b533b757e8353aae9caa7e | [
"MIT"
] | null | null | null | ktts.py | Jeyadevanjd/ktts | 3e6aef7546abfbdf08b533b757e8353aae9caa7e | [
"MIT"
] | null | null | null | import os
import sys
from configparser import ConfigParser
configr = ConfigParser()
from subprocess import Popen as pop
pp = os.getcwd()
config = ConfigParser()
val = []
path = pp
para = path + "/det.ini"
print(para)
val2 = []
config.read(para)
ad = config['installation']['installation']
print(pp)
if ad == "False":
... | 24.882353 | 84 | 0.605201 | import os
import sys
from configparser import ConfigParser
configr = ConfigParser()
from subprocess import Popen as pop
pp = os.getcwd()
config = ConfigParser()
val = []
path = pp
para = path + "/det.ini"
print(para)
val2 = []
config.read(para)
ad = config['installation']['installation']
print(pp)
if ad == "False":
... | 130 | 0 | 22 |
6d684bef9ff874d142d8e3ac37ec1b10bc574e68 | 675 | py | Python | funds/migrations/0008_auto_20211205_0852.py | cnlis/lib_books | 05bed0f9775826e0b1f968a766ddf5c2d1d55f40 | [
"MIT"
] | null | null | null | funds/migrations/0008_auto_20211205_0852.py | cnlis/lib_books | 05bed0f9775826e0b1f968a766ddf5c2d1d55f40 | [
"MIT"
] | null | null | null | funds/migrations/0008_auto_20211205_0852.py | cnlis/lib_books | 05bed0f9775826e0b1f968a766ddf5c2d1d55f40 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-12-05 08:52
from django.db import migrations, models
| 23.275862 | 49 | 0.551111 | # Generated by Django 3.2.9 on 2021-12-05 08:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funds', '0007_document_type'),
]
operations = [
migrations.RenameField(
model_name='fund',
old_name='fund_count',
... | 0 | 561 | 23 |
8ad2d2a254ba090cf3c2576f441bf3cfe9241a0a | 1,117 | py | Python | web/practicas/practica2/parser.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | null | null | null | web/practicas/practica2/parser.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | null | null | null | web/practicas/practica2/parser.py | luisjimenez6245/escom | a1ae1f988d02f88844f5d29fba75e7cee04998db | [
"MIT"
] | 1 | 2020-03-03T04:16:42.000Z | 2020-03-03T04:16:42.000Z |
text = " <option>Álvaro Obregón</option>\n" +" <option>Azcapotzalco</option>\n" +" <option>Benito Juárez</option>\n" +" <option>Coyoacán</option>\n" +" <option>Cuajimalpa de Morelos</option>\n" +" <option>Cuauhtémoc</option>... | 101.545455 | 909 | 0.45658 |
text = " <option>Álvaro Obregón</option>\n" +" <option>Azcapotzalco</option>\n" +" <option>Benito Juárez</option>\n" +" <option>Coyoacán</option>\n" +" <option>Cuajimalpa de Morelos</option>\n" +" <option>Cuauhtémoc</option>... | 0 | 0 | 0 |
13ffa40792c9a2978d3b11a7f70c68598ebefae1 | 254 | py | Python | Aulas/Aula13/tk01.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | Aulas/Aula13/tk01.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | Aulas/Aula13/tk01.py | matheusmenezs/com220 | d699f00892df1259249ae012aa2a02f63ae0f06f | [
"MIT"
] | null | null | null | # tk01.py
import tkinter as tk
main()
| 18.142857 | 45 | 0.590551 | # tk01.py
import tkinter as tk
def main():
# Cria a janela
janela = tk.Tk()
janela.title('Primeira janela')
# Entra no mainloop, o que faz com que
# a janela seja renderizada na tela
janela.mainloop()
main()
| 192 | 0 | 23 |
1bf61e9ce9b3a3f64582a8b86bf57fcde353dd25 | 3,411 | py | Python | stash/database.py | fkolacek/Stash | 58c2e38306a89bf1b1b63d427ac5db9134471cc4 | [
"MIT"
] | null | null | null | stash/database.py | fkolacek/Stash | 58c2e38306a89bf1b1b63d427ac5db9134471cc4 | [
"MIT"
] | null | null | null | stash/database.py | fkolacek/Stash | 58c2e38306a89bf1b1b63d427ac5db9134471cc4 | [
"MIT"
] | null | null | null | #
# Author: Frantisek Kolacek <work@kolacek.it
# Version: 1.0
#
import logging
import sqlite3
from datetime import datetime
from .exception import StashDatabaseException
| 29.66087 | 128 | 0.577543 | #
# Author: Frantisek Kolacek <work@kolacek.it
# Version: 1.0
#
import logging
import sqlite3
from datetime import datetime
from .exception import StashDatabaseException
class StashDatabase:
config = None
connection = None
cursor = None
def __init__(self, **config):
try:
self.c... | 2,716 | 499 | 23 |
3d9ba12ebbec8fcf3abd7c138d26883b8b57674c | 1,321 | py | Python | Flask/learnflask.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | 1 | 2022-01-14T18:03:42.000Z | 2022-01-14T18:03:42.000Z | Flask/learnflask.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | null | null | null | Flask/learnflask.py | subash-kc/2022-01-04-Python | 5ce51e4265bcd860a4e62423edef6ec9cd1437b4 | [
"MIT"
] | null | null | null | """
Handle only one request one time
not good for developer
Flask is a small and lightweight Python web framework that provides useful tools and features that make creating web applications in Python easier.
It gives developers flexibility and is a more accessible framework for new developers since you can build a
web... | 32.219512 | 147 | 0.761544 | """
Handle only one request one time
not good for developer
Flask is a small and lightweight Python web framework that provides useful tools and features that make creating web applications in Python easier.
It gives developers flexibility and is a more accessible framework for new developers since you can build a
web... | 80 | 0 | 66 |
c867bec69ea1f0db617a236944c7a37caaf51c8d | 1,102 | py | Python | cerulean/test/test_terminal.py | MD-Studio/cerulean | e081f0242494890e26b5ec5e150187c1f130477f | [
"Apache-2.0"
] | 5 | 2019-02-12T01:39:24.000Z | 2020-08-26T12:59:46.000Z | cerulean/test/test_terminal.py | MD-Studio/cerulean | e081f0242494890e26b5ec5e150187c1f130477f | [
"Apache-2.0"
] | 12 | 2018-11-04T19:11:23.000Z | 2019-09-26T14:19:36.000Z | cerulean/test/test_terminal.py | MD-Studio/cerulean | e081f0242494890e26b5ec5e150187c1f130477f | [
"Apache-2.0"
] | 2 | 2019-09-27T11:24:04.000Z | 2020-04-28T07:04:04.000Z | from cerulean import Terminal
| 26.878049 | 60 | 0.575318 | from cerulean import Terminal
def test_terminal(terminal: Terminal) -> None:
exit_code, output, error = terminal.run(
10.0,
'echo', ['hello', 'world'])
assert exit_code == 0
assert output == 'hello world\n'
assert error == ''
def test_terminal_stdin(terminal: Terminal) -> Non... | 976 | 0 | 92 |
734d4660acd1fa981bb20e9452efd630f2edbc0e | 17,263 | py | Python | platformio/platforms/base.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | 2 | 2020-05-12T15:10:37.000Z | 2021-07-02T15:41:56.000Z | platformio/platforms/base.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | null | null | null | platformio/platforms/base.py | eiginn/platformio | 33502f82f26e731f5bdc38c1ea6b17d1565dedd3 | [
"Apache-2.0"
] | 1 | 2018-11-30T22:34:24.000Z | 2018-11-30T22:34:24.000Z | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.070881 | 78 | 0.573307 | # Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 10,898 | 1,005 | 69 |
ae7911041f957339b7880da7f8a77caa9715da61 | 2,462 | py | Python | kedb/files/settings.py | salt-formulas/salt-formula-kedb | 0739d4c8c5278ede0275820b8c5ba810e746c8f1 | [
"Apache-2.0"
] | null | null | null | kedb/files/settings.py | salt-formulas/salt-formula-kedb | 0739d4c8c5278ede0275820b8c5ba810e746c8f1 | [
"Apache-2.0"
] | null | null | null | kedb/files/settings.py | salt-formulas/salt-formula-kedb | 0739d4c8c5278ede0275820b8c5ba810e746c8f1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{%- set app = pillar.kedb.server %}
from os.path import join, dirname, abspath, normpath
DATABASES = {
'default': {
{%- if app.database.engine == 'mysql' %}
'ENGINE': 'django.db.backends.mysql',
'PORT': '3306',
'OPTIONS': {'init_command': 'SET storage_engine... | 28.627907 | 134 | 0.561738 | # -*- coding: utf-8 -*-
{%- set app = pillar.kedb.server %}
from os.path import join, dirname, abspath, normpath
DATABASES = {
'default': {
{%- if app.database.engine == 'mysql' %}
'ENGINE': 'django.db.backends.mysql',
'PORT': '3306',
'OPTIONS': {'init_command': 'SET storage_engine... | 0 | 0 | 0 |
276b2b75102958887a594dd0dc549f5b1e092d4b | 6,243 | py | Python | snesc_checker.py | wminner/SNES-Classic-Checker | 9b9fc1b72ad4d64969d3456cd1b5d05cd03c7d46 | [
"MIT"
] | 3 | 2017-08-23T01:32:31.000Z | 2018-01-09T03:11:24.000Z | snesc_checker.py | wminner/SNES-Classic-Checker | 9b9fc1b72ad4d64969d3456cd1b5d05cd03c7d46 | [
"MIT"
] | null | null | null | snesc_checker.py | wminner/SNES-Classic-Checker | 9b9fc1b72ad4d64969d3456cd1b5d05cd03c7d46 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re, sys
import getopt, pickle
import time, datetime
import urllib.request
import smtplib
from email.mime.text import MIMEText
import getpass
# import browser_cookie3
# Create email with subject and body, then sends via gmail address provided
# Gets and caches your gmail address
# G... | 31.852041 | 168 | 0.682364 | #!/usr/bin/env python3
import re, sys
import getopt, pickle
import time, datetime
import urllib.request
import smtplib
from email.mime.text import MIMEText
import getpass
# import browser_cookie3
def main(argv):
default_send_email = "<your_sender_gmail>@gmail.com"
default_receive_email = "<your_receiver_gmail>@gma... | 5,708 | 0 | 89 |
0ecd9b1334e318b4ccffc4b6eeae536b6e03414f | 186 | py | Python | python-flask-server-generated/swagger_server/controllers/__init__.py | procube-open/pdns_certbot_server | 516207b2416781c94a8620bb3a1d0897c773142d | [
"MIT"
] | null | null | null | python-flask-server-generated/swagger_server/controllers/__init__.py | procube-open/pdns_certbot_server | 516207b2416781c94a8620bb3a1d0897c773142d | [
"MIT"
] | null | null | null | python-flask-server-generated/swagger_server/controllers/__init__.py | procube-open/pdns_certbot_server | 516207b2416781c94a8620bb3a1d0897c773142d | [
"MIT"
] | null | null | null | import threading
import logging
LOCK = threading.Lock()
logger = logging.getLogger("CERTBOT")
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| 20.666667 | 37 | 0.801075 | import threading
import logging
LOCK = threading.Lock()
logger = logging.getLogger("CERTBOT")
handler = logging.StreamHandler()
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| 0 | 0 | 0 |
a09b9af2b847bf39b063ead0a72aab28cd93427e | 126 | py | Python | wtpy/apps/__init__.py | Huijun-Cui/wtpy | 9a8243a20b944fbb37aa33d81215b7b36ac7b1e2 | [
"MIT"
] | null | null | null | wtpy/apps/__init__.py | Huijun-Cui/wtpy | 9a8243a20b944fbb37aa33d81215b7b36ac7b1e2 | [
"MIT"
] | null | null | null | wtpy/apps/__init__.py | Huijun-Cui/wtpy | 9a8243a20b944fbb37aa33d81215b7b36ac7b1e2 | [
"MIT"
] | null | null | null | from .WtBtAnalyst import WtBtAnalyst
from .WtCtaOptimizer import WtCtaOptimizer
__all__ = ["WtBtAnalyst","WtCtaOptimizer"] | 31.5 | 43 | 0.809524 | from .WtBtAnalyst import WtBtAnalyst
from .WtCtaOptimizer import WtCtaOptimizer
__all__ = ["WtBtAnalyst","WtCtaOptimizer"] | 0 | 0 | 0 |
86633a33a9926907327bdb9b93dde0ee954c35a3 | 729 | py | Python | tests/debugger.py | fferri/pygolog | 98a4c5d9de053ee2e43ae2f61fa9f098eb38598a | [
"BSD-3-Clause"
] | 7 | 2017-06-15T14:56:37.000Z | 2021-11-12T22:27:47.000Z | tests/debugger.py | fferri/pygolog | 98a4c5d9de053ee2e43ae2f61fa9f098eb38598a | [
"BSD-3-Clause"
] | null | null | null | tests/debugger.py | fferri/pygolog | 98a4c5d9de053ee2e43ae2f61fa9f098eb38598a | [
"BSD-3-Clause"
] | 1 | 2021-05-14T11:13:01.000Z | 2021-05-14T11:13:01.000Z | #!/usr/bin/env python3
from collections import defaultdict
from copy import copy
from strips import *
from golog_program import *
from domains.math1 import S
s = S(0)
p = Sequence(
Choose(
Exec(S.incr()),
Exec(S.double())
),
Choose(
Exec(S.incr()... | 22.78125 | 71 | 0.489712 | #!/usr/bin/env python3
from collections import defaultdict
from copy import copy
from strips import *
from golog_program import *
from domains.math1 import S
s = S(0)
p = Sequence(
Choose(
Exec(S.incr()),
Exec(S.double())
),
Choose(
Exec(S.incr()... | 291 | 0 | 23 |
c7b05272d678883c8d35b24c852e7ccef6f65d43 | 12,515 | py | Python | tests/test_utf8inputtext.py | polm/SudachiPy | 9eae063baa65d230cd89e382685fe9e410577125 | [
"Apache-2.0"
] | 3 | 2017-09-21T14:56:30.000Z | 2017-11-10T05:44:30.000Z | tests/test_utf8inputtext.py | polm/SudachiPy | 9eae063baa65d230cd89e382685fe9e410577125 | [
"Apache-2.0"
] | null | null | null | tests/test_utf8inputtext.py | polm/SudachiPy | 9eae063baa65d230cd89e382685fe9e410577125 | [
"Apache-2.0"
] | 1 | 2021-12-17T05:39:38.000Z | 2021-12-17T05:39:38.000Z | # Copyright (c) 2019 Works Applications Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 48.886719 | 111 | 0.703076 | # Copyright (c) 2019 Works Applications Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 11,237 | 701 | 23 |
9694a2f313620b91b57ba7cf9877cc25e3d3f26a | 8,996 | py | Python | mtil/reward_injection_wrappers.py | qxcv/mtil | 62608046efb570b53f8107b8de9a7a1f28aee28a | [
"0BSD"
] | 1 | 2021-01-18T23:57:07.000Z | 2021-01-18T23:57:07.000Z | mtil/reward_injection_wrappers.py | qxcv/mtil | 62608046efb570b53f8107b8de9a7a1f28aee28a | [
"0BSD"
] | null | null | null | mtil/reward_injection_wrappers.py | qxcv/mtil | 62608046efb570b53f8107b8de9a7a1f28aee28a | [
"0BSD"
] | null | null | null | """Wrappers for rlpyt algorithms that inject reward from a custom reward model
at execution time.
TODO: need to figure out exactly how I'm going to do this for algorithms other
than PG. Some notes:
- For PG algorithms (PPO + A2C) it's easy to override the reward used at
training time by subclassing & overriding the... | 39.113043 | 79 | 0.626723 | """Wrappers for rlpyt algorithms that inject reward from a custom reward model
at execution time.
TODO: need to figure out exactly how I'm going to do this for algorithms other
than PG. Some notes:
- For PG algorithms (PPO + A2C) it's easy to override the reward used at
training time by subclassing & overriding the... | 6,492 | 629 | 122 |
3594e17236136b711372a9945750692b0c864ddd | 1,701 | py | Python | src/apps/alarm_clock/tests/test_alarm_time.py | stefanhoelzl/alarm-clock | efba84e71fcade26bef020dc7eaa10181ea9f96c | [
"MIT"
] | 1 | 2019-07-31T12:39:53.000Z | 2019-07-31T12:39:53.000Z | src/apps/alarm_clock/tests/test_alarm_time.py | stefanhoelzl/alarm-clock | efba84e71fcade26bef020dc7eaa10181ea9f96c | [
"MIT"
] | null | null | null | src/apps/alarm_clock/tests/test_alarm_time.py | stefanhoelzl/alarm-clock | efba84e71fcade26bef020dc7eaa10181ea9f96c | [
"MIT"
] | 1 | 2019-10-04T04:32:20.000Z | 2019-10-04T04:32:20.000Z | import pytest
from unittest.mock import patch
from ..alarm_time import diff_between_weekdays, get_next_weekday, next_time
# time.localtime(126000) 35*60*60
# time.struct_time(tm_year=1970, tm_mon=1, tm_mday=2,
# tm_hour=12, tm_min=0, tm_sec=0,
# tm_wday=4, tm_yday=2, tm_isdst=0)
| 30.375 | 80 | 0.633157 | import pytest
from unittest.mock import patch
from ..alarm_time import diff_between_weekdays, get_next_weekday, next_time
# time.localtime(126000) 35*60*60
# time.struct_time(tm_year=1970, tm_mon=1, tm_mday=2,
# tm_hour=12, tm_min=0, tm_sec=0,
# tm_wday=4, tm_yday=2, tm_isdst=0)
def... | 859 | 190 | 332 |
8dcff54d0b2c4427d452f34f93a80e755ff0e5b6 | 422 | py | Python | Array/python/reverse_aryasoni98.py | CodeTrophs/450DSA | 84ab1b13cd837b860c4b747d567e3507b29291b3 | [
"MIT"
] | 5 | 2021-05-15T13:35:33.000Z | 2021-07-21T09:35:51.000Z | Array/python/reverse_aryasoni98.py | CodeTrophs/450DSA | 84ab1b13cd837b860c4b747d567e3507b29291b3 | [
"MIT"
] | 1 | 2021-07-17T12:20:09.000Z | 2021-07-20T08:25:02.000Z | Array/python/reverse_aryasoni98.py | CodeTrophs/450DSA | 84ab1b13cd837b860c4b747d567e3507b29291b3 | [
"MIT"
] | 8 | 2021-05-26T22:22:07.000Z | 2021-12-16T04:35:32.000Z | # Approach 1
# reverseList([1, 2, 3, 4, 5, 6], 0, 5) = [6 5 4 3 2 1]
# Approach 2
# reverseList([1, 2, 3, 4, 5, 6], 0, 5) = [6 5 4 3 2 1]
| 20.095238 | 55 | 0.509479 | # Approach 1
def reverseList(A, start, end):
while start < end:
A[start], A[end] = A[end], A[start]
start += 1
end -= 1
# reverseList([1, 2, 3, 4, 5, 6], 0, 5) = [6 5 4 3 2 1]
# Approach 2
def reverseList(A, start, end):
if start >= end:
return
A[start], A[end] = A[end],... | 234 | 0 | 46 |
9ecee82c77f35b0f9807be6163f918737c5cafbf | 56,215 | py | Python | searchads_api/api.py | phiture/searchads_api | fc374a8102ffd569ce5b314431d17efef4af4cb7 | [
"MIT"
] | 31 | 2019-12-09T14:34:11.000Z | 2022-03-06T16:37:05.000Z | searchads_api/api.py | phiture/searchads_api | fc374a8102ffd569ce5b314431d17efef4af4cb7 | [
"MIT"
] | 5 | 2019-12-12T05:32:08.000Z | 2021-03-09T07:47:24.000Z | searchads_api/api.py | phiture/searchads_api | fc374a8102ffd569ce5b314431d17efef4af4cb7 | [
"MIT"
] | 13 | 2020-03-25T09:46:35.000Z | 2021-12-22T17:22:54.000Z | import requests
import json
import time
import datetime
import random
import jwt
from requests.models import Response
| 34.78651 | 116 | 0.416241 | import requests
import json
import time
import datetime
import random
import jwt
from requests.models import Response
class SearchAdsAPI:
def __init__(self,
org_id,
pem,
key,
client_id=None,
team_id=None,
key_id=... | 2,210 | 53,863 | 23 |
9022b4a37c85bb12d4642e5a3cdab4efa2f30215 | 1,140 | py | Python | apps/comment/models.py | aplot249/my_blog | 7cfcd67991f0a6dc861847514e8d0fca2213fa8b | [
"MIT"
] | null | null | null | apps/comment/models.py | aplot249/my_blog | 7cfcd67991f0a6dc861847514e8d0fca2213fa8b | [
"MIT"
] | 5 | 2021-06-02T01:30:26.000Z | 2022-03-12T00:24:27.000Z | apps/comment/models.py | qq1788lover/my_blog | 7cfcd67991f0a6dc861847514e8d0fca2213fa8b | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from article.models import ArticlePost
# django-ckeditor
# from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
# django-mptt
from mptt.models import MPTTModel, TreeForeignKey
# 博文的评论
| 40.714286 | 117 | 0.740351 | from django.db import models
from django.contrib.auth.models import User
from article.models import ArticlePost
# django-ckeditor
# from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
# django-mptt
from mptt.models import MPTTModel, TreeForeignKey
# 博文的评论
class Commen... | 27 | 871 | 22 |
70dc5ccb8c9fff90f926591a0f6bb044989fa3fa | 1,490 | py | Python | test_city.py | wang-xinyu/csp.pytorch | 8d5187358c1eb0fbf7ba5f184b9afed6c2518ad3 | [
"MIT"
] | 13 | 2020-03-29T13:35:55.000Z | 2021-04-11T10:45:53.000Z | test_city.py | wang-xinyu/csp.pytorch | 8d5187358c1eb0fbf7ba5f184b9afed6c2518ad3 | [
"MIT"
] | 2 | 2020-09-08T09:53:08.000Z | 2020-09-16T04:18:03.000Z | test_city.py | wang-xinyu/csp.pytorch | 8d5187358c1eb0fbf7ba5f184b9afed6c2518ad3 | [
"MIT"
] | 6 | 2020-05-24T21:49:17.000Z | 2021-07-06T09:14:42.000Z | import torch
import cv2
import numpy as np
import os
from models.cspnet import CSPNet_p3p4p5
from utils.keras_weights_loader import load_keras_weights
from utils.utils import *
if __name__ == '__main__':
device = 'cuda:0'
weights_path = 'net_e121_l0.hdf5'
out_path = 'output/valresults/city/h/off/121'
i... | 29.215686 | 102 | 0.599329 | import torch
import cv2
import numpy as np
import os
from models.cspnet import CSPNet_p3p4p5
from utils.keras_weights_loader import load_keras_weights
from utils.utils import *
if __name__ == '__main__':
device = 'cuda:0'
weights_path = 'net_e121_l0.hdf5'
out_path = 'output/valresults/city/h/off/121'
i... | 0 | 0 | 0 |
ba2439d9eddd4585f46a35effe33046144c873b1 | 18 | py | Python | blockhash/constants.py | dsoprea/blockhash-python | bc322658d55c62b96255edc63ae05dbac7cf5ab7 | [
"MIT"
] | 3 | 2017-11-26T18:33:23.000Z | 2020-08-03T16:11:02.000Z | blockhash/constants.py | dsoprea/blockhash-python | bc322658d55c62b96255edc63ae05dbac7cf5ab7 | [
"MIT"
] | null | null | null | blockhash/constants.py | dsoprea/blockhash-python | bc322658d55c62b96255edc63ae05dbac7cf5ab7 | [
"MIT"
] | null | null | null | DEFAULT_BITS = 16
| 9 | 17 | 0.777778 | DEFAULT_BITS = 16
| 0 | 0 | 0 |
818414fc073b5bab726dc3956d8e5e9d22029c67 | 580 | py | Python | config/zuul/zuul_functions.py | javierpena/SF-DLRN-poc | 8b71e1b4a07caee0e3f079ce446d5bb84302e6a1 | [
"Apache-2.0"
] | null | null | null | config/zuul/zuul_functions.py | javierpena/SF-DLRN-poc | 8b71e1b4a07caee0e3f079ce446d5bb84302e6a1 | [
"Apache-2.0"
] | null | null | null | config/zuul/zuul_functions.py | javierpena/SF-DLRN-poc | 8b71e1b4a07caee0e3f079ce446d5bb84302e6a1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
| 32.222222 | 63 | 0.624138 | #!/usr/bin/python
def set_node_reuse(item, job, params):
print "zuul_functions: set_node_reuse(", item, job, "): "
params['OFFLINE_NODE_WHEN_COMPLETE'] = '0'
def set_node_options(item, job, params):
if job.name in ('config-check', 'config-update',
'sf-mirror-update',
... | 514 | 0 | 46 |
116cd4ba8597e8948b72678be0c30f5b943dca3f | 611 | py | Python | Desafio015.py | sidneyalex/Desafios-do-Curso | 11605caf59fb8b456adaca78a41eae2f7469ab7b | [
"MIT"
] | null | null | null | Desafio015.py | sidneyalex/Desafios-do-Curso | 11605caf59fb8b456adaca78a41eae2f7469ab7b | [
"MIT"
] | null | null | null | Desafio015.py | sidneyalex/Desafios-do-Curso | 11605caf59fb8b456adaca78a41eae2f7469ab7b | [
"MIT"
] | null | null | null | #Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado.
dias = int(input('Por quantos dias o carro foi alugado? '))
km = float(input('Quantos quilomet... | 61.1 | 225 | 0.682488 | #Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado.
dias = int(input('Por quantos dias o carro foi alugado? '))
km = float(input('Quantos quilomet... | 0 | 0 | 0 |
d96aa39beae0b4f6ee0866534b868f4a600e92a9 | 63 | py | Python | 98_tools/training_ram/day2/ex14.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | 1 | 2020-05-11T18:39:54.000Z | 2020-05-11T18:39:54.000Z | 98_tools/training_ram/day2/ex14.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | null | null | null | 98_tools/training_ram/day2/ex14.py | tlananthu/python-learning | cfda5bfa6c613bcbe8bfe00567cd058ce5afc4a2 | [
"Apache-2.0"
] | null | null | null | s='Some text with spaces'
x=s.split()
{i:x.count(i) for i in x} | 21 | 25 | 0.650794 | s='Some text with spaces'
x=s.split()
{i:x.count(i) for i in x} | 0 | 0 | 0 |
d70ab24e8d797b74b4daf3c2ae6011b046ac94f3 | 747 | py | Python | tests/test_sphinx_scylladb_theme.py | tzach/sphinx-scylladb-theme-1 | 7b505f3d0827d9172ebf5816a6a3fffd667eeb9a | [
"Apache-2.0"
] | 6 | 2021-09-30T21:41:51.000Z | 2021-12-26T00:12:54.000Z | tests/test_sphinx_scylladb_theme.py | tzach/sphinx-scylladb-theme-1 | 7b505f3d0827d9172ebf5816a6a3fffd667eeb9a | [
"Apache-2.0"
] | 123 | 2021-09-30T11:57:17.000Z | 2022-03-31T01:40:18.000Z | tests/test_sphinx_scylladb_theme.py | tzach/sphinx-scylladb-theme-1 | 7b505f3d0827d9172ebf5816a6a3fffd667eeb9a | [
"Apache-2.0"
] | 5 | 2021-10-03T10:09:02.000Z | 2022-03-15T18:04:35.000Z | import os
from sphinx_scylladb_theme import override_rst_epilog, override_smv_latest_version
| 26.678571 | 82 | 0.72423 | import os
from sphinx_scylladb_theme import override_rst_epilog, override_smv_latest_version
class ConfigStub:
def __init__(self):
self.smv_latest_version = ""
self.rst_epilog = ""
def test_override_smv_latest_version_default():
config = ConfigStub()
assert override_smv_latest_version(c... | 535 | -4 | 118 |
bd6b8fa87708237f95ad354053664855848c915e | 4,425 | py | Python | myria/test/test_udf.py | uwescience/myria-python | 7ae1d135b9e748afd18e17f07ea0df61ddfa384d | [
"BSD-3-Clause"
] | 7 | 2015-01-26T18:30:36.000Z | 2020-10-21T09:03:59.000Z | myria/test/test_udf.py | uwescience/myria-python | 7ae1d135b9e748afd18e17f07ea0df61ddfa384d | [
"BSD-3-Clause"
] | 37 | 2015-01-23T01:35:03.000Z | 2017-09-16T18:32:13.000Z | myria/test/test_udf.py | uwescience/myria-python | 7ae1d135b9e748afd18e17f07ea0df61ddfa384d | [
"BSD-3-Clause"
] | 6 | 2016-02-02T21:25:52.000Z | 2020-02-07T14:44:51.000Z | import unittest
from httmock import HTTMock
from myria.connection import MyriaConnection
from myria.test.mock import *
from myria.udf import MyriaFunction, MyriaPostgresFunction, myria_function
from raco.backends.myria.connection import FunctionTypes
from raco.myrial.parser import Parser
| 39.864865 | 79 | 0.615141 | import unittest
from httmock import HTTMock
from myria.connection import MyriaConnection
from myria.test.mock import *
from myria.udf import MyriaFunction, MyriaPostgresFunction, myria_function
from raco.backends.myria.connection import FunctionTypes
from raco.myrial.parser import Parser
class TestUDF(unittest.TestC... | 3,911 | 12 | 211 |
09163ecf781ce0d1e17ae2ffc234afc93fa21d10 | 518 | py | Python | examples/weather_data_extraction.py | spelap/sport-activities-features | c9d99b94509d8f0dd988b41be6ef45eec291ef7d | [
"MIT"
] | null | null | null | examples/weather_data_extraction.py | spelap/sport-activities-features | c9d99b94509d8f0dd988b41be6ef45eec291ef7d | [
"MIT"
] | null | null | null | examples/weather_data_extraction.py | spelap/sport-activities-features | c9d99b94509d8f0dd988b41be6ef45eec291ef7d | [
"MIT"
] | null | null | null | from sport_activities_features.weather_identification import WeatherIdentification
from sport_activities_features.tcx_manipulation import TCXFile
#read TCX file
tcx_file = TCXFile()
tcx_data = tcx_file.read_one_file("path_to_the_file")
#configure visual crossing api key
visual_crossing_api_key = "API_KEY" # https://w... | 39.846154 | 103 | 0.841699 | from sport_activities_features.weather_identification import WeatherIdentification
from sport_activities_features.tcx_manipulation import TCXFile
#read TCX file
tcx_file = TCXFile()
tcx_data = tcx_file.read_one_file("path_to_the_file")
#configure visual crossing api key
visual_crossing_api_key = "API_KEY" # https://w... | 0 | 0 | 0 |
c768407e58ef331f29e4cf8bf8152406b9d9f5b4 | 27,330 | py | Python | teslakit/numerical_models/swan/io.py | teslakit/teslak | 3f3dda08c5c5998cb2a7debbf22f2be675a4ff8b | [
"MIT"
] | 12 | 2019-11-14T22:19:12.000Z | 2022-03-04T01:25:33.000Z | teslakit/numerical_models/swan/io.py | anderdyl/teslaCoSMoS | 1495bfa2364ddbacb802d145b456a35213abfb7c | [
"MIT"
] | 5 | 2020-03-24T18:21:41.000Z | 2021-08-23T20:39:43.000Z | teslakit/numerical_models/swan/io.py | anderdyl/teslaCoSMoS | 1495bfa2364ddbacb802d145b456a35213abfb7c | [
"MIT"
] | 2 | 2021-03-06T07:54:41.000Z | 2021-06-30T14:33:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path as op
import shutil as su
from datetime import datetime
import numpy as np
import pandas as pd
import xarray as xr
from scipy.io import loadmat
from .geo import gc_distance
# AUX. FUNCTIONs
def geo_distance_azimuth(lat_matrix, lon_matrix, lat_p... | 33.248175 | 149 | 0.530809 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import os.path as op
import shutil as su
from datetime import datetime
import numpy as np
import pandas as pd
import xarray as xr
from scipy.io import loadmat
from .geo import gc_distance
# AUX. FUNCTIONs
def geo_distance_azimuth(lat_matrix, lon_matrix, lat_p... | 1,715 | 0 | 81 |
ed273aa6cd016beba627f472a2c9db37c8bc9752 | 5,588 | py | Python | RL_testing_ground.py | sonic597/rl-testing-ground | c875ae640adb0de0dbe06aa152432aa0d49faed2 | [
"MIT"
] | null | null | null | RL_testing_ground.py | sonic597/rl-testing-ground | c875ae640adb0de0dbe06aa152432aa0d49faed2 | [
"MIT"
] | null | null | null | RL_testing_ground.py | sonic597/rl-testing-ground | c875ae640adb0de0dbe06aa152432aa0d49faed2 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
k = 100
iters = 1000
episodes = 50
eps_01_rewards = np.zeros(iters)
eps_1_rewards = np.zeros(iters)
eps_decay_rewards = np.zeros(iters)
ucb_rewards = np.zeros(iters)
for i in range(episodes):
random_test_list = [x for x in np.random.normal(0, 1, k)]
eps_0... | 38.013605 | 115 | 0.65247 | import numpy as np
import matplotlib.pyplot as plt
k = 100
iters = 1000
episodes = 50
class greedy_bandit:
def __init__(self, arms, elipson, iterations, avg_arm_rewards):
self.arms = arms
self.elipson = elipson
self.iterations = iterations
self.steps = 0
self.step_per_arm ... | 3,989 | 25 | 310 |
7c27aeb1bb208e81c2c11b9d2d0a8d3764e5179a | 68,168 | py | Python | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | jubick1337/NeMo | 9d50733ba0e698b98d0019e9e697686e0a24b90e | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | jubick1337/NeMo | 9d50733ba0e698b98d0019e9e697686e0a24b90e | [
"Apache-2.0"
] | 1 | 2022-03-06T14:09:02.000Z | 2022-03-06T14:09:02.000Z | nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py | jubick1337/NeMo | 9d50733ba0e698b98d0019e9e697686e0a24b90e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 49.147801 | 254 | 0.640594 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 39,091 | 0 | 663 |
ef3cd10a2068b30a9a75bed4bcdf212132ef1fe0 | 2,429 | py | Python | tests/xoto3/utils/oncall_default_test.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 16 | 2020-05-23T15:23:38.000Z | 2022-03-18T19:28:37.000Z | tests/xoto3/utils/oncall_default_test.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 9 | 2020-08-19T23:08:36.000Z | 2021-10-06T17:16:35.000Z | tests/xoto3/utils/oncall_default_test.py | xoeye/xoto3 | ef91cde3cce81e1ded311389358271d5c8eba02b | [
"MIT"
] | 2 | 2020-12-12T08:23:53.000Z | 2021-09-03T20:25:54.000Z | # pylint: disable=unused-argument,unused-variable
from datetime import datetime
import pytest
from xoto3.utils.oncall_default import NotSafeToDefaultError, OnCallDefault
utcnow = OnCallDefault(datetime.utcnow)
def test_disallow_positional_without_default():
"""A positional-possible argument without a defaul... | 26.692308 | 75 | 0.650473 | # pylint: disable=unused-argument,unused-variable
from datetime import datetime
import pytest
from xoto3.utils.oncall_default import NotSafeToDefaultError, OnCallDefault
utcnow = OnCallDefault(datetime.utcnow)
def test_oncall_default_works_with_pos_or_kw():
@utcnow.apply_to("when")
def final(a: str, when: ... | 1,647 | 0 | 168 |
9359e5c4e3e3bd39554fe97f058252575fbac126 | 4,385 | py | Python | pointcloud/sample_points.py | ziyedy/category-priornet | 5aa080eeff936ce3939f0d5458a2936677c15726 | [
"MIT"
] | 72 | 2020-06-11T13:06:56.000Z | 2021-12-07T02:57:51.000Z | pointcloud/sample_points.py | ziyedy/category-priornet | 5aa080eeff936ce3939f0d5458a2936677c15726 | [
"MIT"
] | 8 | 2020-07-24T09:13:14.000Z | 2021-07-02T06:55:25.000Z | pointcloud/sample_points.py | ziyedy/category-priornet | 5aa080eeff936ce3939f0d5458a2936677c15726 | [
"MIT"
] | 11 | 2020-03-13T12:44:44.000Z | 2021-05-12T05:13:26.000Z | import os
import sys
import argparse
import numpy as np
import pandas as pd
from pyntcloud.io import write_ply
if __name__ == '__main__':
main()
| 40.981308 | 122 | 0.618472 | import os
import sys
import argparse
import numpy as np
import pandas as pd
from pyntcloud.io import write_ply
def get_skip_vertice_face_num(path):
with open(path) as file:
for i, line in enumerate(file):
if i == 0 and len(line) > 4: # not just "OFF\n"
digits = line[3:].split(" ... | 4,120 | 0 | 115 |
c762f4be6db752ec413c9782ce94a363b079178f | 3,915 | py | Python | xquotient/test/test_signup.py | twisted/quotient | 95f2515219da99a77905852bc01deeb27e93466e | [
"MIT"
] | 6 | 2016-02-15T07:33:39.000Z | 2018-12-03T17:20:58.000Z | xquotient/test/test_signup.py | DalavanCloud/quotient | 95f2515219da99a77905852bc01deeb27e93466e | [
"MIT"
] | 1 | 2021-02-18T20:01:02.000Z | 2021-02-18T20:01:02.000Z | xquotient/test/test_signup.py | DalavanCloud/quotient | 95f2515219da99a77905852bc01deeb27e93466e | [
"MIT"
] | 4 | 2015-11-15T17:28:20.000Z | 2018-12-03T17:20:48.000Z | """
Test installation of the Quotient offering, as well as testing
signup with different combinations of selected benefactor factories
"""
from time import time
from twisted.trial.unittest import TestCase
from twisted.python.reflect import qual
from axiom.scripts import axiomatic
from axiom.store import Store
from a... | 32.625 | 92 | 0.662835 | """
Test installation of the Quotient offering, as well as testing
signup with different combinations of selected benefactor factories
"""
from time import time
from twisted.trial.unittest import TestCase
from twisted.python.reflect import qual
from axiom.scripts import axiomatic
from axiom.store import Store
from a... | 1,195 | 0 | 96 |
95cf5695d51f6c83e2d8f7a06810122634b4e2ff | 3,601 | py | Python | process_data.py | Jeongah-Shin/integer-seq2seq-tensorflow | 8f2be7c17dd9f93bd34fad01672a7615ddb086f8 | [
"Apache-2.0"
] | null | null | null | process_data.py | Jeongah-Shin/integer-seq2seq-tensorflow | 8f2be7c17dd9f93bd34fad01672a7615ddb086f8 | [
"Apache-2.0"
] | null | null | null | process_data.py | Jeongah-Shin/integer-seq2seq-tensorflow | 8f2be7c17dd9f93bd34fad01672a7615ddb086f8 | [
"Apache-2.0"
] | null | null | null | import json
import numpy as np
| 41.872093 | 82 | 0.648709 | import json
import numpy as np
def process(is_train=True):
with open('./data/config.json') as data_config:
data = json.load(data_config)
if is_train :
with open(data['train_s'], 'r', encoding='utf-8') as source:
source_lines = source.read().splitlines()
with ... | 3,546 | 0 | 23 |
b26bad7359609958551c3b742dcd0172c900dc22 | 138,774 | py | Python | blackfynn/models.py | Blackfynn/blackfynn-python | ab982e63f2cfe68d41ae269a59da629fec90bf68 | [
"Apache-2.0"
] | 6 | 2018-01-05T16:38:11.000Z | 2020-06-03T00:28:04.000Z | blackfynn/models.py | Blackfynn/blackfynn-python | ab982e63f2cfe68d41ae269a59da629fec90bf68 | [
"Apache-2.0"
] | 119 | 2018-03-07T18:32:58.000Z | 2021-02-03T16:10:55.000Z | blackfynn/models.py | Blackfynn/blackfynn-python | ab982e63f2cfe68d41ae269a59da629fec90bf68 | [
"Apache-2.0"
] | 6 | 2018-01-19T17:09:31.000Z | 2021-03-10T21:46:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from builtins import object, zip
from future.utils import PY2, as_native_str, string_types
import datetime
import io
import os
import re
import sys
from uuid import uuid4
import dateutil
import pytz
import requests
from dateutil.... | 30.14205 | 133 | 0.557893 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from builtins import object, zip
from future.utils import PY2, as_native_str, string_types
import datetime
import io
import os
import re
import sys
from uuid import uuid4
import dateutil
import pytz
import requests
from dateutil.... | 43,752 | 21,161 | 3,202 |
ff45a14b78903909a6ffd1b4566901c7dab86a97 | 3,024 | py | Python | api/tests/cards/test_card_read.py | onecrayon/api.ashes.live | 72709fb4e53220aa9b48749a51f5b834ebb2ca42 | [
"0BSD"
] | 11 | 2020-09-13T16:49:21.000Z | 2021-07-29T06:17:58.000Z | api/tests/cards/test_card_read.py | onecrayon/api.ashes.live | 72709fb4e53220aa9b48749a51f5b834ebb2ca42 | [
"0BSD"
] | 49 | 2020-09-11T05:23:02.000Z | 2022-03-02T18:31:00.000Z | api/tests/cards/test_card_read.py | onecrayon/api.ashes.live | 72709fb4e53220aa9b48749a51f5b834ebb2ca42 | [
"0BSD"
] | 1 | 2022-03-27T22:11:29.000Z | 2022-03-27T22:11:29.000Z | from fastapi import status
from fastapi.testclient import TestClient
from api import db
from api.models import Card
def test_get_legacy_card(client: TestClient, session: db.Session):
"""Must be able to read JSON for a legacy card"""
# This is handled by a migration normally (legacy cards can't normally be cr... | 39.789474 | 98 | 0.737765 | from fastapi import status
from fastapi.testclient import TestClient
from api import db
from api.models import Card
def test_get_legacy_card(client: TestClient, session: db.Session):
"""Must be able to read JSON for a legacy card"""
# This is handled by a migration normally (legacy cards can't normally be cr... | 0 | 0 | 0 |
793d046d209b11ed4917626afa99782cc07d3bdf | 13,796 | py | Python | cbm/foi/foi_v1.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/foi/foi_v1.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/foi/foi_v1.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Gilbert Voican, Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import psycopg2
# from psycopg2... | 40.696165 | 100 | 0.683531 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Gilbert Voican, Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import psycopg2
# from psycopg2... | 196 | 0 | 27 |
e549886f38a359ea6d5cf82b0fcbe44d7f043c7e | 3,657 | py | Python | laylm/trainer/task.py | nunenuh/layoutlm.pytorch | 30853b0a37247b5463836156d9f345d84da050f0 | [
"MIT"
] | 1 | 2021-01-25T16:31:54.000Z | 2021-01-25T16:31:54.000Z | laylm/trainer/task.py | nunenuh/layoutlm.pytorch | 30853b0a37247b5463836156d9f345d84da050f0 | [
"MIT"
] | null | null | null | laylm/trainer/task.py | nunenuh/layoutlm.pytorch | 30853b0a37247b5463836156d9f345d84da050f0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.optim as optim
from transformers import (
AdamW,
get_linear_schedule_with_warmup,
)
from .metrics import FullMetrics
import pytorch_lightning as pl
from pytorch_lightning import loggers as pl_loggers
| 33.550459 | 104 | 0.570686 | import torch
import torch.nn as nn
import torch.optim as optim
from transformers import (
AdamW,
get_linear_schedule_with_warmup,
)
from .metrics import FullMetrics
import pytorch_lightning as pl
from pytorch_lightning import loggers as pl_loggers
class TaskLayoutLM(pl.LightningModule):
def __init__(sel... | 3,116 | 18 | 251 |
85c4f894595399211d734bb79e045b6413317d18 | 557 | py | Python | 2020/Day_10/part1.py | Adilius/adventofcode | d0d3ad1a0430c3732d108ad8ef2b4d218a37944b | [
"MIT"
] | 2 | 2020-12-01T14:50:51.000Z | 2020-12-03T17:08:43.000Z | 2020/Day_10/part1.py | Adilius/adventofcode | d0d3ad1a0430c3732d108ad8ef2b4d218a37944b | [
"MIT"
] | null | null | null | 2020/Day_10/part1.py | Adilius/adventofcode | d0d3ad1a0430c3732d108ad8ef2b4d218a37944b | [
"MIT"
] | null | null | null | input_file = open("input.txt", "r")
lines = input_file.read().splitlines() #Read whole file, split by newlines
lines = [int(i) for i in lines]
lines.sort()
lines.append(lines[-1]+3)
oneDifference = 0
threeDifference = 0
previousJoltage = 0
for outlet in lines:
if outlet - 3 == previousJoltage:
threeDiffer... | 26.52381 | 75 | 0.709156 | input_file = open("input.txt", "r")
lines = input_file.read().splitlines() #Read whole file, split by newlines
lines = [int(i) for i in lines]
lines.sort()
lines.append(lines[-1]+3)
oneDifference = 0
threeDifference = 0
previousJoltage = 0
for outlet in lines:
if outlet - 3 == previousJoltage:
threeDiffer... | 0 | 0 | 0 |
e82f452914c75b9c2ebe56457a4ddeef9877b340 | 1,231 | py | Python | yeti.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | null | null | null | yeti.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | null | null | null | yeti.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | 1 | 2021-11-16T13:21:56.000Z | 2021-11-16T13:21:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import argparse
from core.web import webapp
logging.basicConfig(format='%(levelname)s:%(module)s:%(message)s', level=logging.ERROR)
COMMANDS = {
'webserver': webserver,
'syncdb': syncdb,
}
if __name__ == '__main__':
main()
| 25.122449 | 112 | 0.682372 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import argparse
from core.web import webapp
logging.basicConfig(format='%(levelname)s:%(module)s:%(message)s', level=logging.ERROR)
def webserver(args):
# Enable debug and autoreload in dev
webapp.debug = args.debug
if webapp.debug:
w... | 858 | 0 | 69 |
d4dc1d4acf798618eb4e02139f69296e021d2d15 | 1,261 | py | Python | main.py | MunityVR/Game | d22f3dcf8a394eca26cf90d4be38b6c328c8e707 | [
"CC0-1.0"
] | null | null | null | main.py | MunityVR/Game | d22f3dcf8a394eca26cf90d4be38b6c328c8e707 | [
"CC0-1.0"
] | null | null | null | main.py | MunityVR/Game | d22f3dcf8a394eca26cf90d4be38b6c328c8e707 | [
"CC0-1.0"
] | null | null | null | # Spaces
minsp = 0
maxsp = 500
# Admin's configuration
print("Hey Admin!")
sw = str(input("Make up a word : "))
guesses = float(input("How many guesses should the user have : "))
h = str(input("Do you want to give the user a hint? y/n : "))
guess = ''
gc = 0
# Admin's hint
if h == 'y':
hint = str(input("What hin... | 24.25 | 101 | 0.547978 | # Spaces
minsp = 0
maxsp = 500
# Admin's configuration
print("Hey Admin!")
sw = str(input("Make up a word : "))
guesses = float(input("How many guesses should the user have : "))
h = str(input("Do you want to give the user a hint? y/n : "))
guess = ''
gc = 0
# Admin's hint
if h == 'y':
hint = str(input("What hin... | 0 | 0 | 0 |
185a70f8f9c5531ed16ad5da0552a6bd1da2bbad | 4,294 | py | Python | pycspr/client/events.py | MrKrautee/casper-python-sdk | 13e9da83de8892583da7ada91e4231e6f85e5e13 | [
"Apache-2.0"
] | 2 | 2021-10-05T07:50:20.000Z | 2021-10-06T09:58:19.000Z | pycspr/client/events.py | MrKrautee/casper-python-sdk | 13e9da83de8892583da7ada91e4231e6f85e5e13 | [
"Apache-2.0"
] | null | null | null | pycspr/client/events.py | MrKrautee/casper-python-sdk | 13e9da83de8892583da7ada91e4231e6f85e5e13 | [
"Apache-2.0"
] | null | null | null | import enum
import requests
import sseclient
from json import loads
from typing import Callable
from typing import Generator
from typing import Tuple
from pycspr.api import NodeConnectionInfo
class NodeSseChannelType(enum.Enum):
""" Enumeration over set of exposed node SEE event types. """
deploys = enum.aut... | 34.629032 | 78 | 0.62599 | import enum
import requests
import sseclient
from json import loads
from typing import Callable
from typing import Generator
from typing import Tuple
from pycspr.api import NodeConnectionInfo
class NodeSseChannelType(enum.Enum):
""" Enumeration over set of exposed node SEE event types. """
deploys = enum.aut... | 0 | 0 | 0 |
562a96982f8632cd52e3eb1b793d70b9c95e52cb | 2,400 | py | Python | truck_microservice/truck/models.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck/models.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck/models.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | # library imports
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
# property imports
from .properties import *
# import socket # Koennte die richtige Loesung sein...
| 37.5 | 135 | 0.737083 | # library imports
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
# property imports
from .properties import *
class TruckEntity(models.Model):
# Params
id = models.PositiveIntegerField(default=ID, primary_key=True)
address = models.TextField(default=AD... | 459 | 1,697 | 23 |
96a9acf8dbfedc8c99c78a3eb9a85b6b5ebf731b | 1,106 | py | Python | x1/append_nop.py | pepepper/lab | 63b15a9455681353560b176256b59715a44aa6e0 | [
"CC0-1.0"
] | null | null | null | x1/append_nop.py | pepepper/lab | 63b15a9455681353560b176256b59715a44aa6e0 | [
"CC0-1.0"
] | 1 | 2021-06-28T06:30:13.000Z | 2021-06-28T06:30:13.000Z | x1/append_nop.py | pepepper/lab | 63b15a9455681353560b176256b59715a44aa6e0 | [
"CC0-1.0"
] | 1 | 2021-06-27T20:36:07.000Z | 2021-06-27T20:36:07.000Z | #!/usr/bin/env python3
import sys
main()
| 30.722222 | 139 | 0.512658 | #!/usr/bin/env python3
import sys
def main():
if len(sys.argv) < 5:
print(f'Usage: {sys.argv[0]} top.bin bottom_loop.bin bottom_reset.bin out.bin reset_fill_from reset_fill_to', file=sys.stderr)
sys.exit(1)
with open(sys.argv[1], 'rb') as tf, open(sys.argv[2], 'rb') as btmlf, open(sys.argv[3... | 1,038 | 0 | 23 |
818ccd30f153dce67753185ecd7905c078fbf3f3 | 4,310 | py | Python | tests/test_task.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | tests/test_task.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | tests/test_task.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | import unittest, types
from pyvisdk import Vim
from tests.common import get_options
from pyvisdk.facade.task import TaskManager
TASKS = ['hello world',
'I hate VMware',
'me too',
'This is a very long task name, a very very long name',
'school sucks',
'one more',
'l... | 35.04065 | 91 | 0.655452 | import unittest, types
from pyvisdk import Vim
from tests.common import get_options
from pyvisdk.facade.task import TaskManager
def nothing():
pass
def random_string(n):
import random
import string
return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(n))
TASKS = ['hello... | 3,164 | 290 | 427 |
30eaa2105d07e43d9a8ec898704e63e5994f330e | 12,680 | py | Python | MyUtils/ImageProcessing.py | mairob/Semantic-segmentation-and-Depth-estimation | d9624cdbde000a0c41e1025f89aa6edfdf947045 | [
"MIT"
] | 6 | 2018-06-15T21:18:58.000Z | 2021-07-05T08:41:21.000Z | MyUtils/ImageProcessing.py | mairob/Semantic-segmentation-and-Depth-estimation | d9624cdbde000a0c41e1025f89aa6edfdf947045 | [
"MIT"
] | null | null | null | MyUtils/ImageProcessing.py | mairob/Semantic-segmentation-and-Depth-estimation | d9624cdbde000a0c41e1025f89aa6edfdf947045 | [
"MIT"
] | 4 | 2018-06-15T21:19:08.000Z | 2021-07-05T08:41:23.000Z | #! /usr/bin/python3
#############################################################
### Helper File for TFRecords and Image manipulation ########
#############################################################
import tensorflow as tf
import numpy as np
## Label mapping for Cityscapes (34 classes)
Cityscapes34_I... | 44.181185 | 133 | 0.593612 | #! /usr/bin/python3
#############################################################
### Helper File for TFRecords and Image manipulation ########
#############################################################
import tensorflow as tf
import numpy as np
## Label mapping for Cityscapes (34 classes)
Cityscapes34_I... | 2,685 | 0 | 75 |
8626b26c027cd908d4f23b8f076700d77803fcad | 3,623 | py | Python | src/widgetastic_patternfly4/button.py | Mishrasubha/widgetastic.patternfly4 | 78da52759b1b17b4884391dcb8bd865af663722e | [
"Apache-2.0"
] | 3 | 2019-11-16T05:20:54.000Z | 2022-02-22T22:10:35.000Z | src/widgetastic_patternfly4/button.py | Mishrasubha/widgetastic.patternfly4 | 78da52759b1b17b4884391dcb8bd865af663722e | [
"Apache-2.0"
] | 66 | 2019-07-09T06:43:00.000Z | 2022-03-29T08:52:57.000Z | src/widgetastic_patternfly4/button.py | Mishrasubha/widgetastic.patternfly4 | 78da52759b1b17b4884391dcb8bd865af663722e | [
"Apache-2.0"
] | 24 | 2019-06-24T08:21:46.000Z | 2022-02-23T02:57:01.000Z | from widgetastic.utils import ParametrizedLocator
from widgetastic.widget import ClickableMixin
from widgetastic.widget import Widget
from widgetastic.xpath import quote
class Button(BaseButton, Widget, ClickableMixin):
"""A Patternfly button
You can match by text, partial text or by attributes, you can als... | 35.174757 | 97 | 0.602539 | from widgetastic.utils import ParametrizedLocator
from widgetastic.widget import ClickableMixin
from widgetastic.widget import Widget
from widgetastic.xpath import quote
class BaseButton:
CHECK_VISIBILITY = True
# Classes usable in the constructor
# Button types
PRIMARY = "pf-m-primary"
SECONDARY... | 1,694 | 1,071 | 77 |
6ea46e439fa32f14f73fb96fd66ffd82937d8f5e | 3,149 | py | Python | analyser/analyser.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | analyser/analyser.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | analyser/analyser.py | yimig/pyfilm-spliter | baf586e976a7a99373a13e1923f250eaf70f77b8 | [
"Apache-2.0"
] | null | null | null | import analyser.caption_factory
import data_connector.model_sentence
import data_connector.model_word
import data_connector.data_manager
from xml.etree.ElementTree import *
import re
import sys
sys.path.append("../")
from log_writer import LogWriter
| 36.616279 | 119 | 0.58463 | import analyser.caption_factory
import data_connector.model_sentence
import data_connector.model_word
import data_connector.data_manager
from xml.etree.ElementTree import *
import re
import sys
sys.path.append("../")
from log_writer import LogWriter
class Analyser:
@property
def sentence_list(self):
... | 2,670 | 325 | 23 |
90c849bc94c70a99e4e373256b50144ecdba6cd3 | 13,498 | py | Python | python38/Lib/site-packages/openpyxl/reader/worksheet.py | alextusinean/TikTokCommentScraper | 94ae7d5e20129f33a18857197794758b62909b22 | [
"MIT"
] | 28 | 2021-07-23T16:08:55.000Z | 2022-03-15T16:19:32.000Z | python38/Lib/site-packages/openpyxl/reader/worksheet.py | alextusinean/TikTokCommentScraper | 94ae7d5e20129f33a18857197794758b62909b22 | [
"MIT"
] | 4 | 2021-10-08T03:28:30.000Z | 2022-02-08T13:01:40.000Z | python38/Lib/site-packages/openpyxl/reader/worksheet.py | alextusinean/TikTokCommentScraper | 94ae7d5e20129f33a18857197794758b62909b22 | [
"MIT"
] | 11 | 2021-07-15T04:40:27.000Z | 2022-03-19T14:01:12.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Reader for a single worksheet."""
from io import BytesIO
# compatibility imports
from openpyxl.xml.functions import iterparse
# package imports
from openpyxl.cell import Cell
from openpyxl.worksheet import Worksheet, ColumnDimension, RowDim... | 41.027356 | 106 | 0.602682 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Reader for a single worksheet."""
from io import BytesIO
# compatibility imports
from openpyxl.xml.functions import iterparse
# package imports
from openpyxl.cell import Cell
from openpyxl.worksheet import Worksheet, ColumnDimension, RowDim... | 10,684 | 881 | 46 |
86cd014089a67861caf0503440063d428b748d8d | 6,297 | py | Python | tutorials/tutorial_4_adding_a_dataset.py | AliAbdulHussain/moabb | d308f024636802c21b06726457ce5ddacd418e16 | [
"BSD-3-Clause"
] | null | null | null | tutorials/tutorial_4_adding_a_dataset.py | AliAbdulHussain/moabb | d308f024636802c21b06726457ce5ddacd418e16 | [
"BSD-3-Clause"
] | null | null | null | tutorials/tutorial_4_adding_a_dataset.py | AliAbdulHussain/moabb | d308f024636802c21b06726457ce5ddacd418e16 | [
"BSD-3-Clause"
] | null | null | null | """
=================================
Creating a dataset class in MOABB
=================================
"""
# Authors: Pedro L. C. Rodrigues, Sylvain Chevallier
#
# https://github.com/plcrodrigues/Workshop-MOABB-BCI-Graz-2019
import numpy as np
from scipy.io import savemat, loadmat
import mne
from moab... | 37.706587 | 143 | 0.610767 | """
=================================
Creating a dataset class in MOABB
=================================
"""
# Authors: Pedro L. C. Rodrigues, Sylvain Chevallier
#
# https://github.com/plcrodrigues/Workshop-MOABB-BCI-Graz-2019
import numpy as np
from scipy.io import savemat, loadmat
import mne
from moab... | 274 | 0 | 27 |
f4f59e9616efbd52c782c87011c67a4852f64da0 | 486 | py | Python | test/sqlalchemy_filterparams_tests/database_test.py | cbrand/python-sqlalchemy-filterparams | 6e555cfe9e2f0f2c5f6d6606485de50bc76aaf73 | [
"MIT"
] | 2 | 2016-02-24T03:07:26.000Z | 2016-05-22T22:00:40.000Z | test/sqlalchemy_filterparams_tests/database_test.py | cbrand/python-sqlalchemy-filterparams | 6e555cfe9e2f0f2c5f6d6606485de50bc76aaf73 | [
"MIT"
] | null | null | null | test/sqlalchemy_filterparams_tests/database_test.py | cbrand/python-sqlalchemy-filterparams | 6e555cfe9e2f0f2c5f6d6606485de50bc76aaf73 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from unittest import TestCase
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy_filterparams_tests.models import (
Base,
)
| 20.25 | 50 | 0.713992 | # -*- encoding: utf-8 -*-
from unittest import TestCase
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy_filterparams_tests.models import (
Base,
)
class BaseDatabaseTest(TestCase):
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engi... | 83 | 180 | 23 |
49aaf3536a9b3013f2535a7951571b5299a8099f | 604 | py | Python | heisen/core/__init__.py | HeisenCore/heisen | 0cd4d27822960553a8e83a72c7dfeefa76e65c06 | [
"MIT"
] | 5 | 2016-08-30T07:51:08.000Z | 2021-09-13T11:30:05.000Z | heisen/core/__init__.py | HeisenCore/heisen | 0cd4d27822960553a8e83a72c7dfeefa76e65c06 | [
"MIT"
] | 15 | 2016-09-15T19:21:24.000Z | 2016-10-22T16:22:15.000Z | heisen/core/__init__.py | HeisenCore/heisen | 0cd4d27822960553a8e83a72c7dfeefa76e65c06 | [
"MIT"
] | null | null | null | from heisen.config import settings
from jsonrpclib.request import ConnectionPool
rpc_call = get_rpc_connection()
| 27.454545 | 80 | 0.692053 | from heisen.config import settings
from jsonrpclib.request import ConnectionPool
def get_rpc_connection():
if settings.CREDENTIALS:
username, passowrd = settings.CREDENTIALS[0]
else:
username = passowrd = None
servers = {'self': []}
for instance_number in range(settings.INSTANCE_COUNT... | 465 | 0 | 23 |
02ea8c82d7d07ccadb813b913632d2c79182a1a4 | 3,348 | py | Python | python/ikit/interp.py | eddy-ilg/ikit | 4a2a28bf29e35bd69557cd1a7a250ceccab07b88 | [
"MIT"
] | null | null | null | python/ikit/interp.py | eddy-ilg/ikit | 4a2a28bf29e35bd69557cd1a7a250ceccab07b88 | [
"MIT"
] | null | null | null | python/ikit/interp.py | eddy-ilg/ikit | 4a2a28bf29e35bd69557cd1a7a250ceccab07b88 | [
"MIT"
] | null | null | null | import numpy as np
| 28.134454 | 116 | 0.468339 | import numpy as np
def find_nearest(array, value):
idx = np.searchsorted(array, value, side="left")
if idx > 0 and (idx == len(array) or math.fabs(value - array[idx-1]) < math.fabs(value - array[idx])):
idx = idx - 1
return idx, array[idx]
def advance_to_nearest(idx, array, value):
dist = abs(... | 3,066 | 11 | 252 |
5bc89390a9afb112693a9caadb722ffe80a659c2 | 1,331 | py | Python | pytition/petition/management/commands/update.py | lpoujade/Pytition | b66a4b358dc4e7dc368ec30e34e124f21920371e | [
"BSD-3-Clause"
] | 1 | 2020-08-13T23:01:48.000Z | 2020-08-13T23:01:48.000Z | pytition/petition/management/commands/update.py | lpoujade/Pytition | b66a4b358dc4e7dc368ec30e34e124f21920371e | [
"BSD-3-Clause"
] | 14 | 2020-08-05T17:27:54.000Z | 2020-09-25T02:11:32.000Z | pytition/petition/management/commands/update.py | lpoujade/Pytition | b66a4b358dc4e7dc368ec30e34e124f21920371e | [
"BSD-3-Clause"
] | null | null | null | import subprocess
from functools import partial
from django.core.management.base import BaseCommand
from django.conf import settings
from pathlib import Path
import os
run = partial(subprocess.run, shell=True, check=True)
class Command(BaseCommand):
"""Update pytition install
"""
| 34.128205 | 156 | 0.593539 | import subprocess
from functools import partial
from django.core.management.base import BaseCommand
from django.conf import settings
from pathlib import Path
import os
run = partial(subprocess.run, shell=True, check=True)
class Command(BaseCommand):
"""Update pytition install
"""
def handle(self, *args,... | 1,012 | 0 | 27 |
d8a9231416df4329b68705f67027a39e5c572589 | 3,401 | py | Python | bcml4pheno/ttbarzp.py | sheride/bcml4pheno | c9629dafcdbee0a4c28ceb7b28c9862de8479a24 | [
"Apache-2.0"
] | null | null | null | bcml4pheno/ttbarzp.py | sheride/bcml4pheno | c9629dafcdbee0a4c28ceb7b28c9862de8479a24 | [
"Apache-2.0"
] | null | null | null | bcml4pheno/ttbarzp.py | sheride/bcml4pheno | c9629dafcdbee0a4c28ceb7b28c9862de8479a24 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: ttbarzp.ipynb (unless otherwise specified).
__all__ = ['get_elijah_ttbarzp_cs', 'get_manuel_ttbarzp_cs', 'import47Ddata', 'get47Dfeatures']
# Cell
import numpy as np
import tensorflow as tf
# Cell
def get_elijah_ttbarzp_cs():
r"""
Contains cross section information... | 41.987654 | 121 | 0.614525 | # AUTOGENERATED! DO NOT EDIT! File to edit: ttbarzp.ipynb (unless otherwise specified).
__all__ = ['get_elijah_ttbarzp_cs', 'get_manuel_ttbarzp_cs', 'import47Ddata', 'get47Dfeatures']
# Cell
import numpy as np
import tensorflow as tf
# Cell
def get_elijah_ttbarzp_cs():
r"""
Contains cross section information... | 0 | 0 | 0 |
86aa32e4a92d6c37599e883a6b3eae0ce6cad1ff | 13,530 | py | Python | simple_db_migrate/oracle.py | sh0nk/simple-db-migrate | 8483a4ae11f5aea5514da55d7ff139a5a1bb2a71 | [
"Apache-2.0"
] | 120 | 2015-01-22T20:09:41.000Z | 2021-11-06T00:00:28.000Z | simple_db_migrate/oracle.py | sh0nk/simple-db-migrate | 8483a4ae11f5aea5514da55d7ff139a5a1bb2a71 | [
"Apache-2.0"
] | 19 | 2015-01-12T15:01:44.000Z | 2020-10-12T11:50:01.000Z | simple_db_migrate/oracle.py | sh0nk/simple-db-migrate | 8483a4ae11f5aea5514da55d7ff139a5a1bb2a71 | [
"Apache-2.0"
] | 36 | 2015-01-26T15:45:57.000Z | 2022-01-11T07:00:24.000Z | import os
import re
import sys
from .core import Migration
from .core.exceptions import MigrationException
from .helpers import Utils
from getpass import getpass
from .cli import CLI
| 43.089172 | 262 | 0.585144 | import os
import re
import sys
from .core import Migration
from .core.exceptions import MigrationException
from .helpers import Utils
from getpass import getpass
from .cli import CLI
class Oracle(object):
__re_objects = re.compile("(?ims)(?P<pre>.*?)(?P<main>create[ \n\t\r]*(or[ \n\t\r]+replace[ \n\t\r]*)?(trigge... | 12,567 | 756 | 23 |
27d6a8f043d6d02fb9eb37d08984a8c17e445752 | 457 | py | Python | backend_application/app/wikisearch/migrations/0005_article_urls.py | cdeler/woogle | 5774ce380947734bf0ed82bd27cdc5359bc1a646 | [
"MIT"
] | null | null | null | backend_application/app/wikisearch/migrations/0005_article_urls.py | cdeler/woogle | 5774ce380947734bf0ed82bd27cdc5359bc1a646 | [
"MIT"
] | 54 | 2018-07-05T13:39:48.000Z | 2018-09-24T09:58:40.000Z | backend_application/app/wikisearch/migrations/0005_article_urls.py | cdeler/woogle | 5774ce380947734bf0ed82bd27cdc5359bc1a646 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-08-06 02:02
from django.db import migrations, models
| 24.052632 | 121 | 0.621444 | # Generated by Django 2.0.7 on 2018-08-06 02:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wikisearch', '0004_auto_20180730_2216'),
]
operations = [
migrations.AddField(
model_name='article',
name='urls',
... | 0 | 343 | 23 |
aa0c45fc09b8a64070231bbbba2d3e138ed5f826 | 1,172 | py | Python | setup.py | EKT/pyrundeck | cfc5140d6ef336a54efcf1915df202ff35a7a492 | [
"BSD-3-Clause"
] | 2 | 2016-10-19T07:26:27.000Z | 2021-02-04T10:26:15.000Z | setup.py | EKT/pyrundeck | cfc5140d6ef336a54efcf1915df202ff35a7a492 | [
"BSD-3-Clause"
] | null | null | null | setup.py | EKT/pyrundeck | cfc5140d6ef336a54efcf1915df202ff35a7a492 | [
"BSD-3-Clause"
] | 2 | 2016-10-19T07:26:35.000Z | 2017-07-24T10:14:29.000Z | from setuptools import setup, find_packages
setup(
name="PyRundeck",
version="0.3.7",
description="A thin, pure Python wrapper for the Rundeck API",
author="Panagiotis Koutsourakis",
author_email="kutsurak@ekt.gr",
license='BSD',
url='https://github.com/EKT/pyrundeck',
classifiers=[
... | 33.485714 | 71 | 0.583618 | from setuptools import setup, find_packages
setup(
name="PyRundeck",
version="0.3.7",
description="A thin, pure Python wrapper for the Rundeck API",
author="Panagiotis Koutsourakis",
author_email="kutsurak@ekt.gr",
license='BSD',
url='https://github.com/EKT/pyrundeck',
classifiers=[
... | 0 | 0 | 0 |
d6352fdce21d7d0c934a11bb9ea65bd932594a8a | 8,584 | py | Python | core/diffraction.py | VasilyevEvgeny/self-focusing_3D | c90b4d78d2d72365566f8a49b325bd48127b1e44 | [
"MIT"
] | null | null | null | core/diffraction.py | VasilyevEvgeny/self-focusing_3D | c90b4d78d2d72365566f8a49b325bd48127b1e44 | [
"MIT"
] | null | null | null | core/diffraction.py | VasilyevEvgeny/self-focusing_3D | c90b4d78d2d72365566f8a49b325bd48127b1e44 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from multiprocessing import cpu_count
from numpy import exp, conj, zeros, complex64
from numba import jit
from pyfftw.builders import fft2, ifft2
class DiffractionExecutor(metaclass=ABCMeta):
"""
Abstract class for diffraction object.
The class takes on the input in... | 36.841202 | 116 | 0.582363 | from abc import ABCMeta, abstractmethod
from multiprocessing import cpu_count
from numpy import exp, conj, zeros, complex64
from numba import jit
from pyfftw.builders import fft2, ifft2
class DiffractionExecutor(metaclass=ABCMeta):
"""
Abstract class for diffraction object.
The class takes on the input in... | 3,877 | 0 | 237 |
335a7affe187d0655121af5cae9cd6180241399b | 3,928 | py | Python | src/product/migrations/0001_initial.py | gabriel-gn/magalu-favorites-api | c9e2e3c6752530272198ef8c12357016149c1d34 | [
"MIT"
] | null | null | null | src/product/migrations/0001_initial.py | gabriel-gn/magalu-favorites-api | c9e2e3c6752530272198ef8c12357016149c1d34 | [
"MIT"
] | null | null | null | src/product/migrations/0001_initial.py | gabriel-gn/magalu-favorites-api | c9e2e3c6752530272198ef8c12357016149c1d34 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.2 on 2021-05-16 03:23
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
| 46.761905 | 176 | 0.580193 | # Generated by Django 3.2.2 on 2021-05-16 03:23
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | 0 | 3,721 | 23 |
2ccf31155892bd9aa8de51d4885b66f2bda3d3f0 | 12,401 | py | Python | pysnmp/APPN-DLUR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/APPN-DLUR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/APPN-DLUR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module APPN-DLUR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APPN-DLUR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 127.845361 | 1,703 | 0.756149 | #
# PySNMP MIB module APPN-DLUR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APPN-DLUR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:08:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 0 | 0 | 0 |
43c22f960b133202f8a7111b1fe3f2235264bfa8 | 136 | py | Python | planning/urls.py | essanpupil/moneytracker | 506424ff287d4c093430e93169fedb7ee7da34f7 | [
"MIT"
] | null | null | null | planning/urls.py | essanpupil/moneytracker | 506424ff287d4c093430e93169fedb7ee7da34f7 | [
"MIT"
] | null | null | null | planning/urls.py | essanpupil/moneytracker | 506424ff287d4c093430e93169fedb7ee7da34f7 | [
"MIT"
] | null | null | null | from django.urls import path
from planning.views import main
app_name = 'planning'
urlpatterns = [
path('', main, name='main'),
]
| 15.111111 | 32 | 0.691176 | from django.urls import path
from planning.views import main
app_name = 'planning'
urlpatterns = [
path('', main, name='main'),
]
| 0 | 0 | 0 |
838292766d385db372fa0d4af4505071b2dc24b9 | 610 | py | Python | baseConverter.py | Alex0Blackwell/python-projects | 2abb51d1267913bcdd4807e1a10b931c90eb1bef | [
"MIT"
] | 2 | 2019-11-13T17:45:53.000Z | 2020-02-23T02:25:30.000Z | baseConverter.py | Alex0Blackwell/python-projects | 2abb51d1267913bcdd4807e1a10b931c90eb1bef | [
"MIT"
] | null | null | null | baseConverter.py | Alex0Blackwell/python-projects | 2abb51d1267913bcdd4807e1a10b931c90eb1bef | [
"MIT"
] | null | null | null | # Base conversion algorithm
# Fastest way to convert bases
# Note this does it in reverse so the strings and the strings elements
# must be reversed
usrNum = int(input("Enter a number to convert:\n"))
usrBase = int(input("Enter a base:\n"))
print(baseConvert(usrNum, usrBase))
| 27.727273 | 77 | 0.639344 | # Base conversion algorithm
# Fastest way to convert bases
# Note this does it in reverse so the strings and the strings elements
# must be reversed
def baseConvert(num, base):
# Given a number and a base to convert to
res = ''
q = num
while(q > 0):
r = q % base
# Reverse string becaus... | 307 | 0 | 23 |
8cc5584839c1c6356456528af689164edcad2ed7 | 1,530 | py | Python | archive/LEDs.py | Guillermo-Hidalgo-Gadea/RPi4Toolbox | 47a265aa9828f144155c097efc8ff36bd435099f | [
"MIT"
] | null | null | null | archive/LEDs.py | Guillermo-Hidalgo-Gadea/RPi4Toolbox | 47a265aa9828f144155c097efc8ff36bd435099f | [
"MIT"
] | null | null | null | archive/LEDs.py | Guillermo-Hidalgo-Gadea/RPi4Toolbox | 47a265aa9828f144155c097efc8ff36bd435099f | [
"MIT"
] | 1 | 2021-10-15T16:14:48.000Z | 2021-10-15T16:14:48.000Z | from blinkstick import blinkstick
| 32.553191 | 41 | 0.565359 | from blinkstick import blinkstick
class LED:
def __init__(self):
LEDlist = blinkstick.find_all()
self.LED1 = LEDlist[0]
self.LED2 = LEDlist[1]
def on(self):
self.LED1.set_color(0,0,255,0,0)
self.LED1.set_color(0,1,255,0,0)
self.LED1.set_color(0,2,255,0... | 1,388 | -11 | 119 |
0ed91efc5dacfde2c285ab9386a5f5ce32dd3da1 | 1,785 | py | Python | backend/classification/features/extraction.py | PolyCortex/polydodo | 473d5a8b89e9bdb68ba9592241e45d30b86b471c | [
"MIT"
] | 13 | 2020-06-02T03:17:10.000Z | 2022-03-23T04:06:52.000Z | backend/classification/features/extraction.py | PolyCortex/polydodo | 473d5a8b89e9bdb68ba9592241e45d30b86b471c | [
"MIT"
] | 43 | 2020-07-15T04:21:06.000Z | 2022-03-06T00:32:19.000Z | backend/classification/features/extraction.py | PolyCortex/polydodo | 473d5a8b89e9bdb68ba9592241e45d30b86b471c | [
"MIT"
] | 2 | 2020-12-27T07:21:18.000Z | 2021-09-16T20:06:47.000Z | """Feature extraction tools based off a two channel EEG recording"""
import numpy as np
from classification.config.constants import (
EEG_CHANNELS,
AGE_FEATURE_BINS,
)
from classification.features.pipeline import get_feature_union
def get_eeg_features(epochs, in_bed_seconds, out_of_bed_seconds):
"""Retur... | 30.775862 | 75 | 0.707003 | """Feature extraction tools based off a two channel EEG recording"""
import numpy as np
from classification.config.constants import (
EEG_CHANNELS,
AGE_FEATURE_BINS,
)
from classification.features.pipeline import get_feature_union
def get_eeg_features(epochs, in_bed_seconds, out_of_bed_seconds):
"""Retur... | 0 | 0 | 0 |
f052b9fc28af42e699049bdfe2b0ac01d467c316 | 187 | py | Python | user_details/give_default.py | Shreyanshsachan/College-Predictor | 87068aa1d1a889ced586ff155bc2b5d9a78340f7 | [
"MIT"
] | null | null | null | user_details/give_default.py | Shreyanshsachan/College-Predictor | 87068aa1d1a889ced586ff155bc2b5d9a78340f7 | [
"MIT"
] | null | null | null | user_details/give_default.py | Shreyanshsachan/College-Predictor | 87068aa1d1a889ced586ff155bc2b5d9a78340f7 | [
"MIT"
] | null | null | null | preference_list_of_user=[] | 20.777778 | 31 | 0.84492 | preference_list_of_user=[]
def give(def_list):
Def=def_list
global preference_list_of_user
preference_list_of_user=Def
return Def
def give_to_model():
return preference_list_of_user | 116 | 0 | 45 |
58988f8f98d9e6ccb12c9b0191a886bc9755df2f | 669 | py | Python | OPTED2fiveletter.py | caranha/wordle_helper | 731259e14f704a48bd84f528085dc8a70898adee | [
"RSA-MD"
] | null | null | null | OPTED2fiveletter.py | caranha/wordle_helper | 731259e14f704a48bd84f528085dc8a70898adee | [
"RSA-MD"
] | null | null | null | OPTED2fiveletter.py | caranha/wordle_helper | 731259e14f704a48bd84f528085dc8a70898adee | [
"RSA-MD"
] | null | null | null | import os
import re
from bs4 import BeautifulSoup
from string import ascii_lowercase
base_file = "OPTED/words_X.html"
fiveletter = []
for letter in ascii_lowercase:
file = base_file.replace("X",letter)
with open(file, "r") as f:
html = f.read()
words = BeautifulSoup(html, "html.parser").find_al... | 22.3 | 60 | 0.617339 | import os
import re
from bs4 import BeautifulSoup
from string import ascii_lowercase
base_file = "OPTED/words_X.html"
fiveletter = []
for letter in ascii_lowercase:
file = base_file.replace("X",letter)
with open(file, "r") as f:
html = f.read()
words = BeautifulSoup(html, "html.parser").find_al... | 0 | 0 | 0 |
2540e21ae41327e2addb8ebd529f9f84a1b0a7c2 | 713 | py | Python | testCoordinate.py | fsystemweb/mars-exploration | 26eba4bc51ac373159f3d030c5183e5f772ede40 | [
"MIT"
] | 1 | 2021-05-17T16:06:22.000Z | 2021-05-17T16:06:22.000Z | testCoordinate.py | fsystemweb/mars-exploration | 26eba4bc51ac373159f3d030c5183e5f772ede40 | [
"MIT"
] | null | null | null | testCoordinate.py | fsystemweb/mars-exploration | 26eba4bc51ac373159f3d030c5183e5f772ede40 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import patch
from models.coordinate import Coordinate
| 26.407407 | 61 | 0.708275 | import unittest
from unittest.mock import patch
from models.coordinate import Coordinate
class TestCoordinate(unittest.TestCase):
def test_extractDirections(self):
coordinate = Coordinate("01N FRL")
self.assertEqual("FRL", coordinate.getDirections())
def test_extractPointsInPlane(self):
... | 473 | 19 | 131 |
4861261a51c5c31e103d20e20adeece80de4bce7 | 1,198 | py | Python | rotate/ciphers.py | Noxell-zs/ROT13 | 36f1b788616979d6644448e0a8cc728bb2c15ad9 | [
"MIT"
] | null | null | null | rotate/ciphers.py | Noxell-zs/ROT13 | 36f1b788616979d6644448e0a8cc728bb2c15ad9 | [
"MIT"
] | null | null | null | rotate/ciphers.py | Noxell-zs/ROT13 | 36f1b788616979d6644448e0a8cc728bb2c15ad9 | [
"MIT"
] | null | null | null | """Realization of algorithms for char-by-char text encryption.
Functions:
rot_13(str) -> str
Character offset by 13 positions.
caesar_1(str) -> str
Character offset by 1 position.
"""
def rot_13(char_in: str) -> str:
"""Character offset by 13 positions.
Parameters:
char_in :... | 20.655172 | 62 | 0.551753 | """Realization of algorithms for char-by-char text encryption.
Functions:
rot_13(str) -> str
Character offset by 13 positions.
caesar_1(str) -> str
Character offset by 1 position.
"""
def rot_13(char_in: str) -> str:
"""Character offset by 13 positions.
Parameters:
char_in :... | 0 | 0 | 0 |
a1942149cf95520833b94d31fd0b168d287ad4d7 | 4,464 | py | Python | lbry/tests/unit/core/test_utils.py | vanshdevgan/lbry-sdk | 3624a3b450945235edcf76971e18c898fba67455 | [
"MIT"
] | null | null | null | lbry/tests/unit/core/test_utils.py | vanshdevgan/lbry-sdk | 3624a3b450945235edcf76971e18c898fba67455 | [
"MIT"
] | null | null | null | lbry/tests/unit/core/test_utils.py | vanshdevgan/lbry-sdk | 3624a3b450945235edcf76971e18c898fba67455 | [
"MIT"
] | null | null | null | import unittest
import asyncio
from lbry import utils
from torba.testcase import AsyncioTestCase
| 32.583942 | 98 | 0.614471 | import unittest
import asyncio
from lbry import utils
from torba.testcase import AsyncioTestCase
class CompareVersionTest(unittest.TestCase):
def test_compare_versions_isnot_lexographic(self):
self.assertTrue(utils.version_is_greater_than('0.3.10', '0.3.6'))
def test_same_versions_return_false(self):... | 3,725 | 280 | 360 |