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 |
|---|---|---|---|---|---|---|
unused/cv/support/data/merge.py | VirtualVFix/AndroidTestFramework | 0 | 54400 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "$May 19, 2016 4:21:36 PM$"
import os
import numpy as np
CURRENT_DIR = os.path.dirname(os.... | 2.21875 | 2 |
model/api/keras_endpoint.py | mvxxx/mimuw-hats | 0 | 54401 | <reponame>mvxxx/mimuw-hats<filename>model/api/keras_endpoint.py
# MLHat methods/classes
from loader import prepare_image
from mlhat import HatClassifier
from config import Configurator as Cfg
from config import MLConfig
from similarity import sim
# Others improts
from PIL import Image
import flask
import io
import war... | 2.421875 | 2 |
syntactic_complexity.py | volkancirik/synlana | 1 | 54402 | '''ORIGINAL file:https://github.com/neubig/util-scripts/blob/master/syntactic-complexity.py
'''
#!/usr/bin/env python
'''
A program to calculate syntactic complexity of parse trees. (Relies on NLTK)
This is an implementation of some of the methods in:
Syntactic complexity measures for detecting Mild Cognitive Impairm... | 3.28125 | 3 |
problem/10000~19999/15803/15803.py3.py | njw1204/BOJ-AC | 1 | 54403 | <filename>problem/10000~19999/15803/15803.py3.py<gh_stars>1-10
a,b=map(int,input().split())
c,d=map(int,input().split())
e,f=map(int,input().split())
if (a-c)*(d-f)==(b-d)*(c-e):
print('WHERE IS MY CHICKEN?')
else:
print('WINNER WINNER CHICKEN DINNER!') | 3.265625 | 3 |
tests/text/test_pipeline_copy.py | javispp/biome-text | 62 | 54404 | <reponame>javispp/biome-text
import pytest
from numpy.testing import assert_allclose
from biome.text import Dataset
from biome.text import Pipeline
from biome.text import Trainer
from biome.text import TrainerConfiguration
@pytest.fixture
def pipeline():
return Pipeline.from_config(
{
"name":... | 2.046875 | 2 |
morphocell/preprocessing/thresholding.py | alxndrkalinin/morphocell | 0 | 54405 | """Implement 3D image thresholding."""
from typing import List, Optional
import numpy.typing as npt
import numpy as np
from ..image_utils import get_xy_block_coords, get_xy_block
from ..gpu import get_image_method
def get_threshold_otsu(image: npt.ArrayLike, blur_sigma=5):
"""Perform Otsu's thresholding with ... | 2.90625 | 3 |
ex3.py | BryanQ98/Learning_Python | 0 | 54406 | <gh_stars>0
print "I will now count my chickens:"
# + is for addition
# - is for subtraction
# / is for division
# * is for multiplication
# < is less than
# > is greater than
# <= is less than equal
# >= is greater than equal
# % is the symbol for modulus
# 30 divided by 6 plus 25 = 30
print "Hens", 25... | 4.34375 | 4 |
registration/forms.py | raj457036/Rushtime-blog | 1 | 54407 | <gh_stars>1-10
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, UsernameField
from django import forms
from django.contrib.auth.models import User
Genders = (
('m', 'Male'),
('f', 'Female'),
)
class DateInput(forms.DateInput):
input_type = 'date'
class SignupForm(UserCreationFor... | 2.859375 | 3 |
medusa.py | BatSec/Project-Butler | 0 | 54408 | import vlc
import time
import io
import os
from tkinter import *
from tinytag import TinyTag, TinyTagException
from PIL import Image, ImageTk
class check:
i = 0
mname = ''
song = 1
goto = 0
def main(self):
# change to \ for windows
temp_track = TinyTag.... | 2.859375 | 3 |
pw_stm32cube_build/py/tests/inject_init_test.py | curtin-space/pigweed | 86 | 54409 | <gh_stars>10-100
#!/usr/bin/env python3
# Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 2.09375 | 2 |
fetal_brain_mask/predict.py | FNNDSC/pl-fetal-brain-masking | 0 | 54410 | import cv2
import logging
import numpy as np
import nibabel as nib
from skimage.measure import label
from skimage.morphology import binary_closing, cube
from fetal_brain_mask.model import Unet
logger = logging.getLogger(__name__)
class MaskingTool:
def __init__(self):
self.model = Unet()
def mask_t... | 2.34375 | 2 |
Platform.py | jessedeveloperinvestor/Multiple-Jesse-Projects | 0 | 54411 | #pip install datetime
import time
import platform
import getpass
machine=str(platform.node())
architecture=str(platform.architecture())
opsys=str(platform.system())
os_vers=str(platform.release())
proces=str(platform.processor())
py_vers=str(platform.python_version())
a='\n'
a1='Machine: '
a2='Architecture:... | 2.8125 | 3 |
amorphous/tests/models.py | japrogramer/django-amorphous | 3 | 54412 | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.postgres.fields import JSONField
class TestModel(models.Model):
# we only need one field
metadata = JSONField(default=dict())
def get_absolute_url(self):
return '/one/'
| 2.125 | 2 |
changes/api/task_details.py | vault-the/changes | 443 | 54413 | <gh_stars>100-1000
from __future__ import absolute_import
from changes.api.base import APIView
from changes.models.task import Task
class TaskDetailsAPIView(APIView):
def _collect_children(self, task):
children = Task.query.filter(
Task.parent_id == task.task_id,
)
results = [... | 2.171875 | 2 |
fledgling/cli/command/delete_task.py | PracticalCleanArchitecture/fledgling | 0 | 54414 | # -*- coding: utf8 -*-
import click
from fledgling.app.use_case.delete_task import DeleteTaskUseCase, IParams
from fledgling.cli.config import IniFileConfig
from fledgling.cli.repository_factory import RepositoryFactory
class Params(IParams):
def __init__(self, *, task_id):
self.task_id = task_id
de... | 2.1875 | 2 |
incise/__init__.py | Exahilosys/incise | 0 | 54415 | <gh_stars>0
from .core import *
__all__ = (*core.__all__,)
| 1.117188 | 1 |
utils/__init__.py | Rafiatu/weekly_order_stats | 0 | 54416 | <filename>utils/__init__.py
from .auxillary_functions import *
| 1.0625 | 1 |
smore/apispec/core.py | sloria/smore | 1 | 54417 | # -*- coding: utf-8 -*-
from .exceptions import APISpecError, PluginError
_PATH_CORRECTIONS = {
'operation_id': 'operationId',
'external_docs': 'externalDocs'
}
def _serialize_operation(operation):
"""Return operation dict, making necessary casing corrections
to each key.
"""
return {
... | 2.296875 | 2 |
domainics/domobj/dset.py | lcgong/dpillars | 3 | 54418 | <reponame>lcgong/dpillars
# -*- coding: utf-8 -*-
from collections import OrderedDict
from collections import namedtuple
from collections.abc import Iterable, Mapping
from itertools import islice
import sys
# from .metaclass import datt
# from ._reshape import reshape
from .dobject import dobject
from .typing impor... | 2.234375 | 2 |
tests/integration_tests/test_flux.py | radical-cybertools/radical.utils | 7 | 54419 | #!/usr/bin/env python3
import os
import time
import pytest
import radical.utils as ru
yaml = pytest.importorskip('yaml')
flux = pytest.importorskip('flux')
events = dict()
spec = {
"tasks": [{
"slot": "task",
"count": {
"per_slot": 1
... | 2.015625 | 2 |
scripts/Data_eda.py | abimur-123/Mentalhealth_project | 1 | 54420 | #!/usr/bin/env python
# coding: utf-8
# # Data EDA
# Author - <NAME>
# Written - December 2017
# This script take cleansed data from a csv file and writes figures to a results folder
# Parameters required -
# 1. Cleansed csv file
# 2. Codebook csv file
# 3. Destination folder for figures
import pandas as pd
import n... | 3.53125 | 4 |
scripts/addons/keentools_facebuilder/utils/images.py | Tilapiatsu/blender-custom_conf | 2 | 54421 | # ##### BEGIN GPL LICENSE BLOCK #####
# KeenTools for blender is a blender addon for using KeenTools in Blender.
# Copyright (C) 2019 KeenTools
# This program 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, ... | 1.6875 | 2 |
code/clips_raw_gen.py | swy20190/Graduation-Design-Note | 1 | 54422 | from img_parser import parse
import cv2
import numpy as np
import pandas as pd
import os
protoFile = "models/pose_deploy_linevec.prototxt"
weightsFile = "models/pose_iter_440000.caffemodel"
# Read the network into memory
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)
nPoints = 18
# TrainImgNum = len(os.listdi... | 2.4375 | 2 |
tests/test_wtap.py | qasim-at-tci/graph-theory | 56 | 54423 | <reponame>qasim-at-tci/graph-theory
from fractions import Fraction as F
from itertools import permutations, combinations_with_replacement
from graph import Graph
from graph.assignment_problem import wtap_solver
def test_damage_assessment_calculation():
g, weapons, target_values = wikipedia_wtap_setup()
edge... | 3.09375 | 3 |
shors/qiskit/interactive_shors_factoring/qfunctions.py | daniel-mills-cqc/QC-App-Oriented-Benchmarks | 3 | 54424 | """ This file contains quantum code in support of Shor's Algorithm
"""
""" Imports from qiskit"""
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
import sys
import math
import numpy as np
""" ********* QFT Functions *** """
""" Function to create QFT """
def create_QFT(circuit,up_reg,n,with_sw... | 3 | 3 |
geoApp/migrations/0002_auto_20210831_2215.py | sebastian-konicz/geo-murals | 0 | 54425 | <filename>geoApp/migrations/0002_auto_20210831_2215.py
# Generated by Django 3.2.6 on 2021-08-31 20:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('geoApp', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_... | 1.523438 | 2 |
scripts/pca_digits.py | ngshya/ssl-play | 0 | 54426 | import sys
sys.path.append('.')
from sslplay.data.digits import DataDigits
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
import numpy as np
obj_data = DataDigits()
obj_data.load()
X = obj_data.X
y = obj_data.y
target_names = np.array(["0", "1"... | 2.71875 | 3 |
tests/test_server_utils.py | jecki/DHParser | 2 | 54427 | <gh_stars>1-10
#!/usr/bin/env python3
"""test_server_utils.py - tests for utility-functions in the,
server-module of DHParse.
Author: <NAME> <<EMAIL>>
Copyright 2020 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in c... | 1.929688 | 2 |
app/app/constants.py | alasdair-macleod/demoappback | 0 | 54428 | <gh_stars>0
from enum import Enum
class Constants(Enum):
# errors in linear model creation
ERR_ERROR_DEG_FREEDOM = 'Error degrees of freedom must be positive. To achieve this increase smallest group size'
ERR_NOT_POSITIVE_DEFINITE = 'Sigma star is not positive definite.'
ERR_NOT_POSITIVE_DEFINITE_OUTC... | 2.71875 | 3 |
setup.py | Lolologist/balanced_time | 1 | 54429 | <gh_stars>1-10
from setuptools import setup
from setuptools import find_packages
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.rst"), "r") as fh:
long_description = fh.read()
setup(
name='balancedtime',
version='0.16b',
author="<... | 1.703125 | 2 |
src/game/commands/global_cmdtable.py | gtaylor/dott | 3 | 54430 | <filename>src/game/commands/global_cmdtable.py
from src.daemons.server.commands.cmdtable import CommandTable
from src.game.commands import general as general_cmds
from src.game.commands import staff as staff_cmds
class GlobalCommandTable(CommandTable):
"""
The standard, global command table.
"""
comm... | 2.015625 | 2 |
09_xml_nhm/xml_stuff.py | pnorton-usgs/notebooks | 0 | 54431 | <gh_stars>0
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python [conda env:bandit_py3]
# language: python
# name: co... | 2.1875 | 2 |
xweb/views.py | shenxgan/xweb-music | 0 | 54432 | <reponame>shenxgan/xweb-music
import os
import subprocess
from rest_framework import status
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from .serializers import VolumeSerializer
class Volume(GenericAPIView):
queryset = []
serializer_class = VolumeSerializer
... | 2.21875 | 2 |
nexradaws/__init__.py | peterdhansen/nexradaws | 28 | 54433 | <reponame>peterdhansen/nexradaws<filename>nexradaws/__init__.py<gh_stars>10-100
__author__ = '<NAME>'
__version__ = "1.1"
from .nexradawsinterface import NexradAwsInterface
| 1.054688 | 1 |
tasks/__init__.py | brmson/sts-data | 690 | 54434 | <gh_stars>100-1000
from __future__ import print_function
from __future__ import division
import importlib
from keras.layers.core import Activation
from keras.models import Graph
import numpy as np
import random
import traceback
import pysts.loader as loader
from pysts.kerasts import graph_input_slice, graph_input_pru... | 2.015625 | 2 |
{{ cookiecutter.repo_name }}/src/features/build_features.py | crmne/cookiecutter-data-science | 0 | 54435 | # -*- coding: utf-8 -*-
import logging
import click
@click.command(short_help='Fits and saves feature extractors.')
@click.argument('dataset_path', type=click.Path(exists=True))
@click.argument('feature_extractor_path', type=click.Path())
def build_features(dataset_path, feature_extractor_path):
"""Fits and save... | 2.65625 | 3 |
exercise.py | abir880090/ska | 1 | 54436 | <filename>exercise.py
def info():
name = input("Enter Your Name : ")
fname = input("Enter Your Father Name : ")
mname = input("Enter Your Mother Name : ")
while True:
try:
age = int(input("\033[0m Enter your age: "))
break
except Exception as e:
print("\033[31m invalid age\nplease t... | 3.6875 | 4 |
ilp_test.py | rene-schoene/racr-mquat | 0 | 54437 | <reponame>rene-schoene/racr-mquat
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This program and the accompanying materials are made available under the
# terms of the MIT license (X11 license) which accompanies this distribution.
# Author: <NAME>
import re, threading, os, shutil, sys, timeit
try:
from fabric.api ... | 2.0625 | 2 |
sensor/fake_forward_return.py | jokbull/benew_model | 1 | 54438 | from collider.data.sensor import Sensor
from collider.data.message_package import MessagePackage
from scipy.stats import spearmanr
import numpy as np
class FakeForwardReturn(Sensor):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.lastvalue = None
@property
def output_varia... | 2.125 | 2 |
k-anonymization-algo/src/k_anonymity.py | Billy1900/Differential-Privacy | 90 | 54439 | <reponame>Billy1900/Differential-Privacy
from utilis.readdata import *
class KAnonymity():
def __init__(self, records):
self.records = records
self.confile = [AGECONFFILE, EDUCONFFILE, MARITALCONFFILE, RACECONFFILE]
def anonymize(self, qi_names=['age', 'education', 'marital-status', 'race'], ... | 2.6875 | 3 |
aptx/aptx_schemaver.py | rizeladiaz/jwst-apt-tools | 0 | 54440 | #!/usr/bin/env python
import aptx
import argparse
import textwrap
import os.path
parser = argparse.ArgumentParser(
description='Print schema version of .aptx files.',
epilog='example: aptx_schemaver.py *.aptx')
parser.add_argument('aptxfiles', nargs='+', help='aptx file specification')
args = parser.parse_arg... | 3.046875 | 3 |
lab4_CNN_intro/create_dataset.py | j-adamczyk/Pattern_recognition | 1 | 54441 | from concurrent.futures.thread import ThreadPoolExecutor
from io import BytesIO
import os
import cv2
import numpy as np
import requests
def get_img(url):
try:
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; "
"Intel Mac OS X 10_11_6) "
"... | 3.1875 | 3 |
tests/cndict_types_test.py | alexamies/chinesenotes-python | 0 | 54442 | <reponame>alexamies/chinesenotes-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, Versi... | 2.140625 | 2 |
categorical_label_to_id.py | furaoing/tensorflow-tutorial | 0 | 54443 | import random
import pandas
import numpy as np
from sklearn import metrics, cross_validation
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib import learn
random.seed(42)
"""
data = pandas.read_csv('titanic_train.csv')
X = data[["Embarked"]]
y = data["Survived"]
X_train, X_test, y... | 3.1875 | 3 |
context.py | blockchainhelppro/Flask-Crypto | 0 | 54444 | from web3 import Web3
from hexbytes import HexBytes
from .contract import Contract
from . import mk_contract_address, encode_hex
def buildContexts(ops, api, contracts, txhash):
contract_stack = []
tx = api.getTransaction(txhash)
to = tx['to']
blnum = int(tx['blockNumber'])
if to == '0x0':
... | 2.109375 | 2 |
src/sort/0791.custom-sort-string/custom-sort-string.py | lyphui/Just-Code | 782 | 54445 | <gh_stars>100-1000
class Solution:
def customSortString(self, S: str, T: str) -> str:
return ''.join(sorted(list(T), key=lambda x:S.find(x))) | 2.90625 | 3 |
SellTimeRemainder_InsertItem/lambda_function.py | maton456/SellTimeRemainder | 0 | 54446 | <filename>SellTimeRemainder_InsertItem/lambda_function.py<gh_stars>0
import json
import boto3
def put_card(card, owner, url):
dynamodb = boto3.resource('dynamodb', region_name='us-west-2')
table = dynamodb.Table('SellTimeRemainder')
response = table.put_item(
Item={
'Card': card,
... | 2.390625 | 2 |
mindspore/python/mindspore/dataset/audio/utils.py | AK391/mindspore | 0 | 54447 | <reponame>AK391/mindspore<gh_stars>0
# Copyright 2021-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 2.171875 | 2 |
Python3/Books/Douson/chapter02/personal_greeter.py | neon1ks/Study | 0 | 54448 | # Personal Greeter
# Demonstrates getting user input
name = input("Hi. What's your name? ")
print(name)
print("Hi,", name)
input("\n\nPress the enter key to exit.")
| 3.640625 | 4 |
contact/admin.py | lbacon17/lb-fitness | 0 | 54449 | from django.contrib import admin
from .models import Contact
class ContactAdmin(admin.ModelAdmin):
list_display = (
'created_on',
'user',
'name',
'email_address',
'subject',
'message',
)
ordering = ('created_on',)
actions = ['mark_as_answered']
de... | 1.953125 | 2 |
mfr/extensions/unoconv/__init__.py | yacchin1205/RDM-modular-file-renderer | 36 | 54450 | <reponame>yacchin1205/RDM-modular-file-renderer<filename>mfr/extensions/unoconv/__init__.py<gh_stars>10-100
from .export import UnoconvExporter # noqa
from .render import UnoconvRenderer # noqa
| 1.265625 | 1 |
set4/26.py | dineshkumarc987/matasano-crypto | 25 | 54451 | from common import randstr, AES_CTR, xor_str
from random import randint
oracle_key = randstr(16)
oracle_nonce = randint(0, (1 << 64) - 1)
def encryption_oracle(data):
data = data.replace(';', '').replace('=', '')
data = "comment1=cooking%20MCs;userdata=" + data
data = data + ";comment2=%20like%20a%20poun... | 2.953125 | 3 |
plusOne1.py | kodreanuja/python | 0 | 54452 | def plusOne(arr):
result = int("".join([str(each) for each in arr])) + 1
result = str(result)
return list(result)
# if want = result[-1] = digits[-1] + 1:
# l = digits[-1]
# digits.pop()
# l = l + 1
# digits.append(l)
# return digits
if __name__ == "__main__":... | 3.59375 | 4 |
tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/utest/data.py | YangHao666666/hawq | 450 | 54453 | <gh_stars>100-1000
import exceptions
class Data:
class DataError(exceptions.ValueError): pass
def __init__(self, value):
self.value = value
def get_value(self):
return self.value
| 2.671875 | 3 |
users/signals.py | uktrade/great-cms | 10 | 54454 | def approve_new_user(sender, instance, created, *args, **kwarg):
if created:
instance.is_staff = True
instance.is_superuser = True
instance.save()
| 1.992188 | 2 |
proxy/high_api.py | CMA2401PT/Phoenix-Transfer | 3 | 54455 | <gh_stars>1-10
from socket import socket
from proxy import forward
from proxy import utils
from threading import Thread
from queue import Queue
import time
from typing import Any, Callable, Iterable
# 理论上 epoll 和 asyncio 才是更好的选择,但是这俩api都比较新,暂时先不用了
def one_sender_multiworkers(conn:socket,recv_func:Callable,workers:dict... | 2.84375 | 3 |
backend/endpoints/users.py | adithyaparams/bontango | 0 | 54456 | <filename>backend/endpoints/users.py
from typing import List
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from services import users as services
from schemas import users as schemas
from dependencies import get_current_user, get_db
router = APIRouter(
prefix="/users",
... | 2.5 | 2 |
ccl-cookbook/files/default/cocreatelite/cocreate/createvm/createvm.py | nemonik/CoCreateLite | 9 | 54457 | <filename>ccl-cookbook/files/default/cocreatelite/cocreate/createvm/createvm.py
#createvm.py
#
#
#
#
#
#
import sys
print ("\n".join(sys.path))
from pyVmomi import vim
from pyVim.connect import SmartConnect, Disconnect
import time
import vmutils
import subprocess
import configparser
import json
from passlib.hash impo... | 2.46875 | 2 |
xls_cli/frame.py | joelibaceta/xls-cli | 26 | 54458 | import os
import math
import xls_cli.ansi as ansi
from xls_cli.grid import Grid
from getkey import getkey, keys
class Frame:
width, height = 0, 0
printable_window = "\x1B[2J"
title = "unititled"
grid = None
def __init__(self, title):
rows, columns = os.popen('stty size', 'r').read().spl... | 2.984375 | 3 |
api/app/utils/testing.py | martinoywa/Baobab | 1 | 54459 | import unittest
import json
from datetime import datetime,timedelta
from app import db, app, LOGGER
from sqlalchemy import event
from sqlalchemy.engine import Engine
from sqlite3 import Connection as SQLite3Connection
from app.organisation.models import Organisation
from app.users.models import AppUser, UserCategory, ... | 2.453125 | 2 |
sompy/visualization/view.py | ldocao/sompy | 0 | 54460 | import numpy as np
import matplotlib.pyplot as plt
class View(object):
def __init__(self, width, height, title, show_axis=True, packed=True, text_size=2.8, show_text=True, col_size=6, *args, **kwargs):
self.width = width
self.height = height
self.title = title
self.show_axis = sho... | 2.640625 | 3 |
modern/util/Handle_ini.py | ZhuangZhu-74/open | 2 | 54461 | <filename>modern/util/Handle_ini.py<gh_stars>1-10
#coding=utf-8
import os, sys
sys.path.append(os.getcwd())
from configparser import ConfigParser, ExtendedInterpolation
import chardet
class Handle_ini:
"""
Used for ini file
"""
def __init__(self, ini_file=None, var_sub=False):
''... | 2.578125 | 3 |
apps/approval/migrations/0006_auto_20170814_0402.py | kharann/onlineweb4 | 0 | 54462 | <reponame>kharann/onlineweb4<filename>apps/approval/migrations/0006_auto_20170814_0402.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-14 02:02
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletio... | 1.460938 | 1 |
src/wsgi.py | kumardeepak/user-mgmt | 0 | 54463 | <reponame>kumardeepak/user-mgmt<gh_stars>0
from app import server as user
if __name__ == "__main__":
user.run() | 0.9375 | 1 |
unit-5-intermediate/instructor-resources/hw-10wk-class-8/solutions/problem1.py | rodriguezda/python-programming-104 | 5 | 54464 | <gh_stars>1-10
import csv
employees = [
{
"first_name": "Bill",
"last_name": "Lumbergh",
"job_title": "Vice President",
"hire_date": 1985,
"performance_review": "excellent"
}, {
"first_name": "Michael",
"last_name": "Bolton",
"job_title": "Programmer",
"hire_date": 1995,
"pe... | 3.375 | 3 |
pyorbit/classes/kepler_exo.py | lucaborsato/PyORBIT | 12 | 54465 | <reponame>lucaborsato/PyORBIT<gh_stars>10-100
import sys
sys.path.insert(0, '/Users/malavolta/Astro/CODE/PyORBIT/')
from pyorbit.classes.common import np
from scipy.optimize import fsolve, newton
import pyorbit.classes.constants as constants
# +
# NAME:
# exofast_keplereq
# PURPOSE:
# Solve Kepler's Equation
# ... | 2.5625 | 3 |
tests/test-data/example-publications.py | caltechlibrary/pindu | 16 | 54466 | #!/usr/bin/env python3
import getpass
import json
import pprint
import requests
import sys
# The credentials to be used
try:
user = input('Login name: ')
# If it's a tty, use the version that doesn't echo the password.
if sys.stdin.isatty():
password = getpass.getpass('Password: ')
else:
... | 3.09375 | 3 |
lib_rac.py | pankovva/zbx_rac | 0 | 54467 | <filename>lib_rac.py
# -*- coding: utf-8 -*-
import logging, json, subprocess
from typing import Dict, List, Union, Callable, TypeVar, Any
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
ListRac = List[Dict[str, str]]
class UserDecorators:
@classmethod
def to_json(cls, func):... | 2.265625 | 2 |
handtracker_module.py | 7wikd/Volume-Control | 1 | 54468 | import cv2
import mediapipe as mp
import time
'''
Hand Landmarks:
WRIST = 0
THUMB_CMC = 1
THUMB_MCP = 2
THUMB_IP = 3
THUMB_TIP = 4
INDEX_FINGER_MCP = 5
INDEX_FINGER_PIP = 6
INDEX_FINGER_DIP = 7
INDEX_FINGER_TIP = 8
MIDDLE_FINGER_MCP = 9
MIDDLE_FINGER_PIP = 10
MIDDLE_FINGER_DIP = 11
MIDDLE_FIN... | 2.5625 | 3 |
Dataset/Leetcode/train/2/50.py | kkcookies99/UAST | 0 | 54469 | <reponame>kkcookies99/UAST<gh_stars>0
def pylist_to_listnode(self, pylist, link_count):
if len(pylist) > 1:
ret = precompiled.listnode.ListNode(pylist.pop())
ret.next = self.pylist_to_listnode(pylist, link_count)
return ret
else:
return precompiled.listnode.ListNode(pylist.pop(),... | 2.84375 | 3 |
garage/misc/logger/tensorboard_logger.py | shadiakiki1986/garage | 0 | 54470 | <reponame>shadiakiki1986/garage
"""Tensorboard Logger.
This logger adds tensorboard functionalities to base logger.
When LOG_TENSORBORAD is set to True in config.py,
garage.misc.logger will be instantiated as a TensorboardLogger
"""
# flake8: noqa
from garage.misc.logger.base_logger import Logger
from garage.misc.logg... | 2.3125 | 2 |
moisture/searches/migrations/0001_initial.py | wikibootup/moisture-backend | 0 | 54471 | # Generated by Django 2.0 on 2017-12-27 03:05
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Search',
fields=[
('search_id', models.AutoFi... | 1.773438 | 2 |
wagtail/wagtailadmin/tests/test_rich_text.py | kurtrwall/wagtail | 3 | 54472 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from wagtail.tests.testapp.rich_text import CustomRichTextArea
from wagtail.tests.utils import Wagtail... | 1.960938 | 2 |
run.py | thesilenthero/spotify-offline-playlist | 0 | 54473 | <reponame>thesilenthero/spotify-offline-playlist
from playlist import PlaylistUpdater
if __name__ == "__main__":
pl = PlaylistUpdater("offline songs")
updated_playlist = pl.update_playlist(250)
print(f"Updated playlist - {len(updated_playlist)} songs:\n\n")
for song in sorted(updated_playlist, key=la... | 3.125 | 3 |
interactive_scene/scene_builder/scripts/scene_builder_config.py | OneOneEleven/Interactive-Scene-Reconstruction | 62 | 54474 | import os
from utils import load_json
from utils import print_err
from global_settings import SCENE_BUILDER_OUTPUT_DIR
class SceneBuilderConfig(object):
def __init__(
self,
input_scene_dir,
scene_builder_root,
output_dir_name,
rigid_mesh_db,
articulated_mesh_db,
... | 2.171875 | 2 |
jobs/bencher/osu.merge_outputs.py | NCAR/HPC_Scripts | 1 | 54475 | #!/usr/bin/python
import sys
import os
import re
if len(sys.argv) < 3:
print >> sys.stderr, '%s {dump|average} {separator} {label|filename}* ' % (sys.argv[0])
os._exit(1)
args = sys.argv;
args.pop(0); #prog
output_type=args.pop(0)
separator=args.pop(0)
if separator == '':
separator = None
data = {} #bi... | 2.5625 | 3 |
examples/CC_examples/CC_demo_qasm.py | nuttamas/PycQED_py3 | 60 | 54476 | <reponame>nuttamas/PycQED_py3<gh_stars>10-100
#!/usr/bin/python
### setup logging before all imports (before any logging is done as to prevent a default root logger)
import CC_logging
import logging
#from qiskit.qasm.qasm import Qasm
from qiskit.circuit.quantumcircuit import QuantumCircuit
#import matplotlib.pyplot a... | 2.0625 | 2 |
server/schemas/tshirt.py | CraftyChimera/nittfest-site | 0 | 54477 | <gh_stars>0
"""
T-shirt Registration Schema
"""
from sqlalchemy import Column, Enum, ForeignKey, Integer
from config.database import Base
class Tshirt(Base):
"""T-shirt Registration Schema"""
__tablename__ = "tshirts"
id = Column(Integer, primary_key=True)
size = Column(Enum("S", "M", "L", "XL", "XX... | 3 | 3 |
tests/unit/main.py | marcosfpr/match_up_lib | 0 | 54478 | import unittest
from tests.unit import model_test, sanitizer_test, occurrence_test, query_test, vocabulary_test
def create_suite(t_lst, t_load):
t_lst.append(t_load.loadTestsFromTestCase(model_test.ModelTest))
t_lst.append(t_load.loadTestsFromTestCase(sanitizer_test.SanitizerTest))
t_lst.append(t_load.lo... | 2.59375 | 3 |
setup.py | Sologala/pyp | 0 | 54479 |
import setuptools
setuptools.setup(
name="pyp",
version="0.0.1",
author="Dawsonwen",
author_email="<EMAIL>",
description="Personal utils about Image processing and Deep Learning",
long_description="Personal utils about Image processing and Deep Learning",
long_description_content_type="tex... | 1.039063 | 1 |
Algo201/problem_of_the_class/python/tile.py | oat431/HomeworkCollection | 3 | 54480 | def fill_tile(n):
if n == 0 or n == 1 or n == 2:
return 1
return fill_tile(n-1) + fill_tile(n-2) + fill_tile(n-3)
print(fill_tile(8))
| 3.8125 | 4 |
src/CherryPy-3.1.2/cherrypy/test/test_http.py | wake-forest-ctsi/mist-toolkit | 2 | 54481 | <gh_stars>1-10
"""Tests for managing HTTP issues (malformed requests, etc)."""
from cherrypy.test import test
test.prefer_parent_path()
import httplib
import cherrypy
import mimetypes
def encode_multipart_formdata(files):
"""Return (content_type, body) ready for httplib.HTTP instance.
files: a sequence... | 2.5 | 2 |
app.py | ynajem/thenano245 | 0 | 54482 | from flask import Flask, render_template, request, redirect
app = Flask(__name__)
@app.route("/")
def root():
return "Hello, World!"
@app.route("/index.html")
@app.route("/index.php")
def home():
return redirect("/")
@app.route("/user/<username>")
def user_template(username):
return render_template("user.h... | 2.9375 | 3 |
pyntpg/analysis/spectrogram/spectrogram.py | 5tefan/py-netcdf-timeseries-gui | 0 | 54483 | from PyQt5.QtWidgets import QWizard, QWidget, QHBoxLayout, QFormLayout, QSpinBox, QComboBox
from matplotlib.backends.backend_qt5 import NavigationToolbar2QT as NavigationToolbar
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from pyntpg.analysis.di... | 2.421875 | 2 |
src/speech_to_text/stt_api.py | JoungheeKim/emotion_recognition | 3 | 54484 | <reponame>JoungheeKim/emotion_recognition<gh_stars>1-10
import os
from pathlib import Path
from tqdm import tqdm
from pydub import AudioSegment, effects
import soundfile as sf
import logging
from src.configs import BasicConfig
from dataclasses import _MISSING_TYPE, dataclass, field
@dataclass
class APIConfig(BasicConf... | 2.09375 | 2 |
iiotsapps/graphql/farms/types/__init__.py | CorpofloTechCommunity/Intelligent-IOT-system- | 0 | 54485 | from .farm import FarmType as FarmNode | 1.148438 | 1 |
src/kcri/bap/services.py | zwets/kcri-cge-bap | 0 | 54486 | #!/usr/bin/env python3
#
# kcri.bap.services - Defines the services used by the BAP workflow
#
# This module defines the SERVICES dict that maps each Service.* enum
# defined in .workflow to a class (called a 'shim') that implements
# the service.
#
# Import the Services enum
from .workflow import Services
# Im... | 1.710938 | 2 |
dev/config/jupyter_server_config.py | gabalafou/jupyter-react | 4 | 54487 | import os
c.ServerApp.log_level = 'INFO'
#################
# Network
#################
c.ServerApp.ip = '0.0.0.0'
c.ServerApp.port = 8686
c.ServerApp.port_retries = 0
#################
# Browser
#################
c.ServerApp.open_browser = False
#################
# Terminal
#################
c.ServerApp.terminal... | 1.640625 | 2 |
vistautils/memory_amount.py | isi-vista/vistautils | 3 | 54488 | import re
from enum import Enum, auto, unique
from typing import Mapping
from attr import attrib, attrs
from attr.validators import and_, in_, instance_of
from immutablecollections import immutabledict
from vistautils.range import Range
@unique
class MemoryUnit(Enum):
"""
A unit in which memory can be meas... | 2.484375 | 2 |
UpscaleTextures.py | boristsr/TextureUpscalingPipeline | 5 | 54489 | import json
import pprint
import copy
from TextureUpscaler.TextureProcessing import gather_textures, run_processing_stage, save_hires_image
from TextureUpscaler.UpscaleESRGAN import upscale_esrgan
from TextureUpscaler.DenoiseImages import denoise_texture_opencv
from TextureUpscaler.DownsampleImages import downsample
f... | 2.40625 | 2 |
algos/news.py | steveman1123/multiStonk | 1 | 54490 | <reponame>steveman1123/multiStonk
#this file contains functions specifically for the news algo
#what changes when a stock has news written about it, what about the sentiment of that news?
#TODO: populate goodBuys, goodSells, and getUnsortedList
import otherfxns as o
algo = o.os.path.basename(__file__).split('.')[0] ... | 2.96875 | 3 |
src/image_folder_publisher/scripts/image_folder_publisher.py | Seba-san/RosImageFolderPublisher | 0 | 54491 | #!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('image_folder_publisher')
import sys
import os
from os import listdir
from os.path import isfile, join
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class image_f... | 2.296875 | 2 |
tests/plugins/test_download_remote_source.py | obriencj/atomic-reactor | 0 | 54492 | """
Copyright (c) 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from io import BytesIO
import os
import responses
import tarfile
from atomic_reactor.constants impor... | 2 | 2 |
OnlineStudy/utils/middlewares.py | NanRenTeam-9/MongoMicroCourse | 132 | 54493 | from django.utils.deprecation import MiddlewareMixin
class MyCors(MiddlewareMixin):
def process_response(self, requesst, response):
response['Access-Control-Allow-Origin'] = '*'
if requesst.method == 'OPTIONS':
response["Access-Control-Allow-Headers"] = "*"
response['Access... | 1.953125 | 2 |
vectorbt/base/__init__.py | haxdds/vectorbt | 1,787 | 54494 | # Copyright (c) 2021 <NAME>. All rights reserved.
# This code is licensed under Apache 2.0 with Commons Clause license (see LICENSE.md for details)
"""Modules with base classes and utilities for pandas objects, such as broadcasting."""
from vectorbt.base.array_wrapper import ArrayWrapper
__all__ = [
'ArrayWrappe... | 1.484375 | 1 |
fdk_client/platform/models/OpenApiOrderItem.py | kavish-d/fdk-client-python | 0 | 54495 | <reponame>kavish-d/fdk-client-python<gh_stars>0
"""Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
from .CartItemMeta import CartItemMeta
from .OpenApiFiles import OpenApiFiles
from .... | 1.75 | 2 |
tests/fixtures/sound.py | bcurnow/rfid-security-svc | 0 | 54496 | <gh_stars>0
import os
from io import BytesIO
import pytest
from werkzeug.datastructures import FileStorage
from rfidsecuritysvc.model.sound import Sound
@pytest.fixture(scope='session')
def wav_content():
test_wav = os.path.join(os.path.dirname(__file__), 'test.wav')
with open(test_wav, 'rb') as f:
... | 2.125 | 2 |
agent.py | lanteignel93/cart_pole | 2 | 54497 | import random
import gym
import sys
import numpy as np
from collections import deque,namedtuple
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torch.optim import Adam
plt.style.use('seaborn')
class DQN(nn.Module):
def __init__(self,hidden_sz,state_sz, action_sz):
... | 2.5625 | 3 |
ocdskingfisher/sources/scotland.py | andrewlorien/kingfisher | 0 | 54498 | from ocdskingfisher.base import Source
import datetime
class ScotlandSource(Source):
"""
API documentation and bulk downloads: https://www.publiccontractsscotland.gov.uk/NoticeDownload/Download.aspx
"""
publisher_name = 'Scotland'
url = 'https://www.publiccontractsscotland.gov.uk/NoticeDownload/D... | 2.6875 | 3 |
music21/sorting.py | cuthbertLab/music21 | 1,449 | 54499 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: sorting.py
# Purpose: Music21 class for sorting
#
# Authors: <NAME>
#
# Copyright: Copyright © 2014-2015 <NAME> and the music21
# Project
# License: BSD, see license.tx... | 3.015625 | 3 |