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 |
|---|---|---|---|---|---|---|
mlaas/api/score/serializers.py | ayanray-tech/faas | 2 | 12772351 | from flask_restplus import fields
from api.restplus import api
model_score = api.model('Model Score', {
'algorithm': fields.String(required=True, description='Model name'),
'source_url': fields.String(required=True, description='Source URL'),
'field_names': fields.String(required=True, description='Field ... | 2.078125 | 2 |
music/file_source.py | MaT1g3R/YasenBaka | 6 | 12772352 | from functools import partial
from music.abstract_source import AbstractSource
from music.music_util import file_detail, get_file_info
class FileSource(AbstractSource):
"""
An audio source from a file.
"""
__slots__ = ('file_path', 'title')
def __init__(self, file_path: str):
"""
... | 2.859375 | 3 |
Lab5_2020/lab5_2_1.py | AlexandrosKyriakakis/StochasticProcesses | 3 | 12772353 | from numpy import random, pi
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
Ntrials, Nhits = 1_000_000, 0
for n in range(Ntrials):
x, y, z = random.uniform(-1, 1, 3) # draw 2 samples, each uniformly distributed over (-1,1)
if x**2 + y**2 + z**2 < 1:
Nhits += 1
print("Monte Car... | 3.203125 | 3 |
botteryext/binput/inputhandler.py | IvanBrasilico/binput | 0 | 12772354 | '''InputHandler is an extension to add "Input commands" to bottery views
Usage:
On an Application:
app = App()
input = InputHandler(app)
On Patterns:
hang_user_pattern_input = HangUserPattern(input_example)
input.set_hang(hang_user_pattern_input, 'project')
patterns = [
hang_user_pattern_input,
Pattern('proje... | 2.953125 | 3 |
examples/geofence.py | datwwe/dronecontrol-MAVSDK | 0 | 12772355 | <gh_stars>0
#!/usr/bin/env python3
import asyncio
from mavsdk import Point, Polygon, System
import json
with open('./connect.json','r') as f:
aa = json.load(f)
async def run():
drone = System()
await drone.connect(system_address=aa['address'])
print("Waiting for drone...")
async for state in dro... | 2.515625 | 3 |
ATEMview/LocWindow.py | dwfmarchant/ATEMview | 2 | 12772356 | <gh_stars>1-10
""" ATEMview Location Window """
from PyQt5 import QtCore, QtWidgets
import pyqtgraph as pg
import numpy as np
from .ATEMWidget import ATEMWidget
from .colormaps import jetCM, jetBrush
class LocWidget(ATEMWidget):
"""docstring for LocWidget"""
def __init__(self, parent):
super(LocWidget... | 2.296875 | 2 |
HREMGromacs/multidir_setup.py | MauriceKarrenbrock/HREMGromacs | 0 | 12772357 | <gh_stars>0
# -*- coding: utf-8 -*-
#############################################################
# Copyright (c) 2021-2021 <NAME> #
# #
# This software is open-source and is distributed under the #
# MIT License ... | 2.609375 | 3 |
plugins/active_directory_ldap/komand_active_directory_ldap/actions/enable_user/action.py | JaredAllen13/insightconnect-plugins | 0 | 12772358 | import insightconnect_plugin_runtime
# Custom imports below
from .schema import EnableUserInput, EnableUserOutput, Input, Output
class EnableUser(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="enable_user",
description="Enabl... | 2.09375 | 2 |
keymaster/common/model/decrypted_data.py | shiroyuki/spymaster | 0 | 12772359 | <reponame>shiroyuki/spymaster
from dataclasses import dataclass
from typing import List, Any, Dict, Optional
from keymaster.common.model.credential import Credential
from keymaster.common.model.note import Note
@dataclass
class DecryptedData:
credentials: List[Credential]
notes: List[Note]
@staticmethod... | 2.53125 | 3 |
No_0018_4 Sum aka four Sum/4_sum.py | coderMaruf/leetcode-1 | 32 | 12772360 | '''
Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums
such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
Note:
The solution set must not contain duplicate quadruplets.
Example:
Given array nums = [1, 0, -1, 0, ... | 3.796875 | 4 |
app/Service/Service_Livro.py | MerciaFerreira/Projeto_devweb | 0 | 12772361 | <reponame>MerciaFerreira/Projeto_devweb<gh_stars>0
from app import db
from app.Entidades.Livro import Livro
from app.Service.Service_Autor import ServiceAutor
class ServiceLivro:
@staticmethod
def save_livro(dados):
livro = Livro.query.filter_by(isbn=dados['isbn']).first()
if not livro:
... | 2.5625 | 3 |
src/wavestate/iirrational/fitters_ZPK/codings_s/cplx_sos_NL_orig.py | wavestate/wavestate-iirrational | 0 | 12772362 | <reponame>wavestate/wavestate-iirrational
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.
# SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>>
# NOTICE: authors should document their contributions in concisely in NO... | 2.078125 | 2 |
frappe-bench/apps/erpnext/erpnext/patches/v7_2/setup_auto_close_settings.py | Semicheche/foa_frappe_docker | 1 | 12772363 | <filename>frappe-bench/apps/erpnext/erpnext/patches/v7_2/setup_auto_close_settings.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
# update the selling settings and s... | 1.414063 | 1 |
utils.py | akloster/jupyter-flightgear | 23 | 12772364 | from ipywidgets.widgets import HTML, Button
from tornado.ioloop import IOLoop
from IPython import display
import time
from traitlets import Bool
class LoopDecorator(object):
""" Runs the wrapped function in a certain interval until the user presses
the stop button. """
def __init__(self, button, interv... | 3.140625 | 3 |
utils/read_musk_data.py | qiyuangong/ppdpes_core | 0 | 12772365 | <filename>utils/read_musk_data.py
#!/usr/bin/env python
# coding=utf-8
# Read data and read tree fuctions for musk data
try:
from models.numrange import NumRange
from utils.utility import cmp_str
except ImportError:
from ..models.numrange import NumRange
from ..utils.utility import cmp_str
import pick... | 2.734375 | 3 |
T07-28/program.py | maa76/SSof-Project1920 | 2 | 12772366 | a = source()
if True:
b = a + 3 * sanitizer2(y)
else:
b = sanitizer(a)
sink(b) | 2.28125 | 2 |
tests/data_generation.py | drabenoro/geomstats | 0 | 12772367 | <filename>tests/data_generation.py
import itertools
import pytest
import geomstats.backend as gs
def better_squeeze(array):
"""Delete possible singleton dimension on first axis."""
if len(array) == 1:
return gs.squeeze(array, axis=0)
return array
class TestData:
"""Class for TestData objec... | 2.609375 | 3 |
pi/scripts/cpu_et_all.py | bergloman/gadgetWiring | 1 | 12772368 | <reponame>bergloman/gadgetWiring
import os
import sys
import os.path
import datetime
# Return CPU temperature as a character string
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return(res.replace("temp=","").replace("'C\n",""))
# Return RAM information (unit=kb) in a list
# Inde... | 3.046875 | 3 |
Projects/Opencv/read&write&showvideo.py | ankita080208/Hacktoberfest | 1 | 12772369 | import cv2
cap = cv2.VideoCapture(0)
fourcc = cv2.VideoWriter_fourcc(*'DIVX')
out = cv2.VideoWriter('output.avi',fourcc,20.0,(640,480))
#cap.isOpened()=>will return true value if cammera is linked or file name is correct and false in other case
while cap.isOpened():
ret,frame=cap.read()#ret will store true or fa... | 2.875 | 3 |
tests/test_pool.py | ndevenish/drmaa_futures | 0 | 12772370 | <filename>tests/test_pool.py<gh_stars>0
# coding: utf-8
"""Test the pool launching and management capabilities"""
import pytest
from collections import namedtuple
from drmaa_futures.master import bind_to_endpoint
# If we can't import drmaa (e.g. no good environment for it), then
# skip any tests in this file
try:
... | 2 | 2 |
src/CheckersBot.py | kartikkukreja/blog-codes | 182 | 12772371 | <gh_stars>100-1000
from copy import deepcopy
from time import time
# Global Constants
MaxUtility = 1e9
IsPlayerBlack = True
MaxAllowedTimeInSeconds = 9.5
MaxDepth = 100
class CheckersState:
def __init__(self, grid, blackToMove, moves):
self.grid = grid
self.blackToMove = blackToMove
self.moves = moves ... | 2.65625 | 3 |
localgraphclustering/algorithms/__init__.py | vishalbelsare/LocalGraphClustering | 106 | 12772372 | <gh_stars>100-1000
from .acl_list import acl_list
from .eig2_nL import eig2_nL, eig2nL_subgraph
from .fista_dinput_dense import fista_dinput_dense
from .sweepcut import sweepcut
| 1.023438 | 1 |
examples/decompose_fmri_stability.py | johnbanq/modl | 135 | 12772373 | # Author: <NAME>
# License: BSD
import warnings
from nilearn.input_data import NiftiMasker
warnings.filterwarnings("ignore", category=DeprecationWarning)
import os
from os.path import expanduser, join
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from joblib import Memory, dump
from jobli... | 1.984375 | 2 |
programs/pgm10_10.py | danielsunzhongyuan/python_practice | 0 | 12772374 | #
# This file contains the Python code from Program 10.10 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by <NAME>.
#
# Copyright (c) 2003 by <NAME>, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm10_10.txt
#
class AVLTree(BinarySearchTree):
... | 3.15625 | 3 |
tests/test_states.py | cgogolin/strawberryfields | 0 | 12772375 | <reponame>cgogolin/strawberryfields<filename>tests/test_states.py
"""
Unit tests for :class:`strawberryfields.backends.states`.
"""
import os
import sys
import signal
import unittest
import numpy as np
from numpy import pi
from scipy.special import factorial
from scipy.stats import multivariate_normal
import strawb... | 2.34375 | 2 |
launch/main.py | haraisao/rtmlaunch | 0 | 12772376 | <reponame>haraisao/rtmlaunch<gh_stars>0
#
# Simple Launcher for OpenHRI and OpenRTM-aist
# Released under the MIT license
# Copyright(C) 2018 <NAME>, All rights reserved.
#
from __future__ import print_function
import sys
import os
import time
import subprocess
import re
import traceback
import rtcpkg as pkg
import r... | 2.015625 | 2 |
terrascript/matchbox/__init__.py | hugovk/python-terrascript | 4 | 12772377 | # terrascript/matchbox/__init__.py
import terrascript
class matchbox(terrascript.Provider):
pass
| 1.1875 | 1 |
config/deploy/scheme2.py | bbc/intra-chroma-attentionCNN | 7 | 12772378 | <reponame>bbc/intra-chroma-attentionCNN<filename>config/deploy/scheme2.py
scheme = 2
deploy_path = "/work/marcb/Intra_Chroma/deploy"
config = "config/norelu_sa_mult_out.py"
| 1.0625 | 1 |
liquid_extra/filters/additional.py | jg-rp/liquid-extra | 1 | 12772379 | """Some additional filters that don't belong to any specific category."""
import json
from typing import Any
from typing import Optional
from typing import Mapping
from liquid.context import get_item
from liquid.filter import liquid_filter
from liquid.filter import with_context
from liquid.filter import with_environ... | 2.390625 | 2 |
remi/db/engine.py | Qu4n7r01d/remi | 1 | 12772380 | <reponame>Qu4n7r01d/remi<gh_stars>1-10
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker
from remi.core.constant import Client
async def dispose_all_engines():
await async_config_engine.dispose()
async_engine_scheme = f"sqlite+aiosqlite:///{Client.DATA... | 2.15625 | 2 |
core/utils/states/mailing_everyone.py | AKurmazov/hoteluni_bot | 2 | 12772381 | <reponame>AKurmazov/hoteluni_bot<filename>core/utils/states/mailing_everyone.py
from aiogram.dispatcher.filters.state import State, StatesGroup
class MailingEveryoneDialog(StatesGroup):
enter_message = State()
| 1.328125 | 1 |
from_config/run_test.py | astrockragh/IceCube | 0 | 12772382 | <filename>from_config/run_test.py
import os, sys, tqdm, json, shutil, glob
import os.path as osp
from tensorflow.keras.backend import clear_session
import tensorflow as tf
# gpu_devices = tf.config.list_physical_devices('GPU')
# if len(gpu_devices) > 0:
# print("GPU detected")
# tf.config.experimental.set_... | 2.109375 | 2 |
printevenrange.py | maurendeviia/pythoncharmers | 37 | 12772383 | <filename>printevenrange.py<gh_stars>10-100
# Python program to print Even Numbers in given range
start, end = 4, 19
# iterating each number in list
for num in range(start, end + 1):
# checking condition
if num % 2 == 0:
print(num, end = " ")
| 3.65625 | 4 |
seaplotlib/decorators.py | mvdbeek/seaplotlib | 0 | 12772384 | from functools import wraps
from .helper import abline
from . import plt
def can_set_title(function):
@wraps(function)
def set_title(*args, **kwargs):
title = kwargs.pop('title', None)
r = function(*args, **kwargs)
if title:
ax = plt.gca()
ax.set_title(title)
... | 2.53125 | 3 |
main.py | Waz0x/codingame_discord_bot | 6 | 12772385 | import os
import json
import codingame
import discord
from discord.ext import commands
with open("./config/config.json", "r") as cjson:
config = json.load(cjson)
with open("./config/db.json", "r") as dbjson:
db = json.load(dbjson)
intents = discord.Intents.default()
bot = commands.Bot(command_prefix=config["... | 2.25 | 2 |
Scheduler/dailyMission.py | louisyoungx/stock-api | 1 | 12772386 | import time
import datetime
from Status.logList import log
from Message.sendEmail import send_email
from Message.sendMessage import send_message
from Scheduler.dataAnalysis import analysis
from Update.getData import getCurrentData_torxiong
def getTime():
# time.localtime(time.time())
# int tm_sec; /* 秒 – 取值区... | 2.515625 | 3 |
braincards/settings.py | snirp/braincards-OLD | 0 | 12772387 | <filename>braincards/settings.py
import os
from dotenv import load_dotenv
# Load sensitive environment-specific settings from .env file
# These do *not* override existing System environment variables by default.
# To override, use load_dotenv(override=True)
load_dotenv()
# Build paths inside the project like this: os... | 1.78125 | 2 |
gui_app/utils/SystemUtil.py | cloudconductor/cloud_conductor_gui | 0 | 12772388 | from ..utils import ApiUtil
from ..utils import StringUtil
from ..utils.ApiUtil import Url
def get_system_list(code, token, project_id=None):
# -- Create a cloud, api call
url = Url.systemList
data = {
'auth_token': token,
'project_id': project_id,
}
# -- API call, get a response
... | 2.453125 | 2 |
main.py | MatejMecka/reddit_stellar_tip_bot | 0 | 12772389 | <gh_stars>0
import os
from praw import Reddit
from praw.models import Submission, Subreddit, Comment
from dotenv import load_dotenv
from stellar_sdk import Keypair, Asset, exceptions
import logging
import sqlite3
import mysql.connector
import sys
"""
logging.basicConfig(filename='app.log', filemode='w', format='%(na... | 2.546875 | 3 |
CargarArchivo.py | yopablo017/PROYECTO2LF | 0 | 12772390 | <filename>CargarArchivo.py
from tkinter import *
from tkinter import messagebox as MessageBox
noterminales=""
terminales=""
terminalinicial=""
contador=0
Terminales=[]
Noterminales=[]
Terminalinicial=[]
Titulos=[]
Produccion=[]
Cantidad1=[]
Cantidad2=[]
Cantidad3=[]
Validos=[]
NoValidos=[]
ContadorCantidad=0
Validar=Fa... | 3.28125 | 3 |
PYTHON/PasswordGen.py | ayushyado/HACKTOBERFEST2021-2 | 125 | 12772391 | <reponame>ayushyado/HACKTOBERFEST2021-2<filename>PYTHON/PasswordGen.py
import string
import random
#Characters List to Generate Password
characters = list(string.ascii_letters + string.digits + "!@#$%^&*()")
def password_gen():
#Length of Password from the User
length = int(input("Password length: "))
#Shuffling ... | 3.859375 | 4 |
custom/funcs.py | sergicastellasape/transformers | 0 | 12772392 | <gh_stars>0
import torch
from transformers import *
from custom.transformer_sentence import TransformerSentence
from tqdm import tqdm
import re
def load_dataset(txt_path=None,
return_embeddings=False,
MODEL=BertModel.from_pretrained('scibert-scivocab-uncased'),
TOKENIZE... | 2.546875 | 3 |
cldfspec/commands/component_readmes.py | cldf/cldf | 23 | 12772393 | """
Create the component-specific README files by concatenating `description.md` and
a generated description of the metadata.
"""
import json
from pycldf.terms import Terms
from csvw.metadata import Table
from cldfspec.util import REPO_DIR
def run(args):
for p in REPO_DIR.joinpath('components').glob('*/*.json'):... | 2.453125 | 2 |
src/initialize_constraints.py | petersiemen/P3_Implement_SLAM | 0 | 12772394 | <reponame>petersiemen/P3_Implement_SLAM<filename>src/initialize_constraints.py
import numpy as np
def initialize_constraints(N, num_landmarks, world_size):
''' This function takes in a number of time steps N, number of landmarks, and a world_size,
and returns initialized constraint matrices, omega and xi.... | 3.5625 | 4 |
scripts/count_words.py | Mitrius/TransformerBasedWikification | 0 | 12772395 | #!/home/mitrius/anaconda3/bin/python
from sys import argv
if __name__ == "__main__":
found = set()
with open(argv[1], "r") as f_in:
for line in f_in:
line_out = line.split(',')[1].strip()
line_splitted = line_out.split(' ')
for word in line_splitted:
... | 3.609375 | 4 |
ast-transformations-core/src/test/resources/org/jetbrains/research/ml/ast/transformations/multipleOperatorComparison/data/out_3.py | JetBrains-Research/ast-transformations | 8 | 12772396 | <gh_stars>1-10
x = input()
y = input()
z = input()
flag = z % (1 + 1) == 0 and (1 < x and x < 123) or (1 > y and y > x and x > y and y < 123)
def identity(var):
return var
if x ^ y == 1 or (
x % 2 == 0 and (3 > x and x <= 3 and 3 <= y and y > z and z >= 5) or (
identity(-1) + hash('hello') < 10... | 3.515625 | 4 |
demo/config.sample.py | Souukou/ZhetaokeSDK | 20 | 12772397 | APPKEY = "" # appkey,从折淘客获取
SID = # sid,从折淘客获取,与每个淘宝联盟账户对应
PID = "" # 推广位PID,在淘宝联盟中创建,需要是网站的PID
ALIPAY_KEY = "" # 代付安全密匙,在折淘客中设置
| 1.210938 | 1 |
app.py | Renaud17/HSE-KPI | 0 | 12772398 | <filename>app.py
from db import *
from get import *
from subprocess import call
import streamlit as st
import pandas as pd
import datetime
import re
import base64
from datetime import datetime,date
from datetime import datetime, timedelta
from pandas import DataFrame
from io import BytesIO
import xlsxwriter
import plot... | 2.65625 | 3 |
uni_class.py | suvojitd79/University-Database-using-python | 0 | 12772399 |
def main():
class student:
std = []
def __init__(self,name,id,cgpa):
self.name = name
self.id = id
self.cgpa = cgpa
def showId(self):
return self.id
def result(self):
if(self.cgpa > 8.5):
print(... | 3.84375 | 4 |
send_sms.py | apthagowda97/areca_price_alerter | 0 | 12772400 | <reponame>apthagowda97/areca_price_alerter
import os
from twilio.rest import Client
from twilio.http.http_client import TwilioHttpClient
import areca_price
from dotenv import load_dotenv
def send_sms(body: str):
"""Send the SMS with given message body."""
proxy_client = TwilioHttpClient(
proxy={"http... | 2.625 | 3 |
gen_luh2.py | ricardog/raster-project | 1 | 12772401 | #!/usr/bin/env python
import numpy as np
import numpy.ma as ma
import os
import rasterio
import rasterio.warp as rwarp
import subprocess
import pdb
import projections.poly as poly
from projections.rasterset import Raster, RasterSet
import projections.reproject as reproj
from projections.simpleexpr import SimpleExpr
f... | 2.03125 | 2 |
Protheus_WebApp/Modules/SIGAGFE/GFEA014TESTCASE.py | 98llm/tir-script-samples | 17 | 12772402 | <filename>Protheus_WebApp/Modules/SIGAGFE/GFEA014TESTCASE.py
from tir import Webapp
import unittest
class GFEA014(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup('SIGAGFE','03/11/2020','T1','D MG 01 ','78')
inst.oHelper.Program('GFEA014')
def test_GFEA014_CT... | 2.4375 | 2 |
dicom_tools/highlight_color.py | carlomt/dicom_tools | 7 | 12772403 | import numpy as np
def highlight_color(data, colorrange, verbose=False):
if verbose:
print("highlight_color")
kMax = data.shape[0]
jMax = data.shape[1]
iMax = data.shape[2]
valMin = float(colorrange.split(":")[0])
valMax = float(colorrange.split(":")[1])
if valMin > valMax:
... | 2.90625 | 3 |
Food Blog Backend/blog.py | oxxio/hyperskill-projects-python | 0 | 12772404 | import sqlite3
import sys
def get_pk_key(databasename, name, value):
connect_sqlite3 = sqlite3.connect(databasename)
cursor_sqlite3 = connect_sqlite3.cursor()
if name == "meals":
meal_name = ""
# 1) breakfast 2) brunch 3) lunch 4) supper
if int(value) == 1:
... | 3.4375 | 3 |
nash.py | girving/poker | 10 | 12772405 | '''Exact Nash equilibrium computation given a payoff matrix'''
from __future__ import division
from numpy import *
'''We implement a fairly unoptimized version of the simplex method for linear programming following
Wikipedia: http://en.wikipedia.org/wiki/Simplex_method. Thus, our tableu has the structure
T = [[1... | 3.390625 | 3 |
examples/rtt.py | dia38/pylink | 0 | 12772406 | <reponame>dia38/pylink
# -*- coding: utf-8 -*-
# Copyright 2017 Square, 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 requ... | 2.5625 | 3 |
icevision/models/mmdet/models/retinanet/backbones/resnet_fpn.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 580 | 12772407 | __all__ = [
"resnet50_caffe_fpn_1x",
"resnet50_fpn_1x",
"resnet50_fpn_2x",
"resnet101_caffe_fpn_1x",
"resnet101_fpn_1x",
"resnet101_fpn_2x",
"resnext101_32x4d_fpn_1x",
"resnext101_32x4d_fpn_2x",
"resnext101_64x4d_fpn_1x",
"resnext101_64x4d_fpn_2x",
]
from icevision.imports impor... | 1.421875 | 1 |
reverseWords_01b.py | robertbyers1111/python | 0 | 12772408 | <reponame>robertbyers1111/python
#!/usr/bin/python
from reverseWords_01a import Sentence
s = Sentence('abc def xyz')
s.show()
s.reverse_words()
s.show()
| 3.40625 | 3 |
docs/source/conftest.py | chaaklau/pycantonese | 124 | 12772409 | """Test code snippets embedded in the docs.
Reference: https://sybil.readthedocs.io/en/latest/use.html#pytest
"""
from doctest import NORMALIZE_WHITESPACE
from os import chdir, getcwd
from shutil import rmtree
from tempfile import mkdtemp
import pytest
from sybil import Sybil
from sybil.parsers.doctest import DocTes... | 2.453125 | 2 |
setup.py | rcarmo/miniredis | 1 | 12772410 | <filename>setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2013, <NAME>
Description: Experimental Cython compile script
License: MIT (see LICENSE.md for details)
"""
import os, sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext... | 2.109375 | 2 |
CCC/CCC '13 J3 - From 1987 to 2013.py | Joon7891/Competitive-Programming | 2 | 12772411 | def valid(a):
a = str(a)
num = set()
for char in a:
num.add(char)
return len(a) == len(num)
n = int(input())
n += 1
while True:
if valid(n):
print(n)
break
else:
n += 1
| 3.46875 | 3 |
test/test_handlers.py | charles-x-chen/pyaem | 17 | 12772412 | import pyaem
import unittest
class TestHandlers(unittest.TestCase):
def test_auth_fail(self):
response = {
'http_code': 401,
'body': 'some body'
}
try:
pyaem.handlers.auth_fail(response)
self.fail('An exception should have been raised')
... | 3.09375 | 3 |
plot/plot.py | firiceguo/my-pycuda | 0 | 12772413 | <filename>plot/plot.py
import matplotlib.pyplot as plt
def getData(file):
'''
Get the x-axis and time usage information from log.
input file - log format: 'IMAGE_W:1:Time:0.048934:ms'
output: x is a list of IMAGE_W, time is a list of microsecond.
'''
x = []
time = []
f = open(file, 'r... | 3.140625 | 3 |
qtcurate/exceptions.py | quantxt/qtcurate-sdk-python | 0 | 12772414 | class QtConnectionError(Exception):
pass
class QtRestApiError(Exception):
""" Problem with authentification"""
pass
class QtFileTypeError(Exception):
"""Invalid type of file"""
pass
class QtArgumentError(Exception):
pass
class QtVocabularyError(Exception):
pass
class QtModelError(E... | 2.09375 | 2 |
simulator/units/cavalry.py | ClementJ18/aoe | 0 | 12772415 | <reponame>ClementJ18/aoe
import objects
class Templars(objects.Unit):
def __init__(self):
super().__init__(
name = "Templar Knights",
attack = 200,
defense = 200,
range = 1,
movement = 10,
vision = 7,
type = objects.UnitTyp... | 2.765625 | 3 |
SS/offer17_printNumbers.py | MTandHJ/leetcode | 0 | 12772416 |
from typing import List
class Solution:
def printNumbers(self, n:int) -> List[int]:
def dfs(x:int):
if x == n:
res.append(''.join(num))
return
for i in range(10):
num[x] = str(i)
dfs(x+1)
... | 3.4375 | 3 |
bach/bach/sql_model.py | objectiv/objectiv-analytics | 23 | 12772417 | """
Copyright 2021 Objectiv B.V.
"""
import typing
from typing import Dict, TypeVar, Tuple, List, Optional, Mapping, Hashable, Union
from sqlalchemy.engine import Dialect
from bach.expression import Expression, get_variable_tokens, VariableToken
from bach.types import value_to_dtype, get_series_type_from_dtype
from s... | 2.4375 | 2 |
server/crud/protocol.py | lab-grid/labflow | 4 | 12772418 | <gh_stars>1-10
import casbin
from sqlalchemy.orm import Session, Query
from typing import Optional, List
from functools import reduce
from fastapi import HTTPException
from authorization import check_access
from server import Auth0ClaimsPatched
from database import (
filter_by_plate_label,
filter_by_reagent_la... | 2 | 2 |
basic/blog/models.py | mrmonkington/django-basic-apps | 1 | 12772419 | <gh_stars>1-10
import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.db.models import permalink
from django.contrib.auth.models import User
from django.template.defaultfilters import truncatewords_html
from taggit... | 2.078125 | 2 |
packages/v8env/vendor/whatwg-streams/reference-implementation/web-platform-tests/css/tools/apiclient/apiclient/apiclient.py | GagnDeep/v8-isolates | 0 | 12772420 | # coding=utf-8
#
# Copyright © 2013 Hewlett-Packard Development Company, L.P.
#
# This work is distributed under the W3C® Software License [1]
# in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# [1] http:... | 2.09375 | 2 |
src/main.py | chezyn/ir-sender | 1 | 12772421 | <filename>src/main.py
from irsender.irsender import IrSender
irsender = IrSender()
irsender.start()
| 1.132813 | 1 |
tests/orgmode.py | thetomcraig/HPI | 0 | 12772422 | <gh_stars>0
import my.notes.orgmode as orgmode
def test():
# meh
results = orgmode.query().query_all(lambda x: x.with_tag('python'))
assert len(results) > 5
| 1.859375 | 2 |
utils/keymaster.py | samadhicsec/threatware | 0 | 12772423 | <gh_stars>0
#!/usr/bin/env python3
"""
Utility methods for data.key.Key
"""
import logging
import re
from data import find
from data.key import key as Key
import utils.logging
logger = logging.getLogger(utils.logging.getLoggerName(__name__))
def get_section_for_key(row_key:Key) -> Key:
if row_key is not None:
... | 2.78125 | 3 |
rebal.py | djevans071/Reba | 0 | 12772424 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 6 13:02:10 2017
@author: psamtik071
"""
# create rebalancing datasets from trips datasets and save to rebaltrips\
from workflow.data import *
import os
month = 3
year = 2017
#trips = trip_data(year, month)
#columns to shift by
#shift_cols = ['st... | 2.875 | 3 |
main_natselect.py | JLMadsen/TetrisAI | 1 | 12772425 | """
Tetris in Python for Natural Selection
"""
from nat_selection.agent import Agent as NatAgent
from nat_selection.model import Model
import time
from enviorment.tetris import Tetris
env = Tetris({'reduced_grid': 0, 'reduced_shapes': 0}, 'Genetic algorithm')
def main():
agent = NatAgent(cores=4)
generation... | 3.359375 | 3 |
maker/SQL_Query.py | PrinceS17/Crypcy | 0 | 12772426 | <gh_stars>0
#Begin Simple SQl Queries
#@author <NAME>
import sqlite3
from django.db import connection
from .sql_operation import *
# search crypto-currencies based on prefix
# prefix: pref
def search_by_prefix(pref):
with connection.cursor() as cursor:
cursor.execute('''SELECT cr.logo, cr.id, cr.name, me.p... | 2.65625 | 3 |
Code/PeformancePoint.py | ChimieleCode/OpenSees_Script | 0 | 12772427 | <reponame>ChimieleCode/OpenSees_Script<filename>Code/PeformancePoint.py
from os import listdir, write
from numpy.lib.function_base import disp
import openseespy.opensees as ops
import time
import csv
import math
import numpy as np
from ModelOptions import field_factor
from PostProcessing.Damping import computeD... | 2.171875 | 2 |
tf2onnx/version.py | lucienwang1009/tensorflow-onnx | 1 | 12772428 | <filename>tf2onnx/version.py
version = '1.6.0'
git_version = '82f805f8fe7d2fa91e6ca9d39e153712f6887fec'
| 1.09375 | 1 |
views_cart.py | PDXCodeCoop/ecommerce | 0 | 12772429 | <gh_stars>0
from __future__ import division
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template.context import RequestContext
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
import stripe
import copy
from models import *
from vi... | 2.171875 | 2 |
pddl_parser_2/pond/utils.py | QuMuLab/action-reachability-via-deadend-detection | 4 | 12772430 | <reponame>QuMuLab/action-reachability-via-deadend-detection
from .predicate import Predicate
"""
General purpose utilities
"""
import re
def get_contents(fname: str) -> str:
"""
Return the contents of the given file.
Strip comments (lines starting with ;)
"""
fp = open(fname, "r")
contents ... | 2.609375 | 3 |
integralpsychology/settings/production.py | djangulo/integralpsychology.life | 0 | 12772431 | from .base import *
from integralpsychology.secrets import SECRET_KEY
DEBUG = False
try:
from .local import *
except ImportError:
pass
| 1.046875 | 1 |
custom_components/wort_des_tages/sensor_const.py | Ludy87/astra_germany_wort_des_tages | 0 | 12772432 | from .const import *
SENSOR_TYPES = {
ATTR_WDT_WORD: [ # state
'Wort des Tages',
'mdi:book-open-variant',
None,
],
ATTR_WDT_ORIGIN: [ # origin
'Herkunft',
'mdi:map-marker-star-outline',
None,
],
ATTR_WDT_MEANING: [ # meaning
'Bedeutung',
... | 1.09375 | 1 |
test.py | BailiShanghai/pywzl-bin2c_array | 1 | 12772433 | #!/usr/bin/env python
#
# Copyright 2001-2004 by <NAME>. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice... | 2.046875 | 2 |
external-import/kaspersky/src/kaspersky/master_yara/importer.py | opencti-platform/connectors | 0 | 12772434 | <filename>external-import/kaspersky/src/kaspersky/master_yara/importer.py<gh_stars>0
"""Kaspersky Master YARA importer module."""
import itertools
from datetime import datetime
from typing import Any, List, Mapping, Optional, Tuple
from kaspersky.client import KasperskyClient
from kaspersky.importer import BaseImport... | 2.078125 | 2 |
src/level_three/peculiar_balance.py | peterlin1/google-foobar | 0 | 12772435 | <reponame>peterlin1/google-foobar
class PeculiarBalance:
"""
Can we save them? Beta Rabbit is trying to break into a lab that contains the only known zombie cure - but there's
an obstacle. The door will only open if a challenge is solved correctly. The future of the zombified rabbit
population is at st... | 3.734375 | 4 |
yandex/yandex2016_a_a.py | knuu/competitive-programming | 1 | 12772436 | P, A, B = map(int, input().split())
if P >= A+B:
print(P)
elif B > P:
print(-1)
else:
print(A+B)
| 3.34375 | 3 |
lambdas/mail sender/code.py | PKopel/IOT-Smartband | 0 | 12772437 | import json
import smtplib
from socket import gaierror
import datetime as dt
port = 2525
smtp_server = "smtp.mailtrap.io"
login = "eb<PASSWORD>" # paste your login generated by Mailtrap
password = "<PASSWORD>" # paste your password generated by Mailtrap
sender = "<EMAIL>"
receiver = "<EMAIL>"
const = """\
Subject:... | 2.890625 | 3 |
ffws/test/parser/test_LightCycler480.py | mojaie/flashflood-workspace-sample | 0 | 12772438 | #
# (C) 2014-2017 <NAME>
# Licensed under the MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import unittest
from ffws.parser import LightCycler480 as lc
class TestLightCycler480(unittest.TestCase):
def test_file_loader(self):
data = lc.file_loader("./raw/instruments/LightCycler480.txt")
... | 2.40625 | 2 |
pybrowser/elements/file.py | abranjith/pybrowser | 22 | 12772439 | __author__ = 'Ranjith'
import os
from .utils import find_elements_for_element
from .actions import Action
from ..common_utils import get_user_home_dir
from ..exceptions import InvalidArgumentError
from ..downloader import download_url
class File(Action):
def __init__(self, driver, locator=None, element=None, wait... | 2.375 | 2 |
multitask_benchmark/datasets_generation/graph_algorithms.py | Michaelvll/pna | 249 | 12772440 | <reponame>Michaelvll/pna<filename>multitask_benchmark/datasets_generation/graph_algorithms.py
import math
from queue import Queue
import numpy as np
def is_connected(A):
"""
:param A:np.array the adjacency matrix
:return:bool whether the graph is connected or not
"""
for _ in range(int(1 + math.c... | 3.296875 | 3 |
05/05.py | teagles/teagles-pc | 0 | 12772441 | <reponame>teagles/teagles-pc<gh_stars>0
#!/usr/bin/env python
#http://www.pythonchallenge.com/pc/def/peak.html
import sys
import urllib2
import pickle
PICKLE_FILE = "http://www.pythonchallenge.com/pc/def/banner.p"
def printMatrix(matrix):
for line in matrix:
for char, num in line:
for x in ra... | 3.390625 | 3 |
creds_example.py | kellerjustin/rpi-examples | 0 | 12772442 | PASSWORD = "<PASSWORD>"
TO = ["<EMAIL>",
"<EMAIL>"]
FROM = "<EMAIL>"
| 1.15625 | 1 |
tests/test_newlines.py | MKuranowski/aiocsv | 19 | 12772443 | <reponame>MKuranowski/aiocsv
import aiofiles
import pytest
from aiocsv import AsyncDictReader, AsyncReader
DIALECT_PARAMS = {"escapechar": "$", "lineterminator": "\n"}
FILENAME = "tests/newlines.csv"
HEADER = ["field1", "field2", "field3"]
READ_VALUES = [
["hello", 'is it "me"', "you're\nlooking for"],
["this... | 2.5625 | 3 |
src/githubclient/prfile.py | Preocts/githubclient | 1 | 12772444 | <reponame>Preocts/githubclient<gh_stars>1-10
"""
CLI Controls for creates a PR with a file
Author: Preocts <Preocts#8196>
"""
from __future__ import annotations
import argparse
import logging
import os
import pathlib
import sys
from datetime import datetime
from typing import Any
from typing import Dict
from typing i... | 2.5625 | 3 |
populate_db.py | BabouZ17/open-food-facts | 0 | 12772445 | <gh_stars>0
#! /usr/bin/env python
#-*- coding: utf-8 -*-
"""
Script performered to populate the database before the program can
be used to searched among the OpenFoodFacts Database.
"""
from api_manager import ApiManager
from constants import MIN_PRODUCTS_PER_CATEGORY, DATABASE, HOST, USER, PASSWORD
from mysql.connec... | 2.796875 | 3 |
bids_app/models.py | daniel-afana/Bids | 0 | 12772446 | from django.db import models
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
class Channel(models.Model):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50)
BID_TYPES_CHOICES = (
("CPC", "CPC"),
("CPM", "... | 2.28125 | 2 |
ahd2fhir/mappers/ahd_to_medication.py | miracum/ahd2fhir | 3 | 12772447 | from fhir.resources.codeableconcept import CodeableConcept
from fhir.resources.coding import Coding
from fhir.resources.identifier import Identifier
from fhir.resources.medication import Medication, MedicationIngredient
from fhir.resources.meta import Meta
from fhir.resources.quantity import Quantity
from fhir.resource... | 2.328125 | 2 |
promtimer/util.py | aartamonau/promtimer | 0 | 12772448 | <reponame>aartamonau/promtimer
#!/usr/bin/env python3
#
# Copyright (c) 2020 Couchbase, Inc 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/lice... | 2.078125 | 2 |
microtbs_rl/utils/plotter.py | alex-petrenko/simple-reinforcement-learning | 8 | 12772449 | """
Plot the training progress data collected by the Monitor.
"""
import csv
import matplotlib.pyplot as plt
from microtbs_rl.utils.common_utils import *
from microtbs_rl.utils.monitor import Monitor
COLORS = ['blue', 'green', 'red', 'cyan', 'magenta', 'black', 'purple', 'pink',
'brown', 'orange', 'teal... | 2.40625 | 2 |
test/unit/config/test_reload_config.py | rikeshi/galaxy | 1,085 | 12772450 | <filename>test/unit/config/test_reload_config.py
import pytest
from galaxy import config
from galaxy.config import BaseAppConfiguration
from galaxy.config import reload_config_options
from galaxy.config.schema import AppSchema
R1, R2, N1, N2 = 'reloadable1', 'reloadable2', 'nonrelodable1', 'nonreloadable2' # config... | 2.328125 | 2 |