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 |
|---|---|---|---|---|---|---|
Nelson_Alvarez/Assignments/flask_fund/ninja_turtle/turtle.py | webguru001/Python-Django-Web | 5 | 10800 | <reponame>webguru001/Python-Django-Web<gh_stars>1-10
from flask import Flask
from flask import render_template, redirect, session, request
app = Flask(__name__)
app.secret_key = 'ThisIsSecret'
@app.route('/')
def nothing():
return render_template('index.html')
@app.route('/ninja')
def ninja():
x = 'tmnt'
r... | 2.578125 | 3 |
neo/Network/Inventory.py | BSathvik/neo-python | 15 | 10801 | # -*- coding:utf-8 -*-
"""
Description:
Inventory Class
Usage:
from neo.Network.Inventory import Inventory
"""
from neo.IO.MemoryStream import MemoryStream
from neocore.IO.BinaryWriter import BinaryWriter
class Inventory(object):
"""docstring for Inventory"""
def __init__(self):
"""
... | 2.765625 | 3 |
tests/test_api_gateway/test_common/test_exceptions.py | Clariteia/api_gateway_common | 3 | 10802 | <filename>tests/test_api_gateway/test_common/test_exceptions.py<gh_stars>1-10
"""
Copyright (C) 2021 Clariteia SL
This file is part of minos framework.
Minos framework can not be copied and/or distributed without the express permission of Clariteia SL.
"""
import unittest
from minos.api_gateway.common import (
E... | 1.929688 | 2 |
native_prophet.py | 1143048123/cddh | 177 | 10803 | <gh_stars>100-1000
# coding: utf-8
# quote from kmaiya/HQAutomator
# 谷歌搜索部分原版搬运,未做修改
import time
import json
import requests
import webbrowser
questions = []
def get_answer():
resp = requests.get('http://htpmsg.jiecaojingxuan.com/msg/current',timeout=4).text
resp_dict = json.loads(resp)
... | 2.90625 | 3 |
python/ht/nodes/styles/styles.py | Hengle/Houdini-Toolbox | 136 | 10804 | """Classes representing color entries and mappings."""
# =============================================================================
# IMPORTS
# =============================================================================
from __future__ import annotations
# Standard Library
import re
from typing import TYPE_CHEC... | 3.4375 | 3 |
src/sntk/kernels/ntk.py | gear/s-ntk | 0 | 10805 | <reponame>gear/s-ntk<gh_stars>0
import math
import numpy as np
# return an array K of size (d_max, d_max, N, N), K[i][j] is kernel value of depth i + 1 with first j layers fixed
def kernel_value_batch(X, d_max):
K = np.zeros((d_max, d_max, X.shape[0], X.shape[0]))
for fix_dep in range(d_max):
S = np.... | 1.59375 | 2 |
nlpproject/main/words.py | Hrishi2312/IR-reimagined | 0 | 10806 | <filename>nlpproject/main/words.py
import nltk
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer, PorterStemmer
from nltk.tokenize import sent_tokenize , word_tokenize
import glob
import re
import os
import numpy as np
import sys
nltk.download('stopwords')
nltk.download('punkt')
Stopwords = set... | 3.171875 | 3 |
oseoserver/operations/describeresultaccess.py | pyoseo/oseoserver | 0 | 10807 | # Copyright 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 2.21875 | 2 |
utils/decorator/dasyncio.py | masonsxu/red-flask | 0 | 10808 | <reponame>masonsxu/red-flask
# -*- coding: utf-8 -*-
# 基于python Threading模块封装的异步函数装饰器
import time
from functools import wraps
from threading import Thread
def async_call(fn):
"""一次简单的异步处理操作,装饰在要异步执行的函数前,再调用该函数即可执行单次异步操作(开辟一条新的线程)
Args:
:fn(function):需要异步处理的方法
Return:
:wrapper(function):
... | 3.0625 | 3 |
oo/pessoa.py | wfs18/pythonbirds | 0 | 10809 | class Person:
olhos = 2
def __init__(self, *children, name=None, year=0):
self.year = year
self.name = name
self.children = list(children)
def cumprimentar(self):
return 'Hello'
@staticmethod
def metodo_estatico():
return 123
@classmethod
def metod... | 3.828125 | 4 |
tests/integration/test_combined.py | jonathan-winn-geo/new-repo-example | 0 | 10810 | """Test combined function."""
from cmatools.combine.combine import combined
def test_combined():
"""Test of combined function"""
assert combined() == "this hello cma"
| 1.914063 | 2 |
elastalert_modules/top_count_keys_enhancement.py | OpenCoreCH/elastalert | 0 | 10811 | """Enhancement to reformat `top_events_X`
from match in order to reformat and put it
back to be able to use in alert message.
New format:
top_events_keys_XXX -- contains array of corresponding key values defined in `top_count_keys`,
where `XXX` key from `top_count_keys` array.
top_events_values_XXX -- contains arra... | 2.921875 | 3 |
nets.py | koreyou/SWEM-chainer | 0 | 10812 | <reponame>koreyou/SWEM-chainer<gh_stars>0
import numpy
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import reporter
embed_init = chainer.initializers.Uniform(.25)
def block_embed(embed, x, dropout=0.):
"""Embedding function followed by convolution
Args:
embed ... | 2.78125 | 3 |
src/entities/users.py | MillaKelhu/ohtu-lukuvinkkikirjasto | 0 | 10813 | from flask_login import UserMixin
class Users(UserMixin):
# Luodaan näennäinen tietokanta käyttäjistä
user_database = {"kayttaja": ("kayttaja", "salasana"),
"tunnus": ("tunnus", "passu")}
def __init__(self, id, username, password):
self.id = id
self.username = username
self.pas... | 2.84375 | 3 |
artifacts/kernel_db/autotvm_scripts/tune_tilling_dense_select_codegen.py | LittleQili/nnfusion | 0 | 10814 | """
matmul autotvm
[batch,in_dim] x [in_dim,out_dim]
search_matmul_config(batch,in_dim,out_dim,num_trials):
input: batch,in_dim,out_dim,num_trials
[batch,in_dim] x [in_dim,out_dim]
num_trials: num of trials, default: 1000
output: log (json format)
use autotvm to search configs for the matm... | 2.703125 | 3 |
src/olympia/activity/admin.py | dante381/addons-server | 0 | 10815 | <filename>src/olympia/activity/admin.py<gh_stars>0
from django.contrib import admin
from .models import ActivityLog, ReviewActionReasonLog
from olympia.reviewers.models import ReviewActionReason
class ActivityLogAdmin(admin.ModelAdmin):
list_display = (
'created',
'user',
'__str__',
)... | 1.929688 | 2 |
modules/nmap_script/address_info.py | naimkowshik/reyna-eye | 4 | 10816 | import subprocess
import sys
import time
import os
#############################
# COLORING YOUR SHELL #
#############################
R = "\033[1;31m" #
B = "\033[1;34m" #
Y = "\033[1;33m" #
G = "\033[1;32m" #
RS = "\033[0m" #
W = "\033[1;37m" ... | 3.28125 | 3 |
tests/utilities/test_upgrade_checkpoint.py | cuent/pytorch-lightning | 0 | 10817 | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 1.804688 | 2 |
rnn/train_rnn_oneflow.py | XinYangDong/models | 0 | 10818 | <reponame>XinYangDong/models<gh_stars>0
import oneflow.experimental as flow
from oneflow.experimental import optim
import oneflow.experimental.nn as nn
from utils.dataset import *
from utils.tensor_utils import *
from models.rnn_model import RNN
import argparse
import time
import math
import numpy as np
flow.env.ini... | 2.25 | 2 |
metaflow/datastore/local_storage.py | RobBlumberg/metaflow | 2 | 10819 | import json
import os
from ..metaflow_config import DATASTORE_LOCAL_DIR, DATASTORE_SYSROOT_LOCAL
from .datastore_storage import CloseAfterUse, DataStoreStorage
from .exceptions import DataException
class LocalStorage(DataStoreStorage):
TYPE = "local"
METADATA_DIR = "_meta"
@classmethod
def get_datas... | 2.25 | 2 |
src/Models/tools/quality.py | rahlk/MOOSE | 0 | 10820 | <filename>src/Models/tools/quality.py
from __future__ import division, print_function
from scipy.spatial.distance import euclidean
from numpy import mean
from pdb import set_trace
class measure:
def __init__(self,model):
self.mdl = model
def convergence(self, obtained):
"""
Calculate the convergence m... | 2.890625 | 3 |
script/spider/www_chinapoesy_com.py | gitter-badger/poetry-1 | 1 | 10821 | <filename>script/spider/www_chinapoesy_com.py
'''
pip3 install BeautifulSoup4
pip3 install pypinyin
'''
import requests
import re
import os
import shutil
from bs4 import BeautifulSoup
from util import Profile, write_poem
def parse_poem_profile_td(td):
container = td.find('div')
if container is None:... | 2.96875 | 3 |
design-patterns-101/Animal.py | stealthanthrax/python-design-patterns | 0 | 10822 | class Animal:
def __init__(self):
self.name = ""
self.weight = 0
self.sound = ""
def setName(self, name):
self.name = name
def getName(self):
return self.name
def setWeight(self, weight):
self.weight = weight
def getWeight(self):
return sel... | 3.53125 | 4 |
tests/test_events.py | hhtong/dwave-cloud-client | 0 | 10823 | <reponame>hhtong/dwave-cloud-client
# Copyright 2020 D-Wave Systems 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.84375 | 2 |
ex3_nn_TF2.py | Melykuti/Ng_Machine_learning_exercises | 3 | 10824 | <reponame>Melykuti/Ng_Machine_learning_exercises<gh_stars>1-10
'''
Neural networks. Forward propagation in an already trained network in TensorFlow 2.0-2.1 (to use the network for classification).
TF 2.0:
Option 0 takes 0.08 sec.
Option 1 takes 0.08 sec.
Option 6 takes 0.08 sec.
Option 2 takes 4.7 sec.
Option 3 takes ... | 3.09375 | 3 |
instagram/models.py | kilonzijnr/instagram-clone | 0 | 10825 | <gh_stars>0
from django.db import models
from django.db.models.deletion import CASCADE
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
# Create your models here.
class Profile(models.Model):
"""Model for handling User Profile"""
user = models.OneToOneField(User, on_del... | 2.578125 | 3 |
addons/purchase_request/migrations/13.0.4.0.0/post-migration.py | jerryxu4j/odoo-docker-build | 0 | 10826 | <filename>addons/purchase_request/migrations/13.0.4.0.0/post-migration.py
from odoo import SUPERUSER_ID, api
from odoo.tools.sql import column_exists
def migrate(cr, version=None):
env = api.Environment(cr, SUPERUSER_ID, {})
if column_exists(cr, "product_template", "purchase_request"):
_migrate_purcha... | 2 | 2 |
cfy/server.py | buhanec/cloudify-flexiant-plugin | 0 | 10827 | # coding=UTF-8
"""Server stuff."""
from __future__ import print_function
from cfy import (create_server,
create_ssh_key,
attach_ssh_key,
wait_for_state,
wait_for_cond,
create_nic,
attach_nic,
get_res... | 1.890625 | 2 |
markdown2dita.py | mattcarabine/markdown2dita | 6 | 10828 | # coding: utf-8
"""
markdown2dita
~~~~~~~~~~~~~
A markdown to dita-ot conversion tool written in pure python.
Uses mistune to parse the markdown.
"""
from __future__ import print_function
import argparse
import sys
import mistune
__version__ = '0.3'
__author__ = '<NAME> <<EMAIL>>'
__all__ = ['Render... | 2.96875 | 3 |
tests/integration/test_reload_certificate/test.py | roanhe-ts/ClickHouse | 1 | 10829 | <gh_stars>1-10
import pytest
import os
from helpers.cluster import ClickHouseCluster
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', main_configs=["configs/first.crt", "configs/first.key",
... | 2.109375 | 2 |
examples/python/fling.py | arminfriedl/fling | 0 | 10830 | <filename>examples/python/fling.py
import flingclient as fc
from flingclient.rest import ApiException
from datetime import datetime
# Per default the dockerized fling service runs on localhost:3000 In case you
# run your own instance, change the base url
configuration = fc.Configuration(host="http://localhost:3000")
... | 2.921875 | 3 |
pretraining/python/download_tensorboard_logs.py | dl4nlp-rg/PTT5 | 51 | 10831 | <filename>pretraining/python/download_tensorboard_logs.py
import tensorflow.compat.v1 as tf
import os
import tqdm
GCS_BUCKET = 'gs://ptt5-1'
TENSORBOARD_LOGS_LOCAL = '../logs_tensorboard'
os.makedirs(TENSORBOARD_LOGS_LOCAL, exist_ok=True)
# where to look for events files - experiment names
base_paths = [
# Main ... | 2.265625 | 2 |
tests/TestPythonLibDir/RemotePkcs1Signer/__init__.py | q351941406/isign-1 | 83 | 10832 | import base64
import requests
class RemotePkcs1Signer(object):
""" Client-side Signer subclass, that calls the Signing Service over HTTP to sign things """
# standard headers for request
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
def __init__(s... | 3.140625 | 3 |
architecture_tool_django/nodes/tasks.py | goldginkgo/architecture_tool_django | 1 | 10833 | import logging
import re
from celery import shared_task
from django.conf import settings
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.template.loader import get_template
from django.urls import reverse
from django.utils import timezone
from architecture_tool_django.utils.c... | 1.867188 | 2 |
crosswalk/views/alias_or_create.py | cofin/django-crosswalk | 4 | 10834 | <filename>crosswalk/views/alias_or_create.py
from crosswalk.authentication import AuthenticatedView
from crosswalk.models import Domain, Entity
from crosswalk.serializers import EntitySerializer
from crosswalk.utils import import_class
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import sta... | 2.484375 | 2 |
hoist/fastapi_wrapper.py | ZeroIntensity/Hoist | 0 | 10835 | from fastapi import FastAPI, Response, WebSocket, WebSocketDisconnect
from threading import Thread
from .server import Server
from .errors import HoistExistsError
from .error import Error
from .version import __version__
from .flask_wrapper import HTML
import uvicorn
from typing import List, Callable
from fastapi.respo... | 2.546875 | 3 |
network/mqtt_client/main_mqtt_publisher.py | flashypepo/myMicropython-Examples | 3 | 10836 | # This file is executed on every boot (including wake-boot from deepsleep)
# 2017-1210 PePo send timestamp and temperature (Celsius) to MQTT-server on BBB
# 2017-1105 PePo add _isLocal: sensor data to serial port (False) of stored in file (True)
# 2017-0819 PePo add sensor, led and print to serial port
# 2017-0811 ... | 2.796875 | 3 |
2015/07.py | Valokoodari/advent-of-code | 2 | 10837 | <filename>2015/07.py
#!/usr/bin/python3
lines = open("inputs/07.in", "r").readlines()
for i,line in enumerate(lines):
lines[i] = line.split("\n")[0]
l = lines.copy();
wires = {}
def func_set(p, i):
if p[0].isdigit():
wires[p[2]] = int(p[0])
lines.pop(i)
elif p[0] in wires.keys():
... | 2.8125 | 3 |
soccer_embedded/Development/Ethernet/lwip-rtos-config/test_udp_echo.py | ghsecuritylab/soccer_ws | 56 | 10838 | <reponame>ghsecuritylab/soccer_ws
import socket
import time
import numpy
# This script sends a message to the board, at IP address and port given by
# server_address, using User Datagram Protocol (UDP). The board should be
# programmed to echo back UDP packets sent to it. The time taken for num_samples
# echoes is mea... | 2.96875 | 3 |
test.py | keke185321/emotions | 58 | 10839 | #!/usr/bin/env python
#
# This file is part of the Emotions project. The complete source code is
# available at https://github.com/luigivieira/emotions.
#
# Copyright (c) 2016-2017, <NAME> (http://www.luiz.vieira.nom.br)
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | 1.617188 | 2 |
konform/cmd.py | openanalytics/konform | 7 | 10840 | from . import Konform
def main():
Konform().run()
| 1.101563 | 1 |
ichnaea/taskapp/app.py | mikiec84/ichnaea | 348 | 10841 | """
Holds global celery application state and startup / shutdown handlers.
"""
from celery import Celery
from celery.app import app_or_default
from celery.signals import (
beat_init,
worker_process_init,
worker_process_shutdown,
setup_logging,
)
from ichnaea.log import configure_logging
from ichnaea.ta... | 2.390625 | 2 |
gmqtt/storage.py | sabuhish/gmqtt | 0 | 10842 | import asyncio
from typing import Tuple
import heapq
class BasePersistentStorage(object):
async def push_message(self, mid, raw_package):
raise NotImplementedError
def push_message_nowait(self, mid, raw_package) -> asyncio.Future:
try:
asyncio.get_event_loop()
except Runt... | 2.625 | 3 |
test/testframework/runner.py | 5GExchange/escape | 10 | 10843 | # Copyright 2017 <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 2.28125 | 2 |
Calliope/13 Clock/Clock.py | frankyhub/Python | 0 | 10844 | from microbit import *
hands = Image.ALL_CLOCKS
#A centre dot of brightness 2.
ticker_image = Image("2\n").crop(-2,-2,5,5)
#Adjust these to taste
MINUTE_BRIGHT = 0.1111
HOUR_BRIGHT = 0.55555
#Generate hands for 5 minute intervals
def fiveticks():
fivemins = 0
hours = 0
while True:
yield hands[f... | 3.265625 | 3 |
home/kakadu31/sabertooth.py | rv8flyboy/pyrobotlab | 63 | 10845 | #Variables
#Working with build 2234
saberPort = "/dev/ttyUSB0"
#Initializing Motorcontroller
saber = Runtime.start("saber", "Sabertooth")
saber.connect(saberPort)
sleep(1)
#Initializing Joystick
joystick = Runtime.start("joystick","Joystick")
print(joystick.getControllers())
python.subscribe("joystick","publishJoysti... | 2.578125 | 3 |
Dangerous/Weevely/core/backdoor.py | JeyZeta/Dangerous- | 0 | 10846 | <filename>Dangerous/Weevely/core/backdoor.py<gh_stars>0
# -*- coding: utf-8 -*-
# This file is part of Weevely NG.
#
# Copyright(c) 2011-2012 Weevely Developers
# http://code.google.com/p/weevely/
#
# This file may be licensed under the terms of of the
# GNU General Public License Version 2 (the ``GPL'').
#
# Software ... | 2.109375 | 2 |
musicscore/musicxml/types/complextypes/notations.py | alexgorji/music_score | 2 | 10847 | <filename>musicscore/musicxml/types/complextypes/notations.py
from musicscore.dtd.dtd import Sequence, GroupReference, Choice, Element
from musicscore.musicxml.attributes.optional_unique_id import OptionalUniqueId
from musicscore.musicxml.attributes.printobject import PrintObject
from musicscore.musicxml.groups.common ... | 2.0625 | 2 |
src/constants.py | MitraSeifari/pystackoverflow | 0 | 10848 | <gh_stars>0
from types import SimpleNamespace
from src.utils.keyboard import create_keyboard
keys = SimpleNamespace(
settings=':gear: Settings',
cancel=':cross_mark: Cancel',
back=':arrow_left: Back',
next=':arrow_right: Next',
add=':heavy_plus_sign: Add',
edit=':pencil: Edit',
save=':che... | 2.65625 | 3 |
iirsBenchmark/exceptions.py | gAldeia/iirsBenchmark | 0 | 10849 | <reponame>gAldeia/iirsBenchmark
# Author: <NAME>
# Contact: <EMAIL>
# Version: 1.0.0
# Last modified: 08-20-2021 by <NAME>
"""
Simple exception that is raised by explainers when they don't support local
or global explanations, or when they are not model agnostic. This should be
catched and handled in the expe... | 2.09375 | 2 |
covid_data_tracker/util.py | granularai/gh5050_covid_data_tracker | 0 | 10850 | import click
from covid_data_tracker.registry import PluginRegistry
def plugin_selector(selected_country: str):
"""plugin selector uses COUNTRY_MAP to find the appropriate plugin
for a given country.
Parameters
----------
selected_country : str
specify the country of interest.
Ret... | 3.125 | 3 |
dev/libs.py | karimwitani/webscraping | 0 | 10851 | <filename>dev/libs.py
import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
def browser_init():
o... | 2.90625 | 3 |
setup.py | dwastberg/osmuf | 0 | 10852 | from setuptools import setup
setup(name='osmuf',
version='0.1',
install_requires=[
"seaborn",
],
description='Urban Form analysis from OpenStreetMap',
url='http://github.com/atelierlibre/osmuf',
author='AtelierLibre',
author_email='<EMAIL>',
license='MIT',
... | 1.070313 | 1 |
tests/test_model.py | artemudovyk/django-updown | 41 | 10853 | <filename>tests/test_model.py
# -*- coding: utf-8 -*-
"""
tests.test_model
~~~~~~~~~~~~~~~~
Tests the models provided by the updown rating app
:copyright: 2016, weluse (https://weluse.de)
:author: 2016, <NAME> <<EMAIL>>
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import ra... | 2.578125 | 3 |
nlptk/ratings/rake/rake.py | GarryGaller/nlp_toolkit | 0 | 10854 | <reponame>GarryGaller/nlp_toolkit
import sys,os
from typing import List
from collections import defaultdict, Counter
from itertools import groupby, chain, product
import heapq
from pprint import pprint
import string
class Rake():
def __init__(
self,
text:List[List[str]],
stopw... | 2.65625 | 3 |
depimpact/tests/test_functions.py | NazBen/dep-impact | 0 | 10855 | <gh_stars>0
import numpy as np
import openturns as ot
def func_overflow(X, model=1, h_power=0.6):
"""Overflow model function.
Parameters
----------
X : np.ndarray, shape : N x 8
Input variables
- x1 : Flow,
- x2 : Krisler Coefficient,
- x3 : Zv, etc...
model : ... | 2.53125 | 3 |
app/main/forms.py | ingabire1/blog | 0 | 10856 | <filename>app/main/forms.py
from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,SubmitField
from wtforms.validators import Required
class ReviewForm(FlaskForm):
title = StringField('Review title',validators=[Required()])
review = TextAreaField('Movie review', validators=[Required()]... | 2.765625 | 3 |
SEPHIRA/FastAPI/main.py | dman926/Flask-API | 4 | 10857 | <filename>SEPHIRA/FastAPI/main.py
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette import status
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.requests import Request
from starlette.responses import Response
from starlette.... | 2.03125 | 2 |
bio_rtd/uo/sc_uo.py | open-biotech/bio-rtd | 5 | 10858 | """Semi continuous unit operations.
Unit operations that accept constant or box-shaped flow rate profile
and provide periodic flow rate profile.
"""
__all__ = ['AlternatingChromatography', 'ACC', 'PCC', 'PCCWithWashDesorption']
__version__ = '0.7.1'
__author__ = '<NAME>'
import typing as _typing
import numpy as _np
... | 2.828125 | 3 |
src/tools/create_graphs_log.py | KatiaJDL/CenterPoly | 0 | 10859 | import matplotlib.pyplot as plt
def main():
with open('log.txt') as f:
lines = f.readlines()
glob_loss = []
hm_l = []
off_l = []
poly_l = []
depth_l = []
glob_loss_val = []
hm_l_val = []
off_l_val = []
poly_l_val = []
depth_l_val = []
for epoch in lines:
m = epoch.split("|")
if ... | 2.59375 | 3 |
fluree/query-generate.py | ivankoster/aioflureedb | 4 | 10860 | <filename>fluree/query-generate.py
#!/usr/bin/python3
import json
from aioflureedb.signing import DbSigner
def free_test(signer):
data = {"foo": 42, "bar": "appelvlaai"}
body, headers, uri = signer.sign_query(data)
rval = dict()
rval["body"] = body
rval["headers"] = headers
rval["uri"] = uri
... | 2.40625 | 2 |
actions/delete_bridge_domain.py | StackStorm-Exchange/network_essentials | 5 | 10861 | <filename>actions/delete_bridge_domain.py
# Copyright 2016 Brocade Communications Systems, 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.... | 2.640625 | 3 |
python/signature.py | IUIDSL/kgap_lincs-idg | 4 | 10862 | #!/usr/bin/env python3
###
# Based on signature.R
###
import sys,os,logging
import numpy as np
import pandas as pd
if __name__=="__main__":
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
if (len(sys.argv) < 3):
logging.error("3 file args required, LINCS sig info for GSE70138 and... | 2.40625 | 2 |
HW3 - Contest Data Base/main.py | 916-Maria-Popescu/Fundamental-of-Programming | 0 | 10863 | <reponame>916-Maria-Popescu/Fundamental-of-Programming
# ASSIGNMENT 3
"""
During a programming contest, each contestant had to solve 3 problems (named P1, P2 and P3).
Afterwards, an evaluation committee graded the solutions to each of the problems using integers between 0 and 10.
The committee needs a progr... | 4.46875 | 4 |
surface/ex_surface02.py | orbingol/NURBS-Python_Examples | 48 | 10864 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Examples for the NURBS-Python Package
Released under MIT License
Developed by <NAME> (c) 2016-2017
"""
import os
from geomdl import BSpline
from geomdl import utilities
from geomdl import exchange
from geomdl import operations
from geomdl.visualization imp... | 2.765625 | 3 |
dev/bazel/deps/micromkl.bzl | cmsxbc/oneDAL | 169 | 10865 | <filename>dev/bazel/deps/micromkl.bzl<gh_stars>100-1000
#===============================================================================
# Copyright 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | 1.492188 | 1 |
opennsa/protocols/nsi2/bindings/p2pservices.py | jmacauley/opennsa | 0 | 10866 | ## Generated by pyxsdgen
from xml.etree import ElementTree as ET
# types
class OrderedStpType(object):
def __init__(self, order, stp):
self.order = order # int
self.stp = stp # StpIdType -> string
@classmethod
def build(self, element):
return OrderedStpType(
ele... | 2.5 | 2 |
Scripts/PyLecTest.py | DVecchione/DVEC | 0 | 10867 | import matplotlib.pyplot as plt
import numpy as np
x=20
y=1
plt.plot(x,y)
plt.show()
| 3.03125 | 3 |
examples/nested/mog4_fast.py | ivandebono/nnest | 0 | 10868 | import os
import sys
import argparse
import copy
import numpy as np
import scipy.special
sys.path.append(os.getcwd())
def log_gaussian_pdf(theta, sigma=1, mu=0, ndim=None):
if ndim is None:
try:
ndim = len(theta)
except TypeError:
assert isinstance(theta, (float, int)), t... | 2.609375 | 3 |
sendria/message.py | scottcove/sendria | 85 | 10869 | <gh_stars>10-100
__all__ = ['Message']
import uuid
from email.header import decode_header as _decode_header
from email.message import Message as EmailMessage
from email.utils import getaddresses
from typing import Union, List, Dict, Any
class Message:
__slots__ = (
'id',
'sender_envelope', 'sende... | 2.46875 | 2 |
myApps/test_web.py | Rocket-hodgepodge/NewsWeb | 0 | 10870 | <reponame>Rocket-hodgepodge/NewsWeb
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.t... | 2.640625 | 3 |
nce_glue/run_glue.py | salesforce/ebm_calibration_nlu | 7 | 10871 | <filename>nce_glue/run_glue.py<gh_stars>1-10
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 1.78125 | 2 |
tools/python/myriad/__init__.py | TU-Berlin-DIMA/myriad-toolkit | 15 | 10872 | <filename>tools/python/myriad/__init__.py
__all__ = [ "assistant", "event", "error" ] | 1.054688 | 1 |
Python/Advanced/Tuples And Sets/Lab/SoftUni Party.py | EduardV777/Softuni-Python-Exercises | 0 | 10873 | guests=int(input())
reservations=set([])
while guests!=0:
reservationCode=input()
reservations.add(reservationCode)
guests-=1
while True:
r=input()
if r!="END":
reservations.discard(r)
else:
print(len(reservations))
VIPS=[]; Regulars=[]
for e in reservations:
... | 3.625 | 4 |
locale/pot/api/plotting/_autosummary/pyvista-Plotter-remove_all_lights-1.py | tkoyama010/pyvista-doc-translations | 4 | 10874 | <filename>locale/pot/api/plotting/_autosummary/pyvista-Plotter-remove_all_lights-1.py
# Create a plotter and remove all lights after initialization.
# Note how the mesh rendered is completely flat
#
import pyvista as pv
plotter = pv.Plotter()
plotter.remove_all_lights()
plotter.renderer.lights
# Expected:
## []
_ = plo... | 2.109375 | 2 |
einsum.py | odiak/einsum | 0 | 10875 | from typing import Dict, Tuple
import numpy as np
def einsum(expr: str, *args: Tuple[np.ndarray, ...], **kwargs) -> np.ndarray:
(a, b) = map(str.strip, expr.split("->"))
a_ = list(
map(lambda s: list(map(str.strip, s.split(","))), map(str.strip, a.split(";")))
)
b_ = list(map(str.strip, b.spli... | 2.890625 | 3 |
aarhus/get_roots.py | mikedelong/aarhus | 0 | 10876 | <reponame>mikedelong/aarhus
import json
import logging
import os
import pickle
import sys
import time
import pyzmail
# http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html
reload(sys)
sys.setdefaultencoding("utf8... | 2.046875 | 2 |
python/760.find-anagram-mappings.py | stavanmehta/leetcode | 0 | 10877 | <filename>python/760.find-anagram-mappings.py<gh_stars>0
class Solution:
def anagramMappings(self, A: List[int], B: List[int]) -> List[int]:
| 2.03125 | 2 |
src/jdk.internal.vm.compiler/.mx.graal/mx_graal.py | siweilxy/openjdkstudy | 2 | 10878 | <filename>src/jdk.internal.vm.compiler/.mx.graal/mx_graal.py
#
# ----------------------------------------------------------------------------------------------------
#
# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This ... | 1.960938 | 2 |
linear_regression.py | wail007/ml_playground | 0 | 10879 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
class _LinearModel(object):
def __init__(self):
self.w = None
def fit(self, x, y):
pass
def predict(self, x):
return np.dot(x, self.w)
def cost(self, x... | 2.953125 | 3 |
pygments_lexer_solidity/__init__.py | veox/pygments-lexer-solidity | 2 | 10880 | from .lexer import SolidityLexer, YulLexer
__all__ = ['SolidityLexer', 'YulLexer']
| 1.03125 | 1 |
optimal_buy_gdax/history.py | coulterj/optimal-buy-gdax | 0 | 10881 | #!/usr/bin/env python3
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Float, DateTime, Integer
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Order(Base):
__tablename__ = 'orders'
id = Column(Intege... | 2.75 | 3 |
vmtkScripts/vmtkmeshboundaryinspector.py | ramtingh/vmtk | 0 | 10882 | <filename>vmtkScripts/vmtkmeshboundaryinspector.py
#!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkmeshboundaryinspector.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.3 $
## Copyright (c) <NAME>, <NAME>. All rights reserved.
## See LICENSE f... | 2.1875 | 2 |
setup.py | sriz1/mudslide | 4 | 10883 | <filename>setup.py
from setuptools import setup
from distutils.util import convert_path
main_ns = {}
ver_path = convert_path('mudslide/version.py')
with open(ver_path) as ver_file:
exec(ver_file.read(), main_ns)
def readme():
with open("README.md") as f:
return f.read()
setup(
name='mudslide',
... | 1.398438 | 1 |
src/sklearn/sklearn_random_forest_test.py | monkeychen/python-tutorial | 0 | 10884 | import csv
import joblib
from sklearn.metrics import accuracy_score
data = []
features = []
targets = []
feature_names = []
users = []
with open('satisfaction_feature_names.csv') as name_file:
column_name_file = csv.reader(name_file)
feature_names = next(column_name_file)[2:394]
with open('cza_satisfaction_tr... | 2.828125 | 3 |
py/test.py | BEARUBC/grasp-kernel | 1 | 10885 | class TestClass:
def __init__(self, list, name):
self.list = list
self.name = name
def func1():
print("func1 print something")
def func2():
print("func2 print something")
integer = 8
return integer
def func3():
print("func3 print something")
s = "func3"
return s
def f... | 3.625 | 4 |
tests/utils/_process_nonwin.py | chrahunt/quicken | 3 | 10886 | <reponame>chrahunt/quicken
"""Utilities for managing child processes within a scope - this ensures
tests run cleanly even on failure and also gives us a mechanism to
get debug info for our children.
"""
import logging
import os
import sys
from contextlib import contextmanager
from typing import ContextManager, List
i... | 2.171875 | 2 |
data/meneame/parse_meneame.py | segurac/DeepQA | 0 | 10887 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2016 <NAME>. 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/licens... | 2.609375 | 3 |
dfstools/tests/test_relationship_tools.py | orekunrin/comp410_summer2020 | 0 | 10888 | import unittest
import pandas as pd
import git
import os
from dfstools import get_dataset_dtypes
from dfstools import find_related_cols_by_name
from dfstools import find_related_cols_by_content
from dfstools import find_parent_child_relationships
from dfstools import pecan_cookies_load_data
class RelationshipTools(un... | 2.6875 | 3 |
Calculator.py | KunalKatiyar/Calculator | 0 | 10889 | import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout, QGroupBox, QDialog, QVBoxLayout, QGridLayout,QMainWindow, QApplication, QWidget, QPushButton, QAction, QLineEdit, QMessageBox
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
class App(QDialog):
def __ini... | 2.859375 | 3 |
analysis/src/util/_concepts.py | Domiii/code-dbgs | 95 | 10890 | <filename>analysis/src/util/_concepts.py
# // ###########################################################################
# // Queries
# // ###########################################################################
# -> get a single cell of a df (use `iloc` with `row` + `col` as arguments)
df.iloc[0]['staticContextId... | 2.28125 | 2 |
src/py/proto/v3/diff/UniversalDiff_pb2.py | zifter/conf_protobuf | 0 | 10891 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v3/diff/UniversalDiff.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | 1.257813 | 1 |
src/onevision/data/augment/image_box_augment.py | phlong3105/onevision | 2 | 10892 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import annotations
import numpy as np
import torch
from torch import Tensor
from onevision.data.augment.base import BaseAugment
from onevision.data.augment.utils import apply_transform_op
from onevision.data.data_class import ObjectAnnotation
fro... | 1.945313 | 2 |
dataviz/euvotes.py | Udzu/pudzu | 119 | 10893 | from pudzu.charts import *
from pudzu.sandbox.bamboo import *
import seaborn as sns
# generate map
df = pd.read_csv("datasets/euvotes.csv").set_index('country')
palette = tmap(RGBA, sns.cubehelix_palette(11, start=0.2, rot=-0.75))
ranges = [20000000,10000000,5000000,2000000,1000000,500000,200000,100000,0]
def voteco... | 2.578125 | 3 |
WarmUpSTE.py | jrolf/jse-api | 1 | 10894 |
import pandas as pd
import numpy as np
from copy import *
from bisect import *
from scipy.optimize import curve_fit
from sklearn.metrics import *
from collections import defaultdict as defd
import datetime,pickle
from DemandHelper import *
import warnings
warnings.filterwarnings("ignore")
####################... | 2.359375 | 2 |
Section 3/cnn3.py | PacktPublishing/Python-Deep-Learning-for-Beginners- | 7 | 10895 | <gh_stars>1-10
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Flatten
from keras.layers import Conv2D, MaxPooling2D
model = Sequential()
model.add(Conv2D(32, kernel_size=(3, 3),
activation='relu',
input_shape=(128, 128... | 2.84375 | 3 |
k1lib/selector.py | 157239n/k1lib | 1 | 10896 | <filename>k1lib/selector.py
# AUTOGENERATED FILE! PLEASE DON'T EDIT
"""
This module is for selecting a subnetwork using CSS so that you can do special
things to them. Checkout the tutorial section for a walkthrough. This is exposed
automatically with::
from k1lib.imports import *
selector.select # exposed
"""
fr... | 2.984375 | 3 |
plugins/General/wxRaven_WebBrowser.py | sLiinuX/wxRaven | 11 | 10897 | <reponame>sLiinuX/wxRaven<gh_stars>10-100
'''
Created on 22 févr. 2022
@author: slinux
'''
from .wxRavenGeneralDesign import wxRavenWebBrowser
from wxRavenGUI.application.wxcustom.CustomLoading import *
from wxRavenGUI.application.wxcustom import *
import wx.html2 as webview
import sys
import logging
from wxRavenGUI... | 1.960938 | 2 |
backend/pollr-eb2/lib/python3.5/site-packages/ebcli/operations/upgradeops.py | saarthak24/Pollr | 2 | 10898 | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 1.78125 | 2 |
src/perimeterator/enumerator/elb.py | vvondra/perimeterator | 0 | 10899 | ''' Perimeterator - Enumerator for AWS ELBs (Public IPs). '''
import logging
import boto3
from perimeterator.helper import aws_elb_arn
from perimeterator.helper import dns_lookup
class Enumerator(object):
''' Perimeterator - Enumerator for AWS ELBs (Public IPs). '''
# Required for Boto and reporting.
SE... | 2.640625 | 3 |