index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
26,231
HyXFR/ss-tool
refs/heads/main
/sstool.py
################################################################################################### # # # SSTool - By HyXFR # Please contact into discord HyXFR#1231 for add cheats to the list (for md5 hash), only versions and mods ! # Availible on Windows, Linux and Other systems # Requirements (for start ScreenShare):...
{"/ppaw/__init__.py": ["/ppaw/pastebin.py"], "/ppaw/pastebin.py": ["/ppaw/__init__.py"], "/sstool.py": ["/ppaw/__init__.py"], "/ppaw/ppaw/request.py": ["/ppaw/__init__.py"]}
26,232
HyXFR/ss-tool
refs/heads/main
/ppaw/ppaw/request.py
""" Python Pastebin API Wrapper. Provide one-liner functions for reqing JSON files and handling any errors provided by the PasteBin API. """ import json import requests from ppaw import __author__, __version__ from ppaw.errors import PPAWBaseException USERAGENT = "PPAW v{} by {}".format(__version__, __author__) de...
{"/ppaw/__init__.py": ["/ppaw/pastebin.py"], "/ppaw/pastebin.py": ["/ppaw/__init__.py"], "/sstool.py": ["/ppaw/__init__.py"], "/ppaw/ppaw/request.py": ["/ppaw/__init__.py"]}
26,236
Imran72/Flat_Accountant
refs/heads/master
/accountant/sqliteConnector.py
import sqlite3 import datetime import itertools import telebot from . import config bot = telebot.TeleBot("1379702508:AAGquXO8II-Uzky60_YHzR7Ni6yddMQOZhg") # ORM-handmade или класс взаимодействия с базой данных, реализованной на Sqlite class sqliteConnector: def __init__(self): self.start_day = '2020-09...
{"/accountant/start.py": ["/accountant/relational.py", "/accountant/sqliteConnector.py"], "/accountant/relational.py": ["/accountant/sqliteConnector.py"]}
26,237
Imran72/Flat_Accountant
refs/heads/master
/accountant/start.py
from accountant.relational import is_number, insert_query, get_users, get_common_info, get_private_info import telebot from .Mode import Mode from . import config import schedule from accountant.sqliteConnector import sqliteConnector import threading import time bot = telebot.TeleBot("1379702508:AAGquXO8II-Uzky60_YHzR...
{"/accountant/start.py": ["/accountant/relational.py", "/accountant/sqliteConnector.py"], "/accountant/relational.py": ["/accountant/sqliteConnector.py"]}
26,238
Imran72/Flat_Accountant
refs/heads/master
/accountant/relational.py
from accountant.sqliteConnector import sqliteConnector import datetime # Проверка на число def is_number(s): try: s = str(s).replace(',', '.') s = float(s) if s >= 0: return True else: return False except ValueError: return False # Формирование...
{"/accountant/start.py": ["/accountant/relational.py", "/accountant/sqliteConnector.py"], "/accountant/relational.py": ["/accountant/sqliteConnector.py"]}
26,243
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/model/match.py
import re class IsCellphone(): def __init__(self): self.p = re.compile(r'[1][^1269]\d{9}') def iscellphone(self, number): res = self.p.match(number) if res: return True else: return False class IsMail(): def __init__(self): self.p = re.com...
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,244
HarborYuan/Student-Information-Management-System
refs/heads/master
/config.py
DEBUG = False SECRET_KEY = 'please change when deploy'
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,245
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/views/api.py
from flask import Blueprint, request, url_for, redirect, session from ..model.common import judgeStudent, userExist from ..model.match import IsCellphone, IsMail from ..model.user import insertUser, userlogin API = Blueprint('api', __name__) @API.route('/login/', methods=['POST']) def api_login(): data = request....
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,246
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/views/index.py
from flask import Blueprint, render_template, session INDEX = Blueprint('index', __name__) @INDEX.route('/') def index(): if 'user' in session: return render_template( 'index/index.html', is_login=True, user=session['user']) return render_template('index/index.html...
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,247
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/model/common.py
import sqlite3 import os import hashlib dirname, filename = os.path.split(os.path.abspath(__file__)) def getStudentList(): conn = sqlite3.connect(dirname + '/../data/hongyi.db') c = conn.cursor() cursor = c.execute("SELECT ID from STUIDC") StudentList = [] for row in cursor: StudentList.a...
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,248
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/model/user.py
import sqlite3 import os import hashlib dirname, filename = os.path.split(os.path.abspath(__file__)) def insertUser(data): id = data['username'] pwd = hashlib.sha3_512(data['password1'].encode()).hexdigest() major = str(data['major']) email = data['email'] phone = data['phone'] isGirl = str(da...
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,249
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/views/login.py
from flask import Blueprint, render_template LOGIN = Blueprint('login', __name__) @LOGIN.route('/') def login(): return render_template('login/login.html', is_login=False)
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,250
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/__init__.py
from flask import Flask from .views.index import INDEX from .views.login import LOGIN from .views.api import API from .views.register import REGISTER APP = Flask(__name__, instance_relative_config=True) APP.config.from_object('config') APP.register_blueprint(INDEX, url_prefix='/') APP.register_blueprint(LOGIN, url_pr...
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,251
HarborYuan/Student-Information-Management-System
refs/heads/master
/src/views/register.py
from flask import Blueprint, render_template from ..model.common import getMajorList REGISTER = Blueprint('REGISTER', __name__) @REGISTER.route('/') def register(): majors = getMajorList() return render_template( 'register/register.html', majors=majors, is_login=False)
{"/src/views/api.py": ["/src/model/common.py", "/src/model/match.py", "/src/model/user.py"], "/src/__init__.py": ["/src/views/index.py", "/src/views/login.py", "/src/views/api.py", "/src/views/register.py"], "/src/views/register.py": ["/src/model/common.py"]}
26,255
ard61/SparcComplex
refs/heads/master
/sparc/dft.py
""" Functions to calculate the product of a vector and a sub-sampled DFT matrix. Copied from Adam Greig, https://github.com/sigproc/sparc-amp/blob/master/sparc_amp.ipynb """ import numpy as np def dft(n, m, ordering): """ Returns functions to compute the sub-sampled Discrete Fourier transform, i.e., opera...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,256
ard61/SparcComplex
refs/heads/master
/simulate.py
def run_simulation(sparc_params_json, num_trials): import sys sys.path.append('/home/zelda/ard61/project/code') import numpy as np import sparc as sp p = sp.SparcParams.from_json(sparc_params_json) ## Setup if p.D == 1: (Ax, Ay) = sp.sparc_transforms(p.n, p.M, p.L, sp.gen_ordering...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,257
ard61/SparcComplex
refs/heads/master
/sparc/__init__.py
from sparc.awgn_capacity import * from sparc.error_rate import error_rate from sparc.bits2ints import * from sparc.data_point import * from sparc.dft import complex_sparc_transforms, gen_ordering_dft from sparc.hadamard import sparc_transforms, gen_ordering from sparc.power import * from sparc.sparc_modulated import Sp...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,258
ard61/SparcComplex
refs/heads/master
/sparc/sparc_params.py
import numpy as np import json from sparc.awgn_capacity import awgn_capacity class SparcParams: def __init__(self, n, D, L, logK, logM, Palloc): assert (Palloc.shape[0] == L) self.n = n # codeword length self.D = D # codeword dimensionality (1 for real, 2 for comp...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,259
ard61/SparcComplex
refs/heads/master
/obtain_data_points.py
import os import sys sys.path.append('/home/zelda/ard61/project/code') import numpy as np import sparc import simulate from define_scenarios import * scenario_inds = [index for index in np.ndindex(scenarios.shape)] # Initialise data points list data_points = np.zeros_like(scenarios, dtype=sparc.DataPoint) for index...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,260
ard61/SparcComplex
refs/heads/master
/sparc/power.py
import numpy as np def modified_power_alloc(a, f, P_total, L, C): P = np.zeros(L) for l in range(L): if l/L < f: P[l] = np.exp2(-2*a*C*l/L) else: P[l] = np.exp2(-2*a*C*f) P *= P_total / sum(P) # Scale P so that it sums to P_total return P def iterative_power_a...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,261
ard61/SparcComplex
refs/heads/master
/sparc/bits2ints.py
import numpy as np def bits2ints(bits, width): """ Transform an array of bits (ints in {0,1}) into an array of ints where each int is sampled from `width` bits. """ assert(bits.size % width == 0) L = bits.size // width ints = np.zeros(L, dtype=int) for l in range(L): cur_int...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,262
ard61/SparcComplex
refs/heads/master
/sparc/sparc_modulated.py
""" AMP Modulated SPARC decoder with Hadamard matrices. """ import numpy as np class SparcModulated: def __init__(self, sparc_params, Ax, Ay): """ Initialise a modulated SPARC with codeword matrix provided as the Ax and Ay functions and power allocation P. This defines the constant...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,263
ard61/SparcComplex
refs/heads/master
/sparc/data_point.py
import numpy as np import json from sparc.sparc_params import SparcParams class DataPoint: """ A set of data points of a SPARC simulation. Properties: sparc_params: SparcParams Simulation properties: num_trials = #(simulations) SER = array(section error rates) BER = ar...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,264
ard61/SparcComplex
refs/heads/master
/define_scenarios.py
import numpy as np import sparc # Generate loads of different SPARC parameters, that are all comparable. # Parameters common to all simulations R_per_Ds = np.array([1, 1.5]) # Rate per dimension R/D R_pa_per_Ds = np.array([0, 1.05]) * R_per_Ds # Power allocation rate per dimension R_pa/D L = 1024 ...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,265
ard61/SparcComplex
refs/heads/master
/graph.py
import os import numpy as np import matplotlib.pyplot as plt import sparc as sp from define_scenarios import * ## Load data results_dir = 'results' data_points = np.zeros_like(scenarios, dtype=sparc.DataPoint) scenario_inds = [index for index in np.ndindex(scenarios.shape)] for index in scenario_inds: data_point...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,266
ard61/SparcComplex
refs/heads/master
/sparc/error_rate.py
import numpy as np from sparc.bits2ints import ints2bits def error_rate(sparc): """ Test a SPARC, giving the section and bit error rates as output. """ logKM = sparc.p.logK + sparc.p.logM input = np.random.randint(0, 2**logKM, size=sparc.p.L) x = sparc.encode(input) y = x + np.random.norma...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,267
ard61/SparcComplex
refs/heads/master
/sparc/hadamard.py
""" Functions to calculate the product of a vector and a Hadamard matrix. Copied from Adam Greig, https://github.com/sigproc/sparc-amp/blob/master/sparc_amp.ipynb """ import numpy as np try: from pyfht import fht_inplace except ImportError: import warnings warnings.warn("Using very slow Python version of ...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,268
ard61/SparcComplex
refs/heads/master
/sparc/awgn_capacity.py
import numpy as np def awgn_capacity(Pchan): return 1/2 * np.log2(1 + Pchan) def minimum_Pchan(C): return 2 ** (2*C) - 1
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,269
ard61/SparcComplex
refs/heads/master
/sparc/sparc_normal.py
""" AMP SPARC decoder with Hadamard matrices. """ import numpy as np class Sparc: def __init__(self, sparc_params, Ax, Ay): """ Initialise a SPARC with codeword matrix provided as the Ax and Ay functions and power allocation P. This defines the constants n, L, M. """ ...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,270
ard61/SparcComplex
refs/heads/master
/sparc/sparc_qpsk.py
""" AMP Complex QPSK SPARC decoder with DFT matrices. """ import numpy as np def abs2(z): return np.sum(np.real(z)**2 + np.imag(z)**2) class SparcQpsk: def __init__(self, sparc_params, Ax, Ay): """ Initialise a modulated SPARC with codeword matrix provided as the Ax and Ay functions a...
{"/simulate.py": ["/sparc/__init__.py"], "/sparc/__init__.py": ["/sparc/awgn_capacity.py", "/sparc/error_rate.py", "/sparc/bits2ints.py", "/sparc/data_point.py", "/sparc/dft.py", "/sparc/hadamard.py", "/sparc/power.py", "/sparc/sparc_modulated.py", "/sparc/sparc_normal.py", "/sparc/sparc_qpsk.py", "/sparc/sparc_params....
26,271
neerajcse/INF241
refs/heads/master
/bluetooth_scanning.py
from __future__ import print_function from multiprocessing.connection import Client import bluetooth import time address = ('localhost', 6000) user1_devices = ['60:6C:66:03:04:ED'] def write_to_file(nearby_devices): with open("devices.txt", "w") as f: for device in nearby_devices: if device in user1_devi...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,272
neerajcse/INF241
refs/heads/master
/agent.py
from multiprocessing.connection import Client from array import array address = ('localhost', 6000) conn = Client(address) conn.send('exit') conn.send('PUT:a,5') conn.send('GET:a') msg = conn.recv() print(msg) conn.send('close') conn.close()
{"/usbscale_agent.py": ["/usbscale.py"]}
26,273
neerajcse/INF241
refs/heads/master
/handdetector.py
# import the necessary packages import imutils import numpy as np import argparse import cv2 import time # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", help = "path to the (optional) video file") args = vars(ap.parse_args()) # def...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,274
neerajcse/INF241
refs/heads/master
/detect_calories.py
import sys import time from barcode_scanner import BarcodeScanner from usbscale import Scale import requests from multiprocessing.connection import Client address = ('localhost', 6000) def get_data_from_dashboard(key): conn = Client(address) conn.send('GET:' + str(key)) data = conn.recv() conn.send('c...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,275
neerajcse/INF241
refs/heads/master
/food_rest.py
# -*- coding: utf-8 -*- """ Created on Sat Oct 31 12:33:46 2015 @author: swanand """ import os import dweepy import requests import json from flask import Flask from pymongo import MongoClient from urlparse import urlparse app = Flask(__name__) MONGO_URL = os.environ.get('MONGOLAB_URI') @app.route('/') def hello_world(...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,276
neerajcse/INF241
refs/heads/master
/barcode_scanner.py
import sys import time class BarcodeScanner(): def __init__(self, channel="/dev/hidraw0"): self.fp = open(channel, 'rb') def read_next_barcode(self): barcode = '' while True: if barcode == '': time.sleep(0.1) buffer = self.fp.read(8) for c in buffer: num_val = ord(c) if num_val == 40: ...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,277
neerajcse/INF241
refs/heads/master
/usbscale.py
#!/usr/bin/python import os import fcntl import struct import time """ Class which takes care of calibration and sampled weight of an item put on the usb scale. """ class Scale(object): """ Object for a weighting scale. Classes using this object should only use one method i.e., to get weight of an item put on the ...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,278
neerajcse/INF241
refs/heads/master
/usbscale_agent.py
from multiprocessing.connection import Client from array import array from usbscale import Scale import time address = ('localhost', 6000) def send_weight_to_blackboard(weight): conn = Client(address) print("Sending weight :" + str(weight)) conn.send('PUT:weight,' + str(weight)) conn.send('close') ...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,279
neerajcse/INF241
refs/heads/master
/blackboard.py
from multiprocessing.connection import Listener from array import array import sys address = ('localhost', 6000) listener = Listener(address) key_store = {} try: while True: try: print("Listening for connections...") conn = listener.accept() print('connection accepted ...
{"/usbscale_agent.py": ["/usbscale.py"]}
26,315
vetu11/QuienVienebot_old
refs/heads/master
/lista.py
# coding=utf-8 # Archivo: lista # Descipción: describe la clase Lista, que es una lista de amigos. from uuid import uuid4 from time import time class Lista: # Lista de amigos con distintos métodos para cambiar su voto. def __init__(self, **kwargs): self.text = kwargs.get("text") self.id = kw...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,316
vetu11/QuienVienebot_old
refs/heads/master
/handlers.py
# coding=utf-8 # Archivo: handlers # Descripción: Aquí se declararán los handlers a las distintas llamadas de la API. from lang import get_lang from telegram import ParseMode, InlineKeyboardButton, InlineKeyboardMarkup def generic_message(bot, update, text_code): # Responde a cualquier mensaje con un texto genér...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,317
vetu11/QuienVienebot_old
refs/heads/master
/list_manager.py
# coding=utf-8 # Archivo: list_manager # Autor: Ventura Pérez García - vetu@pm.me - github.com/vetu11 # Fecha última edición: 8/10 # Descripción: Describe la clase que se encargará de manejar las listas. import json from lista import Lista class ListManager: def __init__(self): self.lists = {} ...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,318
vetu11/QuienVienebot_old
refs/heads/master
/lang/__init__.py
# coding=utf-8 # Modulo: lang # Descripción: este módulo incluye los textos para los mensajes en todos los idiomas disponibles. from lang import get_lang
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,319
vetu11/QuienVienebot_old
refs/heads/master
/lang/lang.py
# coding=utf-8 # Archivo: lang # Descripción: Descripción de la clase Lang y otras funciones útiles, que se usarán para obtener los textos de los # mensajes del bot. import json _LANGS_INICIADOS = {} _IDIOMAS_DISPONIBLES = ["ES-es"] _SINONIMOS_IDIOMAS = {"es": "ES-es", "ES-es": "es"} class La...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,320
vetu11/QuienVienebot_old
refs/heads/master
/user.py
# coding=utf-8 # Archivo: user # Autor: vetu11 # Fecha última edición: 1/10/2018 # Descripción: Se define la clase User, que contiene las descripciónes minimas por parte de Telegram, y los datos # adicionales generados por el bot. class User: # Usuario de Telegram. def __init__(self, **kwargs): self...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,321
vetu11/QuienVienebot_old
refs/heads/master
/bot.py
# coding=utf-8 # Archivo: bot # Descripción: el bot se ejecutará desde este archivo. Aquí se asignarán las funciones handler del archivo handlers.py # a una llamada de la API. import logging import handlers as h from telegram.ext import Updater, InlineQueryHandler, ChosenInlineResultHandler, CallbackQueryHandler,\ ...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,322
vetu11/QuienVienebot_old
refs/heads/master
/old_bot.py
# coding=utf-8 import logging, json, time, re from telegram.ext import Updater, InlineQueryHandler, ChosenInlineResultHandler, CallbackQueryHandler,\ CommandHandler, MessageHandler, Filters, PreCheckoutQueryHandler from telegram import InlineQueryResultArticle, ParseMode, InputTextMessageContent, InlineKeyboardBut...
{"/handlers.py": ["/lang/__init__.py"], "/list_manager.py": ["/lista.py"]}
26,323
leohakim/FastAPI-GraphQL
refs/heads/main
/data.py
employee_data = [ {"id": 1001, "firstName": "John", "lastName": "Doe", "age": 28}, {"id": 1002, "firstName": "Bob", "lastName": "McBobby", "age": 45}, ] product_data = [ {"id": 2011, "name": "Tofu", "price": 12.7}, {"id": 2012, "name": "Chocolate", "price": 18.2}, {"id": 2013, "name": "Pepper Sauce...
{"/graphqlapp.py": ["/data.py"], "/restapp.py": ["/data.py"]}
26,324
leohakim/FastAPI-GraphQL
refs/heads/main
/graphqlapp.py
from ariadne import ObjectType, QueryType, gql, make_executable_schema, load_schema_from_path from ariadne.asgi import GraphQL import data type_defs = load_schema_from_path("schema.graphql") # Map resolver functions to Query fields using QueryType query = QueryType() # Resolvers are simple python functions @query....
{"/graphqlapp.py": ["/data.py"], "/restapp.py": ["/data.py"]}
26,325
leohakim/FastAPI-GraphQL
refs/heads/main
/restapp.py
from fastapi import FastAPI import data app = FastAPI() @app.get("/employee") async def employee(id: int = 0): employees = data.get_employee(id) for employee in employees: employee['fullName'] = f"{employee['firstName']} {employee['lastName']}" return employees @app.get("/product") async def pr...
{"/graphqlapp.py": ["/data.py"], "/restapp.py": ["/data.py"]}
26,326
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/management/commands/importdump_cxx.py
''' Created on Dec 18, 2011 Import a JSON dump @author: Joel Haasnoot @author: Stefan de Konink ''' import time, codecs, csv import simplejson as json from django.contrib.gis.geos import * from django import db from django.core.management.base import BaseCommand from haltes.stops.models import UserStop, StopAttribute...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,327
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/views.py
from models import UserStop, BaseStop from forms import SearchForm from django.shortcuts import render from django.db.models import Count from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.views.decorators.cache import cache_page import reversion from django.http import Http404 def ho...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,328
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/tools/rewrite.py
''' Created on Jan 29, 2012 Import a JSON dump and convert it to a CSV column based file @author: Joel Haasnoot ''' import csv, codecs, cStringIO import simplejson as json class DictUnicodeWriter(object): def __init__(self, f, fieldnames, dialect=csv.excel, encoding="utf-8", **kwds): # Redirect output to ...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,329
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/utils/geo.py
from django.contrib.gis.geos import Point from django.contrib.gis.gdal import OGRGeometry, SpatialReference def transform_rd(point): ''' Please note this returns an OGRGeometry, not a point ''' src_string = '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ell...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,330
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/management/commands/importkv1.py
''' Import a KV1 dump in TSV format @author: Joel Haasnoot ''' import csv, codecs, logging from optparse import make_option from haltes.utils import file, geo from haltes.stops import admin # Needed for reversion from haltes.stops.models import UserStop, BaseStop, StopAttribute, Source, SourceAttribute from django....
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,331
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/urls.py
from django.conf.urls.defaults import patterns, include, url from django.contrib.gis import admin from django.views.generic.detail import DetailView from stops.models import BaseStop, UserStop admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'stops.views.home', name='home'), url(r'^cities/?$', 'sto...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,332
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/admin.py
from django.contrib.gis import admin from models import UserStop, BaseStop, Agency, Source, StopAttribute, SourceAttribute import reversion class StopAttributeInline(admin.TabularInline): model = StopAttribute class SourceAttributeInline(admin.TabularInline): model = SourceAttribute class StopAdmin(admin...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,333
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/utils/file.py
import codecs import csv def UnicodeDictReader(str_data, encoding, **kwargs): csv_reader = csv.DictReader(str_data, **kwargs) # Decode the keys once keymap = dict((k, k.decode(encoding)) for k in csv_reader.fieldnames) for row in csv_reader: yield dict((keymap[k], (unicode(v...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,334
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/forms.py
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit class SearchForm(forms.Form): terms = forms.CharField(max_length=100, label="", widget=forms.TextInput(attrs={'placeholder' : 'Typ een zoekterm'})) def __init__(self, *args, **kwargs): self.h...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,335
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/models.py
from django.db import models from django.contrib.gis.db import models as gis_models import reversion class Agency(models.Model): agency_id = models.CharField(max_length=10) name = models.CharField(max_length=100) url = models.CharField(max_length=100) tz = models.CharField(max_length=25) def _...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,336
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/management/commands/importgovi.py
''' Import a KV1 dump in TSV format @author: Joel Haasnoot ''' import csv, codecs from django.core.management.base import BaseCommand from django.contrib.gis.geos import Point from django.contrib.auth.models import User from haltes.utils import file, geo from haltes.stops.models import BaseStop, UserStop, StopAttr...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,337
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/migrations/0002_auto__add_field_source_encoding.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Source.encoding' db.add_column('stops_source', 'encoding', self.gf('django.db.models.field...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,338
StichtingOpenGeo-Museum/haltebeheer
refs/heads/master
/haltes/stops/migrations/0001_initial.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Agency' db.create_table('stops_agency', ( ('id', self.gf('django.db.models.fie...
{"/haltes/stops/management/commands/importgovi.py": ["/haltes/stops/models.py"]}
26,351
sregmi/word-count
refs/heads/master
/test_count_letters.py
import unittest from main import count_letters class TestCountLetter(unittest.TestCase): def test_count_letters(self): count = count_letters('hello world!') self.assertEqual('2', count[0])
{"/test_count_letters.py": ["/main.py"]}
26,352
sregmi/word-count
refs/heads/master
/main.py
from flask import Flask, render_template from flask_wtf import Form from wtforms import TextAreaField from wtforms.validators import DataRequired from collections import Counter import re import operator import enchant app = Flask(__name__) app.config['SECRET_KEY'] = 's3cr3tk3y' class MyForm(Form): input_text = Text...
{"/test_count_letters.py": ["/main.py"]}
26,591
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/global_config.py
"""Configuration module for logging""" import logging from os import mkdir, getcwd import csv import threading import time import configparser LOG_DIR = "./logs/" FILE_NAME_MAPPING = "mapping.csv" DELIMITER = "," CONFIG_FILE_NAME = getcwd() + '/Settings.ini' config = configparser.ConfigParser() config.read(CONFIG_FIL...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,592
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/xola_deputy.py
"""Main script which start all logic. Here we have 2 webhooks, and process date from request from XOLA and DEPUTY""" from flask import Flask, request, Response from xola_client import XolaClient from deputy_client import DeputyClient from logger import LoggerClient from google_sheets_client import GoogleSheetsClient fr...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,593
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/xola_client.py
""""Have class XolaCLient,which connect to Xola API and get/post data from here. Also process data from xola-webhook for parameters to deputy post request""" from datetime import datetime from math import ceil import json import requests from global_config import compare_mapping, config HTTP_CREATED = 201 HTTP_CO...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,594
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/logger.py
"""Init logger parameters""" import configparser import logging from logging.config import dictConfig from global_config import CONFIG_FILE_NAME, LOG_CONFIG DEFAULT_NAME_FLASK_LOGGER = 'werkzeuq' class LoggerClient(): """Create logger object""" logger = logging.getLogger() logmode = "console" def ...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,595
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/tests/test_deputy_client.py
"""File with test for deputy_client file and class DeputyClient """ import pytest import json import requests from unittest.mock import patch from xola_deputy.deputy_client import DeputyClient from xola_deputy.logger import LoggerClient logging = LoggerClient().get_logger() deputy = DeputyClient(logging) @pytest.fi...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,596
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/tests/test_global_config.py
from xola_deputy.global_config import compare_mapping def test_compare_mapping(): assert compare_mapping("Asylum","title") assert compare_mapping("5b649f7ec581e1c1738b463f","experience") assert compare_mapping("1","area") assert compare_mapping("111111","experience") == False
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,597
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/google_sheets_client.py
"""Google class for process data from deputy and post data to google sheets""" from datetime import datetime from spreadsheet_api import SpreadsheetAPI from global_config import compare_mapping, config START_TIME = " 6:00" # start time in google sheets END_TIME = " 23:30" # end time in google sheets DELAY = 1800 #...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,598
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/deputy_client.py
"""Have class DeputyCLient,which connect to deputy API and get/post data from here""" import json from collections import Counter import requests from global_config import compare_mapping, config HTTP_SUCCESS = 200 class DeputyClient(): """"Connect to Deputy API""" __headers = {} __url = "" __public...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,599
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/spreadsheet_api.py
# pylint: disable=E1101 """ This module describe class for working with Spreadsheet API """ import pickle import os.path from datetime import datetime from googleapiclient.discovery import build from googleapiclient.errors import HttpError from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transp...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,600
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/tests/test_google_sheets_client.py
import pytest from unittest.mock import patch, Mock from xola_deputy.deputy_client import DeputyClient from xola_deputy.logger import LoggerClient from xola_deputy.google_sheets_client import GoogleSheetsClient logging = LoggerClient().get_logger() deputy = DeputyClient(logging) sheets = GoogleSheetsClient(deputy,lo...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,601
COXIT-CO/xola_deputy
refs/heads/main
/setup.py
"""This script creates a config file for the main script. This should be run once at the very beginning before the main script run (zola_deputy.py). Then it should be run every time you want to reconfigure the script.""" import sys import argparse import configparser from os import path def create_parser(): """C...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,602
COXIT-CO/xola_deputy
refs/heads/main
/xola_deputy/tests/test_xola_client.py
import pytest import json import requests from unittest.mock import patch, Mock from xola_deputy.xola_client import XolaClient from xola_deputy.logger import LoggerClient logging = LoggerClient().get_logger() xola = XolaClient(logging) @pytest.fixture() def get_event_json(): with open("tests/data_event_from_xola...
{"/xola_deputy/tests/test_deputy_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py"], "/xola_deputy/tests/test_global_config.py": ["/xola_deputy/global_config.py"], "/xola_deputy/tests/test_google_sheets_client.py": ["/xola_deputy/deputy_client.py", "/xola_deputy/logger.py", "/xola_deputy/google_she...
26,609
tacticalhombre/CarND-Vehicle-Detection
refs/heads/master
/visualize_for_writeup.py
import matplotlib.image as mpimg import numpy as np import cv2 import glob import pickle import glob import collections from scipy.ndimage.measurements import label from moviepy.editor import VideoFileClip from search_classify import * from pipeline import * from random import randint class VisualizeProject: def __...
{"/visualize_for_writeup.py": ["/pipeline.py"]}
26,610
tacticalhombre/CarND-Vehicle-Detection
refs/heads/master
/pipeline.py
import matplotlib.image as mpimg import numpy as np import cv2 import glob import pickle import glob import collections from scipy.ndimage.measurements import label from moviepy.editor import VideoFileClip from search_classify import * #from hog_subsample import * class Pipeline: def __init__(self): print('Pipel...
{"/visualize_for_writeup.py": ["/pipeline.py"]}
26,642
tianzhaotju/Deeplive
refs/heads/master
/BBA.py
class Algorithm: def __init__(self): # fill your init vars self.buffer_size = 0 # Intial def Initial(self,model_name): return None def run(self, time, S_time_interval, S_send_data_size, S_chunk_len, S_rebuf, S_buffer_size, S_play_time_len, S_end_delay, S_decision_fl...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,643
tianzhaotju/Deeplive
refs/heads/master
/DYNAMIC.py
import math import numpy as np BIT_RATE = [500.0,850.0,1200.0,1850.0] MAX_STORE = 100 TARGET_BUFFER = 1 latency_limit = 4 class BBA(): def __init__(self): self.buffer_size = 0 def get_quality(self,segment): # record your params self.buffer_size = segment['buffer'][-1] bit_rate...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,644
tianzhaotju/Deeplive
refs/heads/master
/Pensieve.py
import numpy as np import tensorflow as tf import tflearn import a3c GAMMA = 0.99 ENTROPY_WEIGHT = 0.5 ENTROPY_EPS = 1e-6 S_INFO = 5 # bit_rate, buffer_size, now_chunk_size, bandwidth_measurement(throughput and time) S_LEN = 50 # take how many frames in the past A_DIM = 64 M_IN_K = 1000.0 ACTOR_LR_RATE = 0.0001 CRIT...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,645
tianzhaotju/Deeplive
refs/heads/master
/picture/CDF_QoE.py
import numpy as np from scipy import stats import matplotlib.pyplot as plt f_BBA = './result/QoE/QoE_al/BBA.csv' f_RBA = './result/QoE/QoE_al/RBA.csv' f_DYNAMIC = './result/QoE/QoE_al/DYNAMIC.csv' f_Pensieve = './result/QoE/QoE_al/Pensieve.csv' f_PDDQN = './result/QoE/QoE_al/PDDQN.csv' f_Offline_optimal = './result/Q...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,646
tianzhaotju/Deeplive
refs/heads/master
/train/pensieve-b/train.py
import os import logging import multiprocessing as mp import fixed_env as env import load_trace as load_trace import matplotlib.pyplot as plt import time as time_package import tensorflow as tf import numpy as np import a3c import csv S_INFO = 5 # bit_rate, buffer_size, now_chunk_size, bandwidth_measurement(throughp...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,647
tianzhaotju/Deeplive
refs/heads/master
/PDDQN_.py
import random import numpy as np from collections import deque from keras.layers import Dense from keras.optimizers import Adam from keras import backend as K from keras.layers import Input from keras.models import Model import tensorflow as tf from keras.models import Sequential from keras.layers import Conv1D from ke...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,648
tianzhaotju/Deeplive
refs/heads/master
/test.py
import fixed_env as env import load_trace as load_trace import os import time as tm import csv import tensorflow as tf def test(user_id): #1 Algorithm Setting: RBA, BBA, DYNAMIC, PDDQN, Pensieve ABR_NAME = 'Pensieve' #2 QoE Setting: ar, al, hd, b, max QoE = 'b' #3 Network Dataset: high, medi...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,649
tianzhaotju/Deeplive
refs/heads/master
/train/Dynamic/Dynamic.py
import math import numpy as np BIT_RATE = [500.0, 1200.0] MAX_STORE = 100 TARGET_BUFFER = 2 # class Ewma(): # # def __init__(self, segment): # # self.throughput = None # self.latency = None # self.segment_time = 1 # self.half_life = [8000, 3000] # self.latency_half_life = [...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,650
tianzhaotju/Deeplive
refs/heads/master
/RBA.py
import time as tm BIT_RATE = [500.0,850.0,1200.0,1850.0] class Algorithm: def __init__(self): # fill your init vars self.buffer_size = 0 self.p_rb = 1 # Intial def Initial(self,model_name): IntialVars = {'throughputHistory':[]} return IntialVars def run(self, ti...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,651
tianzhaotju/Deeplive
refs/heads/master
/train/DQN-b - no R/train2.py
import LiveStreamingEnv.final_fixed_env as env import LiveStreamingEnv.load_trace as load_trace import matplotlib.pyplot as plt import time as time_package import numpy as np import ABR from ddqn2 import DQNAgent ACTION_SAPCE = [] for j in range(1,19): ACTION_SAPCE.append(j/10) STATE_SIZE = 200 + 40 ACTION_SIZE =...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,652
tianzhaotju/Deeplive
refs/heads/master
/train/DQN-ar/train.py
import fixed_env as env import load_trace as load_trace import matplotlib.pyplot as plt import time as time_package import numpy as np import ABR from ddqn import DQNAgent BITRATE = [0,1,2,3] TARGET_BUFFER = [0,1,2,3] LATENCY_LIMIT = [1,2,3,4] ACTION_SAPCE = [] for i in BITRATE: for j in TARGET_BUFFER: for...
{"/test.py": ["/BBA.py", "/RBA.py", "/DYNAMIC.py", "/Pensieve.py"]}
26,653
BenjiLee/PoloniexAnalyzer
refs/heads/master
/utils.py
import calendar import time def create_time_stamp(date_string, formatting="%Y-%m-%d %H:%M:%S"): """ Sometimes Poloniex will return a date as a string. This converts it to a timestamp. Args: date_string: Date string returned by poloniex formatting: The default format poloniex retu...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,654
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex.py
import argparse import textwrap from collections import OrderedDict import time import sys if sys.version_info[0] < 3: raise Exception("This project has move to using python 3. If you would like to use the python 2 snapshot, checkout" " the v1.0.0 tag. `git checkout v1.0.0`") import analyzer ...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,655
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/api_models/trade_history.py
from poloniex_apis import trading_api class TradeHistory: def __init__(self): self.history = trading_api.return_trade_history() def get_all_fees(self): result = {} for stock in self.history: result[stock] = 0 for trade in self.history[stock]: re...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,656
BenjiLee/PoloniexAnalyzer
refs/heads/master
/dev_utils.py
""" Utility methods for development """ import json def dict_to_file(dict_input, filename): with open(filename, 'w') as f: json.dump(dict_input, f, indent=4, sort_keys=True) def file_to_dict(filename): with open(filename, 'r') as f: return json.load(f)
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,657
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/api_models/ticker_price.py
from poloniex_apis import public_api class TickerData: def __init__(self): self.ticker_price = public_api.return_ticker() def get_price(self, symbol): try: return float(self.ticker_price[symbol]["last"]) except KeyError: return 0
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,658
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/public_api.py
""" Public API for Poloniex Poloniex's Public API. Not all public api methods are implemented and will probably not be added unless it will actually be used. """ import json from urllib.request import Request from urllib.request import urlopen import dev_utils import settings api_url = "https://poloniex.com/public" ...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,659
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/api_key_secret_util.py
import configparser def get_api_key(): """ Returns a Poloniex API key from the config file """ config = configparser.ConfigParser() config.read_file(open("api_keys.ini")) key = config.get("ApiKeys", "key") return key def get_api_secret(): """ Returns a Poloniex API secret from th...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,660
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/api_models/lending_history.py
import time from poloniex_apis import trading_api from utils import create_time_stamp BITCOIN_GENESIS_BLOCK_DATE = "1231006505" class LendingHistory: def __init__(self): self.history = self._get_all_lending_history() def _get_all_lending_history(self): current_timestamp = time.time() ...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,661
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/api_models/balances.py
from poloniex_apis import trading_api class Balances: def __init__(self): self.all_balances = trading_api.return_complete_balances() def get_btc_total(self): total_btc = 0 for stock, balances in self._get_active_balances().items(): total_btc += float(balances['btcValue']) ...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...
26,662
BenjiLee/PoloniexAnalyzer
refs/heads/master
/poloniex_apis/trading_api.py
""" Poloniex's Trading API. Not all trading api methods are implemented and will probably not be added unless it will actually be used. In order for these API methods to work, an API key and secret must be configured. Not all methods need the "Trading Enabled" option on their API key. """ import hashlib import hmac im...
{"/poloniex.py": ["/analyzer.py"], "/poloniex_apis/public_api.py": ["/dev_utils.py", "/settings.py"], "/poloniex_apis/api_models/lending_history.py": ["/utils.py"], "/poloniex_apis/trading_api.py": ["/dev_utils.py", "/settings.py", "/poloniex_apis/api_key_secret_util.py"], "/analyzer.py": ["/printer.py", "/poloniex_api...