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 |
|---|---|---|---|---|---|---|
stockbot/provider/yahoo.py | Habbie/stockbot | 0 | 26200 | <reponame>Habbie/stockbot
import logging
import requests
import urllib.parse
from datetime import datetime
from stockbot.provider.base import BaseQuoteService, BaseQuote
LOGGER = logging.getLogger(__name__)
class YahooFallbackQuote(object):
def __init__(self, *args, **kwargs):
pass
def __str__(sel... | 2.6875 | 3 |
Database/SQLIte/15.Limit/U1.py | sarincr/Business-analytics-Course-with-Python- | 3 | 26201 | import sqlite3
X = sqlite3.connect('NeDB.db')
Y = X.cursor()
Y.execute('''CREATE TABLE IF NOT EXISTS EMPLOYEE (
ID integer,
Name text NOT NULL,
Date_Join text,
Place text,
Age integer,
Salary real);''')
Y.execute('''INSERT INT... | 3.125 | 3 |
lambda/python/ip/what_is_my_ip.py | enrikiko/AWS | 0 | 26202 | <filename>lambda/python/ip/what_is_my_ip.py<gh_stars>0
import json
def lambda_handler(event, context):
ip = event["requestContext"]["identity"]["sourceIp"]
return {
'statusCode': 200,
'body': json.dumps(ip)
}
| 2.484375 | 2 |
week1/8.py | kamorozov/coursera_python | 2 | 26203 | <filename>week1/8.py
n = int(input())
n = n % 100
print(n // 10)
| 3.265625 | 3 |
qtpp/views/auth.py | xzdylyh/qtppy | 2 | 26204 | <reponame>xzdylyh/qtppy
import functools
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for, jsonify, abort
)
from werkzeug.security import check_password_hash, generate_password_hash
from qtpp import db
from qtpp.libs.framework.operate_db import OperationDB
from qtpp.l... | 2.265625 | 2 |
engine/mixer.py | UnidayStudio/Easy-2D-Game-Engine | 8 | 26205 | <reponame>UnidayStudio/Easy-2D-Game-Engine
import pygame
import engine.file
class Mixer():
def __init__(self):
self._sounds = {}
def _getSound(self, name):
if not name in self._sounds:
try:
img = pygame.mixer.Sound(engine.file.getPath(name))
except:
return None
self._sounds[name] = img
retur... | 2.84375 | 3 |
csv sift.py | hitime1234/progress-8-sorter | 0 | 26206 | import time
def readcsv(filename, linenumber):
import csv
data = list(csv.reader(open(filename + ".csv")))
return data
def schoolpo8finder(data,name):
info = []
for i in range(0, len(data)):
try:
if (str(name)).lower() in (str(data[i][4])).lower():
... | 3.28125 | 3 |
pcircle/globals.py | fwang2/ccss | 20 | 26207 | class T:
WORK_REQUEST = 1
WORK_REPLY = 2
REDUCE = 3
BARRIER = 4
TOKEN = 7
class Tally:
total_dirs = 0
total_files = 0
total_filesize = 0
total_stat_filesize = 0
total_symlinks = 0
total_skipped = 0
total_sparse = 0
max_files = 0
total_nlinks = 0
total_nlinke... | 1.515625 | 2 |
kge/util/glove_to_word2vec.py | Team-Project-OKG/kge | 0 | 26208 | import os
import sys
from gensim.scripts.glove2word2vec import glove2word2vec
from kge.misc import kge_base_dir
def _convert_to_word2vec(
filename: str
):
"""
Convert file of pretrained embeddings in GloVe format to word2vec format.
"""
folder = os.path.join(kge_base_dir(), "pretrained")
... | 2.890625 | 3 |
ui/command_list.py | wangjing1215/COM-DEV | 0 | 26209 | <reponame>wangjing1215/COM-DEV
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'command_list.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doi... | 1.851563 | 2 |
pedidos/migrations/0001_initial.py | tiagocordeiro/zumaq-partners | 1 | 26210 | # Generated by Django 2.1.7 on 2019-02-14 13:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 1.804688 | 2 |
spyderlib/utils/debug.py | MarlaJahari/Marve | 1 | 26211 | # -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 <NAME>
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Debug utilities"""
import inspect
import traceback
import time
def log_time(fd):
timestr = "Logging time: %s" % time.ctime(time.time())
print >>f... | 3.25 | 3 |
swift/internal/swift_c_module.bzl | BalestraPatrick/rules_swift | 215 | 26212 | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1.476563 | 1 |
PytomationMailStandalone.py | riensWinoto/PytomationMail | 0 | 26213 | import smtplib
import sys
import time
from datetime import datetime
# variable
trigger = 0
myName = "<NAME>"
myEmail = "<EMAIL>"
myPass = "<PASSWORD>"
myEmailSMTP = "smtp.yourEmailProvider.com" #for gmail: smtp.gmail.com for outlook: smtp.office365.com
mySMTPPort = 587
receivers = {"receiver name": "<EMAIL>"}
emailS... | 3.109375 | 3 |
tempgui.py | mustafaIhssan/semantic-segmentation-maker | 1 | 26214 | import Tkinter
parent_widget = Tkinter.Tk()
scale_widget = Tkinter.Scale(parent_widget, from_=0, to=100,
orient=Tkinter.HORIZONTAL)
scale_widget.set(25)
scale_widget.pack()
Tkinter.mainloop() | 2.984375 | 3 |
main.py | agoupy/parrainages | 0 | 26215 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 24 14:12:38 2022
@author: j64280
"""
import alluvial
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm
list_2017 = pd.read_csv('parrainagestotal_2017.csv',sep=';')
list_2022 = pd.read_csv('parrainagestot... | 2.609375 | 3 |
bridge_sim/sim/run/opensees/build/d3/__init__.py | jerbaroo/bridge-sim | 2 | 26216 | <reponame>jerbaroo/bridge-sim
"""Build OpenSees 3D model files."""
import os
from collections import OrderedDict, defaultdict
from itertools import chain
from typing import List, Optional, Tuple
import numpy as np
from bridge_sim.model import PierSettlement, PointLoad, Config, Material
from bridge_sim.sim.model impo... | 2.21875 | 2 |
setup.py | KathleenLabrie/KLpysci | 0 | 26217 | <reponame>KathleenLabrie/KLpysci
from setuptools import setup, find_packages
from codecs import open
import os
import klpysci
VERSION = klpysci.__version__
cwd = os.path.abspath(os.path.dirname(__file__))
# Get the long_description from the Description.rst file
with open(os.path.join(cwd, 'DESCRIPTION.rst'), encodin... | 1.75 | 2 |
lnc/lib/exceptions.py | atrosinenko/lecture-notes-compiler | 3 | 26218 | class ProgramError(Exception):
"""Generic exception class for errors in this program."""
pass
class PluginError(ProgramError):
pass
class NoOptionError(ProgramError):
pass
class ExtCommandError(ProgramError):
pass
| 2.078125 | 2 |
libsolresol.py | MishaKlopukh/solresol-language | 0 | 26219 | <reponame>MishaKlopukh/solresol-language
import enum
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from scipy.io import wavfile
import json
jupyter_nb_mode = False
try:
assert jupyter_nb_mode
from IPython.display import Audio
except:
import sounddevice as sd
de... | 2.40625 | 2 |
src/icegrams/trie_build.py | vthorsteinsson/Icegrams | 7 | 26220 | """
Icegrams: A trigrams library for Icelandic
CFFI builder for _trie module
Copyright (C) 2020 <NAME>.
Original author: <NAME>
This software is licensed under the MIT License:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and asso... | 1.523438 | 2 |
raspi/test/bork_dprc.py | lukaschoebel/bed | 0 | 26221 | <reponame>lukaschoebel/bed
#!/usr/bin/python
import time
import random
import RPi.GPIO as GPIO
import firebase_admin
from firebase_admin import credentials, firestore
cred = credentials.Certificate("secrets/firestore-creds.json")
firebase_admin.initialize_app(cred)
db = firestore.client()
GPIO.setwarnings(False)
GPIO... | 3.21875 | 3 |
src/test/when.py | cgjones/rr | 3 | 26222 | <filename>src/test/when.py<gh_stars>1-10
from rrutil import *
import re
send_gdb('when\n')
expect_gdb(re.compile(r'= (\d+)'))
t = eval(last_match().group(1));
if t < 1 or t > 10000:
failed('ERROR in first "when"')
send_gdb('b main\n')
expect_gdb('Breakpoint 1')
send_gdb('c\n')
send_gdb('when\n')
expect_gdb(re.co... | 2.46875 | 2 |
tests/test_invex.py | xridge/invex | 1 | 26223 | <filename>tests/test_invex.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `invex` package."""
import os
import py
from click.testing import CliRunner
import pytest
from flexfolio.utils import run
from invex import cli
from .reports import ALL_FLEX_REPORTS
@pytest.mark.parametrize("flex_report", AL... | 2.375 | 2 |
lista_ex3.1.py/exercicio23.py | robinson-1985/mentoria_exercises | 0 | 26224 | <filename>lista_ex3.1.py/exercicio23.py
''' 23. Faça um programa que receba o valor do salário mínimo, o turno de trabalho (M
— matutino; V — vespertino; ou N — noturno), a categoria (O — operário; G —
gerente) e o número de horas trabalhadas no mês de um funcionário. Suponha a
digitação apenas de dados válidos e, quan... | 2.984375 | 3 |
how-to-use-azureml/training-with-deep-learning/how-to-use-estimator/dummy_train.py | faxu/MachineLearningNotebooks | 1 | 26225 | <reponame>faxu/MachineLearningNotebooks<gh_stars>1-10
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
print("*********************************************************")
print("Hello Azure ML!")
try:
from azureml.core import Run
run = Run.get_context()
print("L... | 2.546875 | 3 |
sequential_inference/envs/mujoco/rand_param_envs/gym/scoreboard/client/api_requestor.py | cvoelcker/sequential_inference | 0 | 26226 | import json
import platform
import gym
import six.moves.urllib as urlparse
from six import iteritems
from environments.mujoco.rand_param_envs.gym import error, version
from environments.mujoco.rand_param_envs.gym.scoreboard.client import http_client
verify_ssl_certs = True # [SECURITY CRITICAL] only turn this off w... | 2.390625 | 2 |
FinanceDicBuilder/DicBuilder.py | dukechain2333/Finance-Text-Analysis-System | 2 | 26227 | # -*- coding: UTF-8 -*-
from pyhanlp import *
from DataBaseOperator import DBConnector
class DicBuilder:
def __init__(self, id=-1):
"""
构建金融行业字典
:param id: 从数据库中通过index选择文本,默认-1即全选
"""
self.id = id
self.stopWords_path = r'EmotionBasedDic/stopwords.txt'
self... | 2.640625 | 3 |
adalam/ransac.py | happylin0427/AdaLAM | 1 | 26228 | from .utils import draw_first_k_couples, batch_2x2_inv, batch_2x2_ellipse, arange_sequence, piecewise_arange
import torch
def stable_sort_residuals(residuals, ransidx):
logres = torch.log(residuals + 1e-10)
minlogres = torch.min(logres)
maxlogres = torch.max(logres)
sorting_score = ransidx.unsqueeze(... | 1.976563 | 2 |
85/ninja.py | jsh/pybites | 0 | 26229 | <filename>85/ninja.py<gh_stars>0
"""Bite 85. Write a score property."""
from typing import Optional
SCORES = [10, 50, 100, 175, 250, 400, 600, 800, 1000]
RANKS = "white yellow orange green blue brown black paneled red".split()
BELTS = dict(zip(SCORES, RANKS))
class NinjaBelt:
"""Keep track of Ninja belts and po... | 3.390625 | 3 |
python_base/binary_array_to_number.py | GlacierBo/python_learn | 1 | 26230 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/12/15 11:26
# @Author : glacier
# @Site : 二进制计算
# @File : binary_array_to_number.py
# @Software: PyCharm Edu
# def binary_array_to_number(arr):
# sum = 0
# index = len(arr)-1
# i = 0
# while(index >= 0):
# ... | 3.828125 | 4 |
py_reportit/shared/config/container.py | fedus/py_reportit | 1 | 26231 | <filename>py_reportit/shared/config/container.py
from dependency_injector import containers, providers
from pytz import timezone as pytz_timezone
from py_reportit.shared.config import config
from py_reportit.shared.config.db import Database
from py_reportit.shared.config.requests_session import get_requests_session
f... | 1.859375 | 2 |
event_loop/select_loop.py | mapogolions/pyreact-event-loop | 0 | 26232 | <reponame>mapogolions/pyreact-event-loop
import select
import signal
import time
import event_loop.tick
import event_loop.timer
import event_loop.signal
MICROSECONDS_PER_SECOND = 10 ** 6
MAX_TIMEOUT = int(2 ** 63 / 10 ** 9)
class SelectLoop:
def __init__(self):
self.future_tick_queue = event_loop.tick.... | 2.296875 | 2 |
scripts/publisher.py | kavyadevd/Toy_Car_Simulation | 0 | 26233 | <filename>scripts/publisher.py
#!/usr/bin/python2
import rospy
from std_msgs.msg import String
from std_msgs.msg import Float64
def pub_sub(left_speed,right_speed):
pub_right = rospy.Publisher('right_speed', Float64, queue_size=10)
pub_left = rospy.Publisher('left_speed', Float64, queue_size=10)
send = "The robot ... | 3.046875 | 3 |
asdf/commands/extension.py | zanecodes/asdf | 66 | 26234 | <gh_stars>10-100
"""
Implementation of command for reporting information about installed extensions.
"""
from .main import Command
from ..entry_points import get_extensions
__all__ = ['find_extensions']
class QueryExtension(Command): # pragma: no cover
"""This class is the plugin implementation for the asdftool... | 2.421875 | 2 |
workflow/Analytical_return_flow_generator.py | IMMM-SFA/ferencz-tidwell_2022_frontiers | 0 | 26235 | <filename>workflow/Analytical_return_flow_generator.py
import math
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
mpl.rc('axes', titlesize=14)
plt.rc('font', size= 16)
os.chdir('C:/Users/sbferen/Documents/Frontiers_Paper/Analytical_solution_compar... | 2.5625 | 3 |
data_toy/bnmtf/generate_bnmtf.py | ThomasBrouwer/BNMTF | 16 | 26236 | <gh_stars>10-100
"""
Generate a toy dataset for the matrix tri-factorisation case, and store it.
We use dimensions 100 by 50 for the dataset, 10 row clusters, and 5 column clusters.
As the prior for F, G we take value 1 for all entries (so exp 1), and for S value 2 (so exp 1/2).
As a result, each value in R has a va... | 2.125 | 2 |
bot.py | areapergrimm/therejectbot | 0 | 26237 | <filename>bot.py
import discord
from discord.ext import commands
import random
import codenames
import trrutils
import asyncio
description = "The Reject Bot."
PREFIX = "."
CHANNELNAME = "spam"
bot = commands.Bot(command_prefix=PREFIX, description=description)
TOKEN = open('TOKEN.txt', 'r').read()
PERMLIST ... | 3.15625 | 3 |
kaggle_ensemble/prob_extend_kaggle.py | shayan223/Reverse_GoL | 0 | 26238 | <reponame>shayan223/Reverse_GoL
'''Code found on this kaggle submission
https://www.kaggle.com/yakuben/crgl-probability-extension-true-target-problem'''
import pandas as pd
import torch
import numpy as np
from torch import FloatTensor
from torch.utils.data import IterableDataset, DataLoader
import torch.nn as nn
from ... | 2.015625 | 2 |
scripts/file_renamer.py | mmenietti/python_code | 0 | 26239 | <gh_stars>0
#------------------------------------------------------------
# Dependencies
#------------------------------------------------------------
import pathlib
import os
import argparse
#------------------------------------------------------------
#
#------------------------------------------------------------
... | 2.859375 | 3 |
mordae/gpc/__init__.py | mordae/gpc | 2 | 26240 | <gh_stars>1-10
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
from mordae.gpc.manager import *
from mordae.gpc.site import *
# vim:set sw=4 ts=4 et:
| 1.09375 | 1 |
eznlp/vectors.py | syuoni/eznlp | 9 | 26241 | <reponame>syuoni/eznlp
# -*- coding: utf-8 -*-
from typing import Union, List
import os
import tqdm
import logging
import torch
logger = logging.getLogger(__name__)
def _parse_line(line: bytes):
w, *vector = line.rstrip().split(b" ")
return w, [float(v) for v in vector]
def _infer_shape(path: str, skiprows... | 2.390625 | 2 |
tools/Kline2HDF5.py | wzf92/rqalpha | 0 | 26242 | import os
import datetime
import h5py
import numpy as np
DEFAULT_DTYPE = np.dtype([
('datetime', np.int64),
('open', np.float),
('close', np.float),
('high', np.float),
('low', np.float),
('limit_up', np.float),
('limit_down', np.float),
('volume', np.float),
('total_turnover', np.f... | 2.609375 | 3 |
src/types.py | fabianobizarro/lispy | 0 | 26243 | <reponame>fabianobizarro/lispy
# Types
Symbol = str # A Lisp Symbol is implemented as a Python str
List = list # A Lisp List is implemented as a Python list
Number = (int, float) # A Lisp Number is implemented as a Python int or float
# Exp = Union[Symbol, Exp]
def atom(token):
"Numbers beco... | 3.421875 | 3 |
app/logic/mailing/tests/tests_management_SendMail.py | imvu/bluesteel | 10 | 26244 | """ StackedMail management command tests """
from django.test import TestCase
from django.test import Client
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.utils.six import StringIO
from app.logic.mailing.models.StackedMailModel import StackedM... | 2.28125 | 2 |
source/deepsecurity/api/policy_firewall_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 1 | 26245 | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | 1.390625 | 1 |
server/middleware/log_requests.py | marirs/fastApi-simpleApiKey-boilerplate | 3 | 26246 | """
Log requests middleware
"""
import time
from fastapi import Request
import geoip2.database
from geoip2.errors import AddressNotFoundError
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from server.config import app_logger
from server.config import CITY_DB
logger = app_logger(__n... | 2.484375 | 2 |
example/src/pythonSnippet.py | hansehe/DockerBuildManagement | 8 | 26247 | <gh_stars>1-10
def GetInfoMsg():
infoMsg = "This python snippet is triggered by the 'cmd' property.\r\n"
infoMsg += "Any command line may be triggered with the 'cmd' property.\r\n"
return infoMsg
if __name__ == "__main__":
print(GetInfoMsg()) | 2.625 | 3 |
python/testData/requirement/generation/keepMatchingVersion/main.py | Sajaki/intellij-community | 2 | 26248 | <gh_stars>1-10
import django
import numpy
import requests | 0.9375 | 1 |
tools/search_product.py | shuangliu1993/PyScraper | 0 | 26249 | import argparse
def parse_args():
parser = argparse.ArgumentParser(description="Search Products on Supported Platforms")
parser.add_argument(
"--platform", "-p", required=True, help="Online Retail Platform", type=str
)
parser.add_argument(
"--keyword", "-k", required=True, help="Produc... | 3.375 | 3 |
mros1_reasoner/test/test_level_1_functional_arch.py | JWijkhuizen/mc_mros_reasoner | 0 | 26250 | <reponame>JWijkhuizen/mc_mros_reasoner<filename>mros1_reasoner/test/test_level_1_functional_arch.py
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are per... | 1.460938 | 1 |
psana/psana/dgrammanager.py | valmar/lcls2 | 0 | 26251 | import sys, os
import time
import getopt
import pprint
try:
# doesn't exist on macos
from shmem import PyShmemClient
except:
pass
from psana import dgram
from psana.event import Event
from psana.detector import detectors
from psana.psexp.event_manager import TransitionId
import numpy as np
def dumpDict(di... | 2.203125 | 2 |
pygamerogue/utils.py | mikolasan/pyroguelike | 0 | 26252 | <filename>pygamerogue/utils.py<gh_stars>0
def shift_rect(rect, direction, distance=48):
if direction == 'left':
rect.left -= distance
elif direction == 'right':
rect.left += distance
elif direction == 'up':
rect.top -= distance
elif direction == 'down':
rect.top += distan... | 3.046875 | 3 |
examples/flair_example/example_3.py | aethersoft/textkit-learn | 0 | 26253 | from flair.models import TARSTagger
from flair.data import Sentence
# 1. Load zero-shot NER tagger
tars = TARSTagger.load('tars-ner')
# 2. Prepare some test sentences
sentences = [
Sentence("kill la kill is an anime"),
Sentence("The Humboldt University of Berlin is situated near the Spree in Berlin, Germany")... | 2.75 | 3 |
techmanpy/clients/tmsta_client.py | julespalles/techman-python | 3 | 26254 | #!/usr/bin/env python
import asyncio
from .stateless_client import *
from ..packets import *
from ..exceptions import *
class TMSTA_client(StatelessClient):
PORT=5890
def __init__(self, *, robot_ip, conn_timeout=3):
super().__init__(robot_ip=robot_ip, robot_port=self.PORT, conn_timeout=conn_timeout)
... | 2.328125 | 2 |
rampwf/score_types/__init__.py | rth/ramp-workflow | 0 | 26255 | from .accuracy import Accuracy
from .balanced_accuracy import BalancedAccuracy
from .base import BaseScoreType
from .brier_score import (
BrierScore, BrierSkillScore, BrierScoreReliability, BrierScoreResolution)
from .clustering_efficiency import ClusteringEfficiency
from .classification_error import Classification... | 1.601563 | 2 |
src/som/vm/current.py | SOM-st/PySOM | 22 | 26256 | def _init():
from som.vm.universe import create_universe
return create_universe()
current_universe = _init()
| 1.617188 | 2 |
detectron2_backbone/backbone/shufflenetv2.py | cenchaojun/detectron2 | 0 | 26257 | <filename>detectron2_backbone/backbone/shufflenetv2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# --------------------------------------------------------
# Descripttion: https://github.com/sxhxliang/detectron2_backbone
# version: 0.0.1
# Author: <NAME> (<EMAIL>)
# FilePath: /detectron2_backbone/backbone/shufflene... | 1.679688 | 2 |
client.py | iamdonmathew/CLI-Rest-API | 1 | 26258 | # author: <<NAME>>
# Client side CLI
# Necessary imports.
import os
import json
from pathlib import Path
import requests
import click
from server import run
# Click package is used to turn the python script into CLI.
@click.command()
@click.option('--path',prompt="Enter the path", help='Specify the path, that you wan... | 3.65625 | 4 |
python_code/I_K_ATP_RMP_mg.py | mmaleck/chondrocyte | 1 | 26259 | import numpy as np
from scipy.integrate.odepack import odeint
import matplotlib.pyplot as plt
import functions
from chondrocyte import Voltage_clamp
from params import params_dict
import matplotlib as mpl
"""
The code is used to create Figure 4B for submitted paper
"Probing the putative role of KATP channels and biol... | 2.515625 | 3 |
Dataset4EO/datasets/_builtin/voc.py | GeoAI4EO/GeoData4EO | 0 | 26260 | import enum
import pdb
import functools
import pathlib
from typing import Any, Dict, List, Optional, Tuple, BinaryIO, cast, Union
from xml.etree import ElementTree
from torchdata.datapipes.iter import (
IterDataPipe,
Mapper,
Filter,
Demultiplexer,
IterKeyZipper,
LineReader,
)
from torchvision.d... | 1.859375 | 2 |
server/roster_updater/lib/course.py | HeavenFox/coursepad | 33 | 26261 | import re
# crawl roster
faulty_prof = {
'Francis,J)' : 'Francis,J (jdf2)',
'Glathar,E)' : 'Glathar,E',
'Cady,B)' : 'Cady,B'
}
section_types = set()
day_pattern = {
'M': 1,
'T': 1<<1,
'W': 1<<2,
'R': 1<<3,
'F': 1<<4,
'S': 1<<5,
'U': 1<<6
}
def to_bool(s):
return True if ... | 2.390625 | 2 |
src/colusa/plugins/etr_infoq.py | huuhoa/symphony | 6 | 26262 | <reponame>huuhoa/symphony
from colusa.etr import Extractor, register_extractor
@register_extractor('//www.infoq.com')
class InfoQExtractor(Extractor):
def _find_main_content(self):
return self.bs.find('div', class_='article__content')
def cleanup(self):
self.remove_tag(self.main_content, 'div... | 2.0625 | 2 |
covidapp/urls.py | babbarutkarsh/CovidTracker | 1 | 26263 | <reponame>babbarutkarsh/CovidTracker
from django.contrib import admin
from django.urls import path,include
from .views import helloworldview
urlpatterns = [
path('helloworld/',helloworldview)
]
| 1.4375 | 1 |
src/cart/migrations/0009_remove_cartitem_user.py | phisyche/rydhubsolutions | 5 | 26264 | # Generated by Django 2.2.9 on 2020-01-29 16:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cart', '0008_cartitem_user'),
]
operations = [
migrations.RemoveField(
model_name='cartitem',
name='user',
),
]
| 1.40625 | 1 |
tests/test_pendant_aws.py | clintval/reticle | 1 | 26265 | <gh_stars>1-10
import os
from datetime import datetime
import botocore
import boto3
import moto
import pytest
from hypothesis import example, given
from hypothesis.strategies import integers, datetimes
from pendant.aws.batch import BatchJob, JobDefinition
from pendant.aws.exception import BatchJobSubmissionError, S3... | 1.804688 | 2 |
plot_progs/barsum_plot.py | bradlyke/dr16q | 2 | 26266 | <filename>plot_progs/barsum_plot.py
"""
This creates the plot that is used as Fig. 2 in Lyke et al. 2020.
Dependencies
----------
github repository : https://github.com/bradlyke/utilities
Note: To get these plots, LaTeX must be installed and
matplotlib must be able to compile LaTeX commands
Input file
--------... | 2.578125 | 3 |
health/models.py | atiro/obesitydata | 0 | 26267 | from django.db import models
class Health(models.Model):
MALE = 'M'
FEMALE = 'F'
ALL = 'A'
GENDER_CHOICES = (
(MALE, 'Male'),
(FEMALE, 'Female'),
(ALL, 'All')
)
class Meta:
abstract = True
class HealthActivity(models.Model):
MALE = 'M'
FEMALE = 'F'
... | 2.25 | 2 |
src/rcwa_utils.py | scolburn54/rcwa_tf | 9 | 26268 | # Copyright (c) 2020, <NAME>, University of Washington
# This file is part of rcwa_tf
# Written by <NAME> (Email: <EMAIL>)
import tensorflow as tf
import numpy as np
def convmat(A, P, Q):
'''
This function computes a convolution matrix for a real space matrix `A` that
represents either a relative per... | 2.84375 | 3 |
src/ui/setup_custom_dialog.py | AndreWohnsland/CocktailBerry | 1 | 26269 | <reponame>AndreWohnsland/CocktailBerry
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QDialog
from src.ui_elements.customdialog import Ui_CustomDialog
from src.display_controller import DP_CONTROLLER
class CustomDialog(QDialog, Ui_CustomDialog):
""" Class for the Team selec... | 2.21875 | 2 |
archived/twitter_filtering_deprecated_code/tw_keyword_search.py | mcpeixoto/Sentrade | 4 | 26270 | __author__ = "<NAME>"
__status__ = "prototype"
import tarfile
import json
import re
import subprocess
import os
import nltk
import time
year = 2019
month = 9
day = 16
keyword_list = ["netflix", "amazon", "apple", "microsoft", "google", "tesla", "facebook"]
date = "{0}-{1}-{2}".format(year, str(month).zfill(2), str(da... | 2.453125 | 2 |
tests/unit/callbacks/test_sqlalchemy.py | dunnkers/fseval | 5 | 26271 | <reponame>dunnkers/fseval
import numpy as np
import pandas as pd
import pytest
from fseval.callbacks.sql_alchemy import SQLAlchemyCallback
from fseval.types import Task
from omegaconf import DictConfig, OmegaConf
def test_init_no_params():
"""Initialization should fail when no `engine` param was supplied."""
... | 2.234375 | 2 |
pytesla/vehicle.py | jstenback/pytesla | 0 | 26272 | <reponame>jstenback/pytesla
from . import stream
class CommandError(Exception):
"""Tesla Model S vehicle command returned failure"""
pass
class Vehicle:
def __init__(self, vin, conn, payload, log):
assert payload['vin'] == vin
self._conn = conn
self._data = payload
self._l... | 2.75 | 3 |
modules/utility_date_time.py | Alex-Nalin/Support-Bot-v3 | 2 | 26273 | <gh_stars>1-10
import datetime
import re
from dateutil.parser import parse
def ConvertDateTimeToMilliseconds(inputDT: datetime.datetime):
return int(inputDT.timestamp()*1000)
def ConvertDTStringToMilliseconds(inputStr):
dt = parse(inputStr)
return ConvertDateTimeToMilliseconds(dt)
def ConvertShorthan... | 3.203125 | 3 |
Mundo-1-Fundamentos/016.py | TOPTOPUNIVERSE/CEV-PYTHON3 | 0 | 26274 | """
Desafio 016
Problema: Crie um programa que leia um número Real qualquer
pelo teclado e mostre na tela a sua porção Inteira."""
n = float(input('Digite um valor:'))
print(f'O número {n} tem a parte inteira {int(n)}')
| 3.90625 | 4 |
algorithms/nesterov_random/nesterov_test.py | OptiMaL-PSE-Lab/Expensive-Black-Box-Optim-ChemEng | 0 | 26275 | <gh_stars>0
# import sys
# sys.path.insert(1, 'test_functions')
import numpy as np
from test_functions.quadratic_constrained import *
from test_functions.rosenbrock_constrained import *
from algorithms.nesterov_random.nesterov_random import nesterov_random
def problem_rosenbrock(x):
f = rosenbrock_f
g1 = r... | 2.15625 | 2 |
old/accent_analyser/rules/VoicedFricative1.py | stefantaubert/eng2ipa-accent-transformer | 0 | 26276 | <gh_stars>0
from accent_analyser.rules.IpaRule import IpaRule
def replace(word: str):
return word.replace("v", "w")
class VoicedFricative1(IpaRule):
def __init__(self, likelihood=0.51):
super().__init__(likelihood)
self.name = "Voiced Fricative: [w] instead of /v/"
def _convert_core(self, words: list... | 3.125 | 3 |
src/clients/python/api_v1/examples/ensemble_image_client.py | AliAzG/triton-inference-server | 0 | 26277 | #!/usr/bin/env python
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice... | 1.453125 | 1 |
mamonsu/plugins/system/linux/__init__.py | sgrinko/mamonsu | 188 | 26278 | __all__ = [
'proc_stat', 'disk_stats', 'disk_sizes',
'memory', 'uptime', 'open_files', 'net', 'la'
,'pg_probackup'
]
from . import *
| 1.09375 | 1 |
config.py | stultus/Flask-wado | 3 | 26279 | <gh_stars>1-10
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY='parayan-manasilla'
| 1.226563 | 1 |
piper/mayapy/pipernode.py | MongoWobbler/piper | 0 | 26280 | # Copyright (c) 2021 <NAME>. All Rights Reserved.
import pymel.core as pm
import piper_config as pcfg
import piper.mayapy.util as myu
import piper.mayapy.convert as convert
import piper.mayapy.attribute as attribute
from .rig import curve # must do relative import in python 2
def get(node_type, ignore=None, search... | 2.5625 | 3 |
ie_serving/server/rest_service.py | Doken-Tokuyama/OpenVINO-model-server | 1 | 26281 | <filename>ie_serving/server/rest_service.py
import datetime
import json
import falcon
from google.protobuf.json_format import MessageToJson
from tensorflow_serving.apis import get_model_metadata_pb2, \
get_model_status_pb2
from ie_serving.logger import get_logger
from ie_serving.server.constants import WRONG_MODE... | 2.1875 | 2 |
spinup/utils/hyper_search.py | yjl450/spinningup-drl-prototyping | 9 | 26282 | import pandas as pd
import json
import os
import os.path as osp
import numpy as np
"""
python -m spinup.run hyper_search <files> -ae <start from which epoch>
make a file that can order the experiments in terms of their performance
use this to easily find good hyperparameters when doing hyperparameter search
upload thi... | 2.78125 | 3 |
piecrust/wsgiutil/__init__.py | airbornemint/PieCrust2 | 0 | 26283 | from piecrust.serving.server import WsgiServer
def get_app(root_dir, cache_key='prod', enable_debug_info=False):
app = WsgiServer(root_dir,
cache_key=cache_key,
enable_debug_info=enable_debug_info)
return app
| 1.515625 | 2 |
Main.py | mriduldhall/tic-tac-toe | 0 | 26284 | from Interfaces.CommandLineInterface import CLI
if __name__ == '__main__':
CLI().initiate()
| 1.3125 | 1 |
tests/data/view.py | Forumouth/flask-simple | 0 | 26285 | <gh_stars>0
#!/usr/bin/env python
# coding=utf-8
from flask.ext.simple import FlaskEasyView
from .model import ExampleModel
from .form import generate_example_form
from .testapp import app
class SimpleView(FlaskEasyView):
'''
Simple Example View for test
'''
trailing_slash = False
model = Exampl... | 2.5625 | 3 |
tests/job_concurrency1_test.py | moellep/sirepo | 0 | 26286 | # -*- coding: utf-8 -*-
u"""Concurrency testing
This test does not always fail when there is a problem (false
positive), because it depends on a specific sequence of events
that can't be controlled by the test.
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/license... | 2.1875 | 2 |
FF_HOI.py | hellocatfood/FontForge-Higher-Order-Interpolation | 14 | 26287 | <gh_stars>10-100
#!/usr/bin/env python3
import fontforge
import argparse
import itertools
import os
import shutil
from lib.util import *
# This handles the glyph's "HOIINFO" comment. Right now only deals with setting rbearing of each master.
from lib import HOIInfo
parser = argparse.ArgumentParser(description='Given... | 2.328125 | 2 |
graphql_subscription_manager/__init__.py | Danielhiversen/PyGraphqlWebsocketManager | 0 | 26288 | """Subscription manager for Graph QL websocket."""
import asyncio
import json
import logging
import socket
import sys
from time import time
import pkg_resources
import websockets
_LOGGER = logging.getLogger(__name__)
STATE_STARTING = "starting"
STATE_RUNNING = "running"
STATE_STOPPED = "stopped"
try:
VERSION =... | 2.1875 | 2 |
github_api/cli/env.py | kazamori/github-cli | 0 | 26289 | <reponame>kazamori/github-cli<gh_stars>0
import os
_GITHUB_SETTING_SITE = 'https://github.com/settings/tokens'
TOKEN = os.environ.get('GITHUB_API_TOKEN')
if TOKEN is None:
message = 'requires Personal access tokens. '
message += 'export GITHUB_API_TOKEN="***", '
message += f'get from {_GITHUB_SETTING_SITE... | 1.929688 | 2 |
methionineTest.py | Csernica/Isotomics | 0 | 26290 | import copy
import json
import numpy as np
import pandas as pd
import basicDeltaOperations as op
import calcIsotopologues as ci
import fragmentAndSimulate as fas
import solveSystem as ss
'''
This is a set of functions to quickly initalize methionine molecules based on input delta values and to simulate its fragmenta... | 2.859375 | 3 |
neuro-cli/tests/unit/formatters/test_storage_formatters.py | neuro-inc/platform-client-python | 11 | 26291 | import time
from typing import Any, List
import pytest
from yarl import URL
from neuro_sdk import Action, FileStatus, FileStatusType
from neuro_sdk.storage import DiskUsageInfo
from neuro_cli.formatters.storage import (
BaseFilesFormatter,
BSDAttributes,
BSDPainter,
DiskUsageFormatter,
FilesSorte... | 2.328125 | 2 |
examples/example2d1many.py | elliottslaughter/cufinufft | 56 | 26292 | """
Demonstrate the type 1 NUFFT using cuFINUFFT
"""
import numpy as np
import pycuda.autoinit
from pycuda.gpuarray import GPUArray, to_gpu
from cufinufft import cufinufft
# Set up parameters for problem.
N1, N2 = 59, 61 # Size of uniform grid
M = 100 # Number of nonuniform p... | 2.734375 | 3 |
2021/22/22b.py | kristianwiklund/AOC | 3 | 26293 | #!/usr/bin/python3
import sys
import cut
from box import Box
from reactor import Reactor
from termcolor import colored
# -- assert helper
def check(what,output,f=None):
try:
assert(what)
except:
print("Assert failed, debug output: ",end="")
print(output)
if f is not None:
... | 3 | 3 |
planner/progression/__init__.py | cyclone923/pyplanners | 0 | 26294 | <reponame>cyclone923/pyplanners
from .hill_climbing import hill_climbing_search, strategies
from .best_first import path_cost_fn, greedy_cost_fn, weighted_cost_fn, macro_greedy_cost_fn, \
a_star_search, best_first_search, deferred_best_first_search, macro_deferred_best_first_search, semideferred_best_first_search
fro... | 1.25 | 1 |
domain_api/migrations/0001_initial.py | heytrav/drs-project | 1 | 26295 | <reponame>heytrav/drs-project
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-26 01:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dep... | 1.609375 | 2 |
src/ralph/networks/migrations/0010_auto_20170216_1230.py | DoNnMyTh/ralph | 1,668 | 26296 | <gh_stars>1000+
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('networks', '0009_auto_20160823_0921'),
]
operations = [
migrations.AlterFie... | 1.445313 | 1 |
tests/tasks/dbt/test_dbt.py | andykawabata/prefect | 2 | 26297 | import os
import sys
import pytest
from prefect import Flow
from prefect.tasks.dbt import DbtShellTask
pytestmark = pytest.mark.skipif(
sys.platform == "win32", reason="DbtShellTask currently not supported on Windows"
)
def test_shell_result_from_stdout(tmpdir):
dbt_dir = tmpdir.mkdir("dbt")
task = D... | 1.992188 | 2 |
tests/data/formulas/five/five-1.0.py | pmuller/ipkg | 3 | 26298 | <gh_stars>1-10
from os.path import dirname
from ipkg.build import Formula, File
class five(Formula):
name = 'five'
version = '1.0'
sources = File(dirname(__file__) + '/../../sources/five-1.0.tar.gz')
platform = 'any'
dependencies = ('four > 1.0',)
def install(self):
pass
| 2.015625 | 2 |
venv/Lib/site-packages/captcha/urls.py | bopopescu/diandian_online | 3 | 26299 | from django.conf.urls import url
from django.urls import path
from captcha import views
# urlpatterns = [
# url(r'image/(?P<key>\w+)/$', views.captcha_image, name='captcha-image', kwargs={'scale': 1}),
# url(r'image/(?P<key>\w+)@2/$', views.captcha_image, name='captcha-image-2x', kwargs={'scale': 2}),
# ur... | 1.976563 | 2 |