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
scripts/jenkins_console_log_search.py
hrajput89/kv_engine
1
22700
#!/usr/bin/env python3 """ Copyright 2018 Couchbase, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed ...
2.46875
2
geokey/projects/migrations/0004_auto_20150123_1507.py
universityofsussex/geokey
0
22701
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0003_auto_20150123_1148'), ] operations = [ migrations.AlterField( model_name='project', ...
1.445313
1
hr_attendance_ex/models/sql_ser_config.py
alexhong121/odoo_model
0
22702
<reponame>alexhong121/odoo_model # -*- coding: utf-8 -*- import logging # import pyodbc from odoo import models, fields, api, _ from odoo.exceptions import UserError, AccessError, MissingError _logger = logging.getLogger(__name__) class SQLConfig(models.Model): _name = 'sql.config' _description='sql_config'...
2.421875
2
core/templatetags/my_custom_tags.py
SubhanRzayev/E-commerce-Tmart
2
22703
<gh_stars>1-10 from blog.models import Category from django.template import Library from core.models import * register = Library() @register.filter def main_catagory(self): if self.category == None: return self.category
1.476563
1
Object.py
LeenJooken/RFMCollaborationMiner
0
22704
<filename>Object.py #Represents an object class Object: def __init__(self,ID,name): self.name = name self.ID = ID self.importance = 1 #keep track of the events in which this file was the object self.modifiedIn = [] self.addedIn = [] self.deletedIn = [] ...
3.5
4
centraloffice/src/ngconfiginterface/nginterface.py
dmazzer/CogRIoT
0
22705
""" nginterface.py: NovaGenesis Interface """ __author__ = "<NAME>" __copyright__ = "Copyright 2016, CogRIoT Project" __credits__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import sys import zmq import threading from bzrlib.plugins.launchpad.lp_api_lite import json sys.path.appen...
2.171875
2
tests/test_connect.py
mkniewallner/edgedb-python
214
22706
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB authors. # # 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...
1.960938
2
.venv/Lib/site-packages/pdoc/cli.py
JohanK91/MethodDice
0
22707
#!/usr/bin/env python3 """pdoc's CLI interface and helper functions.""" import argparse import ast import importlib import inspect import os import os.path as path import json import re import sys import warnings from contextlib import contextmanager from functools import lru_cache from http.server import BaseHTTPRequ...
2.40625
2
application/helper/connection_check.py
HarshadKavathiya/acciom
0
22708
<reponame>HarshadKavathiya/acciom import cx_Oracle import psycopg2 import pymysql import pyodbc from application.common.constants import APIMessages, SupportedDBType, \ GenericStrings def connection_check(db_type_id, db_hostname, db_username, db_password, db_name): """ Helper method ...
2.65625
3
src/db/alembic/tests/add_problems.py
furea2/ProofGame
0
22709
<filename>src/db/alembic/tests/add_problems.py from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///db.sqlite3') Session = sessionmaker(engine) import sys sys.path.append("D:\\Users\\furea2\\NodejsProjects\\login_sample\\src\\db\\alembic\\app\\models") from pr...
2.734375
3
aes/rkeys.py
raviolliii/AES-Encryption
0
22710
<gh_stars>0 def uint(x): # casts x to unsigned int (1 byte) return x & 0xff def chunkify(string, size): # breaks up string into chunks of size chunks = [] for i in range(0, len(string), size): chunks.append(string[i:i + size]) return chunks def gen_rcons(rounds): # generates and returns round constants # th...
2.46875
2
otscrape/core/extractor/nested/__init__.py
SSripilaipong/otscrape
0
22711
from .zip_dict import ZipDict
1.125
1
10_Exceptions_and_Errors/internal.py
MANOJPATRA1991/Python-Beyond-the-Basics
0
22712
def modulus_three(n): r = n % 3 if r == 0: print("Multiple of 3") elif r == 1: print("Remainder 1") else: assert r == 2, "Remainder is not 2" print("Remainder 2") def modulus_four(n): r = n % 4 if r == 0: print("Multiple of 4") elif r == 1: p...
3.8125
4
ml_studio/visualate/dashboards/data_explorer.py
john-james-ai/ml-studio
1
22713
# =========================================================================== # # DATA EXPLORER # # =========================================================================== # # =========================================================================== # ...
1.46875
1
bot.py
m2Link/YouTube-Video-Search
9
22714
<gh_stars>1-10 from pyrogram import Client ,filters import os from py_youtube import Data, Search from pyrogram.types import * TOKEN = os.environ.get("TOKEN", "") APP_ID = int(os.environ.get("APP_ID", "")) API_HASH = os.environ.get("API_HASH", "") app = Client( "yt-search", bot_token = TOKEN, api_id =API_ID ...
2.71875
3
steam_review_sentiments/cnn_model.py
joshuamegnauth54/aapor_scholars_2021
0
22715
<reponame>joshuamegnauth54/aapor_scholars_2021 import numpy as np import keras import spacy from sklearn.feature_extraction.text import CountVectorizer from sklearn.exceptions import NotFittedError from keras.models import Sequential from keras.layers import BatchNormalization, Conv1D, Dense, Embedding from keras.layer...
2.890625
3
startup.py
andreagia/WEBNMR
0
22716
<gh_stars>0 from paste.deploy import loadapp app = loadapp("config:/home/webenmr/WebENMR/development.ini")
1.203125
1
dataset/components.py
mikhailkin/dataset
0
22717
<reponame>mikhailkin/dataset<gh_stars>0 """ Contains classes to handle batch data components """ class ComponentDescriptor: """ Class for handling one component item """ def __init__(self, component, default=None): self._component = component self._default = default def __get__(self, inst...
2.6875
3
app/models.py
owen-rpx/RainGod
7
22718
<reponame>owen-rpx/RainGod<filename>app/models.py #-*- coding:utf-8 -*- from .apps import db class User(db.Model): __tablename__ = 'user' user_id = db.Column(db.Integer, primary_key=True) user_count = db.Column(db.String(100), unique=True) user_name = db.Column(db.String(100), unique=True) user_s...
2.5
2
fingerExercises/fingerExercises-03/03.6-finger.how-many.py
sodaPhix/MITx-6.00.1x
1
22719
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 7 03:26:16 2019 @author: sodatab MITx: 6.00.1x """ """ 03.6-Finger How Many --------------------- Consider the following sequence of expressions: animals = { 'a': ['aardvark'], 'b': ['baboon'], 'c': ['coati']} animals['d'] = ['donkey'] animals...
4.59375
5
test/const.py
DaniFdezAlvarez/shexerp3
3
22720
BASE_FILES = "C:\\Users\\Dani\\repos-git\\shexerp3\\test\\t_files\\" BASE_FILES_GENERAL = BASE_FILES + "general\\" G1 = BASE_FILES + "t_graph_1.ttl" G1_NT = BASE_FILES + "t_graph_1.nt" G1_TSVO_SPO = BASE_FILES + "t_graph_1.tsv" G1_JSON_LD = BASE_FILES + "t_graph_1.json" G1_XML = BASE_FILES + "t_graph_1.xml" G1_N3 = B...
1.617188
2
src/lookoutequipment/evaluation.py
dast1/amazon-lookout-for-equipment-python-sdk
3
22721
<gh_stars>1-10 # Copyright Amazon.com, Inc. or its affiliates. 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.1875
2
src/opserver/plugins/alarm_process_connectivity/setup.py
biswajit-mandal/contrail-controller
3
22722
# # Copyright (c) 2013 <NAME>, Inc. All rights reserved. # from setuptools import setup, find_packages setup( name='alarm_process_connectivity', version='0.1dev', packages=find_packages(), entry_points = { 'contrail.analytics.alarms': [ 'ObjectCollectorInfo = alarm_process_connecti...
1.1875
1
app/tools/dbg_queue_graph.py
samelamin/kylinmonitorbot
0
22723
<reponame>samelamin/kylinmonitorbot<filename>app/tools/dbg_queue_graph.py import asyncio import os from localization import LocalizationManager from services.dialog.queue_picture import queue_graph from services.lib.config import Config from services.lib.db import DB from services.lib.depcont import DepContainer asy...
1.96875
2
fenpei/job.py
mverleg/fenpei
0
22724
""" Base class for fenpei job; this should be considered abstract. Your custom job(s) should inherit from this job and extend the relevant methods, such as:: * is_prepared * is_complete * prepare * start * result * summary """ from re import match from sys import stdout from bardeen.system import mkdirp from time i...
2.53125
3
Aula 07/ex6.py
diegorafaelvieira/Programacao-1
0
22725
<reponame>diegorafaelvieira/Programacao-1 val = int(input("Valor:")) soma = val maior = val menor = val for i in range(0,9): val = int(input("Valor:")) if val>maior: maior = val if val<menor: menor=val soma+=val print("O maior valor é:",maior) print("O menor valor é:",menor) print("A m...
4.125
4
waterbutler/providers/github/exceptions.py
KakeruMizuno/RDM-waterbutler
1
22726
from http import HTTPStatus from waterbutler.core.exceptions import ProviderError class GitHubUnsupportedRepoError(ProviderError): def __init__(self, dummy): """``dummy`` argument is because children of ``WaterButlerError`` must be instantiable with a single integer argument. See :class:`waterbu...
2.765625
3
buildencyclopedia.py
ZhenyuZ/gdc-docs
67
22727
<filename>buildencyclopedia.py<gh_stars>10-100 """updates the encyclopedia section in the mkdocs.yml should be run whenever a file is removed or added into the directory""" import os import yaml ABSFILEPATH = os.path.dirname(os.path.realpath(__file__)) FILEARRAY = os.listdir(ABSFILEPATH + '/docs/Encyclopedia/pages')...
2.890625
3
nucypher/tests/config/test_firstula_circumstances.py
kanzeparov/NuCypher
0
22728
""" This file is part of nucypher. nucypher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. nucypher is distributed in the hope that it wil...
1.8125
2
anchore/anchore-modules/queries/show-familytree.py
berez23/anchore
401
22729
#!/usr/bin/env python import sys import os import re import json import traceback import anchore.anchore_utils # main routine try: config = anchore.anchore_utils.init_query_cmdline(sys.argv, "params: all\nhelp: shows dockerfile lines.") except Exception as err: print str(err) sys.exit(1) if not config:...
2.390625
2
spikeforest/spikeforestwidgets/templatewidget/templatewidget.py
mhhennig/spikeforest
1
22730
<filename>spikeforest/spikeforestwidgets/templatewidget/templatewidget.py import uuid from spikeforest import mdaio import io import base64 import vdomr as vd import os import numpy as np import mtlogging import time import traceback source_path = os.path.dirname(os.path.realpath(__file__)) def _mda32_to_base64(X): ...
1.984375
2
delsmm/smm.py
sisl/delsmm
1
22731
<reponame>sisl/delsmm import torch from torch import nn from torch.autograd import grad from torch.autograd.functional import jacobian from scipy.optimize import root from ceem.dynamics import * from ceem.nn import LNMLP from ceem.utils import temp_require_grad from tqdm import tqdm from delsmm.lagsys import AbstractLa...
2.125
2
src/speech/deep_model.py
dem123456789/Speech-Emotion-Recognition-with-Dual-Sequence-LSTM-Architecture
6
22732
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pad_packed_sequence import pdb import math torch.manual_seed(1) class GRUAudio(nn.Module): def __init__(self, num_features, hidden_dim, num_layers, dropout_rate, num_labels, batch_size, bidirectional=False): ...
2.4375
2
problem/01000~09999/09498/9498.py3.py
njw1204/BOJ-AC
1
22733
print(("F"*6+"DCBAA")[int(input())//10])
2.515625
3
tests/netcdf_engine/test_utils.py
TileDB-Inc/TileDB-CF-Py
12
22734
# Copyright 2021 TileDB Inc. # Licensed under the MIT License. import numpy as np import pytest from tiledb.cf.netcdf_engine._utils import get_netcdf_metadata, get_unpacked_dtype netCDF4 = pytest.importorskip("netCDF4") @pytest.mark.parametrize( "input_dtype,scale_factor,add_offset,output_dtype", ( ...
2.234375
2
bib2mp3.py
ewquon/bib2mp3
0
22735
#!/usr/bin/env python import os import numpy as np import html from bs4 import BeautifulSoup import bibtexparser from bibtexparser.bparser import BibTexParser from bibtexparser.customization import convert_to_unicode import eyed3 from tokenizer import MyTokenizer # acronyms to spell out acronyms = [ 'LES', ...
2.65625
3
build/create_tag_body.py
Nexusforge/Nexus.Extensions.RpcDataSource
0
22736
<reponame>Nexusforge/Nexus.Extensions.RpcDataSource<gh_stars>0 import os import re import subprocess tag = os.getenv('GITHUB_REF_NAME') if tag is None: raise Exception("GITHUB_REF_NAME is not defined") with open("tag_body.txt", "w") as file: output = subprocess.check_output(["git", "tag", "-l", "--format='%...
2.625
3
amos/django_orchestrator/api/views.py
amosproj/2020ws02-computer-vision-for-sights
2
22737
"""This module contains the views exposed to the user.""" from django.http import HttpResponse from rest_framework.decorators import api_view from rest_framework.request import Request from api.view_handlers import ( handle_get_trained_city_model, handle_persist_sight_image, handle_add_new_city, handle_...
2.65625
3
samples/verify.py
ssmbct-netops/CyberSaucier
17
22738
<reponame>ssmbct-netops/CyberSaucier import requests, json, argparse, os from termcolor import colored parser = argparse.ArgumentParser(description="Verify the recipes by running them through CyberSaucier") parser.add_argument('--rulefolder', help='Folder containing the json recipes') parser.add_argument("--url", help...
2.875
3
tests/test_binary_tree.py
avere001/dsplot
8
22739
import os import pytest from dsplot.errors import InputException from dsplot.tree import BinaryTree def test_binary_tree(): tree = BinaryTree(nodes=[5, 4, 8, 11, None, 13, 4, 7, 2, None, None, 5, 1]) assert tree.root.val == 5 assert tree.root.right.left.val == 13 assert tree.root.right.right.left.v...
2.921875
3
features/environment.py
geeksforsocialchange/imok
6
22740
from django.conf import settings settings.NOTIFY_EMAIL = 'root@localhost' settings.DEBUG = True def before_all(context): context.users = {} context.members = {}
1.429688
1
h2o-py/tests/testdir_jira/pyunit_pubdev_7353_reset_threshold.py
vishalbelsare/h2o-3
6,098
22741
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator from h2o.utils.model_utils import reset_model_threshold def test_reset_threshold(): """ Test the model threshold can be reset. Performance metric should be recalc...
2.640625
3
tests/datasets/TestV1/csv2sql.py
pvanderknyff/alibabacloud-adb-tableau-connector
1
22742
#!/usr/bin/python import argparse import csv import sys ''' This script takes a CSV file with a mandatory header and a sql tablename and converts the data in the csv file into an SQL INSERT statement. ''' def parse_arguments(): # initialize argumentparser and arguments parser = argparse.ArgumentParser(descri...
4.03125
4
FlaskApp/app.py
Dec22gln/FlaskBlog
0
22743
from flask import Flask from flask import render_template app = Flask(__name__) @app.route('/') def hello_world(): return render_template('index.html') @app.route('/index') def index(): return render_template('index.html') @app.route('/contact') def contact(): return render_template('contact.html') @a...
2.28125
2
azure-servicefabric/azure/servicefabric/models/primary_replicator_status_py3.py
JonathanGailliez/azure-sdk-for-python
1
22744
<filename>azure-servicefabric/azure/servicefabric/models/primary_replicator_status_py3.py # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # li...
1.828125
2
example/example/models.py
KnightConan/sspdatatables
4
22745
from django.db import models from django_countries.fields import CountryField from django.db.models.deletion import CASCADE class Author(models.Model): name = models.CharField(max_length=60) nationality = CountryField() class Book(models.Model): name = models.CharField(max_length=60) description = m...
2.375
2
workspace/baseline/midi_generator.py
SeungHeonDoh/EMOPIA
69
22746
<reponame>SeungHeonDoh/EMOPIA import os os.environ["CUDA_VISIBLE_DEVICES"] = "4" import json import argparse import numpy as np import tensorflow as tf import midi_encoder as me from train_generative import build_generative_model from train_classifier import preprocess_sentence GENERATED_DIR = './generated' def ove...
2.21875
2
holobot/sdk/chrono/interval_parser.py
rexor12/holobot
1
22747
from ..utils import pad_left, try_parse_int from datetime import timedelta from typing import Dict, List TIME_PARTS: List[str] = [ "D", "H", "M", "S" ] FIXED_INTERVALS: Dict[str, timedelta] = { "WEEK": timedelta(weeks=1), "DAY": timedelta(days=1), "HOUR": timedelta(hours=1) } def parse_interval(value: str...
3.234375
3
pirates/ai/PiratesMagicWordManager.py
itsyaboyrocket/pirates
3
22748
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.ai.PiratesMagicWordManager from direct.showbase.ShowBaseGlobal import * from direct.distributed import DistributedObject from di...
1.609375
2
layers/bazel/deps.bzl
celentes/bazel-container-ubuntu1804
0
22749
<reponame>celentes/bazel-container-ubuntu1804<gh_stars>0 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") def deps(): excludes = native.existing_rules().keys() if "bazel_installer" not in excludes: http_file( name = "bazel_installer", downloaded_file_path = "ba...
1.578125
2
db.py
RecycledMedia/apprenticeship-app
0
22750
<reponame>RecycledMedia/apprenticeship-app<filename>db.py<gh_stars>0 import os import sqlite3 class TaskDatabase: def __init__(self, db_filename): self.filename = db_filename self.connection = None def get_connection(self): """ Return a connection to the database, creating one if it d...
3.671875
4
python/vars_test.py
runningforlife/CodingExamples
0
22751
<gh_stars>0 #!/usr/bin/python def test_vars(): """test variables in python""" int_var = 5 string_var = "hah" assert int_var == 5 assert string_var == 'hah' print("test vars is done") if __name__ == "__main__": test_vars()
2.796875
3
src/data_preparation/tfrecords_and_queues.py
Zhenxingzhang/tiny_imagenet
0
22752
<gh_stars>0 """ Up to now we have held all data in memory. This is of course impossible with large datasets. In this file we explore the use of TFRecords (binary files quickly loading data from disk) and Queues to store asynchronously loading data. In this example we the TinyImageNet-200 dataset which has 100,000 64x...
3.125
3
relialok/SerialPort.py
jrhosk/relialok
0
22753
<filename>relialok/SerialPort.py import serial import serial.tools.list_ports from PyQt5.QtCore import QObject import relialok.Logger class SerialPort(QObject): @relialok.Logger.function_log def __init__(self, port, parent = None): self.port = port self.resource_free = True self.connect...
2.46875
2
Python/DDUtil.py
dalek7/umbrella
1
22754
<filename>Python/DDUtil.py<gh_stars>1-10 import os import datetime def exit(): os._exit(0) def GetTimeString(m = -1): if m==0: s1 = datetime.datetime.now().strftime("%Y%m%d%H%M%S") else: s1 = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") return s1 def MakeDir(directory): if n...
2.78125
3
codes/modelTraining.py
jairock282/hatsi
0
22755
<reponame>jairock282/hatsi """ __| |_____________________________________________________________________________________| |__ (__ _____________________________________________________________________________________ __) | | ...
2.515625
3
datasource/mylaps/tests.py
SphinxNZ/game-on
0
22756
<reponame>SphinxNZ/game-on import datetime from django.utils import timezone from django.test import TestCase from sport.models import Sport, Competition, Venue from compete.models import CompetitionRound from compete.motorsport.models import Race from datasource.models import DataSource from datasource.mylaps.score...
2.453125
2
scripts/generate_tests.py
alibaba/sionnx
34
22757
#* #* Copyright (C) 2017-2019 Alibaba Group Holding Limited #* #* 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 ...
1.976563
2
tests/mixins.py
jarkkorantala/sqlalchemy-utils
879
22758
import pytest import sqlalchemy as sa class ThreeLevelDeepOneToOne(object): @pytest.fixture def Catalog(self, Base, Category): class Catalog(Base): __tablename__ = 'catalog' id = sa.Column('_id', sa.Integer, primary_key=True) category = sa.orm.relationship( ...
2.296875
2
gbpservice/nfp/lib/rest_client_over_unix.py
ashutosh-mishra/my-test
0
22759
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
2.21875
2
tk_sim.py
incherre/slam-bot
0
22760
'''Robot sim with a nicer display.''' from sim_framework import * from math import radians import tkinter BACKGROUND_COLOR = 'grey60' ENTITY_COLOR = 'RoyalBlue1' OBSTACLE_COLOR = 'black' ENTITY_TAG = 'entity' class TKWorld(World): '''A world that will display via tkinter instead of ascii.''' def __init__(self...
3.640625
4
COT/tests/test_doctests.py
morneaup/cot
81
22761
<filename>COT/tests/test_doctests.py #!/usr/bin/env python # # test_doctests.py - test runner for COT doctests # # July 2016, <NAME> # Copyright (c) 2016-2017 the COT project developers. # See the COPYRIGHT.txt file at the top-level directory of this distribution # and at https://github.com/glennmatthews/cot/blob/maste...
2.0625
2
aws/etc/packer/tools/python/stardog/cluster/test_program.py
stardog-union/stardog-graviton
3
22762
<filename>aws/etc/packer/tools/python/stardog/cluster/test_program.py import logging import subprocess import sys import stardog.cluster.utils as utils def run_program(cmd, tries): def pgm_func(): try: p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ...
2.078125
2
apps/core/urls.py
tayyabRazzaq/opl-platform
2
22763
""" Here all the blog's urls routes will be mapped """ from django.urls import path from django.conf.urls import include, url from . import views app_name = 'core' urlpatterns = [ # path('', views.home, name='home-page'), url(r'^api/', include('apps.core.api.urls', namespace='api')), ]
2.140625
2
py2codes/py2_exec.py
rhabacker/lib2to3import
0
22764
exec "123"
0.992188
1
Tools/RaiseCheck.py
17320692835RGF/buptoj
0
22765
<reponame>17320692835RGF/buptoj import MySQLdb from queue import Queue import socket import json from time import sleep import threading import os queue = Queue() # 全局判题列表 myjsonfile = open("./setting.json", 'r') judgerjson = json.loads(myjsonfile.read()) if os.environ.get("DB_USER"): judge...
2.15625
2
first_steps_in_oop/programmer.py
ivan-yosifov88/python_oop_june_2021
1
22766
class Programmer: def __init__(self, name, language, skills): self.name = name self.language = language self.skills = skills def watch_course(self, course_name, language, skills_earned): if not self.language == language: return f"{self.name} does not know {language}"...
3.890625
4
unit_test.py
LSTM-Kirigaya/MsnEnvironment
0
22767
from env import MsnDiscrete, MaplessNaviEnv from robot_utils import * from robot_utils.log import msn_debug from robot_utils.scene import * from env import * from collections import Counter MAX_FORCE = 10. TARGET_VELOCITY = 5. MULTIPLY = 2.0 def keyboard_control(): global MAX_FORCE global TARGET_VELOCITY ...
2.09375
2
meta-refkit-core/lib/ostree/ostreeupdate.py
kraj/intel-iot-refkit
36
22768
<gh_stars>10-100 import bb import oe.path import glob import hashlib import os.path import shutil import string import subprocess VARIABLES = ( 'IMAGE_ROOTFS', 'OSTREE_BRANCHNAME', 'OSTREE_COMMIT_SUBJECT', 'OSTREE_REPO', 'OSTREE_GPGDIR', 'OSTREE_GPGID', 'OSTREE_OS', 'OSTREE_REMOTE', ...
2.53125
3
returns-the- value-to-the-variable.py
fatihwin-yt/a-Python-Tutorial-of-2021
1
22769
#returns the value to the variable # x = 900 print(x) #print will take the argument x as the value in the variable #
3.765625
4
app.py
alvaropp/interactive-fantasy-map
4
22770
<filename>app.py from glob import glob from flask import flash, Flask, Markup, render_template, redirect, request, send_from_directory from form import MapForm from process_new_map import create_map_from_form app = Flask(__name__) with open("secret.txt", "r") as secret_f: app.config["SECRET_KEY"] = secret_f.rea...
3.046875
3
monai/deploy/core/execution_context.py
jlvahldiek/monai-deploy-app-sdk
28
22771
# Copyright 2021 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s...
1.984375
2
LeetCode-All-Solution/Python3/LC-1728-Cat-and-Mouse-II.py
YuweiYin/Algorithm_YuweiYin
0
22772
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-1728-Cat-and-Mouse-II.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-05-10 ==================================...
3.90625
4
tictac/tictac/cli.py
SteveDMurphy/tic_tac_go
0
22773
<reponame>SteveDMurphy/tic_tac_go import click from random import randrange from tictac import Tictac @click.group() def tictac(): pass @tictac.command(name="games", help="Returns all started games, order by when they were created") def view_games(): tictac_class = Tictac() click.echo(tictac_class.view...
3.65625
4
matchId.py
terryhahm/ARAM
0
22774
<reponame>terryhahm/ARAM import numpy as np import pandas as pd import riotConstant import time import requests def wait( tik ): tik = int(tik) tik += 2 while( tik > 0 ): print("API Rate Limit exceeded, wait for " + str(tik) + " second(s)", end = ' \r') tik -= 1 time.sleep(1) ...
3.25
3
Backend/order/urls.py
Bhavya0020/Readopolis
0
22775
from django.urls import path from . import views urlpatterns = [ path('checkout/', views.checkout), path('orders/', views.OrdersList.as_view()), ]
1.648438
2
src/z3c/saconfig/__init__.py
zopefoundation/z3c.saconfig
2
22776
from z3c.saconfig.scopedsession import Session, named_scoped_session from z3c.saconfig.utility import ( GloballyScopedSession, SiteScopedSession, EngineFactory) __all__ = [ 'Session', 'named_scoped_session', 'GloballyScopedSession', 'SiteScopedSession', 'EngineFactory', ]
1.203125
1
src/triage/experiments/singlethreaded.py
josephbajor/triage_NN
160
22777
from triage.experiments import ExperimentBase class SingleThreadedExperiment(ExperimentBase): def process_query_tasks(self, query_tasks): self.feature_generator.process_table_tasks(query_tasks) def process_matrix_build_tasks(self, matrix_build_tasks): self.matrix_builder.build_all_matrices(ma...
2.015625
2
Webspider.py
radiantbk/webspider
1
22778
<reponame>radiantbk/webspider<gh_stars>1-10 import re import os class tag_obj: def __init__(self): self.pos = 0 self.name = "" self.class_name = "" self.content = '' self.children ='' self.pairpos = -1 self.pair="" self.tag_label = "" class spider...
2.4375
2
QScrollAreaImages.py
ErwinSchotman/QT5-QScrollAreaImages
1
22779
# # Copyright (c) 2019 <NAME> # # Licensed under MIT License (MIT) # # 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 # ...
1.523438
2
pyrax/fakes.py
jfreeman812/pyrax
0
22780
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import json import os import random import time import uuid import pyrax from pyrax.autoscale import AutoScaleClient from pyrax.autoscale import AutoScalePolicy from pyrax.autoscale import AutoScaleWebhook from pyrax.autoscale import Sca...
1.203125
1
ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/alerts/alert_logfeeder.py
likenamehaojie/Apache-Ambari-ZH
25
22781
<gh_stars>10-100 #!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2....
2.015625
2
hack/scripts/ca_metrics_parser.py
nicdoye/autoscaler
17
22782
<gh_stars>10-100 #!/usr/bin/env python # Copyright 2017 The Kubernetes Authors. # # 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 ...
2.46875
2
tests/test_cli.py
dls-controls/tickit
4
22783
<filename>tests/test_cli.py from typing import Iterable import pytest from click.testing import CliRunner, Result from mock import Mock, patch from mock.mock import create_autospec from tickit.cli import main from tickit.core.components.component import ComponentConfig from tickit.core.management.schedulers.master im...
1.992188
2
homework5/app/config.py
sakost/tinkoff_fintech
0
22784
from typing import Any from pydantic import BaseSettings from .utils import singleton_cache class Settings(BaseSettings): TESTING: bool = False SQLALCHEMY_DATABASE_URI: str = 'sqlite:///db.sqlite3' FIRST_SUPERUSER: str = 'admin' FIRST_SUPERUSER_PASSWORD: str = '<PASSWORD>' FIRST_SUPERUSER_ROLE...
2.21875
2
nabu/story.py
sterlingbaldwin/nabu
0
22785
<filename>nabu/story.py<gh_stars>0 from typing import ChainMap import yaml from pathlib import Path from jinja2 import Template from weasyprint import HTML, CSS # from xhtml2pdf import pisa class Story(): def __init__(self, story_path, story_name, template_path, *args, **kwargs): self.template_path = temp...
2.59375
3
src/homework/models/__init__.py
nvo87/education-backend
62
22786
<filename>src/homework/models/__init__.py from homework.models.answer import Answer from homework.models.answer_access_log_entry import AnswerAccessLogEntry from homework.models.answer_cross_check import AnswerCrossCheck from homework.models.question import Question __all__ = [ 'Answer', 'AnswerAccessLogEntry'...
1.742188
2
second workout/8B/A.py
paktusov/algorithms
0
22787
<reponame>paktusov/algorithms<gh_stars>0 def add(tree, x): if not tree: tree.extend([x, None, None]) print('DONE') return key = tree[0] if x == key: print('ALREADY') elif x < key: left = tree[1] if left == None: tree[1] = [x, None, None] ...
3.78125
4
fewshot/clis/score_simple.py
armancohan/flex
63
22788
<filename>fewshot/clis/score_simple.py import json from typing import TextIO from functools import partial import click import numpy as np from scipy.stats import sem import pandas as pd from fewshot.bootstrap import bootstrap from fewshot.bootstrap import ci from fewshot.challenges.utils import get_gold_dataset from ....
2.609375
3
KWS/Dissection/tf_mfcc_from_log_mel_spectrogram_sample.py
xrick/gotek_smic
0
22789
batch_size, num_samples, sample_rate = 32, 32000, 16000.0 # A Tensor of [batch_size, num_samples] mono PCM samples in the range [-1, 1]. pcm = tf.random.normal([batch_size, num_samples], dtype=tf.float32) # A 1024-point STFT with frames of 64 ms and 75% overlap. stfts = tf.signal.stft(pcm, frame_length=1024, frame_ste...
2.0625
2
user/migrations/0017_auto_20200812_2149.py
Muia23/Grammer
0
22790
<reponame>Muia23/Grammer<filename>user/migrations/0017_auto_20200812_2149.py # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-08-12 18:49 from __future__ import unicode_literals from django.db import migrations import tinymce.models class Migration(migrations.Migration): dependencies = [ ('...
1.296875
1
audio/loudness_normalization.py
Open-Speech-EkStep/common_scripts
4
22791
<filename>audio/loudness_normalization.py<gh_stars>1-10 from pydub import AudioSegment, effects import glob import os from tqdm import tqdm import argparse class AudioNormalization: def __init__(self, wav_file): self.wav_file = wav_file def loudness_normalization(self, target_dBFS=-15): audio_...
2.921875
3
libcloud/dns/drivers/nsone.py
dupontz/libcloud
4
22792
<gh_stars>1-10 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); y...
1.796875
2
ocr.py
PI2-Braille-printer/OCR
0
22793
<reponame>PI2-Braille-printer/OCR<filename>ocr.py from PIL import Image, ImageEnhance import pytesseract import os #image = Image.open('f_test.jpg') #enhance = ImageEnhance.Contrast(image) #new_image = enhance.enhance(1.5) #new_image.save('f_test__c_2.jpg') for x in range(0,3): os.system('./textcleaner -g -s 2 -a 1 ...
2.71875
3
processing/lua_file_builder.py
eubr-atmosphere/Spark-Log-Parser
1
22794
#! /usr/bin/env python3 ## Copyright 2018 <NAME> <<EMAIL>> ## Copyright 2016 <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/LIC...
1.9375
2
mynlp/__init__.py
Suneel123/mynlp
0
22795
"""Top-level package for mynlp.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
0.964844
1
test/point_test.py
markupCode/computational-geometry
0
22796
import unittest from geometry.point import Point class TestPoint(unittest.TestCase): def get_points(self): return [ Point(0, 0), Point(1, 1), Point(0, 1), Point(-1, 1), Point(-1, 0), Point(-1, -1), Point(1, -1) ]...
3.484375
3
scenarios/simpleBTSEdgeCloudIngestion/units/sensors.py
rdsea/IoTCloudSamples
5
22797
import yaml import os, errno import json def load_config(path): config = None with open(path, 'r') as config_file: config = yaml.load(config_file) return config def createSensorConfigs(topicSensors): sensors = [] count = 0 for i in range(topicSensors['nb']): config = {} ...
2.421875
2
array/0018_4_sum/0018_4_sum.py
zdyxry/LeetCode
6
22798
<gh_stars>1-10 import collections class Solution(object): def fourSum(self, nums, target): nums, result, lookup = sorted(nums), [], collections.defaultdict(list) for i in xrange(0, len(nums) - 1): for j in xrange(i+1, len(nums)): lookup[nums[i]+nums[j]].append([i,j]) ...
2.984375
3
Qcover/backends/__init__.py
BAQIS-Quantum/Qcover
38
22799
from .backend import Backend from .circuitbyqiskit import CircuitByQiskit from .circuitbyprojectq import CircuitByProjectq from .circuitbycirq import CircuitByCirq from .circuitbyqulacs import CircuitByQulacs # from .circuitbytket import CircuitByTket from .circuitbytensor import CircuitByTensor from .circuitbyq...
1.109375
1