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
python/mergePDFs.py
jbelenag/scripts
0
12774151
<reponame>jbelenag/scripts<filename>python/mergePDFs.py # -*- coding: utf-8 -*- ##################################################### # name: mergePDFs.py # # author: <NAME> # # description: given a root directory, merges # # all the founded .pdf files ...
2.75
3
scripts/varsome_api_annotate_vcf.py
definitelysean/varsome-api-client-python
23
12774152
#!/usr/bin/env python3 # Copyright 2018 <NAME>. # # 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 ag...
2.390625
2
setup.py
kant/4bars
0
12774153
#!/usr/bin/env python from setuptools import setup import subprocess import sys import pkg_resources from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() def get_semantic_version(): gl...
2.046875
2
vectorflow/__init__.py
dongrenguang/VectorFlow
0
12774154
# -*- coding: utf-8 -*- from . import core from . import layer from . import loss from . import metric from . import operator from . import optimizer from . import saver from . import trainer default_graph = core.default_graph
1.148438
1
deepconcolic/training.py
nberth/DeepConcolic
102
12774155
from __future__ import absolute_import, division, print_function, unicode_literals # NB: see head of `datasets.py' from training_utils import * from utils_io import os, tempdir from datasets import image_kinds print ("Using TensorFlow version:", tf.__version__) def train_n_save_classifier (model, class_names, input_k...
2.375
2
mps_database/tools/depricate/export_thresholds.py
slaclab/mps_database
0
12774156
<filename>mps_database/tools/depricate/export_thresholds.py #!/usr/bin/env python from mps_database.mps_config import MPSConfig, models from sqlalchemy import func, exc import sys import argparse # # Sample Device Input (i.e. Digital Channel) record: # # record(bi, "CentralNode:DIGIN0") { # field(DESC, "Test inpu...
2.484375
2
300-/372.py
yshshadow/Leetcode
0
12774157
# Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. # # Example1: # # a = 2 # b = [3] # # Result: 8 # Example2: # # a = 2 # b = [1,0] # # Result: 1024
3.25
3
src/phasestatemachine/_kernel.py
raphaeldeimel/python-phasestatemachine
0
12774158
# -*- coding: utf-8 -*- """ @author: <NAME> @copyright 2017 @licence: 2-clause BSD licence This file contains the main code for the phase-state machine """ import numpy as _np import pandas as _pd import itertools from numba import jit import warnings as _warnings @jit(nopython=True, cache=True) def _limit(a): ...
2.609375
3
mypong2/emanuel.henrique/mypongpygame.py
LUDUSLab/stem-games
2
12774159
import pygame import random pygame.init() COLOR_BLACK = (0, 0, 0) COLOR_WHITE = (255, 255, 255) SCORE_MAX = 10 tn = [1, 2, 3, 4, 5] size = (1280, 720) screen = pygame.display.set_mode(size) pygame.display.set_caption("MyPong - PyGame Edition - 2021.01.30") # score text score_font = pygame.font.Font('C:/Users/Pich...
2.71875
3
members/views/frontend/fsrc_views.py
louking/members
1
12774160
<filename>members/views/frontend/fsrc_views.py ''' fsrc_views - views specific to the <NAME>asers Running Club =========================================================================== ''' # standard from tempfile import TemporaryDirectory from os.path import join as pathjoin from mimetypes import guess_type from sh...
2.109375
2
src/main/python/aut/udfs.py
ruebot/aut
113
12774161
<reponame>ruebot/aut<filename>src/main/python/aut/udfs.py from pyspark import SparkContext from pyspark.sql.column import Column, _to_java_column, _to_seq from pyspark.sql.functions import col def compute_image_size(col): sc = SparkContext.getOrCreate() udf = ( sc.getOrCreate()._jvm.io.archivesunleash...
2.203125
2
imgy/settings.py
claytonbrown/imgy
10
12774162
import os AWS_REGION = os.environ.get('AWS_REGION') BUCKET = "" CACHE_MAX_AGE = 3600 DEFAULT_QUALITY_RATE = 80 LOSSY_IMAGE_FMTS = ('jpg', 'jpeg', 'webp')
1.734375
2
python/paddle/v2/parameters.py
yu239/Paddle
0
12774163
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
2.65625
3
sdk/python/pulumi_cloudflare/access_policy.py
juchom/pulumi-cloudflare
0
12774164
<filename>sdk/python/pulumi_cloudflare/access_policy.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing imp...
1.71875
2
py/30. Substring with Concatenation of All Words.py
longwangjhu/LeetCode
3
12774165
<reponame>longwangjhu/LeetCode # https://leetcode.com/problems/substring-with-concatenation-of-all-words/ # You are given a string s and an array of strings words of the same length. # Return all starting indices of substring(s) in s that is a concatenation of each # word in words exactly once, in any order, and witho...
3.515625
4
deftwit/forms.py
tobias-fyi/deftwit
0
12774166
""" :: deftwit.forms :: A source of truthyness for deftwit wtforms. """ from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, SelectField from wtforms.validators import DataRequired, Length from deftwit.models import DB, User, Tweet class GetUserForm(FlaskForm): """ A general class ...
3.015625
3
python_raster_functions/ObjectDetector.py
ArcGIS/raster-deep-learning
154
12774167
<reponame>ArcGIS/raster-deep-learning<gh_stars>100-1000 ''' Copyright 2018 Esri 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 a...
2.453125
2
pybpodgui_plugin/models/setup/board_task/board_task_window.py
ckarageorgkaneen/pybpod-gui-plugin
0
12774168
#!/usr/bin/python3 # -*- coding: utf-8 -*- import logging import re import pyforms as app from pyforms.basewidget import BaseWidget from pyforms.controls import ControlList from pyforms.controls import ControlCheckBox from pybpodgui_plugin.models.setup.task_variable import TaskVariableWindow from pybpodgui_api.model...
2.734375
3
AutoNode/exceptions.py
jvalteren/auto-node
7
12774169
""" Library of custom exceptions raised by AutNode """ from cryptography.fernet import InvalidToken from pyhmy import Typgpy from .common import ( node_config, save_node_config ) class ResetNode(Exception): """ The only exception that triggers a hard reset. """ def __init__(self, *args, cle...
2.65625
3
migrations/versions/7b47983c2ea0_create_table_budget_item.py
flaviogf/architecture_example_august_2019
2
12774170
"""create table budget_item Revision ID: 7b47983c2ea0 Revises: 89794c69ffab Create Date: 2019-09-07 11:46:49.554912 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '7b47983c2ea0' down_revision = '89794c69ffab' branch_labels = None depends_on = None def upgrade...
1.5
2
i2c_search.py
jaka/usbi2c-python3
3
12774171
<gh_stars>1-10 # -*- coding: utf-8 -*- import serial from sys import platform from usbi2c.usbi2c import * verbose = False def probe(adapter, address): try: adapter.Address(address) adapter.Start() adapter.WaitForCompletion() return True except Exception as e: if e.char and e.char == b'T' and address == ...
3.1875
3
client/client.py
Fish-game-dev/python-web-socket-chat-program
1
12774172
<reponame>Fish-game-dev/python-web-socket-chat-program<filename>client/client.py<gh_stars>1-10 import socket import os def SendString(HOST, PORT): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: sock.connect((HOST, PORT)) sock.sendall(bytes(name + ": " + data + "\n", "utf-8"))...
3.296875
3
pyvips/tests/test_create.py
kleisauke/pyvips
0
12774173
<filename>pyvips/tests/test_create.py # vim: set fileencoding=utf-8 : import unittest import pyvips from .helpers import PyvipsTester class TestCreate(PyvipsTester): def test_black(self): im = pyvips.Image.black(100, 100) self.assertEqual(im.width, 100) self.assertEqual(im.height, 100) ...
2.375
2
src/eeyore_nlp/pipelines/__init__.py
dpasse/eeyore
0
12774174
<reponame>dpasse/eeyore<filename>src/eeyore_nlp/pipelines/__init__.py from .abs import AbsPipe, \ TextPipe, \ ContextPipe from .context_pipes import ChunkerPipe, \ TokenAttributesPipe, \ TokenTaggerPipe, \ ...
0.960938
1
tests/test_dumpb_and_loadb.py
aecay/jsons
1
12774175
<filename>tests/test_dumpb_and_loadb.py import json from unittest import TestCase import jsons class TestDumpbAndLoadb(TestCase): def test_dumpb(self): class A: def __init__(self): self.name = 'A' class B: def __init__(self, a: A): self.a = ...
2.84375
3
phileo/signals.py
dheeru0198/phileo
0
12774176
import django.dispatch object_liked = django.dispatch.Signal(providing_args=["like", "request"]) object_unliked = django.dispatch.Signal(providing_args=["object", "request"])
1.429688
1
test/praatio_test_case.py
timmahrt/praatIO
208
12774177
<filename>test/praatio_test_case.py import unittest import os class PraatioTestCase(unittest.TestCase): def __init__(self, *args, **kargs): super(PraatioTestCase, self).__init__(*args, **kargs) root = os.path.dirname(os.path.realpath(__file__)) self.dataRoot = os.path.join(root, "files") ...
2.8125
3
sparselandtools/applications/utils.py
mttk/sparselandtools
56
12774178
import numpy as np import imageio import os AVAILABLE_IMAGES = ['barbara'] def _add_noise(img, sigma): noise = np.random.normal(scale=sigma, size=img.shape).astype(img.dtype) return img + noise def example_image(img_name, noise_std=0): imgf = os.path.join('sparselandtools'...
2.640625
3
project euler solutions/Problem_023b-with_Haskell.py
helq/old_code
0
12774179
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # run Time: few seconds with runHaskell ~ 12 s import subprocess as sub p = sub.Popen(["runhaskell", "Problem_023.hs"], stdout=sub.PIPE) aNums, b = p.communicate() aNums = eval(aNums) lenNums = 28123 noAbundantNums = [True for i in range(lenNums+1)] lenAbun = len( aN...
2.828125
3
apps/dbd/admin.py
TryNeo/sistema-gestion-pedidos
0
12774180
<reponame>TryNeo/sistema-gestion-pedidos<filename>apps/dbd/admin.py<gh_stars>0 from django.contrib import admin from apps.dbd.modelos.estructura_model_producto import Producto from apps.dbd.modelos.esctructura_model_cliente import Cliente from apps.dbd.modelos.estructura_model_catalogo import Categoria from apps.dbd.mo...
1.15625
1
run_mnist.py
jaredgorski/firstcnn
1
12774181
import mnist import numpy as np import pickle import cnn training_images = mnist.train_images() training_labels = mnist.train_labels() ## uncomment below to train mnist images as RGB data # import cv2 # training_images_rgb = [] # for i, image in enumerate(training_images): # training_images_rgb.append(cv2.cvtCol...
3.40625
3
core/backend.py
MeRajat/MAX-Review-Text-Generator
0
12774182
<gh_stars>0 from keras.backend import clear_session from keras import models import numpy as np import json import logging logger = logging.getLogger() from config import DEFAULT_MODEL_PATH, DEFAULT_MODEL_FILE, SEED_TEXT_LEN # (Fixed) length of seed text that can serve as input to the generative model _SEED_TEXT_LEN...
2.234375
2
resume_builder/__init__.py
nilesh1168/Resume_Builder
0
12774183
from flask import Flask from resume_builder.config import Configuration app = Flask(__name__) app.config.from_object(Configuration) from resume_builder import routes,models
1.617188
2
examples/human_sar/net_latent.py
Cysu/dlearn
4
12774184
import os import sys import argparse import numpy as np import theano.tensor as T homepath = os.path.join('..', '..') if not homepath in sys.path: sys.path.insert(0, homepath) from dlearn.models.layer import FullConnLayer, ConvPoolLayer from dlearn.models.nnet import NeuralNet from dlearn.utils import actfuncs, ...
2.375
2
tests/test_transport_websocket.py
zentropi/python-zentropi
14
12774185
import pytest from zentropi import Agent from zentropi import Frame from zentropi import WebsocketTransport from zentropi.transport import websocket class MockWebsockets(object): def __init__(self, login_ok=True, send_ok=True, recv_ok=True): self._login_ok = login_ok self._send_ok = send_ok ...
2.234375
2
test/test_edit_group.py
Oliebert/Testing_training
0
12774186
<gh_stars>0 from model.group import Group from random import randrange import random def test_edit_group_name(app, db, check_ui): if app.group.count() == 0: # falls keine Gruppe gibt´s app.group.create(Group(name="New_group")) # erstellen wir eine Gruppe old_groups = db.get_group_list() # Liste der ...
2.40625
2
#13.py
dev-farmaan/Project-Euler
0
12774187
# Work out the first ten digits of the sum of N 50 digit numbers. total = 0 for x in range(int(input())): total += int(input().rstrip()) print(str(total)[:10])
3.578125
4
app/views/contexts/submit_questionnaire_context.py
petechd/eq-questionnaire-runner
0
12774188
from typing import Generator, Mapping, Union from flask_babel import lazy_gettext from app.questionnaire.location import Location from .context import Context from .section_summary_context import SectionSummaryContext class SubmitQuestionnaireContext(Context): def __call__( self, answers_are_editable: ...
2.40625
2
waliki/git/urls.py
luzik/waliki
324
12774189
<filename>waliki/git/urls.py import django try: from django.conf.urls import patterns, url # django 1.8, 1.9 except ImportError: from django.conf.urls import url from waliki.settings import WALIKI_SLUG_PATTERN from waliki.git.views import whatchanged, WhatchangedFeed, webhook_pull, history, version, diff _p...
2.15625
2
encoder_ui/api/ffprobe.py
hidnoiz/encoder_ui
0
12774190
import subprocess import json class FFProbe: def __init__(self): self.bin = 'ffprobe' def exec(self, cmd: str) -> str: p = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE, stderr=subprocess.PIPE) is_error = False stdout, _ = p.communicate() if stdout: ...
2.640625
3
Programs/ResourceEditor/Teamcity/getGitTime.py
stinvi/dava.engine
26
12774191
import os import sys if len(sys.argv) > 1: branch = sys.argv[1] else: branch = ' ' os.chdir('../') os.system("git config --global log.date local") os.chdir('../../') os.system("git log -1 --format=\"%ci\" > gitTime.txt")
2.25
2
blog/migrations/0001_initial.py
orangedigitallab/django-tinyblog
3
12774192
<reponame>orangedigitallab/django-tinyblog # -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-29 12:33 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import taggit.managers class Migration(migrations.Migr...
1.703125
2
Luhn.py
Cesar-rso/CreditCardValidation
0
12774193
<gh_stars>0 #LuhnValid: #Função que usa o algoritmo de Luhn para validar numeros (cartão de crédito, or exemplo) #Parametro 'num' deve ser informado como string. Os caracteres '.' (ponto) e ' ' (espaço) são aceitos, porém nenhum outro caracter, somente numeros. #Retorna 1 se o numero é válido, # retorna 0 se o nume...
3.640625
4
test/unit/command/test_status.py
alphagov/ghtools
3
12774194
from mock import patch from ghtools.command.status import status, parser class TestRepo(object): def setup(self): self.patcher = patch('ghtools.command.status.Repo') self.mock_repo = self.patcher.start() self.mock_repo.return_value.set_build_status.return_value.json.return_value = {} ...
2.5
2
actions/concat.py
Sylvaner/PyConverter
0
12774195
__author__ = "<NAME>" __licence__ = "Apache 2.0" __version__ = "1.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Development" class concat(): def action(input_data, params, current_row, current_index): """Concat multiple columns in the cell. :param input_data: Not used. :p...
3.140625
3
algorithms/151/changeBase.py
WebClub-NITK/Hacktoberfest-2k19
28
12774196
<reponame>WebClub-NITK/Hacktoberfest-2k19 #!/bin/python3 import sys def symbol(num): if num < 0 or num > 61: return 'No Symbol' if num < 10: return str(num) if num < 36: return chr(ord('A') + num - 10) else: return chr(ord('a') + num - 36) def value(symbol): if sy...
3.625
4
modules/MemberList.py
PressureRX/OverwatchClanUnionBot
1
12774197
import json, time from datetime import datetime class MemberList: def __init__(self): self.Name = "" self.Update = "" self.Members = "" def MessageFormVerify(self, content): content = content if '#' in content and '\n' in content: return True return ...
3
3
5_back_propagation.py
leegeunhyeok/deep-learning-study
0
12774198
import numpy as np from common import numerical_gradient, softmax, cross_entropy_error from collections import OrderedDict class Relu: def __init__(self): self.mask = None def forward(self, x): self.mask = (x <= 0) out = x.copy() out[self.mask] = 0 return out def...
2.671875
3
setup.py
jmschrei/yabn
2
12774199
<filename>setup.py<gh_stars>1-10 from distutils.core import setup from distutils.extension import Extension import numpy as np try: from Cython.Distutils import build_ext except ImportError: use_cython = False else: use_cython = True cmdclass = { } if use_cython: ext_modules = [ Extension("ya...
1.710938
2
package/PartSegCore/interpolation/setup.py
monotropauniflora/PartSeg
0
12774200
<gh_stars>0 from distutils.core import setup from distutils.extension import Extension import numpy as np from Cython.Build import cythonize extensions = [Extension("bilinear_interpolation", ["bilinear_interpolation.pyx"], include_dirs=[np.get_include()])] setup(ext_modules=cythonize(extensions), name="coloring imag...
1.414063
1
Python/stochastic.py
Hieuqng/Stochastic-Modelling
0
12774201
#!/usr/bin/env python import numpy as np from scipy.stats import norm def bachelier(So, K, sigma, T, option_type): ''' Calculate European option price using Bachelier model: dSt = sigma * S0 * dWt St = S0*(1 + sigma*Wt) Parameter --------- So: float price of underlying...
2.984375
3
tests/builtins/test_dir.py
olgapinheiro/batavia
1
12774202
<filename>tests/builtins/test_dir.py from .. utils import TranspileTestCase, BuiltinFunctionTestCase class DirTests(TranspileTestCase): pass class BuiltinDirFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): function = "dir" not_implemented = [ 'test_class', ]
1.476563
1
api/resources/v1/logs.py
thegrowthapp/backend
1
12774203
<filename>api/resources/v1/logs.py from flask import request from flask_jwt_extended import get_jwt_identity, jwt_required from flask_restful import Resource from ...models import Log, Goal from ...schemas import LogSchema from .responses import respond class LogListResource(Resource): @jwt_required def get...
2.265625
2
calico/openstack/test/test_plugin.py
fasaxc/felix
0
12774204
<reponame>fasaxc/felix # -*- coding: utf-8 -*- # Copyright 2014 Metaswitch Networks # # 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 # # Unle...
1.640625
2
tests/userprofile/decorators_test.py
BMeu/Aerarium
0
12774205
# -*- coding: utf-8 -*- from unittest import TestCase from flask import url_for from flask_login import current_user from flask_login import login_user from werkzeug.exceptions import Forbidden from werkzeug.wrappers import Response from app import create_app from app import db from app.configuration import TestConf...
2.875
3
scripts/generate_image_per_word.py
nmningmei/uncon_semantic
0
12774206
<filename>scripts/generate_image_per_word.py <<<<<<< HEAD # -*- coding: utf-8 -*- """ Created on Tue Feb 18 16:03:27 2020 @author: ning """ import os import pandas as pd from matplotlib import pyplot as plt plt.style.use('dark_background') df = pd.read_csv('../data/sampled.csv',encoding = 'latin-1') figur...
2.609375
3
plugins/multi_neighbors/test_multi_neighbors.py
mohnjahoney/website_source
13
12774207
<reponame>mohnjahoney/website_source<filename>plugins/multi_neighbors/test_multi_neighbors.py<gh_stars>10-100 import unittest import multi_neighbors class PseudoArticlesGenerator: def __init__(self, settings=None, articles=None): self.settings = settings or {} self.articles = articles or [] cla...
2.921875
3
python/kf_true.py
gcgibson/ssvgd
1
12774208
from pydlm import dlm, trend, seasonality from scipy.stats import norm import numpy as np import matplotlib.pyplot as plt # A linear trend linear_trend = trend(degree=1, discount=1, name='linear_trend', w=10) # A seasonality time_series = [] for i in range(10): if i == 0: x_sim = np.random.normal(0,1,1) ...
2.921875
3
app/res/view/json_editor/self.py
HsOjo/PyJSONEditor
0
12774209
<reponame>HsOjo/PyJSONEditor # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'self.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_JSONEditor(object): def setupUi(self, J...
1.9375
2
torch_t2t/torch_t2t_train.py
radiodee1/awesome-chatbot
22
12774210
<reponame>radiodee1/awesome-chatbot #!/usr/bin/python3 """ Sequence-to-Sequence Modeling with nn.Transformer and TorchText =============================================================== This is a tutorial on how to train a sequence-to-sequence model that uses the `nn.Transformer <https://pytorch.org/docs/master/nn....
2.984375
3
apps/forms-flow-ai/forms-flow-api/src/api/services/application.py
saravanpa-aot/SBC_DivApps
2
12774211
"""This exposes application service.""" from http import HTTPStatus from ..exceptions import BusinessException from ..models import Application, FormProcessMapper from ..schemas import AggregatedApplicationSchema, ApplicationSchema from .external import BPMService from ..schemas import FormProcessMapperSchema import ...
2.140625
2
segmentation_rt/rs2mask/rs2mask.py
BrouBoni/segmentation_RT
6
12774212
""" Implementation of :py:class:`Dataset` object. A folder containing a set of subjects with CT and RS in dicom format is converted into nii format. A new folder is created keeping the same organization. """ import os import numpy as np from dcmrtstruct2nii import dcmrtstruct2nii, list_rt_structs class Dataset: ...
3.078125
3
generating_markov_chains/markov_chain_two.py
AlexanderEllis/presidential-tweets
2
12774213
<gh_stars>1-10 """ This module is for generating a Markov chain order two from a text. """ def generate_markov_chain(tweet_array): """ Input assumes text is an array of tweets, each tweet with words separated by spaces with no new lines. This requires some changes to most transcripts ahead of time. Output will be a...
3.640625
4
tools/telemetry/telemetry/util/exception_formatter.py
shaochangbin/chromium-crosswalk
2
12774214
# Copyright 2014 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. """Print prettier and more detailed exceptions.""" import math import os import sys import traceback from telemetry.core import util def PrintFormattedEx...
2.578125
3
easyai/base_name/task_name.py
lpj0822/image_point_cloud_det
1
12774215
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: class TaskName(): Classify_Task = "classify" Detect2d_Task = "detect2d" Segment_Task = "segment" PC_Classify_Task = "pc_classify"
1.226563
1
scr/target/TargetScan/geTarmir.py
chunjie-sam-liu/miRNASNP-v3
1
12774216
<gh_stars>1-10 import os,re with open("mir_seed_2_8.txt","a") as mirseed: RULE1={"A":"U","C":"G","G":"C","U":"A"} with open("wild_mir.fa") as mirseq: line = mirseq.readline().strip() while(line): if line.startswith('>'): mirid = re.split(r'\s',line)[0][1:] cmd1 = "grep -w "+ mirid + " mature.gff3" # ...
2.328125
2
data_loader.py
eXascaleInfolab/Wiki2Prop
2
12774217
<reponame>eXascaleInfolab/Wiki2Prop<filename>data_loader.py import argparse import pickle import logging import os import pandas as pd logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO) import numpy as np np.set_printoptions(suppress=True) logging.basicConfig(format='%(asctime)s %(message)s',...
2.171875
2
huxley/api/tests/test_user.py
bmun/huxley
18
12774218
# Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved. # Use of this source code is governed by a BSD License (see LICENSE). import json from django.urls import reverse from django.test import TestCase from django.test.client import Client from rest_framework import exceptions from huxley.acc...
2.234375
2
scripts/v2-checks.py
coltekin/gk-treebank
3
12774219
<filename>scripts/v2-checks.py #!/usr/bin/env python3 import sys, argparse, re from udtools.conllu import conllu_sentences def is_predicate(node, sent): if node.deprel in {'root', 'parataxis'}: # This may not always be correct return True if node.upos == 'VERB': return True elif ...
2.765625
3
roulette.py
Finegorko/roulette_game
0
12774220
# подключаем модуль случайных чисел import random # подключаем модуль для графиков import plotly.graph_objs as go # сколько денег будет на старте для каждой стратегии startmoney = 1000000 # коэффициент ставки c1 = 0.001 # количество побед и проигрышей win = 0 loose = 0 # количество игр, сыгранный по первой стратег...
3.203125
3
mutadi/private_messages/tests/test_urls.py
etiennody/mutadi
1
12774221
"""Unit tests for posts app urls """ import pytest from django.contrib.auth import get_user_model from django.urls import resolve, reverse from model_bakery import baker from mutadi.private_messages.models import PrivateMessage pytestmark = pytest.mark.django_db User = get_user_model() class TestPrivateMessageUrls:...
2.484375
2
exercises_generation.py
Valadis-Mastoras/SemiGramEx
1
12774222
<reponame>Valadis-Mastoras/SemiGramEx import pandas as pd import random import spacy from sentences_retrieval import retrieve_verb_tense from exercise_types_creation import generate_grammar_mistake, generate_multiple_choice, generate_fib_verb from helper_functions import PDF, extra_preprocessing, profanity_check ...
3.40625
3
chapter09/urlopen_auth3.py
NetworkRanger/python-core
1
12774223
<reponame>NetworkRanger/python-core #!/usr/bin/env python # -*- coding:utf-8 -*- # Author: NetworkRanger # Date: 2019/8/10 11:05 PM import urllib.request, urllib.error, urllib.parse LOGIN = 'wesley' PASSWD = "<PASSWORD>" URL = 'http://localhost' REALM = 'Secure Archive' def handler_version(url): hdlr = urllib.r...
2.125
2
evscaperoom/states/state_009_fertilizer.py
Griatch/evscaperoom
8
12774224
""" Time to make the super-fertilizer from our ingredients. """ from random import random from evennia.utils import interactive from ..state import BaseState from .. import objects GREETING = """ This is the situation, {name}: The |rJester|n wants to win your village's yearly |wpie-eating contest|n. As...
3.078125
3
genstar.py
PoHuit/starlight
1
12774225
# Copyright (c) 2017 <NAME> # [This program is licensed under the "MIT License"] # Please see the file COPYING in the source # distribution of this software for license terms. """Generate a simulated EVE Online™ Project Discovery star luminance trace.""" from random import * from math import * samples_per_day = ...
2.921875
3
geocoder/here_reverse.py
termim/geocoder
1,506
12774226
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.location import Location from geocoder.here import HereResult, HereQuery class HereReverseResult(HereResult): @property def ok(self): return bool(self.address) class HereReverse(HereQuery): """ HERE Geoc...
3.03125
3
legiscrape/video.py
notpeter/legiscrape
3
12774227
import json import logging import os import shutil import subprocess from urllib.parse import parse_qsl, urlsplit import requests def es_search(index, clip_id): """Queries the elasticsearch for video metadata""" search_url = 'http://search.granicus.com/api/%s/_search' % index query = {'query': {'match': ...
2.625
3
Chapter04/4_1_download_data.py
shamir456/Python-Network-Programming-Cookbook-Second-Edition
125
12774228
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 4 # This program requires Python 3.5.2 or any later version # It may run on any other version with/without modifications. # # Follow the comments inline to make it run on Python 2.7.x. import argparse import urllib.request # Comment out the abov...
3
3
dash_app/app.py
dancasey-ie/Grid2LatLon
0
12774229
import json import requests import dash import dash_table import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc import dash_leaflet as dl import pandas as pd from pyproj import Transformer import plotly.graph_objects as go from dash.dependencies import Output, In...
2.546875
3
callers.py
Mars-tin/fast-stripe-calling
0
12774230
import pandas as pd from scipy.signal import find_peaks_cwt from utils import * def _stripe_caller(mat, orientation='h', max_range=3000000, resolution=25000, interval=200000, filter_rate=0.95, min_length=500000, closeness=1000000, stripe_wid...
2.1875
2
numpy_unique.py
Kalpavrikshika/python_modules
1
12774231
import numpy as numpy a = numpy.array([5,2,6,2,7,5,6,8,2,9]) print ('First array:') print(a) print('\n') print('Unique values of first array:') u = numpy.unique(a) print(u) print('\n') print('Unique array and indices array:') u, indices = numpy.unique(a, return_index = True) print (indices) print('\n') print('We ca...
3.734375
4
lxman/cli/page.py
stuxcrystal/lxman
1
12774232
<gh_stars>1-10 from colorama import Fore import json class Page(object): def __init__(self, title): self.title = title self.table = [] def push(self, name, value): self.table.append((name, value)) def output(self, raw=False): if raw: print(self...
3.0625
3
client/verta/verta/_cli/deployment/predict.py
stefan-petrov-toptal/modeldb
835
12774233
<gh_stars>100-1000 # -*- coding: utf-8 -*- import click import json from .deployment import deployment from ... import Client @deployment.group() def predict(): """Making prediction to a deployment-related entity. For example, to make a prediction to an endpoint, run `verta deployment predict endpoint...
2.578125
3
src/basic/exc_trace.py
liuguanglin/Learn_Python
0
12774234
#!/usr/bin/env python # -*- coding: utf-8 -*- import traceback import logging class MyErr(Exception): pass def division(s): n = int(s) if n == 0: raise MyErr('Divisor cannot be %s' % s) return 10 / n def func(x): try: division(x) except MyErr as me: print(me) ...
3.65625
4
libs/datasets/dataset_export.py
imxtrabored/covid-data-model
2
12774235
<gh_stars>1-10 from typing import Iterator import logging from libs.datasets.timeseries import TimeseriesDataset from libs.datasets.dataset_utils import AggregationLevel _logger = logging.getLogger(__name__) STATE_EXPORT_FIELDS = ["state", "cases", "deaths", "source", "date"] COUNTY_EXPORT_FIELDS = ["fips", "cases"...
2.625
3
components/keras/Train_classifier/_samples/sample_pipeline.py
kamalmemon/pipelines
0
12774236
import keras from kfp import components chicago_taxi_dataset_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml') pandas_transform_csv_op = components.load_component_from_url('https://...
2.796875
3
snappy_wrappers/tools/ped_to_vcf_header.py
PotatoThrone/snappy-pipeline
5
12774237
# -*- coding: utf-8 -*- """Add PED file content to VCF file header. Usage:: $ snappy-ped_to_vcf_header --ped-file PED --output TXT """ from __future__ import print_function import argparse from collections import OrderedDict, defaultdict, namedtuple import os import re import sys __author__ = "<NAME> <<EMAIL>>...
2.703125
3
xythrion/extensions/__init__.py
fisher60/Xythrion
9
12774238
from pkgutil import iter_modules EXTENSIONS = frozenset( extension.name for extension in iter_modules(("xythrion/extensions",), "xythrion.extensions.") )
1.179688
1
python/biograph/internal/vdb_query.py
spiralgenetics/biograph
16
12774239
#!/usr/bin/env python3 ''' Query the VDB ''' import argparse import logging import sys import pprint import pandas as pd import orjson as json from biograph.internal import vdb def parse_args(clargs): ''' biograph vdb query args ''' parser = argparse.ArgumentParser( description='Query the Spiral Varia...
2.75
3
site/config/settings/heroku.py
bobhilt/pyhawaii-website
0
12774240
import logging import environ from .base import * # noqa _env = environ.Env() logging.disable(logging.DEBUG) # # invariants # DEBUG = False CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True # # pulled from environment # SECRET_KEY = _env('SECRET_KEY') ALLOWED_HOSTS = ('.herokuapp.com') _additional_hos...
1.90625
2
builder/utils/helpers.py
zpapakipos/dynabench-1
0
12774241
<filename>builder/utils/helpers.py # Copyright (c) Facebook, Inc. and its affiliates. import pickle def load_queue_dump(path, logger=None): try: queue = pickle.load(open(path, "rb")) if logger: logger.info(f"Load existing queue from {path}.") return queue except FileNotFou...
2.3125
2
changes/verification.py
michaeljoseph/changes
135
12774242
import logging from plumbum import CommandNotFound, local from changes import shell log = logging.getLogger(__name__) def get_test_runner(): test_runners = ['tox', 'nosetests', 'py.test'] test_runner = None for runner in test_runners: try: test_runner = local[runner] except ...
2.4375
2
mirtop/libs/sql.py
srinivas32/mirtop
0
12774243
import sqlite3 from sqlite3 import Error def create_connection(): """ create a database connection to the SQLite database specified by the db_file :return: Connection object or None """ try: conn = sqlite3.connect(":memory:") return conn except Error as e: print(e) ...
4.21875
4
open directory.py
blulady/python
0
12774244
<filename>open directory.py from tkinter import * from tkinter import filedialog root = Tk() root.title('open directory') def directory(): root.directory = filedialog.askdirectory(initialdir="/",title="Select a Directory") label = Label(root, text=root.directory) label.pack() b1 = Button(root, text="Br...
3.703125
4
build/lib/g3ar/threadutils/contractor.py
VillanCh/g3ar
48
12774245
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: Provide some useful thread utils Created: 2016/10/29 """ import uuid import time import unittest try: from queue import Queue, Empty except: from Queue import Queue, Empty import threading from threading import Thread im...
2.734375
3
testresults/scons230_trace/strace/pypy_cpython_touch_only/cpython_run/time_all.py
SCons/scons-performance
0
12774246
<filename>testresults/scons230_trace/strace/pypy_cpython_touch_only/cpython_run/time_all.py<gh_stars>0 #!/usr/bin/env python2 import os import sys import sconstest import time import subprocess def stdoutCmd(args): process = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) so...
2.21875
2
analysis/workflow/scripts/generate_phenotypes.py
aryarm/happler
0
12774247
<gh_stars>0 #!/usr/bin/env python import sys import argparse import numpy as np import pandas as pd from math import sqrt from numpy.random import normal def parse_args(): parser = argparse.ArgumentParser( description=( "Use a genotype matrix to create phenotypes from a variant or variants." ...
3.046875
3
safe_transaction_service/history/migrations/0002_auto_20190725_0857.py
kanhirun/safe-transaction-service
5
12774248
# Generated by Django 2.2.2 on 2019-07-25 08:57 from django.db import migrations, models import gnosis.eth.django.models class Migration(migrations.Migration): dependencies = [ ('history', '0001_initial'), ] operations = [ migrations.AddField( model_name='multisigconfirmati...
1.703125
2
model/knowledge_representation/curriculum.py
e-kolpakov/study-model
2
12774249
import logging __author__ = 'e.kolpakov' class Curriculum: def __init__(self): self._competency_index = {} self._fact_index = {} self._lesson_index = {} def register_competency(self, competency): """ Registers competency with curriculum. :param competency: Com...
2.953125
3
core/client.py
leno3s/FF_checker
0
12774250
<gh_stars>0 import tweepy class Client: def __init__(self, consumer_key, consumer_secret, access_token, access_token_secret): self.auth = tweepy.OAuthHandler(consumer_key, consumer_secret) self.auth.set_access_token(access_token, access_token_secret) self.api = tweepy.API(self.auth,...
2.859375
3