hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ef5ab39f15ba19cf26d154d97b1439d120a1ea77 | 1,027 | py | Python | migrations/versions/2289e585ec7b_.py | apoorvkhare07/SUMSarizer | ff8264906c380b4d5e6a52a23040bb8bff361c92 | [
"MIT"
] | 9 | 2015-03-08T07:45:30.000Z | 2019-02-10T04:22:34.000Z | migrations/versions/2289e585ec7b_.py | apoorvkhare07/SUMSarizer | ff8264906c380b4d5e6a52a23040bb8bff361c92 | [
"MIT"
] | 45 | 2015-04-09T00:32:09.000Z | 2018-08-22T18:04:53.000Z | migrations/versions/2289e585ec7b_.py | apoorvkhare07/SUMSarizer | ff8264906c380b4d5e6a52a23040bb8bff361c92 | [
"MIT"
] | 13 | 2015-04-08T23:52:05.000Z | 2019-02-20T10:22:33.000Z | """empty message
Revision ID: 2289e585ec7b
Revises: 4291771faa57
Create Date: 2016-02-29 01:54:50.285413
"""
# revision identifiers, used by Alembic.
revision = '2289e585ec7b'
down_revision = '4291771faa57'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 28.527778 | 85 | 0.682571 |
f4594662999339f01695fc3e95b0497e5787ca09 | 292 | py | Python | python/katana/local/_graph_numba.py | bobdc/katana | 44b85645ef3955dc10653f64779bfec4231f215c | [
"BSD-3-Clause"
] | 1 | 2022-03-17T11:55:26.000Z | 2022-03-17T11:55:26.000Z | python/katana/local/_graph_numba.py | bobdc/katana | 44b85645ef3955dc10653f64779bfec4231f215c | [
"BSD-3-Clause"
] | null | null | null | python/katana/local/_graph_numba.py | bobdc/katana | 44b85645ef3955dc10653f64779bfec4231f215c | [
"BSD-3-Clause"
] | null | null | null | from numba.extending import overload, overload_method
from katana.local_native import Graph
__all__ = []
@overload_method(Graph._numba_type_wrapper.Type, "node_ids")
def overload_Graph_nodes(self):
_ = self
def impl(self):
return range(self.num_nodes())
return impl
| 18.25 | 60 | 0.736301 |
ad1635c37d775cccf4d3148e12524b788dbeb79e | 6,553 | py | Python | skimage/feature/template.py | zhanwenchen/scikit-image | af8a78e5b12ebb5709a57f9350b4b1f4c8f0c7db | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:36.000Z | 2020-04-03T17:29:07.000Z | Lib/site-packages/skimage/feature/template.py | caiyongji/Anaconda-py36.5-tensorflow-built-env | f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2 | [
"PSF-2.0"
] | 26 | 2020-03-24T18:07:06.000Z | 2022-03-12T00:12:27.000Z | Lib/site-packages/skimage/feature/template.py | caiyongji/Anaconda-py36.5-tensorflow-built-env | f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2 | [
"PSF-2.0"
] | 3 | 2019-12-31T23:21:40.000Z | 2020-04-03T17:29:08.000Z | import numpy as np
from scipy.signal import fftconvolve
from .._shared.utils import assert_nD
def _window_sum_2d(image, window_shape):
window_sum = np.cumsum(image, axis=0)
window_sum = (window_sum[window_shape[0]:-1]
- window_sum[:-window_shape[0] - 1])
window_sum = np.cumsum(window_... | 36.405556 | 86 | 0.572104 |
836c1fc83c17b339ee262c5a02603390e4873e85 | 479 | py | Python | malcolm/modules/pmac/parts/pmacrunnablechildpart.py | MattTaylorDLS/pymalcolm | 995a8e4729bd745f8f617969111cc5a34ce1ac14 | [
"Apache-2.0"
] | null | null | null | malcolm/modules/pmac/parts/pmacrunnablechildpart.py | MattTaylorDLS/pymalcolm | 995a8e4729bd745f8f617969111cc5a34ce1ac14 | [
"Apache-2.0"
] | null | null | null | malcolm/modules/pmac/parts/pmacrunnablechildpart.py | MattTaylorDLS/pymalcolm | 995a8e4729bd745f8f617969111cc5a34ce1ac14 | [
"Apache-2.0"
] | null | null | null | from malcolm.modules.scanning.controllers import RunnableController
from malcolm.modules.scanning.parts import RunnableChildPart
class PmacRunnableChildPart(RunnableChildPart):
# TODO: not sure if this is still needed to reset triggers on pause?
# Think it probably is because we need to reset triggers before ... | 36.846154 | 76 | 0.762004 |
ed895d59a38557f542237ab3b2b97220cba1300d | 158 | py | Python | ofstest/ofs/doctype/credit_and_sales_transactions/test_credit_and_sales_transactions.py | keithyang77/ofstest | aed4c8d22ea1f7857d6e6fcf774ec36d26a5ed17 | [
"MIT"
] | null | null | null | ofstest/ofs/doctype/credit_and_sales_transactions/test_credit_and_sales_transactions.py | keithyang77/ofstest | aed4c8d22ea1f7857d6e6fcf774ec36d26a5ed17 | [
"MIT"
] | null | null | null | ofstest/ofs/doctype/credit_and_sales_transactions/test_credit_and_sales_transactions.py | keithyang77/ofstest | aed4c8d22ea1f7857d6e6fcf774ec36d26a5ed17 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, mds and Contributors
# See license.txt
# import frappe
import unittest
class TestCreditandSalesTransactions(unittest.TestCase):
pass
| 17.555556 | 56 | 0.797468 |
c826274fe8993fbbf60897a372c7ee592cc592cd | 350 | py | Python | app/settings.py | mgajewskik/website_scraper_api | 7dab20863ac8461f24cff79f36e39d3ad2b40ed0 | [
"MIT"
] | null | null | null | app/settings.py | mgajewskik/website_scraper_api | 7dab20863ac8461f24cff79f36e39d3ad2b40ed0 | [
"MIT"
] | null | null | null | app/settings.py | mgajewskik/website_scraper_api | 7dab20863ac8461f24cff79f36e39d3ad2b40ed0 | [
"MIT"
] | null | null | null | import os
DATA_PATH = os.getenv("DATA_PATH")
PG = {
"host": os.getenv("POSTGRES_NAME"),
"db": os.getenv("PG_DATABASE"),
"user": os.getenv("PG_USER"),
"password": os.getenv("PG_PASSWORD"),
"port": os.getenv("PG_PORT"),
}
POSTGRES_URL = (
f"postgresql://{PG['user']}:{PG['password']}@{PG['host'... | 20.588235 | 86 | 0.577143 |
2d233472d179414bd09210b47455df56671dc57e | 75 | py | Python | machine_learning/similarity/problem/__init__.py | caserwin/daily-learning-python | 01fea4c5d4e86cbea2dbef8817146f018b5f1479 | [
"Apache-2.0"
] | 1 | 2019-05-04T07:27:18.000Z | 2019-05-04T07:27:18.000Z | machine_learning/similarity/problem/__init__.py | caserwin/daily-learning-python | 01fea4c5d4e86cbea2dbef8817146f018b5f1479 | [
"Apache-2.0"
] | null | null | null | machine_learning/similarity/problem/__init__.py | caserwin/daily-learning-python | 01fea4c5d4e86cbea2dbef8817146f018b5f1479 | [
"Apache-2.0"
] | 1 | 2018-09-20T01:49:36.000Z | 2018-09-20T01:49:36.000Z | # -*- coding: utf-8 -*-
# @Time : 2019/1/24 上午10:09
# @Author : yidxue
| 18.75 | 30 | 0.52 |
24cb410aa9bd5f21bee0b5d9edad3aaa4c783db5 | 100,801 | py | Python | ADMIN/venv/lib/python2.7/site-packages/pymongo/collection.py | PayPal-Opportunity-Hack-Chennai-2016/surabi-trust | 7f0d2038d5152c8cccb8d9db90b3edc589c3e3d1 | [
"Apache-2.0"
] | 1 | 2016-10-09T01:36:54.000Z | 2016-10-09T01:36:54.000Z | django_project/env/lib/python2.7/site-packages/pymongo/collection.py | bocaaust/FreshLife | 8a4efd9397e5e316f97abacaa765f3d4f9a7b371 | [
"Apache-2.0"
] | 7 | 2016-11-12T11:20:25.000Z | 2022-03-11T23:11:53.000Z | django_project/env/lib/python2.7/site-packages/pymongo/collection.py | bocaaust/FreshLife | 8a4efd9397e5e316f97abacaa765f3d4f9a7b371 | [
"Apache-2.0"
] | 3 | 2016-11-12T09:21:38.000Z | 2016-11-14T14:00:31.000Z | # Copyright 2009-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 42.694197 | 91 | 0.58049 |
4ee41c96ec0c98673051bf2f3ed7cd9d587ad32a | 13,191 | py | Python | sheraf/databases.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | 1 | 2020-03-18T09:54:52.000Z | 2020-03-18T09:54:52.000Z | sheraf/databases.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | null | null | null | sheraf/databases.py | yaal-fr/sheraf | 9821a53d8b0ea0aba420175e4cfa81529262f88c | [
"MIT"
] | null | null | null | import contextlib
import os
import traceback
from contextvars import ContextVar
import transaction
import ZODB.config
import ZODB.DB
import zodburi
from ZODB.DemoStorage import DemoStorage
from sheraf.exceptions import ConnectionAlreadyOpened
# Isolated contexts state
global_context_connections_state = ContextVar(... | 33.910026 | 125 | 0.627852 |
62f6c3e9d67d2ffec74359366959a98bb2427112 | 811 | py | Python | roles/osm2pgsql/templates/main.j2.py | cobra79/GeoGeekSuite | fc8e43a9e8dffa6b41b5b4671f674bee6f60785d | [
"Apache-2.0"
] | null | null | null | roles/osm2pgsql/templates/main.j2.py | cobra79/GeoGeekSuite | fc8e43a9e8dffa6b41b5b4671f674bee6f60785d | [
"Apache-2.0"
] | null | null | null | roles/osm2pgsql/templates/main.j2.py | cobra79/GeoGeekSuite | fc8e43a9e8dffa6b41b5b4671f674bee6f60785d | [
"Apache-2.0"
] | null | null | null | import cobra.helper.logging as logging
import cobra.tools.osm2pgsql as osm
from flask import Flask, request, jsonify
app = Flask(__name__)
l = logging.Logger('Osm2pgsql Flask')
l.debug('Start Cobra Logging')
#TODO: Schema handling
osm.Osm2PgSql(run_in_loop = True)
@app.route('/')
def hello_world():
l.debug('hell... | 24.575758 | 44 | 0.649815 |
cba7d1e0ad8a18494f02f0bc44fe38a363db76b4 | 37,033 | py | Python | discord/ext/commands/bot.py | ToxicKidz/discord.py | bba4d6c4e4df418ba98d46a95c3f472a67a042b6 | [
"MIT"
] | 13 | 2020-12-16T06:13:11.000Z | 2021-04-15T12:01:38.000Z | discord/ext/commands/bot.py | ToxicKidz/discord.py | bba4d6c4e4df418ba98d46a95c3f472a67a042b6 | [
"MIT"
] | 1 | 2022-02-26T08:28:44.000Z | 2022-02-26T08:28:44.000Z | discord/ext/commands/bot.py | ToxicKidz/discord.py | bba4d6c4e4df418ba98d46a95c3f472a67a042b6 | [
"MIT"
] | 6 | 2020-12-16T00:01:24.000Z | 2021-02-05T12:32:54.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 34.321594 | 118 | 0.604245 |
a4a89712613ffd58bba52e5e6019655b39976691 | 6,330 | py | Python | ros/src/tl_detector/tl_detector.py | AlexanderKim/CarND-Capstone | 99d7fb010bba961fe5f9416b6232e9904b8b691d | [
"MIT"
] | null | null | null | ros/src/tl_detector/tl_detector.py | AlexanderKim/CarND-Capstone | 99d7fb010bba961fe5f9416b6232e9904b8b691d | [
"MIT"
] | null | null | null | ros/src/tl_detector/tl_detector.py | AlexanderKim/CarND-Capstone | 99d7fb010bba961fe5f9416b6232e9904b8b691d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... | 34.78022 | 132 | 0.646445 |
501bea0132eb447a696bd18bf9755ba4442090c0 | 7,734 | py | Python | Figure_S1/Figure S1i-Compare with DMS-MaPseq/2-callMutations.py | zhangqf-lab/RIP-icSHAPE-MaP | 435cc8c8d5c2a662edb6371fd228174b3edd996f | [
"MIT"
] | 3 | 2021-06-11T14:17:04.000Z | 2021-12-20T16:20:20.000Z | Figure_S1/Figure S1i-Compare with DMS-MaPseq/2-callMutations.py | zhangqf-lab/RIP-icSHAPE-MaP | 435cc8c8d5c2a662edb6371fd228174b3edd996f | [
"MIT"
] | null | null | null | Figure_S1/Figure S1i-Compare with DMS-MaPseq/2-callMutations.py | zhangqf-lab/RIP-icSHAPE-MaP | 435cc8c8d5c2a662edb6371fd228174b3edd996f | [
"MIT"
] | null | null | null |
##### Run lpd lpdir envpy3 first
import subprocess
import threading
import os
def get_pairs():
pairs = []
pairs.append( [ 'NAI_100mm_vivo_CIRL_SSII', 'DMSO_CIRL_SSII', 'DC_CIRL_SSII' ] )
pairs.append( [ 'NAI_100mm_vitro_CIRL_SSII', 'DMSO_CIRL_... | 44.194286 | 142 | 0.569822 |
f5b1e7289f9bfbeac72dd18eb335bde902363ab9 | 1,756 | py | Python | setup.py | MrRutledge/pypastry | 59104ee8e882e75d33fe7bab60f03c353516eb8a | [
"MIT"
] | 1 | 2019-11-13T11:12:18.000Z | 2019-11-13T11:12:18.000Z | setup.py | MrRutledge/pypastry | 59104ee8e882e75d33fe7bab60f03c353516eb8a | [
"MIT"
] | null | null | null | setup.py | MrRutledge/pypastry | 59104ee8e882e75d33fe7bab60f03c353516eb8a | [
"MIT"
] | null | null | null | import sys
from setuptools import setup, find_packages
#check to make sure the python version is compatible
if sys.version_info < (3, 6):
sys.exit('Sorry, PyPastry requires Python version 3.6 or greater')
# Reading in the ReadMe file as the doc file
with open("README.md", "r") as fh:
long_description = fh.r... | 33.769231 | 93 | 0.6418 |
6e766104bdac6ddc8195ddbc96f49804fd7c3a2e | 751 | py | Python | Mundo 2/ex059.py | sandenbergmelo/ExerciciosPython | 049958801823b1b9b23b0e80f6f1bcf8cd272efe | [
"MIT"
] | 1 | 2021-05-12T18:44:11.000Z | 2021-05-12T18:44:11.000Z | Mundo 2/ex059.py | sandenbergmelo/ExerciciosPython | 049958801823b1b9b23b0e80f6f1bcf8cd272efe | [
"MIT"
] | null | null | null | Mundo 2/ex059.py | sandenbergmelo/ExerciciosPython | 049958801823b1b9b23b0e80f6f1bcf8cd272efe | [
"MIT"
] | null | null | null | n1 = int(input('Primeiro valor: '))
n2 = int(input('Segundo valor: '))
opcao = 0
while opcao != 5:
print(''' [ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair do programa''')
opcao = int(input('Opção: '))
if opcao == 1:
soma = n1 + n2
print(f'\n\n{n1} + {n2} = {soma}\n\n')
elif opca... | 22.088235 | 47 | 0.569907 |
cdbbee64d37a04d2ec606caad18f1e913aaa5736 | 4,628 | py | Python | vdpwi/data.py | achyudh/castor | d7a02ce03f2b71ef1fa490122dd4bbc8214b8b19 | [
"Apache-2.0"
] | 132 | 2017-04-02T12:31:55.000Z | 2019-03-09T07:53:29.000Z | vdpwi/data.py | sudipta90/castor | fa2f59535c71a0fb4586afbe543b81ba812c8630 | [
"Apache-2.0"
] | 111 | 2017-04-01T23:00:24.000Z | 2019-03-10T08:29:20.000Z | vdpwi/data.py | sudipta90/castor | fa2f59535c71a0fb4586afbe543b81ba812c8630 | [
"Apache-2.0"
] | 53 | 2017-04-06T01:17:18.000Z | 2019-02-27T03:10:35.000Z | import argparse
import os
import torch
import torch.nn as nn
import torch.utils.data as data
class Configs(object):
@staticmethod
def base_config():
parser = argparse.ArgumentParser()
parser.add_argument("--classifier", type=str, default="vdpwi", choices=["vdpwi", "resnet"])
parser.ad... | 42.072727 | 107 | 0.658168 |
0c800b9a9b1539f81cc9f466ab49348cd7f2d73b | 2,989 | py | Python | mathematica/feynrules/KineticMixingDM_UFO/lorentz.py | LoganAMorrison/AsymptoticBoltzmann | ef0213a7acc3f8d7095b446716bc90bbb036493d | [
"MIT"
] | null | null | null | mathematica/feynrules/KineticMixingDM_UFO/lorentz.py | LoganAMorrison/AsymptoticBoltzmann | ef0213a7acc3f8d7095b446716bc90bbb036493d | [
"MIT"
] | null | null | null | mathematica/feynrules/KineticMixingDM_UFO/lorentz.py | LoganAMorrison/AsymptoticBoltzmann | ef0213a7acc3f8d7095b446716bc90bbb036493d | [
"MIT"
] | null | null | null | # This file was automatically created by FeynRules 2.3.36
# Mathematica version: 12.1.1 for Linux x86 (64-bit) (June 19, 2020)
# Date: Thu 13 Aug 2020 15:13:29
from object_library import all_lorentz, Lorentz
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
try:
import form_factors ... | 31.463158 | 153 | 0.463031 |
ef2d9ce79e6bc0c87b840a6ce8204bae1ce5e0ef | 430 | py | Python | output/models/nist_data/atomic/ncname/schema_instance/nistschema_sv_iv_atomic_ncname_length_1_xsd/nistschema_sv_iv_atomic_ncname_length_1.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/ncname/schema_instance/nistschema_sv_iv_atomic_ncname_length_1_xsd/nistschema_sv_iv_atomic_ncname_length_1.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/ncname/schema_instance/nistschema_sv_iv_atomic_ncname_length_1_xsd/nistschema_sv_iv_atomic_ncname_length_1.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-NCName-length-1-NS"
@dataclass
class NistschemaSvIvAtomicNcnameLength1:
class Meta:
name = "NISTSchema-SV-IV-atomic-NCName-length-1"
namespace = "NISTSchema-SV-IV-atomic-NCName-length-1-NS"
value: str = field(
... | 22.631579 | 64 | 0.62093 |
5a52130a3fd85039c173d92ef0c13a0868635d7f | 1,593 | py | Python | smartcab/planner.py | thantuongaotrang/smart-cab | f5e34b15d01f6f15385318e5d09360cb1218b806 | [
"MIT"
] | null | null | null | smartcab/planner.py | thantuongaotrang/smart-cab | f5e34b15d01f6f15385318e5d09360cb1218b806 | [
"MIT"
] | null | null | null | smartcab/planner.py | thantuongaotrang/smart-cab | f5e34b15d01f6f15385318e5d09360cb1218b806 | [
"MIT"
] | null | null | null | import random
class RoutePlanner(object):
"""Silly route planner that is meant for a perpendicular grid network."""
def __init__(self, env, agent):
self.env = env
self.agent = agent
self.destination = None
def route_to(self, destination=None):
self.destination = destinatio... | 40.846154 | 115 | 0.560578 |
3b9e5ed5d79c9462856e4e8a132ac963622f9889 | 33,643 | py | Python | hzclient/proxy/mapproxy.py | hazelcast-incubator/hazelcast-python-client | 5ec6c908916a6adef648059314923c0dbf71557b | [
"Apache-2.0"
] | null | null | null | hzclient/proxy/mapproxy.py | hazelcast-incubator/hazelcast-python-client | 5ec6c908916a6adef648059314923c0dbf71557b | [
"Apache-2.0"
] | null | null | null | hzclient/proxy/mapproxy.py | hazelcast-incubator/hazelcast-python-client | 5ec6c908916a6adef648059314923c0dbf71557b | [
"Apache-2.0"
] | null | null | null | __author__ = 'jonathanbrodie'
from hzclient.codec import mapcodec
from hzclient.codec import proxycodec
from hzclient.clientmessage import ClientMessage
from util import encode
class MapProxy(object):
def __init__(self,title,connfamily):
self.title=title
self.connection=connfamily
firstpack=... | 61.28051 | 175 | 0.76099 |
39e7cdcb8ef4d17fcaeaefc7bf1131478de86552 | 4,124 | py | Python | scikit-learn-weighted_kde/examples/ensemble/plot_adaboost_multiclass.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | 1 | 2021-11-26T12:22:13.000Z | 2021-11-26T12:22:13.000Z | scikit-learn-weighted_kde/examples/ensemble/plot_adaboost_multiclass.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | scikit-learn-weighted_kde/examples/ensemble/plot_adaboost_multiclass.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | """
=====================================
Multi-class AdaBoosted Decision Trees
=====================================
This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can
improve prediction accuracy on a multi-class problem. The classification
dataset is constructed by taking a ten-dimensional ... | 34.082645 | 79 | 0.738118 |
ccfa8ea3f336b03b3ce0ce5baafc754ab34b5ff8 | 8,302 | py | Python | tests/webservice/test_getegrid.py | danduk82/pyramid_oereb | 4544ef81371aabd2a2f0759c2073f2ca51f85ff7 | [
"BSD-2-Clause"
] | null | null | null | tests/webservice/test_getegrid.py | danduk82/pyramid_oereb | 4544ef81371aabd2a2f0759c2073f2ca51f85ff7 | [
"BSD-2-Clause"
] | 2 | 2019-11-22T16:32:47.000Z | 2019-12-03T07:31:02.000Z | tests/webservice/test_getegrid.py | danduk82/pyramid_oereb | 4544ef81371aabd2a2f0759c2073f2ca51f85ff7 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import math
from jsonschema import Draft4Validator
from shapely.geometry import Point, Polygon, MultiPolygon
import pytest
from pyramid.httpexceptions import HTTPBadRequest, HTTPNoContent
from pyramid_oereb.lib.records.real_estate import RealEstateRecord
from pyramid_oereb.lib.re... | 37.396396 | 110 | 0.635148 |
f391e26b8fa3d1f4d4487fcea813274a176fffce | 354 | py | Python | backend/src/util/response_generator.py | leowucn/lazykindler | 45717e08aa0ccc504a9a5e3883dc403470ae824b | [
"MIT"
] | 2 | 2021-12-22T15:00:15.000Z | 2022-03-21T10:38:30.000Z | backend/src/util/response_generator.py | leowucn/lazykindler | 45717e08aa0ccc504a9a5e3883dc403470ae824b | [
"MIT"
] | null | null | null | backend/src/util/response_generator.py | leowucn/lazykindler | 45717e08aa0ccc504a9a5e3883dc403470ae824b | [
"MIT"
] | null | null | null | from flask import Response, json
from datetime import datetime, date
def response_generator(payload, status):
return Response(response=json.dumps({"payload": payload}), status=status, mimetype='application/json')
# json serializer
def json_serial(obj):
if isinstance(obj, (datetime, date)):
return ob... | 25.285714 | 106 | 0.731638 |
e310138c0f4ce00425baa11c92f96726e1ab9cbb | 3,328 | py | Python | gcloud/contrib/admin/migration_api/template_category.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 2 | 2021-07-28T01:48:31.000Z | 2021-11-17T11:02:26.000Z | gcloud/contrib/admin/migration_api/template_category.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | gcloud/contrib/admin/migration_api/template_category.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.619048 | 115 | 0.696514 |
6f53187945bf2acdd63789a349a6bdf3fd9d3e41 | 1,215 | py | Python | secrets.py | GregEigsti/HiveOS-Monitor | 7d26f10bbc4c8ae26d0e2925ebce3fddc6e11b1c | [
"MIT"
] | null | null | null | secrets.py | GregEigsti/HiveOS-Monitor | 7d26f10bbc4c8ae26d0e2925ebce3fddc6e11b1c | [
"MIT"
] | null | null | null | secrets.py | GregEigsti/HiveOS-Monitor | 7d26f10bbc4c8ae26d0e2925ebce3fddc6e11b1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
HiveOS-Monitor
HiveOS and currency monitoring script with temperature monitoring and heat management.
Project files:
hiveos.py - main script and stdout output code
temperature.py - temperature monitor / SSH based OC control. Interacts with Adafruit IO for UI goodness
webhel... | 31.153846 | 120 | 0.483951 |
222dd53901bfb2ab9baf636ea45e6459defef6a1 | 9,975 | py | Python | runOtakuBot.py | Eagleheardt/otakuBot | 6f8576423bb1b0701d5a60095bed7552b2711bab | [
"Unlicense"
] | null | null | null | runOtakuBot.py | Eagleheardt/otakuBot | 6f8576423bb1b0701d5a60095bed7552b2711bab | [
"Unlicense"
] | null | null | null | runOtakuBot.py | Eagleheardt/otakuBot | 6f8576423bb1b0701d5a60095bed7552b2711bab | [
"Unlicense"
] | null | null | null | import sqlite3
from sqlite3 import Error
import os
import time
import datetime
import re
import random
import schedule
import cryptography
from apscheduler.schedulers.background import BackgroundScheduler
from slackclient import SlackClient
from cryptography.fernet import Fernet
conn = sqlite3.connect('... | 27.631579 | 95 | 0.665063 |
230fb693f0a2df41ba867638cd3cd03a9e144d30 | 17,150 | py | Python | sdk/python/pulumi_azure_native/batch/v20210601/certificate.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/batch/v20210601/certificate.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/batch/v20210601/certificate.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 46.603261 | 1,259 | 0.662915 |
35daad5aecd0ac3a78c0c2339cbf51e0014f3f74 | 9,264 | py | Python | RunSEAmodes.py | PapStatMechMat/SeaPy | 1b30792c011a23172a1ce33fe8ebea976561d59a | [
"BSD-2-Clause"
] | 1 | 2021-05-26T05:16:05.000Z | 2021-05-26T05:16:05.000Z | RunSEAmodes.py | PapStatMechMat/SeaPy | 1b30792c011a23172a1ce33fe8ebea976561d59a | [
"BSD-2-Clause"
] | null | null | null | RunSEAmodes.py | PapStatMechMat/SeaPy | 1b30792c011a23172a1ce33fe8ebea976561d59a | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from numpy import dot, multiply, diag, power,ones,average
from scipy.signal import convolve2d
from numpy import pi, exp, sin, cos, cosh, tanh, real, imag
from numpy.linalg import inv, eig, pinv
from scipy... | 33.323741 | 128 | 0.614961 |
1f3fcca34de84aa8bf6265a50647d694d96fc92e | 2,475 | py | Python | setup.py | cclauss/requirements-builder | ec2e84b974290aaefa71b5ce19d0c343d29efffa | [
"BSD-3-Clause"
] | null | null | null | setup.py | cclauss/requirements-builder | ec2e84b974290aaefa71b5ce19d0c343d29efffa | [
"BSD-3-Clause"
] | null | null | null | setup.py | cclauss/requirements-builder | ec2e84b974290aaefa71b5ce19d0c343d29efffa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Requirements-Builder
# Copyright (C) 2015, 2016, 2017, 2018 CERN.
#
# Requirements-Builder is free software; you can redistribute it and/or
# modify it under the terms of the Revised BSD License; see LICENSE
# file for more details.
#
"""Build requirements files from set... | 27.5 | 74 | 0.63596 |
2666542ec3037f792e3650bf4b928959ac13f8c9 | 5,743 | py | Python | backends/ebpf/targets/ebpfstf.py | Abe149/p4c | 4a40ce4a15957de76e3a161c3778f1f0b6ac5780 | [
"Apache-2.0"
] | null | null | null | backends/ebpf/targets/ebpfstf.py | Abe149/p4c | 4a40ce4a15957de76e3a161c3778f1f0b6ac5780 | [
"Apache-2.0"
] | null | null | null | backends/ebpf/targets/ebpfstf.py | Abe149/p4c | 4a40ce4a15957de76e3a161c3778f1f0b6ac5780 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2018 VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.615942 | 104 | 0.58001 |
2a77aa3a4fd9eea90d9ccee3698d69828f3f2a0c | 11,685 | py | Python | mtcar-lossgraph/mountaincar-solver-lossgraph.py | hushon/son-dqn | 08b9bdce8b570a629b8484d21b06146335f5907e | [
"Apache-2.0"
] | null | null | null | mtcar-lossgraph/mountaincar-solver-lossgraph.py | hushon/son-dqn | 08b9bdce8b570a629b8484d21b06146335f5907e | [
"Apache-2.0"
] | null | null | null | mtcar-lossgraph/mountaincar-solver-lossgraph.py | hushon/son-dqn | 08b9bdce8b570a629b8484d21b06146335f5907e | [
"Apache-2.0"
] | null | null | null | ## Original implementation from https://github.com/ageron/tiny-dqn
## Edited to solve OpenAI Gym classic environments by github.com/hushon
from __future__ import division, print_function, unicode_literals
# Handle arguments (before slow imports so --help can be fast)
import argparse
parser = argparse.ArgumentParser(
... | 38.820598 | 123 | 0.653059 |
ab09950d7f6955e84d0ecf8c7fc0aa0c515b90d8 | 8,481 | py | Python | test/functional/wallet_import_rescan.py | reeccoin/REEC | eb388d692aa7039dfe78247c829e4d348ff1f631 | [
"MIT"
] | 2 | 2020-11-28T13:09:16.000Z | 2020-12-05T21:01:07.000Z | test/functional/wallet_import_rescan.py | reeccoin/REEC | eb388d692aa7039dfe78247c829e4d348ff1f631 | [
"MIT"
] | null | null | null | test/functional/wallet_import_rescan.py | reeccoin/REEC | eb388d692aa7039dfe78247c829e4d348ff1f631 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
impor... | 47.379888 | 116 | 0.666431 |
3a2950318764046c328bae914582abfee31aa3e2 | 445 | py | Python | apps/exams/migrations/0010_auto_20200410_1559.py | alfarhanzahedi/edumate | 76ced0063d25431098babb1d163c95c9ddaf3307 | [
"MIT"
] | 1 | 2021-11-28T14:18:16.000Z | 2021-11-28T14:18:16.000Z | apps/exams/migrations/0010_auto_20200410_1559.py | alfarhanzahedi/edumate | 76ced0063d25431098babb1d163c95c9ddaf3307 | [
"MIT"
] | 1 | 2022-02-10T10:53:12.000Z | 2022-02-10T10:53:12.000Z | apps/exams/migrations/0010_auto_20200410_1559.py | alfarhanzahedi/edumate | 76ced0063d25431098babb1d163c95c9ddaf3307 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.8 on 2020-04-10 15:59
import ckeditor_uploader.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('exams', '0009_auto_20200410_1526'),
]
operations = [
migrations.AlterField(
model_name='answer',
... | 22.25 | 89 | 0.640449 |
9c9b0c088becdb658f77557dc352e8951ef478fd | 86 | py | Python | lanfactory/__init__.py | AlexanderFengler/LANfactory | 78570d488c64907ef7dcf2161581a03746d0e45b | [
"MIT"
] | 1 | 2021-07-15T03:49:28.000Z | 2021-07-15T03:49:28.000Z | lanfactory/__init__.py | AlexanderFengler/LANfactory | 78570d488c64907ef7dcf2161581a03746d0e45b | [
"MIT"
] | null | null | null | lanfactory/__init__.py | AlexanderFengler/LANfactory | 78570d488c64907ef7dcf2161581a03746d0e45b | [
"MIT"
] | null | null | null | __version__ = '0.0.2'
from . import config
from . import trainers
from . import utils | 17.2 | 22 | 0.732558 |
bbcced59a030fde0ab77438bbf6a9c57daa000d4 | 24,177 | py | Python | examples/pytorch/language-modeling/run_mlm.py | InfluencerNGZK/transformers | 33080a0a29f849649ade9ef351d5744b5b0ddefe | [
"Apache-2.0"
] | null | null | null | examples/pytorch/language-modeling/run_mlm.py | InfluencerNGZK/transformers | 33080a0a29f849649ade9ef351d5744b5b0ddefe | [
"Apache-2.0"
] | null | null | null | examples/pytorch/language-modeling/run_mlm.py | InfluencerNGZK/transformers | 33080a0a29f849649ade9ef351d5744b5b0ddefe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team 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-... | 43.562162 | 119 | 0.667783 |
d0347cc0f904769260deaaf47c29c9bd6df1f67c | 3,541 | py | Python | nipyapi/nifi/models/drop_request_entity.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/drop_request_entity.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | 1 | 2020-03-16T10:02:46.000Z | 2020-03-16T13:37:42.000Z | nipyapi/nifi/models/drop_request_entity.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 28.556452 | 479 | 0.556622 |
0e7c9f3574619d899ba3d12f44f8c3a9ea0c8558 | 64,044 | py | Python | test/functional/feature_block.py | LOUD-Mining/WhatCoin | 867630c222dfc7643fe13c1ec69ae187210f157d | [
"MIT"
] | null | null | null | test/functional/feature_block.py | LOUD-Mining/WhatCoin | 867630c222dfc7643fe13c1ec69ae187210f157d | [
"MIT"
] | null | null | null | test/functional/feature_block.py | LOUD-Mining/WhatCoin | 867630c222dfc7643fe13c1ec69ae187210f157d | [
"MIT"
] | 1 | 2021-04-22T05:44:57.000Z | 2021-04-22T05:44:57.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing."""
import copy
import struct
import time
from test_framework.blocktools import ... | 46.509804 | 184 | 0.584598 |
75c36dda4c76a28b49d5c811c321b54af326ede4 | 2,795 | py | Python | connectfour/agent/environment.py | Lando-L/connect-four | 35be8b41443bd357b2b30678237a4581f3543aac | [
"MIT"
] | null | null | null | connectfour/agent/environment.py | Lando-L/connect-four | 35be8b41443bd357b2b30678237a4581f3543aac | [
"MIT"
] | null | null | null | connectfour/agent/environment.py | Lando-L/connect-four | 35be8b41443bd357b2b30678237a4581f3543aac | [
"MIT"
] | null | null | null | import os
from typing import Tuple
import numpy as np
from connectfour.agent.memory import AgentMemory
from connectfour.agent.model import AgentModel
from connectfour.game import gamestate
from connectfour.tools.mcts.tree import MCTSTree
class AgentEnvironment:
def __init__(self, observation_space: Tuple, actio... | 36.298701 | 112 | 0.620036 |
1d56ac8bd6e9f69dda6177d90df70ed873910b3f | 6,263 | py | Python | Theano-master/theano/gof/tests/test_link.py | JuliusSchwartz/FlowMO | e221d989914f906501e1ad19cd3629d88eac1785 | [
"MIT"
] | 95 | 2019-05-14T20:55:26.000Z | 2022-03-26T13:32:42.000Z | Theano-master/theano/gof/tests/test_link.py | JuliusSchwartz/FlowMO | e221d989914f906501e1ad19cd3629d88eac1785 | [
"MIT"
] | 7 | 2019-11-25T08:24:47.000Z | 2021-09-12T13:29:14.000Z | Theano-master/theano/gof/tests/test_link.py | JuliusSchwartz/FlowMO | e221d989914f906501e1ad19cd3629d88eac1785 | [
"MIT"
] | 24 | 2019-05-14T20:55:38.000Z | 2022-01-16T11:29:39.000Z | from __future__ import absolute_import, print_function, division
from copy import deepcopy
import unittest
import numpy
import theano
from theano.gof import graph
from theano.gof.graph import Variable, Apply, Constant
from theano.gof.type import Type
from theano.gof.op import Op
from theano.gof import fg
from theano... | 28.339367 | 77 | 0.544627 |
5266fcbf47370baaeecc1ec0dcc6ca77236cec94 | 10,781 | py | Python | tests/chainer_tests/optimizers_tests/test_optimizers.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 3,705 | 2017-06-01T07:36:12.000Z | 2022-03-30T10:46:15.000Z | tests/chainer_tests/optimizers_tests/test_optimizers.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 5,998 | 2017-06-01T06:40:17.000Z | 2022-03-08T01:42:44.000Z | tests/chainer_tests/optimizers_tests/test_optimizers.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 1,150 | 2017-06-02T03:39:46.000Z | 2022-03-29T02:29:32.000Z | import pickle
import unittest
import numpy as np
import six
import chainer
from chainer import functions as F
from chainer import optimizers
from chainer import testing
_all_optimizers = [
'AdaDelta',
'AdaGrad',
'Adam',
'AdamW',
'AMSGrad',
'AdaBound',
'AMSBound',
'CorrectedMomentumSG... | 29.137838 | 79 | 0.604675 |
a0d7c0c916f3ac9a4f2360f45a9979f8d9772f52 | 873 | py | Python | martin.carrasco/Tarea3/server.py | Nadnus/Dev-Plats | e90bc4770b9c0b7898a19168f6310275e7aa6eab | [
"MIT"
] | null | null | null | martin.carrasco/Tarea3/server.py | Nadnus/Dev-Plats | e90bc4770b9c0b7898a19168f6310275e7aa6eab | [
"MIT"
] | null | null | null | martin.carrasco/Tarea3/server.py | Nadnus/Dev-Plats | e90bc4770b9c0b7898a19168f6310275e7aa6eab | [
"MIT"
] | null | null | null | from functools import wraps
from flask import Flask, render_template, session, request, redirect, url_for
import redis
import os
app = Flask(__name__)
#redis_i = redis.from_url("redis://localhost:6379")
redis_i = redis.StrictRedis(host='localhost', port=6379, db=0)
app.secret_key = os.urandom(24)
def check_redis(f):... | 24.25 | 77 | 0.642612 |
cb6529afd094479a69475c8939f6264cffea5aed | 315 | py | Python | src/web/models.py | canl/algo-trading | 288f43a54d6594f79c79dc21f5534ad9aa785b29 | [
"MIT"
] | 11 | 2020-04-04T08:59:37.000Z | 2020-12-25T20:21:05.000Z | src/web/models.py | canl/algo-trading | 288f43a54d6594f79c79dc21f5534ad9aa785b29 | [
"MIT"
] | 1 | 2021-12-13T20:35:20.000Z | 2021-12-13T20:35:20.000Z | src/web/models.py | canl/algo-trading | 288f43a54d6594f79c79dc21f5534ad9aa785b29 | [
"MIT"
] | 3 | 2020-06-21T16:29:56.000Z | 2020-07-18T15:15:01.000Z | from flask_login import UserMixin
from src.web import db
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True) # primary keys are required by SQLAlchemy
email = db.Column(db.String(100), unique=True)
password = db.Column(db.String(100))
name = db.Column(db.String(1000))
| 28.636364 | 91 | 0.71746 |
3ef8bdeab62535a82ee775bed63e566846b51edd | 480 | py | Python | medusa_website/org_chart/migrations/0006_alter_committeerole_email.py | DeakinMeDUSA/medusa_website | 2f865a34ca29b42f4376623659f0e5b3a457769d | [
"MIT"
] | null | null | null | medusa_website/org_chart/migrations/0006_alter_committeerole_email.py | DeakinMeDUSA/medusa_website | 2f865a34ca29b42f4376623659f0e5b3a457769d | [
"MIT"
] | null | null | null | medusa_website/org_chart/migrations/0006_alter_committeerole_email.py | DeakinMeDUSA/medusa_website | 2f865a34ca29b42f4376623659f0e5b3a457769d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2022-01-03 08:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('org_chart', '0005_committeememberrecord'),
]
operations = [
migrations.AlterField(
model_name='committeerole',
name... | 25.263158 | 132 | 0.641667 |
79fb6fce030cb7f946bca21bfd1d13c5b7400a15 | 9,069 | py | Python | train.py | bklppr/yolo2_onnx | fcb85bd94e22c1c47f20fc13bb6ae3ac1ccd10f4 | [
"MIT"
] | null | null | null | train.py | bklppr/yolo2_onnx | fcb85bd94e22c1c47f20fc13bb6ae3ac1ccd10f4 | [
"MIT"
] | null | null | null | train.py | bklppr/yolo2_onnx | fcb85bd94e22c1c47f20fc13bb6ae3ac1ccd10f4 | [
"MIT"
] | 1 | 2018-07-11T22:44:11.000Z | 2018-07-11T22:44:11.000Z | from __future__ import print_function
import sys
if len(sys.argv) != 4:
print('Usage:')
print('python train.py datacfg cfgfile weightfile')
exit()
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torchvision... | 33.839552 | 122 | 0.582424 |
0d928312a375c95ae1bbf7deb1d0053d3397e001 | 22,980 | py | Python | schemagen/antlr/GraphQLListener.py | GoZaddy/SchemaGen | c8374382f6b52ad3cec398c77fd5bc90fe891818 | [
"MIT"
] | 3 | 2021-03-26T22:51:41.000Z | 2021-03-27T15:17:24.000Z | schemagen/antlr/GraphQLListener.py | GoZaddy/SchemaGen | c8374382f6b52ad3cec398c77fd5bc90fe891818 | [
"MIT"
] | null | null | null | schemagen/antlr/GraphQLListener.py | GoZaddy/SchemaGen | c8374382f6b52ad3cec398c77fd5bc90fe891818 | [
"MIT"
] | null | null | null | # Generated from GraphQL.g4 by ANTLR 4.9
from antlr4 import *
if __name__ is not None and "." in __name__:
from .GraphQLParser import GraphQLParser
else:
from GraphQLParser import GraphQLParser
# This class defines a complete listener for a parse tree produced by GraphQLParser.
class GraphQLListener(ParseTreeL... | 35.299539 | 101 | 0.758964 |
a914383576c54aa31117d4d8b56250d201d6b25c | 355 | py | Python | tests/test_meshinery.py | drozdziak1/meshinery | 65d3e1eba071ddf4b803909e9d42ef61c4de22c1 | [
"MIT"
] | null | null | null | tests/test_meshinery.py | drozdziak1/meshinery | 65d3e1eba071ddf4b803909e9d42ef61c4de22c1 | [
"MIT"
] | null | null | null | tests/test_meshinery.py | drozdziak1/meshinery | 65d3e1eba071ddf4b803909e9d42ef61c4de22c1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_meshinery
----------------------------------
Tests for `meshinery` module.
"""
import unittest
import meshinery
class TestMeshinery(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
assert(meshinery.__version__)
... | 13.653846 | 39 | 0.583099 |
f80741a074820c036344c63bfcaa99ae45e9d2a4 | 5,571 | py | Python | admin_app.py | nprapps/elections14 | b89f65aa276eebb790594f456d58e741066c1f93 | [
"MIT"
] | 5 | 2015-01-23T19:23:21.000Z | 2015-05-01T17:15:13.000Z | admin_app.py | nprapps/elections14 | b89f65aa276eebb790594f456d58e741066c1f93 | [
"MIT"
] | 1 | 2015-02-04T18:58:40.000Z | 2015-02-04T18:58:40.000Z | admin_app.py | nprapps/elections14 | b89f65aa276eebb790594f456d58e741066c1f93 | [
"MIT"
] | 1 | 2021-02-23T10:25:25.000Z | 2021-02-23T10:25:25.000Z | #!/usr/bin/env python
import argparse
import datetime
import json
import logging
import subprocess
import boto
from boto.s3.key import Key
from fabfile import stack
from flask import Flask, render_template
from flask_peewee.auth import Auth
from flask_peewee.db import Database
from flask_peewee.admin import Admin, Mo... | 29.321053 | 125 | 0.666846 |
76cd569bad8ab91584a795c6a542aba65b1ac9a2 | 1,775 | py | Python | core/migrations/0002_auto_20190606_0041.py | MubongwoNdasi/pms | 0cc5dcbc25b31e13631672e1a03c88e2ad46bc92 | [
"MIT"
] | null | null | null | core/migrations/0002_auto_20190606_0041.py | MubongwoNdasi/pms | 0cc5dcbc25b31e13631672e1a03c88e2ad46bc92 | [
"MIT"
] | 8 | 2021-03-18T22:27:44.000Z | 2022-02-10T09:18:50.000Z | core/migrations/0002_auto_20190606_0041.py | MubongwoNdasi/pms | 0cc5dcbc25b31e13631672e1a03c88e2ad46bc92 | [
"MIT"
] | 1 | 2021-09-20T06:37:41.000Z | 2021-09-20T06:37:41.000Z | # Generated by Django 2.2 on 2019-06-06 00:41
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='city',
name='cr... | 33.490566 | 118 | 0.59831 |
8cb365ec060514af9641d7684391a9a21a75c0d6 | 2,089 | py | Python | hordak/utilities/money.py | PetrDlouhy/django-hordak | 71c141928c5a2cc102bcfd710d7bdf17093933c9 | [
"MIT"
] | 2 | 2016-09-05T08:58:53.000Z | 2016-09-26T10:49:07.000Z | hordak/utilities/money.py | PetrDlouhy/django-hordak | 71c141928c5a2cc102bcfd710d7bdf17093933c9 | [
"MIT"
] | 3 | 2016-11-06T13:14:29.000Z | 2016-11-06T13:57:58.000Z | hordak/utilities/money.py | waldocollective/django-hordak | dc9b8e5008954ca0f4b089d89348e7dec4301f65 | [
"MIT"
] | null | null | null | from decimal import Decimal
from hordak.defaults import DECIMAL_PLACES
def ratio_split(amount, ratios):
"""Split in_value according to the ratios specified in `ratios`
This is special in that it ensures the returned values always sum to
in_value (i.e. we avoid losses or gains due to rounding errors). As... | 34.245902 | 84 | 0.646721 |
086d6848084d97850897bbe6d6c6676fd8676882 | 13,044 | py | Python | tests/time_tests/test_runner/conftest.py | maksimvlasov/openvino | be8600af38dd6ab39422b3db496c0fb73c156938 | [
"Apache-2.0"
] | 1 | 2021-07-14T07:20:24.000Z | 2021-07-14T07:20:24.000Z | tests/time_tests/test_runner/conftest.py | maksimvlasov/openvino | be8600af38dd6ab39422b3db496c0fb73c156938 | [
"Apache-2.0"
] | 35 | 2020-11-13T16:32:58.000Z | 2022-03-12T15:05:16.000Z | tests/time_tests/test_runner/conftest.py | sungeunk/openvino | c55291d62fced468570d15594738a7db6ef31c9d | [
"Apache-2.0"
] | 1 | 2021-01-21T12:09:13.000Z | 2021-01-21T12:09:13.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
"""
Basic high-level plugin file for pytest.
See [Writing plugins](https://docs.pytest.org/en/latest/writing_plugins.html)
for more information.
This plugin adds the following command-line options:
* `--test_conf` - Path to test configu... | 32.773869 | 120 | 0.605259 |
71e45913a166035d9487fd3d45450c75b60c96ae | 6,753 | py | Python | services/ops/LogStatisticsAgent/logstatisticsagent/agent.py | cloudcomputingabc/volttron | 6495e26e3185a7af8d0d79ad2586bdf8ea83992d | [
"Apache-2.0",
"BSD-2-Clause"
] | 406 | 2015-01-20T03:08:53.000Z | 2022-03-31T20:59:07.000Z | services/ops/LogStatisticsAgent/logstatisticsagent/agent.py | cloudcomputingabc/volttron | 6495e26e3185a7af8d0d79ad2586bdf8ea83992d | [
"Apache-2.0",
"BSD-2-Clause"
] | 2,031 | 2015-01-05T21:35:45.000Z | 2022-03-29T21:44:36.000Z | services/ops/LogStatisticsAgent/logstatisticsagent/agent.py | cloudcomputingabc/volttron | 6495e26e3185a7af8d0d79ad2586bdf8ea83992d | [
"Apache-2.0",
"BSD-2-Clause"
] | 219 | 2015-01-20T14:53:57.000Z | 2022-03-06T00:37:41.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | 39.95858 | 117 | 0.685473 |
ceacce6a356457dd0ca92b5e60fabae47f015271 | 6,318 | py | Python | examples/presenter/my_presentation.py | mdmintz/seleniumspot | f5c225aa4fcd0b4124fc990e3892c36736290ce8 | [
"MIT"
] | 2,745 | 2016-07-20T09:13:15.000Z | 2022-03-29T15:07:31.000Z | examples/presenter/my_presentation.py | mdmintz/seleniumspot | f5c225aa4fcd0b4124fc990e3892c36736290ce8 | [
"MIT"
] | 384 | 2016-07-17T20:45:26.000Z | 2022-03-31T22:35:35.000Z | examples/presenter/my_presentation.py | mdmintz/seleniumspot | f5c225aa4fcd0b4124fc990e3892c36736290ce8 | [
"MIT"
] | 704 | 2016-07-17T20:47:04.000Z | 2022-03-31T04:32:35.000Z | from seleniumbase import BaseCase
class MyPresenterClass(BaseCase):
def test_presenter(self):
self.create_presentation(theme="serif", transition="none")
self.add_slide(
"<h1>Welcome</h1><br />\n" "<h3>Press the <b>Right Arrow</b></h3>"
)
self.add_slide(
"<h3... | 48.229008 | 79 | 0.466129 |
35dd40fc28ff605b93136a6aa4fd8514d5d8f5a1 | 9,738 | py | Python | src/utils/gene_to_signal.py | ithihasmadala/gene-to-signal | 96efc1253604c0b5b46a0643e10bd1f0c9a7801c | [
"MIT"
] | null | null | null | src/utils/gene_to_signal.py | ithihasmadala/gene-to-signal | 96efc1253604c0b5b46a0643e10bd1f0c9a7801c | [
"MIT"
] | null | null | null | src/utils/gene_to_signal.py | ithihasmadala/gene-to-signal | 96efc1253604c0b5b46a0643e10bd1f0c9a7801c | [
"MIT"
] | null | null | null |
# *Import packages
from os import error
import math
import csv
import sys
# !Specify the type of representation you want the DNA sequence to be converted into. Choose from: ['Voss', 'Tetrahedron', 'Integer', 'Real', 'Complex']. Default = 'Voss'
# *This is the only variable that needs to be set in this script.
metric... | 39.425101 | 170 | 0.454919 |
4362266424de6b76013b18124be2bcc5cd063452 | 76 | py | Python | engine/model/__init__.py | rahulmadanraju/Semantic-Search-Engine | b0be4b9cdee2362be6c7ac97865c2588a7acdc15 | [
"MIT"
] | 2 | 2020-06-03T11:26:56.000Z | 2020-07-23T11:23:32.000Z | engine/model/__init__.py | rahulmadanraju/Semantic-Search-Engine | b0be4b9cdee2362be6c7ac97865c2588a7acdc15 | [
"MIT"
] | null | null | null | engine/model/__init__.py | rahulmadanraju/Semantic-Search-Engine | b0be4b9cdee2362be6c7ac97865c2588a7acdc15 | [
"MIT"
] | null | null | null | from engine.model.transformers import sentence_embeddings, predict_results
| 25.333333 | 74 | 0.881579 |
64ee140fd3a5dfa235fd7544d5ea51dcf2badd45 | 7,881 | py | Python | tool/utils.py | kndt84/pytorch-YOLOv4 | dfaada3517c5e3bea07f96e0e1e62a003271fa24 | [
"Apache-2.0"
] | null | null | null | tool/utils.py | kndt84/pytorch-YOLOv4 | dfaada3517c5e3bea07f96e0e1e62a003271fa24 | [
"Apache-2.0"
] | null | null | null | tool/utils.py | kndt84/pytorch-YOLOv4 | dfaada3517c5e3bea07f96e0e1e62a003271fa24 | [
"Apache-2.0"
] | null | null | null | import sys
import os
import time
import math
import numpy as np
import cv2
import itertools
import struct # get_image_size
import imghdr # get_image_size
from torch import nn
from torchvision import datasets, models, transforms
from torch.autograd import Variable
from PIL import Image
def extract_feature(img):
... | 27.652632 | 161 | 0.541809 |
c79d27a0de5cac6efb738d035efb4090ca390091 | 2,005 | py | Python | yt_dlp/extractor/syfy.py | olipfei/yt-dlp | 7879e79d11a2e5855167820518df49caf623fe48 | [
"Unlicense"
] | 11 | 2022-01-06T22:09:50.000Z | 2022-03-12T22:26:22.000Z | yt_dlp/extractor/syfy.py | olipfei/yt-dlp | 7879e79d11a2e5855167820518df49caf623fe48 | [
"Unlicense"
] | 4 | 2022-02-25T08:20:18.000Z | 2022-03-17T16:16:20.000Z | yt_dlp/extractor/syfy.py | olipfei/yt-dlp | 7879e79d11a2e5855167820518df49caf623fe48 | [
"Unlicense"
] | 3 | 2022-02-19T08:59:13.000Z | 2022-03-06T16:11:21.000Z | from .adobepass import AdobePassIE
from ..utils import (
update_url_query,
smuggle_url,
)
class SyfyIE(AdobePassIE):
_VALID_URL = r'https?://(?:www\.)?syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'http://www.syfy.com/theinternetruinedmylife/videos/the-internet-ruined-my-life... | 35.175439 | 113 | 0.527681 |
d2733611e34b0b364c29ff473b041a44ce553f2b | 26 | py | Python | utils/all.py | QiangZiBro/compass | 30c3d89a69e496185488dd5f596de517f59624fc | [
"Apache-2.0"
] | null | null | null | utils/all.py | QiangZiBro/compass | 30c3d89a69e496185488dd5f596de517f59624fc | [
"Apache-2.0"
] | 1 | 2021-09-23T06:59:23.000Z | 2021-09-23T06:59:23.000Z | utils/all.py | QiangZiBro/compass | 30c3d89a69e496185488dd5f596de517f59624fc | [
"Apache-2.0"
] | null | null | null | import open3d
import torch | 13 | 13 | 0.884615 |
7901f8712e7c9a9d62614608e1db94ba004f877a | 3,488 | py | Python | a2ml/api/auger/model.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 30 | 2019-07-01T13:23:27.000Z | 2022-03-16T21:19:33.000Z | a2ml/api/auger/model.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 234 | 2019-07-04T13:56:15.000Z | 2021-11-04T10:12:55.000Z | a2ml/api/auger/model.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 13 | 2019-07-04T14:00:34.000Z | 2020-07-13T11:18:44.000Z | from .impl.cloud.rest_api import RestApi
from .impl.decorators import with_project
from a2ml.api.utils.decorators import error_handler, authenticated
from .impl.model import Model
from .credentials import Credentials
class AugerModel(object):
def __init__(self, ctx):
self.ctx = ctx
self.credential... | 38.32967 | 138 | 0.711869 |
6852f14a0a4865116686058f45d93848e7050de2 | 7,481 | py | Python | tests/models/test_generic_file_error_model.py | dua-arpit/qecsim | 70ded606a653fd96d517e07fbba15d9b755df752 | [
"BSD-3-Clause"
] | 35 | 2021-02-08T08:32:54.000Z | 2022-03-22T05:35:06.000Z | tests/models/test_generic_file_error_model.py | dua-arpit/qecsim | 70ded606a653fd96d517e07fbba15d9b755df752 | [
"BSD-3-Clause"
] | 2 | 2021-08-05T06:10:35.000Z | 2021-08-20T12:44:10.000Z | tests/models/test_generic_file_error_model.py | dua-arpit/qecsim | 70ded606a653fd96d517e07fbba15d9b755df752 | [
"BSD-3-Clause"
] | 7 | 2021-02-11T17:32:47.000Z | 2021-11-30T12:34:41.000Z | import math
import os
import numpy as np
import pytest
from click.testing import CliRunner # use for isolated_filesystem feature
from qecsim import app
from qecsim import paulitools as pt
from qecsim.models.basic import FiveQubitCode
from qecsim.models.generic import FileErrorModel
from qecsim.models.rotatedplanar i... | 38.761658 | 119 | 0.730918 |
b9579098cdd1fea8e338f54a90889cf5d220e683 | 829 | py | Python | nlu/components/classifiers/multi_classifier/multi_classifier.py | UPbook-innovations/nlu | 2ae02ce7b6ca163f47271e98b71de109d38adefe | [
"Apache-2.0"
] | 1 | 2021-05-01T01:23:18.000Z | 2021-05-01T01:23:18.000Z | nlu/components/classifiers/multi_classifier/multi_classifier.py | sheerinZ/nlu | a223eee4b077a6b832f47e5e6125167fe0922687 | [
"Apache-2.0"
] | 2 | 2021-09-28T05:55:05.000Z | 2022-02-26T11:16:21.000Z | nlu/components/classifiers/multi_classifier/multi_classifier.py | atdavidpark/nlu | 619d07299e993323d83086c86506db71e2a139a9 | [
"Apache-2.0"
] | 1 | 2021-09-13T10:06:20.000Z | 2021-09-13T10:06:20.000Z | import nlu.pipe_components
import sparknlp
from sparknlp.annotator import *
class MultiClassifier:
@staticmethod
def get_default_model():
return MultiClassifierDLModel.pretrained() \
.setInputCols("sentence_embeddings") \
.setOutputCol("category")
@staticmethod
def get_... | 28.586207 | 65 | 0.652593 |
ff8b6c1575ed131d073caed9b536724f74da7cb3 | 72 | py | Python | quiz/main.py | bschandramohan/PyConnect | bfd5acc13b5fd5a83be14706032be2cf70d4d05a | [
"MIT"
] | 1 | 2021-10-11T04:34:25.000Z | 2021-10-11T04:34:25.000Z | quiz/main.py | bschandramohan/PyConnect | bfd5acc13b5fd5a83be14706032be2cf70d4d05a | [
"MIT"
] | null | null | null | quiz/main.py | bschandramohan/PyConnect | bfd5acc13b5fd5a83be14706032be2cf70d4d05a | [
"MIT"
] | null | null | null | from quiz.quiz_game import QuizGame
game = QuizGame()
game.play_game()
| 14.4 | 35 | 0.777778 |
3ee1234f52d2b19e1dbfe176ee3d32b5b789f2b8 | 5,078 | py | Python | src/gan_training.py | saattrupdan/gan | 68443884c7b4cf2527254d63145549de1f4ae525 | [
"MIT"
] | null | null | null | src/gan_training.py | saattrupdan/gan | 68443884c7b4cf2527254d63145549de1f4ae525 | [
"MIT"
] | null | null | null | src/gan_training.py | saattrupdan/gan | 68443884c7b4cf2527254d63145549de1f4ae525 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.data import TensorDataset
from torch.utils.tensorboard import SummaryWriter
import itertools as it
from pathlib import Path
from tqdm.auto import tqdm
from typing import Union
import os
import time
from... | 31.153374 | 70 | 0.553564 |
3ac6e2c853542d474ca9657e6b4eb7cb2c6c0546 | 10,312 | py | Python | tournament/tournament.py | singh-pratyush96/tournament-udacity | de895cf00b4799fe4193f38c30d8e0501fd95b68 | [
"MIT"
] | null | null | null | tournament/tournament.py | singh-pratyush96/tournament-udacity | de895cf00b4799fe4193f38c30d8e0501fd95b68 | [
"MIT"
] | null | null | null | tournament/tournament.py | singh-pratyush96/tournament-udacity | de895cf00b4799fe4193f38c30d8e0501fd95b68 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# tournament.py -- implementation of a Swiss-system tournament
#
import psycopg2
from random import shuffle
def connect():
"""
Connect to the PostgreSQL database.
Returns a database connection and corresponding cursor.
"""
connection = psycopg2.connect("dbname=tournament"... | 25.715711 | 80 | 0.610357 |
b58cc492945714d0d8b1ebe20efb2cf75f90fb40 | 3,032 | py | Python | src/vanchor/devices/nmea_net.py | AlexAsplund/Vanchor | cb5d1c95567ab9d9bd280e2ca3022e4a2da1fa67 | [
"MIT"
] | 12 | 2021-09-25T01:03:31.000Z | 2022-02-04T09:13:00.000Z | src/vanchor/devices/nmea_net.py | AlexAsplund/Vanchor | cb5d1c95567ab9d9bd280e2ca3022e4a2da1fa67 | [
"MIT"
] | 13 | 2021-09-20T19:56:50.000Z | 2022-01-10T13:08:32.000Z | src/vanchor/devices/nmea_net.py | AlexAsplund/Vanchor | cb5d1c95567ab9d9bd280e2ca3022e4a2da1fa67 | [
"MIT"
] | 1 | 2021-10-05T10:49:59.000Z | 2021-10-05T10:49:59.000Z | import socketserver
from threading import Thread
class NmeaNet:
def __init__(self, main):
self.main = main
self.logger = main.logging.getLogger(self.__class__.__name__)
self.emitter = main.event.emitter
self.main.work_manager.start_worker(self.start)
def start(sel... | 36.095238 | 87 | 0.573219 |
f4eaa4061bfed62c1da74b49767bf9af46595249 | 12,597 | py | Python | pyglet/media/instrumentation.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/media/instrumentation.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | pyglet/media/instrumentation.py | SwineProject/pyglet | f0203870bef94d4349ad16f060c941d45270a0b5 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2018 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 37.491071 | 88 | 0.609431 |
5d567e95c7601027cbc4d0f451a26ff9804ba951 | 835 | py | Python | src/music_genre_mfcc.py | Cyofanni/music-genre-classification | 05977e25146697426231017feff0624c09bdb96f | [
"MIT"
] | null | null | null | src/music_genre_mfcc.py | Cyofanni/music-genre-classification | 05977e25146697426231017feff0624c09bdb96f | [
"MIT"
] | null | null | null | src/music_genre_mfcc.py | Cyofanni/music-genre-classification | 05977e25146697426231017feff0624c09bdb96f | [
"MIT"
] | null | null | null | from scikits.talkbox.features import mfcc
import scipy
from scipy.io import wavfile
import numpy as np
import os
import glob
def write_ceps(ceps, filename):
base_filename, ext = os.path.splitext(filename)
data_filename = base_filename + ".ceps"
np.save(data_filename, ceps)
print("Written %s" % data_filename)
def... | 26.09375 | 83 | 0.702994 |
b9e92d29f53986ccc9ec9da4292db3cf2da5d11e | 4,961 | py | Python | corehq/extensions/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/extensions/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/extensions/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import importlib
import inspect
import itertools
import logging
from enum import Enum
from dimagi.utils.logging import notify_exception
logger = logging.getLogger("commcare.extensions")
class ExtensionError(Exception):
pass
class ResultFormat(Enum):
FLATTEN = 'flatten'
FIRST = 'first'
def flatten_re... | 32.854305 | 100 | 0.636767 |
5089a76de2298aeb14b6115ce1c88c159d7cce5e | 720 | py | Python | motor_control.py | cpu-robotics/Clyde | 345d757a5410cd4903764146c86b4f14af14a797 | [
"MIT"
] | null | null | null | motor_control.py | cpu-robotics/Clyde | 345d757a5410cd4903764146c86b4f14af14a797 | [
"MIT"
] | null | null | null | motor_control.py | cpu-robotics/Clyde | 345d757a5410cd4903764146c86b4f14af14a797 | [
"MIT"
] | 1 | 2019-04-18T18:24:44.000Z | 2019-04-18T18:24:44.000Z | #!/usr/bin/env python
"""motor_control.py: Motor control via a Sabertooth 2x25 motor controller """
__author__ = "Nick Vazquez"
__copyright__ = "Copyright 2020, Davenport Central Robotics Teams"
# Import all Necessary Classes
import serial
import math
import functions
# Used for the verification of the baud r... | 28.8 | 101 | 0.768056 |
baa184074dfb98baf0749a0a48d296f3cf4e9a22 | 8,129 | py | Python | grader_lib/datalayer.py | rmok57/sketchresponse | 1bc8123cc6e21137c6b5cc15719ba26ad41bcd54 | [
"MIT"
] | 11 | 2016-06-28T13:35:03.000Z | 2021-07-07T06:14:07.000Z | grader_lib/datalayer.py | rmok57/sketchresponse | 1bc8123cc6e21137c6b5cc15719ba26ad41bcd54 | [
"MIT"
] | 37 | 2016-06-29T13:16:38.000Z | 2022-02-27T01:18:08.000Z | grader_lib/datalayer.py | rmok57/sketchresponse | 1bc8123cc6e21137c6b5cc15719ba26ad41bcd54 | [
"MIT"
] | 4 | 2017-10-16T19:35:28.000Z | 2020-08-12T16:17:03.000Z | # """Contains functions and classes for processing function data"""
from __future__ import division
from __future__ import absolute_import
import numpy as np
from .Tag import Tag, Tagables
DEGREES = (3.142/180)
import sys
from . import Gradeable
# helper methods for interface-like class
def _functionId(obj, nFrame... | 34.888412 | 120 | 0.622217 |
906911366b550eafc1cb245f021457817db4acc0 | 796 | py | Python | Collect/MOD17/NPP_yearly.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | 3 | 2021-01-26T11:21:31.000Z | 2021-12-31T21:28:18.000Z | Collect/MOD17/NPP_yearly.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | null | null | null | Collect/MOD17/NPP_yearly.py | TimHessels/watertools | 77bb412a72f068d255d614f4f8a8f2cfb7d78a26 | [
"Apache-2.0"
] | 4 | 2019-01-02T06:45:55.000Z | 2021-06-30T11:51:38.000Z | import sys
from watertools.Collect.MOD17.DataAccessNPP import DownloadData
def main(Dir, Startdate, Enddate, latlim, lonlim, cores=False, Waitbar = 1, hdf_library = None, remove_hdf = 1):
"""
This function downloads MOD17 yearly NPP data for the specified time
interval, and spatial extent.
Keyword ar... | 34.608696 | 112 | 0.680905 |
1ec2bb16d12a4319fb9ebbd0f7d282f1307b7658 | 250 | py | Python | filterpy/wavhex.py | nyaxt/dmix | 8407c977562aa6145f8c5827b3881c3eb51011a7 | [
"MIT"
] | null | null | null | filterpy/wavhex.py | nyaxt/dmix | 8407c977562aa6145f8c5827b3881c3eb51011a7 | [
"MIT"
] | null | null | null | filterpy/wavhex.py | nyaxt/dmix | 8407c977562aa6145f8c5827b3881c3eb51011a7 | [
"MIT"
] | 1 | 2018-08-12T18:47:05.000Z | 2018-08-12T18:47:05.000Z | import sys
import wave
import struct
wi = wave.open(sys.argv[1], 'r')
# n = wi.getnframes()
n = 100000
ai = struct.unpack('h'*n, wi.readframes(n))
bo = open(sys.argv[2], 'w')
for e in ai:
bo.write("%06x\n" % ((e * 0x100) & 0xffffff))
bo.close()
| 16.666667 | 47 | 0.616 |
f7ea22c849e88cb6ec23b7fce557889423f5588a | 53 | py | Python | tests/lif/if_not_eq.py | Mieschendahl/assignment-final-stub | 19eea657fcc4f8a455c42028f34b918628514cc0 | [
"MIT"
] | null | null | null | tests/lif/if_not_eq.py | Mieschendahl/assignment-final-stub | 19eea657fcc4f8a455c42028f34b918628514cc0 | [
"MIT"
] | 1 | 2022-03-20T11:08:45.000Z | 2022-03-20T11:08:45.000Z | tests/lif/if_not_eq.py | Mieschendahl/assignment-final-stub | 19eea657fcc4f8a455c42028f34b918628514cc0 | [
"MIT"
] | 6 | 2022-03-13T13:10:25.000Z | 2022-03-28T22:18:12.000Z | x = 1
print(777 if (not (x == input_int())) else 42)
| 17.666667 | 46 | 0.584906 |
dc06d60b56c47248c23fa36a24ac0adbdefc621f | 22,110 | py | Python | tests/test_models/test_forward.py | hmtrii/mmdetection | a998e0ac45118482b4a1fa320c2f0611f35fb0d1 | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_forward.py | hmtrii/mmdetection | a998e0ac45118482b4a1fa320c2f0611f35fb0d1 | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_forward.py | hmtrii/mmdetection | a998e0ac45118482b4a1fa320c2f0611f35fb0d1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
"""pytest tests/test_forward.py."""
import copy
from os.path import dirname, exists, join
import numpy as np
import pytest
import torch
def _get_config_directory():
"""Find the predefined detector config directory."""
try:
# Assume we are r... | 34.173107 | 111 | 0.604568 |
5256fc7c6d0c5384aabe91d5ebf9201c1f38571a | 6,449 | py | Python | mayan/apps/document_parsing/views.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/document_parsing/views.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 6 | 2020-06-05T22:45:29.000Z | 2022-03-11T23:57:53.000Z | mayan/apps/document_parsing/views.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _, ungettext
from mayan.apps.common.generi... | 31.768473 | 80 | 0.656071 |
05909b7544b41abb1abf7245f32aa48b1ecd21b7 | 8,268 | py | Python | workflow_configuraitons_manager/xml_parsers/variables_manager.py | sontheimer/EBRAINS_ConfigManager | 5bbd8ee048e33d154d7287512d65bdcf2ca1a7d9 | [
"BSD-3-Clause"
] | null | null | null | workflow_configuraitons_manager/xml_parsers/variables_manager.py | sontheimer/EBRAINS_ConfigManager | 5bbd8ee048e33d154d7287512d65bdcf2ca1a7d9 | [
"BSD-3-Clause"
] | null | null | null | workflow_configuraitons_manager/xml_parsers/variables_manager.py | sontheimer/EBRAINS_ConfigManager | 5bbd8ee048e33d154d7287512d65bdcf2ca1a7d9 | [
"BSD-3-Clause"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0. "
#
# F... | 47.791908 | 114 | 0.641509 |
5a66fcb717c3a9151664741a2074a7f2373f4788 | 383 | py | Python | project/e2c/asgi.py | Tanukium/excel2csv | 44afc6d4ca241f48e12583e6c1209d881f466f49 | [
"MIT"
] | 9 | 2019-01-12T04:19:27.000Z | 2019-03-26T15:22:32.000Z | project/e2c/asgi.py | Tanukium/msemi | 40da6c4942cfffda31ba302ac0b8e6f8be2e86e4 | [
"MIT"
] | 1 | 2021-04-13T18:40:08.000Z | 2021-04-13T18:40:08.000Z | project/e2c/asgi.py | Tanukium/msemi | 40da6c4942cfffda31ba302ac0b8e6f8be2e86e4 | [
"MIT"
] | null | null | null | """
ASGI config for e2c project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_... | 22.529412 | 78 | 0.780679 |
b80ef368c958247ba1870cccbf0f4c08d067bec7 | 1,461 | py | Python | userbot/modules/instamusic.py | PratikGoswamiPM/OpenUserBot | 1ba7845522a5d5619d2705421a303aa82ce35abb | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-07-18T06:57:28.000Z | 2021-07-18T06:57:28.000Z | userbot/modules/instamusic.py | PratikGoswamiPM/OpenUserBot | 1ba7845522a5d5619d2705421a303aa82ce35abb | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/instamusic.py | PratikGoswamiPM/OpenUserBot | 1ba7845522a5d5619d2705421a303aa82ce35abb | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Originally from Bothub
# Port to UserBot by @PM_The_Angry
from telethon import events
import subprocess
from telethon.errors import MessageEmptyError, MessageTooLongError, MessageNotModifiedError
import io
import asyncio
import time
#from userbot.utils import admin_cmd
from userbot.events import register
from userb... | 23.564516 | 91 | 0.640657 |
68ed8bad0fbcb080d3932f731bc01ab9ad6ac8bc | 2,532 | py | Python | lms_code/plots/shading.py | tbenthompson/LMS_public | 1637e461ea269ae127a9da1fdba8e47a180c2ed2 | [
"MIT"
] | null | null | null | lms_code/plots/shading.py | tbenthompson/LMS_public | 1637e461ea269ae127a9da1fdba8e47a180c2ed2 | [
"MIT"
] | null | null | null | lms_code/plots/shading.py | tbenthompson/LMS_public | 1637e461ea269ae127a9da1fdba8e47a180c2ed2 | [
"MIT"
] | null | null | null | from pylab import *
# Taken from http://rnovitsky.blogspot.com/2010/04/using-hillshade-image-as-intensity.html
def set_shade(a,intensity=None,cmap=cm.jet,scale=10.0,azdeg=165.0,altdeg=45.0):
''' sets shading for data array based on intensity layer
or the data's value itself.
inputs:
a - a 2-d array ... | 44.421053 | 90 | 0.639021 |
cf1a96ce22487299f9e15346ca4ced28f3540a43 | 1,989 | py | Python | plugins/modules/ces_quotas_info.py | shaderecker/ansible-collection-cloud | d347379181c66db8d0c775c6f0647e928a90ba70 | [
"Apache-2.0"
] | null | null | null | plugins/modules/ces_quotas_info.py | shaderecker/ansible-collection-cloud | d347379181c66db8d0c775c6f0647e928a90ba70 | [
"Apache-2.0"
] | null | null | null | plugins/modules/ces_quotas_info.py | shaderecker/ansible-collection-cloud | d347379181c66db8d0c775c6f0647e928a90ba70 | [
"Apache-2.0"
] | 1 | 2021-03-24T06:03:58.000Z | 2021-03-24T06:03:58.000Z | #!/usr/bin/python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# di... | 23.963855 | 89 | 0.591755 |
20f8582b4fe695877eb4c6608b957c6cdb526adc | 40,268 | py | Python | src/core/payloadgen/create_payloads.py | rockstar9788/socialtoolkit | 02e40c6f89d5a78c233449c310b5d3c1e2a12e0b | [
"MIT"
] | null | null | null | src/core/payloadgen/create_payloads.py | rockstar9788/socialtoolkit | 02e40c6f89d5a78c233449c310b5d3c1e2a12e0b | [
"MIT"
] | null | null | null | src/core/payloadgen/create_payloads.py | rockstar9788/socialtoolkit | 02e40c6f89d5a78c233449c310b5d3c1e2a12e0b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Import modules
import subprocess
import time
import sys
import os
import re
import socket
import base64
from src.core.setcore import *
from src.core.menu.text import *
from src.core.dictionaries import *
try:
if len(check_options("IPADDR=")) > 2:
ipaddr = check_options("IPADDR=")
... | 50.779319 | 459 | 0.520686 |
1bb7ad7d12ca47f72c3d6e1be3d308044cde6cc1 | 189 | py | Python | text/is_palindrome.py | mouckatron/Martyr2MegaProjectList | 96cea1ea409a50626a2cb91d750f99e9bdf95464 | [
"MIT"
] | null | null | null | text/is_palindrome.py | mouckatron/Martyr2MegaProjectList | 96cea1ea409a50626a2cb91d750f99e9bdf95464 | [
"MIT"
] | null | null | null | text/is_palindrome.py | mouckatron/Martyr2MegaProjectList | 96cea1ea409a50626a2cb91d750f99e9bdf95464 | [
"MIT"
] | null | null | null | #! /usr/bin/python2.7
import os
import sys
data = sys.stdin.read().strip()
if data == data[::-1]:
sys.exit(0) # 0 is true or no failure
else:
sys.exit(1) # 1 is false or failure
| 15.75 | 41 | 0.624339 |
e23288474fc6445e48a0be0e2a554416af5431b6 | 3,406 | py | Python | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 674 | 2015-11-06T04:22:47.000Z | 2022-02-26T17:31:43.000Z | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 3,243 | 2017-02-07T15:30:01.000Z | 2022-03-31T16:42:19.000Z | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | 44.233766 | 79 | 0.685555 |
a67dba6522c8a61453b32bc3ca21f85bc77aee93 | 10,764 | py | Python | hivemind/server/expert_backend.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | 11 | 2021-06-21T19:56:01.000Z | 2021-12-22T09:06:09.000Z | hivemind/server/expert_backend.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | null | null | null | hivemind/server/expert_backend.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | null | null | null | from typing import Dict, Sequence, Any, Tuple, Union, Callable
import torch
from torch import nn
from hivemind.server.task_pool import TaskPool
from hivemind.utils import BatchTensorDescriptor, DUMMY_BATCH_SIZE
from hivemind.utils.logging import get_logger
from hivemind.utils.nested import nested_flatten, nested_pack... | 50.065116 | 125 | 0.678558 |
9d6dcaec00f412707cca21822d9dcd4cf71710f3 | 40,498 | py | Python | sos_trades_core/tests/l0_test_36_simple_multi_scenario.py | os-climate/sostrades-core | bcaa9b5e393ffbd0963e75a9315b27caf8b0abd9 | [
"Apache-2.0"
] | 8 | 2022-01-10T14:44:28.000Z | 2022-03-31T08:57:14.000Z | sos_trades_core/tests/l0_test_36_simple_multi_scenario.py | os-climate/sostrades-core | bcaa9b5e393ffbd0963e75a9315b27caf8b0abd9 | [
"Apache-2.0"
] | null | null | null | sos_trades_core/tests/l0_test_36_simple_multi_scenario.py | os-climate/sostrades-core | bcaa9b5e393ffbd0963e75a9315b27caf8b0abd9 | [
"Apache-2.0"
] | 1 | 2022-02-21T14:51:45.000Z | 2022-02-21T14:51:45.000Z | '''
Copyright 2022 Airbus SAS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | 44.454446 | 180 | 0.602499 |
386eea48ae59488107d3b8bf92b860dbc71387be | 431 | py | Python | 20160507_4.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | 20160507_4.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | 20160507_4.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | #_*_ coding: utf-8 _*_
from threading import Thread
def do_work(start, end, result):
sum = 0
for i in range(start, end):
sum += i
result.append(sum)
return
if __name__ == "__main__":
START, END = 0, 20000000
result = list()
th1 = Thread(target=do_work, args=(START, END/2, result))
th2 = Thread(target=do_wo... | 20.52381 | 58 | 0.663573 |
496878601bdbd8ab8bae6726cea8bbfc4d020ce6 | 12,021 | py | Python | django_extensions/management/commands/graph_models.py | kaozdl/django-extensions | bbc3ae686d2cba9c0bb0a6b88f5e71ddf1a6af36 | [
"MIT"
] | null | null | null | django_extensions/management/commands/graph_models.py | kaozdl/django-extensions | bbc3ae686d2cba9c0bb0a6b88f5e71ddf1a6af36 | [
"MIT"
] | null | null | null | django_extensions/management/commands/graph_models.py | kaozdl/django-extensions | bbc3ae686d2cba9c0bb0a6b88f5e71ddf1a6af36 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import json
import os
import tempfile
import six
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_extensions.management.modelviz import ModelGraph, generate_dot
from django_extensions.management.utils import signalcommand... | 40.338926 | 194 | 0.546294 |
fc464cc39c7a9db9cf3895c1311e7dabc8f105e9 | 39,124 | py | Python | qa/rpc-tests/test_framework/mininode.py | globalmovementclub/globalmovementclub | be5123a8e199cbe584963eedbe7e6f57e50374a1 | [
"MIT"
] | 1 | 2020-01-11T17:22:09.000Z | 2020-01-11T17:22:09.000Z | qa/rpc-tests/test_framework/mininode.py | grandmastercoin/grandmastercoin | be5123a8e199cbe584963eedbe7e6f57e50374a1 | [
"MIT"
] | 1 | 2020-09-24T02:21:29.000Z | 2020-09-24T02:21:29.000Z | qa/rpc-tests/test_framework/mininode.py | globalmovementclub/globalmovementclub | be5123a8e199cbe584963eedbe7e6f57e50374a1 | [
"MIT"
] | 1 | 2019-07-06T03:37:05.000Z | 2019-07-06T03:37:05.000Z | # mininode.py - GlobalMovementClub P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http... | 29.240658 | 184 | 0.571235 |
36ccdfc9408f44a83650f8df3b4de8eac6b8533c | 302 | py | Python | itertools_accumulate.py | DahlitzFlorian/article-introduction-to-itertools-snippets | 07803f568e8e11c96a42c140b1aca8fcbf71c93e | [
"MIT"
] | 3 | 2020-03-12T21:42:59.000Z | 2020-03-18T02:42:22.000Z | itertools_accumulate.py | DahlitzFlorian/article-introduction-to-itertools-snippets | 07803f568e8e11c96a42c140b1aca8fcbf71c93e | [
"MIT"
] | null | null | null | itertools_accumulate.py | DahlitzFlorian/article-introduction-to-itertools-snippets | 07803f568e8e11c96a42c140b1aca8fcbf71c93e | [
"MIT"
] | null | null | null | from itertools import accumulate
from operator import mul
numbers = [1, 2, 3, 4, 5]
result1 = accumulate(numbers)
result2 = accumulate(numbers, mul)
result3 = accumulate(numbers, initial=100)
print(f"Result 1: {list(result1)}")
print(f"Result 2: {list(result2)}")
print(f"Result 3: {list(result3)}")
| 25.166667 | 42 | 0.725166 |
24bb4aa9ecdf5bd8a9e89ffd359137a9805b77c9 | 11,926 | py | Python | SARS CoV-2/INATIVOS/Extração MagMax COVID - STARLAB.py | biogerm-pt/OT-2 | fed24f06db0ee19216a1f793482f588f07e3762a | [
"Apache-2.0"
] | null | null | null | SARS CoV-2/INATIVOS/Extração MagMax COVID - STARLAB.py | biogerm-pt/OT-2 | fed24f06db0ee19216a1f793482f588f07e3762a | [
"Apache-2.0"
] | null | null | null | SARS CoV-2/INATIVOS/Extração MagMax COVID - STARLAB.py | biogerm-pt/OT-2 | fed24f06db0ee19216a1f793482f588f07e3762a | [
"Apache-2.0"
] | null | null | null | from opentrons.types import Point
import json
import os
import math
import threading
from time import sleep
metadata = {
'protocolName': 'USO_v6_station_b_M300_Pool_magmax',
'author': 'Nick <ndiehl@opentrons.com',
'apiLevel': '2.3'
}
NUM_SAMPLES = 96 # start with 8 samples, slowly increase to 48, then 94 ... | 36.808642 | 110 | 0.582425 |
0177fcebd2550e61c6175ef81214f68f254fa7f3 | 6,740 | py | Python | src/tests/ftest/container/Open.py | JohnMalmberg/daos | 81a0e41a538aee4b998ec5101a66bb2b3ddecb6a | [
"Apache-2.0"
] | null | null | null | src/tests/ftest/container/Open.py | JohnMalmberg/daos | 81a0e41a538aee4b998ec5101a66bb2b3ddecb6a | [
"Apache-2.0"
] | 1 | 2018-10-22T17:06:02.000Z | 2018-10-29T05:08:00.000Z | src/tests/ftest/container/Open.py | JohnMalmberg/daos | 81a0e41a538aee4b998ec5101a66bb2b3ddecb6a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
(C) Copyright 2018 Intel Corporation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | 34.742268 | 93 | 0.617062 |
4157d0fb6b97e8d4648b6a9527374ba6e8e43f4a | 1,097 | py | Python | host/greatfet/interfaces/sdir.py | hewittc/greatfet | 9e9dfb9c0af476457d41731d5bfe483f8928a49d | [
"BSD-3-Clause"
] | 2 | 2019-11-07T01:09:14.000Z | 2020-10-31T06:10:49.000Z | host/greatfet/interfaces/sdir.py | hewittc/greatfet | 9e9dfb9c0af476457d41731d5bfe483f8928a49d | [
"BSD-3-Clause"
] | null | null | null | host/greatfet/interfaces/sdir.py | hewittc/greatfet | 9e9dfb9c0af476457d41731d5bfe483f8928a49d | [
"BSD-3-Clause"
] | 1 | 2021-06-26T06:05:10.000Z | 2021-06-26T06:05:10.000Z |
#
# This file is part of GreatFET
#
import array
import usb
from ..interface import GreatFETInterface
from greatfet.protocol import vendor_requests
class SDIRTransceiver(GreatFETInterface):
"""
Data source for scanning out software-defined IR data.
"""
USB_TIMEOUT_ERRNO = 110
def __init__... | 21.94 | 88 | 0.62443 |
74fddb0ba016fed5f282df528360621ea913a9b1 | 3,216 | py | Python | tests/test_extensions_build.py | l-bat/nncf | 6258916cd5fa7fc010ad09da63113354358bffd8 | [
"Apache-2.0"
] | null | null | null | tests/test_extensions_build.py | l-bat/nncf | 6258916cd5fa7fc010ad09da63113354358bffd8 | [
"Apache-2.0"
] | null | null | null | tests/test_extensions_build.py | l-bat/nncf | 6258916cd5fa7fc010ad09da63113354358bffd8 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
import pytest
import pathlib
import shutil
import torch
from tests.conftest import TEST_ROOT
from tests.test_sanity_sample import Command
EXTENSIONS_BUILD_FILENAME = 'extensions_build_checks.py'
@pytest.mark.parametrize("venv_type, package_type,install_type",
[(... | 35.733333 | 119 | 0.699938 |
0f3c5e55c0beb4a6904721a5ebaac967ed98eb25 | 6,019 | py | Python | stanza/models/pos/trainer.py | vivkvv/stanza | d30d396950c94499aa4897e2a3539ec720682253 | [
"Apache-2.0"
] | null | null | null | stanza/models/pos/trainer.py | vivkvv/stanza | d30d396950c94499aa4897e2a3539ec720682253 | [
"Apache-2.0"
] | null | null | null | stanza/models/pos/trainer.py | vivkvv/stanza | d30d396950c94499aa4897e2a3539ec720682253 | [
"Apache-2.0"
] | null | null | null | """
A trainer class to handle training and testing of models.
"""
import sys
import logging
import torch
from torch import nn
from stanza.models.common.trainer import Trainer as BaseTrainer
from stanza.models.common import utils, loss
from stanza.models.pos.model import Tagger
from stanza.models.pos.vocab import Mult... | 41.226027 | 141 | 0.629174 |
818129558bddbc0505e05a60216047b21343fd82 | 10,725 | py | Python | src/demos/python/fea/demo_FEA_beams_constr.py | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 1,383 | 2015-02-04T14:17:40.000Z | 2022-03-30T04:58:16.000Z | src/demos/python/fea/demo_FEA_beams_constr.py | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 245 | 2015-01-11T15:30:51.000Z | 2022-03-30T21:28:54.000Z | src/demos/python/fea/demo_FEA_beams_constr.py | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 351 | 2015-02-04T14:17:47.000Z | 2022-03-30T04:42:52.000Z | # =============================================================================
# PROJECT CHRONO - http:#projectchrono.org
#
# Copyright (c) 2014 projectchrono.org
# All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file at the top level of the distri... | 38.16726 | 139 | 0.702657 |
87a00e56f2ce796eab88192eea693b22ec87a146 | 10,375 | py | Python | method/mymodel-yelp/main.py | julian-pani/controllable-text-attribute-transfer | f60281702a37b681634b86c8597df542bafa64f5 | [
"Apache-2.0"
] | null | null | null | method/mymodel-yelp/main.py | julian-pani/controllable-text-attribute-transfer | f60281702a37b681634b86c8597df542bafa64f5 | [
"Apache-2.0"
] | null | null | null | method/mymodel-yelp/main.py | julian-pani/controllable-text-attribute-transfer | f60281702a37b681634b86c8597df542bafa64f5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# requirements: pytorch: 0.4
# Author: Ke Wang
# Contact: wangke17[AT]pku.edu.cn
import time
import argparse
import math
import os
import torch
import torch.nn as nn
from torch import optim
import numpy
import matplotlib
from matplotlib import pyplot as plt
# Import your model files.
from model import ... | 39.599237 | 111 | 0.611181 |
d95b8a27ac2ebdd5e4b8ab34161bb2137f577510 | 1,805 | py | Python | share/qt/extract_strings_qt.py | wizadr/DiminutiveCoin | 678ac688217b4578308c3a9cd6ccd1e7a08ecaf4 | [
"MIT"
] | 1 | 2022-03-27T20:06:29.000Z | 2022-03-27T20:06:29.000Z | share/qt/extract_strings_qt.py | MadCatMining/DiminutiveCoin | 678ac688217b4578308c3a9cd6ccd1e7a08ecaf4 | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | MadCatMining/DiminutiveCoin | 678ac688217b4578308c3a9cd6ccd1e7a08ecaf4 | [
"MIT"
] | 2 | 2022-01-10T00:41:44.000Z | 2022-02-24T09:11:26.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
OUT_CPP="src/qt/diminutivecoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
... | 25.422535 | 87 | 0.584488 |
f7a7a62d7f576e49e998225fc0a68717990c829d | 7,044 | py | Python | probdists/Triangulardistribution.py | m0hit-kumar/probdists | 786d4f6c53534c318499d97200355f94c8c48919 | [
"MIT"
] | null | null | null | probdists/Triangulardistribution.py | m0hit-kumar/probdists | 786d4f6c53534c318499d97200355f94c8c48919 | [
"MIT"
] | null | null | null | probdists/Triangulardistribution.py | m0hit-kumar/probdists | 786d4f6c53534c318499d97200355f94c8c48919 | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
from .Generaldistribution import Distribution
from collections import Counter
import seaborn as sns
class Triangular(Distribution):
"""
Triangular distribution class for calculating and visualizing the
triangular distribution: a continuous probability distributi... | 28.634146 | 104 | 0.548978 |
d94e48635e9d2ef72aafeb89e0cd91465420f984 | 1,167 | py | Python | shuter/shooter_game.py | vlax679/shuter | 8df27dfc9f6686df4f7b97ac831fb9518ea7da95 | [
"CC0-1.0"
] | null | null | null | shuter/shooter_game.py | vlax679/shuter | 8df27dfc9f6686df4f7b97ac831fb9518ea7da95 | [
"CC0-1.0"
] | null | null | null | shuter/shooter_game.py | vlax679/shuter | 8df27dfc9f6686df4f7b97ac831fb9518ea7da95 | [
"CC0-1.0"
] | null | null | null | from pygame import *
#создай окно игры
window = display.set_mode((800,600))
display.set_caption("Шутер")
background = transform.scale(image.load("galaxy.jpg"),(800,600))
#задай фон сцены
clock = time.Clock()
FPS = 100
#создай 2 спрайта и размести их на сцене
mixer.init()
mixer.music.load("space.ogg")
mixer.music.pl... | 25.369565 | 70 | 0.634105 |
2ba6252815a9e7af063eb544b38007c502f9003b | 847 | py | Python | tests/test_mysql_connection_pool.py | maypimentel/mysql_connection_pool | a6d193ee62d24fbc9aec449dd3bc9bf00375927d | [
"MIT"
] | null | null | null | tests/test_mysql_connection_pool.py | maypimentel/mysql_connection_pool | a6d193ee62d24fbc9aec449dd3bc9bf00375927d | [
"MIT"
] | null | null | null | tests/test_mysql_connection_pool.py | maypimentel/mysql_connection_pool | a6d193ee62d24fbc9aec449dd3bc9bf00375927d | [
"MIT"
] | null | null | null | import pytest
from mysql_connection_pool import MysqlPool
from mysql.connector import MySQLConnection
from mysql.connector.errors import PoolError
class TestMysqlConnectionPool:
def setup_method(self, method):
self.pool = MysqlPool(pool_size=2, pool_max_size=2)
def test_cnx_type(self):
cnx = ... | 31.37037 | 62 | 0.68477 |
335ebe7bff7191a76f4fdddea8e48d3a68f98df0 | 747 | py | Python | vispy/util/fonts/_vispy_fonts.py | shjoshi/vispy | 2f3d169aa60c738467e766c59096f51570483d6f | [
"BSD-3-Clause"
] | null | null | null | vispy/util/fonts/_vispy_fonts.py | shjoshi/vispy | 2f3d169aa60c738467e766c59096f51570483d6f | [
"BSD-3-Clause"
] | null | null | null | vispy/util/fonts/_vispy_fonts.py | shjoshi/vispy | 2f3d169aa60c738467e766c59096f51570483d6f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | 35.571429 | 79 | 0.519411 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.