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
src/haploqa/customcsvimport.py
TheJacksonLaboratory/haploqa
3
12799751
import argparse import csv import haploqa.mongods as mds SAMPLE_BATCH_SIZE = 20 def import_samples(platform, geno_matrix_csv, x_matrix_csv, y_matrix_csv, sample_tags, db): platform_chrs, snp_count_per_chr, snp_chr_indexes = mds.within_chr_snp_indices(platform, db) curr_sample_start_index = 0 while Tru...
2.546875
3
hangoutswordcount/hangoutswordcount.py
pinaky/utilities
0
12799752
# This program reads in a Google Hangouts JSON file and produces a wordcount # Author: <NAME> import json # JSON to handle Google's format import re # regular expressions # CHANGE THIS. For linux/mac, use '/home/user/restofpath/' basepath = 'C:\\Users\\Pinaky\\Desktop\\cesmd\\gmail_hangout\\' # I...
3.6875
4
tools/get_user_info.py
yanetut/live-get
4
12799753
<gh_stars>1-10 #!/usr/bin/python3 # -*- coding: utf-8 -*- import re import os import argparse from collections import Counter from tqdm import tqdm def get_danmu_user_name(line): res = re.findall(r',\d{1,2},([^,]+),[^,]*">', line) if res: return res[0] return '' def get_danmu_time(line): re...
2.5
2
Scripts/Obsolete/Markov.py
DLasher95/TransEmote
0
12799754
<gh_stars>0 import random import mido from mido import MidiFile # what things to store? # random choice # https://stackoverflow.com/questions/4859292/how-to-get-a-random-value-from-dictionary-in-python notes = [] #random.choice(notes) # dictionaries # https://www.w3schools.com/python/python_dictionaries.asp # { note ...
3
3
kvs/client/python/setup.py
saurav-c/fluent
1,164
12799755
<gh_stars>1000+ from distutils.core import setup import os from setuptools.command.install import install class InstallWrapper(install): def run(self): # compile the relevant protobufs self.compile_proto() # Run the standard PyPi copy install.run(self) # remove the compile...
2
2
botc/commands/abilities/tb/learn.py
BlueLenz/Blood-on-the-Clocktower-Storyteller-Discord-Bot
1
12799756
"""Learn command""" import botutils import discord import traceback import json from discord.ext import commands from botc import check_if_is_player, check_if_is_night, check_if_dm, RoleCannotUseCommand, \ check_if_player_really_dead, check_if_can_learn, PlayerParser, AbilityForbidden, \ NotAPlayer, BOTCUtils,...
2.625
3
piecrust/sources/interfaces.py
ludovicchabant/PieCrust2
43
12799757
class IPreparingSource(object): """ Defines the interface for a source whose pages can be created by the `chef prepare` command. """ def setupPrepareParser(self, parser, app): raise NotImplementedError() def createContent(self, args): raise NotImplementedError() class Interac...
2.5
2
roulette.py
velzerat/lb-bot
10
12799758
from random import randrange from film import film_embed from api import api_call import os async def random_embed(): __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) f = open(os.path.join(__location__, "films.txt"), "r", encoding="utf8", errors="ignore") film = random...
2.875
3
kubetools/kubernetes/api.py
EDITD/kubetools
5
12799759
from time import sleep from kubernetes import client, config from kubernetes.client.rest import ApiException from kubetools.constants import MANAGED_BY_ANNOTATION_KEY from kubetools.exceptions import KubeBuildError from kubetools.settings import get_settings def get_object_labels_dict(obj): return obj.metadata....
1.9375
2
jenkins/modules/jjb_afs/jjb_afs/afs.py
cwolferh/project-config
0
12799760
<reponame>cwolferh/project-config # Copyright 2016 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
1.429688
1
kqueen/gunicorn.py
LaudateCorpus1/kqueen
140
12799761
<filename>kqueen/gunicorn.py from kqueen.config import current_config from prometheus_client import multiprocess import multiprocessing import os app_config = current_config() bind = "{host}:{port}".format( host=app_config.get('KQUEEN_HOST'), port=app_config.get('KQUEEN_PORT'), ) timeout = 180 workers = mult...
2.265625
2
applemusicAPI.py
SeanCBlue652/swap-stream-backend
0
12799762
import requests import json import jwt import cryptography #ploads = {'Authorization': 'Bearer '} #r = requests.get('https://api.music.apple.com/v1/me/library/playlists') #print(r.headers) #print(r.text) #print(r.json()) import applemusicpy secret_key = '' key_id = '74G4697BU4' team_id = 'QTM38LJQ3P' am = applemusic...
2.890625
3
tests/test_utils.py
MerleLiuKun/python-twitter
53
12799763
<filename>tests/test_utils.py """ Utils tests """ import pytest from pytwitter.error import PyTwitterError from pytwitter.utils.validators import enf_comma_separated from pytwitter.utils.convertors import conv_type def test_comma_separated(): value_is_none = enf_comma_separated(name="none", value="") ass...
2.671875
3
stdlib2-src/dist-packages/quodlibet/util/copool.py
ch1huizong/Scode
0
12799764
<reponame>ch1huizong/Scode<filename>stdlib2-src/dist-packages/quodlibet/util/copool.py # Copyright 2006 <NAME>, <NAME> # 2014 <NAME> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Fou...
2.53125
3
study-hall/__main__.py
matt-ketk/study-hall
0
12799765
import sys from .classmodule import MyCla
1.132813
1
fyp/api/tests/serializers/test_login_serializer.py
Fanner487/fyp-django
0
12799766
<filename>fyp/api/tests/serializers/test_login_serializer.py<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from django.contrib.auth.models import User from api import serializers class LoginSerializerTest(TestCase): """ Tests all parameters o...
2.765625
3
py/path/svn/testing/svntestbase.py
woodrow/pyoac
1
12799767
<filename>py/path/svn/testing/svntestbase.py import sys import py from py import path, test, process from py.__.path.testing.fscommon import CommonFSTests, setuptestfs from py.__.path.svn import cache, svncommon mypath = py.magic.autopath() repodump = mypath.dirpath('repotest.dump') def getsvnbin(): svnbin = py.p...
2.28125
2
MagniPy/MassModels/Sersic.py
dangilman/MagniPy
2
12799768
import numpy as np class Sersic: def b(self,n): return 1.9992*n - 0.3271 + 4*(405*n)**-1 def kappa(self,x, y, n_sersic, r_eff, k_eff, q, center_x=0, center_y=0): bn = self.b(n_sersic) r = (x**2+y**2*q**-2)**0.5 return k_eff*np.exp(-bn*((r*r_eff**-1)**(n_sersic**-1)-1))
2.734375
3
client_handler.py
Walabot-Projects/Walabot-WebSocketServer
2
12799769
<reponame>Walabot-Projects/Walabot-WebSocketServer ''' This is a asynchronous function to handle with client requirements. This client handler is with a strong bond to NewWalabotAppTemplate.py requirements. Basic functions that must be: start() get_data() stop() Feel free to add your uwn function just ...
2.546875
3
app_settings/config.py
arcticle/app-settings
0
12799770
import os, re, collections from attrdict import AttrDict from app_settings import file_search from app_settings import FileFactory __all__ = ["Config"] class Config(object): def __init__(self, files=None, dir=None, default=None, filter=None, **kwargs): self._validate(files, dir, default) self._cr...
2.59375
3
tvrenamer/processors/__init__.py
shad7/tvrenamer
1
12799771
<reponame>shad7/tvrenamer """Result processors plugins""" from tvrenamer.processors import base def load(): """Load all processor plugins that are enabled. :returns: priority sorted processor plugins (high to low) :rtype: list """ return base.EnabledExtensionManager()
1.945313
2
airbyte-integrations/connectors/source-freshdesk/unit_tests/conftest.py
heap/airbyte
22
12799772
# # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # import pytest from requests.auth import HTTPBasicAuth @pytest.fixture(name="config") def config_fixture(): return {"domain": "test.freshdesk.com", "api_key": "secret_api_key", "requests_per_minute": 50, "start_date": "2002-02-10T22:21:44Z"} @pytest.f...
1.921875
2
gridding/JG_pchip_interpolation/pchipOceanSlices.py
BillMills/argo-database
2
12799773
import pandas as pd import pdb import requests import numpy as np import os, sys import xarray as xr from datetime import datetime, timedelta import logging from scipy.interpolate import PchipInterpolator import argparse from collections import OrderedDict, defaultdict class PchipOceanSlices(object): def __init__...
2.359375
2
keystone/managers/grant.py
admiyo/keystone
0
12799774
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2011 OpenStack 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
1.929688
2
server/website/website/db/oracle/target_objective.py
yangdsh/ottertune
3
12799775
# # OtterTune - target_objective.py # # Copyright (c) 2017-18, Carnegie Mellon University Database Group # import logging from website.models import DBMSCatalog, MetricCatalog from website.types import DBMSType from ..base.target_objective import (BaseTargetObjective, BaseThroughput, LESS_IS_BETTER, ...
2.015625
2
python3/leetcodepy/regular_expression_matching.py
qianbinbin/leetcode
4
12799776
""" Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). Example 1: Input: s = "aa", p = "a" Output...
4.34375
4
generate_prediction/bio.py
yangyxt/QBiC-Pred
7
12799777
import itertools import pandas as pd import numpy as np # all permutations are already reverse-deleted # all sequences are represented in binary nucleotides = {'A':0,'C':1,'G':2,'T':3} numtonuc = {0:'A',1:'C',2:'G',3:'T'} complement = {0:3,3:0,1:2,2:1} def window(fseq, window_size): for i in range(len(fseq) - wi...
2.59375
3
je_auto_control/osx/listener/__init__.py
JE-Chen/Python_JEAutoControl
9
12799778
from je_auto_control.osx.listener import *
1.046875
1
utility/mac_mapper.py
jcal329/cs158b-Storm
3
12799779
<gh_stars>1-10 from pysnmp.hlapi import * from parse_config import config import sys #Reference SNMAP-WALK from:https://www.google.com/search?q=snmp+walk+solarwinds&oq=snmp+walk&aqs=chrome.5.69i57j0l5.2209j0j4&sourceid=chrome&ie=UTF-8 #.env file need to have VLAN number & Switch address switches = config['switches'...
2.328125
2
define_jogadores.py
LuizArthur135/Joga-da-velha
0
12799780
jogadores = { "jogador_1":{ "name": "", "escolha": "" }, "jogador_2":{ "name": "", "escolha": "" } } def inicia_jogadores(): jogadores["jogador_1"]["name"] = str(input('Qual e seu nome? ')) jogadores["jogador_2"]["name"] = str(input('Nome da pessoa que vai joga...
3.921875
4
core/apps/kubeops_api/migrations/0063_auto_20200223_0557.py
r4b3rt/KubeOperator
3
12799781
<filename>core/apps/kubeops_api/migrations/0063_auto_20200223_0557.py # Generated by Django 2.2.10 on 2020-02-23 05:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0002_userprofile'), ('kubeops_api', '0062_auto_20200221_0510'), ]...
1.484375
1
tests/detail/jupyter_app/test_format_deployments_info.py
intdata-bsc/idact
5
12799782
from idact.detail.jupyter_app.format_deployments_info import \ format_deployments_info def test_format_deployments_info(): formatted = format_deployments_info(cluster_name='cluster1') assert formatted == ( "\nTo access the allocation and notebook deployments from cluster," " you can use th...
2.390625
2
Red_Color_E_Paper_HAT/e_paper_2in7_color_air.py
sbcshop/2.7-E-Paper-HAT
1
12799783
# Red color e-paper import sys import os import lib_2inch7_ec_paper import time from PIL import Image,ImageDraw,ImageFont from pms_a003 import Sensor air_mon = Sensor() air_mon.connect_hat(port="/dev/ttyS0", baudrate=9600) while True: try: e_paper = lib_2inch7_ec_paper.Ec_Paper() e_paper.ini...
2.828125
3
firmware/bait/git_rev_macro.py
dkadish/BioAcousticIndexTool
1
12799784
<gh_stars>1-10 #!/Users/davk/anaconda/envs/platformio_setup python import subprocess revision = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip() print('-DPIO_SRC_REV="%s"' % revision)
1.828125
2
Project_cmNotice/expressChecker.py
corkine/pyBook
10
12799785
<gh_stars>1-10 #/usr/bin/env python3 # -*- coding:utf8 -*- import requests import lxml.etree import json import pickle,traceback,shelve,time,sys __title__ = "快递更新查询程序" __version__ = '0.0.2' __log__ = """ 0.0.1 2018年3月4日 0.0.2 2018-03-07 修正了数据尚未更新的404错误,返回空列表 """ class ExpressChecker: """检查快递更新状态的类 """ de...
2.265625
2
test.py
NiklasMWeber/CreditCycleForecasting
0
12799786
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Mon Jan 17 15:42:09 2022 @author: nikth """ from train import select_hatm_cv from tools import add_time from train import SignatureRegressionNik from dataGeneration import GeneratorFermanianDependentMax from sklearn.model_selection import train_test_split #Xtrain, ...
2.390625
2
neuralizer/tests/test_data_process.py
BeckResearchLab/Neuralizer
1
12799787
<filename>neuralizer/tests/test_data_process.py from __future__ import absolute_import,division,print_function import os import pandas as pd import numpy as np import numpy.testing as npt import data_process as dp def test_read_file(): X,Y = dp.read_file('test.tsv',["A","B"],"y") npt.assert_equal(X,np.array[[0...
2.9375
3
quizzes/00.organize.me/Cracking the Coding Interview/tree_search_by_stack.py
JiniousChoi/encyclopedia-in-code
2
12799788
<filename>quizzes/00.organize.me/Cracking the Coding Interview/tree_search_by_stack.py<gh_stars>1-10 #!/usr/bin/env python3 import unittest class Tree: def __init__(self, v): self.v = v self.left = None self.right = None def is_terminal(self): return self.left==None and self.r...
4.09375
4
Models/Subject.py
erikhalperin/Scheduler
1
12799789
import itertools class Subject: __id_generator = itertools.count(0, 1) @staticmethod def get_all_subjects(): return ['Eng1', 'Eng2', 'Eng3', 'Eng4', 'Alg1', 'Alg2', 'Geo', 'PreC', 'Phys', 'Chem', 'SciE', 'Bio', 'Civ1', 'Civ2', 'Civ3', 'Civ4'] def __init__(self, name: str): ...
3.234375
3
itemdb/itemdb_2_csv.py
Katorone/Astrox-Imperium
0
12799790
#!/usr/bin/python3 # More information, as well as the (non)licence can be found at: https://github.com/Katorone/Astrox-Imperium # This script exports 2 files to a csv: # - MOD/items/items_database.txt -> itemdb.csv # - MOD/items/specs_database.txt -> docdb.csv # It will also do some sanity checking, which should be...
2.640625
3
contact_forms/contact/tests/test_config.py
uktrade/dit-contact-forms
2
12799791
<reponame>uktrade/dit-contact-forms from django.test import SimpleTestCase from django.apps import apps from contact.apps import ContactConfig class ContactConfigTestCase(SimpleTestCase): """ Test app config """ def test_apps(self): self.assertEqual(ContactConfig.name, "contact") se...
2.390625
2
.k8s/scripts/delete-k8s-objects.py
fossabot/code-du-travail-numerique
0
12799792
<gh_stars>0 from subprocess import check_output import hashlib import os import json from urllib import request # This script compares the active remote branches and active k8s tags. # If a k8s tag doesn't match an active hashed remote branches name's, we delete all the k8s objects with this k8s tag. github_token = os...
2.59375
3
hossein/contest/52544/52544.py
mhdehghan/quera-answers
0
12799793
# https://quera.ir/problemset/contest/52544 CORNER_ONE = {(0, 0), (0, 1), (0, 2), (0, 6), (0, 7), (0, 8), (1, 0), (1, 2), (1, 6), (1, 8), (2, 0), (2, 1), (2, 2), (2, 6), (2, 7), (2, 8), (6, 0), (6, 1), (6, 2), (6, 6), (6, 7), (6, 8), (7, 0), (7, 2), (7, 6), (7, 8...
3.515625
4
setup.py
jim22k/metagraph-stellargraph
0
12799794
from setuptools import setup, find_packages import versioneer setup( name="metagraph-stellargraph", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), description="Stellargraph plugins for Metagraph", author="<NAME>.", packages=find_packages( include=["metagraph_stell...
1.140625
1
sdk/python/pulumi_aws/secretsmanager/__init__.py
pulumi-bot/pulumi-aws
0
12799795
<filename>sdk/python/pulumi_aws/secretsmanager/__init__.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! *** # Export this package's modules as members: from secret import * from secret...
1.164063
1
run_test.py
NREL/scout
0
12799796
<reponame>NREL/scout<gh_stars>0 #!/usr/bin/env python3 """ Tests for running the engine """ # Import code to be tested import run # Import needed packages import unittest import numpy import copy import itertools import os class CommonTestMeasures(object): """Class of common sample measures for tests. Att...
2.09375
2
gocd_tools/cli/secrets.py
rasmunk/gocd-tools
0
12799797
def add_secrets_groups(parser): _ = parser.add_argument_group(title="Secrets arguments")
1.53125
2
tap_mailchimp/streams/reports_email_activity.py
icebug/tap-mailchimp
0
12799798
<gh_stars>0 from tap_mailchimp.streams.base import BaseStream import singer from datetime import datetime from dateutil.parser import parse LOGGER = singer.get_logger() class ReportsEmailActivityStream(BaseStream): API_METHOD = "GET" TABLE = "reports_email_activity" response_key = "emails" def sync...
2.296875
2
generic_testing/isclose.py
steverpalmer/GenericTesting
0
12799799
#!/usr/bin/env python3 # Copyright 2021 <NAME> """Extension to math.isclose and cmath.isclose.""" import cmath import logging import math import numbers LOG = logging.getLogger("isclose") try: import version as _version if not _version.version.is_backwards_compatible_with("1.0.0"): raise ImportErro...
2.578125
3
Comportamentais/Template Method/main.py
DionVitor/design_pattern
0
12799800
<gh_stars>0 from abc import ABC, abstractmethod def print_abstract(string): print(f'\033[31m{string}\033[0;0m') def print_concrete(string): print(f'\033[32m{string}\033[0;0m') class AbstractClass(ABC): def template_method(self): self.operation_one() self.required_operation_one() ...
3.171875
3
server/danesfield_server/workflow_steps/run_danesfield_imageless.py
Kitware/Danesfield-App
25
12799801
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. and Contributors # Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0) # See accompanying Copyright.txt and LICENSE files for details ##########...
1.65625
2
api_v1/migrations/0001_initial.py
crazy-coding/django-rest-swagger-master
1
12799802
<gh_stars>1-10 # Generated by Django 3.1.1 on 2020-09-23 07:05 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Group', fie...
1.953125
2
xos/xos/urls.py
wathsalav/xos
0
12799803
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin # This is the generated API from xosapi import * from core.views.legacyapi import LegacyXMLRPC from core.views.services import ServiceGridView #from core.views.analytics import Ana...
1.992188
2
EKMRC/build_graph_concepts/build_conceptnet/retrieve_1hop.py
yyHaker/EKMRC-is-your-need
4
12799804
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : retrieve_1hop.py @Author : yyhaker @Contact : <EMAIL> @Time : 2020/04/07 16:33:58 ''' """ 检索知识图谱:对于某个token,分别检索出三部分: 1. sub-graph (1) 检索出头或者尾部包含该词的三元组,构建子图G 2. sub-graph triples 3. core_entity """ import sys sys.path.append(".") import r...
2.203125
2
fauth/face.py
shadownetz/fauth
0
12799805
<gh_stars>0 import base64 import face_recognition from django.core.files.base import ContentFile from django.core.files import File from django.conf import settings class FauthImage: def __init__(self, dataURI: str, *, name: str = 'temp'): self.image_uri = dataURI self.image_format, self.image_st...
2.625
3
engine/utils/xml_json_process.py
torrotitans/torro_community
1
12799806
<filename>engine/utils/xml_json_process.py #!/usr/bin/python # -*- coding: UTF-8 -* import json from json import JSONDecodeError import xmltodict from common.common_response_code import response_code def xml_to_json(xml_str): """ :param xml_str: :return: """ xml_parse = xmltodict.parse(xml_str) ...
2.984375
3
demo/plugins/bootstrap_button/cms_plugins.py
andrewschoen/django-cms-demo
7
12799807
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext as _ from django.conf import settings from models import BootstrapButtonPlugin class BootstrapButtonPlugin(CMSPluginBase): model = BootstrapButtonPlugin name = _("Button") text_e...
1.921875
2
test_model/models.py
Lairion/defaultproject
0
12799808
from django.db import models # Create your models here. class Category(models.Model): """ Description: Model Description """ name = models.CharField(max_length=50) class Meta: pass class Skill(models.Model): """ Description: Model Description """ name = models.CharField(ma...
2.515625
3
test/test_images.py
mwang87/SMART_NMR
0
12799809
<reponame>mwang87/SMART_NMR import sys sys.path.insert(0, "..") import smart_utils import os import glob def test_draw(): test_files = glob.glob("Data/*") for test_file in test_files: print(test_file) smart_utils.draw_nmr(test_file, "{}.png".format(os.path.basename(test_file)))
2.734375
3
modneat/modneat_settings.py
katomasahiro10/modpy
0
12799810
# nn parameters INPUT_NUM = 2 OUTPUT_NUM = 1 NORMAL_NUM_UPPER_LIMIT = 5 NORMAL_NUM_LOWER_LIMIT = 2 MODULATION_NUM_UPPER_LIMIT = 2 MODULATION_NUM_LOWER_LIMIT = 2 NEURON_NUM_UPPER_LIMIT = 5 CONNECTION_NUM_UPPER_LIMIT = 10 CONNECTION_NUM_LOWER_LIMIT = 1 WEIGHT_UPPER_LIMIT = 1.0 WEIGHT_LOWER_LIMIT = -1.0 BIAS_UPPER_L...
1.726563
2
evaluate_recordings/config.py
technologiestiftung/otc-toolkit
4
12799811
from os.path import dirname, abspath, join DIR_PATH = dirname(abspath(__file__)) OTC_TOOLKIT_PATH = abspath(join(DIR_PATH, '..')) PATH_TO_RECORDINGS = "data" STATIONS = ['ecdf', 'citylab'] BOARDS = ['nano', 'tx2', 'xavier'] COUNTER_LINE_COORDS = {'ecdf': # {'ecdf-lindner': {"point1": {"x": 718,...
2.09375
2
examples/management/get_user.py
ZygusPatryk/amqpstorm
140
12799812
<gh_stars>100-1000 from amqpstorm import management if __name__ == '__main__': # If using a self-signed certificate, change verify=True to point at your CA bundle. # You can disable certificate verification for testing by passing in verify=False. API = management.ManagementApi('https://rmq.amqpstorm.io:156...
2.0625
2
setup.py
hurali97/makeReact
0
12799813
<gh_stars>0 import re from setuptools import setup version = re.search( '^__version__\s*=\s*"(.*)"', open('makeReact/script.py').read(), re.M ).group(1) with open("README.md", "r") as f: long_description = f.read() setup( name = "makeReact", packages = ["makeReact"], entry_points = {...
1.601563
2
tests/test_archive_operations.py
jpenney/pdar
3
12799814
<reponame>jpenney/pdar<gh_stars>1-10 # This file is part of pdar. # # Copyright 2011 <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 ...
2.21875
2
Dataset/Leetcode/valid/56/149.py
kkcookies99/UAST
0
12799815
class Solution(object): def XXX(self, intervals): """ 轻松秒杀,根据结果集合最后一个和新的元素之间关系判断是否要修改 """ if not intervals: return [] intervals = sorted(intervals) res = [intervals[0]] for i in range(1, len(intervals)): if intervals[i][0] <= res[-1][1]: ...
3.25
3
experiments/examplereader.py
abdelabdalla/deepmind-research
0
12799816
<reponame>abdelabdalla/deepmind-research import functools import json import os import tensorflow as tf from learning_to_simulate import reading_utils def _read_metadata(data_path): with open(os.path.join(data_path, 'metadata.json'), 'rt') as fp: return json.loads(fp.read()) data_path = "/tmp/WaterDrop...
2.53125
3
serving/keras_load_saved_model.py
oushu1zhangxiangxuan1/HolmesNER
0
12799817
<reponame>oushu1zhangxiangxuan1/HolmesNER # import tensorflow as tf from tensorflow.python.keras.saving.saved_model.load import KerasObjectLoader from tensorflow.python.saved_model.load import load_internal from tensorflow.python.keras.saving.saved_model.load import RevivedModel from tensorflow.python.keras.saving imp...
2.3125
2
update.py
lilshim/collective-actions-in-tech
0
12799818
import os import textwrap import argparse import pandas as pd from pathlib import Path from utils.action import Action, Actions from utils.markdown import ( update_markdown_document, SUMMARY_ID, MarkdownData, MarkdownDocument, ) from utils.files import FileClient README = Path( os.path.realpath(os....
2.984375
3
main.py
Hyrtsi/opencv-tools
0
12799819
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.widgets import Slider import cv2 as cv FILE_NAME = 'res/mountain-and-lake.jpg' # https://matplotlib.org/3.3.1/gallery/widgets/slider_demo.html # https://sodocumentation.net/matplotlib/topic/6983/animations-and-...
3.3125
3
mirari/SV/migrations/0006_auto_20190310_1346.py
gcastellan0s/mirariapp
0
12799820
# Generated by Django 2.0.5 on 2019-03-10 19:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('SV', '0005_auto_20190305_0116'), ] operations = [ migrations.RemoveField( model_name='cut', name='user', ), ...
1.515625
2
miscellaneous/old_code/resources/template.py
wehriam/awspider
2
12799821
from twisted.web.resource import Resource from genshi.template import TemplateLoader import os import cStringIO, gzip class TemplateResource(Resource): isLeaf = True def __init__(self, path = None): self.path = path loader = TemplateLoader( search_path=[ os.path.join(os.path.dirname(__file__), '...
2.09375
2
496_Next-Greater-Element-I.py
Coalin/Daily-LeetCode-Exercise
3
12799822
# Method I: class Solution: def nextGreaterElement(self, nums1: List[int], nums2: List[int]) -> List[int]: res = [] for num in nums1: index = 0 cur_num_index = 0 while index <= len(nums2)-1: if nums2[index] == num: ...
3.28125
3
main_exe.py
pkudba/SCL
7
12799823
<gh_stars>1-10 import os import torch import numpy as np import pandas as pd import torch import torch.nn as nn import yaml from tqdm.auto import tqdm from tensorboardX import SummaryWriter from torch.utils.data.dataloader import DataLoader
1.226563
1
boost/libs/iterator/doc/generate.py
randolphwong/mcsema
1,155
12799824
<reponame>randolphwong/mcsema<filename>boost/libs/iterator/doc/generate.py #!/usr/bin/python # Copyright <NAME> 2004. Use, modification and distribution is # subject to the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # Generate html, ...
2.125
2
np_processor/processor/np_ssd_post.py
laobadao/TF_VS_Caffe
0
12799825
import numpy as np from platformx.plat_tensorflow.tools.processor.np_utils import shape_utils, \ anchor_generator_builder, box_list_ops, box_list, box_coder_builder, post_processing_builder, \ visualization_utils as vis_util from platformx.plat_tensorflow.tools.processor.np_utils import standard_fields as f...
2.015625
2
simulations/simulations.py
ashkanbashiri/data_driven_intersection_control
1
12799826
from vissim_utils.sim import generate_phase_times, run_simulation, printProgressBar import sys import time import datetime import multiprocessing import win32com.client as com import os def main(): global start_time start_time = time.time() fair_scheme = 'fair' relative_scheme = 'relative' schemes...
2.390625
2
lib/data/graph_dataset/structural_dataset.py
shamim-hussain/egt_pytorch
10
12799827
<gh_stars>1-10 import numpy as np import numba as nb from .graph_dataset import GraphDataset NODE_FEATURES_OFFSET = 128 EDGE_FEATURES_OFFSET = 8 @nb.njit def floyd_warshall(A): n = A.shape[0] D = np.zeros((n,n), dtype=np.int16) for i in range(n): for j in range(n): if i == j: ...
2.125
2
dev/tools/docs/run_doctests.py
awillats/brian2
674
12799828
<gh_stars>100-1000 import os import sphinx os.chdir('../../../docs_sphinx') sphinx.main(['sphinx-build', '-b', 'doctest', '.', '../docs', '-D', 'exclude_patterns=reference'])
1.320313
1
mass_flask_core/tests/__init__.py
mass-project/mass_server
8
12799829
from .flask_test_case import FlaskTestCase __all__ = [ 'FlaskTestCase' ]
1.117188
1
biolearns/metrics/discriminant.py
huangzhii/biolearns
7
12799830
# Copyright 2020 <NAME>. All rights reserved # Created on Tue Feb 11 12:29:35 2020 # Author: <NAME>, Purdue University # # # The original code came with the following disclaimer: # # This software is provided "as-is". There are no expressed or implied # warranties of any kind, including, but not limited to, the warra...
2.140625
2
tests/trinity/core/p2p-proto/test_server.py
jin10086/py-evm
0
12799831
<filename>tests/trinity/core/p2p-proto/test_server.py import asyncio import pytest import socket from eth_keys import keys from cancel_token import CancelToken from eth.chains.ropsten import RopstenChain, ROPSTEN_GENESIS_HEADER from eth.db.chain import ChainDB from eth.db.backends.memory import MemoryDB from p2p.au...
1.84375
2
src/inpainting.py
DehuiYan/tumorDetection
0
12799832
<gh_stars>0 #!/usr/bin/env python # coding=utf-8 ''' 将生成patch聚合为癌症区域并嵌入到normal切块中 ''' import os import cv2 import random import tools import numpy as np import makevocxml inputGenedir = '../../mydata/dcgan/dcgan_micro_512/' inputNordir = '../../mydata/dcgan/normal_part/' outputdir = '../../mydata/dcgan/virtual_datase...
2.0625
2
test/test_violence.py
yanzhicong/VAE-GAN
33
12799833
import os import sys sys.path.append('.') sys.path.append('../') import numpy as np import cv2 import tensorflow as tf import matplotlib.pyplot as plt from dataset.violence import Violence from dataset.tianchi_guangdong_defect import TianChiGuangdongDefect if __name__ == '__main__': config = { "output shape" : ...
2.578125
3
rayonix_detector.py
bopopescu/Lauecollect
0
12799834
<gh_stars>0 from __future__ import with_statement """ Remote control of the MAR CCD detector, using <NAME>'s sample remote control server program "marccd_server_socket" with TCP port number 2222. Usage example: ccd = rayonix_detector("marccd043.cars.aps.anl.gov:2222") The server is started from the MarCCD software fr...
2.5625
3
apps/poll/admin.py
CasualGaming/studlan
9
12799835
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from .models import Poll, PollOption, PollParticipant, PollTranslation class PollTranslationInlineAdmin(admin.StackedInline): verbose_name = _(u'poll translation') ...
1.867188
2
build-hooks/hook-browse_utils.py
rezgar/pythonista-chromeless
1
12799836
from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('cli', include_py_files=True)
1.242188
1
log/migrations/0001_initial.py
zyayoung/lab-item-tracking
4
12799837
# Generated by Django 2.1.1 on 2019-02-09 01:11 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('login', '0004_user_settings'), ] operations = [ migrations.CreateModel( nam...
1.882813
2
examples/run.py
GregoireDelannoy/udon
1
12799838
<gh_stars>1-10 import getopt import logging import sys import time import udon.log import udon.run pidfile = None opts, args = getopt.getopt(sys.argv[1:], "p:") for opt, arg in opts: if opt == '-p': pidfile = arg if args: if args[0] == 'stop': udon.run.stop(pidfile) elif args[0] == 'kill...
2.21875
2
service1.py
theneon-Hacker/main_numProperty
0
12799839
<reponame>theneon-Hacker/main_numProperty from itertools import dropwhile def roman(n): if n > 0 and n < 3999: ones = ["","I","II","III","IV","V","VI","VII","VIII","IX"] tens = ["","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"] hunds = ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"...
3.015625
3
src/daemon/initialisation.py
0CT3T/Daemon_Home_Integration
1
12799840
<reponame>0CT3T/Daemon_Home_Integration from importlib.machinery import SourceFileLoader from daemon.Configuration.Modele import * from daemon.Configuration.configuration import configuration ############################################################# # # INITIALISATION ###########################...
1.8125
2
day10.py
kdrag0n/aoc2021
2
12799841
#!/usr/bin/env python3 import sys def ints(itr): return [int(i) for i in itr] with open(sys.argv[1], 'r') as f: file_lines = [l for l in f.read().strip().split('\n')] in_nums = [] total = 0 result = 0 other = 0 opn_to_cls = {'(': ')', '[': ']', '{': '}', '<': '>'} cls_to_opn = {v: k for k, v in opn_to_cl...
3.546875
4
fHDHR/originwrapper/origin_channels_standin.py
deathbybandaid/fHDHR_NewsOn
2
12799842
<gh_stars>1-10 class OriginChannels_StandIN(): def __init__(self): pass def get_channels(self): return [] def get_channel_stream(self, chandict): return None
1.609375
2
data_wrangling/legacy_code/frame_times_crawler.py
alexmitchell/file_manipulations
0
12799843
<gh_stars>0 import os import numpy as np from pathlib import Path # From Helpyr import data_loading from helpyr_misc import nsplit from helpyr_misc import ensure_dir_exists from logger import Logger from crawler import Crawler class FrameTimesCrawler (Crawler): # The FrameTimesCrawler navigates through the bac...
2.609375
3
Conversation chatbot/dialogue_manager.py
kirilcvetkov92/MNIST-Classifier-
2
12799844
import os from sklearn.metrics.pairwise import pairwise_distances_argmin from chatterbot import ChatBot from chatterbot.trainers import ListTrainer from chatbot import * from utils import * import tensorflow as tf class ThreadRanker(object): def __init__(self, paths): self.word_embeddings, self.embedding...
2.453125
2
trim.py
watsoncm/PruneSeg
0
12799845
<reponame>watsoncm/PruneSeg #!/usr/bin/env python # -*- coding: utf-8 -*- """Trims weights on a pruned model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import shutil import sys import collections # https://git...
2.09375
2
src/modules/catalog/domain/services.py
Ermlab/python-ddd
308
12799846
# from seedwork.domain.services import DomainService # from seedwork.domain.value_objects import UUID # from .entities import Listing, Seller # from .repositories import ListingRepository # from .rules import ( # ListingMustBeInDraftState, # SellerMustBeEligibleForAddingNextListing, # ) # class CatalogService...
2.0625
2
ndv_ru.py
nonameists/puls_test
0
12799847
<reponame>nonameists/puls_test import json import re import requests from bs4 import BeautifulSoup as soup DICT_KEYS = ['complex', 'type', 'phase', 'building', 'section', 'price_base', 'price_finished', 'price_sale', 'price_finished_sale', 'area', 'number', 'number_on_site', 'rooms', 'floor'...
2.796875
3
learn-to-code-with-python/32-PROJECT-Texas-Hold-Em-Poker/tests/test_card.py
MaciejZurek/python_practicing
0
12799848
import unittest from poker.card import Card class CardTest(unittest.TestCase): def test_has_rank(self): card = Card(rank = "Queen", suit = "Hearts") self.assertEqual(card.rank, "Queen") def test_has_suit(self): card = Card(rank = "2", suit = "Clubs") self.assertEqual(card.suit,...
3.75
4
tests/test_generics.py
danpoland/pyramid-restful
18
12799849
<filename>tests/test_generics.py from unittest import TestCase, mock from pyramid import testing from pyramid.httpexceptions import HTTPNotFound from sqlalchemy import create_engine, Column, String, Integer from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy...
2.3125
2
emLam/corpus/corenlp_preprocessor.py
DavidNemeskey/emLam
2
12799850
<reponame>DavidNemeskey/emLam<gh_stars>1-10 #!/usr/bin/env python3 """A preprocessor that invokes a Stanford CoreNLP server for analysis.""" from __future__ import absolute_import, division, print_function from emLam.corenlp import CoreNLP from emLam.corpus.preprocessor_base import Preprocessor class CoreNlpPreproc...
3.234375
3