max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
model/report.py
CJBriers/orange-river-thesis
0
12790751
""" Construct dataset """ import sys import math import pandas as pd import numpy as np import csv def calc_gaps(station): """Calculate gaps in time series""" df = pd.read_csv('../data/all_clean/{0}-clean.txt'.format(station), parse_dates=['Date']) df = df.set_index(['Date']) df.index = pd.to_datetim...
3.40625
3
web_app/infinite_trivia.py
4398TempleSpring2020/cscapstoneproject-infinitetrivia
1
12790752
from app import app, socketio if __name__ == '__main__': app.jinja_env.auto_reload = True app.config['TEMPLATES_AUTO_RELOAD'] = True socketio.run(app)
1.421875
1
m3.py
bshishov/DeepForecasting
4
12790753
import numpy as np import matplotlib.pyplot as plt import keras import keras.layers as klayers import time_series as tsutils import processing import metrics class ModelBase(object): # Required 'context' information for a model input_window = None # How many point the model can predict for a single give...
2.765625
3
0451 Sort Characters By Frequency.py
MdAbedin/leetcode
4
12790754
class Solution: def frequencySort(self, s: str) -> str: counts = Counter(s) chars = defaultdict(list) for char in counts: chars[counts[char]].append(char) ans = '' for count in sorted(chars.keys(),reverse=True): for char ...
3.671875
4
Back-End/Python/Basics/Part -3- Hash Maps/02- Dictionaries/some-dict-code/04_API_difference.py
ASHISHKUMAR2411/Programming-CookBook
25
12790755
<reponame>ASHISHKUMAR2411/Programming-CookBook n1 = {'employees': 100, 'employee': 5000, 'users': 10, 'user': 100} n2 = {'employees': 250, 'users': 23, 'user': 230} n3 = {'employees': 150, 'users': 4, 'login': 1000} dict_union = n1.keys() | n2.keys() | n3.keys() dict_intersection = n1.keys() & n2.keys() & n3.keys() ...
3.96875
4
hello/forms.py
choudharykartik1717/python-docs-hello-django
0
12790756
<gh_stars>0 from django import forms from django.db import models from django.db.models import fields from .models import * class AddForm(forms.ModelForm): class Meta: model = Post fields = ('title','desc')
1.914063
2
spookyconsole/gui/style.py
FRCTeam7170/spooky-console
0
12790757
""" Contains styling utilities for tkinter widgets. Some features include: - a hierarchical styling system for the non-ttk widgets; - a collection of colour constants; - and reasonable cross-platform named fonts. """ import tkinter as tk import tkinter.font as tkfont from contextlib import contextmanager # Co...
2.984375
3
tests/test_engine/test_queries/test_queryop_logical_not.py
gitter-badger/MontyDB
0
12790758
import re from bson.regex import Regex def test_qop_not_1(monty_find, mongo_find): docs = [ {"a": 4}, {"x": 8} ] spec = {"a": {"$not": {"$eq": 8}}} monty_c = monty_find(docs, spec) mongo_c = mongo_find(docs, spec) assert mongo_c.count() == 2 assert monty_c.count() == mon...
2.515625
3
routine.py
Atari2/WhiteSnake
0
12790759
import asar from rom import Rom from patchexception import PatchException import os import re class Routine: incsrc = 'incsrc global_ow_code/defines.asm\nfreecode cleaned\n' def __init__(self, file): self.path = file self.ptr = None self.name = re.findall(r'\w+\.asm', file)[-1].replac...
2.34375
2
envio2/poisson.py
leonheld/INE5118
0
12790760
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt import seaborn as sns import collections import scipy from scipy.stats import poisson from scipy.stats import norm from math import sqrt sns.set(style = "darkgrid", context = "paper") plt.rc('text', usetex=True) plt.rc('font', family='serif') def poipmf(s...
2.78125
3
test/test_dataset.py
ffrankies/tf_rnn
1
12790761
import pytest from tf_rnn.dataset import * INPUT_PLACEHOLDER = 1 OUTPUT_PLACEHOLDER = 2 NUM_BATCHES_SMALL = 10 NUM_ROWS_SMALL = 10 ROW_LEN_SMALL = 5 NUM_BATCHES_MEDIUM = 1000 NUM_ROWS_MEDIUM = 100 ROW_LEN_MEDIUM = 20 BATCHED_INPUTS_SMALL = [[[INPUT_PLACEHOLDER for timestep in range(ROW_LEN_SMALL)]...
2.703125
3
dxgb_bench/datasets/__init__.py
trivialfis/dxgb_bench
2
12790762
from .mortgage import Mortgage from .taxi import Taxi from .higgs import Higgs from .year import YearPrediction from .covtype import Covtype from .airline import Airline from .epsilon import Epsilon from .generated import Generated import argparse from typing import Tuple from dxgb_bench.utils import DataSet def fac...
2.4375
2
examples/iris.py
speedcell4/houttuynia
1
12790763
from pathlib import Path import aku from torch import nn, optim from houttuynia.monitors import get_monitor from houttuynia.schedules import EpochalSchedule from houttuynia.nn import Classifier from houttuynia import log_system, manual_seed, to_device from houttuynia.datasets import prepare_iris_dataset from houttuyn...
2.203125
2
tests/test_tools/test_aucote_ad/test_parsers/test_enum4linux_parser.py
Wolodija/aucote
1
12790764
<filename>tests/test_tools/test_aucote_ad/test_parsers/test_enum4linux_parser.py<gh_stars>1-10 from unittest import TestCase from tools.acuote_ad.parsers.enum4linux_parser import Enum4linuxParser from tools.acuote_ad.structs import Enum4linuxOS, Enum4linuxUser, Enum4linuxShare, Enum4linuxGroup, \ Enum4linuxPasswor...
2.25
2
torch_basic/NMT.py
quoniammm/mine-pytorch
3
12790765
<gh_stars>1-10 import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable import numpy as np import pandas as pd import matplotlib.pyplot as plt from nltk import FreqDist import re import jieba import math import time from collections import Coun...
2.0625
2
predict.py
henryhust/Coreference-Chinese
0
12790766
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import json import tensorflow as tf import util import json except_name = ["公司", "本公司", "该公司", "贵公司", "贵司", "本行", "该行", "本银行", "该集团", "本集团", "集团", "它", "他们", "他们", "我们", "该股", "其", ...
2.515625
3
pyobs/utils/threads/__init__.py
pyobs/pyobs-core
4
12790767
<gh_stars>1-10 from .future import Future from .lockwithabort import LockWithAbort, AcquireLockFailed from .threadwithreturnvalue import ThreadWithReturnValue
1.179688
1
tpDcc/libs/python/folder.py
tpDcc/tpDcc-libs-python
1
12790768
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Utility methods related to folders """ from __future__ import print_function, division, absolute_import import os import sys import time import errno import shutil import fnmatch import logging import tempfile import traceback import subprocess from distutils.dir_...
3.03125
3
main.py
kevinrpb/additives-scrapper
0
12790769
<filename>main.py #!/usr/bin/env python3 import json from scrappers import EAditivosScrapper, EuropaScrapper, LaVeganisteriaScrapper from util import parse_args, select_dietary, setup_logger, update_dietary def main(): args = parse_args() logger = setup_logger(level=args.log_level) logger.info('Starting') ...
3.015625
3
neural_interaction_detection.py
mtsang/neural-interaction-detection
35
12790770
import bisect import operator import numpy as np import torch from torch.utils import data from multilayer_perceptron import * from utils import * def preprocess_weights(weights): w_later = np.abs(weights[-1]) w_input = np.abs(weights[0]) for i in range(len(weights) - 2, 0, -1): w_later = np.matm...
2.296875
2
haas/tests/test_text_test_result.py
itziakos/haas
4
12790771
# -*- coding: utf-8 -*- # Copyright (c) 2013-2019 <NAME> # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE.txt file for details. from __future__ import absolute_import, unicode_literals from datetime import datetime, timedelta from...
2.203125
2
scripts/configs/minimal.py
Skydivizer/compsci
0
12790772
<gh_stars>0 import numpy as np from pcs_aero.experiment import ExperimentGroup # Convenience _all_shapes = ['rect', 'halfcircle', 'triangle'] # Script to use. program = "scripts/coef.py" experiments = [ ExperimentGroup("scripts/results/theta.txt", { 'shape': _all_shapes, 'theta': range(0, 181, 3...
2.140625
2
src/university/models.py
Nikhilgupta18/practice-react_django
0
12790773
from django.db import models from account.models import Country from django.contrib import admin grad_streams_list = [ 'Engineering', 'Law', 'Medicine', 'Business', ] grad_streams = ( ('Engineering', 'Engineering'), ('Law', 'Law'), ('Medicine', 'Medicine'), ('Business', 'Business'), )...
2.125
2
disk.py
oznotes/Pit
1
12790774
<gh_stars>1-10 from __future__ import print_function import sys import time import wmi __author__ = "Oz" __copyright__ = "Disk Reader WMI" def read_in_chunks(fileobj, chunksize=65536): """ Lazy function to read a file piece by piece. Default chunk size: 64kB. """ while True: data = file...
3.078125
3
ex4.py
hanskrupakar/Tensorflow-Beginner
0
12790775
<reponame>hanskrupakar/Tensorflow-Beginner import tensorflow as tf import numpy as np from tensorflow.models.rnn import rnn, rnn_cell if __name__ == '__main__': X = np.random.randint(0,2,(50000,25,10)) Y = np.reshape(np.sum(X,axis=2),(50000,25,1)) X_test = np.random.randint(0,2,(1000,25,10)) Y_tes...
3.515625
4
operators/identity_operator.py
aryanz-co-in/python-comments-variables-type-casting-operators
0
12790776
# Identity operator # "is" and "is not" living_room_temperature = 23 kitchen_room_temperature = 23 # is if living_room_temperature is kitchen_room_temperature: print("Temperature is same") else: print("Temperature is NOT same") living_room_temperature = 18 # is if living_room_temperature is kitchen_room...
4.46875
4
tests/test_atividade.py
leticiaarj/TrabalhoTPPE
0
12790777
<reponame>leticiaarj/TrabalhoTPPE<filename>tests/test_atividade.py<gh_stars>0 import unittest from usecases.Atividades import Atividade from usecases.Nodos import Nodo, NodoDecisao, NodoFusao, NodoFinal class testeAtividade(unittest.TestCase): def testCriacaoDiagrama(self): nodoInicial = Nodo('Nodo Inicial', ['...
2.703125
3
Pensamento Computacional/Exercicios/ex055.py
jotaven/UnipeCC
1
12790778
'''Faça um programa que receba dois números inteiros e gere os números inteiros que estão no intervalo compreendido por eles.''' number1 = int(input("Digite o primeiro numero: ")) + 1 number2 = int(input("Digite o segundo numero: ")) print(list(range(number1, number2)))
4.0625
4
TOPSIS-Aseem-101803469/__init__.py
26aseem/TOPSIS
0
12790779
from TOPSIS-Aseem-101803469.topsis import topsisPerformer
0.925781
1
Gui/Images/title_icons.py
marioharper182/OptionsPricing
0
12790780
#---------------------------------------------------------------------- # This file was generated by img2py.py # from wx.lib.embeddedimage import PyEmbeddedImage AmericanOption = PyEmbeddedImage( "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlw" "SFlzAAAHIQAAByEBauL93wAAABl0RVh0U29mdHd...
1.390625
1
reposit/auth/exceptions.py
tombasche/reposit-home-assistant
0
12790781
<filename>reposit/auth/exceptions.py """ Exceptions relating to auth """ class NoAuthenticationError(Exception): """ If a method is called that requires an access token and none is yet set then raise this error """ # pylint: disable=unnecessary-pass pass
1.929688
2
proto/core/molecule.py
protoserver/proto-cli
0
12790782
from abc import abstractmethod from cement import Interface, Handler class MoleculeInterface(Interface): class Meta: interface = 'stack' @abstractmethod def _build_config(self): """Do something to build the config.""" pass def build_config(self): """Do something to bu...
3.109375
3
netcdf_utils/NetCDF_O2_corr.py
shaunwbell/EcoFOCI_MooringAnalysis
2
12790783
<reponame>shaunwbell/EcoFOCI_MooringAnalysis #!/usr/bin/env python """ NetCDF_O2_corr.py calculate salinity from conductivity. History: ======== 2019-01-03 Put in flag for correcting Aandera optode values vs SBE-43 values (mmole/l vs umole/kg) Compatibility: ============== python >=3.6 - not tested, unlik...
2.046875
2
gen-py/Services_old/__init__.py
afshelburn/irpy
0
12790784
<filename>gen-py/Services_old/__init__.py __all__ = ['ttypes', 'constants', 'GameService', 'GamePlayer']
1.054688
1
cscs-checks/libraries/magma/magma_checks.py
CLIP-HPC/reframe
167
12790785
<gh_stars>100-1000 # Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import reframe as rfm import reframe.utility.sanity as sn @rfm.simple_test class MagmaCheck(rfm.Regressio...
1.875
2
main.py
kamaravichow/hrv-stress-detection-model
2
12790786
import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import OneHotEncoder import keras from keras import backend as K from keras.models import Sequential from keras.layers import Activation from keras.layers.core import Dense from keras.optimizers import Adam...
2.8125
3
topCoder/srms/500s/srm571/div2/fox_and_game.py
ferhatelmas/algo
25
12790787
class FoxAndGame: def countStars(self, result): return sum(r.count("o") for r in result)
2.765625
3
kinbot/write_mesmer.py
rubenvdvijver/KinBot
0
12790788
################################################### ## ## ## This file is part of the KinBot code v2.0 ## ## ## ## The contents are covered by the terms of the ## ## BSD 3-clause license included in the LICENSE ## ## file,...
1.75
2
tests/core/validation/test_transaction_validation.py
dbfreem/py-evm
1,641
12790789
<reponame>dbfreem/py-evm import pytest from eth.vm.forks.london.transactions import UnsignedDynamicFeeTransaction from eth.vm.forks.berlin.transactions import UnsignedAccessListTransaction from eth_utils import ValidationError @pytest.mark.parametrize( "unsigned_access_list_transaction,is_valid", ( ...
2.015625
2
burden/validate_burden.py
PingjunChen/LiverCancerSeg
41
12790790
<filename>burden/validate_burden.py<gh_stars>10-100 # -*- coding: utf-8 -*- import os, sys import numpy as np import pandas as pd from skimage import io from pydaily import format def cal_train_burden(slides_dir): slide_list = [] slide_list.extend([ele[6:-4] for ele in os.listdir(slides_dir) if "svs" in ele]...
2.484375
2
tclr_pretraining/dl_tclr.py
DAVEISHAN/TCLR
4
12790791
r'''This dataloader is an attemp to make a master DL that provides 2 augmented version of a sparse clip (covering minimum 64 frames) and 2 augmented versions of 4 dense clips (covering 16 frames temporal span minimum)''' import os import torch import numpy as np import matplotlib.pyplot as plt from torch.utils.data imp...
2.1875
2
exts.py
whan6795/myweb
0
12790792
<reponame>whan6795/myweb<filename>exts.py # encoding:utf-8 from flask_sqlalchemy import SQLAlchemy from datetime import datetime db = SQLAlchemy()
1.484375
1
1/kdh/8_11719.py
KNU-CS09/Baekjoon
0
12790793
import sys for line in sys.stdin: print(line.strip('\n'))
2.125
2
the-cloudwatch-dashboard/python/app.py
mttfarmer/serverless
1,627
12790794
<reponame>mttfarmer/serverless #!/usr/bin/env python3 from aws_cdk import core from the_cloudwatch_dashboard.the_cloudwatch_dashboard_stack import TheCloudwatchDashboardStack app = core.App() TheCloudwatchDashboardStack(app, "the-cloudwatch-dashboard") app.synth()
1.414063
1
party.py
jelkink/ucd-prog-2020
0
12790795
from location import Location import random class Party: def __init__(self, simulation, name, colour, strategy=""): self.location = Location() self.simulation = simulation if strategy == "": self.random_strategy() else: self.strategy = strategy self.name = name self.colour ...
3.703125
4
utils/archive/plasticc_extract_gp.py
heather999/snmachine
1
12790796
from snmachine import sndata,snfeatures import numpy as np import pandas from astropy.table import Table import pickle import os,sys ''' print('starting readin of monster files') #raw_data=pandas.read_csv('/share/hypatia/snmachine_resources/data/plasticc/test_set.csv') raw_data=pandas.read_csv('/share/hypatia/snmachin...
2.25
2
benchmarking.py
niladell/DockStream
34
12790797
import os import json import errno import sys import argparse from dockstream.utils.execute_external.execute import Executor from dockstream.utils import files_paths from dockstream.utils.enums.docking_enum import DockingConfigurationEnum _DC = DockingConfigurationEnum() def run_script(input_path: str) -> dict: ...
2.75
3
sc/acme_test.py
elliotgunn/DS-Unit-3-Sprint-1-Software-Engineering
0
12790798
<reponame>elliotgunn/DS-Unit-3-Sprint-1-Software-Engineering<filename>sc/acme_test.py import unittest from acme import Product from acme_report import generate_products, ADJECTIVES, NOUNS class AcmeProductTests(unittest.TestCase): """Making sure Acme products are the tops!""" def test_default_product_price(se...
3.234375
3
xyzflow/__init__.py
Renneke/xyzflow
2
12790799
# # XYZFlow - Simple Orchestration Framework # from .Task import Task, task from .Flow import get_flow_parameter, flow, Flow, save_parameters, load_parameters from .HelperTasks import Add, Sub, Multiplication from .Parameter import Parameter from .xyzflow import inspect_parameters, main
1.1875
1
tests/test_models.py
kahache/video_packaging_platform
8
12790800
<gh_stars>1-10 __author__ = "<NAME> & <NAME>" __version__ = "1.0.0" __start_date__ = "25th July 2020" __end_date__ = "3rd August 2020" __maintainer__ = "me" __email__ = "<EMAIL>" __requirements__ = "SQL-Alchemy, MySQL, Flask-SQLAlchemy, database script" __status__ = "Production" __description__ = """ This is the Databa...
2.296875
2
utils.py
nntrongnghia/learn-recsys
0
12790801
<reponame>nntrongnghia/learn-recsys<filename>utils.py import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F def bpr_loss(pos: torch.Tensor, neg: torch.Tensor)-> torch.Tensor: """Bayesian Personalized Ranking Loss Parameters ---------- pos : torch.Tensor ...
2.109375
2
scripts/gather_benchmarks.py
preshing/CompareIntegerMaps
72
12790802
#--------------------------------------------------- # Perform a bunch of experiments using CompareIntegerMaps.exe, and writes the results to results.txt. # You can filter the experiments by name by passing a regular expression as a script argument. # For example: run_tests.py LOOKUP_0_.* # Results are also cached in a...
2.46875
2
smoothcrawler/persistence/__init__.py
Chisanan232/pytsunami
1
12790803
from abc import ABCMeta, abstractmethod class PersistenceFacade(metaclass=ABCMeta): @abstractmethod def save(self, data, *args, **kwargs): pass
3.03125
3
lhorizon/solutions.py
arfon/lhorizon
1
12790804
""" functionality for solving body-intersection problems. used by `lhorizon.targeter`. currently contains only ray-sphere intersection solutions but could also sensibly contain expressions for bodies of different shapes. """ from collections.abc import Callable, Sequence import sympy as sp # sympy symbols for ray-sph...
2.96875
3
videoFeedStuff/UDPRecieverTest.py
mattwalstra/2019RobotCode
4
12790805
<reponame>mattwalstra/2019RobotCode<filename>videoFeedStuff/UDPRecieverTest.py import socket import cv2 UDP_IP = "127.0.0.1" UDP_PORT = 5005 sock= socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind((UDP_IP,UDP_PORT)) while True: data, addr = sock.recvfrom(1024) print data
2.515625
3
morio/model/__init__.py
wddwycc/morio
0
12790806
from .base import db from .user import User from .repository import Repository from .card import Card from .course import Course from .course_card_progress import CourseCardProgress def init_app(app): db.init_app(app)
1.453125
1
test/default_value_constrct.py
bourne7/demo-python
0
12790807
# Default values are computed once, then re-used. # https://blog.csdn.net/x_r_su/article/details/54730654 class MyList: def __init__(self, init_list=[]): self.list = init_list print(id(init_list)) def add(self, ele): self.list.append(ele) def appender(ele): # obj = MyList() ...
3.71875
4
001-python-core-language/012_function_pass_by_ref_var_scope.py
CHemaxi/python
0
12790808
## >--- ## >YamlDesc: CONTENT-ARTICLE ## >Title: python functions ## >MetaDescription: python functions, function with parameters, function with return value example code, tutorials ## >MetaKeywords: python functions, function with parameters, function with return value example code, tutorials ## >Author: Hemaxi ## >Co...
3.96875
4
connect_four/agents/dfpn_build_db.py
rpachauri/connect4
0
12790809
import gym import time from connect_four.agents import DFPN from connect_four.agents import difficult_connect_four_positions from connect_four.evaluation.victor.victor_evaluator import Victor from connect_four.hashing import ConnectFourHasher from connect_four.transposition.sqlite_transposition_table import SQLiteTra...
2.140625
2
inst/python/python_predict.py
cynthiayang525/PatientLevelPrediction
141
12790810
<reponame>cynthiayang525/PatientLevelPrediction<gh_stars>100-1000 # apply random forest model on new data #=============================================================== # INPUT: # 1) location of new data # 2) location of model # # OUTPUT: # it returns a file with indexes merged with prediction for test index - name...
2.484375
2
mapillary-tools/interpolate_with_anchors.py
mgottholsen/cynefin
0
12790811
#!/usr/bin/env python import datetime from lib.geo import interpolate_lat_lon, compute_bearing, offset_bearing from lib.sequence import Sequence import lib.io import os import sys from lib.exifedit import ExifEdit def interpolate_with_anchors(anchors, angle_offset): ''' Interpolate gps position and compass an...
2.859375
3
awstosrt.py
asulibraries/AwsTranscribe
0
12790812
<reponame>asulibraries/AwsTranscribe<gh_stars>0 import re import sys import json import logging from datetime import timedelta import srt import webvtt log = logging.getLogger(__name__) log.addHandler(logging.StreamHandler()) log.setLevel(logging.DEBUG) sys.path.append("/home/ubuntu/.local/lib/python3.6/site-package...
2.921875
3
tests/from_file_multiple_calls_mismatch/test_mock_server_from_file_multiple_calls_mismatch.py
icanbwell/mockserver_client
0
12790813
from glob import glob from pathlib import Path from typing import List, Any, Dict import pytest import requests import json from requests import Response from mockserver_client.exceptions.mock_server_expectation_not_found_exception import ( MockServerExpectationNotFoundException, ) from mockserver_client.excepti...
2.21875
2
src/updater.py
vincent-lg/cocomud
3
12790814
# Copyright (c) 2016-2020, <NAME> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the fo...
1.335938
1
src/epc_exporter/collector/port_utilization_table.py
cisco-cx/epc_exporter
0
12790815
<reponame>cisco-cx/epc_exporter """ Collects show port utilization table command and parses it """ from prometheus_client import REGISTRY from prometheus_client.metrics_core import GaugeMetricFamily from collector.abstract_command_collector import AbstractCommandCollector from device import AbstractDevice class Por...
2.5625
3
src/apps/trainings/managers/network_pandas_queryset.py
sanderland/katago-server
27
12790816
from django.db.models import QuerySet class NetworkPandasQuerySet(QuerySet): pass
1.351563
1
kinetic_model_construction_and_analysis/src/tests/test_process_simulations.py
svevol/accoa_project_data_analysis
0
12790817
<reponame>svevol/accoa_project_data_analysis<filename>kinetic_model_construction_and_analysis/src/tests/test_process_simulations.py<gh_stars>0 import os import unittest import scipy.io from src.data.process_simulations import get_time_series_quantiles from src.data.import_simulations import gather_sim_data, get_met_rx...
1.960938
2
test/moves/test_acrobatics.py
adacker10/showdown
8
12790818
import unittest from sim.battle import Battle from data import dex class TestAcrobatics(unittest.TestCase): def test_acrobatics(self): b = Battle(debug=False, rng=False) b.join(0, [{'species': 'charmander', 'moves': ['tackle']}]) b.join(1, [{'species': 'pidgey', 'moves': ['acrobati...
2.671875
3
hic3defdr/util/lrt.py
thomasgilgenast/hic3defdr
0
12790819
<gh_stars>0 import numpy as np import scipy.stats as stats from hic3defdr.util.scaled_nb import logpmf, fit_mu_hat def lrt(raw, f, disp, design, refit_mu=True): """ Performs a likelihood ratio test on raw data ``raw`` given scaling factors ``f`` and dispersion ``disp``. Parameters ---------- ...
2.484375
2
multitask_lightning/losses/loss.py
heyoh-app/gestures-detector
8
12790820
from .keypoint_losses import KpointFocalLoss from .aux_losses import RegrLoss, MaskedFocal def get_loss(loss): loss_name = loss["name"] params = loss["params"] if loss_name == "kpoint_focal": loss = KpointFocalLoss(**params) elif loss_name == "masked_focal": loss = MaskedFocal() e...
2.4375
2
server/githubsrm/apis/urls.py
Aradhya-Tripathi/githubsrm
1
12790821
from django.urls import path from .open_views import ( Contributor, Maintainer, HealthCheck, Team, ContactUs ) urlpatterns = [ path('contributor', Contributor.as_view()), path('maintainer', Maintainer.as_view()), path('healthcheck', HealthCheck.as_view()), path('team', Team.as_view()), path('c...
1.625
2
pdf4me/Pdf4mePythonClientApi/pdf4me/helper/custom_http.py
pdf4me/pdf4me-clientapi-python
1
12790822
import requests from pdf4me.helper.json_converter import JsonConverter from pdf4me.helper.pdf4me_exceptions import Pdf4meClientException, Pdf4meBackendException from pdf4me.helper.response_checker import ResponseChecker # from pdf4me.helper.token_generator import TokenGenerator class CustomHttp(object): def __...
2.65625
3
0282.Expression Add Operators/solution.py
zhlinh/leetcode
0
12790823
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: <EMAIL> Version: 0.0.1 Created Time: 2016-05-09 Last_modify: 2016-05-09 ****************************************** ''' ''' Given a string that contains only digits 0-9 and a ta...
4.15625
4
tests/fixtures.py
jsam/datagears
3
12790824
<gh_stars>1-10 from typing import Any, TypeVar, Union T = TypeVar("T") Fixture = Union[Any, T]
1.664063
2
api/src/wt/http_api/_common.py
sedlar/work-tracking
0
12790825
<gh_stars>0 from functools import wraps from wt.common.errors import ObjectDoesNotExist, BadRequest def get_error_response(ex): return { "code": ex.error_code.value, "message": ex.message } def handle_errors(func): @wraps(func) def wrapper(*args, **kwargs): try: ...
2.25
2
SubGNN/train_config.py
thomasly/SubGNN
1
12790826
# General import numpy as np import random import argparse import json import commentjson import joblib import os import pathlib from collections import OrderedDict # Pytorch import torch import pytorch_lightning as pl from pytorch_lightning.loggers import TensorBoardLogger from pytorch_lightning.callbacks import Mode...
2.1875
2
bangpy-ops/ops/sum/sum.py
testouya/mlu-ops
0
12790827
<filename>bangpy-ops/ops/sum/sum.py<gh_stars>0 # Copyright (C) [2021] by Cambricon, Inc. # # 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 ...
1.789063
2
normalTest/main.py
ForrestHeiYing/tutorials
0
12790828
<reponame>ForrestHeiYing/tutorials<gh_stars>0 #!usr/bin/env python # _*_ coding:utf-8 _*_ """ @author:chaowei @file: main.py @time: 2019/07/18 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function # from matplotlib import pyplot import numpy as np import time...
2.59375
3
initial/initial_1.py
mhasan13-here/phase-plane-torch
0
12790829
<filename>initial/initial_1.py # -*- coding: utf-8 -*- """ Created on Sun Oct 17 01:42:08 2021 @author: mhasan13 using exmaple from https://github.com/Intelligent-Computing-Lab-Yale/BNTT-Batch-Normalization-Through-Time/blob/main/model.py """ import torch import torch.nn as nn import torch.nn.functional as F import...
2.359375
2
logic2_analyzers/TI TCA6408A/pd.py
martonmiklos/sigrokdecoders_to_logic2_analyzers
5
12790830
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 <NAME> <<EMAIL>> ## Copyright (C) 2013 <NAME> <<EMAIL>> ## Copyright (C) 2014 alberink <<EMAIL>> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as publishe...
2.21875
2
pluto/coms/controller.py
chalant/pluto
0
12790831
<reponame>chalant/pluto import uuid import grpc from zipline.finance.execution import MarketOrder, StopLimitOrder, StopOrder, LimitOrder from protos import controller_service_pb2 as ctl, controllable_service_pb2_grpc as cbl_rpc, \ controllable_service_pb2 as cbl, broker_pb2_grpc as broker_rpc, broker_pb2 as br_m...
1.84375
2
sgnlp/models/emotion_entailment/train.py
raymondng76/sgnlp
14
12790832
import math import pandas as pd from transformers import Trainer, TrainingArguments from .config import RecconEmotionEntailmentConfig from .data_class import RecconEmotionEntailmentArguments from .modeling import RecconEmotionEntailmentModel from .tokenization import RecconEmotionEntailmentTokenizer from .utils impor...
2.625
3
M2-Recession/M2SL_recession.py
Icosahedral-Dice/FE
0
12790833
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 16 18:49:46 2021 @author: wanderer """ ### Housekeeping ### import pandas as pd import pandas_datareader.data as web import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.ticker as mticker import seaborn as sns sns.set_style(...
2.40625
2
postgres-debezium-ksql-elasticsearch/python_kafka_notify.py
alonsoir/examples-2
1,150
12790834
<reponame>alonsoir/examples-2<gh_stars>1000+ # rmoff / 13 Jun 2018 from slackclient import SlackClient from confluent_kafka import Consumer, KafkaError import json import time import os,sys token = os.environ.get('SLACK_API_TOKEN') if token is None: print('\n\n*******\nYou need to set your Slack API token in the SLAC...
2.625
3
Computing Class Test 1/Jerick_FE03.py
granwyntan/Python-Notes
0
12790835
def maxScore(fe): FE = {'o': 100, 'e': 10, 'g': 1, 'a': 0, 'b': -1, 'i': -10, 'u': -100} final=[] count=len(fe) for a in range(0,count): temp = 0 for d in fe[a:]: temp += int(FE[d]) print(d) final...
3.34375
3
src/__init__.py
Irreq/deer-assistant
0
12790836
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File name: __init__.py # Description: Basic format for Python scripts # Author: irreq (<EMAIL>) # Date: 17/12/2021 """Documentation"""
1.164063
1
scoreboard.py
cstuller/alieninvasion
0
12790837
<filename>scoreboard.py import pygame.font from pygame.sprite import Group from ship import Ship class Scoreboard(): '''a class to report scoring information''' def __init__(self, ai_settings, screen, stats): '''initialize scorekeeping attributes''' self.screen = screen self....
3.515625
4
tests/test_forward_backward_tracking.py
Megscammell/Estimating-Direction
0
12790838
import numpy as np import est_dir def test_1(): """ Test for compute_forward() - check for flag=True. """ np.random.seed(90) m = 10 f = est_dir.quad_f_noise const_back = 0.5 const_forward = (1 / const_back) minimizer = np.ones((m,)) centre_point = np.random.unif...
2.171875
2
postreview/admin.py
harshiljhaveri/unicode-website
16
12790839
<reponame>harshiljhaveri/unicode-website from django.contrib import admin from .models import Review admin.site.register(Review)
0.90625
1
creator/child_views/gender_tab.py
Jerakin/FakemonCreator
4
12790840
import logging as log from PyQt5 import QtWidgets, uic from PyQt5.QtCore import Qt from creator.utils import util from creator.child_views import shared from creator.child_views import list_view GENDERLESS = 0 MALE = 1 FEMALE = 2 class GenderTab(QtWidgets.QWidget, shared.Tab): def __init__(self, data): ...
2.21875
2
App/Server/ChartData.py
sujoy-coder/CFC-2020
1
12790841
<reponame>sujoy-coder/CFC-2020 # This Function formating the data to plot in Line Chart ... def get_LineChartData(date_time,actualPower): lineChartData = [] for i,j in zip(date_time,actualPower): lineChartData.append(list((i,j))) return lineChartData # This Function formating the data to plot i...
3.375
3
alipay/aop/api/response/AlipayEcoDoctemplateSettingurlQueryResponse.py
antopen/alipay-sdk-python-all
213
12790842
<filename>alipay/aop/api/response/AlipayEcoDoctemplateSettingurlQueryResponse.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayEcoDoctemplateSettingurlQueryResponse(AlipayResponse): def __init__(self): super(Alipay...
2.171875
2
cpovc_registry/templatetags/app_class.py
Rebeccacheptoek/cpims-ovc-3.0
3
12790843
<reponame>Rebeccacheptoek/cpims-ovc-3.0<gh_stars>1-10 from django import template register = template.Library() @register.filter(name='get_class') def get_class(value, args): if value == args: return 'active' else: split_vals = value.split('/') if split_vals[1] == args: ...
1.953125
2
ponyconf/management/commands/squashemails.py
JulienPalard/PonyConf
11
12790844
<reponame>JulienPalard/PonyConf<gh_stars>10-100 from django.core.management.base import BaseCommand from accounts.models import User class Command(BaseCommand): help = 'Squash all users email' def handle(self, *args, **options): answer = input("""You are about to squash all users email. This action i...
2.421875
2
starfish/test/full_pipelines/cli/test_iss.py
ttung/starfish
0
12790845
""" Notes ----- This test and docs/source/usage/iss/iss_cli.sh test the same code paths and should be updated together """ import os import unittest import numpy as np import pandas as pd import pytest from starfish.test.full_pipelines.cli._base_cli_test import CLITest from starfish.types import Features EXPERIMENT...
1.953125
2
gym_idsgame/agents/training_agents/q_learning/dqn/dqn.py
FredericoNesti/gym-idsgame
15
12790846
<filename>gym_idsgame/agents/training_agents/q_learning/dqn/dqn.py """ An agent for the IDSGameEnv that implements the DQN algorithm. """ from typing import Union import numpy as np import time import tqdm import torch from torch.utils.tensorboard import SummaryWriter from gym_idsgame.envs.rendering.video.idsgame_monit...
2.328125
2
setup.py
helloqiu/SillyServer
0
12790847
# !/usr/bin/env python # coding=utf-8 from setuptools import setup, find_packages import SillyServer setup( name="SillyServer", version=SillyServer.__VERSION__, author=SillyServer.__AUTHOR__, url=SillyServer.__URL__, license=SillyServer.__LICENSE__, packages=find_packages(), description="A...
1.0625
1
test/manual/annotations/test_list_annotations.py
membranepotential/mendeley-python-sdk
103
12790848
<reponame>membranepotential/mendeley-python-sdk<filename>test/manual/annotations/test_list_annotations.py from test import get_user_session, cassette, sleep from test.resources.documents import create_document, delete_all_documents def test_should_list_annotations(): session = get_user_session() delete_all_do...
2.328125
2
app/hive_sbi_api/v1/filters.py
josephsavage/hive-sbi-api
0
12790849
from django_filters import rest_framework as filters from hive_sbi_api.core.models import Transaction class TransactionFilter(filters.FilterSet): account = filters.CharFilter( field_name='account__account', label='account', ) sponsor = filters.CharFilter( field_name='sponsor__acc...
2.046875
2
applications/tensorflow2/image_classification/custom_exceptions.py
payoto/graphcore_examples
260
12790850
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. class UnsupportedFormat(TypeError): pass class DimensionError(ValueError): pass class MissingArgumentException(ValueError): pass class InvalidPrecisionException(NameError): pass class UnallowedConfigurationError(ValueError): pass
1.75
2