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 |
|---|---|---|---|---|---|---|
migrations/versions/16d42da99601_.py | osmearth/tasking-manager | 0 | 19000 | <reponame>osmearth/tasking-manager
"""empty message
Revision ID: 16d42da99601
Revises: <PASSWORD>
Create Date: 2018-08-23 00:18:10.765086
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '16d42da99601'
down_revision = '30b091260689'
branch_labels = None
depends_... | 1.203125 | 1 |
data_augmentation/eda/image/transforms/normalize.py | simran-arora/emmental-tutorials | 0 | 19001 | <reponame>simran-arora/emmental-tutorials<gh_stars>0
import torchvision.transforms as transforms
from eda.image.transforms.transform import EdaTransform
class Normalize(EdaTransform):
def __init__(self, mean, std, name=None, prob=1.0, level=0):
self.mean = mean
self.std = std
self.transfo... | 3.015625 | 3 |
scripts.py | intendednull/lcu_connectorpy | 0 | 19002 | <reponame>intendednull/lcu_connectorpy
import subprocess as subp
def doc():
subp.run([
'pdoc', '--html', '--overwrite',
'--html-dir', 'docs', 'lcu_connectorpy'
])
| 1.960938 | 2 |
lemon_markets/tests/ctest_account.py | leonhma/lemon_markets_sdk | 0 | 19003 | <gh_stars>0
from os import environ
from unittest import TestCase
from lemon_markets.account import Account
client_id = environ.get('CLIENT_ID')
client_token = environ.get('CLIENT_TOKEN')
class _TestAccount(TestCase):
def setUp(self):
try:
self.account = Account(client_id, client_token)
... | 2.71875 | 3 |
Right_Angle/trans.py | kameranis/IEEExtreme-8.0 | 0 | 19004 | N=input()
num = [int(raw_input().split()[2]) for i in range(N)]
num = list(set(num))
print num
| 3.484375 | 3 |
magnetos/crypto/caesar_rail_fence_crack.py | restran/magnetos | 20 | 19005 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
凯撒困在栅栏里了,需要你的帮助。
sfxjkxtfhwz9xsmijk6j6sthhj
flag格式:NSFOCUS{xxx},以及之前的格式
"""
def rail_fence(e):
# e = 'tn c0afsiwal kes,hwit1r g,npt ttessfu}ua u hmqik e {m, n huiouosarwCniibecesnren.'
elen = len(e)
field = []
for i in range(2, ... | 3.171875 | 3 |
backend/client/admin.py | katserafine/GenieHub | 1 | 19006 | <reponame>katserafine/GenieHub
from django.contrib import admin
from django.utils.html import format_html
from django.contrib.auth.models import Permission
from .models import *
# Register your models here.
admin.site.register(projectWorker)
admin.site.register(project)
admin.site.register(leadContact)
class ClientA... | 1.828125 | 2 |
dataset.py | donghankim/comma_ai_speed_challenge | 0 | 19007 | import os
import pandas as pd
import numpy as np
import torch
from torchvision import transforms
from torch.utils.data import Dataset
import matplotlib.pyplot as plt
from skimage import io
import pdb
class FrameDataset(Dataset):
def __init__(self, csv_file, train_dir):
self.labels = pd.read_csv(csv_file)
... | 2.59375 | 3 |
pairwise/pairwise_theano.py | numfocus/python-benchmarks | 31 | 19008 | # Authors: <NAME>
# License: MIT
import theano
import theano.tensor as TT
def pairwise_theano_tensor_prepare(dtype):
X = TT.matrix(dtype=str(dtype))
dists = TT.sqrt(
TT.sum(
TT.sqr(X[:, None, :] - X),
axis=2))
name = 'pairwise_theano_broadcast_' + dtype
rval = theano.fu... | 2.375 | 2 |
pandapower/pypower/idx_bus.py | bergkvist/pandapower | 1 | 19009 | # -*- coding: utf-8 -*-
# Copyright 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. ... | 2.5 | 2 |
example.py | vinhntb/geo_redis | 0 | 19010 | <filename>example.py
# -*- coding: utf-8 -*-
# !/usr/bin/python
#
# example.py
#
#
# Created by vinhntb on 6/27/17.
# Copyright (c) 2017 geo_redis. All rights reserved.
import sys
from bunch import Bunch
from constants import GEO_USER_VISITED
from geo_redis.geo_redis import GeoRedis
def add_user_visited():
u... | 2.578125 | 3 |
f5/bigip/tm/asm/policies/test/functional/test_signatures.py | nghia-tran/f5-common-python | 272 | 19011 | <reponame>nghia-tran/f5-common-python
# Copyright 2017 F5 Networks 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 b... | 1.890625 | 2 |
functions.py | anoopjakob/flowers_classifier | 0 | 19012 | <filename>functions.py
import torch
import numpy as np
from PIL import Image
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
# changing the already created codes in jupyter notebbooks to a functions
def load_data(data_dir):
train_tr... | 2.765625 | 3 |
monotonic_cffi.py | rkyoto/monotonic_cffi | 1 | 19013 | <filename>monotonic_cffi.py<gh_stars>1-10
"""
monotonic_cffi:
Just a cffi version of existing monotonic module on PyPI. See:
https://pypi.python.org/pypi/monotonic
Tested with PyPy 2.6.1 and 4.0.0 on Windows, OSX and Ubuntu.
Copyright 2015 <NAME> <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "... | 2.1875 | 2 |
renormalizer/mps/tests/test_mpproperty.py | shuaigroup/Renormalizer | 27 | 19014 | # -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import pytest
from renormalizer.mps import Mps, Mpo, MpDm, ThermalProp
from renormalizer.mps.backend import np
from renormalizer.tests.parameter import holstein_model
from renormalizer.utils import Quantity
creation_operator = Mpo.onsite(... | 1.789063 | 2 |
pelee/pth2keras.py | DragonGongY/mmdet-ui | 1 | 19015 | # -*- coding: utf-8 -*-
import sys
import numpy as np
import torch
from torch.autograd import Variable
from pytorch2keras.converter import pytorch_to_keras
import torchvision
import os.path as osp
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
from keras import backend as K
K.clear_session()
K.set_image_dim_or... | 2.828125 | 3 |
marketservice/models.py | mrprofessor/farmersmarket | 0 | 19016 | from typing import List, Union
import json
class Product:
def __init__(self, name: str, code: str, price: float):
self.name = name
self.code = code
self.price = price
# Breakdown coupon's description into quantifiable attributes
# For example: BOGO on coffee can be translated as an objec... | 3.03125 | 3 |
sdk/eventhub/azure-eventhubs/azure/eventhub/eventprocessor/utils.py | gautam714/azure-sdk-for-python | 0 | 19017 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 2.40625 | 2 |
tools/examples.py | Hellowlol/plexapi | 4 | 19018 | <filename>tools/examples.py
# -*- coding: utf-8 -*-
"""
PlexAPI Examples
As of Plex version 0.9.11 I noticed that you must be logged in
to browse even the plex server locatewd at localhost. You can
run this example suite with the following command:
>> python examples.py -u <USERNAME> -p <PASSWORD> -s <SERVERNAME>
"""
... | 2.515625 | 3 |
BowlingGame/bowling_game_test.py | WisWang/code-kata | 2 | 19019 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 - hongzhi.wang <<EMAIL>>
'''
Author: hongzhi.wang
Create Date: 2019-09-04
Modify Date: 2019-09-04
'''
import unittest
from .bowling_game import BowlingGame
class TestBowlingGame(unittest.TestCase):
def setUp(self):
self.g = BowlingGame... | 3.25 | 3 |
palo_alto_firewall_analyzer/validators/bad_group_profile.py | moshekaplan/palo_alto_firewall_analyzer | 4 | 19020 | <gh_stars>1-10
from palo_alto_firewall_analyzer.core import register_policy_validator, BadEntry
@register_policy_validator("BadGroupProfile", "Rule uses an incorrect group profile")
def find_bad_group_profile_setting(profilepackage):
device_groups = profilepackage.device_groups
devicegroup_exclusive_objects =... | 2.65625 | 3 |
metagym/liftsim/tests/qa_test.py | WorldEditors/MetaGym | 0 | 19021 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 1.992188 | 2 |
tests/AdagucTests/AdagucTestTools.py | lukas-phaf/adaguc-server | 1 | 19022 | <gh_stars>1-10
import os
from io import BytesIO
import shutil
from adaguc.CGIRunner import CGIRunner
from lxml import etree
from lxml import objectify
import re
ADAGUC_PATH = os.environ['ADAGUC_PATH']
class AdagucTestTools:
def getLogFile(self):
ADAGUC_LOGFILE = os.environ['ADAGUC_LOGFILE']
try:... | 2.171875 | 2 |
emotion_recognition_using_speech/test.py | TomKingsfordUoA/emotion-recognition-using-speech | 0 | 19023 | import os
import wave
from array import array
from struct import pack
from sys import byteorder
import pyaudio
import soundfile
from .emotion_recognition import EmotionRecognizer
from .utils import get_best_estimators
THRESHOLD = 500
CHUNK_SIZE = 1024
FORMAT = pyaudio.paInt16
RATE = 16000
SILENCE = 30
def is_silen... | 2.8125 | 3 |
training/dataset.py | liucong3/camelyon17 | 0 | 19024 | <reponame>liucong3/camelyon17
import numpy as np
import torch.utils.data as data
import csv
import cv2
from PIL import Image
from utils import progress_bar
class CamelDataset(data.Dataset):
""" camelyon17 dataset class for pytorch dataloader
"""
def __init__(self, csv_path='train.csv', limit=0, tran... | 2.90625 | 3 |
src/settings/settings.py | lamas1901/telegram__pdf-bot | 0 | 19025 | <reponame>lamas1901/telegram__pdf-bot
from ..utils import get_env_var
from pathlib import Path
BASE_DIR = Path(__file__).parent.parent
TG_TOKEN = get_env_var('TG_TOKEN')
YMONEY_TOKEN = get_env_var('YTOKEN')
PROMO_CODE = get_env_var('PROMO_CODE')
| 1.453125 | 1 |
sheet.py | roocell/myfreelapextract | 0 | 19026 | <filename>sheet.py
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pprint
import logging
import random
# https://medium.com/daily-python/python-script-to-edit-google-sheets-daily-python-7-aadce27846c0
# tutorial is older, so the googple API setup is a little outdated
# call di... | 2.875 | 3 |
image_generation/parse_models.py | pudumagico/clevr-dataset-gen | 0 | 19027 | <filename>image_generation/parse_models.py
import sys
import re
from typing import Sized
def parse_models(models_file):
color = re.compile(r'hasColor\(\d,\w+\)')
shape = re.compile(r'hasShape\(\d,\w+\)')
size = re.compile(r'hasSize\(\d,\w+\)')
texture = re.compile(r'hasTexture\(\d,\w+\)')
out_co... | 3.015625 | 3 |
Codes of the SMD2II model/Codes of Transfer-learning of Bert (stage I classification)/produce_submit_json_file.py | 0AnonymousSite0/Social-media-data-to-Interrelated-informtion-to-Parameters-of-virtual-road-model | 1 | 19028 | # coding=utf-8
import os
import json
# 获取最新模型预测数据文件夹
def get_latest_model_predict_data_dir(new_epochs_ckpt_dir=None):
# 获取文件下最新文件路径
def new_report(test_report):
lists = os.listdir(test_report) # 列出目录的下所有文件和文件夹保存到lists
lists.sort(key=lambda fn: os.path.getmtime(test_report + "/" + fn)) # 按时间排序... | 2.359375 | 2 |
examples/artifact_with_fanout.py | bchalk101/hera-workflows | 0 | 19029 | <gh_stars>0
from hera import (
InputArtifact,
InputFrom,
OutputArtifact,
Task,
Workflow,
WorkflowService,
)
def writer():
import json
with open('/file', 'w+') as f:
for i in range(10):
f.write(f'{json.dumps(i)}\n')
def fanout():
import json
import sys
... | 2.359375 | 2 |
fastparquet/__init__.py | jorisvandenbossche/fastparquet | 0 | 19030 | """parquet - read parquet files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .thrift_structures import parquet_thrift
from .core import read_thrift
from .writer import write
from . import core, schema, conv... | 1.40625 | 1 |
third_party/virtualbox/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py | Fimbure/icebox-1 | 521 | 19031 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: InstructionTestGen.py $
"""
Instruction Test Generator.
"""
from __future__ import print_function;
__copyright__ = \
"""
Copyright (C) 2012-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.... | 2.046875 | 2 |
bann/b_data_functions/pytorch/shared_memory_interface.py | arturOnRails/BANN | 0 | 19032 | # -*- coding: utf-8 -*-
""".. moduleauthor:: <NAME>"""
import abc
from copy import copy
from dataclasses import dataclass
from multiprocessing.managers import SharedMemoryManager
from multiprocessing.shared_memory import SharedMemory
from typing import Tuple, List, Optional, final, TypeVar, Generic
from torch.utils.da... | 2.28125 | 2 |
packages/python/yap_kernel/yap_kernel/tests/test_io.py | ryandesign/yap | 90 | 19033 | <reponame>ryandesign/yap
"""Test IO capturing functionality"""
import io
import zmq
from jupyter_client.session import Session
from yap_kernel.iostream import IOPubThread, OutStream
import nose.tools as nt
def test_io_api():
"""Test that wrapped stdout has the same API as a normal TextIO object"""
session ... | 1.851563 | 2 |
OSIx/modules/temp_file_manager.py | guibacellar/OSIx | 1 | 19034 | <gh_stars>1-10
"""Temporary Files Manager."""
import logging
from configparser import ConfigParser
from typing import Dict
from OSIx.core.base_module import BaseModule
from OSIx.core.temp_file import TempFileHandler
logger = logging.getLogger()
class TempFileManager(BaseModule):
"""Temporary File Manager."""
... | 2.203125 | 2 |
vectors/vectormath.py | sbanwart/data-science | 0 | 19035 | import math
def vector_add(v, w):
"""adds corresponding elements"""
return [v_i + w_i
for v_i, w_i in zip(v, w)]
def vector_subtract(v, w):
"""subtracts corresponding elements"""
return [v_i - w_i
for v_i, w_i in zip(v, w)]
def vector_sum(vectors):
return reduce(vector_add, vector... | 4.09375 | 4 |
fancyrat.py | avacadoPWN/fancyrat | 1 | 19036 | #!/bin/python3
import exploit
import ui_setup
from time import sleep
checkrain = exploit.Checkrain()
checkrain.REMOTE_SSH_CC = '<EMAIL>'
window = ui_setup.UI.window
keep_printing=True
while True:
if window['-OUTPUT-'].DisplayText.count('\n') >= 14:
window['-OUTPUT-'].DisplayText = window['-OUTPUT-']... | 2.1875 | 2 |
sysinv/sysinv/sysinv/sysinv/tests/helm/test_base.py | albailey/config | 10 | 19037 | <gh_stars>1-10
# Copyright (c) 2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import mock
from sysinv.helm.base import BaseHelm
from sysinv.helm.helm import HelmOperator
from sysinv.tests import base as test_base
class TestHelmBase(test_base.TestCase):
def test_num_replicas_for_platfor... | 2.09375 | 2 |
tests/test_as_decimal.py | lkattis-signal/SignalSDK | 10 | 19038 | <filename>tests/test_as_decimal.py
from decimal import Decimal
from signal_ocean._internals import as_decimal
def test_handles_None():
assert as_decimal(None) is None
def test_handles_empty_strings():
assert as_decimal("") is None
def test_parses_strings():
assert as_decimal("12.345") == Decimal("12.... | 2.90625 | 3 |
Francisco_Trujillo/Assignments/registration/serverre.py | webguru001/Python-Django-Web | 5 | 19039 | <reponame>webguru001/Python-Django-Web<filename>Francisco_Trujillo/Assignments/registration/serverre.py
from flask import Flask, render_template, request, redirect, session, flash
import re
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$')
app = Flask(__name__)
app.secret_key = 'irtndvieurnvi... | 2.671875 | 3 |
eternalghost.py | awareseven/eternalghosttest | 2 | 19040 | <reponame>awareseven/eternalghosttest
import socket
import struct
import sys
banner = """
_ _ _ _
| | | | | | | |
___| |_ ___ _ __ _ __ __ _| | __ _| |__ ___ ___| |_
/ _ \ __/ _ \ '__| '_ \ / _` | |/ _` | '_ \ / _ ... | 2.25 | 2 |
pedantic/tests/tests_pedantic.py | LostInDarkMath/Pedantic-python-decorators | 0 | 19041 | import os.path
import sys
import types
import typing
import unittest
from datetime import datetime, date
from functools import wraps
from io import BytesIO, StringIO
from typing import List, Tuple, Callable, Any, Optional, Union, Dict, Set, FrozenSet, NewType, TypeVar, Sequence, \
AbstractSet, Iterator, NamedTuple,... | 2.515625 | 3 |
robosuite/utils/mjcf_utils.py | kyungjaelee/robosuite | 0 | 19042 | <reponame>kyungjaelee/robosuite<gh_stars>0
# utility functions for manipulating MJCF XML models
import xml.etree.ElementTree as ET
import os
import numpy as np
from collections.abc import Iterable
from PIL import Image
from pathlib import Path
import robosuite
RED = [1, 0, 0, 1]
GREEN = [0, 1, 0, 1]
BLUE = [0, 0, 1,... | 2.3125 | 2 |
cpgames/modules/core/__init__.py | Wasabii88/Games | 1 | 19043 | <reponame>Wasabii88/Games<gh_stars>1-10
'''initialize'''
from .ski import SkiGame
from .maze import MazeGame
from .gobang import GobangGame
from .tetris import TetrisGame
from .pacman import PacmanGame
from .gemgem import GemGemGame
from .tankwar import TankWarGame
from .sokoban import SokobanGame
from .pingpong import... | 1.007813 | 1 |
jobs/migrations/0005_job_date.py | AkinWilderman/myPort | 0 | 19044 | # Generated by Django 2.1.7 on 2019-07-06 04:48
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('jobs', '0004_auto_20190706_0012'),
]
operations = [
migrations.AddField(
model_name='job',
... | 1.757813 | 2 |
build_an_ai_startup_demo/app/__init__.py | bbueno5000/BuildAnAIStartUpDemo | 0 | 19045 | <reponame>bbueno5000/BuildAnAIStartUpDemo
import app
import flask
import flask_debugtoolbar
app = flask.Flask(__name__)
app.config.from_object('app.config')
db = flask.ext.sqlalchemy.SQLAlchemy(app)
mail = flask.ext.mail.Mail(app)
app.config['DEBUG_TB_TEMPLATE_EDITOR_ENABLED'] = True
app.config['DEBUG_TB_PROFILER_E... | 2.03125 | 2 |
main.py | shoulderhu/heroku-ctf-www | 0 | 19046 | import os
from app import create_app
from dotenv import load_dotenv
# .env
dotenv_path = os.path.join(os.path.dirname(__file__), ".env")
if os.path.exists(dotenv_path):
load_dotenv(dotenv_path)
app = create_app(os.environ.get("FLASK_CONFIG") or "default")
if __name__ == "__main__":
app.run() | 2.265625 | 2 |
COMP/W01/class_DFA.py | joao-frohlich/BCC | 10 | 19047 | <filename>COMP/W01/class_DFA.py
class DFA:
current_state = None
current_letter = None
valid = True
def __init__(
self, name, alphabet, states, delta_function, start_state, final_states
):
self.name = name
self.alphabet = alphabet
self.states = states
self.de... | 3.609375 | 4 |
src/apps/devices/cubelib/emulator.py | ajintom/music_sync | 0 | 19048 | #!/bin/env python
#using the wireframe module downloaded from http://www.petercollingridge.co.uk/
import mywireframe as wireframe
import pygame
from pygame import display
from pygame.draw import *
import time
import numpy
key_to_function = {
pygame.K_LEFT: (lambda x: x.translateAll('x', -10)),
pygame.K_RIGHT... | 2.84375 | 3 |
lambda_handlers/errors.py | renovate-tests/lambda-handlers | 0 | 19049 | class LambdaError(Exception):
def __init__(self, description):
self.description = description
class BadRequestError(LambdaError):
pass
class ForbiddenError(LambdaError):
pass
class InternalServerError(LambdaError):
pass
class NotFoundError(LambdaError):
pass
class ValidationError(L... | 2.46875 | 2 |
src/topbuzz/management/commands/topbuzz_stat.py | lucemia/gnews | 0 | 19050 | # -*- encoding=utf8 -*-
from django.core.management.base import BaseCommand
from datetime import timedelta, datetime
from topbuzz.tasks import stat
import argparse
def valid_date(s):
try:
return datetime.strptime(s, "%Y-%m-%d")
except ValueError:
msg = "Not a valid date: '{0}'.".format(s)
... | 2.28125 | 2 |
main.py | anirudha-bs/Distributed_storage_ipfs | 0 | 19051 | <reponame>anirudha-bs/Distributed_storage_ipfs
from files import write_key, load_key, encrypt, decrypt
import os
from ipfs import add,pin,get_file
def switch(option):
return switcher.get(option, default)()
# Encrypts file and adds to ipfs
def encrypt_ipfs_add():
file=input("Enter the file name to be added - "... | 3.359375 | 3 |
web-app/ZGenerator.py | IsaacGuan/SGSG | 2 | 19052 | import os
import tensorflow as tf
import numpy as np
import mcubes
from ops import *
class ZGenerator:
def __init__(self, sess, z_dim=128, ef_dim=32, gf_dim=128, dataset_name=None):
self.sess = sess
self.input_size = 64
self.z_dim = z_dim
self.ef_dim = ef_dim
self... | 2.1875 | 2 |
tests/crud/test_crud_user.py | congdh/fastapi-realworld | 0 | 19053 | import pytest
from faker import Faker
from fastapi.encoders import jsonable_encoder
from pydantic.types import SecretStr
from sqlalchemy.orm import Session
from app import crud, schemas
from app.core import security
def test_create_user(db: Session) -> None:
faker = Faker()
profile = faker.profile()
emai... | 2.5 | 2 |
tests/cli_test.py | de-code/layered-vision | 5 | 19054 | <filename>tests/cli_test.py<gh_stars>1-10
from pathlib import Path
from typing import Union
import cv2
import pytest
from layered_vision.cli import (
parse_value_expression,
parse_set_value,
get_merged_set_values,
main
)
EXAMPLE_IMAGE_URL = (
r'https://raw.githubusercontent.com/numpy/numpy'
... | 2.4375 | 2 |
src/discordbot/writeToken.py | mavjav-edu/discordpy | 1 | 19055 | <reponame>mavjav-edu/discordpy
import os
import re
import base64
import keyring
from cryptography.fernet import Fernet
# Make sure the key, Fernet objects within scope of future dependencies
# by setting to here (to nothing, for now)
frn = Fernet(base64.b64encode(bytes(list(range(32)))))
key = bytes(0)
if os.path.isf... | 3.171875 | 3 |
Deprecated/three_stmts.py | FrankVolpe/SIMFIN | 1 | 19056 | from base_classes import *
class income_statement(financial_statement):
''' __init__ will create the necessary accounts for an income statement.
--------------------------------------------------------------------------
No data must be added initially, use function add_data for this '''
def __init__(se... | 3.546875 | 4 |
agents/ag_useHisExplorDecayedP.py | a-pedram/kaggle-mab | 0 | 19057 | <reponame>a-pedram/kaggle-mab
import numpy as np
from collections import Counter
decay_rate = 0.97
n_rounds = 2000
bandit_count = 100
total_reward = None
last_bandit = None
last_reward = None
his_hits = None
his_record = None
my_record = None
my_hits = None
wins = None
losses = None
bandits_record = None
record_inde... | 2.328125 | 2 |
principles-of-computing/Practice Exercises/Solitaire Mancala/Solitaire Mancala/poc_simpletest.py | kingwatam/misc-python | 1 | 19058 | """
Lightweight testing class inspired by unittest from Pyunit
https://docs.python.org/2/library/unittest.html
Note that code is designed to be much simpler than unittest
and does NOT replicate uinittest functionality
"""
class TestSuite:
"""
Create a suite of tests similar to unittest
"""
d... | 3.265625 | 3 |
jwc_core/jwc_sender.py | Inetgeek/Notice-Pusher | 2 | 19059 | <gh_stars>1-10
#!/usr/bin/python3
# coding: utf-8
import sys
import os, time, datetime
import smtplib
from email import (header)
from email.mime import (text, multipart)
with open(r'/home/jwc_notice.txt', "r+", encoding="utf-8") as file: #自行更改路径
a = file.read()
send_title = "机器人风险提示"
send_head = '<p style="color... | 2.546875 | 3 |
distributed_systems/ftp/frontend.py | JRhodes95/net-sys-cw | 0 | 19060 | import os
os.environ["PYRO_LOGFILE"] = "pyro.log"
os.environ["PYRO_LOGLEVEL"] = "DEBUG"
import Pyro4
import Pyro4.util
import Pyro4.naming
import sys
import pprint
"""
Front end controller for the 2017/18 Networks and Distributed Systems
Summative Assignment.
Author: Z0954757
"""
sys.excepthook = Pyro4.util.excepth... | 2.578125 | 3 |
tests/test_hexamer/test_search_hexamer.py | zyxue/kleat3 | 0 | 19061 | import unittest
from kleat.hexamer.search import plus_search, minus_search, search
from kleat.hexamer.hexamer import extract_seq
class TestSearchHexamer(unittest.TestCase):
def test_plus_search(self):
self.assertEqual(plus_search('GGGAATAAAG', 9), ('AATAAA', 16, 3))
self.assertEqual(plus_search('... | 2.71875 | 3 |
_mod_Community/LineDrawer/Lines_Callbacks.py | tianlunjiang/_NukeStudio_v2 | 6 | 19062 | import nuke
def delete_pt():
max_pts = int(nuke.thisNode().knob('Max PTS').value()) - 1
if max_pts < 2:
nuke.message('Minimum 2 points')
return
pt_num = int(nuke.thisKnob().name()[6:])
node = nuke.thisNode()
for pt in xrange(pt_num, max_pts):
knob_name = 'pt' + str(pt)
... | 2.921875 | 3 |
臺灣言語平臺/management/commands/加sheet的json.py | sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-tai5 | 14 | 19063 | import json
from django.core.management.base import BaseCommand
from 臺灣言語平臺.正規化團隊模型 import 正規化sheet表
from django.conf import settings
class Command(BaseCommand):
help = '加sheet的json'
def add_arguments(self, parser):
parser.add_argument(
'服務帳戶json',
type=str,
hel... | 2.171875 | 2 |
flask_googlelogin.py | leakim34/flask-googlelogin | 35 | 19064 | """
Flask-GoogleLogin
"""
from base64 import (urlsafe_b64encode as b64encode,
urlsafe_b64decode as b64decode)
from urllib import urlencode
from urlparse import parse_qsl
from functools import wraps
from flask import request, redirect, abort, current_app, url_for
from flask_login import LoginManage... | 2.6875 | 3 |
datajoint_utilities/dj_search/search.py | iamamutt/datajoint-utilities | 1 | 19065 | <filename>datajoint_utilities/dj_search/search.py
import datajoint as dj
import re
import inspect
from termcolor import colored
class DJSearch:
def __init__(self, db_prefixes=[''], context=None):
db_prefixes = [db_prefixes] if isinstance(db_prefixes, str) else db_prefixes
self.context = context o... | 2.25 | 2 |
acvrct.py | lyzcoote/VRChat-Py-Launcher | 0 | 19066 | <reponame>lyzcoote/VRChat-Py-Launcher
################################################################################
# #
# Modules #
# ... | 1.828125 | 2 |
keepercommander/vault.py | Keeper-Security/commander | 0 | 19067 | <filename>keepercommander/vault.py<gh_stars>0
# _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# <NAME>
# Contact: <EMAIL>
#
import abc
import datetime
import json
from typing import Optional, List, Tuple, Iterable, Type, Union, Dict, Any
import... | 2.484375 | 2 |
tests/test_quaternionic.py | mhostetter/quaternionic | 40 | 19068 | <reponame>mhostetter/quaternionic
import warnings
import numpy as np
import quaternionic
import pytest
def test_constants():
for const in ['one', 'x', 'y', 'z', 'i', 'j', 'k']:
assert hasattr(quaternionic, const)
c = getattr(quaternionic, const)
with pytest.raises(ValueError):
... | 2.265625 | 2 |
carla_ros_bridge/src/carla_ros_bridge/coordinate_converter.py | OlafOrangi/ros-bridge | 0 | 19069 | <reponame>OlafOrangi/ros-bridge<filename>carla_ros_bridge/src/carla_ros_bridge/coordinate_converter.py
#!/usr/bin/env python
from geometry_msgs.msg import Pose, Point, Quaternion, Vector3
import numpy as np
import tf
def convert_pose(pose):
"""
convert pose between left and right-hand coordinate system
:p... | 3.078125 | 3 |
models/IFR_generalized_SB.py | rileymcmorrow/C-SFRAT | 0 | 19070 | from core.model import Model
class IFR_Generalized_SB(Model):
name = "IFR generalized Salvia & Bollinger"
shortName = "IFRGSB"
# initial parameter estimates
beta0 = 0.01
parameterEstimates = (0.1, 0.1)
def hazardSymbolic(self, i, args):
# args -> (c, alpha)
f = 1... | 2.53125 | 3 |
TrendTrading/ProbModel/CheckScripts/updated market indicator.py | benjabee10/WKUResearch | 0 | 19071 | import numpy as np
import pandas as pd
import talib
big= 200
small= 50
threshold=0.02
#context.market (shortperiod, longperiod):
#Market Values= 0-negative, 1-no trend, 2-positive
def initialize(context):
context.spy= sid(8554)
schedule_function(check)
def check(context, data):
spydata= data.histo... | 2.59375 | 3 |
google_drive_online_decompression.py | xunyixiangchao/Google-Drive-Online-Decompression | 0 | 19072 | # -*- coding: utf-8 -*-
"""Google_Drive_Online_Decompression.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/16e0tv3LEkAFaYHmKH2H63Cg6rpCNWFky
# **第一步 绑定GoogleDrive**
"""
#@markdown 点击左侧按钮,授权绑定GoogleDrive
from google.colab import drive
drive.mo... | 2.453125 | 2 |
hackerearth/Algorithms/A plane journey/solution.py | ATrain951/01.python-com_Qproject | 4 | 19073 | """
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
n, m = map(int, input().strip().split())
a ... | 3.234375 | 3 |
ml/av/io/__init__.py | necla-ml/ml | 1 | 19074 | <reponame>necla-ml/ml
"""APIs from ml.vision.io and ml.audio.io
"""
from .api import * | 0.703125 | 1 |
addon.py | codingPF/plugin.video.newsApp | 0 | 19075 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
The main addon module
SPDX-License-Identifier: MIT
"""
# -- Imports ------------------------------------------------
import xbmcaddon
import resources.lib.appContext as appContext
import resources.lib.settings as Settings
import resources.lib.logger as Logger
import resources.... | 1.640625 | 2 |
bfgame/components/equipment.py | ChrisLR/BasicDungeonRL | 3 | 19076 | <gh_stars>1-10
from bflib import units
from core import contexts
from core.components import Component, listing
from core.messaging import StringBuilder, Actor, Target, Verb
@listing.register
class Equipment(Component):
NAME = "equipment"
__slots__ = ["armor_restrictions", "weapon_restrictions", "weapon_size_... | 2.5 | 2 |
students/K33402/Shuginin_Yurii/LR2/homework_board/board_app/urls.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 0 | 19077 | <filename>students/K33402/Shuginin_Yurii/LR2/homework_board/board_app/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.StartPageView.as_view()),
path('accounts/created/', views.NotificationView.as_view()),
path('accounts/<int:pk>/update/', views.StudentUpdate.as_view(... | 1.804688 | 2 |
tests/enviroments_test/test_environments.py | DKE-Data/agrirouter-sdk-python | 0 | 19078 | """Test agrirouter/environments/environments.py"""
from agrirouter.environments.environments import ProductionEnvironment as PE
from agrirouter.environments.environments import QAEnvironment as QAE
from tests.constants import application_id
class TestPE:
def test_get_base_url(self):
assert PE().get_base_... | 2.25 | 2 |
foursquare/tests/test_lang.py | milind-shakya-sp/foursquare | 1 | 19079 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# (c) 2016 <NAME>
import logging; log = logging.getLogger(__name__)
from . import MultilangEndpointTestCase
class MultiLangTestCase(MultilangEndpointTestCase):
"""
General
"""
def test_lang(self):
"""Test a wide swath of languages"... | 2.375 | 2 |
src/tests/model_deployment_tests.py | vravisrpi/mlops-vertex | 0 | 19080 | <filename>src/tests/model_deployment_tests.py
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 1.914063 | 2 |
noxfile.py | aodag/asbool | 8 | 19081 | <filename>noxfile.py
import nox
nox.options.sessions = ["test"]
@nox.session
def test(session):
session.install("-e", ".[testing]")
session.run("pytest")
@nox.session
def pack(session):
session.install("build")
session.run("python", "-m", "build", ".") | 1.578125 | 2 |
selectGoodFeatures.py | TimSC/PyFeatureTrack | 33 | 19082 | <reponame>TimSC/PyFeatureTrack
from __future__ import print_function
import math, numpy as np
from PIL import Image
from klt import *
from error import *
from convolve import *
from klt_util import *
import goodFeaturesUtils
class selectionMode:
SELECTING_ALL = 1
REPLACING_SOME = 2
KLT_verbose = 1
#***************... | 2.5625 | 3 |
pysparsdr/pySparSDR.py | ucsdwcsng/pySparSDR | 0 | 19083 | #/bin/python3
import numpy as np
from scipy import signal as sig
class pySparSDRCompress():
'''
Implementation of the SparSDR Compressor based on
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>. and <NAME>., 2019, June. Sparsdr: Sparsity-proportional backhaul and compute for sdrs. In Proceedings of ... | 2.640625 | 3 |
dirtyclean/tests/test_dirtyclean.py | paultopia/dirtyclean | 2 | 19084 | <reponame>paultopia/dirtyclean
from dirtyclean import clean
import unittest
class TestDirtyClean(unittest.TestCase):
def setUp(self):
self.uglystring = " st—up•id ‘char−ac ter..s’, in its’ string...”Ç "
with open("multiline.txt") as mt:
self.multiline = mt.read()
def test_basi... | 3.09375 | 3 |
findNearestControl.py | petrarch1603/SurveyApplications | 1 | 19085 | <filename>findNearestControl.py
import csv
control = "/Users/patrickmcgranaghan1/Documents/Python/python_work/SurveyApplications/source_data/control.csv"
set_points = "/Users/patrickmcgranaghan1/Documents/Python/python_work/SurveyApplications/source_data/setPoints.csv"
max_hypotenuse = 200 # Integer in feet
# Note i... | 3.46875 | 3 |
stac_compose/collections/controller.py | dgi-catalog/stac-compose | 0 | 19086 | <gh_stars>0
from json import dumps
from pprint import PrettyPrinter
from cerberus.validator import Validator
from flask import request
from flask_restx import Resource
from werkzeug.exceptions import BadRequest
from stac_compose.collections import ns as api
from stac_compose.collections.business import CollectionsBus... | 2.140625 | 2 |
python/tvm/auto_scheduler/workload_registry.py | jiangzoi/incubator-tvm | 2 | 19087 | # 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"); you may not u... | 2.453125 | 2 |
main/xrandr/template.py | RoastVeg/cports | 0 | 19088 | pkgname = "xrandr"
pkgver = "1.5.1"
pkgrel = 0
build_style = "gnu_configure"
hostmakedepends = ["pkgconf"]
makedepends = ["libxrandr-devel"]
pkgdesc = "Command line interface to X RandR extension"
maintainer = "q66 <<EMAIL>>"
license = "MIT"
url = "https://xorg.freedesktop.org"
source = f"$(XORG_SITE)/app/{pkgname}-{pk... | 1.65625 | 2 |
src/arch/riscv/RiscvCPU.py | yclin99/CS251A_final_gem5 | 1 | 19089 | <filename>src/arch/riscv/RiscvCPU.py<gh_stars>1-10
# Copyright 2021 Google, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of co... | 1.375 | 1 |
misc/validateInput.py | viju4you/Python | 110 | 19090 | # Validate input
while True:
print('Enter your age:')
age = input()
if age.isdecimal():
break
print('Pleas enter a number for your age.')
| 4.125 | 4 |
ckan/migration/versions/041_resource_new_fields.py | florianm/ckan | 12 | 19091 | <filename>ckan/migration/versions/041_resource_new_fields.py
from migrate import *
def upgrade(migrate_engine):
migrate_engine.execute(
'''
begin;
ALTER TABLE resource
ADD COLUMN name text,
ADD COLUMN resource_type text,
ADD COLUMN mimetype text,
ADD COLUMN mimetype_inner text,
ADD ... | 1.898438 | 2 |
src/train_model.py | hzdr/dvc_tutorial_series | 2 | 19092 | import pickle
import pandas as pd
import yaml
from sklearn.linear_model import ElasticNet, LogisticRegression
from sklearn.ensemble import RandomForestRegressor
from config import Config
Config.MODELS_PATH.mkdir(parents=True, exist_ok=True)
with open ("params.yaml", "r") as fd:
params = yaml.safe_load(fd)
model... | 2.328125 | 2 |
opentracing/harness/api_check.py | autocracy/opentracing-python | 0 | 19093 | # Copyright (c) 2016 The OpenTracing Authors.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pub... | 1.882813 | 2 |
tests/test_cli.py | jameswilkerson/elex | 183 | 19094 | <filename>tests/test_cli.py
import csv
import sys
import json
import tests
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from six import with_metaclass
from elex.cli.app import ElexApp
from collections import OrderedDict
DATA_FILE = 'tests/data/20151103_national.json'
DATA_ELE... | 2.5 | 2 |
unipipeline/worker/uni_worker_consumer.py | aliaksandr-master/unipipeline | 0 | 19095 | from typing import TypeVar, Generic, Optional, Type, Any, Union, Dict, TYPE_CHECKING
from unipipeline.errors.uni_payload_error import UniPayloadParsingError, UniAnswerPayloadParsingError
from unipipeline.errors.uni_sending_to_worker_error import UniSendingToWorkerError
from unipipeline.answer.uni_answer_message import... | 2.046875 | 2 |
funing/_ui/about.py | larryw3i/Funing | 1 | 19096 | <filename>funing/_ui/about.py
import gettext
import os
import re
import subprocess
import sys
import time
import tkinter as tk
import tkinter.filedialog as tkf
import uuid
import webbrowser
from datetime import date, datetime
from enum import Enum
from tkinter import *
from tkinter import messagebox
from tkinter.ttk i... | 2.4375 | 2 |
lib/logger.py | YahiaKandeel/ironport-correlator | 6 | 19097 | <filename>lib/logger.py
################################################################################
# Styler & Logger
################################################################################
from logging.handlers import SysLogHandler
import logging
import json
import pprint
import time
from .decoder import... | 2.234375 | 2 |
services/web/apps/inv/inv/plugins/log.py | prorevizor/noc | 84 | 19098 | <reponame>prorevizor/noc
# ---------------------------------------------------------------------
# inv.inv log plugin
# ---------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ------------------------------------------------------------... | 1.898438 | 2 |
blender/arm/logicnode/transform/LN_separate_quaternion.py | niacdoial/armory | 0 | 19099 | from arm.logicnode.arm_nodes import *
class SeparateQuaternionNode(ArmLogicTreeNode):
"""TO DO."""
bl_idname = 'LNSeparateQuaternionNode'
bl_label = "Separate Quaternion"
arm_section = 'quaternions'
arm_version = 1
def init(self, context):
super(SeparateQuaternionNode, self).init(cont... | 2.546875 | 3 |