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
swim_backend/events.py
eurocontrol-swim/swim-backend
0
24800
<reponame>eurocontrol-swim/swim-backend<filename>swim_backend/events.py """ Copyright 2019 EUROCONTROL ========================================== Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source...
1.367188
1
src/ama/validator.py
sffjunkie/ama
1
24801
<filename>src/ama/validator.py<gh_stars>1-10 # Copyright 2013-2014, <NAME>, <EMAIL> # pylint: disable=unused-argument """Provides access to a registry of validation functions. Functions are returned via the :func:`get_validator` function and can be refined by passing a specification which alters what passes the valid...
2.5
2
Thirdparty/libcurl/build.py
reven86/dava.engine
5
24802
<gh_stars>1-10 import os import shutil import build_utils def get_supported_targets(platform): if platform == 'win32': return ['win32', 'win10'] elif platform == 'darwin': return ['macos', 'ios', 'android'] elif platform == 'linux': return ['android', 'linux'] else: ret...
2.171875
2
tests/test_schnell.py
damonge/SNELL
2
24803
<filename>tests/test_schnell.py import healpy as hp import numpy as np from schnell import MapCalculator, GroundDetector, LISADetector # Detectors det1 = GroundDetector('Hanford', 46.4, -119.4, 90-171.8, 'plots/data/aLIGO_design.txt') det2 = GroundDetector('Livingstone', 30.7, -90.8, 90-243...
2.109375
2
bittensor/wallet.py
il-dar/bittensor
0
24804
# The MIT License (MIT) # Copyright © 2021 Opentensor.ai # 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,...
1.671875
2
build_data/data_partitions.py
zkurtz/kaggle_malware_2019
0
24805
<filename>build_data/data_partitions.py<gh_stars>0 ''' Split the training data into subsets for cross validation, sample from the testing data, etc. ''' from feather import read_dataframe as read_feather import numpy as np import pdb from zpylib import data_path as dp from zpylib import datatools from zpylib import N...
2.40625
2
tests/integration/application/test_attribute_server_and_client.py
microprediction/predictionserver
1
24806
<filename>tests/integration/application/test_attribute_server_and_client.py from predictionserver.clientmixins.attributereader import ( AttributeReader, AttributeType, AttributeGranularity ) from predictionserver.set_config import MICRO_TEST_CONFIG from predictionserver.servermixins.attributeserver import Attribute...
2.078125
2
aiokraken/utils/tests/test_timeindexeddataframe.py
asmodehn/aiokraken
0
24807
import unittest from datetime import datetime, timezone from pandas import DatetimeTZDtype from parameterized import parameterized import pandas as pd from aiokraken.utils.timeindexeddataframe import TimeindexedDataframe """ Test module. This is intended for extensive testing, using parameterized, hypothesis or simi...
2.703125
3
app/models/admin.py
ShuaiGao/mini-shop-server
0
24808
<gh_stars>0 # _*_ coding: utf-8 _*_ """ Created by Allen7D on 2018/6/16. """ import os.path as op from flask_admin import Admin, BaseView, expose from flask import render_template, redirect, url_for from flask_admin.contrib.sqla import ModelView from flask_admin.contrib.fileadmin import FileAdmin from flask_admin imp...
2.203125
2
MKCommand.py
the-snowwhite/Machinekit-Workbench
8
24809
<reponame>the-snowwhite/Machinekit-Workbench # Classes implementing the different commands that can be sent to MK # The implemented classes do not cover the complete functional set of MK # but are what is required to implement a basic UI. import enum import machinetalk.protobuf.message_pb2 as MESSAGE import machinetal...
2.546875
3
src/testing/TestON/bin/nec.py
securedataplane/preacher
1
24810
<reponame>securedataplane/preacher class NEC: def __init__( self ): self.prompt = '(.*)' self.timeout = 60 def show(self, *options, **def_args ): '''Possible Options :[' access-filter ', ' accounting ', ' acknowledgments ', ' auto-config ', ' axrp ', ' cfm ', ' channel-grou...
2.21875
2
main.py
StewartNZ/OpenCVPython_ObjectDectection_Tut_1
0
24811
<gh_stars>0 import cv2 threshold = 0.5 # Threshold to detect objects cap = cv2.VideoCapture(0) cap.set(3, 640) cap.set(4, 480) classNames = [] classFile = "coco.names" with open(classFile, "rt") as f: classNames = f.read().rstrip("\n").split("\n") configPath = "ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt" weig...
2.375
2
custom_functions.py
JacopoMalatesta/letterboxd_30000
0
24812
#!/usr/bin/env python # coding: utf-8 # In[1]: from bs4 import BeautifulSoup import re import json import numpy as np import sys sys.setrecursionlimit(10000) # Write a function that parses HTML pages into BeautifulSoup objects # In[2]: def soupify(html): soup = BeautifulSoup(html, 'lxml') return soup ...
3.03125
3
girder/molecules/molecules/models/geometry.py
bnmajor/mongochemserver
14
24813
<gh_stars>10-100 from bson.objectid import ObjectId from girder.models.model_base import AccessControlledModel from girder.constants import AccessType from molecules.models.molecule import Molecule as MoleculeModel from molecules.utilities.get_cjson_energy import get_cjson_energy from molecules.utilities.pagination i...
2.296875
2
GearC/material.py
cfernandesFEUP/Gear-Calculation
3
24814
<gh_stars>1-10 ## LIBRARY OF MATERIALS ####################################################### def matp(mat, Tbulk, NL): import numpy as np E, v, cpg, kg, rohg, sigmaHlim, sigmaFlim = [np.zeros(2) for _ in range(7)] for i in range(len(E)): if mat[i] == 'POM': E[i] = 3.2e9 # ...
1.976563
2
crawler/browser/javascript.py
CvvT/crawler_sqlmap
9
24815
<reponame>CvvT/crawler_sqlmap #! /usr/bin/env python # -*- coding: utf-8 -*- # __author__ = 'CwT' # document.body.innerHTML += '<form id="dynForm" action="http://example.com/" method="post"> # <input type="hidden" name="q" value="a"></form>'; # document.getElementById("dynForm").submit(); POST_JS = '<form id=\\"dyna...
2.65625
3
vtpl_api/models/engine_task.py
vtpl1/vtpl_api
0
24816
# coding: utf-8 """ Engine api Engine APIs # noqa: E501 The version of the OpenAPI document: 1.0.4 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class EngineTask(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref:...
1.820313
2
scripts/05_skew.py
fabiobaccarin/allstate-loss
0
24817
""" Analyses skewness for continuous features Options: A. Log B. Yeo-Johnson C. QuantileTransformer """ import json import pandas as pd import numpy as np from sklearn.pipeline import make_pipeline from sklearn.preprocessing import power_transform, quantile_transform from pathlib import Path p = Path(__f...
2.625
3
trakt/mapper/sync.py
ruinernin/trakt.py
0
24818
<gh_stars>0 from __future__ import absolute_import, division, print_function from trakt.mapper.core.base import Mapper import logging log = logging.getLogger(__name__) class SyncMapper(Mapper): @classmethod def process(cls, client, store, items, media=None, flat=False, **kwargs): if flat: ...
2.203125
2
src/murus_gallicus/constants.py
HicBoux/PyMurusGallicus
0
24819
import pygame pygame.init() FPS = 60 WIDTH, HEIGHT = 800, 700 ROWS, COLS = 7, 8 SQUARE_SIZE = HEIGHT//ROWS # GRAPHICAL USER INTERFACE ICON_PATH = './src/murus_gallicus/assets/noun_checkers_1684698.png' WINDOW = pygame.display.set_mode((WIDTH, HEIGHT)) PADDING = 20 OUTLINE = 2 # RGB COLORS RED = (255, 0, 0) WHITE = ...
2.953125
3
streamer/output_stream.py
meryacine/shaka-streamer
154
24820
<gh_stars>100-1000 # Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
2.3125
2
nghp/misc/utils.py
squoilin/NewGenerationHeatPumps
1
24821
<reponame>squoilin/NewGenerationHeatPumps # -*- coding: utf-8 -*- """ Useful functions for the Next Generation Heat Pump library @author: <NAME> """ import sys,os class NoStdStreams(object): ''' This class hides the std output of the executed function usage: with NoStdStreams() pass ...
2.34375
2
regex_2.py
python-pro/Learn-Python-by-Doing-by-Jose-Espanol
0
24822
<filename>regex_2.py # B_R_R # M_S_A_W """ Coding Problem on Regular expressions: In order to work with regular expressions or we can say regex too, we have to import its module which is called re Specifically we use search method of regex library search method returns match object if it finds any """ import r...
3.421875
3
deepchem/data/tests/test_shape.py
deloragaskins/deepchem
3,782
24823
import deepchem as dc import numpy as np import os def test_numpy_dataset_get_shape(): """Test that get_shape works for numpy datasets.""" num_datapoints = 100 num_features = 10 num_tasks = 10 # Generate data X = np.random.rand(num_datapoints, num_features) y = np.random.randint(2, size=(num_datapoints,...
2.671875
3
docs/hydrostatic-pressure/hydrostatic_pressure.py
TOKU-Systems/tutorials
0
24824
<filename>docs/hydrostatic-pressure/hydrostatic_pressure.py import pandas as pd df = pd.read_sql( ''' SELECT a.name, h.name, s.name, sd.t, sd.y FROM assets a JOIN hardpoints h ON a.id = h.asset_id JOIN signals s ON h.id = s.hardpoint_id JOIN LATERAL ( SELECT x.t, x.y FROM signa...
3.03125
3
3-data-hiding-1.py
Otumian-empire/My-PyClasses
0
24825
# data hiding - encapsulation # this can be achieve by making the attribute or method private # python doesn't have private keyword so precede # the attribute/method identifier with an underscore or a double # this is more effective if object in import or used as a module # it isn't that effective # no underscore = pu...
3.359375
3
lib/googlecloudsdk/core/util/text.py
kustodian/google-cloud-sdk
2
24826
# -*- coding: utf-8 -*- # # Copyright 2015 Google LLC. 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 requir...
2.875
3
for_fun/mul_and_div/mul_and_div.py
trisct/Software-Tutorials
2
24827
import time a = 3215.35127 b = 3. start = time.time() for i in range(100000000): c = a / b end = time.time() time_elapsed = end - start print('Time elapsed (div ver) = %.5f' % time_elapsed) a = 3215.35127 b = 1./3. start = time.time() for i in range(100000000): c = a * b end = time.time() time_elapsed = end...
3.421875
3
src/oci/apigateway/models/execution_log_policy.py
Manny27nyc/oci-python-sdk
249
24828
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
1.859375
2
Processing sketches/Line Stitching/star_mesh/star_mesh.pyde
nicoprocessor/Digital-Art-Collection
0
24829
<filename>Processing sketches/Line Stitching/star_mesh/star_mesh.pyde import math lines = 30 radius_x = 550 radius_y = 550 axes = 20 def frange(start, stop, step): while start < stop: yield start start += step def setup(): size(1080, 2160) background(51) ellipseMode(RADIUS) stroke(...
2.859375
3
venv/Lib/site-packages/plotnine/geoms/geom_col.py
EkremBayar/bayar
0
24830
<filename>venv/Lib/site-packages/plotnine/geoms/geom_col.py from ..doctools import document from .geom_bar import geom_bar @document class geom_col(geom_bar): """ Bar plot with base on the x-axis This is an alternate version of :class:`geom_bar` that maps the height of bars to an existing variable in...
3.1875
3
my_app/admin.py
gh-8/FullSend-List
1
24831
from django.contrib import admin from .models import Search # Register your models here. admin.site.register(Search)
1.257813
1
utils.py
SeoulTech-HCIRLab/ChannelAug
3
24832
# <NAME> # Institute of Mechatronic Systems # Leibniz Universität Hannover, Germany # 2019 # Code From https://github.com/mlaves/bayesian-temperature-scaling import torch __all__ = ['accuracy', 'kl_loss', 'nentr', 'xavier_normal_init'] def accuracy(input, target): _, max_indices = torch.max(input.data, 1) ac...
2.609375
3
typotools.py
peczony/chgksuite
3
24833
<filename>typotools.py #!usr/bin/env python #! -*- coding: utf-8 -*- from __future__ import unicode_literals import re import traceback import urllib import pprint OPENING_QUOTES = set(['«', '„', '“']) CLOSING_QUOTES = set(['»', '“', '”']) QUOTES = OPENING_QUOTES | CLOSING_QUOTES | set(['"', "'"]) WHITESPACE = set([' ...
2.59375
3
src/test_evader.py
zacespinosa/homicidal_chauffeur
0
24834
<reponame>zacespinosa/homicidal_chauffeur import random as random import numpy as np from dynamics import Simulator, Pursuer, Evader def test_evader(): num_d_states = 25 num_phi_states = 20 num_phi_d_states = 20 num_actions = 10 num_states = num_d_states*num_phi_states*num_phi_d_states num_epochs = 1000 p = P...
2.859375
3
tests/testing_drive.py
alexzanderr/_core-dev
0
24835
import unittest from core.drive import copy from core.aesthetics import * class TestingDrivepy(unittest.TestCase): def test_copy_function(self): source_tests = [ r"D:\Alexzander__\programming\python\Python2Executable", r"D:\Alexzander__\programming\python\byzantion", ...
2.609375
3
app/routes.py
apigram/HospitalWaiterAuthService
0
24836
from app import app from flask_restful import Api from app.resources.auth import TokenResource api = Api(app) # Token resource api.add_resource(TokenResource, '/authservice/token', endpoint='auth_token')
2.140625
2
rioxarray/rioxarray.py
jhamman/rioxarray
0
24837
<filename>rioxarray/rioxarray.py # -- coding: utf-8 -- """ This module is an extension for xarray to provide rasterio capabilities to xarray datasets/dataarrays. Credits: The `reproject` functionality was adopted from https://github.com/opendatacube/datacube-core # noqa Source file: - https://github.com/opendatacube/...
2.0625
2
src/the_teleop/test_popout.py
NuenoB/TheTeleop
0
24838
#! /usr/bin/env python import os import rospy import rospkg from readbag import restore from qt_gui.plugin import Plugin from python_qt_binding.QtCore import Qt from python_qt_binding import loadUi from python_qt_binding.QtGui import QFileDialog, QGraphicsView, QIcon, QWidget from PyQt4 import QtGui, QtCore from exam...
2.09375
2
_km.py
rajesh-lab/Inverse-Weighted-Survival-Games
7
24839
import models import os import copy import torch import torch.nn as nn from lifelines import KaplanMeierFitter as KMFitter import pycox import numpy as np # local import catdist import data_utils import _concordance import _nll import _saver def str_to_bool(arg): """Convert an argument string into its boolean val...
2.203125
2
active/setup.py
jordan-schneider/value-alignment-verification
0
24840
from distutils.core import setup from pathlib import Path # TODO(joschnei): Add typing info setup( name="active", version="0.1", packages=["active",], install_requires=[ "scipy", "numpy", "driver @ git+https://github.com/jordan-schneider/driver-env.git#egg=driver", ], p...
1.164063
1
macgraph/input/print_gqa.py
vinamramattoo/gqa-node-properties
0
24841
import tableprint from collections import Counter from .args import * from .util import * if __name__ == "__main__": args = get_args() output_classes = Counter() question_types = Counter() with tableprint.TableContext(headers=["Type", "Question", "Answer"], width=[40,50,15]) as t: for i in read_gqa(args):...
2.9375
3
kaldi_tflite/lib/layers/tdnn/tdnn.py
ishine/kaldi-tflite
0
24842
#!/usr/bin/env python3 # Copyright (2021-) <NAME> <<EMAIL>> # # 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 applicab...
2.296875
2
Python/1 pengenalan python/2 komentar dan operasi matematika/6 kesimpulan.py
ekovegeance-com/tree
3
24843
# Instruksi: # Buatlah komentar di garis pertama, # Buat variabel bernama jumlah_pacar yang isinya angka (bukan desimal), # Buat variabel bernama lagi_galau yang isinya boolean, # Buat variabel dengan nama terserah anda dan gunakan salah satu dari operator matematika yang telah kita pelajari. #variabel untuk menyimpan...
2.5625
3
04/py/q2.py
RussellDash332/practice-makes-perfect
2
24844
<gh_stars>1-10 print((lambda x: lambda y: 2*x)(3)(4))
1.757813
2
authusers/views.py
JoyMbugua/auth-app
0
24845
from django.shortcuts import render from rest_framework.response import Response from rest_framework.views import APIView from rest_framework import status, permissions import pyotp import base64 from rest_framework_simplejwt.tokens import RefreshToken from .serializers import CustomUserSerializer from .models import ...
2.203125
2
atom3d/util/formats.py
bfabiandev/atom3d
0
24846
<gh_stars>0 """Methods to convert between different file formats.""" import collections as col import gzip import os import re import Bio.PDB.Atom import Bio.PDB.Chain import Bio.PDB.Model import Bio.PDB.Residue import Bio.PDB.Structure import numpy as np import pandas as pd # -- MANIPULATING DATAFRAMES -- def spl...
2.875
3
py_basic/acc_in.py
M1NH42/py
0
24847
# About: Implementation of the accumulator program # in python 3 specialization # ask to enter string phrase = input("Enter a string: ") # initialize total variable with zero tot = 0 # iterate through the string for char in phrase : if char != " " : tot += 1 # print the result print(tot)
4.0625
4
general/hash_algo.py
RakeshRam/algorithm-python
0
24848
<filename>general/hash_algo.py class MapHash: def __init__(self, maxsize=6): self.maxsize = maxsize # Real scenario 64. self.hash = [None] * self.maxsize # Will be a 2D list def _get_hash_key(self, key): hash = sum(ord(k) for k in key) return hash % self.maxsize...
3.765625
4
args.py
fang1fan/m5-python-starter
1
24849
import argparse parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--d_model', type=int, default=0, help='d_model') parser.add_argument('--d_head', type=int, default=2, help='head') parser.add_argument('--d_inner', type=bool, default=True, help='inner lay...
2.46875
2
maxblog/apps/posts/forms.py
masich/maxblog
0
24850
<gh_stars>0 from django.forms import forms, ModelForm from .models import Comment, Post class CommentForm(ModelForm): class Meta: model = Comment fields = ['author_name', 'text'] labels = { 'author_name': '<NAME>', 'text': 'Comment' } class PostForm(Model...
2.265625
2
core/gdrn_selfocc_modeling/tools/dataset_utils.py
4PiR2/SO-Pose
32
24851
<filename>core/gdrn_selfocc_modeling/tools/dataset_utils.py<gh_stars>10-100 import copy import logging import numpy as np import operator import pickle import random import mmcv import torch import torch.multiprocessing as mp import torch.utils.data as data from torch.utils.data import dataloader from detectron2.utils...
1.914063
2
tests/settings.py
tanjibpa/django-coconut
0
24852
<reponame>tanjibpa/django-coconut<filename>tests/settings.py # -*- coding: utf-8 -*- # # django-coconuts # Copyright (c) 2008-2017, <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: # # 1...
1.265625
1
models/oomusic_transcoder.py
nicolasmartinelli/oomusic
4
24853
<gh_stars>1-10 # -*- coding: utf-8 -*- import datetime import os import subprocess from odoo import fields, models from odoo.tools import OrderedSet class MusicTranscoder(models.Model): _name = "oomusic.transcoder" _description = "Music Transcoder" _order = "sequence" name = fields.Char("Transcoder...
2.4375
2
Chapter04/CNN_1.py
PacktPublishing/Practical-Convolutional-Neural-Networks
23
24854
#Refer AlexNet implementation code, returns last fully connected layer fc7 = AlexNet(resized, feature_extract=True) shape = (fc7.get_shape().as_list()[-1], 43) fc8_weight = tf.Variable(tf.truncated_normal(shape, stddev=1e-2)) fc8_b = tf.Variable(tf.zeros(43)) logits = tf.nn.xw_plus_b(fc7, fc8_weight, fc8_b) probs = tf....
2.625
3
sexyhotel/venv/Scripts/django-admin.py
JesseChanCN/sexyHotel
0
24855
<reponame>JesseChanCN/sexyHotel<gh_stars>0 #!C:\Users\Administrator\Desktop\装饰器代码\venv\Scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
1.007813
1
fuzz.py
codebyzen/smart-url-fuzzer
38
24856
import logging import sys import os from logging.handlers import RotatingFileHandler from multiprocessing.pool import ThreadPool from optparse import OptionParser import requests from requests.packages import urllib3 urllib3.disable_warnings() # Workers configurations ASYNC_WORKERS_COUNT = 100 # How many threads wi...
2.5
2
models/cells/PC2018Zang/Purkinje.py
HarshKhilawala/cerebmodels
0
24857
#Template of the Purkinje cell model, Zang et al. 2018 #Templating by Lungsi 2019 based on ~/PC2018Zang/purkinje.hoc #purkinje.hoc has been converted from original purkinje_demo and using readme.html as a guide from neuron import h #from pdb import set_trace as breakpoint from random import randint class Purkinje(obje...
2.140625
2
octoprint_marlin_flasher/validation/validators/arduino.py
thinkyhead/OctoPrint-Marlin-Flasher
1
24858
<filename>octoprint_marlin_flasher/validation/validators/arduino.py<gh_stars>1-10 from flask_babel import gettext from marshmallow import ValidationError import intelhex import zipfile def is_correct_file_type(filename): try: with zipfile.ZipFile(filename, "r") as _: pass except zipfile.BadZipfile: try: i...
2.640625
3
zazu/git_helper.py
stopthatcow/zazu
2
24859
<gh_stars>1-10 # -*- coding: utf-8 -*- """Git functions for zazu.""" import zazu.imports zazu.imports.lazy_import(locals(), [ 'filecmp', 'git', 'os', 'pkg_resources', 'shutil', 'zazu.util', ]) __author__ = '<NAME>' __copyright__ = 'Copyright 2016' def get_repo_root(starting_dir): """Get ...
2.03125
2
Gds/src/fprime_gds/common/data_types/event_data.py
SSteve/fprime
2
24860
""" @brief Class to store data from a specific event @date Created July 2, 2018 @author <NAME> @bug No known bugs """ from fprime.common.models.serialize import time_type from fprime_gds.common.data_types import sys_data class EventData(sys_data.SysData): """ The EventData class stores a specific event mes...
3.125
3
src/Plot.py
xin-huang/dadi-cli
5
24861
<reponame>xin-huang/dadi-cli import dadi, pickle import numpy as np import matplotlib.pyplot as plt fig = plt.figure(figsize=(8,6)) def plot_single_sfs(fs, projections, output, vmin): fs = dadi.Spectrum.from_file(fs) fig = plt.figure(219033) if len(fs.sample_sizes) == 1: if projections ...
2.171875
2
modules/accounts/__init__.py
vladpi/zenmoney-bot
0
24862
from .exports import ( # noqa create_account_from_zenmoney_account, delete_account, get_accounts_by_user, get_user_account_by_id, get_user_account_by_title, update_account_transactions_count, ) from .schemas import AccountModel # noqa from .tables import * # noqa
1.015625
1
akita/metrics.py
michael-lazar/Akita
18
24863
<reponame>michael-lazar/Akita<gh_stars>10-100 import time import logging import threading from collections import Counter _logger = logging.getLogger('akita') class SlidingWindowBase: """ Data structure that keeps track of the total number of events that have occurred in a given time frame. Events are b...
3.28125
3
studentData.py
seanmacb/COMP-115-Exercises
0
24864
Schmoe Joe 12345 90 91 94 87 89 Doe Jane 74836 91 99 82 81 100
0.664063
1
tests/project_creator.py
AlexandrovRoman/Flask-DJ
7
24865
from os.path import exists, join import pytest from flask_dj import startproject from tests.basic_project_creator import ProjectCreate class TestBaseSettingProjectConstructor(ProjectCreate): def setup(self, need_static=False, need_templates=False): super().setup() def test_project_folder_exist(self):...
2.5
2
ACM ICPC/DP/subset_sum problem/subsetSum.py
shreejitverma/GeeksforGeeks
2
24866
<reponame>shreejitverma/GeeksforGeeks def isSubsetSum(arr, n, sum): ''' Returns true if there exists a subset with given sum in arr[] ''' # The value of subset[i%2][j] will be true # if there exists a subset of sum j in # arr[0, 1, ...., i-1] subset = [[False for j in range(sum + 1)] fo...
4.09375
4
models/matching/ffm.py
charlesxu-aicoder/Recommendation-model
0
24867
# -*-coding: utf-8-*- # @Author : Charlesxu # @Email : <EMAIL> from models.matching import * class FFM_Layer(Layer): def __init__(self, dense_feature_columns, sparse_feature_columns, k, w_reg=1e-4, v_reg=1e-4): super(FFM_Layer, self).__init__() self.dense_feature_columns = dense_feature_columns...
2.171875
2
server/apps/authentication/tests.py
krishnasagar14/street_parking
0
24868
from django.test import TestCase from rest_framework.test import APIRequestFactory from .views import LoginView, SignupView from common.tests import USER_DATA, prepare_dummy_user_data # Create your tests here. class ApiViewTests(TestCase): factory = APIRequestFactory() def test_signup(self): user_da...
2.515625
3
build/android/play_services/utils.py
TwistedCore/external_v8
2
24869
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' Utility functions for all things related to manipulating google play services related files. ''' import argparse import filecmp import json import loggi...
2.25
2
tagger/__main__.py
XYlearn/Tagger
0
24870
# -*-coding: utf-8 import sys import argparse from tagger import FileTagger def tagger_add(args): tg = FileTagger() res = tg.add_tags(args.path, *args.tags) if not res: print("[-] Fail to add tags.") def tagger_rm(args): tg = FileTagger() res = tg.rm_tags(args.path, *args.tags) if n...
3.109375
3
lang_vec/langvec_classify.py
cordercorder/NMT
6
24871
<gh_stars>1-10 import numpy as np import argparse import pycountry import lang2vec.lang2vec as l2v from sklearn import preprocessing, linear_model, svm from lang_vec.lang_vec_tools import load_lang_vec from utils.tools import read_data from typing import Dict def get_language_alpha3(language_code: str): if len(la...
2.578125
3
hooks/post_gen_project.py
KernelA/cookiecutter-python
0
24872
import os FILES_TO_REMOVE = ["setup.cfg", "pyproject.toml", "setup.py"] if "{{ cookiecutter.as_package }}" == "no": for file in FILES_TO_REMOVE: os.remove(file) if "{{ cookiecutter.remove_test_script }}" == "yes": os.remove("test_log.py")
2.125
2
register/forms/misc.py
Ajuajmal/heroku
0
24873
from django import forms from crispy_forms.helper import FormHelper class MiscForm(forms.Form): notes = forms.CharField( label='Notes for the registration team', help_text='Anything else you need to describe. ' 'The registration team will see this. ' 'The bursa...
2.328125
2
Practice/script.py
NVombat/WebCam-Motion-Detector
2
24874
#Import libraries import cv2 #Read image file into n dimensional numpy array #Read as greyscale image -> 0, Read as color image w/o transparency -> 1, Read as color image w transparency -> -1 img = cv2.imread("Practice/images/galaxy.jpg", 0) print(type(img)) print(img) #To know the number of rows and columns print(i...
3.875
4
tests/basic/tuple.py
MoonStarCZW/py2rb
0
24875
tup = ('a','b',1,2,3) print(tup[0]) print(tup[1]) print(tup[2]) print(tup[3]) print(tup[4])
2.859375
3
frameworks/Python/aiohttp/app/gunicorn.py
xsoheilalizadeh/FrameworkBenchmarks
5
24876
import asyncio from .main import create_app loop = asyncio.get_event_loop() app = create_app(loop)
1.484375
1
keymap/klc_to_asm.py
MJoergen/x16-rom-floating-point
1
24877
import io, re, codecs, sys, os.path import pprint REG = 0 SHFT = 1 CTRL = 2 ALT = 4 ALTGR = 6 COMPRESSED_OUTPUT=1 def get_kbd_layout(base_filename, load_patch = False): filename_klc = base_filename filename_changes = base_filename + 'patch' f = io.open(filename_klc, mode="r", encoding="utf-8") lines = f.r...
2.53125
3
src_py/testudpvilistus.py
paulharter/biofeed
0
24878
<filename>src_py/testudpvilistus.py import socket,time tcpSock=socket.socket(socket.AF_INET,socket.SOCK_STREAM) print "try connect",tcpSock tcpSock.connect(('169.254.1.1',2000)) print "connected - wait for response" print tcpSock.recv(8) time.sleep(0.1) tcpSock.send("$$$") time.sleep(0.5) print tcpSock.recv(...
2.84375
3
returns/context/requires_context_result.py
MichaelAOlson/returns
1
24879
<reponame>MichaelAOlson/returns from __future__ import annotations from typing import TYPE_CHECKING, Any, Callable, ClassVar, TypeVar from typing_extensions import final from returns.context import NoDeps from returns.interfaces.specific import reader_result from returns.primitives.container import BaseContainer fro...
2.046875
2
save.py
brunnatorino/FEC_app
0
24880
import pandas as pd from gooey import Gooey, GooeyParser import numpy as np import xlsxwriter import xlrd @Gooey(program_name="FEC FILE FOR FRANCE", required_cols= 4,default_size=(710, 700),navigation='TABBED', header_bg_color = '#48a7fa') def parse_args(): parser = GooeyParser() FilesGL = par...
2.828125
3
kits21/annotation/postprocessing.py
bakry230/kits21
0
24881
<gh_stars>0 """Code for turning user delineations into dense segmentations.""" import json import numpy as np import nibabel as nib from PIL import Image, ImageDraw from numpy.core.fromnumeric import cumsum import torch import torch.nn.functional from scipy import signal from skimage import measure import cv2 #pylint...
2.1875
2
Programs/Evernote/PackMemo/PackMemo.py
Psiphonc/EasierLife
203
24882
<filename>Programs/Evernote/PackMemo/PackMemo.py from EvernoteController import EvernoteController from Memo import Memo MEMO_NAME = 'Memo' MEMO_DIR = 'Memo' MEMO_STORAGE_DIR = 'S-Memo' def f(fn, *args, **kwargs): try: fn(*args, **kwargs) except: pass m = Memo() e = EvernoteCont...
2.109375
2
files/build_trigger.py
vexingcodes/vexing.codes-infra
0
24883
import boto3 def handler(event, _): boto3.client('codebuild').start_build( projectName=event['Records'][0]['customData'])
1.78125
2
process/scene/menu.py
Koishilll/pyFuujinrokuDestiny
3
24884
# menu.py # 维护暂停界面 import pygame from pygame.locals import * import sys from utility import globe from process.scene import menu_confirm from PIL import Image, ImageFilter class Pause_Menu(object): # 暂停页面 def __init__(self): self.button_rect = [] self.rs = globe.destiny.rsManager.image ...
2.65625
3
setup.py
LSSTDESC/sn_simulation
0
24885
from setuptools import setup # get the version here pkg_vars = {} with open("version.py") as fp: exec(fp.read(), pkg_vars) setup( name='sn_simulation', version= pkg_vars['__version__'], description='Simulations for supernovae', url='http://github.com/lsstdesc/sn_simulation', author='<NAME>',...
1.515625
2
test/src/testing/universal/uart.py
Jcc99/Adafruit_Blinka
294
24886
<filename>test/src/testing/universal/uart.py import gc from unittest import TestCase from testing import await_true gc.collect() class TestGPSInteractive(TestCase): def test_read_value(self): import adafruit_blinka adafruit_blinka.patch_system() # needed before adafruit_gps imports time ...
2.859375
3
atividade064.py
henrikysena/Atividades_CursosEmVideo_Python
0
24887
"""Exercício Python 64: Crie um programa que leia vários números inteiros pelo teclado. O programa só vai parar quando o usuário digitar o valor 999, que é a condição de parada. No final, mostre quantos números foram digitados e qual foi a soma entre eles (desconsiderando o flag (999)).""" q = 0 s = 0 print('[Digit...
4.09375
4
AutoElectsysConfig.pyw
gousaiyang/AutoElectsys
3
24888
import base64 import contextlib import os import re import sys import tkinter as tk from tkinter import messagebox, ttk from AutoElectsysUtil import (config_file_name, course_rounds, file_read_json, file_read_lines, file_write_json, file_write_lines, first_categories, general_val...
2.203125
2
src/masonite/presets/React.py
cercos/masonite
1,816
24889
<reponame>cercos/masonite """React Preset""" import shutil import os from .Preset import Preset from ..utils.filesystem import make_directory from ..utils.location import resources_path, views_path class React(Preset): """ Configure the front-end scaffolding for the application to use ReactJS Will also ...
2.4375
2
apps/credit_card/models.py
code-yeongyu/backend
1
24890
<filename>apps/credit_card/models.py from django.db import models from django.core.validators import MinLengthValidator from apps.user.models import User from pangpangeats.settings import AUTH_USER_MODEL from apps.common.models import BaseModel from apps.common.validators import numeric_validator class CreditCard(Bas...
2.234375
2
simpleoncall/views.py
simpleoncall/simpleoncall
1
24891
import contextlib import datetime import json import StringIO from django.contrib.auth import logout as logout_user from django.contrib import messages from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponseRedirect, JsonResponse, Http404,...
1.835938
2
scraper/scraper3.py
SebChw/IsMusicANaturalLanguage
0
24892
from bs4 import BeautifulSoup import requests import os """ This script download all songs with given genre from midiworld.com """ genre_name = input( "type in genre name (lowercase, no space, no special characters): ") # Just in case someone don't respect the rules. genre_name = genre_name.lower() genre_name = g...
3.421875
3
imageset-viewer.py
its-jd/imageset-viewer
53
24893
#!/usr/bin/env python # coding: utf-8 __author__ = '<NAME>' __copyright__ = 'Copyright 2017-2020, <NAME>' __license__ = 'MIT' __version__ = '0.5' __email__ = '<EMAIL>' __status__ = 'Development' __description__ = 'Tkinter based GUI, visualizing PASCAL VOC object detection annotation' """ Changelog: - 2020-06-16 11:3...
2.453125
2
erpnext_feature_board/hook_events/review_request.py
akurungadam/erpnext_feature_board
15
24894
<reponame>akurungadam/erpnext_feature_board import frappe def delete_approved_build_requests(): """ Scheduled hook to delete approved Review Requests for changing site deployments. """ approved_build_requests = frappe.get_all( "Review Request", filters={ "request_type": ["in", ["Build", "Upgrade", "Delete...
1.742188
2
DataProcessor/dev_set_partition.py
cherry979988/feedforward-RE
1
24895
__author__ = 'QinyuanYe' import sys import random from shutil import copyfile # split the original train set into # 90% train-set (train_split.json) and 10% dev-set (dev.json) if __name__ == "__main__": random.seed(1234) if len(sys.argv) != 3: print 'Usage:feature_generation.py -DATA -ratio' ...
2.46875
2
NetCatKS/Logger/api/implementers/__init__.py
dimddev/NetCatKS-CP
0
24896
__author__ = 'dimd' from twisted.python import log from zope.interface import implementer from NetCatKS.Logger.api.interfaces import ILogger GLOBAL_DEBUG = True @implementer(ILogger) class Logger(object): def __init__(self): pass def debug(self, msg): if GLOBAL_DEBUG is True: ...
2.171875
2
trustpayments/models/failure_category.py
TrustPayments/python-sdk
2
24897
# coding: utf-8 from enum import Enum, unique @unique class FailureCategory(Enum): TEMPORARY_ISSUE = "TEMPORARY_ISSUE" INTERNAL = "INTERNAL" END_USER = "END_USER" CONFIGURATION = "CONFIGURATION" DEVELOPER = "DEVELOPER"
2.453125
2
func_moead.py
dynamic-sevn/moead_svm
1
24898
<filename>func_moead.py # -*- coding: utf-8 -*- """ Author: <NAME> <<EMAIL>> website: http://www.cs.cityu.edu.hk/~xilin4/ github: This code is a demo for this paper: A Decomposition based Multiobjective Evolutionary Algorithm with Classification <NAME>, <NAME>, <NAME> Proceedings of the...
2.421875
2
videoServer.py
Hugoargui/eyeDetector
0
24899
<filename>videoServer.py<gh_stars>0 ## MIT LICENSE #Copyright (c) 2014 <NAME>. #http://www.hugoargui.com # #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...
1.484375
1