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 |
|---|---|---|---|---|---|---|
train.py | zzdxfei/3d_landmarks | 1 | 12776351 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import keras
import keras.backend as K
import re
import cv2
import numpy as np
np.set_printoptions(threshold='nan')
def list_pictures(directory, ext='jpg|jpeg|bmp|png|ppm'):
return [os.path.join(root, f)
f... | 2.328125 | 2 |
gv_analyzer_client.py | yama-kei/trail_analyzer | 0 | 12776352 | import json
import socket
import urllib2
#import requests
class GvAnalyzerClient(object):
"""
GV Analyzer Client
"""
def __init__(self, gd_data):
self.base_url = "https://damp-retreat-1145.herokuapp.com/"
self.base_url = "http://127.0.0.1:5000/"
self.gd_data = gd_data
socket.setdefaulttimeout(15)
def ana... | 3.046875 | 3 |
src/OTLMOW/OTLModel/Datatypes/KlVerlichtingstoestelVerlichtGebied.py | davidvlaminck/OTLClassPython | 2 | 12776353 | # coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlVerlichtingstoestelVerlichtGebied(KeuzelijstField):
"""Het gebied op de wegbaa... | 1.929688 | 2 |
rplugin/python3/multiterm.py | kjelly/nvim-multiterm | 1 | 12776354 | import re
import neovim
import enum
import json
try:
import psutil
except ImportError:
psutil = None
def isNumber(x):
return x in '1234567890'
class Result(enum.Enum):
BY_PASS = 1
HANDLED = 2
UNHANDLED = 3
def is_shell(name):
for i in ['fish', 'bash', 'csh', 'zsh']:
if i in nam... | 2.234375 | 2 |
venv/lib/python3.7/site-packages/cloudbio/custom/java.py | itsmesatwik/pants | 0 | 12776355 | """Install instructions for non-packaged java programs.
"""
import os
from fabric.api import *
from fabric.contrib.files import *
from shared import _if_not_installed
@_if_not_installed("cljr")
def install_cljr(env):
"""Install the clojure package manager cljr
http://github.com/liebke/cljr
"""
run("... | 2.265625 | 2 |
check-in/daily/Find-All-Anagrams-in-a-String-(Medium).py | huandrew99/LeetCode | 36 | 12776356 | """
LC 438
Given a string and a pattern, find all of the pattern in the given string.
Every anagram is a permutation of a string. As we know, when we are not allowed to repeat characters while finding permutations of a string, we get N!N! permutations (or anagrams) of a string having NN characters. For example, here ... | 4.09375 | 4 |
bluetooth/camera_share.py | AdityaNG/Self-Driving-RC-Car | 0 | 12776357 | <gh_stars>0
"""
# sudo modprobe bcm2835-v4l2
# python3 controller.py > logs/controller.txt &
# python3 autopilot_web_server.py > logs/autopilot_web_server.txt &
# python3 recorder.py > logs/recorder.txt &
cd training_data;
#python3 -m http.server > ../logs/webserver.txt &
"""
import threading
import time
impor... | 2.1875 | 2 |
contxt/services/health.py | ndustrialio/contxt-sdk-python-control | 0 | 12776358 | from ..models.health import Health
from .api import ConfiguredLegacyApi
from ..utils.config import ContxtEnvironmentConfig
class HealthService(ConfiguredLegacyApi):
"""Health API client"""
def __init__(self, env_config: ContxtEnvironmentConfig, **kwargs) -> None:
super().__init__(env_config=env_confi... | 2.28125 | 2 |
hangman.py | VersatileVishal/Hanging-The-Man | 5 | 12776359 | <filename>hangman.py
import random
def hangman():
word=random.choice(["pugger","tiger","lion","cheetah","thor","ironman","superman","blackwidow","hawkeye","mother","country","pegion",
"carrot","cricket","hockey","technical","human","bad","amazing","hulk","god","picture","air","laptop"... | 4.09375 | 4 |
api_server/api_server.py | aperauch/VMC-on-AWS-App-Portal | 0 | 12776360 | import logging, sys, os, ldap, time, yaml
from ns1 import NS1, Config
from ns1.rest.errors import ResourceException, RateLimitException, AuthException
from flask import Flask, json, g, request, make_response, jsonify
from flask.logging import create_logger
from flask_cors import CORS, cross_origin
from flask_jwt import... | 1.71875 | 2 |
model/SparseModels/RobustKLSparseAutoencoder.py | ne1199/RobustAutoencoder | 3 | 12776361 | <gh_stars>1-10
import numpy as np
import tensorflow as tf
import KLSparseAutoencoder as sdae
import sys
sys.path.append("../")
from shrink import l21shrink as SHR
class Robust_KL_SparseAutoencder():
"""
@author: <NAME>
modified: 02/12/2018
Des:
X = L + S
L is a non-linearly low dimensio... | 2.53125 | 3 |
hashmap/htbl.py | ebisLab/codingchallenges | 0 | 12776362 | class Hashtable:
def __init__(self):
"""
Create an array(self.my dict) w/ a bucket size - derived from load factor.
Load factor --> a measure that decides when to increase the Hashmap capacity to maintain the get() and put() operator complexity of o(1).
Default load factor of hashmap... | 3.921875 | 4 |
controller.py | ionufi/first | 0 | 12776363 | <reponame>ionufi/first
from repository import StudentRepository
class StudentController(object):
def __init__(self):
self._student_controller = StudentRepository()
def add_student(self, student):
return self._student_controller.add_student(student)
def remove_student(self, sid)... | 2.625 | 3 |
src/nr/powerline/__init__.py | NiklasRosenstein/powerline | 0 | 12776364 | <reponame>NiklasRosenstein/powerline
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2020, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# this software and associated documentation files (the "Software"), to deal in
# Software without restriction, including without lim... | 1.992188 | 2 |
Research/imitate_experiments/001/imitateOptimizer.py | RockmanZheng/AgentSteve | 1 | 12776365 | <gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import resource_variable_ops
from tens... | 2.203125 | 2 |
tests/pytests/test_rotation.py | ladoramkershner/ale | 4 | 12776366 | <gh_stars>1-10
import pytest
import numpy as np
from scipy.spatial.transform import Rotation
from ale.rotation import ConstantRotation, TimeDependentRotation
def test_constant_constant_composition():
rot1_2 = ConstantRotation([1.0/np.sqrt(2), 0, 0, 1.0/np.sqrt(2)], 1, 2)
rot2_3 = ConstantRotation([0, 1.0/np.s... | 1.992188 | 2 |
example/test/core/geometry/simple/plane/__init__.py | dmilos/IceRay | 2 | 12776367 | #__name__ = "sphere"
#__package__ = "sphere"
#__all__ = ['make']
| 1.015625 | 1 |
Aula_60/ForTwo/r2/embarque.py | Mateus-Silva11/AulasPython | 0 | 12776368 | <reponame>Mateus-Silva11/AulasPython<gh_stars>0
def embarque(motorista:str, passageiro:str, saida:dict):
fortwo = {'motorista': motorista, 'passageiro': passageiro}
saida['pessoas'].remove(motorista)
print(f"{fortwo['motorista']} embarcou como motorista")
if passageiro != '':
saida['pessoas'].r... | 3.078125 | 3 |
demoire-baseline/losses.py | Foldit/Netdisk-Image-Demoireing-Rank7th | 1 | 12776369 | import paddle
import paddle.nn as nn
import vgg
def compute_l1_loss(input, output):
return paddle.mean(paddle.abs(input - output))
def loss_Textures(x, y, nc=3, alpha=1.2, margin=0):
xi = x.contiguous().view(x.size(0), -1, nc, x.size(2), x.size(3))
yi = y.contiguous().view(y.size(0), -1, nc, y.size(2),... | 2.828125 | 3 |
model.py | noob-life/GAIL-for-mountain-car-Tensorflow | 0 | 12776370 | <reponame>noob-life/GAIL-for-mountain-car-Tensorflow
import tensorflow as tf
import tensorflow.keras as kr
import collections
import numpy as np
from tensorflow import random
#from tensorflow.python.keras import layers
class gail_gen(kr.Model):
"""docstring for gail_gen"""
def __init__(self, state_shape,a... | 3.03125 | 3 |
sources/lib.py | qnguyen2atb/MUL | 0 | 12776371 | <reponame>qnguyen2atb/MUL
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 22 14:56:14 2022
@author: quang
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from pyparsing import col
# Import train_test_spli... | 1.875 | 2 |
test/components/scheduler/promises/test_2_2_6_2.py | rerobins/rhobot_framework | 0 | 12776372 | """
2.2.6: `then` may be called multiple times on the same promise.
https://github.com/promises-aplus/promises-tests/blob/2.1.1/lib/tests/2.2.6.js
"""
import mock
from test.components.scheduler.promises.helpers import generate_rejected_test_case
other = {'other': 'other'}
sentinel = {'sentinel': 'sentinel'}
sentinel2 ... | 2.75 | 3 |
src/swiftlet/azext_swiftlet/vendored_sdks/swiftlet/operations/_virtual_machine_operations.py | Mannan2812/azure-cli-extensions | 207 | 12776373 | <gh_stars>100-1000
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Genera... | 1.773438 | 2 |
unfolders/result.py | peguerosdc/unfolding_benchmark | 0 | 12776374 | class UnfoldingResult:
def __init__(self, solution, error):
self.solution = solution
self.error = error
| 1.976563 | 2 |
qforce/tests/test_qm_orca.py | xiki-tempula/qforce | 0 | 12776375 | <reponame>xiki-tempula/qforce
import numpy as np
import pytest
from qforce_examples import Orca_default, Orca_default_NBO6
from ase.units import Hartree, mol, kJ
from qforce.qm.orca import ReadORCA
from .test_qm_gaussian import TestReadHessian as Gaussian_hessian
from .test_qm_gaussian import TestReadScan as Gaussian... | 2.109375 | 2 |
D4/D4.py | bitlischieber/AdventOfCode2019 | 0 | 12776376 | import re
# Your puzzle input is 246540-787419.
## Part 1
pwords = []
for i in range(246540,787419):
if(int(str(i)[0]) <= int(str(i)[1]) <= int(str(i)[2]) <= int(str(i)[3]) <= int(str(i)[4]) <= int(str(i)[5])):
if((str(i)[0] == str(i)[1]) or (str(i)[1] == str(i)[2]) or (str(i)[2] == str(i)[3]) or (str(i)[... | 3.59375 | 4 |
python/example_code/nifcloud-basic-demo.py | nifcloud/nifcloud-sample | 0 | 12776377 | from nifcloud import session
import sys
import base64
# ---- define name -------
# -- key name ----------
SSH_KYE_FILE_NAME = 'key.pub'
EAST31_KEY_NAME = "key"
# -- security group ----
WEB_SECURITY_GP_NAME = "webfw"
DB_SECURITY_GP_NAME = "dbfw"
# -- Private LAN name ---
WEB_DB_PRV_NET_NAME = "webdbnet"
# -- Router ... | 2.203125 | 2 |
astetik/style/random_colors.py | meirm/astetik | 8 | 12776378 | <gh_stars>1-10
import numpy as np
def randomcolor():
''' PICKS COLORS RANDOMLY
'''
colors = []
for i in range(20):
colors.append(list((np.random.randint(0, 255, 3) / 255)))
return colors
| 3.1875 | 3 |
3.4_matplotlib_live.py | codernayeem/python-data-science-cheat-sheet | 0 | 12776379 | from matplotlib import pyplot as plt
import pandas as pd
import random
from itertools import count
from matplotlib.animation import FuncAnimation
plt.style.use('bmh')
# index = count()
# x = []
# y = []
# def animate(i):
# x.append(next(index))
# y.append(random.randint(1, 10))
# plt.cla()
# plt.plot... | 3.15625 | 3 |
Algorithms/Dynamic Programming/Stock Maximize/solution.py | kitarp29/ds-algo-solutions | 48 | 12776380 | # input number of testcases
test=int(input())
for i in range(test):
# input the number of predicted prices for WOT
n=int(input())
# input array of predicted stock price
a=list(map(int,input().split()))
c=0
i=len(a)-1
while(i>=0):
d=a[i]
l=i
p=0
while(a[i]<=d a... | 3.5625 | 4 |
mailtemplates/lib/celery_tasks.py | axant/tgapp-mailtemplates | 2 | 12776381 | <filename>mailtemplates/lib/celery_tasks.py
from tgext.celery.celery import celery_app
from tgext.mailer import get_mailer
from tg import config
import logging
celery_app.config_from_object(config.get('celery_configuration_object'))
log = logging.getLogger(__name__)
@celery_app.task(name='mailtemplates_async_send_e... | 2.234375 | 2 |
Data Structures/LinkedList/DoublyLL/python/doublyLL.py | ashishsahu1/DataStructures | 1 | 12776382 | class node:
def __init__(self,value):
self.data=value
self.next=None
self.prev=None
class DoubleLinkedList:
def __init__(self):
self.head=None
def insertAtBeg(self,value):
newnode = node(value)
if self.head==None:
self.head=newnode
else:
... | 3.796875 | 4 |
tests/test_parameter/test_time_components_parameter.py | roocs/roocs-utils | 1 | 12776383 | import pytest
from roocs_utils.exceptions import InvalidParameterValue
from roocs_utils.parameter.time_components_parameter import string_to_dict
from roocs_utils.parameter.time_components_parameter import time_components
from roocs_utils.parameter.time_components_parameter import TimeComponentsParameter
type_error ... | 2.65625 | 3 |
apps/puestos/models.py | Monse200599/sistema_medico | 0 | 12776384 | from django.db import models
from django.db.models.base import Model
class Puesto(models.Model):
nombre = models.CharField(max_length=255)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.nombre | 2.28125 | 2 |
pytorch_yolo_v1/utils/viz.py | ldylab/learning_yolo_family_with_pytorch | 0 | 12776385 | import cv2
import numpy as np
def label2rgb(label_np):
print(label_np)
label_color = np.argmax(label_np, axis=0)
label_color = label_color / np.max(label_color) * 255
print(label_color)
n = label_color.astype(np.uint8)
n = np.array(n)
print(type(n))
label_color = cv2.applyColorMap(n, '... | 3.03125 | 3 |
happy_slot_machine.py | breard-r/happy_slot_machine | 0 | 12776386 | <reponame>breard-r/happy_slot_machine
#!/bin/env python
#
# Copyright (c) 2015 <NAME>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE... | 3.40625 | 3 |
setup.py | CottageLabs/OpenArticleGauge | 1 | 12776387 | <filename>setup.py
from setuptools import setup, find_packages
setup(
name = 'openarticlegauge',
version = '0.0.1',
packages = find_packages(),
install_requires = [
"Flask==0.9",
"Jinja2==2.6",
"Werkzeug==0.8.3",
"anyjson==0.3.3",
"argparse==1.2.1",
"cele... | 1.453125 | 1 |
example.py | Kalvar/python-GreyTheory | 23 | 12776388 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from greytheory import GreyTheory
grey = GreyTheory()
# GM0N
gm0n = grey.gm0n
gm0n.add_outputs([1., 1., 1., 1., 1., 1.], "x1")
gm0n.add_patterns([.75, 1.22, .2, 1., 1., 1.], "x2")
gm0n.add_patterns([.5, 1., .7, .66, 1., .5], "x3")
gm0n.add_patterns([1., 1.09, .4, .33, .66... | 2.5 | 2 |
serveradmin/servershell/templatetags/serversearch.py | abdulkadirakin/serveradmin | 43 | 12776389 | """Serveradmin
Copyright (c) 2019 InnoGames GmbH
"""
from json import dumps
from django import template
from django.conf import settings
from adminapi.filters import filter_classes
from serveradmin.serverdb.models import Attribute, Servertype
register = template.Library()
@register.inclusion_tag('serversearch.ht... | 2.046875 | 2 |
tasks.py | Lugoues/bq-schema | 9 | 12776390 | from invoke import task
_TEST_FOLDER = "tests"
_SOURCE_FOLDERS = " ".join(["bq_schema", _TEST_FOLDER])
@task
def lint(context):
context.run(f"pylint {_SOURCE_FOLDERS}")
@task
def type_check(context):
context.run("mypy bq_schema")
@task
def check_code_format(context):
context.run("black --check .")
... | 1.796875 | 2 |
tools/common.py | Wenslauv/RekiScript | 1 | 12776391 | #!usr/bin/python
class Enviroment:
sets = []
banned = [] | 1.195313 | 1 |
data_pre_process.py | mahatmaWM/NCRFpp | 0 | 12776392 | <filename>data_pre_process.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
把我们的序列标注格式转化为项目支持的格式
"""
import codecs
if __name__ == '__main__':
with codecs.open('./sys.media.ip/test.txt', "r", "utf-8") as f1, \
codecs.open('./sys.media.ip/test_new.txt', "w", "utf-8") as f_train:
sentence = list([])
... | 2.734375 | 3 |
ch10/2_group_anagrams.py | zmarvel/cracking | 0 | 12776393 |
store = {}
def anagram_key(s):
if s not in store:
store[s] = sorted(s)
return store[s]
def group_anagrams(ls):
ls = sorted(ls, key=anagram_key)
return ls
def test():
from random import shuffle
l = [
"ascot",
"coats",
"coast",
"sushi",
"tacos",... | 3.9375 | 4 |
PyProj.py | MrBanh/PyProj | 0 | 12776394 | <filename>PyProj.py
#! python3
# PyProj.py - Creates a directory template for python projects
# Usage:
# PyProj.py save <project name> - creates project directory
# PyProj.py remove <project name> - removes project directory
# PyProj.py <project name> - Shows where project directory is... | 3.421875 | 3 |
app/auth/views.py | reivhax/One-minute-pitch | 0 | 12776395 | from flask import render_template,request,redirect,url_for,abort
from flask_login import login_user,login_required,current_user,logout_user
from ..models import User
from .forms import LoginForm,RegisterForm
from . import auth
# Views
@auth.route('/login', methods=["GET","POST"])
def login():
if current_user.is_au... | 2.84375 | 3 |
htcanalyze/view/summarized_logfile_view.py | psyinfra/htcompact | 0 | 12776396 | <gh_stars>0
"""Module to create a view for summarized log files."""
from datetime import timedelta
from typing import List
from htcanalyze.globals import BAD_USAGE, TOLERATED_USAGE
from .view import View
from ..log_summarizer.summarized_condor_logs.summarized_condor_logs import (
SummarizedCondorLogs
)
class Sum... | 2.5 | 2 |
utils.py | steynvl/video-format-converter | 1 | 12776397 | import sys
import os
import shutil
import shlex
from command import Command
def check_ffmpeg_installed():
if shutil.which('ffmpeg') is None:
print('The program \'ffmpeg\' is not installed in your system.\n'
'You can install it by visiting http://ffmpeg.org/download.html')
sys.exit(0)... | 3.28125 | 3 |
sentdex_data_analysis/pandas_TPOT.py | thimotyb/Data-Analysis | 5 | 12776398 | import pandas as pd
import numpy as np
from tpot import TPOTClassifier
from sklearn.model_selection import train_test_split
benchmark = pd.read_pickle('us_pct.pickle') # us overall housing price index percentage change
HPI = pd.read_pickle('HPI_complete.pickle') # all of the state data, thirty year mortgage, unempl... | 2.921875 | 3 |
app.py | frason88/Heart-Pred-Project | 0 | 12776399 |
#Important Modules
from flask import Flask,render_template, url_for ,flash , redirect
import pickle
from flask import request
import numpy as np
import os
from flask import send_from_directory
#from this import SQLAlchemy
app=Flask(__name__,template_folder='template')
@app.route("/")
@app.route("/home")
def... | 2.75 | 3 |
1) Applying Geometric Transformations to Images/#4 Image translation/translation.py | RezaFirouzii/python-opencv-review | 0 | 12776400 | import cv2 as cv
import numpy as np
if __name__ == "__main__":
img = cv.imread('../../assets/test1.jpg')
height, width = img.shape[:2] # rows, columns
# translating the img 200 pixels right (x axis)
translation_matrix = np.float32([[1, 0, 200], [0, 1, 0]])
output = cv.warpAffine(img, transl... | 3.296875 | 3 |
views/templates.py | dpgd/utils | 0 | 12776401 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.http import HttpResponse
from django.http import JsonResponse
import json
imp... | 2.109375 | 2 |
gitvier/commands.py | MasterOdin/gitvier | 2 | 12776402 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import os
import sys
from colorama import Fore, init as colorama_init
from git import Repo, CheckoutError
from git.exc import InvalidGitRepositoryError
from .common import get_input, get_yes, call as shell_call, output
from .config import get_config, Config
colorama_init(autor... | 2.46875 | 2 |
edu_loan/api/app.py | renanbs/edu-loan | 0 | 12776403 | from flask import Flask
from injector import Injector
from edu_loan.config.default import Config
from edu_loan.config.dependencies import ApplicationRegister, Application
from edu_loan.config.main_module import MODULES, create_injector
def create_app(injector: Injector) -> Flask:
"""
Creates a Flask app
... | 2.6875 | 3 |
webapp-flask/app/src/models/user.py | didYouUpdateCode/iot_monitoring | 0 | 12776404 | from marshmallow import fields, validate
from .. import db, ma
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String, unique=True, nullable=False)
password = db.Column(db.String, nullable=False)
creation_date = db.Column(db.TIMESTAMP,
... | 2.671875 | 3 |
udata_schema_gouvfr/__init__.py | AntoineAugusti/udata-schema | 2 | 12776405 | <filename>udata_schema_gouvfr/__init__.py
'''
udata-schema-gouvfr
Integration with schema.data.gouv.fr
'''
__version__ = '1.3.3.dev'
__description__ = 'Integration with schema.data.gouv.fr'
| 0.980469 | 1 |
inheritance/zoo/reptile.py | ivan-yosifov88/python_oop_june_2021 | 1 | 12776406 | from zoo.animal import Animal
class Reptile(Animal):
pass
| 1.40625 | 1 |
PedSimulation/example/listener.py | HDL951236874/PedSimulation | 1 | 12776407 | from PedSimulation.scene import SceneListener
from PedSimulation.entity import Agent, RotateAgent
import math
class PedestrianEscapeListener(SceneListener):
def on_added(self):
pass
def on_begin(self):
pass
def on_stepped(self):
for agent in list(set(self.scene.entities_of_type(Ag... | 2.59375 | 3 |
pyqtsocius/ui_elements/misc_ui/system_tray.py | Giddius/PyQt_Socius | 0 | 12776408 | <reponame>Giddius/PyQt_Socius
# region [Imports]
# * Standard Library Imports -->
import gc
import os
import re
import sys
import json
import lzma
import time
import queue
import logging
import platform
import subprocess
from enum import Enum, Flag, auto
from time import sleep
from pprint import pprint, pformat
from t... | 1.40625 | 1 |
dmriqcpy/version.py | liuzhenqi77/dmriqcpy | 4 | 12776409 | <filename>dmriqcpy/version.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import glob
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 1
_version_micro = '' # use '' for first of series, number for 1 and abov... | 1.726563 | 2 |
problem-051/main.py | Shiqan/daily-coding-problem | 2 | 12776410 | <filename>problem-051/main.py<gh_stars>1-10
#!/usr/bin/env python
""" Problem 51 daily-coding-problem.com """
import random
from typing import List
def shuffle_cards(cards: List[int]) -> List[int]:
for i in range(len(cards)-1, 0, -1):
j = random.randint(0,i)
cards[i], cards[j] = cards[j],cards[i]
... | 3.71875 | 4 |
storage/team03/storageManager/Tabla.py | webdev188/tytus | 35 | 12776411 | from storageManager.CrudTupla import CrudTuplas
class Tabla:
def __init__(self, nombre, columnas):
self.nombre = nombre
self.columnas = columnas
self.estructura = CrudTuplas(columnas)
def getNombreASCII(self):
number = 0
for c in self.nombre:
number += ord(... | 2.828125 | 3 |
quadcopter.py | shijy16/quadqopter | 0 | 12776412 | import numpy as np
import vrep
import ctypes
import math
import sys
import time
sim_dt = 0.01
dt = 0.001
SYNC = True
vrep_mode = vrep.simx_opmode_oneshot
def b( num ):
""" forces magnitude to be 1 or less """
if abs( num ) > 1.0:
return math.copysign( 1.0, num )
else:
return num
def convert_angles( a... | 2.828125 | 3 |
cogs/events/errorHandler.py | xcloudx12345/tts-bot-discord | 3 | 12776413 | import discord
from discord.ext import commands
import random
import sys
import traceback
class ErrorHandler(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
# This prevents any commands with ... | 2.4375 | 2 |
Face Reconstruction/Self-Supervised Monocular 3D Face Reconstruction by Occlusion-Aware Multi-view Geometry Consistency/src_common/geometry/render/api_tf_mesh_render.py | swapnilgarg7/Face-X | 302 | 12776414 | <filename>Face Reconstruction/Self-Supervised Monocular 3D Face Reconstruction by Occlusion-Aware Multi-view Geometry Consistency/src_common/geometry/render/api_tf_mesh_render.py<gh_stars>100-1000
# system
from __future__ import print_function
# python lib
import math
from copy import deepcopy
import numpy as np
# t... | 1.875 | 2 |
scripts/evaluate_on_target.py | millicentli/clin-bias-summarization | 0 | 12776415 | <reponame>millicentli/clin-bias-summarization
import argparse
import pandas as pd
import numpy as np
from transformers import BartTokenizer, BartForConditionalGeneration
## Initialize arguments
parser = argparse.ArgumentParser()
parser.add_argument('--task_type', defaut='binary', const='binary', nargs ='?', choices=['... | 2.40625 | 2 |
cupyx/fallback_mode/__init__.py | prkhrsrvstv1/cupy | 6,180 | 12776416 | <reponame>prkhrsrvstv1/cupy
from cupy import _util
# Attributes and Methods for fallback_mode
# Auto-execute numpy method when corresponding cupy method is not found
# "NOQA" to suppress flake8 warning
from cupyx.fallback_mode.fallback import numpy # NOQA
_util.experimental('cupyx.fallback_mode.numpy')
| 1.5625 | 2 |
tools/intogen/lib/python/intogensm/command/qc.py | globusgenomics/galaxy | 1 | 12776417 | <filename>tools/intogen/lib/python/intogensm/command/qc.py
from intogensm.command import RunCommand
class QcCommand(RunCommand):
cmd_name = "qc"
def execute(self):
self._wok_run(self.instance_name, self.conf_builder, "intogen-mutations:qc") | 1.726563 | 2 |
openarticlegauge/plugins/oup.py | CottageLabs/OpenArticleGauge | 1 | 12776418 | from openarticlegauge import plugin
import re
class OUPPlugin(plugin.Plugin):
_short_name = __name__.split('.')[-1]
__version__='0.1' # consider incrementing or at least adding a minor version
# e.g. "0.1.1" if you change this plugin
__desc__ = "Handles articles from the Oxford Universi... | 2.203125 | 2 |
tick/solver/history/__init__.py | sumau/tick | 411 | 12776419 | # License: BSD 3 clause
# import tick.base
from .history import History
__all__ = ["History"]
| 1.046875 | 1 |
nodes/smads_endpoints_node.py | UTSMADS/smads_core | 0 | 12776420 | #!/usr/bin/env python3
import rospy
import threading
from enum import Enum
from smads_core.client import JackalClient
from smads_core.client import SpotClient
from smads_core.client import RobotClient
from smads_core.interface import RobotSensorInterface
from smads_core.interface import RobotNavigationInterface
cl... | 2.390625 | 2 |
ht/cogs/misc.py | mirnovov/heraldtron | 0 | 12776421 | import discord, asyncio, typing, random, os, html
from discord import ui
from discord.ext import commands
from collections import defaultdict
from datetime import datetime, timezone, timedelta
from .. import converters, embeds, services, utils, views
class MiscStuff(utils.MeldedCog, name = "Miscellaneous", category = ... | 2.578125 | 3 |
src/main.py | Pikaurd/ps_mockup_downloader | 0 | 12776422 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
options = Options()
options.headless = True
# options.add_argument('--proxy-server http://127.0.0.1:8001')
options.binary_location = '/Applications/Google Chrome.app/Contents/MacOS/Googl... | 2.640625 | 3 |
wflow-py/wflow/wflow_topoflex.py | edwinkost/wflow | 0 | 12776423 | #!/usr/bin/python
"""
Definition of the wflow_sceleton model.
---------------------------------------
This simple model calculates soil temperature using
air temperature as a forcing.
Usage:
wflow_sceleton -C case -R Runid -c inifile
-C: set the name of the case (directory) to run
-R: set the name ru... | 2.390625 | 2 |
ddi_search_engine/Bio/expressions/transfac.py | dbmi-pitt/DIKB-Evidence-analytics | 3 | 12776424 | """A Martel format to parse the output from transfac.
Formats:
format Format for a whole file.
"""
import warnings
warnings.warn("Bio.expressions was deprecated, as it does not work with recent versions of mxTextTools. If you want to continue to use this module, please get in contact with the Biopython d... | 2.84375 | 3 |
jab/admin.py | pythonanywhere/jab | 13 | 12776425 | from django.contrib import admin
from jab.models import Post, SidebarItem
class PostAdmin(admin.ModelAdmin):
list_display = ('publication_date', 'title', 'status',)
ordering = ('-publication_date',)
admin.site.register(Post, PostAdmin)
class SidebarItemAdmin(admin.ModelAdmin):
pass
admin.site.registe... | 1.5 | 2 |
graphbrain/commands/info.py | nicolamelluso/graphbrain | 1 | 12776426 | <filename>graphbrain/commands/info.py
from graphbrain import *
def run(args):
hg = hgraph(args.hg)
print('atoms: {}'.format(hg.atom_count()))
print('edges: {}'.format(hg.edge_count()))
print('primary atoms: {}'.format(hg.primary_atom_count()))
print('primary edges: {}'.format(hg.primary_edge_count... | 2.3125 | 2 |
queue/queue.py | marcoswb/data-structure | 0 | 12776427 | class Queue:
def __init__(self) :
self.__max = 10
self.__first = 0
self.__last = 0
self.__structure = {}
def is_full(self):
"""
Verifica se a Queue está cheia
"""
result = (self.__last - self.__first) == self.__max
return result
de... | 4.1875 | 4 |
tests/utils/test_get_laplacian.py | BUPT-GAMMA/GammaGL | 0 | 12776428 | # !/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time : 2022/05/00 16:47
# @Author : clear
# @FileName: test_get_laplacian.py
import tensorlayerx as tlx
from gammagl.utils.get_laplacian import get_laplacian
def test_get_laplacian():
edge_index = tlx.convert_to_tensor([[0, 1, 1, 2], [1, 0, 2, 1]], dtype=tlx.... | 2.421875 | 2 |
gallery/sitemap.py | VasiliyBologov/i-bologova.info | 0 | 12776429 | <reponame>VasiliyBologov/i-bologova.info
from django.contrib.sitemaps import Sitemap
# from .models import RequestModel
# import ClientPortal.settings as set
class StaticViewSitemap(Sitemap):
changefreq = "monthly"
priority = 0.8
def items(self):
# return RequestModel.objects.all()
return... | 1.75 | 2 |
neochain/_release_info.py | dharif23/neochain | 1 | 12776430 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Source code meta data
__author__ = '<NAME>'
__email__ = '<EMAIL>'
# Version
__version__ = '1.1'
__release__ = '1.1'
| 1.125 | 1 |
tests/test_api.py | chrononyan/ok | 148 | 12776431 | <filename>tests/test_api.py
import datetime as dt
import dateutil.parser
import json
import random
from server.models import (Client, db, Assignment, Backup, Course, User,
Version, Group, )
from server.utils import encode_id
from tests import OkTestCase
class TestApi(OkTestCase):
def _... | 2.4375 | 2 |
pydm/tests/data_plugins/test_calc_plugin.py | jbellister-slac/pydm | 0 | 12776432 | from typing import Any
import pytest
from pytestqt.qtbot import QtBot
from qtpy.QtCore import Signal, QObject
import numpy as np
from pydm.application import PyDMApplication
from pydm.data_plugins.calc_plugin import epics_string, epics_unsigned
from pydm.widgets.channel import PyDMChannel
@pytest.mark.parametrize(
... | 2.25 | 2 |
tests/test_storage.py | class4kayaker/stray_recipe_manager | 0 | 12776433 | import io
import pytest
import stray_recipe_manager.units
import stray_recipe_manager.storage
from stray_recipe_manager.recipe import (
CommentedRecipe,
Recipe,
Ingredient,
RecipeStep,
)
ureg = stray_recipe_manager.units.default_unit_registry
@pytest.fixture(scope="module")
def toml_coding():
re... | 2.171875 | 2 |
application/app.py | ericdaat/flask-template | 0 | 12776434 | <filename>application/app.py
import os
from flask import Flask
from application import errors, cli
from application.model import db, session
def create_app(config=None):
""" Flask app factory that creates and configure the app.
Args:
test_config (str): python configuration filepath
Returns: Fl... | 2.6875 | 3 |
python/scrutiny/server/device/device_handler.py | scrutinydebugger/scrutiny | 1 | 12776435 | import copy
import queue
import time
import logging
import binascii
from enum import Enum
from scrutiny.server.protocol.comm_handler import CommHandler
from scrutiny.server.protocol import Protocol, ResponseCode
from scrutiny.server.device.device_searcher import DeviceSearcher
from scrutiny.server.device.request_dispa... | 2.265625 | 2 |
ImgSegment06.py | mmtaksuu/OpenCV_Python_Tutorial | 2 | 12776436 | import cv2
import numpy as np
import matplotlib.pyplot as plt
def main():
path = "C:\\Users\\enesa\\Documents\\MATLAB\\blobs_objects.jpg"
img = cv2.imread(path, 1)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
filter1 = np.array(([0, -1, 0], [-1, 5, -1], [0, -1, 0]), np.float32) #Sharpening Filter
o... | 3.484375 | 3 |
dolfyn/_version.py | MRE-Code-Hub/dolfyn | 28 | 12776437 | __version__ = '0.12.1'
__prog_name__ = 'DOLfYN'
__version_date__ = 'May-07-2020'
def ver2tuple(ver):
if isinstance(ver, tuple):
return ver
# ### Previously used FLOATS for 'save-format' versioning.
# Version 1.0: underscore ('_') handled inconsistently.
# Version 1.1: '_' and '#' handled consi... | 2.5625 | 3 |
app_APPium_test/test_wework.py | XuXuClassMate/My_Test_PyProject | 0 | 12776438 | from time import sleep
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
phone_info = {
"platformName": "android",
"platformVersion": "8.1",
"deviceName": "S4F6R19C18016391",
"appPackage": "com.tencent.wework",
"appActivity": ".launch.LaunchSplashActivity t9",
"... | 2.6875 | 3 |
disassembler.py | dasien/mfc6502 | 0 | 12776439 | <filename>disassembler.py
from mfcbase import MFCBase
class Disassembler(MFCBase):
def __init__(self, infile, outfile, startaddr, includecounter, counterinfile):
# This variable handles the writing of the start position of file.
self.__programstartset = False
# Superclass init.
... | 2.9375 | 3 |
cover.py | NaikAayush/bpl-hassio-component | 4 | 12776440 |
import logging
import socket
import threading
import datetime
import time
import math
from . import BPLMonitor, BPLCurtain, DATA_DOMAIN
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the sens... | 2.5 | 2 |
Codefights/arcade/intro/level-11/49.lineEncoding/Python/test.py | RevansChen/online-judge | 7 | 12776441 | # Python3
from solution1 import lineEncoding as f
qa = [
('aabbbc', '2a3bc'),
('abbcabb', 'a2bca2b'),
('abcd', 'abcd'),
('zzzz', '4z'),
('wwwwwwwawwwwwww', '7wa7w'),
('ccccccccccccccc', '15c'),
('qwertyuioplkjhg', 'qwertyuioplkjhg'),
('ssiiggkooo', '2s2i2gk3o'),
('adfaaa', 'adf3a')... | 2.84375 | 3 |
autobazaar/__main__.py | csala/AutoBazaar | 87 | 12776442 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""AutoBazaar Command Line Module."""
import argparse
import gc
import json
import os
import shutil
import socket
import sys
import traceback
import warnings
from datetime import datetime
import cloudpickle
import pandas as pd
from mit_d3m import metrics
from mit_d3m.dat... | 2.046875 | 2 |
bag.py | dineshrajpurohit/ds_al | 0 | 12776443 | from linked_list import Linked_List, Node
import random
class Bag(Linked_List):
def __init__(self):
Linked_List.__init__(self)
def add(self, item):
"""Stores in a random location in the Linked list"""
if self.count == 0:
random_location = 0
else:
rando... | 3.796875 | 4 |
library/Custom/python_2_template.py | sarafanshul/KACTL | 4 | 12776444 | <gh_stars>1-10
from __future__ import division, print_function
import bisect
import math
import heapq
import itertools
import sys
from collections import deque
from atexit import register
from collections import Counter
from functools import reduce
sys.setrecursionlimit(10000000)
if sys.version_info[0] < 3:
from io... | 2.3125 | 2 |
arrays/tests/test_remove_element.py | ahcode0919/python-ds-algorithms | 0 | 12776445 | from arrays.remove_element import remove_element
def test_remove_element():
arr = [3, 2, 2, 3]
length = remove_element(arr, 3)
assert length == 2
assert arr == [2, 2, 2, 3]
arr = [1]
length = remove_element(arr, 1)
assert length == 0
assert arr == [1]
arr = [2, 2, 3, 3]
lengt... | 3.671875 | 4 |
tests/components/sleepiq/conftest.py | MrDelik/core | 3 | 12776446 | """Common methods for SleepIQ."""
from __future__ import annotations
from collections.abc import Generator
from unittest.mock import MagicMock, create_autospec, patch
from asyncsleepiq import (
SleepIQActuator,
SleepIQBed,
SleepIQFoundation,
SleepIQLight,
SleepIQPreset,
SleepIQSleeper,
)
impor... | 2.171875 | 2 |
qcloudsdkdfw/DescribeInstancesOfSecurityGroupRequest.py | f3n9/qcloudcli | 0 | 12776447 | <filename>qcloudsdkdfw/DescribeInstancesOfSecurityGroupRequest.py
# -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class DescribeInstancesOfSecurityGroupRequest(Request):
def __init__(self):
super(DescribeInstancesOfSecurityGroupRequest, self).__init__(
'dfw', 'qcloudcliV1', ... | 2.15625 | 2 |
benchmarks/SimResults/_bigLittle_hrrs_spec_tugberk_ml/SystemIPC_2/cmp_GemsFDTD/power.py | TugberkArkose/MLScheduler | 0 | 12776448 | <gh_stars>0
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
... | 1.585938 | 2 |
mail.py | robDaglio/dev_mail | 0 | 12776449 | #!/usr/bin/env python
import email, smtplib, ssl
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
class Simple():
def __init__(self, sender, recipient, password, subject, text):
... | 3.21875 | 3 |
rollbar/examples/flask/app.py | arthurio/pyrollbar | 177 | 12776450 | <filename>rollbar/examples/flask/app.py
# NOTE: pyrollbar requires both `Flask` and `blinker` packages to be installed first
from flask import Flask
from flask import got_request_exception
import rollbar
import rollbar.contrib.flask
app = Flask(__name__)
@app.before_first_request
def init_rollbar():
rollbar.in... | 2.359375 | 2 |