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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d97ce5b1583caa862f15cea2cc1f385f8676bdfd | 207 | py | Python | server/api/admin.py | haliciyazilim/beste-yarismasi | 34acc5067caa547c12c81c8ffa9e524c288945aa | [
"MIT"
] | null | null | null | server/api/admin.py | haliciyazilim/beste-yarismasi | 34acc5067caa547c12c81c8ffa9e524c288945aa | [
"MIT"
] | null | null | null | server/api/admin.py | haliciyazilim/beste-yarismasi | 34acc5067caa547c12c81c8ffa9e524c288945aa | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Composition, Contest, Vote, Content
admin.site.register(Content)
admin.site.register(Composition)
admin.site.register(Contest)
admin.site.register(Vote)
| 25.875 | 55 | 0.821256 | from django.contrib import admin
from .models import Composition, Contest, Vote, Content
admin.site.register(Content)
admin.site.register(Composition)
admin.site.register(Contest)
admin.site.register(Vote)
| 0 | 0 | 0 |
f36c54205fb7bfc423d5970e687b7dc0ee76796c | 2,495 | py | Python | connectivity/src/stations/comstation.py | nakata5321/sensors-connectivity | 307c61196791a62365eda5516cdd161999a1a7f2 | [
"BSD-3-Clause"
] | null | null | null | connectivity/src/stations/comstation.py | nakata5321/sensors-connectivity | 307c61196791a62365eda5516cdd161999a1a7f2 | [
"BSD-3-Clause"
] | null | null | null | connectivity/src/stations/comstation.py | nakata5321/sensors-connectivity | 307c61196791a62365eda5516cdd161999a1a7f2 | [
"BSD-3-Clause"
] | null | null | null | import threading
import typing
import nacl.signing
import time
import typing as tp
import logging.config
from .istation import IStation, StationData, STATION_VERSION, Measurement
from ..drivers.sds011 import SDS011_MODEL, SDS011
from collections import deque
from connectivity.config.logging import LOGGING_CONFIG
logg... | 31.582278 | 87 | 0.598397 | import threading
import typing
import nacl.signing
import time
import typing as tp
import logging.config
from .istation import IStation, StationData, STATION_VERSION, Measurement
from ..drivers.sds011 import SDS011_MODEL, SDS011
from collections import deque
from connectivity.config.logging import LOGGING_CONFIG
logg... | 1,928 | 0 | 77 |
bbc03689b792220d2c67aec673e094e5a211d4d8 | 3,188 | py | Python | app/apimodels/ApiModel.py | Voltra/prodLogPy | df8e069342262beefd4210edce8cb13b2a9b936a | [
"MIT"
] | null | null | null | app/apimodels/ApiModel.py | Voltra/prodLogPy | df8e069342262beefd4210edce8cb13b2a9b936a | [
"MIT"
] | null | null | null | app/apimodels/ApiModel.py | Voltra/prodLogPy | df8e069342262beefd4210edce8cb13b2a9b936a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from app.models.Model import Model
from flask_restful import abort
import sqlite3
"""
A class that factorizes the behavior of models used for the API
"""
# | 32.530612 | 151 | 0.608218 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from app.models.Model import Model
from flask_restful import abort
import sqlite3
"""
A class that factorizes the behavior of models used for the API
"""
class ApiModel(Model):
LIMIT = 20
"""
Construct an ApiModel from meta data of a DB table
@:param idCol be... | 1,640 | 1,325 | 22 |
e2f9721e2bc57b9639d847af890205856469becc | 810 | py | Python | mission_control/devices/lock.py | aborger/RockSatX2020-KauIda | 4ee505c7dfac1a9f14a86f17e273fbdaa2af8319 | [
"MIT"
] | null | null | null | mission_control/devices/lock.py | aborger/RockSatX2020-KauIda | 4ee505c7dfac1a9f14a86f17e273fbdaa2af8319 | [
"MIT"
] | 1 | 2021-04-02T03:53:32.000Z | 2021-04-02T03:53:32.000Z | mission_control/devices/lock.py | aborger/RockSatX2020-KauIda | 4ee505c7dfac1a9f14a86f17e273fbdaa2af8319 | [
"MIT"
] | null | null | null | """
* The Lock class controls multiple servos to latch the door shut before the rocket spins up.
* Author: Aaron Borger <aborger@nnu.edu (307)534-6265>
"""
from devices.device import Device
import RPi.GPIO as GPIO
SERVO_PIN = 14
ZERO = 2.5
NINETY = 7.5
ONE_EIGHTY = 12.5
| 23.823529 | 92 | 0.688889 | """
* The Lock class controls multiple servos to latch the door shut before the rocket spins up.
* Author: Aaron Borger <aborger@nnu.edu (307)534-6265>
"""
from devices.device import Device
import RPi.GPIO as GPIO
SERVO_PIN = 14
ZERO = 2.5
NINETY = 7.5
ONE_EIGHTY = 12.5
class Lock(Device):
def __init__(self... | 404 | -2 | 131 |
eafe6d5fd00caff37beb5f3a4362830c727ed60f | 1,028 | py | Python | scripts/sundry/generate_features.py | huydhn/certstream-analytics | ed4dced6fcc399ef02be2c03754e49018623785b | [
"MIT"
] | 10 | 2019-04-27T17:24:14.000Z | 2021-01-21T01:30:39.000Z | scripts/sundry/generate_features.py | huydhn/certstream-analytics | ed4dced6fcc399ef02be2c03754e49018623785b | [
"MIT"
] | null | null | null | scripts/sundry/generate_features.py | huydhn/certstream-analytics | ed4dced6fcc399ef02be2c03754e49018623785b | [
"MIT"
] | 1 | 2019-09-16T13:07:12.000Z | 2019-09-16T13:07:12.000Z | '''
Generate features for outlier detection.
'''
import json
import sys
from certstream_analytics.analysers import WordSegmentation
from certstream_analytics.analysers import IDNADecoder
from certstream_analytics.analysers import FeaturesGenerator
def main(max_count=None):
'''
The record is assumed to be sto... | 23.906977 | 76 | 0.628405 | '''
Generate features for outlier detection.
'''
import json
import sys
from certstream_analytics.analysers import WordSegmentation
from certstream_analytics.analysers import IDNADecoder
from certstream_analytics.analysers import FeaturesGenerator
def main(max_count=None):
'''
The record is assumed to be sto... | 0 | 0 | 0 |
76058567d78556566acc67bff6c4ae064b8fd719 | 2,190 | py | Python | stage1/lib/fitTool.py | YU-Zhiyang/WEVI | 0282dc6de58722fc3ed3829a004800b035685b3a | [
"MIT"
] | 14 | 2021-08-10T06:58:07.000Z | 2022-02-25T23:03:10.000Z | stage1/lib/fitTool.py | YU-Zhiyang/WEVI | 0282dc6de58722fc3ed3829a004800b035685b3a | [
"MIT"
] | 4 | 2021-10-30T13:01:52.000Z | 2022-03-22T04:59:46.000Z | stage2/lib/fitTool.py | YU-Zhiyang/WEVI | 0282dc6de58722fc3ed3829a004800b035685b3a | [
"MIT"
] | null | null | null | import torch
import numpy as np
from torch.nn import functional as F
import torch.nn as nn
from torch.autograd import Variable
| 26.071429 | 76 | 0.56758 | import torch
import numpy as np
from torch.nn import functional as F
import torch.nn as nn
from torch.autograd import Variable
def backWarp(img: torch.Tensor, flow: torch.Tensor):
device = img.device
N, C, H, W = img.size()
u = flow[:, 0, :, :]
v = flow[:, 1, :, :]
gridX, gridY = np.meshgrid(np.... | 1,772 | 195 | 92 |
fb4fb8e645fc7e3b4d149216cfec4b327f930503 | 564 | py | Python | stamps/stest/designmatrix.py | stemlab689/stamps | 5494d4e86ad005082c677d9a07f71e1606338ba0 | [
"MIT"
] | null | null | null | stamps/stest/designmatrix.py | stemlab689/stamps | 5494d4e86ad005082c677d9a07f71e1606338ba0 | [
"MIT"
] | null | null | null | stamps/stest/designmatrix.py | stemlab689/stamps | 5494d4e86ad005082c677d9a07f71e1606338ba0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy
#only accept order = numpy.nan or 0
| 22.56 | 81 | 0.576241 | # -*- coding: utf-8 -*-
import numpy
#only accept order = numpy.nan or 0
def designmatrix( c, order ):
if numpy.isnan(order):
return numpy.array([],ndmin=2).reshape(c.shape[0],0), numpy.array([],ndmin = 2)
else:
n, nd = c.shape
X = numpy.ones((n, 1))
index = numpy.zeros((2, 1))
if nd == 1:
return X, ... | 466 | 0 | 22 |
fb25ec637dd722abb244d9b33c2f496b443fee74 | 36 | py | Python | utils/db/__init__.py | NikolaySimakov/Shop-bot | c13d5a2b91d9524af156948ff0014ff5357c376c | [
"MIT"
] | 50 | 2020-09-27T13:27:02.000Z | 2022-03-28T13:11:33.000Z | utils/db/__init__.py | NikolaySimakov/Shop-bot | c13d5a2b91d9524af156948ff0014ff5357c376c | [
"MIT"
] | null | null | null | utils/db/__init__.py | NikolaySimakov/Shop-bot | c13d5a2b91d9524af156948ff0014ff5357c376c | [
"MIT"
] | 18 | 2021-02-06T16:54:50.000Z | 2022-03-25T07:49:37.000Z | from .storage import DatabaseManager | 36 | 36 | 0.888889 | from .storage import DatabaseManager | 0 | 0 | 0 |
daf47cb37e81ee6379fc73e1083c92143c9ef311 | 377 | py | Python | profile/compute.py | emilleishida/School2019 | d5141df58d3240ceb0037e8f084f60fc2ef9b4c1 | [
"MIT"
] | 14 | 2019-02-02T08:33:10.000Z | 2021-05-04T17:38:26.000Z | profile/compute.py | emilleishida/School2019 | d5141df58d3240ceb0037e8f084f60fc2ef9b4c1 | [
"MIT"
] | 10 | 2019-04-01T11:39:40.000Z | 2019-04-09T12:53:33.000Z | profile/compute.py | emilleishida/School2019 | d5141df58d3240ceb0037e8f084f60fc2ef9b4c1 | [
"MIT"
] | 23 | 2019-03-25T18:37:26.000Z | 2021-08-19T16:41:45.000Z |
if __name__ == "__main__":
main()
| 17.136364 | 40 | 0.633952 | def generate_data(size):
return [i ** 2 for i in range(size)]
def compute_result(data):
total = 0
for _ in range(10):
total += sum(data)
return total
def main():
data = generate_data(size=100_000)
result = compute_result(data)
data = generate_data(size=200_000)
result = comp... | 267 | 0 | 68 |
c087cb6cc61b4a2b2df255ea5c8e9c35642e6d36 | 824 | py | Python | locust_swarm/config.py | ryankanno/locust-swarm | bd652b7fb6fc2c0cb23ef2b6a7f0c5abd80973d7 | [
"MIT"
] | 26 | 2015-03-02T23:09:12.000Z | 2022-02-22T13:21:55.000Z | locust_swarm/config.py | ryankanno/locust-swarm | bd652b7fb6fc2c0cb23ef2b6a7f0c5abd80973d7 | [
"MIT"
] | 3 | 2015-02-09T12:41:38.000Z | 2015-09-03T15:59:11.000Z | locust_swarm/config.py | ryankanno/locust-swarm | bd652b7fb6fc2c0cb23ef2b6a7f0c5abd80973d7 | [
"MIT"
] | 15 | 2015-02-09T20:16:27.000Z | 2021-04-08T07:17:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ConfigParser
from helpers import get_abs_path
DEFAULT_CFG_FILEPATH = 'locust-swarm.cfg'
DEFAULT_MASTER_ROLE_NAME = 'locust-master'
DEFAULT_SLAVE_ROLE_NAME = 'locust-slave'
DEFAULT_MASTER_BOOTSTRAP_DIR = './bootstrap-master'
DEFAULT_SLAVE_BOOTSTRAP_DIR = './bootstr... | 26.580645 | 78 | 0.723301 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ConfigParser
from helpers import get_abs_path
DEFAULT_CFG_FILEPATH = 'locust-swarm.cfg'
DEFAULT_MASTER_ROLE_NAME = 'locust-master'
DEFAULT_SLAVE_ROLE_NAME = 'locust-slave'
DEFAULT_MASTER_BOOTSTRAP_DIR = './bootstrap-master'
DEFAULT_SLAVE_BOOTSTRAP_DIR = './bootstr... | 362 | 0 | 23 |
b443bb6a343b457998597961b1e456c536f15615 | 358 | py | Python | Codes.python/P12/P12.py | hanzenglong/robot | fc686f751fc224b331bae2f1ee7b26b603c04634 | [
"MIT"
] | null | null | null | Codes.python/P12/P12.py | hanzenglong/robot | fc686f751fc224b331bae2f1ee7b26b603c04634 | [
"MIT"
] | null | null | null | Codes.python/P12/P12.py | hanzenglong/robot | fc686f751fc224b331bae2f1ee7b26b603c04634 | [
"MIT"
] | null | null | null | #-------by HYH -------#
import numpy as np
pCan=0.001
pNon=0.999
pPosCan=0.8
pPosNon=0.1
z='positive'
if 'positive'==z:
p=[pPosCan*pCan,pPosNon*pNon]
else:
p=[(1-pPosCan)*pCan,(1-pPosNon)*pNon]
p=p/np.sum(p)
print('The probability of having cancer given the %s test:\n'% z,'\n',p[0])
print('The probability of cancer f... | 25.571429 | 75 | 0.653631 | #-------by HYH -------#
import numpy as np
pCan=0.001
pNon=0.999
pPosCan=0.8
pPosNon=0.1
z='positive'
if 'positive'==z:
p=[pPosCan*pCan,pPosNon*pNon]
else:
p=[(1-pPosCan)*pCan,(1-pPosNon)*pNon]
p=p/np.sum(p)
print('The probability of having cancer given the %s test:\n'% z,'\n',p[0])
print('The probability of cancer f... | 0 | 0 | 0 |
74b5b86bbc8e2112482a8c3593af3294d721f966 | 1,104 | py | Python | nit/__main__.py | udasitharani/name-initials-tile-generator | 31fb8722cf1084e0827061f47baadf3ec034184d | [
"MIT"
] | null | null | null | nit/__main__.py | udasitharani/name-initials-tile-generator | 31fb8722cf1084e0827061f47baadf3ec034184d | [
"MIT"
] | null | null | null | nit/__main__.py | udasitharani/name-initials-tile-generator | 31fb8722cf1084e0827061f47baadf3ec034184d | [
"MIT"
] | null | null | null | import argparse, os, sys
from nit import generate_tile, generate_tile_from_initials, generate_initials_from_string
my_parser = argparse.ArgumentParser(prog="name initials tile generator",
usage="$(prog)s [options] name save_path",
description="Gen... | 55.2 | 121 | 0.707428 | import argparse, os, sys
from nit import generate_tile, generate_tile_from_initials, generate_initials_from_string
my_parser = argparse.ArgumentParser(prog="name initials tile generator",
usage="$(prog)s [options] name save_path",
description="Gen... | 0 | 0 | 0 |
f72c69bd895eea56254b314d4418757ffc5e1cbe | 1,266 | py | Python | Scripts/Legacy/line1prep.py | rhong3/CPTAC-UCEC | ec83fbee234b5ad3df6524cdd960b5f0f3da9ea9 | [
"MIT"
] | 4 | 2019-01-04T21:11:03.000Z | 2020-12-11T16:56:15.000Z | Scripts/Legacy/line1prep.py | rhong3/CPTAC-UCEC | ec83fbee234b5ad3df6524cdd960b5f0f3da9ea9 | [
"MIT"
] | null | null | null | Scripts/Legacy/line1prep.py | rhong3/CPTAC-UCEC | ec83fbee234b5ad3df6524cdd960b5f0f3da9ea9 | [
"MIT"
] | null | null | null | import pandas as pd
labels = pd.read_csv('../Fusion_dummy_His_MUT_joined.csv', header=0)
# line = pd.read_csv('../../Line1.csv', header=0)
line = pd.read_csv('../EC_cyclin_expression.csv', header=0)
# line['name'] = line['Proteomics_Participant_ID']
# line = line.drop(['Proteomics_Participant_ID', 'Histologic_type', ... | 48.692308 | 109 | 0.671406 | import pandas as pd
labels = pd.read_csv('../Fusion_dummy_His_MUT_joined.csv', header=0)
# line = pd.read_csv('../../Line1.csv', header=0)
line = pd.read_csv('../EC_cyclin_expression.csv', header=0)
# line['name'] = line['Proteomics_Participant_ID']
# line = line.drop(['Proteomics_Participant_ID', 'Histologic_type', ... | 0 | 0 | 0 |
d3859c10913045fb875d56e28ad9df02ba42ab36 | 1,043 | py | Python | CursoEmVideo/Python/Mundo 2/ex039.py | GabriellyBailon/Cursos | 0fe82881638a48dabbfd5963db39d2a0b7d7e4c3 | [
"MIT"
] | null | null | null | CursoEmVideo/Python/Mundo 2/ex039.py | GabriellyBailon/Cursos | 0fe82881638a48dabbfd5963db39d2a0b7d7e4c3 | [
"MIT"
] | null | null | null | CursoEmVideo/Python/Mundo 2/ex039.py | GabriellyBailon/Cursos | 0fe82881638a48dabbfd5963db39d2a0b7d7e4c3 | [
"MIT"
] | null | null | null | #Ler o ano de nascimento de um jovem e verificar se ele está na hora de alistar, se está muito cedo
#para isso ou já passou do momento certo
from datetime import date
nascimento = int(input("Digite o ano do seu nascimento: "));
sexo = str(input("Você é homem ou mulher? Digite H para homem e M se for mulher: ")).u... | 47.409091 | 195 | 0.662512 | #Ler o ano de nascimento de um jovem e verificar se ele está na hora de alistar, se está muito cedo
#para isso ou já passou do momento certo
from datetime import date
nascimento = int(input("Digite o ano do seu nascimento: "));
sexo = str(input("Você é homem ou mulher? Digite H para homem e M se for mulher: ")).u... | 0 | 0 | 0 |
b6fdcee777e9b0d18d33cf3d235811c1799c4efa | 4,549 | py | Python | tests/utils/test_sal_on_coco_dets.py | schencej/xaitk-saliency | d51dcc32e15118839133f7023e4f8e8cd65824af | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_sal_on_coco_dets.py | schencej/xaitk-saliency | d51dcc32e15118839133f7023e4f8e8cd65824af | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_sal_on_coco_dets.py | schencej/xaitk-saliency | d51dcc32e15118839133f7023e4f8e8cd65824af | [
"BSD-3-Clause"
] | null | null | null | from click.testing import CliRunner
import os
import py
import pytest
import builtins
import sys
from typing import Any
from tests import DATA_DIR
from xaitk_saliency.utils.bin.sal_on_coco_dets import sal_on_coco_dets
from importlib.util import find_spec
deps = ['kwcoco']
specs = [find_spec(dep) for dep in deps]
is... | 35.818898 | 118 | 0.65377 | from click.testing import CliRunner
import os
import py
import pytest
import builtins
import sys
from typing import Any
from tests import DATA_DIR
from xaitk_saliency.utils.bin.sal_on_coco_dets import sal_on_coco_dets
from importlib.util import find_spec
deps = ['kwcoco']
specs = [find_spec(dep) for dep in deps]
is... | 174 | 0 | 34 |
c36de79193b1d457ea4dabbbff54cc86fe2825ee | 1,584 | py | Python | setup.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | 34 | 2021-11-29T11:40:52.000Z | 2022-03-10T09:08:59.000Z | setup.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | 13 | 2021-12-30T17:07:34.000Z | 2022-02-18T18:46:37.000Z | setup.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
import pathlib as pl
DISTNAME = "gumbi"
DESCRIPTION = "Gaussian Process Model Building Interface"
AUTHOR = "John Goertz"
AUTHOR_EMAIL = ""
URL = "https://github.com/JohnGoertz/Gumbi"
LICENSE = "Apache 2.0"
PROJECT_ROOT = pl.Path(__file__).resolve().parent
REQUIRE... | 28.8 | 58 | 0.668561 | from setuptools import find_packages, setup
import pathlib as pl
DISTNAME = "gumbi"
DESCRIPTION = "Gaussian Process Model Building Interface"
AUTHOR = "John Goertz"
AUTHOR_EMAIL = ""
URL = "https://github.com/JohnGoertz/Gumbi"
LICENSE = "Apache 2.0"
PROJECT_ROOT = pl.Path(__file__).resolve().parent
REQUIRE... | 0 | 0 | 0 |
ba00ea527fb88c2eeb702875e541d67aadb66a24 | 14,056 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_te_datatypes.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_te_datatypes.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_te_datatypes.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-07-22T04:04:44.000Z | 2020-07-22T04:04:44.000Z | """ Cisco_IOS_XR_mpls_te_datatypes
This module contains a collection of generally useful
derived YANG data types.
Copyright (c) 2013\-2017 by Cisco Systems, Inc.
All rights reserved.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, Le... | 15.617778 | 126 | 0.611483 | """ Cisco_IOS_XR_mpls_te_datatypes
This module contains a collection of generally useful
derived YANG data types.
Copyright (c) 2013\-2017 by Cisco Systems, Inc.
All rights reserved.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, Le... | 0 | 0 | 0 |
9ea88e402074b31fd58c53eea583cd8b32a5a4bc | 454 | py | Python | backend/api/migrations/0010_auto_20180505_0100.py | genehsun/HwakimBlog | 714b4ab43675f4a21cf356282238d03b9585e5c4 | [
"MIT"
] | 6 | 2018-03-30T09:45:14.000Z | 2022-02-25T07:10:37.000Z | backend/api/migrations/0010_auto_20180505_0100.py | genehsun/HwakimBlog | 714b4ab43675f4a21cf356282238d03b9585e5c4 | [
"MIT"
] | 2 | 2019-02-25T18:36:26.000Z | 2019-02-25T18:37:37.000Z | backend/api/migrations/0010_auto_20180505_0100.py | genehsun/HwakimBlog | 714b4ab43675f4a21cf356282238d03b9585e5c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-05 01:00
from __future__ import unicode_literals
from django.db import migrations
| 19.73913 | 46 | 0.581498 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-05 01:00
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0009_auto_20180503_0708'),
]
operations = [
migrations.RemoveField(
... | 0 | 285 | 23 |
fd53637a318ac81a6cb7c7c4d4895aec1be44fc3 | 948 | py | Python | 2021/03/solution_one.py | adtok/advent-of-code | df1f61759bd8f3bfd7995b7e2a124d7f6e97ba01 | [
"MIT"
] | null | null | null | 2021/03/solution_one.py | adtok/advent-of-code | df1f61759bd8f3bfd7995b7e2a124d7f6e97ba01 | [
"MIT"
] | null | null | null | 2021/03/solution_one.py | adtok/advent-of-code | df1f61759bd8f3bfd7995b7e2a124d7f6e97ba01 | [
"MIT"
] | null | null | null | """
Advent of Code: Day 03 Part 1
tldr: most prevalent bit
"""
from collections import defaultdict
if __name__ == "__main__":
main()
| 22.046512 | 86 | 0.617089 | """
Advent of Code: Day 03 Part 1
tldr: most prevalent bit
"""
from collections import defaultdict
def bitchar(condition: bool) -> str:
return "1" if condition else "0"
def ZERO() -> int:
return 0
def solve(input_file):
tracker = defaultdict(ZERO)
with open(input_file, "r") as file:
for ... | 711 | 0 | 92 |
979869f37ae6498474b7c34a957d81033e23233c | 5,598 | py | Python | scrape_crs_website.py | JoshData/crs-reports-website | b72d09307511973a892a77f7ea0643cab28926a0 | [
"CC0-1.0"
] | 41 | 2016-09-17T13:12:41.000Z | 2022-01-04T08:32:26.000Z | scrape_crs_website.py | JoshData/crs-reports-website | b72d09307511973a892a77f7ea0643cab28926a0 | [
"CC0-1.0"
] | 13 | 2016-10-19T18:53:02.000Z | 2018-08-19T16:11:03.000Z | scrape_crs_website.py | JoshData/crs-reports-website | b72d09307511973a892a77f7ea0643cab28926a0 | [
"CC0-1.0"
] | 6 | 2016-10-19T18:44:53.000Z | 2021-01-07T02:52:11.000Z | #!/usr/bin/env python3
#
# Scrape reports from https://crsreports.congress.gov.
#
# This site provides many of the same reports that
# are available through our own archive, but only as
# PDFs and only with versions as of the site launch
# date and going forward.
from collections import OrderedDict
import datetime
imp... | 34.134146 | 111 | 0.65577 | #!/usr/bin/env python3
#
# Scrape reports from https://crsreports.congress.gov.
#
# This site provides many of the same reports that
# are available through our own archive, but only as
# PDFs and only with versions as of the site launch
# date and going forward.
from collections import OrderedDict
import datetime
imp... | 4,551 | 0 | 46 |
56ae42b088337f9464441adc110055e63c597818 | 188 | py | Python | locale/pot/api/core/_autosummary/pyvista-Light-specular_color-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 4 | 2020-08-07T08:19:19.000Z | 2020-12-04T09:51:11.000Z | locale/pot/api/core/_autosummary/pyvista-Light-specular_color-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 19 | 2020-08-06T00:24:30.000Z | 2022-03-30T19:22:24.000Z | locale/pot/api/core/_autosummary/pyvista-Light-specular_color-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 1 | 2021-03-09T07:50:40.000Z | 2021-03-09T07:50:40.000Z | # Create a light and set its specular color to bright green.
#
import pyvista as pv
light = pv.Light()
light.specular_color = '#00FF00'
light.specular_color
# Expected:
## (0.0, 1.0, 0.0)
| 20.888889 | 60 | 0.712766 | # Create a light and set its specular color to bright green.
#
import pyvista as pv
light = pv.Light()
light.specular_color = '#00FF00'
light.specular_color
# Expected:
## (0.0, 1.0, 0.0)
| 0 | 0 | 0 |
d31dfbf24fe2af161e356b5834c663977684c417 | 6,407 | py | Python | opennem/db/views/__init__.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 22 | 2020-06-30T05:27:21.000Z | 2022-02-21T12:13:51.000Z | opennem/db/views/__init__.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 71 | 2020-08-07T13:06:30.000Z | 2022-03-15T06:44:49.000Z | opennem/db/views/__init__.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 13 | 2020-06-30T03:28:32.000Z | 2021-12-30T08:17:16.000Z | import logging
from operator import attrgetter
from pathlib import Path
from typing import List
from opennem.db import get_database_engine
from opennem.db.views.queries import (
get_all_views_query,
get_query_drop_view,
get_view_unique_index_query,
)
from .continuous_aggregates import (
create_continu... | 28.602679 | 97 | 0.64133 | import logging
from operator import attrgetter
from pathlib import Path
from typing import List
from opennem.db import get_database_engine
from opennem.db.views.queries import (
get_all_views_query,
get_query_drop_view,
get_view_unique_index_query,
)
from .continuous_aggregates import (
create_continu... | 444 | 0 | 23 |
f853927ccd43fef77f91ed6e39a184b8c8436f43 | 4,264 | py | Python | callback_script_template.py | Phedorabot/phedorabot-python-sdk | 9e5e4a72a573cf85d41dfd765f96ec725f844ea6 | [
"Apache-2.0"
] | null | null | null | callback_script_template.py | Phedorabot/phedorabot-python-sdk | 9e5e4a72a573cf85d41dfd765f96ec725f844ea6 | [
"Apache-2.0"
] | null | null | null | callback_script_template.py | Phedorabot/phedorabot-python-sdk | 9e5e4a72a573cf85d41dfd765f96ec725f844ea6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2017 Phedorabot
#
# 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... | 45.361702 | 81 | 0.705441 | #!/usr/bin/env python
#
# Copyright 2017 Phedorabot
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 0 | 0 |
cf19db66604da08c8957990aad01534c1093b2d9 | 5,031 | py | Python | tests/test_wsClaims.py | pedromtorres/TigerShark | 2790a7c03905a094b126b48387c7919c09cce238 | [
"BSD-3-Clause"
] | 24 | 2015-03-18T10:15:20.000Z | 2022-03-18T13:38:34.000Z | tests/test_wsClaims.py | tspannhw/TigerShark | 5081641f1b189a43e9eab4813256598cc0a79f6f | [
"BSD-3-Clause"
] | 6 | 2015-03-27T12:36:57.000Z | 2021-04-13T15:01:24.000Z | tests/test_wsClaims.py | tspannhw/TigerShark | 5081641f1b189a43e9eab4813256598cc0a79f6f | [
"BSD-3-Clause"
] | 21 | 2015-11-21T09:19:47.000Z | 2020-09-17T16:52:50.000Z | #!/usr/bin/env python2.6
"""
Unit test of web.claims application as a complete Django WSGI web service.
"""
from __future__ import print_function
import unittest
import httplib
import urllib2, urllib
import logging, sys
import os.path
import datetime
import base64
import subprocess, time
import json
logger= logging.ge... | 35.429577 | 114 | 0.602465 | #!/usr/bin/env python2.6
"""
Unit test of web.claims application as a complete Django WSGI web service.
"""
from __future__ import print_function
import unittest
import httplib
import urllib2, urllib
import logging, sys
import os.path
import datetime
import base64
import subprocess, time
import json
logger= logging.ge... | 2,465 | 0 | 104 |
ed83f26f4982188dfda254ff2bee2fbae7eae451 | 507 | py | Python | libs/core/cms/api/migrations/0015_auto_20190321_1017.py | myog-io/WebDjangular | 73d3c40aa449eec5acc59d4493ee94059bddabbd | [
"MIT"
] | 1 | 2018-09-14T15:17:19.000Z | 2018-09-14T15:17:19.000Z | libs/core/cms/api/migrations/0015_auto_20190321_1017.py | MyOwnGamesLLC/WebDjangular | 73d3c40aa449eec5acc59d4493ee94059bddabbd | [
"MIT"
] | 41 | 2018-12-16T16:58:54.000Z | 2019-02-22T20:08:58.000Z | libs/core/cms/api/migrations/0015_auto_20190321_1017.py | myog-io/WebDjangular | 73d3c40aa449eec5acc59d4493ee94059bddabbd | [
"MIT"
] | 1 | 2019-12-10T09:32:49.000Z | 2019-12-10T09:32:49.000Z | # Generated by Django 2.1.7 on 2019-03-21 13:17
from django.db import migrations, models
| 22.043478 | 74 | 0.571992 | # Generated by Django 2.1.7 on 2019-03-21 13:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0014_auto_20190316_0855'),
]
operations = [
migrations.RemoveField(
model_name='menuitem',
name='alt',
... | 0 | 393 | 23 |
b635f0b214c294a4e5c938f85314753a4f657db5 | 760 | py | Python | astro/units.py | cristobal-sifon/astro | e3ca00bebc5dbdd33e2df8df30191cc54c17f722 | [
"MIT"
] | null | null | null | astro/units.py | cristobal-sifon/astro | e3ca00bebc5dbdd33e2df8df30191cc54c17f722 | [
"MIT"
] | 3 | 2018-01-28T18:27:35.000Z | 2019-10-11T13:29:11.000Z | astro/units.py | cristobal-sifon/astro | e3ca00bebc5dbdd33e2df8df30191cc54c17f722 | [
"MIT"
] | 1 | 2021-12-06T14:29:13.000Z | 2021-12-06T14:29:13.000Z | # -*- coding: utf-8 -*-
"""
Conversion factors and units, in cgs. To convert a given value, in cgs, to the desired units,
divide by that unit.
Example:
The speed of light in km·s⁻¹ would be
c_km = c / km
"""
# length
cm = 1.
m = 1e2
km = 1e5
AU = 1.4959787066e13
ly = 9.460730472e17
pc = 3.0856776e18
kpc = 1e3 * pc... | 16.888889 | 93 | 0.628947 | # -*- coding: utf-8 -*-
"""
Conversion factors and units, in cgs. To convert a given value, in cgs, to the desired units,
divide by that unit.
Example:
The speed of light in km·s⁻¹ would be
c_km = c / km
"""
# length
cm = 1.
m = 1e2
km = 1e5
AU = 1.4959787066e13
ly = 9.460730472e17
pc = 3.0856776e18
kpc = 1e3 * pc... | 0 | 0 | 0 |
7154d3b8131cd6b3d365f8e65bab08b014365ee7 | 645 | py | Python | exp/noisy_hd.py | dataiku-research/paper_ial_2021 | f860b6eb2d8471bc23e44d282e50c4deaf0813d9 | [
"Apache-2.0"
] | 1 | 2021-09-06T11:06:07.000Z | 2021-09-06T11:06:07.000Z | exp/noisy_ld.py | dataiku-research/paper_ial_2021 | f860b6eb2d8471bc23e44d282e50c4deaf0813d9 | [
"Apache-2.0"
] | null | null | null | exp/noisy_ld.py | dataiku-research/paper_ial_2021 | f860b6eb2d8471bc23e44d282e50c4deaf0813d9 | [
"Apache-2.0"
] | null | null | null | import openml
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
| 19.545455 | 85 | 0.631008 | import openml
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
def get_config():
return {
'start_size': 20,
'batches': [10] * 19,
'n_iter': 20,
'stop_... | 355 | 0 | 92 |
bd1439993c7b2de1eaa84498533416500afc6a36 | 3,276 | py | Python | bids/config.py | DimitriPapadopoulos/pybids | 9449fdc319c4bdff4ed9aa1b299964352f394d56 | [
"MIT"
] | 101 | 2018-10-11T07:49:03.000Z | 2022-03-13T10:24:29.000Z | bids/config.py | DimitriPapadopoulos/pybids | 9449fdc319c4bdff4ed9aa1b299964352f394d56 | [
"MIT"
] | 572 | 2018-09-26T20:13:24.000Z | 2022-03-30T00:03:15.000Z | bids/config.py | Remi-Gau/pybids | 0f460a8f31eb2ea829c17c85720a1effcfaaf791 | [
"MIT"
] | 61 | 2018-09-26T21:12:13.000Z | 2022-02-15T00:51:45.000Z | ''' Utilities for manipulating package-level settings. '''
import json
from pathlib import Path
import os
from io import open
import warnings
from .utils import listify
__all__ = ['set_option', 'set_options', 'get_option']
_config_name = 'pybids_config.json'
conf_path = str(Path(__file__).absolute().parent.joinpat... | 28.99115 | 89 | 0.637363 | ''' Utilities for manipulating package-level settings. '''
import json
from pathlib import Path
import os
from io import open
import warnings
from .utils import listify
__all__ = ['set_option', 'set_options', 'get_option']
_config_name = 'pybids_config.json'
conf_path = str(Path(__file__).absolute().parent.joinpat... | 0 | 0 | 0 |
82b4c9eb61538b0dde49e019fd485fb5be6c2b4a | 221 | py | Python | broca/tokenize/keyword/__init__.py | ftzeng/broca | 7236dcf54edc0a4a54a55eb93be30800910667e7 | [
"MIT"
] | 50 | 2015-07-25T01:15:50.000Z | 2015-11-29T11:19:25.000Z | broca/tokenize/keyword/__init__.py | publicscience/broca | 7236dcf54edc0a4a54a55eb93be30800910667e7 | [
"MIT"
] | 2 | 2016-06-22T16:34:45.000Z | 2017-03-20T16:29:56.000Z | broca/tokenize/keyword/__init__.py | publicscience/broca | 7236dcf54edc0a4a54a55eb93be30800910667e7 | [
"MIT"
] | 7 | 2016-01-22T13:33:27.000Z | 2021-05-21T07:58:35.000Z | """
Keyword extraction methods.
These accept lists of strings as arguments.
"""
from .pos import POSTokenizer
from .rake import RAKETokenizer
from .apriori import AprioriTokenizer
from .overkill import OverkillTokenizer
| 22.1 | 43 | 0.81448 | """
Keyword extraction methods.
These accept lists of strings as arguments.
"""
from .pos import POSTokenizer
from .rake import RAKETokenizer
from .apriori import AprioriTokenizer
from .overkill import OverkillTokenizer
| 0 | 0 | 0 |
6fcdd38766391ed20a91e9da9df553aa6d10c9ce | 16,251 | py | Python | pm4pyws/handlers/xes/xes.py | ehbasouri/pm4py-ws | 9bf5f88848a4aa2873bae86af95d37f64ae1dde1 | [
"Apache-2.0"
] | null | null | null | pm4pyws/handlers/xes/xes.py | ehbasouri/pm4py-ws | 9bf5f88848a4aa2873bae86af95d37f64ae1dde1 | [
"Apache-2.0"
] | null | null | null | pm4pyws/handlers/xes/xes.py | ehbasouri/pm4py-ws | 9bf5f88848a4aa2873bae86af95d37f64ae1dde1 | [
"Apache-2.0"
] | null | null | null | from pm4py.algo.filtering.log.attributes import attributes_filter
from pm4py.algo.filtering.log.end_activities import end_activities_filter
from pm4py.algo.filtering.log.start_activities import start_activities_filter
from pm4py.algo.filtering.log.variants import variants_filter
from pm4py.objects.conversion.log import... | 33.233129 | 116 | 0.6239 | from pm4py.algo.filtering.log.attributes import attributes_filter
from pm4py.algo.filtering.log.end_activities import end_activities_filter
from pm4py.algo.filtering.log.start_activities import start_activities_filter
from pm4py.algo.filtering.log.variants import variants_filter
from pm4py.objects.conversion.log import... | 0 | 15,065 | 23 |
01ec0b3d1d4096d3b37ba06c1d0bd436c4d3b83d | 303 | py | Python | 01_strategy/duck/lib/fly_behaviors.py | denzow/practice-design-pattern | 141d59c51375e36769a73b6ff135a8afae64b664 | [
"MIT"
] | 1 | 2018-08-15T08:07:58.000Z | 2018-08-15T08:07:58.000Z | 01_strategy/duck/lib/fly_behaviors.py | denzow/practice-design-pattern | 141d59c51375e36769a73b6ff135a8afae64b664 | [
"MIT"
] | null | null | null | 01_strategy/duck/lib/fly_behaviors.py | denzow/practice-design-pattern | 141d59c51375e36769a73b6ff135a8afae64b664 | [
"MIT"
] | null | null | null | # coding: utf-8
from abc import ABCMeta, abstractmethod
| 13.173913 | 39 | 0.650165 | # coding: utf-8
from abc import ABCMeta, abstractmethod
class FlyBehavior(metaclass=ABCMeta):
@abstractmethod
def fly(self):
pass
class FlyWithWings(FlyBehavior):
def fly(self):
print('ばっさばっさ')
class FlyNoWay(FlyBehavior):
def fly(self):
print('飛べない豚')
| 61 | 81 | 123 |
2b51b3261d36e5e14448058fed17cc77ecbb1371 | 1,384 | py | Python | emailcrawler/spiders/emailspider.py | seth2000/scrapyExample | 8eb47195d0d4dd4a174d10b358c2bd7f1fa67496 | [
"MIT"
] | null | null | null | emailcrawler/spiders/emailspider.py | seth2000/scrapyExample | 8eb47195d0d4dd4a174d10b358c2bd7f1fa67496 | [
"MIT"
] | null | null | null | emailcrawler/spiders/emailspider.py | seth2000/scrapyExample | 8eb47195d0d4dd4a174d10b358c2bd7f1fa67496 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
| 33.756098 | 75 | 0.632948 | # -*- coding: utf-8 -*-
import re
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
class EmailspiderSpider(scrapy.Spider):
name = 'emailspider'
allowed_domains = ['']
start_urls = ['https://www.asx.com.au/contact/#/']
def start_reques... | 950 | 260 | 23 |
e6cd6c80307fa4e80b5fc81d74610ff4a1853c06 | 7,324 | py | Python | wildfireassessment/test.py | aalten77/wildfireassessment | 0d4f1639b443350b50068e154e845f1abafcb49f | [
"MIT"
] | null | null | null | wildfireassessment/test.py | aalten77/wildfireassessment | 0d4f1639b443350b50068e154e845f1abafcb49f | [
"MIT"
] | null | null | null | wildfireassessment/test.py | aalten77/wildfireassessment | 0d4f1639b443350b50068e154e845f1abafcb49f | [
"MIT"
] | null | null | null | from wildfireassessment.ops import * #my package
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from skimage import morphology
from skimage.transform import resize
import pandas as pd
import geopandas as gpd
import pickle
from sklearn.impute import SimpleImputer
from sklearn.ensemble import... | 39.165775 | 155 | 0.63722 | from wildfireassessment.ops import * #my package
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from skimage import morphology
from skimage.transform import resize
import pandas as pd
import geopandas as gpd
import pickle
from sklearn.impute import SimpleImputer
from sklearn.ensemble import... | 1,224 | 0 | 23 |
ca77a34e6b30cd8393feee1458421f616d04bc53 | 186 | py | Python | PyAirwave/__init__.py | zhuyuehui1993/PyAirwave | 690a290a3e6ef8126c1a16d6d5ac37907cdc3072 | [
"MIT"
] | 1 | 2021-11-08T02:26:17.000Z | 2021-11-08T02:26:17.000Z | PyAirwave/__init__.py | zhuyuehui1993/PyAirwave | 690a290a3e6ef8126c1a16d6d5ac37907cdc3072 | [
"MIT"
] | null | null | null | PyAirwave/__init__.py | zhuyuehui1993/PyAirwave | 690a290a3e6ef8126c1a16d6d5ac37907cdc3072 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# !/usr/bin/env python3
"""
@author: zhuyuehui
@contact: zhuyuehui02@meituan.com
@time: 2021/11/6 12:57 下午
"""
name = "PyAirwave"
from .PyAirwave import AirWave
| 16.909091 | 33 | 0.672043 | # -*- coding: utf-8 -*-
# !/usr/bin/env python3
"""
@author: zhuyuehui
@contact: zhuyuehui02@meituan.com
@time: 2021/11/6 12:57 下午
"""
name = "PyAirwave"
from .PyAirwave import AirWave
| 0 | 0 | 0 |
f3cb6bd49a8549eee2ca13a7669b29bcdaf92856 | 590 | py | Python | setup.py | nichdu/Adafruit_Python_CharLCD | 82f08d5f8d991666070e622e42816f5bf70c1965 | [
"MIT"
] | 2 | 2015-12-14T03:17:03.000Z | 2018-03-24T23:17:24.000Z | setup.py | nichdu/Adafruit_Python_CharLCD | 82f08d5f8d991666070e622e42816f5bf70c1965 | [
"MIT"
] | 1 | 2017-10-13T00:25:50.000Z | 2017-11-10T01:53:14.000Z | setup.py | nichdu/Adafruit_Python_CharLCD | 82f08d5f8d991666070e622e42816f5bf70c1965 | [
"MIT"
] | 1 | 2022-03-28T08:28:04.000Z | 2022-03-28T08:28:04.000Z | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name = 'Adafruit_CharLCD',
version = '1.0.0',
author = 'Tony DiCola',
author_email = 'tdicola@adafruit.com',
description = 'Library to drive character LCD display and plate.',
license = 'M... | 39.333333 | 114 | 0.705085 | from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(name = 'Adafruit_CharLCD',
version = '1.0.0',
author = 'Tony DiCola',
author_email = 'tdicola@adafruit.com',
description = 'Library to drive character LCD display and plate.',
license = 'M... | 0 | 0 | 0 |
1e1f613430421f25217068f4b3fd9a6953bcc0d5 | 1,177 | py | Python | projects/keypad/keypad-12.py | romilly/explorer-hat-examples | e92157d647c3ba4bc719e9255e52279e7eaa9d74 | [
"MIT"
] | 3 | 2020-09-02T14:17:13.000Z | 2022-03-18T04:18:53.000Z | projects/keypad/keypad-12.py | romilly/explorer-hat-examples | e92157d647c3ba4bc719e9255e52279e7eaa9d74 | [
"MIT"
] | null | null | null | projects/keypad/keypad-12.py | romilly/explorer-hat-examples | e92157d647c3ba4bc719e9255e52279e7eaa9d74 | [
"MIT"
] | null | null | null | import explorerhat as eh
from time import sleep
CHAR_TABLE = [['1','2','3'],['4','5','6'],['7','8','9'],['*','0','#']]
while True:
ch = decode_key(key_pressed(), CHAR_TABLE)
print('%s pressed' % ch)
wait_for_release()
sleep(0.1)
| 21.4 | 70 | 0.542906 | import explorerhat as eh
from time import sleep
CHAR_TABLE = [['1','2','3'],['4','5','6'],['7','8','9'],['*','0','#']]
def prepare_column(column):
for each_col in range(3):
if each_col == column:
eh.output[each_col].off() # so it's at 5v
else:
eh.output[each_col].on() # s... | 785 | 0 | 138 |
df07f31c61d1cff722dac100df336a6fb4a46aea | 479 | py | Python | data/convertCSV2JSONreizigerskilometers.py | LinseyUvA/Programmeerproject | aee51d2a77559fd5f7754fc9aad020f9949b1a68 | [
"Apache-2.0"
] | null | null | null | data/convertCSV2JSONreizigerskilometers.py | LinseyUvA/Programmeerproject | aee51d2a77559fd5f7754fc9aad020f9949b1a68 | [
"Apache-2.0"
] | null | null | null | data/convertCSV2JSONreizigerskilometers.py | LinseyUvA/Programmeerproject | aee51d2a77559fd5f7754fc9aad020f9949b1a68 | [
"Apache-2.0"
] | null | null | null | # Name: Linsey Schaap
# Student number: 11036109
"""
This script convert a csv file into a JSON format.
"""
import csv
import json
csvbestand = open("reizigerskilometers.csv", "r")
jsonbestand = open("reizigerskilometers.json", "w")
namen = ("Vervoerswijze", "Periode", "Provincie", "Afstand")
bestand = csv.DictRead... | 22.809524 | 60 | 0.699374 | # Name: Linsey Schaap
# Student number: 11036109
"""
This script convert a csv file into a JSON format.
"""
import csv
import json
csvbestand = open("reizigerskilometers.csv", "r")
jsonbestand = open("reizigerskilometers.json", "w")
namen = ("Vervoerswijze", "Periode", "Provincie", "Afstand")
bestand = csv.DictRead... | 0 | 0 | 0 |
22f6324caacb20f0fb373f5a7cde45e49be2eba4 | 88 | py | Python | src/tests/__init__.py | Arseny-Tokmancev/channels-watchbot | 102edc07c9d8c306f47b6a5b8318fa0ba56534f0 | [
"MIT"
] | 1 | 2020-11-10T22:50:14.000Z | 2020-11-10T22:50:14.000Z | src/tests/__init__.py | Arseny-Tokmancev/channels-watchbot | 102edc07c9d8c306f47b6a5b8318fa0ba56534f0 | [
"MIT"
] | null | null | null | src/tests/__init__.py | Arseny-Tokmancev/channels-watchbot | 102edc07c9d8c306f47b6a5b8318fa0ba56534f0 | [
"MIT"
] | 1 | 2022-01-31T19:23:03.000Z | 2022-01-31T19:23:03.000Z | from . import data, update_handlers | 17.6 | 35 | 0.681818 | from . import data, update_handlers
def run():
data.run()
update_handlers.run() | 30 | 0 | 23 |
1a829d5a0111c4cb59be4b92c77947f0fff833c0 | 892 | py | Python | tests/support/test_variant.py | Jacobs4/pyatv | 52956adf3b79198be52cc03649f3ddeee19f9e6c | [
"MIT"
] | 532 | 2017-02-01T19:23:28.000Z | 2022-03-29T09:57:39.000Z | tests/support/test_variant.py | Jacobs4/pyatv | 52956adf3b79198be52cc03649f3ddeee19f9e6c | [
"MIT"
] | 1,639 | 2017-02-01T19:22:04.000Z | 2022-03-31T17:26:40.000Z | tests/support/test_variant.py | bdraco/pyatv | 9541d21e6101c60866d832626be97bf962774cd5 | [
"MIT"
] | 102 | 2017-02-02T01:42:13.000Z | 2022-02-26T08:49:34.000Z | """Unit tests for pyatv.protocols.mrp.variant."""
import pytest
from pyatv.support.variant import read_variant, write_variant
| 24.777778 | 61 | 0.700673 | """Unit tests for pyatv.protocols.mrp.variant."""
import pytest
from pyatv.support.variant import read_variant, write_variant
def test_read_single_byte():
assert read_variant(b"\x00")[0] == 0x00
assert read_variant(b"\x35")[0] == 0x35
def test_read_multiple_bytes():
assert read_variant(b"\xb5\x44")[0] ... | 621 | 0 | 138 |
63aad93e1350667c6ea3104ec3e6a0686257c3aa | 11,263 | py | Python | pet_mk_viii/pet_potentiometer_node.py | Pet-Series/Pet-Mk-VII | 4f14d8af46d6a3f4d9838028a6ac0d3c37695ab2 | [
"MIT"
] | null | null | null | pet_mk_viii/pet_potentiometer_node.py | Pet-Series/Pet-Mk-VII | 4f14d8af46d6a3f4d9838028a6ac0d3c37695ab2 | [
"MIT"
] | 1 | 2022-03-30T20:40:19.000Z | 2022-03-30T20:40:19.000Z | pet_mk_viii/pet_potentiometer_node.py | Pet-Series/Pet-Mk-VIII | 4f14d8af46d6a3f4d9838028a6ac0d3c37695ab2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3'
# coding = utf-8
########################################################################################
##
## Maintainer: stefan.kull@gmail.com
## Inspired by: https://github.com/somervda/ourbotmanager_ros.git
##
## Input: Analog potentiometer 1 + 2 + 3 (+4 )
## Output: micro-ROS node (ROS2) ... | 46.159836 | 206 | 0.648584 | #!/usr/bin/env python3'
# coding = utf-8
########################################################################################
##
## Maintainer: stefan.kull@gmail.com
## Inspired by: https://github.com/somervda/ourbotmanager_ros.git
##
## Input: Analog potentiometer 1 + 2 + 3 (+4 )
## Output: micro-ROS node (ROS2) ... | 8,909 | 0 | 99 |
e294e0268e0b169ee1d20bb1135f8707589d4ce5 | 171 | py | Python | examples/timed_set/config.py | fredstro/mrq | eec5dfb425c765afa1ab5b41ca1e6f76869a6726 | [
"MIT"
] | 745 | 2015-01-02T06:54:37.000Z | 2022-03-27T13:23:33.000Z | examples/timed_set/config.py | fredstro/mrq | eec5dfb425c765afa1ab5b41ca1e6f76869a6726 | [
"MIT"
] | 175 | 2015-01-01T20:46:08.000Z | 2022-01-24T09:40:55.000Z | examples/timed_set/config.py | fredstro/mrq | eec5dfb425c765afa1ab5b41ca1e6f76869a6726 | [
"MIT"
] | 143 | 2015-01-06T06:55:26.000Z | 2021-09-13T19:47:12.000Z | RAW_QUEUES = {
"example_timed_set": {
"job_factory": lambda rawparam: {
"path": "example.Print",
"params": {
"test": rawparam
}
}
}
} | 17.1 | 37 | 0.502924 | RAW_QUEUES = {
"example_timed_set": {
"job_factory": lambda rawparam: {
"path": "example.Print",
"params": {
"test": rawparam
}
}
}
} | 0 | 0 | 0 |
32b8c3e29d61e4ef123b1d590e376a697da3489d | 24,380 | py | Python | dmriprep/data.py | akeshavan/dmriprep | c2829fff51e499ea68e5416f336a0bc53bae10e0 | [
"BSD-3-Clause"
] | null | null | null | dmriprep/data.py | akeshavan/dmriprep | c2829fff51e499ea68e5416f336a0bc53bae10e0 | [
"BSD-3-Clause"
] | 1 | 2018-12-07T13:45:33.000Z | 2018-12-07T13:45:33.000Z | dmriprep/data.py | akeshavan/dmriprep | c2829fff51e499ea68e5416f336a0bc53bae10e0 | [
"BSD-3-Clause"
] | null | null | null | """
Functions to download example data from public repositories.
"""
from .base import InputFiles, InputFilesWithSession
import os
import os.path as op
from pathlib import Path
def get_s3_register(subject_id, site, raw_keys, deriv_keys):
"""Get the S3 keys for a single subject's input files
Parameters
... | 34.241573 | 118 | 0.555701 | """
Functions to download example data from public repositories.
"""
from .base import InputFiles, InputFilesWithSession
import os
import os.path as op
from pathlib import Path
def get_dataset(output_dir, source='HBN'):
if source in ['HBN']:
get_hbn_data(output_dir)
else:
raise ValueError('In... | 2,587 | 0 | 179 |
e033f9fd73d722ddff5f01e01c531a7ab26d7f5f | 483 | py | Python | ec2_lambda/lambda_function.py | thiagop-o/python-automacao_lambda_aws | d5db1f37b898a422a500dff392e0da0bbeef1fc6 | [
"MIT"
] | null | null | null | ec2_lambda/lambda_function.py | thiagop-o/python-automacao_lambda_aws | d5db1f37b898a422a500dff392e0da0bbeef1fc6 | [
"MIT"
] | null | null | null | ec2_lambda/lambda_function.py | thiagop-o/python-automacao_lambda_aws | d5db1f37b898a422a500dff392e0da0bbeef1fc6 | [
"MIT"
] | null | null | null | import os
import boto3
AMI = os.environ['AMI']
INSTANCE_TYPE = os.environ['INSTANCE_TYPE']
KEY_NAME = os.environ['KEY_NAME']
SUBNET_ID = os.environ['SUBNET_ID']
ec2 = boto3.resource('ec2')
| 21 | 51 | 0.652174 | import os
import boto3
AMI = os.environ['AMI']
INSTANCE_TYPE = os.environ['INSTANCE_TYPE']
KEY_NAME = os.environ['KEY_NAME']
SUBNET_ID = os.environ['SUBNET_ID']
ec2 = boto3.resource('ec2')
def lambda_handler(event, context):
instance = ec2.create_instances(
ImageId=AMI,
InstanceType=INSTANC... | 269 | 0 | 23 |
d5a445a9060d6cd20ce9d7173af9483d4cbd7c1e | 8,837 | py | Python | tests/unit_tests/logic/camera/test_cameraAscom.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 16 | 2020-01-11T22:32:26.000Z | 2022-03-31T15:18:14.000Z | tests/unit_tests/logic/camera/test_cameraAscom.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 196 | 2020-01-16T13:56:01.000Z | 2022-03-29T02:06:51.000Z | tests/unit_tests/logic/camera/test_cameraAscom.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 6 | 2019-12-01T19:39:33.000Z | 2021-05-27T13:14:20.000Z | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | 27.024465 | 115 | 0.602806 | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | 7,118 | 0 | 551 |
c9fdf87a145b69062ebfc4b957e7c6b7fad9824a | 475 | py | Python | renderers/linkRenderer.py | bgporter/wastebook | 79885a8d503452e1fbeb8ff445cedd2daafff2a0 | [
"MIT"
] | null | null | null | renderers/linkRenderer.py | bgporter/wastebook | 79885a8d503452e1fbeb8ff445cedd2daafff2a0 | [
"MIT"
] | null | null | null | renderers/linkRenderer.py | bgporter/wastebook | 79885a8d503452e1fbeb8ff445cedd2daafff2a0 | [
"MIT"
] | null | null | null |
import re
import renderer
LINK_PATTERN = re.compile(r'(^|\s)(http(?:s)?://[^ \<]+\w)')
class LinkRenderer(renderer.RenderBase):
'''
Converts standalone http or https links in text into the Markdown
equivalent, so
lorem ipsum http://www.example.com, etc
becomes
lorem ipsum [h... | 17.592593 | 71 | 0.612632 |
import re
import renderer
LINK_PATTERN = re.compile(r'(^|\s)(http(?:s)?://[^ \<]+\w)')
class LinkRenderer(renderer.RenderBase):
'''
Converts standalone http or https links in text into the Markdown
equivalent, so
lorem ipsum http://www.example.com, etc
becomes
lorem ipsum [h... | 69 | 0 | 26 |
19a1c00cdc6dcf513c84d6a0bc85980dea271cba | 4,913 | py | Python | py/feasability.py | andrewmkeller/niDelayGraph | 41aa0a9e17b6e3c59ef9e7103f8333047e7745e0 | [
"MIT"
] | null | null | null | py/feasability.py | andrewmkeller/niDelayGraph | 41aa0a9e17b6e3c59ef9e7103f8333047e7745e0 | [
"MIT"
] | null | null | null | py/feasability.py | andrewmkeller/niDelayGraph | 41aa0a9e17b6e3c59ef9e7103f8333047e7745e0 | [
"MIT"
] | null | null | null | import niGraphParser
import niGraph
import sys
import glob
import os
import random
import time
import re
from matplotlib import pyplot
import networkx as nx
import networkx.algorithms.shortest_paths.dense as dense
import xml.etree.ElementTree as ET
import networkx.algorithms.simple_paths as nxPaths
graphsDir = "..\Da... | 28.398844 | 94 | 0.607572 | import niGraphParser
import niGraph
import sys
import glob
import os
import random
import time
import re
from matplotlib import pyplot
import networkx as nx
import networkx.algorithms.shortest_paths.dense as dense
import xml.etree.ElementTree as ET
import networkx.algorithms.simple_paths as nxPaths
graphsDir = "..\Da... | 4,216 | 0 | 138 |
e6b2b01c8bd75ea94536fbb79633083633929b0b | 1,452 | py | Python | utils/draw_utils.py | takurooo/Python-YOLOv3_in_OpneCV | 8f722cdd86e360d557a539431c84636d369549f5 | [
"MIT"
] | null | null | null | utils/draw_utils.py | takurooo/Python-YOLOv3_in_OpneCV | 8f722cdd86e360d557a539431c84636d369549f5 | [
"MIT"
] | 1 | 2018-09-16T05:54:13.000Z | 2018-09-16T05:54:13.000Z | utils/draw_utils.py | takurooo/Python-YOLOv3_in_OpneCV | 8f722cdd86e360d557a539431c84636d369549f5 | [
"MIT"
] | null | null | null | #------------------------------------------------------
# import
#------------------------------------------------------
import os
import cv2
#------------------------------------------------------
# global
#------------------------------------------------------
LINE_COLOR = (0, 0, 255)
LINE_THICKNESS = 10
FONT_STYLE... | 32.266667 | 74 | 0.495868 | #------------------------------------------------------
# import
#------------------------------------------------------
import os
import cv2
#------------------------------------------------------
# global
#------------------------------------------------------
LINE_COLOR = (0, 0, 255)
LINE_THICKNESS = 10
FONT_STYLE... | 834 | 0 | 45 |
78f957f8fa50603fc1de5fed7674136da6e5f033 | 1,131 | py | Python | my_classes/Context.py | steven-phun/Tutoring-App | df0774f18ede09d4476ea63b9f95f7f1b0763f84 | [
"MIT"
] | null | null | null | my_classes/Context.py | steven-phun/Tutoring-App | df0774f18ede09d4476ea63b9f95f7f1b0763f84 | [
"MIT"
] | null | null | null | my_classes/Context.py | steven-phun/Tutoring-App | df0774f18ede09d4476ea63b9f95f7f1b0763f84 | [
"MIT"
] | 1 | 2021-04-20T02:38:54.000Z | 2021-04-20T02:38:54.000Z | import os
| 29 | 102 | 0.525199 | import os
class Context:
def __init__(self, ctx):
self.ctx = ctx
def discord_id(self):
""":return: an int that represents the member's discord id"""
return self.ctx.author.id
def member(self):
""":return: a class of discord.member.Member"""
return self.ctx.bot.get... | 26 | 1,071 | 23 |
2c75071e74d6ac4f4af2e29dd45f88f7b19f3318 | 2,194 | py | Python | cleaner.py | Riviere123/csv_cleaner | 944ec7337232fcc246c276cad7588fda824306d3 | [
"MIT"
] | null | null | null | cleaner.py | Riviere123/csv_cleaner | 944ec7337232fcc246c276cad7588fda824306d3 | [
"MIT"
] | null | null | null | cleaner.py | Riviere123/csv_cleaner | 944ec7337232fcc246c276cad7588fda824306d3 | [
"MIT"
] | null | null | null | import csv
import argparse
parser = argparse.ArgumentParser(description='parameters for cleaning a csv file')
parser.add_argument(
'--columns',
type=int,
nargs="+",
default=[],
help="The columns to remove. Usage: --rows 0 1 10 25",
)
parser.add_argument(
'--file',
type=str,
default=... | 25.511628 | 82 | 0.573838 | import csv
import argparse
class Cleaner:
def __init__(self, file, columns, rows, strip) -> None:
self.file = open(f"{file}")
self.columns = columns
self.rows = rows
self.data = csv.reader(self.file)
self.strip = strip
self.cleaned_data = self.data
self.clean... | 1,318 | -7 | 165 |
b6f38ce362b5ee22034139f490ad8c25fc8886c6 | 3,370 | py | Python | Scripts/Face2.py | LiuSeeker/Robotica-projeto-1 | 425795d51232470ac840faf9dc7d97863d801554 | [
"CECILL-B"
] | null | null | null | Scripts/Face2.py | LiuSeeker/Robotica-projeto-1 | 425795d51232470ac840faf9dc7d97863d801554 | [
"CECILL-B"
] | null | null | null | Scripts/Face2.py | LiuSeeker/Robotica-projeto-1 | 425795d51232470ac840faf9dc7d97863d801554 | [
"CECILL-B"
] | null | null | null | #! /usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = ["Rachel P. B. Moraes", "Igor Montagner", "Fabio Miranda"]
import rospy
import numpy as np
import tf
import math
import cv2
import time
from geometry_msgs.msg import Twist, Vector3, Pose
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Image, Co... | 21.883117 | 132 | 0.692285 | #! /usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = ["Rachel P. B. Moraes", "Igor Montagner", "Fabio Miranda"]
import rospy
import numpy as np
import tf
import math
import cv2
import time
from geometry_msgs.msg import Twist, Vector3, Pose
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Image, Co... | 2,379 | 4 | 121 |
c6a49fd8eae1a073336f9014b2bd4874e8b1295d | 1,277 | py | Python | PyCode/Modules/ServoModule.py | busing/RaspberryPi_SmartCarV1 | 1d7761c7f1e6bc385392c6178d9ba1266c28dc2a | [
"Apache-2.0"
] | 49 | 2018-05-20T11:43:42.000Z | 2022-02-22T01:15:01.000Z | PyCode/Modules/ServoModule.py | qq38061481/RaspberryPi_SmartCarV1 | 1d7761c7f1e6bc385392c6178d9ba1266c28dc2a | [
"Apache-2.0"
] | 1 | 2018-05-16T09:38:28.000Z | 2018-05-16T09:38:47.000Z | PyCode/Modules/ServoModule.py | qq38061481/RaspberryPi_SmartCarV1 | 1d7761c7f1e6bc385392c6178d9ba1266c28dc2a | [
"Apache-2.0"
] | 22 | 2018-05-16T09:33:04.000Z | 2021-07-05T07:02:43.000Z | ###################################################
# 智能小车1.0 -- 舵机模块
#
# @author chenph
# @date 2018/5/15
###################################################
import RPi.GPIO as GPIO
import time
# 初始模块
# 舵机左转
# 舵机右转
if __name__ == "__main__":
try:
... | 23.218182 | 56 | 0.497259 | ###################################################
# 智能小车1.0 -- 舵机模块
#
# @author chenph
# @date 2018/5/15
###################################################
import RPi.GPIO as GPIO
import time
class ServoModule:
# 初始模块
def __init__(self, PIN):
print('Servo... | 693 | -3 | 101 |
e8d8d764446c6ce93834ee77f987452347e579e1 | 810 | py | Python | tests/test_coverage.py | UC-Mind-Lab/Darjeeling | 61dc4fd3c62f43bb7fcfafce6f964f82144e293e | [
"Apache-2.0"
] | null | null | null | tests/test_coverage.py | UC-Mind-Lab/Darjeeling | 61dc4fd3c62f43bb7fcfafce6f964f82144e293e | [
"Apache-2.0"
] | 1 | 2021-04-16T16:53:05.000Z | 2021-07-23T15:21:52.000Z | tests/test_coverage.py | UC-Mind-Lab/Darjeeling | 61dc4fd3c62f43bb7fcfafce6f964f82144e293e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from darjeeling.core import (TestOutcome,
TestCoverage,
FileLine,
FileLineSet)
@pytest.fixture
| 24.545455 | 56 | 0.512346 | # -*- coding: utf-8 -*-
import pytest
from darjeeling.core import (TestOutcome,
TestCoverage,
FileLine,
FileLineSet)
def ln(num: int) -> FileLine:
return FileLine('file.c', num)
@pytest.fixture
def coverage() -> TestCoverage... | 493 | 0 | 91 |
5d973a361af88b11163f87ccf03a9de8c21ac4fc | 20,012 | py | Python | pretrain_bert.py | initc/gpt-lm | 941f2816d7a749ea3a3e0c574b35fc3fc67e94e3 | [
"Apache-2.0"
] | 2 | 2019-10-17T04:03:06.000Z | 2020-05-22T13:27:50.000Z | pretrain_bert.py | initc/gpt-lm | 941f2816d7a749ea3a3e0c574b35fc3fc67e94e3 | [
"Apache-2.0"
] | 1 | 2020-05-22T13:36:27.000Z | 2020-05-22T13:36:27.000Z | pretrain_bert.py | initc/gpt-lm | 941f2816d7a749ea3a3e0c574b35fc3fc67e94e3 | [
"Apache-2.0"
] | 1 | 2019-10-17T04:03:08.000Z | 2019-10-17T04:03:08.000Z | # coding=utf-8
# Copyright (c) 2019, 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 re... | 38.70793 | 158 | 0.613382 | # coding=utf-8
# Copyright (c) 2019, 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 re... | 189 | 0 | 54 |
3ed529d99d20a681fda72fb1b468f10bdf3deffc | 1,907 | py | Python | molsys/fileIO/freq.py | MOFplus/molsys_rel | ff8b181fefc0ba03c5dd14fe2dde613298155203 | [
"MIT"
] | null | null | null | molsys/fileIO/freq.py | MOFplus/molsys_rel | ff8b181fefc0ba03c5dd14fe2dde613298155203 | [
"MIT"
] | null | null | null | molsys/fileIO/freq.py | MOFplus/molsys_rel | ff8b181fefc0ba03c5dd14fe2dde613298155203 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: julian
Read (and write?) molden .freq files
"""
import numpy
import string
from molsys.util.constants import angstrom, kcalmol
| 30.269841 | 92 | 0.521762 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: julian
Read (and write?) molden .freq files
"""
import numpy
import string
from molsys.util.constants import angstrom, kcalmol
def read(mol, f):
# missing docstring!
try:
f.readline ### do nothing
except AttributeError:
raise IO... | 1,694 | 0 | 23 |
7b9ece5aa05ac3e689b66154aa1aba97c512c468 | 1,049 | py | Python | week9-10/week10/hw41/gas_prices.py | fac33/py_intro_exercise | e2c3f3044537b5cc8980bf7aa7651fd16c5fd34b | [
"MIT"
] | null | null | null | week9-10/week10/hw41/gas_prices.py | fac33/py_intro_exercise | e2c3f3044537b5cc8980bf7aa7651fd16c5fd34b | [
"MIT"
] | null | null | null | week9-10/week10/hw41/gas_prices.py | fac33/py_intro_exercise | e2c3f3044537b5cc8980bf7aa7651fd16c5fd34b | [
"MIT"
] | null | null | null | ################################################################################
# Author: Fanyang Cheng
# Date: 04/07/2021
# Description: This program read the weekly gas average price txt file as input
# and draw a graph for to show the data.
###########################################################################... | 34.966667 | 88 | 0.550048 | ################################################################################
# Author: Fanyang Cheng
# Date: 04/07/2021
# Description: This program read the weekly gas average price txt file as input
# and draw a graph for to show the data.
###########################################################################... | 582 | 0 | 44 |
941c88f15910a8e3d82889e5756ebb4771e44f69 | 18,566 | py | Python | brainspell/json_api.py | akeshavan/brainspell-neo | 05259770a9928d01adaaa028e9d2115750c4fe03 | [
"MIT"
] | null | null | null | brainspell/json_api.py | akeshavan/brainspell-neo | 05259770a9928d01adaaa028e9d2115750c4fe03 | [
"MIT"
] | null | null | null | brainspell/json_api.py | akeshavan/brainspell-neo | 05259770a9928d01adaaa028e9d2115750c4fe03 | [
"MIT"
] | null | null | null | # JSON API classes
import brainspell
from article_helpers import *
from base_handler import *
from search_helpers import *
from user_account_helpers import *
# For GitHub OAuth
import requests
import urllib.parse
import os
import hashlib
REQ_DESC = "The fields to search through. 'x' is experiments, 'p' is PMID, 'r' ... | 28.345038 | 176 | 0.556932 | # JSON API classes
import brainspell
from article_helpers import *
from base_handler import *
from search_helpers import *
from user_account_helpers import *
# For GitHub OAuth
import requests
import urllib.parse
import os
import hashlib
REQ_DESC = "The fields to search through. 'x' is experiments, 'p' is PMID, 'r' ... | 8,076 | 0 | 567 |
75a1b42150f0c5930166b72169d17038f84dd12f | 8,419 | py | Python | train/tasks/semantic/modules/user.py | Crowbar97/SalsaNext | 789968bf702367b7f004ccc058d3cdce53ee385c | [
"MIT"
] | null | null | null | train/tasks/semantic/modules/user.py | Crowbar97/SalsaNext | 789968bf702367b7f004ccc058d3cdce53ee385c | [
"MIT"
] | null | null | null | train/tasks/semantic/modules/user.py | Crowbar97/SalsaNext | 789968bf702367b7f004ccc058d3cdce53ee385c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import imp
import os
import time
import numpy as np
from matplotlib import pyplot as plt
import torch
import torch.backends.cudnn as cudnn
from torch import nn
import __init__ as booger
from tasks.semantic.modules.segment... | 39.712264 | 156 | 0.503742 | #!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import imp
import os
import time
import numpy as np
from matplotlib import pyplot as plt
import torch
import torch.backends.cudnn as cudnn
from torch import nn
import __init__ as booger
from tasks.semantic.modules.segment... | 7,887 | -8 | 153 |
b28113f9144fb0be437e13f608eef1bfa90e636b | 6,220 | py | Python | main.py | farhannysf/vitruvina | f4d9512c80c928001543a0852332a512ab602591 | [
"MIT"
] | 5 | 2018-11-04T08:46:38.000Z | 2021-03-09T21:50:54.000Z | main.py | farhannysf/vitruvina | f4d9512c80c928001543a0852332a512ab602591 | [
"MIT"
] | null | null | null | main.py | farhannysf/vitruvina | f4d9512c80c928001543a0852332a512ab602591 | [
"MIT"
] | null | null | null | import random
import settings
import finance_utils
import asyncio
import aiohttp
from time import strftime
from datetime import date
from sanic import Sanic, response
from sanic.response import json
app = Sanic()
@app.route('/vitruvina', methods=['POST'])
if __name__ == '__main__':
app.run(host='0.0.0.0... | 46.41791 | 281 | 0.671704 | import random
import settings
import finance_utils
import asyncio
import aiohttp
from time import strftime
from datetime import date
from sanic import Sanic, response
from sanic.response import json
app = Sanic()
async def aioGet(*args, **kwargs):
async with aiohttp.ClientSession() as client:
async w... | 5,706 | 0 | 183 |
94eced0ae6d8038942ea21908a77c26af1240b78 | 1,769 | py | Python | okta/models/application_accessibility.py | corylevine/okta-sdk-python | c86b8fdc4525e84199143c27213c0aebc6b2af8f | [
"Apache-2.0"
] | 145 | 2017-06-13T21:54:04.000Z | 2022-02-25T05:44:34.000Z | okta/models/application_accessibility.py | corylevine/okta-sdk-python | c86b8fdc4525e84199143c27213c0aebc6b2af8f | [
"Apache-2.0"
] | 146 | 2017-06-02T17:46:12.000Z | 2022-03-29T15:52:15.000Z | okta/models/application_accessibility.py | corylevine/okta-sdk-python | c86b8fdc4525e84199143c27213c0aebc6b2af8f | [
"Apache-2.0"
] | 98 | 2017-06-27T03:44:51.000Z | 2022-03-23T04:58:18.000Z | # flake8: noqa
"""
Copyright 2020 - Present Okta, 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 ... | 32.759259 | 72 | 0.687394 | # flake8: noqa
"""
Copyright 2020 - Present Okta, 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 ... | 899 | 0 | 54 |
495e8adc4d26507ba4b761349caac57cd7210956 | 1,391 | py | Python | joels_scripts/constants.py | DelparteLabs/WCWAVE_ClimateInterp | dce7ddf4f6025ae96b864767c198af78f4ee3c0a | [
"MIT"
] | null | null | null | joels_scripts/constants.py | DelparteLabs/WCWAVE_ClimateInterp | dce7ddf4f6025ae96b864767c198af78f4ee3c0a | [
"MIT"
] | null | null | null | joels_scripts/constants.py | DelparteLabs/WCWAVE_ClimateInterp | dce7ddf4f6025ae96b864767c198af78f4ee3c0a | [
"MIT"
] | null | null | null | #Import necessary modules
import arcpy
from arcpy.sa import *
import numpy
#Check-out necessary extensions
arcpy.CheckOutExtension('Spatial')
#Set input parameters
elevation_raster = arcpy.GetParameterAsText(0)
conRL = arcpy.GetParameter(1)
conRL_ouRaster = arcpy.GetParameterAsText(2)
conH2OSat = arcpy.GetParameter(3... | 33.926829 | 82 | 0.833932 | #Import necessary modules
import arcpy
from arcpy.sa import *
import numpy
#Check-out necessary extensions
arcpy.CheckOutExtension('Spatial')
#Set input parameters
elevation_raster = arcpy.GetParameterAsText(0)
conRL = arcpy.GetParameter(1)
conRL_ouRaster = arcpy.GetParameterAsText(2)
conH2OSat = arcpy.GetParameter(3... | 0 | 0 | 0 |
9a76e6b847a5af542c69c4a2ca4ade2eecfda813 | 2,920 | py | Python | caffe2/python/operator_test/pack_rnn_sequence_op_test.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 206 | 2020-11-28T22:56:38.000Z | 2022-03-27T02:33:04.000Z | caffe2/python/operator_test/pack_rnn_sequence_op_test.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 19 | 2020-12-09T23:13:14.000Z | 2022-01-24T23:24:08.000Z | caffe2/python/operator_test/pack_rnn_sequence_op_test.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 28 | 2020-11-29T15:25:12.000Z | 2022-01-20T02:16:27.000Z |
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
import hypothesis.strategies as st
import numpy as np
if __name__ == "__main__":
import unittest
unittest.main()
| 31.73913 | 75 | 0.560616 |
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
import hypothesis.strategies as st
import numpy as np
class TestPackRNNSequenceOperator(serial.SerializedTestCase):
@serial.given(n=... | 2,270 | 322 | 23 |
7cd8c313e001a8189aed96f414569f874d893c5a | 1,682 | py | Python | lib/spack/spack/cmd/common/__init__.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | lib/spack/spack/cmd/common/__init__.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | lib/spack/spack/cmd/common/__init__.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
import llnl.util.tty.color as color
import spack.paths
def shell_init_instructions(cmd, equ... | 31.148148 | 73 | 0.577289 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
import llnl.util.tty.color as color
import spack.paths
def shell_init_instructions(cmd, equ... | 0 | 0 | 0 |
3d91f9e590b81b179ff1c3782708adf0d1a80c4b | 8,815 | py | Python | src/parse_utils.py | dockimbel/RGB | 3dbb999cecc1fc60cd0f9a064723cc5d967c0688 | [
"MIT"
] | null | null | null | src/parse_utils.py | dockimbel/RGB | 3dbb999cecc1fc60cd0f9a064723cc5d967c0688 | [
"MIT"
] | null | null | null | src/parse_utils.py | dockimbel/RGB | 3dbb999cecc1fc60cd0f9a064723cc5d967c0688 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2018 Samuel Wilder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 26.15727 | 158 | 0.680091 | """
MIT License
Copyright (c) 2018 Samuel Wilder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 0 | 0 | 0 |
6737b1610023ce55da9d1f5659e9fb729bfa0f76 | 2,150 | py | Python | code/plots5_airlines_cereal.py | msinkinson/CommonOwnerReplication | 59a4b275464521623c6bfc22738959c27a534504 | [
"MIT"
] | null | null | null | code/plots5_airlines_cereal.py | msinkinson/CommonOwnerReplication | 59a4b275464521623c6bfc22738959c27a534504 | [
"MIT"
] | null | null | null | code/plots5_airlines_cereal.py | msinkinson/CommonOwnerReplication | 59a4b275464521623c6bfc22738959c27a534504 | [
"MIT"
] | null | null | null | # %%
# %%
import pandas as pd
import numpy as np
import pathlib
import matplotlib
import matplotlib.pyplot as plt
from our_plot_config import derived_dir, fig_dir, raw_dir, setplotstyle
from kappas import do_one_period
setplotstyle()
# %%
# Input files
f_cereal = raw_dir / 'cereal.parquet'
f_airlines = raw_dir / 'a... | 30.28169 | 135 | 0.686047 | # %%
# %%
import pandas as pd
import numpy as np
import pathlib
import matplotlib
import matplotlib.pyplot as plt
from our_plot_config import derived_dir, fig_dir, raw_dir, setplotstyle
from kappas import do_one_period
setplotstyle()
# %%
# Input files
f_cereal = raw_dir / 'cereal.parquet'
f_airlines = raw_dir / 'a... | 273 | 0 | 23 |
fd53c1c1df9cfa4e457e6510b0e6228f6d83ad69 | 722 | py | Python | python/popart.ir/python_files/module.py | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 61 | 2020-07-06T17:11:46.000Z | 2022-03-12T14:42:51.000Z | python/popart.ir/python_files/module.py | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 1 | 2021-02-25T01:30:29.000Z | 2021-11-09T11:13:14.000Z | python/popart.ir/python_files/module.py | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 6 | 2020-07-15T12:33:13.000Z | 2021-11-07T06:55:00.000Z | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
class Module:
"""
Callable class from which user-defined layers can inherit.
The #build method should be overriden and should build the subgraph.
The benefit of inheriting from this class rather than passing a function is
that you can save input ten... | 36.1 | 79 | 0.709141 | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
class Module:
"""
Callable class from which user-defined layers can inherit.
The #build method should be overriden and should build the subgraph.
The benefit of inheriting from this class rather than passing a function is
that you can save input ten... | 171 | 0 | 54 |
d101b444025d87e58fca07c5c91baf0669f48075 | 4,736 | py | Python | benchmarks/oxuva/examples/track.py | willtwr/iSiam-TF | c9c1d0f49cc80f7a5549155fb220b6dce6b6516b | [
"MIT"
] | 2 | 2020-03-28T20:48:34.000Z | 2021-09-22T02:54:12.000Z | benchmarks/oxuva/examples/track.py | willtwr/iSiam-TF | c9c1d0f49cc80f7a5549155fb220b6dce6b6516b | [
"MIT"
] | 1 | 2020-03-28T20:59:30.000Z | 2020-04-03T20:09:53.000Z | benchmarks/oxuva/examples/track.py | willtwr/iSiam-TF | c9c1d0f49cc80f7a5549155fb220b6dce6b6516b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import cv2
import os
import time
import oxuva
from scripts import *
if __name__ == '__main__':
main()
| 34.318841 | 90 | 0.636824 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import cv2
import os
import time
import oxuva
from scripts import *
def main():
parser = argparse.ArgumentParser()
parser.add_argument('data_dir')
parser.add_argument('predictions... | 4,308 | -7 | 195 |
47ab914c592973fc14facd627639938d32460452 | 908 | py | Python | test.py | Gibbsdavidl/naive_tree | 02f69b83b97832a33e5008f85cae50d9286415cc | [
"MIT"
] | null | null | null | test.py | Gibbsdavidl/naive_tree | 02f69b83b97832a33e5008f85cae50d9286415cc | [
"MIT"
] | 1 | 2021-08-10T22:19:22.000Z | 2021-08-10T22:19:22.000Z | test.py | Gibbsdavidl/naive_tree | 02f69b83b97832a33e5008f85cae50d9286415cc | [
"MIT"
] | null | null | null | # Import classes from your brand new package
from naive_tree import GeneTree
from naive_tree import GeneNetwork
# Create an object of Mammals class & call a method of it
myTree = GeneTree()
myTree.build_network()
myTree.print_gene_network_summary()
myTree.gene_network.print_test_edge(4140)
# then get network between ... | 28.375 | 72 | 0.748899 | # Import classes from your brand new package
from naive_tree import GeneTree
from naive_tree import GeneNetwork
# Create an object of Mammals class & call a method of it
myTree = GeneTree()
myTree.build_network()
myTree.print_gene_network_summary()
myTree.gene_network.print_test_edge(4140)
# then get network between ... | 0 | 0 | 0 |
cba575fe3c4d860e5b0b8717de6d7e6e18647762 | 7,080 | py | Python | codes/dgmpm_stability/CFL_comparison_random.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | 1 | 2021-06-18T14:52:03.000Z | 2021-06-18T14:52:03.000Z | codes/dgmpm_stability/CFL_comparison_random.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | 1 | 2019-01-07T13:11:11.000Z | 2019-01-07T13:11:11.000Z | codes/dgmpm_stability/CFL_comparison_random.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy as np
from scipy import optimize
from sympy import *
import matplotlib.pyplot as plt
import pdb
import random
import os
# Symbolic function to evaluate shape functions
shape_functions=lambda x: np.matrix([(1-x)/DX,x/DX])
xn = np.array([0.,1.])
DX = 1.
## required for plotting residu... | 36.307692 | 232 | 0.642655 | #!/usr/bin/python
import numpy as np
from scipy import optimize
from sympy import *
import matplotlib.pyplot as plt
import pdb
import random
import os
def export2DTeXFile(fileName,bins,fields,*kwargs):
TeXFile=open(fileName,"w")
n_fields = np.shape(fields)[0]
n_labels = np.shape(kwargs)[1]
# Defi... | 3,547 | 0 | 115 |
b40a82670ea346149aaf3640009134ba1053fa90 | 37,795 | py | Python | ag/orbit/node/db.py | AlphaGriffin/orbit-node | 6e330a2734a6a5dfbb52d984fe0b2f8dff4755cd | [
"MIT"
] | null | null | null | ag/orbit/node/db.py | AlphaGriffin/orbit-node | 6e330a2734a6a5dfbb52d984fe0b2f8dff4755cd | [
"MIT"
] | null | null | null | ag/orbit/node/db.py | AlphaGriffin/orbit-node | 6e330a2734a6a5dfbb52d984fe0b2f8dff4755cd | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Alpha Griffin
# @%@~LICENSE~@%@
from . import config, TokenError
from bitcash.format import public_key_to_address
from os import path
import sqlite3
from hashlib import sha256
| 41.854928 | 126 | 0.485673 | # Copyright (C) 2018 Alpha Griffin
# @%@~LICENSE~@%@
from . import config, TokenError
from bitcash.format import public_key_to_address
from os import path
import sqlite3
from hashlib import sha256
class TokenDB:
def __init__(self, auto_commit=True):
isolation = 'EXCLUSIVE' if not auto_commit else None... | 36,750 | 820 | 23 |
aa883e3496e21cb0f2daf6fff05903f54faa73b3 | 3,177 | py | Python | create_bags/bag_creator.py | RockefellerArchiveCenter/dart_digitization | f4ee85f3cbcbbe92c9a5b03b76bcdd72233722ec | [
"MIT"
] | null | null | null | create_bags/bag_creator.py | RockefellerArchiveCenter/dart_digitization | f4ee85f3cbcbbe92c9a5b03b76bcdd72233722ec | [
"MIT"
] | 11 | 2021-08-05T19:39:27.000Z | 2021-12-15T14:52:14.000Z | create_bags/bag_creator.py | RockefellerArchiveCenter/dart_digitization | f4ee85f3cbcbbe92c9a5b03b76bcdd72233722ec | [
"MIT"
] | null | null | null | import json
from configparser import ConfigParser
from subprocess import PIPE, Popen
from .archivesspace import ArchivesSpaceClient
from .helpers import create_tag, format_aspace_date, get_closest_dates
| 41.802632 | 79 | 0.564054 | import json
from configparser import ConfigParser
from subprocess import PIPE, Popen
from .archivesspace import ArchivesSpaceClient
from .helpers import create_tag, format_aspace_date, get_closest_dates
class BagCreator:
def __init__(self):
self.config = ConfigParser()
self.config.read("local_se... | 194 | 2,755 | 23 |
81003cc2b9becec46691667317615c5a7f7d2cda | 2,105 | py | Python | test_status_endpoints/test_status_tweet.py | RSMuthu/Twitter_API-Pytest | b272d8ead3d51bbd0d5a4720f67905dccee27d7c | [
"MIT"
] | null | null | null | test_status_endpoints/test_status_tweet.py | RSMuthu/Twitter_API-Pytest | b272d8ead3d51bbd0d5a4720f67905dccee27d7c | [
"MIT"
] | null | null | null | test_status_endpoints/test_status_tweet.py | RSMuthu/Twitter_API-Pytest | b272d8ead3d51bbd0d5a4720f67905dccee27d7c | [
"MIT"
] | null | null | null | import pytest
from conftest import twitter_session, BASE_URL
from utils import get_home_tweets
# status list to tweet
status_list = {"We welcome you to MSD family :)", "Hello World !!"}
@pytest.mark.run(order=1) ## ording test cases -- make tweet first as first test case
@pytest.mark.parametrize("status_text", status... | 46.777778 | 110 | 0.709264 | import pytest
from conftest import twitter_session, BASE_URL
from utils import get_home_tweets
# status list to tweet
status_list = {"We welcome you to MSD family :)", "Hello World !!"}
@pytest.mark.run(order=1) ## ording test cases -- make tweet first as first test case
@pytest.mark.parametrize("status_text", status... | 0 | 0 | 0 |
5d39942b02ac6f8ea852e08d75c444f2f2c627d5 | 1,776 | py | Python | compil_to_csv.py | bliiben/sha256SquaredPrecompilCSV | 752aa981299f1f06abf92ad76228926aa9267934 | [
"MIT"
] | null | null | null | compil_to_csv.py | bliiben/sha256SquaredPrecompilCSV | 752aa981299f1f06abf92ad76228926aa9267934 | [
"MIT"
] | null | null | null | compil_to_csv.py | bliiben/sha256SquaredPrecompilCSV | 752aa981299f1f06abf92ad76228926aa9267934 | [
"MIT"
] | null | null | null | import pickle
import operator
import re
prog = re.compile( r"^([\^\~\&\|])\((\w+),?(\w+)?\)$" )
with open("sha_decoded.pp", "r") as file:
_h, _REFERENCES_, _DEPENDENCY_ ,_INV_DEP_, _COST_ = pickle.load( file )
inv_refs = {v: k for k, v in _REFERENCES_.iteritems()}
#sorted_COST = sorted(_COST_.items(), key=operator.i... | 21.39759 | 72 | 0.552365 | import pickle
import operator
import re
prog = re.compile( r"^([\^\~\&\|])\((\w+),?(\w+)?\)$" )
def getElements( op ):
m= prog.search(op)
ref1 = m.group(2)
ref2 = m.group(3)
return (ref1,ref2)
with open("sha_decoded.pp", "r") as file:
_h, _REFERENCES_, _DEPENDENCY_ ,_INV_DEP_, _COST_ = pickle.load( file )
inv_re... | 218 | 0 | 45 |
1f46c1bbb19eae64d53cea40d5922ff06d116ac8 | 474 | py | Python | notifs/asgi.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | 145 | 2017-06-22T20:37:14.000Z | 2022-02-03T21:18:28.000Z | notifs/asgi.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | 67 | 2017-06-23T06:53:32.000Z | 2021-11-13T04:00:27.000Z | notifs/asgi.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | 24 | 2017-06-22T20:37:17.000Z | 2022-02-17T19:52:35.000Z | import os
from channels.routing import ChannelNameRouter, ProtocolTypeRouter
from django.core.asgi import get_asgi_application
from notifications import consumers
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'notifs.settings')
application = ProtocolTypeRouter(
{
'http': get_asgi_application(),
... | 23.7 | 74 | 0.685654 | import os
from channels.routing import ChannelNameRouter, ProtocolTypeRouter
from django.core.asgi import get_asgi_application
from notifications import consumers
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'notifs.settings')
application = ProtocolTypeRouter(
{
'http': get_asgi_application(),
... | 0 | 0 | 0 |
1524f6da34655de1d60bbc96022b5edd80ee87e4 | 615 | py | Python | demo/python/multi-threading/demo4.py | dark-w/sokoban | 98cd76dd94ae0c7d1beaaca47f0d3598998bb43b | [
"Apache-2.0"
] | null | null | null | demo/python/multi-threading/demo4.py | dark-w/sokoban | 98cd76dd94ae0c7d1beaaca47f0d3598998bb43b | [
"Apache-2.0"
] | 9 | 2021-01-24T05:26:31.000Z | 2021-04-07T07:03:02.000Z | demo/python/multi-threading/demo4.py | dark-w/sokoban | 98cd76dd94ae0c7d1beaaca47f0d3598998bb43b | [
"Apache-2.0"
] | null | null | null | import threading
# pls thinking about if there not use mutex...
# you must try it, comment the line 12 and the line 14...
mutex = threading.Lock()
num = 0
if __name__ == "__main__":
main()
| 20.5 | 59 | 0.560976 | import threading
# pls thinking about if there not use mutex...
# you must try it, comment the line 12 and the line 14...
mutex = threading.Lock()
num = 0
def fun1(n):
global num
for i in range(n):
mutex.acquire()
num += 1
mutex.release()
print("num result: {}".format(num)) ... | 349 | 0 | 62 |
7ed241bdc8a02c16e6ea477e0032b989c2862ec7 | 14,833 | py | Python | decofre/infer.py | LoicGrobol/decofre | 68e12c8da4a6c032bb5ea3edff9e8484344e94e2 | [
"MIT"
] | 9 | 2021-01-15T10:34:02.000Z | 2021-12-24T13:58:36.000Z | decofre/infer.py | LoicGrobol/decofre | 68e12c8da4a6c032bb5ea3edff9e8484344e94e2 | [
"MIT"
] | 8 | 2020-03-13T10:52:48.000Z | 2022-02-06T22:15:28.000Z | decofre/infer.py | LoicGrobol/decofre | 68e12c8da4a6c032bb5ea3edff9e8484344e94e2 | [
"MIT"
] | null | null | null | import contextlib
import pathlib
import shutil
import sys
import tempfile
import typing as ty
import click
import click_pathlib
import jsonlines
import numpy as np
import spacy
import ujson as json
from typing import Any, Dict, List, Literal, Optional, TextIO
from typing_extensions import TypedDict
from decofre.form... | 32.6 | 104 | 0.569945 | import contextlib
import pathlib
import shutil
import sys
import tempfile
import typing as ty
import click
import click_pathlib
import jsonlines
import numpy as np
import spacy
import ujson as json
from typing import Any, Dict, List, Literal, Optional, TextIO
from typing_extensions import TypedDict
from decofre.form... | 8,795 | 160 | 160 |
82b98750a07e2cf2bdd895c8151af601bd05d953 | 1,233 | py | Python | lib/galaxy/model/migrate/versions/0124_job_state_history.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 2 | 2017-03-28T12:11:41.000Z | 2017-04-22T02:58:25.000Z | lib/galaxy/model/migrate/versions/0124_job_state_history.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 12 | 2020-07-24T23:55:19.000Z | 2021-12-19T11:40:06.000Z | lib/galaxy/model/migrate/versions/0124_job_state_history.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2018-05-30T07:38:54.000Z | 2018-05-30T07:38:54.000Z | """
Migration script for the job state history table
"""
from __future__ import print_function
import datetime
import logging
from sqlalchemy import Column, DateTime, ForeignKey, Integer, MetaData, String, Table
from galaxy.model.custom_types import TrimmedString
from galaxy.model.migrate.versions.util import create... | 30.825 | 90 | 0.660989 | """
Migration script for the job state history table
"""
from __future__ import print_function
import datetime
import logging
from sqlalchemy import Column, DateTime, ForeignKey, Integer, MetaData, String, Table
from galaxy.model.custom_types import TrimmedString
from galaxy.model.migrate.versions.util import create... | 231 | 0 | 46 |
d38193783eb4aa254cd51a4fcd972a92d001a8ae | 3,595 | py | Python | deploy_dst.py | CiscoDevNet/dst-automation | dffcde76f1bd7dc4dd4350c7a224f8ad9679ad4a | [
"BSD-3-Clause"
] | 4 | 2020-04-28T16:38:18.000Z | 2021-06-09T08:45:24.000Z | deploy_dst.py | CiscoDevNet/dst-automation | dffcde76f1bd7dc4dd4350c7a224f8ad9679ad4a | [
"BSD-3-Clause"
] | 6 | 2020-11-04T16:35:42.000Z | 2021-04-25T13:38:56.000Z | deploy_dst.py | CiscoDevNet/dst-automation | dffcde76f1bd7dc4dd4350c7a224f8ad9679ad4a | [
"BSD-3-Clause"
] | 3 | 2020-05-13T22:43:50.000Z | 2021-05-01T22:30:33.000Z | #!/usr/bin/env python3
"""
Deploy DST configuration using Ansible.
Copyright (c) 2020, Copyright (c) 2020, Cisco Systems, Inc. or its affiliates
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redis... | 32.387387 | 122 | 0.708484 | #!/usr/bin/env python3
"""
Deploy DST configuration using Ansible.
Copyright (c) 2020, Copyright (c) 2020, Cisco Systems, Inc. or its affiliates
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redis... | 1,547 | 0 | 23 |
d80b042bdf0e393b2fc4472e860104feb09f75f7 | 647 | py | Python | list_class.py | jmb462/rst-to-mediawiki | 2d32f1659593bf6a49668a471f091450526201b9 | [
"MIT"
] | null | null | null | list_class.py | jmb462/rst-to-mediawiki | 2d32f1659593bf6a49668a471f091450526201b9 | [
"MIT"
] | null | null | null | list_class.py | jmb462/rst-to-mediawiki | 2d32f1659593bf6a49668a471f091450526201b9 | [
"MIT"
] | null | null | null | #######################################################################
# Godot RST File to MediaWiki converter #
#######################################################################
import re
import pandas as pd
import sys
source=sys.argv[1]
with open(source) as file:
... | 34.052632 | 146 | 0.48068 | #######################################################################
# Godot RST File to MediaWiki converter #
#######################################################################
import re
import pandas as pd
import sys
source=sys.argv[1]
with open(source) as file:
... | 0 | 0 | 0 |
e6443582a8702368766317174ba425fb2305a214 | 2,261 | py | Python | code/lab2_code/two_collide.py | YuYanzy/Lab_ECE_5725 | 1eb0ebbd3e1aa00a850f6d5ad7f3676386e2fb1b | [
"Apache-2.0"
] | null | null | null | code/lab2_code/two_collide.py | YuYanzy/Lab_ECE_5725 | 1eb0ebbd3e1aa00a850f6d5ad7f3676386e2fb1b | [
"Apache-2.0"
] | null | null | null | code/lab2_code/two_collide.py | YuYanzy/Lab_ECE_5725 | 1eb0ebbd3e1aa00a850f6d5ad7f3676386e2fb1b | [
"Apache-2.0"
] | null | null | null | # Yu Zhang yz2729
# Lab 2 Date: 09/23/21
import RPi.GPIO as GPIO
import pygame # Import pygame graphics library
import time
import os # for OS calls
CODERUN = True
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN,pull_up_down = GPIO.PUD_UP)
GPIO.add_event_detect(17, GPIO.FALLING, callback=GPIO17_callback, bo... | 30.972603 | 87 | 0.673596 | # Yu Zhang yz2729
# Lab 2 Date: 09/23/21
import RPi.GPIO as GPIO
import pygame # Import pygame graphics library
import time
import os # for OS calls
CODERUN = True
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN,pull_up_down = GPIO.PUD_UP)
def GPIO17_callback(channel):
global CODERUN
CODERUN = Fal... | 49 | 0 | 22 |
881a2e37024566fd7ac36f53a1f9885400a09b73 | 9,151 | py | Python | uplift/tree/_tree.py | Antiguru11/uplift | ffaa5bcd20d6aa264fa3b2d191327c86384e4f7c | [
"Apache-2.0"
] | null | null | null | uplift/tree/_tree.py | Antiguru11/uplift | ffaa5bcd20d6aa264fa3b2d191327c86384e4f7c | [
"Apache-2.0"
] | null | null | null | uplift/tree/_tree.py | Antiguru11/uplift | ffaa5bcd20d6aa264fa3b2d191327c86384e4f7c | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta, abstractmethod
import numpy as np
_epsilon = np.finfo('double').eps
| 32.335689 | 82 | 0.460059 | from abc import ABCMeta, abstractmethod
import numpy as np
_epsilon = np.finfo('double').eps
class Tree():
def __init__(self, n_groups):
self.n_groups = n_groups
self.reset()
def reset(self):
self.nodes = list()
self.leaf_ids = list()
def add_node(self,
... | 8,579 | 140 | 332 |
791006d4cf920590caf78ae89fb7b395283728f7 | 1,778 | py | Python | mysql_autoxtrabackup/utils/mysql_cli.py | icy1900/MySQL-AutoXtraBackup | dfdf86ba4d1fe15a35cececa4934cb7f247e448f | [
"MIT"
] | 134 | 2015-04-17T15:05:13.000Z | 2022-01-06T20:51:37.000Z | mysql_autoxtrabackup/utils/mysql_cli.py | icy1900/MySQL-AutoXtraBackup | dfdf86ba4d1fe15a35cececa4934cb7f247e448f | [
"MIT"
] | 316 | 2015-04-22T07:40:46.000Z | 2021-11-08T12:09:02.000Z | mysql_autoxtrabackup/utils/mysql_cli.py | icy1900/MySQL-AutoXtraBackup | dfdf86ba4d1fe15a35cececa4934cb7f247e448f | [
"MIT"
] | 80 | 2015-04-30T19:25:24.000Z | 2021-11-09T10:32:54.000Z | # This file will consist of some wrapper for using MySQL
# It is mainly used for preparing and calling mysql cli
import logging
from mysql_autoxtrabackup.general_conf import path_config
from mysql_autoxtrabackup.general_conf.generalops import GeneralClass
from mysql_autoxtrabackup.process_runner.process_runner import ... | 40.409091 | 79 | 0.669291 | # This file will consist of some wrapper for using MySQL
# It is mainly used for preparing and calling mysql cli
import logging
from mysql_autoxtrabackup.general_conf import path_config
from mysql_autoxtrabackup.general_conf.generalops import GeneralClass
from mysql_autoxtrabackup.process_runner.process_runner import ... | 1,299 | 3 | 103 |
98e6f77a0bdec0402472f82795c8851852f675eb | 817 | py | Python | ExerciciosPython/Analisador de Lista.py | NathanSoares25/ExerciciosPython | 718a47ad26690355807b4ec1412e386b02acd098 | [
"MIT"
] | 2 | 2021-03-19T00:27:55.000Z | 2021-03-24T01:24:08.000Z | ExerciciosPython/Analisador de Lista.py | NathanSoares25/ExerciciosPython | 718a47ad26690355807b4ec1412e386b02acd098 | [
"MIT"
] | null | null | null | ExerciciosPython/Analisador de Lista.py | NathanSoares25/ExerciciosPython | 718a47ad26690355807b4ec1412e386b02acd098 | [
"MIT"
] | null | null | null | # Faça um programa que leia 5 valores e guarde-os em uma lista, no final mostre qual é o maior e o menor valor e qual
# A sua posição na lista
valores = list() # cria uma lista
for c in range(0, 5):
valores.append(int(input(f'Digite um valor para a posição {c}: '))) # inserindo os números dentro da lista
print(f... | 40.85 | 117 | 0.684211 | # Faça um programa que leia 5 valores e guarde-os em uma lista, no final mostre qual é o maior e o menor valor e qual
# A sua posição na lista
valores = list() # cria uma lista
for c in range(0, 5):
valores.append(int(input(f'Digite um valor para a posição {c}: '))) # inserindo os números dentro da lista
print(f... | 0 | 0 | 0 |
ab724ee8ffa9e2aff66290fce867acf596434d97 | 2,430 | py | Python | scripts/sources/S_EllipsoidTestSVI.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2021-04-10T13:24:30.000Z | 2022-03-26T08:20:42.000Z | scripts/sources/S_EllipsoidTestSVI.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | null | null | null | scripts/sources/S_EllipsoidTestSVI.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2019-08-13T22:02:17.000Z | 2022-02-09T17:49:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # S_El... | 27.613636 | 207 | 0.70535 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # S_El... | 0 | 0 | 0 |
05a5f6749f1319f6551e4027aec3c982e8778867 | 823 | py | Python | example/search-author.py | dollodart/gssa | 078ff1e8c2d103d871f6f0e4c50f961384127a3c | [
"MIT"
] | null | null | null | example/search-author.py | dollodart/gssa | 078ff1e8c2d103d871f6f0e4c50f961384127a3c | [
"MIT"
] | null | null | null | example/search-author.py | dollodart/gssa | 078ff1e8c2d103d871f6f0e4c50f961384127a3c | [
"MIT"
] | null | null | null | from gssa.core import search
from gssa.graph_search import breadth_first_search
from gssa.secretenv import author_first, author_last, vancouver_author
author = author_first + ' ' + author_last
publist = search(author, nres=100, overwrite=False)
breadth_first_search(publist[:100], levels=2, filters=(has_author, sp... | 30.481481 | 76 | 0.746051 | from gssa.core import search
from gssa.graph_search import breadth_first_search
from gssa.secretenv import author_first, author_last, vancouver_author
author = author_first + ' ' + author_last
publist = search(author, nres=100, overwrite=False)
def has_author(pub):
if author_last in ''.join(x.lower() for x in pu... | 426 | 0 | 69 |
d8eb1bf097980e7748dab7e27729f783c74750f9 | 893 | py | Python | PyParadise/__init__.py | brandherd/PyParadise | 1c65bf634e17931f165fd88b9938f604b9371e2e | [
"MIT"
] | 1 | 2021-06-01T13:07:54.000Z | 2021-06-01T13:07:54.000Z | PyParadise/__init__.py | brandherd/PyParadise | 1c65bf634e17931f165fd88b9938f604b9371e2e | [
"MIT"
] | 3 | 2021-11-03T02:07:38.000Z | 2022-03-14T20:35:04.000Z | PyParadise/__init__.py | brandherd/PyParadise | 1c65bf634e17931f165fd88b9938f604b9371e2e | [
"MIT"
] | null | null | null | from . import data
from . import cube
from . import rss
from . import spectrum1d
from . import ssplibrary
from . import parameters
from . import fit_profile
from . import header
import copyreg as copy_reg
from types import *
copy_reg.pickle(MethodType, _pickle_method, _unpickle_method)
| 24.135135 | 67 | 0.671892 | from . import data
from . import cube
from . import rss
from . import spectrum1d
from . import ssplibrary
from . import parameters
from . import fit_profile
from . import header
import copyreg as copy_reg
from types import *
def _pickle_method(method):
func_name = method.__func__.__name__
obj = method.__self... | 555 | 0 | 46 |
2ac0b229d581190aaa35cb79f0a0b8e7c605d501 | 131 | py | Python | tenpy/utility/angleConvert.py | TensileTensor/Tenpy | 8ff7150b71f2fed4c6808d89bdfffd1c9063bb66 | [
"MIT"
] | null | null | null | tenpy/utility/angleConvert.py | TensileTensor/Tenpy | 8ff7150b71f2fed4c6808d89bdfffd1c9063bb66 | [
"MIT"
] | null | null | null | tenpy/utility/angleConvert.py | TensileTensor/Tenpy | 8ff7150b71f2fed4c6808d89bdfffd1c9063bb66 | [
"MIT"
] | null | null | null | import math
| 18.714286 | 35 | 0.641221 | import math
def toRadian(angle):
return angle * (math.pi/180.0)
def toDegree(angle):
return angle * (180.0/math.pi) | 70 | 0 | 49 |
d90a4713ede40d909bddd90975cd6377a1d93ec8 | 3,789 | py | Python | NEAT/neat/attributes.py | ShangtongZhang/DataMining | f72a17694ca971dffc80ee6251ab47327c87492c | [
"Apache-2.0"
] | 1 | 2018-02-22T15:40:22.000Z | 2018-02-22T15:40:22.000Z | NEAT/neat/attributes.py | ShangtongZhang/DataMining | f72a17694ca971dffc80ee6251ab47327c87492c | [
"Apache-2.0"
] | null | null | null | NEAT/neat/attributes.py | ShangtongZhang/DataMining | f72a17694ca971dffc80ee6251ab47327c87492c | [
"Apache-2.0"
] | 3 | 2017-03-31T03:38:36.000Z | 2019-04-27T15:58:26.000Z | from random import choice, gauss, random
from neat.config import ConfigParameter
# TODO: There is probably a lot of room for simplification of these classes using metaprogramming.
| 31.31405 | 98 | 0.61441 | from random import choice, gauss, random
from neat.config import ConfigParameter
# TODO: There is probably a lot of room for simplification of these classes using metaprogramming.
class BaseAttribute(object):
def __init__(self, name):
self.name = name
for n, cname in zip(self.__config_items__, se... | 2,606 | 854 | 145 |
7dffe231c31a4be0d60223846b10ded3b3382b58 | 1,938 | py | Python | test.py | hidevn/sphere-face-py | 5b85431b038ac0e196b53ed7e19e2540133132d3 | [
"MIT"
] | null | null | null | test.py | hidevn/sphere-face-py | 5b85431b038ac0e196b53ed7e19e2540133132d3 | [
"MIT"
] | null | null | null | test.py | hidevn/sphere-face-py | 5b85431b038ac0e196b53ed7e19e2540133132d3 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import os
import caffe
from scipy.spatial.distance import cosine
image_folder = './images'
output_folder = './features'
model = './train/code/sphereface_deploy.prototxt'
weights = './train/result/sphereface_model.caffemodel'
net = caffe.Net(model, weights, caffe.TEST)
if __name__ == '__m... | 34.607143 | 110 | 0.691434 | import numpy as np
import cv2
import os
import caffe
from scipy.spatial.distance import cosine
image_folder = './images'
output_folder = './features'
model = './train/code/sphereface_deploy.prototxt'
weights = './train/result/sphereface_model.caffemodel'
net = caffe.Net(model, weights, caffe.TEST)
def extract_deep_fe... | 1,358 | 0 | 92 |
d86e121283842502e8b415f5c5bb7b8769d03bc1 | 1,806 | py | Python | beast/physicsmodel/helpers/gridhelpers.py | marthaboyer/beast | 1ca71fb64ab60827e4e4e1937b64f319a98166c3 | [
"BSD-3-Clause"
] | null | null | null | beast/physicsmodel/helpers/gridhelpers.py | marthaboyer/beast | 1ca71fb64ab60827e4e4e1937b64f319a98166c3 | [
"BSD-3-Clause"
] | null | null | null | beast/physicsmodel/helpers/gridhelpers.py | marthaboyer/beast | 1ca71fb64ab60827e4e4e1937b64f319a98166c3 | [
"BSD-3-Clause"
] | null | null | null | """ Common helpers in the grid package """
__all__ = ['isNestedInstance', 'pretty_size_print']
def isNestedInstance(obj, cl):
""" Test for sub-classes types
I could not find a universal test
keywords
--------
obj: object instance
object to test
cl: Class
... | 24.08 | 72 | 0.54485 | """ Common helpers in the grid package """
__all__ = ['isNestedInstance', 'pretty_size_print']
def isNestedInstance(obj, cl):
""" Test for sub-classes types
I could not find a universal test
keywords
--------
obj: object instance
object to test
cl: Class
... | 0 | 0 | 0 |
4484d154e370a6956803f8544b3ec654031a14f2 | 317 | py | Python | tests/test_showers.py | deepjets/deepjets | fc9c610d4fd80975d8d25eb0d7cd41d7dd318c75 | [
"BSD-3-Clause"
] | 23 | 2016-11-13T02:48:32.000Z | 2021-11-13T01:02:20.000Z | tests/test_showers.py | deepjets/deepjets | fc9c610d4fd80975d8d25eb0d7cd41d7dd318c75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_showers.py | deepjets/deepjets | fc9c610d4fd80975d8d25eb0d7cd41d7dd318c75 | [
"BSD-3-Clause"
] | 7 | 2016-12-02T16:58:33.000Z | 2021-09-02T12:36:46.000Z | from deepjets.generate import generate_events
for event in generate_events('w_vincia.config', 1, write_to='vincia.hepmc', shower='vincia', random_state=1, verbosity=0):
pass
for event, weight in generate_events('w.config', 1, write_to='dire.hepmc', shower='dire', random_state=1, verbosity=0):
print weight
| 39.625 | 122 | 0.753943 | from deepjets.generate import generate_events
for event in generate_events('w_vincia.config', 1, write_to='vincia.hepmc', shower='vincia', random_state=1, verbosity=0):
pass
for event, weight in generate_events('w.config', 1, write_to='dire.hepmc', shower='dire', random_state=1, verbosity=0):
print weight
| 0 | 0 | 0 |
431546551b4d409bb50114ac36a7a15e82717c34 | 2,518 | py | Python | test/python/test_loss.py | slin004/incubator-singa | 09c8a2e65927d6405262bbb969e6dab96809df07 | [
"Apache-2.0"
] | 1 | 2019-11-15T12:46:10.000Z | 2019-11-15T12:46:10.000Z | test/python/test_loss.py | slin004/incubator-singa | 09c8a2e65927d6405262bbb969e6dab96809df07 | [
"Apache-2.0"
] | 8 | 2020-01-16T06:56:23.000Z | 2020-01-18T03:46:04.000Z | test/python/test_loss.py | slin004/incubator-singa | 09c8a2e65927d6405262bbb969e6dab96809df07 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 34.027027 | 74 | 0.602462 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 1,412 | 13 | 138 |
41866b837dfda3d810db4eccfdd0ab68717e6db9 | 1,492 | py | Python | src/SortingSim/test.py | berkayaslan/Sorting_Simulation | 16cfcd404063b060191dab244025012271edacd8 | [
"MIT"
] | 2 | 2020-01-26T09:42:03.000Z | 2020-05-26T13:57:02.000Z | src/SortingSim/test.py | berkayaslan/Sorting_Simulation | 16cfcd404063b060191dab244025012271edacd8 | [
"MIT"
] | null | null | null | src/SortingSim/test.py | berkayaslan/Sorting_Simulation | 16cfcd404063b060191dab244025012271edacd8 | [
"MIT"
] | null | null | null | import Sticks
import stick
import time
import pygame
pygame.init()
board = pygame.display.set_mode((400, 400))
while 1:
for e in pygame.event.get():
if e.type == pygame.KEYDOWN and e.key == pygame.K_TAB:
print("pressed tab")
"""
# ///---=== FIND STICK TEST ===---
ex1 = Sticks.Sticks()
ex1.n... | 27.62963 | 68 | 0.626676 | import Sticks
import stick
import time
import pygame
pygame.init()
board = pygame.display.set_mode((400, 400))
while 1:
for e in pygame.event.get():
if e.type == pygame.KEYDOWN and e.key == pygame.K_TAB:
print("pressed tab")
"""
# ///---=== FIND STICK TEST ===---
ex1 = Sticks.Sticks()
ex1.n... | 0 | 0 | 0 |
279fc711c62428d8edd7bb25202187627d94fc62 | 581 | py | Python | website/volunteers/migrations/0010_auto_20201129_2152.py | tibet5/website | 937e1941aaadbf7cd0a404a2655858451c01dd54 | [
"MIT"
] | null | null | null | website/volunteers/migrations/0010_auto_20201129_2152.py | tibet5/website | 937e1941aaadbf7cd0a404a2655858451c01dd54 | [
"MIT"
] | null | null | null | website/volunteers/migrations/0010_auto_20201129_2152.py | tibet5/website | 937e1941aaadbf7cd0a404a2655858451c01dd54 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-30 02:52
from django.db import migrations, models
| 24.208333 | 56 | 0.598967 | # Generated by Django 3.1.2 on 2020-11-30 02:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('volunteers', '0009_auto_20201128_2348'),
]
operations = [
migrations.AddField(
model_name='volunteer',
name='anonymi... | 0 | 467 | 23 |
1ceb29a6e7813b27c5a606e336c81ea0d60d0dfc | 4,088 | py | Python | examples/external_isolation/plot_both_pol_sweep_results.py | JBHilton/covid-19-in-households-public | 42fb31a3c581a3d5b6b6959078a5f6bf4f25212e | [
"Apache-2.0"
] | 4 | 2020-04-17T13:19:43.000Z | 2021-12-02T19:56:27.000Z | examples/external_isolation/plot_both_pol_sweep_results.py | JBHilton/covid-19-in-households-public | 42fb31a3c581a3d5b6b6959078a5f6bf4f25212e | [
"Apache-2.0"
] | 6 | 2020-06-16T17:06:52.000Z | 2021-02-08T18:32:39.000Z | examples/external_isolation/plot_both_pol_sweep_results.py | JBHilton/covid-19-in-households-public | 42fb31a3c581a3d5b6b6959078a5f6bf4f25212e | [
"Apache-2.0"
] | 3 | 2020-05-12T12:09:48.000Z | 2021-06-07T09:16:09.000Z | '''This plots the results of the parameter sweep for the OOHI
example.
'''
from os import mkdir
from os.path import isdir
from pickle import load
from numpy import arange, array, atleast_2d, hstack, sum, where, zeros
from matplotlib.pyplot import close, colorbar, imshow, set_cmap, subplots
from mpl_toolkits.axes_grid1 ... | 29.410072 | 73 | 0.630871 | '''This plots the results of the parameter sweep for the OOHI
example.
'''
from os import mkdir
from os.path import isdir
from pickle import load
from numpy import arange, array, atleast_2d, hstack, sum, where, zeros
from matplotlib.pyplot import close, colorbar, imshow, set_cmap, subplots
from mpl_toolkits.axes_grid1 ... | 0 | 0 | 0 |
d9c3702c2b8b268d50c3dceb6e958e4b9a10cc86 | 1,515 | py | Python | on Raspberry/DHTPub.py | NourS-d/Smart-GreenHouse-Programming_For_IoT | 18632759c80c87b6343e70aac20b1dbdd3fb6503 | [
"MIT"
] | null | null | null | on Raspberry/DHTPub.py | NourS-d/Smart-GreenHouse-Programming_For_IoT | 18632759c80c87b6343e70aac20b1dbdd3fb6503 | [
"MIT"
] | null | null | null | on Raspberry/DHTPub.py | NourS-d/Smart-GreenHouse-Programming_For_IoT | 18632759c80c87b6343e70aac20b1dbdd3fb6503 | [
"MIT"
] | null | null | null | from DHT import DHT_Read
import paho.mqtt.client as mqtt
import json
import requests
import time
try:
file=open("config.json", "r")
json_str = file.read()
file.close()
except:
raise KeyError("Error opening config file. Please check.")
config_json = json.loads(json_str)
url = config_jso... | 19.423077 | 93 | 0.673927 | from DHT import DHT_Read
import paho.mqtt.client as mqtt
import json
import requests
import time
class DHT_Pub:
def __init__(self, clientID, broker, port = 1883):
self.clientID = clientID
self.port = port
self.pub=mqtt.Client(self.clientID, port)
self.broker = broker
def start(self):
self.pub.conne... | 287 | -7 | 122 |
614756d04575afdd61b6db9c917c997966809450 | 1,303 | py | Python | apps/views.py | Jayson7/django-weather-app | 91931cb59de07213739a95019918f7d91f42e2b2 | [
"MIT"
] | null | null | null | apps/views.py | Jayson7/django-weather-app | 91931cb59de07213739a95019918f7d91f42e2b2 | [
"MIT"
] | null | null | null | apps/views.py | Jayson7/django-weather-app | 91931cb59de07213739a95019918f7d91f42e2b2 | [
"MIT"
] | null | null | null | from django.shortcuts import render
import json
from urllib.error import HTTPError
import urllib
# Create your views here.
| 34.289474 | 165 | 0.521105 | from django.shortcuts import render
import json
from urllib.error import HTTPError
import urllib
# Create your views here.
def homepage(request):
if request.method == 'POST':
city = request.POST['city']
try:
url = urllib.request.urlopen('https://api.openweathermap.org/data/2.5/weather... | 1,158 | 0 | 23 |
86a5fc8774ef271374e84a2219191c1c7929b948 | 1,959 | py | Python | uta_tools/data_sources/mane_transcript_mappings.py | cancervariants/uta_tools | daa3fcbaabcc8aaeef8f2b0c7080bacd928d97d6 | [
"MIT"
] | 1 | 2022-01-19T18:17:56.000Z | 2022-01-19T18:17:56.000Z | uta_tools/data_sources/mane_transcript_mappings.py | cancervariants/uta-tools | 9d102ea96e5f7b07a862113ee07eca2ce3412ad4 | [
"MIT"
] | 25 | 2021-10-13T19:57:39.000Z | 2022-03-29T17:56:32.000Z | uta_tools/data_sources/mane_transcript_mappings.py | cancervariants/uta-tools | 9d102ea96e5f7b07a862113ee07eca2ce3412ad4 | [
"MIT"
] | null | null | null | """The module for loading MANE Transcript mappings to genes."""
from typing import Dict, Optional, List
import pandas as pd
from uta_tools import MANE_SUMMARY_PATH, logger
class MANETranscriptMappings:
"""The MANE Transcript mappings class."""
def __init__(self, mane_data_path: str = MANE_SUMMARY_PATH) -> ... | 36.962264 | 78 | 0.646759 | """The module for loading MANE Transcript mappings to genes."""
from typing import Dict, Optional, List
import pandas as pd
from uta_tools import MANE_SUMMARY_PATH, logger
class MANETranscriptMappings:
"""The MANE Transcript mappings class."""
def __init__(self, mane_data_path: str = MANE_SUMMARY_PATH) -> ... | 0 | 0 | 0 |
fda805b8612fa20791d43e89fb3298b7f7ab2ab3 | 1,253 | py | Python | lib/datasets/__init__.py | hudmgy/HRNet-Facial-Landmark-Detection | fe95d4b19e92fe267201d38648635b9beffba77a | [
"MIT"
] | 1 | 2021-06-22T07:58:24.000Z | 2021-06-22T07:58:24.000Z | lib/datasets/__init__.py | hudmgy/HRNet-Facial-Landmark-Detection | fe95d4b19e92fe267201d38648635b9beffba77a | [
"MIT"
] | null | null | null | lib/datasets/__init__.py | hudmgy/HRNet-Facial-Landmark-Detection | fe95d4b19e92fe267201d38648635b9beffba77a | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Tianheng Cheng(tianhengcheng@gmail.com)
# ------------------------------------------------------------------------------
from .aflw import AFLW
from .cofw import COF... | 29.139535 | 80 | 0.592977 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Tianheng Cheng(tianhengcheng@gmail.com)
# ------------------------------------------------------------------------------
from .aflw import AFLW
from .cofw import COF... | 644 | 0 | 23 |
5f54ec91d90a237450a6edc030c7b90fef6ca813 | 524 | py | Python | merlin/optimizer.py | ethereon/merlin | 0babfed51e65197086d74479a1ca9150259b4f7f | [
"BSD-3-Clause"
] | 1 | 2019-08-15T16:22:20.000Z | 2019-08-15T16:22:20.000Z | merlin/optimizer.py | ethereon/merlin | 0babfed51e65197086d74479a1ca9150259b4f7f | [
"BSD-3-Clause"
] | null | null | null | merlin/optimizer.py | ethereon/merlin | 0babfed51e65197086d74479a1ca9150259b4f7f | [
"BSD-3-Clause"
] | null | null | null | import tensorflow as tf
from merlin.spec import Spec, Default
| 26.2 | 70 | 0.685115 | import tensorflow as tf
from merlin.spec import Spec, Default
class Optimizer:
class Config(Spec):
# An optimizer name from the tf.optimizers module
name: str = 'RMSprop'
# Keyword arguments passed to the optimizer on construction
params: dict = Default(dict(lr=0.001))
def _... | 143 | 294 | 23 |
cd5f236ac6ba3563921c41b0487c9111fcce775b | 3,306 | py | Python | tests/test_ntree.py | awoods/ocfl-py | ef4ff9d6b9a950088ff5373c4f1dfeec339f034d | [
"MIT"
] | 14 | 2018-09-10T20:08:04.000Z | 2022-03-29T18:10:43.000Z | tests/test_ntree.py | awoods/ocfl-py | ef4ff9d6b9a950088ff5373c4f1dfeec339f034d | [
"MIT"
] | 73 | 2019-02-13T20:35:09.000Z | 2022-03-24T15:21:34.000Z | tests/test_ntree.py | awoods/ocfl-py | ef4ff9d6b9a950088ff5373c4f1dfeec339f034d | [
"MIT"
] | 3 | 2019-02-13T18:39:50.000Z | 2021-05-04T15:39:04.000Z | """Digest tests."""
import unittest
from ocfl.ntree import Ntree
class TestAll(unittest.TestCase):
"""TestAll class to run tests."""
def test01_encode(self):
"""Test encode."""
nt = Ntree()
self.assertEqual(nt.encode(''), '')
self.assertEqual(nt.encode('a'), 'a')
self.... | 47.228571 | 85 | 0.635209 | """Digest tests."""
import unittest
from ocfl.ntree import Ntree
class TestAll(unittest.TestCase):
"""TestAll class to run tests."""
def test01_encode(self):
"""Test encode."""
nt = Ntree()
self.assertEqual(nt.encode(''), '')
self.assertEqual(nt.encode('a'), 'a')
self.... | 0 | 0 | 0 |