text
stringlengths
0
1.05M
meta
dict
__author__ = 'cpaulson' import pyKriging from pyKriging.krige import kriging from pyKriging.samplingplan import samplingplan # The Kriging model starts by defining a sampling plan, we use an optimal Latin Hypercube here sp = samplingplan(2) X = sp.optimallhc(15) # Next, we define the problem we would like to solve te...
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/pyKriging-master/examples/2D_simple_train_expected_improvement.py", "copies": "1", "size": "1321", "license": "mit", "hash": 7022152080519651000, "line_mean": 29.7209302326, "line_max": 94, "alpha_frac": 0.7161241484, "autogenerated": fa...
__author__ = 'cpaulson' import numpy as np from numpy.matlib import ones, eye from pyKriging import kriging class coKriging(): def __init__(self, Xc, yc, Xe, ye): # Create the data arrays self.Xc = np.atleast_2d(Xc).T self.yc = yc self.nc = self.Xc.shape[0] self.Xe = np....
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/pyKriging-master/pyKriging/coKriging.py", "copies": "1", "size": "7053", "license": "mit", "hash": 3295755510962204700, "line_mean": 32.1126760563, "line_max": 112, "alpha_frac": 0.5185027648, "autogenerated": false, "ratio": 2.9060568...
__author__ = 'cpaulson' import numpy as np from numpy.matlib import rand,zeros,ones,empty,eye from pyKriging import kriging class coKriging(): def __init__(self, Xc, yc, Xe, ye): # Create the data arrays self.Xc = np.atleast_2d(Xc).T self.yc = yc self.nc = self.Xc.shape[0] ...
{ "repo_name": "capaulson/pyKriging", "path": "pyKriging/coKriging.py", "copies": "1", "size": "6760", "license": "mit", "hash": -7312813251629930000, "line_mean": 30.0091743119, "line_max": 207, "alpha_frac": 0.5431952663, "autogenerated": false, "ratio": 2.7739023389413213, "config_test": fals...
__author__ = 'cpierret' import io import struct _bpk = bytes(b'PK\003\004') _dirpk = bytes(b'PK\001\002') _firstHeader = { '[': 'Content_Types].xml', 'x': 'l/', 'd': 'ocProps/', '_': 'rels/.rels' } _excelOffsetStringDict = { 0: b'\x09\x04\x06\x00\x00\x00\x10\x00', 2080: b"Microsoft Excel 5.0 W...
{ "repo_name": "cpierret/pyxl-magic", "path": "pyxl-magic.py", "copies": "1", "size": "4051", "license": "apache-2.0", "hash": 5605617627699429000, "line_mean": 39.1089108911, "line_max": 151, "alpha_frac": 0.5104912367, "autogenerated": false, "ratio": 3.8325449385052033, "config_test": false, ...
__author__ = 'cpt' """Initial extraction of sas queries from wrdsapi. Idea to make into a general class to generate queries to be passed through wrdsapi. """ from . import utility as wrds_util import os import re def wrds_sas_script(download_path, dataset, year, month=0, day=0, rows=[]): """Generates a .sas fil...
{ "repo_name": "Craig-PT/pywrds", "path": "pywrds/sas_query.py", "copies": "1", "size": "2980", "license": "bsd-3-clause", "hash": 5161933224125479000, "line_mean": 31.3913043478, "line_max": 79, "alpha_frac": 0.4872483221, "autogenerated": false, "ratio": 3.3596392333709133, "config_test": fals...
__author__ = 'cpt' import os import json import re import datetime import time import math import shutil import paramiko from _wrds_db_descriptors import WRDS_DOMAIN, _GET_ALL, FIRST_DATES, \ FIRST_DATE_GUESSES, AUTOEXEC_TEXT, WRDS_USER_QUOTA from pywrds import sshlib from pywrds import utility as wrds_util from...
{ "repo_name": "Craig-PT/pywrds", "path": "pywrds/wrdsapi.py", "copies": "1", "size": "38936", "license": "bsd-3-clause", "hash": -4342997565028721000, "line_mean": 39.5583333333, "line_max": 88, "alpha_frac": 0.535006164, "autogenerated": false, "ratio": 3.932134922237932, "config_test": false,...
__author__ = 'cpt' """ Utility functions for WRDS manipulations. Generally, taking outside of wrdsapi any static methods. """ import re import datetime import os import time def rows_per_file_adjusted(dataset): """ Chooses a number of rows to query to ensure that the files produced do not approach the 1 GB ...
{ "repo_name": "Craig-PT/pywrds", "path": "pywrds/utility.py", "copies": "1", "size": "14052", "license": "bsd-3-clause", "hash": 4018626762907152000, "line_mean": 32.7788461538, "line_max": 79, "alpha_frac": 0.5450469684, "autogenerated": false, "ratio": 3.4730598121601584, "config_test": false...
TICKER = 1 WAVE_VELOCITY = 10 from Tkinter import * top = Tk() top.title('Doppler effect') ca = Canvas(bd=0,highlightthickness=0,bg="white") ca.pack(expand=YES,fill=BOTH) ca.config(width=640,height=480) class Wave: def __init__(self, ca, vel, x, y): self.life = 0 self.canvas = ca self.vel = vel self.pos = ...
{ "repo_name": "cptx032/miniprojects", "path": "doppler.py", "copies": "1", "size": "2402", "license": "unlicense", "hash": -1530097305278883300, "line_mean": 25.7, "line_max": 70, "alpha_frac": 0.6236469609, "autogenerated": false, "ratio": 2.4839710444674252, "config_test": false, "has_no_ke...
__author__ = 'CQC' # -*- coding:utf-8 -*- import urllib import urllib2 import re import thread import time #糗事百科爬虫类 class QSBK: #初始化方法,定义一些变量 def __init__(self): self.pageIndex = 1 self.user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' #初始化headers self.headers = { '...
{ "repo_name": "zhangmhao/crawl-house", "path": "prototype/spider-qiushibaike.py", "copies": "1", "size": "4279", "license": "mit", "hash": -2761944601421572600, "line_mean": 29.8545454545, "line_max": 120, "alpha_frac": 0.5204833481, "autogenerated": false, "ratio": 2.311307901907357, "config_t...
__author__ = 'CQC' # -*- coding:utf-8 -*- import urllib import urllib2 import re #处理页面标签类 class Tool: #去除img标签,7位长空格 removeImg = re.compile('<img.*?>| {7}|') #删除超链接标签 removeAddr = re.compile('<a.*?>|</a>') #把换行的标签换为\n replaceLine = re.compile('<tr>|<div>|</div>|</p>') #将表格制表<td>替换为\t re...
{ "repo_name": "zhangmhao/crawl-house", "path": "prototype/spider-baiduTieba.py", "copies": "1", "size": "2901", "license": "mit", "hash": 1816679850483613200, "line_mean": 28.1590909091, "line_max": 93, "alpha_frac": 0.546588694, "autogenerated": false, "ratio": 2.4639769452449567, "config_test...
__author__ = 'CQC' # -*- coding:utf-8 -*- import urllib import urllib2 import cookielib import re import webbrowser import tool #模拟登录淘宝类 class Taobao: #初始化方法 def __init__(self): #登录的URL self.loginURL = "https://login.taobao.com/member/login.jhtml" #代理IP地址,防止自己的IP被封禁 self.proxy...
{ "repo_name": "zhangmhao/crawl-house", "path": "prototype/spider-taoballist.py", "copies": "1", "size": "12386", "license": "mit", "hash": 7391967095079775000, "line_mean": 35.7333333333, "line_max": 772, "alpha_frac": 0.5762323271, "autogenerated": false, "ratio": 2.3108167770419428, "config_t...
####AUTHOR/CREDIT: O'Brien, Oliver (o.obrien@ucl.ac.uk) #Paramters: startID (in order of the london.csv file - not necc numerical order!), maxID import csv import os import sys def routing(): locations = [] maxID = int(sys.argv[3]) csvreader = csv.reader(open('london.csv', 'r')) for row in csvread...
{ "repo_name": "oscarechobravo/ftc2050-toolchain", "path": "routino.py", "copies": "1", "size": "1343", "license": "apache-2.0", "hash": -8411698330467659000, "line_mean": 35.2972972973, "line_max": 203, "alpha_frac": 0.5368577811, "autogenerated": false, "ratio": 3.1378504672897196, "config_tes...
__author__ = 'cristian' import MySQLdb import MySQLdb.cursors class MySql: _host = '' _user = '' _password = '' _database = '' _con = None error = '' last_id = 0 num_rows = 0 def __init__(self, mysql_host, mysql_user, mysql_pass, mysql_db): self._host = mysql_host ...
{ "repo_name": "ceakki/ddns-server", "path": "dns/mysql.py", "copies": "1", "size": "2003", "license": "mit", "hash": 3517876505594465300, "line_mean": 23.4390243902, "line_max": 89, "alpha_frac": 0.4583125312, "autogenerated": false, "ratio": 4.207983193277311, "config_test": false, "has_no_k...
__author__ = 'croxis' from datetime import datetime from flask import flash, redirect, render_template, request, url_for from flask.ext.login import current_user, login_required, login_user, logout_user from werkzeug.contrib.atom import AtomFeed from . import user from ..models import User from .forms import LoginForm,...
{ "repo_name": "croxis/kmr", "path": "app/user/views.py", "copies": "1", "size": "3597", "license": "mit", "hash": 15622878305283932, "line_mean": 37.2765957447, "line_max": 98, "alpha_frac": 0.6427578538, "autogenerated": false, "ratio": 3.8103813559322033, "config_test": false, "has_no_keywo...
__author__ = 'croxis' from datetime import datetime import mimetypes import random from flask import abort, flash, make_response, redirect, render_template, request, url_for from flask.ext.login import current_user, login_required from . import mod from .forms import ModDownloadUpdateForm, ModEditForm, ModRegisterForm...
{ "repo_name": "croxis/kmr", "path": "app/mod/views.py", "copies": "1", "size": "9657", "license": "mit", "hash": 3099745709020508000, "line_mean": 40.4506437768, "line_max": 135, "alpha_frac": 0.6301128715, "autogenerated": false, "ratio": 3.7113758647194466, "config_test": false, "has_no_key...
__author__ = 'croxis' from flask_wtf import Form from flask_wtf.file import FileField, FileAllowed, FileRequired from wtforms import SubmitField, TextField, TextAreaField, ValidationError from wtforms.validators import Optional, Required from flask.ext.pagedown.fields import PageDownField from ..models import Mod c...
{ "repo_name": "croxis/kmr", "path": "app/mod/forms.py", "copies": "1", "size": "2440", "license": "mit", "hash": 2784830012214971400, "line_mean": 47.82, "line_max": 142, "alpha_frac": 0.7155737705, "autogenerated": false, "ratio": 4.326241134751773, "config_test": false, "has_no_keywords": f...
__author__ = 'croxis' from io import BytesIO import random import re from PIL import Image, ImageDraw, ImageFont import requests import lib.transforms as transforms import lib.utils as utils from lib.manalib import Manatext from . import magic_image from . import img_manager try: import textwrap import nltk...
{ "repo_name": "croxis/mtgai", "path": "app/card_visual.py", "copies": "1", "size": "12141", "license": "mit", "hash": 1580799061882881800, "line_mean": 35.1339285714, "line_max": 79, "alpha_frac": 0.4854624825, "autogenerated": false, "ratio": 3.750695088044486, "config_test": false, "has_no_...
__author__ = 'croxis' import os.path from PIL import Image COLORS = {'white': 'w', 'black': 'b', 'blue': 'u', 'green': 'g', 'red': 'r', 'colorless': 'c', 'artifact': 'a', 'multicolor': 'm'} C = {v: k for k, v in COLORS.items()} class ImageManager...
{ "repo_name": "croxis/mtgai", "path": "app/image_manager.py", "copies": "1", "size": "2261", "license": "mit", "hash": 6680155407458835000, "line_mean": 31.3, "line_max": 103, "alpha_frac": 0.5444493587, "autogenerated": false, "ratio": 3.2025495750708215, "config_test": false, "has_no_keywor...
__author__ = 'croxis' from datetime import datetime import mimetypes import random from flask import abort, current_app, jsonify, make_response, render_template, request from flask.ext.login import current_user from . import main from ..models import Mod, mongo @main.route('/') def index(): user_agent = reques...
{ "repo_name": "croxis/kmr", "path": "app/main/views.py", "copies": "1", "size": "3100", "license": "mit", "hash": -7740487037489334000, "line_mean": 30.6428571429, "line_max": 89, "alpha_frac": 0.5938709677, "autogenerated": false, "ratio": 4.133333333333334, "config_test": false, "has_no_key...
__author__ = 'croxis' from flask.ext.login import AnonymousUserMixin, LoginManager, UserMixin from flask.ext.mongoengine import MongoEngine from werkzeug.security import generate_password_hash, check_password_hash import bcrypt # Break the cycle of circular dependency mongo = MongoEngine() login = LoginManager() @...
{ "repo_name": "croxis/kmr", "path": "app/models.py", "copies": "1", "size": "4495", "license": "mit", "hash": -2229914786500480800, "line_mean": 34.952, "line_max": 118, "alpha_frac": 0.7122190073, "autogenerated": false, "ratio": 4.191231343283582, "config_test": false, "has_no_keywords": fa...
__author__ = 'croxis' from flask import abort, flash, jsonify, make_response, redirect, render_template, request, url_for from flask.ext.openid import OpenID # OpenID support broken until fix: https://github.com/mitsuhiko/flask-openid/pull/34 from flask.ext.pagedown.fields import PageDownField from flask_wtf import...
{ "repo_name": "croxis/kmr", "path": "app/main/kmr.py", "copies": "1", "size": "1047", "license": "mit", "hash": 3628862929456666600, "line_mean": 24.5609756098, "line_max": 121, "alpha_frac": 0.7258834766, "autogenerated": false, "ratio": 3.6228373702422147, "config_test": false, "has_no_keyw...
__author__ = 'croxis' from flask_wtf import Form from flask_wtf.file import FileField from wtforms import TextField, TextAreaField, ValidationError from wtforms.validators import Required from flask.ext.pagedown.fields import PageDownField from ..models import Mod, User '''class OIDLoginForm(Form): """OID user ...
{ "repo_name": "croxis/kmr", "path": "app/main/forms.py", "copies": "1", "size": "1159", "license": "mit", "hash": 4696400715043045000, "line_mean": 34.1212121212, "line_max": 98, "alpha_frac": 0.7100949094, "autogenerated": false, "ratio": 4.066666666666666, "config_test": false, "has_no_keyw...
__author__ = 'croxis' from flask_wtf import Form from wtforms import BooleanField, PasswordField, SubmitField, TextField, ValidationError from wtforms.validators import Email, EqualTo, Required from ..models import User class LoginForm(Form): username = TextField('User Name', validators=[Required()]) passwo...
{ "repo_name": "croxis/kmr", "path": "app/user/forms.py", "copies": "1", "size": "1365", "license": "mit", "hash": -3902717611878918700, "line_mean": 39.1764705882, "line_max": 119, "alpha_frac": 0.7157509158, "autogenerated": false, "ratio": 4.431818181818182, "config_test": false, "has_no_ke...
__author__ = 'croxis' """ Python source: https://gist.github.com/petrklus/b1f427accdf7438606a6 Original pseudo code: Set Temperature = Temperature \ 100 Calculate Red: If Temperature <= 66 Then Red = 255 Else Red = Temperature - 60 Red = 329.698727446 * (Red ^ -0.13320...
{ "repo_name": "croxis/Panda-Core-Technology", "path": "Planets/utils/blackbody.py", "copies": "1", "size": "2901", "license": "mit", "hash": 7705592892069374000, "line_mean": 23.593220339, "line_max": 79, "alpha_frac": 0.5429162358, "autogenerated": false, "ratio": 3.5814814814814815, "config_t...
__author__ = 'croxis' import sandbox from direct.directnotify.DirectNotify import DirectNotify log = DirectNotify().newCategory("SpaceDrive-ClientNet") #PROPOSAL! {server entity id: client entity id} and reverse lookup dict too class ClientNetworkSystem(sandbox.UDPNetworkSystem): def init2(self): ...
{ "repo_name": "croxis/SpaceDrive", "path": "spacedrive/networking/client_networking.py", "copies": "1", "size": "2496", "license": "mit", "hash": 3542728348685860400, "line_mean": 35.2537313433, "line_max": 95, "alpha_frac": 0.6574519231, "autogenerated": false, "ratio": 4.146179401993355, "con...
__author__ = 'croxis' """ Python source: https://gist.github.com/petrklus/b1f427accdf7438606a6 Original pseudo code: Set Temperature = Temperature \ 100 Calculate Red: If Temperature <= 66 Then Red = 255 Else Red = Temperature - 60 Red = 329.698727446 * (R...
{ "repo_name": "croxis/SpaceDrive", "path": "spacedrive/utils/blackbody.py", "copies": "1", "size": "3018", "license": "mit", "hash": -7012207628510967000, "line_mean": 23.593220339, "line_max": 79, "alpha_frac": 0.5218687873, "autogenerated": false, "ratio": 3.7121771217712176, "config_test": f...
import requests import optparse import sys import threading import time import Queue import re from progressbar import ProgressBar header = { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Accept-Encoding': 'gzip, deflate, compress', 'Cache-Control': 'max-age=0', 'Connection': 'keep-ali...
{ "repo_name": "RicterZ/moescan", "path": "tools/DirScan/pldirscan.py", "copies": "1", "size": "4027", "license": "mit", "hash": -2029998308000329200, "line_mean": 34.8648648649, "line_max": 307, "alpha_frac": 0.5342878674, "autogenerated": false, "ratio": 3.3037344398340247, "config_test": fals...
__author__ = 'CSPF' from ..config import db class User(db.Model): __tablename__ = "users" id = db.Column("id",db.Integer,primary_key=True,autoincrement=True) username = db.Column('username',db.String(20),unique=True,index=True) password = db.Column('password',db.String(50)) def __init__(self,usern...
{ "repo_name": "breakthesec/DodoVulnerableBank", "path": "DodoRESTAPI/app/model/Users.py", "copies": "1", "size": "1139", "license": "mit", "hash": 6843217516838618000, "line_mean": 24.3111111111, "line_max": 93, "alpha_frac": 0.5899912204, "autogenerated": false, "ratio": 3.9411764705882355, "c...
__author__ = 'CSPF' from ..config import app from .. model.Transaction import Transaction from .. model.Account import Account from flask import request,jsonify @app.route("/transaction/statement/<int:customer_id>",methods=['POST',"GET"]) def view_statement(customer_id): transactions = Transaction.query.filt...
{ "repo_name": "breakthesec/DodoVulnerableBank", "path": "DodoRESTAPI/app/controller/transaction.py", "copies": "1", "size": "1850", "license": "mit", "hash": -2944468790624310000, "line_mean": 44.3, "line_max": 134, "alpha_frac": 0.5994594595, "autogenerated": false, "ratio": 4.579207920792079, ...
__author__ = 'CSPF' from ..config import db class Account(db.Model): __tablename__ = "accounts" id = db.Column("id",db.Integer,primary_key=True) branch = db.Column('branch',db.String(50)) account_number = db.Column('account_number',db.String(50)) balance = db.Column('balance',db.Integer) ...
{ "repo_name": "breakthesec/DodoVulnerableBank", "path": "DodoRESTAPI/app/model/Account.py", "copies": "1", "size": "1420", "license": "mit", "hash": -7613404034541715000, "line_mean": 30.2727272727, "line_max": 77, "alpha_frac": 0.5725352113, "autogenerated": false, "ratio": 3.641025641025641, ...
__author__ = 'CSPF' from ..config import db class Transaction(db.Model): __tablename__ = "transaction" id = db.Column("id", db.Integer, primary_key=True, autoincrement=True) customer_id = db.Column("customer_id", db.Integer) amount = db.Column('amount', db.Integer) remarks = db.Column('re...
{ "repo_name": "breakthesec/DodoVulnerableBank", "path": "DodoRESTAPI/app/model/Transaction.py", "copies": "1", "size": "1250", "license": "mit", "hash": 481864319006227140, "line_mean": 35.8787878788, "line_max": 103, "alpha_frac": 0.6328, "autogenerated": false, "ratio": 3.8580246913580245, "c...
__author__ = 'CSPF' import os from OpenSSL import crypto import socket, ssl from utils import get_home_dir class SSLCertifiacate: def __init__(self,host=None): self.host = host ssl_dir = os.path.join(get_home_dir(), "ssl") self.key_path = os.path.join(ssl_dir, "dodo.key") ...
{ "repo_name": "breakthesec/DodoVulnerableBank", "path": "DodoRESTAPI/app/digital_certificate.py", "copies": "1", "size": "1868", "license": "mit", "hash": -2807401258273301000, "line_mean": 33.9230769231, "line_max": 135, "alpha_frac": 0.5867237687, "autogenerated": false, "ratio": 3.341681574239...
_author_ = 'ctippur' import boto3 import os from aws_requests_auth.aws_auth import AWSRequestsAuth class credsaws(): ## init session = boto3.session.Session() #es_host='search-enrichment-service-ebin6h6q5xc7ehx2snhwbtyl3m.us-west-2.es.amazonaws.com' #es_host=os.environ['es_endpoint'] def __init__(s...
{ "repo_name": "ctippur/swaggeralliance", "path": "src/python/flask/swagger_server/lib/aws/Creds.py", "copies": "1", "size": "1614", "license": "apache-2.0", "hash": -4570439810450338300, "line_mean": 28.3454545455, "line_max": 94, "alpha_frac": 0.6059479554, "autogenerated": false, "ratio": 3.456...
__author__ = 'Călin Sălăgean' class Person(): __id_class = 0 def __init__(self, first_name = None, last_name = None, address = None, id = None): ''' Person class constructor :param name: :param address: :param event: :return: Class instance ''' ...
{ "repo_name": "dooma/Events", "path": "events/models/person.py", "copies": "1", "size": "2816", "license": "mit", "hash": 2847937633247938000, "line_mean": 24.5818181818, "line_max": 92, "alpha_frac": 0.5151084252, "autogenerated": false, "ratio": 4.307810107197549, "config_test": false, "has...
__author__ = 'Călin Sălăgean' from datetime import datetime import re class Event(): __id_class = 0 def __init__(self, date = None, time = None, description = None, id = None): ''' Event class contructor :param date: :param time: :param description: :return: In...
{ "repo_name": "dooma/Events", "path": "events/models/event.py", "copies": "1", "size": "2981", "license": "mit", "hash": -1009934390293902100, "line_mean": 23.825, "line_max": 108, "alpha_frac": 0.5080591001, "autogenerated": false, "ratio": 4.444776119402985, "config_test": false, "has_no_ke...
__author__ = 'Călin Sălăgean' from events.controllers.event import EventController from events.controllers.person import PersonController class Menu(): text = """ 1. Adaugare persoana 2. Afisare persoane 3. Afisare persoana selectata 4. Stergere persaoana 5. Editare persoa...
{ "repo_name": "dooma/Events", "path": "start.py", "copies": "1", "size": "4508", "license": "mit", "hash": 1671441266844625400, "line_mean": 29.8630136986, "line_max": 88, "alpha_frac": 0.6057713651, "autogenerated": false, "ratio": 3.533333333333333, "config_test": false, "has_no_keywords": ...
__author__ = 'Călin Sălăgean' from events.models.event import Event from events.repositories.event import EventRepository from events.repositories.person_event import PersonEventRepository from events.repositories.person import PersonRepository class EventController(): def __init__(self): ''' Even...
{ "repo_name": "dooma/Events", "path": "events/controllers/event.py", "copies": "1", "size": "6395", "license": "mit", "hash": -3859223540747952600, "line_mean": 26.3205128205, "line_max": 133, "alpha_frac": 0.5292553191, "autogenerated": false, "ratio": 4.3394433129667345, "config_test": false,...
__author__ = 'Călin Sălăgean' from events.models.person import Person from utils.IO import IO class PersonRepository(): def __init__(self, filename = 'person.json'): ''' PersonRepository class constructor :param filename: Default value 'person.json' :return: ''' se...
{ "repo_name": "dooma/Events", "path": "events/repositories/person.py", "copies": "1", "size": "2520", "license": "mit", "hash": -5382964545277476000, "line_mean": 24.18, "line_max": 112, "alpha_frac": 0.5252284466, "autogenerated": false, "ratio": 4.423550087873462, "config_test": false, "has...
__author__ = 'Călin Sălăgean' from events.repositories.event import EventRepository from events.repositories.person import PersonRepository from datetime import datetime class PersonEvent(): def __init__(self, person_id = None, event_id = None, date = None): ''' PersonEvent constructor :pa...
{ "repo_name": "dooma/Events", "path": "events/models/person_event.py", "copies": "1", "size": "2731", "license": "mit", "hash": -7596357108319026000, "line_mean": 26.5656565657, "line_max": 82, "alpha_frac": 0.5450879765, "autogenerated": false, "ratio": 4.302839116719243, "config_test": false,...
__author__ = 'Călin Sălăgean' from events.repositories.person_event import PersonEvent, PersonEventRepository from events.repositories.person import PersonRepository from events.repositories.event import EventRepository from events.models.person_event import PersonEvent import re class PersonController(): def __i...
{ "repo_name": "dooma/Events", "path": "events/controllers/person.py", "copies": "1", "size": "7945", "license": "mit", "hash": -2761423835787932000, "line_mean": 27.1666666667, "line_max": 120, "alpha_frac": 0.5333669101, "autogenerated": false, "ratio": 4.318651441000544, "config_test": false,...
__author__ = 'Călin Sălăgean' from utils.IO import IO from events.models.event import Event class EventRepository(): def __init__(self, filename = 'event.json'): ''' EventRepository class constructor :param filename: Default value 'event.json' :return: ''' self.__d...
{ "repo_name": "dooma/Events", "path": "events/repositories/event.py", "copies": "1", "size": "2655", "license": "mit", "hash": -5491324509669188000, "line_mean": 25.0098039216, "line_max": 93, "alpha_frac": 0.5214932127, "autogenerated": false, "ratio": 4.47972972972973, "config_test": false, ...
__author__ = 'Călin Sălăgean' from utils.IO import IO from events.models.person_event import PersonEvent class PersonEventRepository(): def __init__(self, filename = None): self.__defaultfile = filename or 'person_event.json' def insert(self, person_event): operation = IO(self.__defaultfile) ...
{ "repo_name": "dooma/Events", "path": "events/repositories/person_event.py", "copies": "1", "size": "1682", "license": "mit", "hash": 2032470505474927000, "line_mean": 34.7446808511, "line_max": 120, "alpha_frac": 0.5979749851, "autogenerated": false, "ratio": 3.9786729857819907, "config_test":...
__author__ = 'Călin Sălăgean' import os, json class IO(): def __init__(self, filename = None): ''' IO Constructor :param filename: Default None :return: object ''' self.validate(filename) self.__filename = filename def get(self): ''' Re...
{ "repo_name": "dooma/Events", "path": "utils/IO.py", "copies": "1", "size": "2023", "license": "mit", "hash": -5437359181193553000, "line_mean": 28.2898550725, "line_max": 90, "alpha_frac": 0.5658415842, "autogenerated": false, "ratio": 4.478935698447893, "config_test": false, "has_no_keyword...
__author__ = 'Călin Sălăgean' import unittest from events.models.event import Event class TestEvent(unittest.TestCase): def test_initialization(self): event = Event('14/01/2015', '14:00', 'Colectiv') self.assertIsInstance(event, Event) def test_date_input_validation(self): with self.a...
{ "repo_name": "dooma/Events", "path": "spec/models/test_event.py", "copies": "1", "size": "1213", "license": "mit", "hash": 4103978191900530000, "line_mean": 38.064516129, "line_max": 87, "alpha_frac": 0.652892562, "autogenerated": false, "ratio": 3.5798816568047336, "config_test": true, "has...
__author__ = 'Călin Sălăgean' import unittest from events.models.person_event import PersonEvent class TestPersonEvent(unittest.TestCase): def test_instance(self): with self.assertRaises(ValueError): person_event = PersonEvent(1, 2) self.assertIsInstance(person_event, PersonEvent) ...
{ "repo_name": "dooma/Events", "path": "spec/models/test_person_event.py", "copies": "1", "size": "1239", "license": "mit", "hash": -7105311679982183000, "line_mean": 32.4324324324, "line_max": 89, "alpha_frac": 0.6618122977, "autogenerated": false, "ratio": 4.012987012987013, "config_test": tru...
__author__ = 'Călin Sălăgean' import unittest, os from utils.IO import IO from events.repositories.event import EventRepository from events.models.event import Event class TestEventRepository(unittest.TestCase): def test_insert(self): io = IO('test.json') io.set([]) event = Event('14/01/2...
{ "repo_name": "dooma/Events", "path": "spec/repositories/test_event.py", "copies": "1", "size": "4099", "license": "mit", "hash": -3537187086741714000, "line_mean": 30.2748091603, "line_max": 76, "alpha_frac": 0.5842285156, "autogenerated": false, "ratio": 3.34094616639478, "config_test": true,...
__author__ = "cuongnb14@gmail.com" from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Float from sqlalchemy.orm import relationship, backref from sqlalchemy import ForeignKey Base = declarative_base() class WebApp(Base): """Mapping with table apps""" __tab...
{ "repo_name": "cuongnb14/autoscaling-paas", "path": "project/autoscaling/autoscaling/model.py", "copies": "1", "size": "1175", "license": "mit", "hash": 3092280253413701600, "line_mean": 32.5714285714, "line_max": 112, "alpha_frac": 0.7004255319, "autogenerated": false, "ratio": 3.753993610223642...
__author__ = 'cuongnb14@gmail.com' import logging class Scaler(object): """docstring for ClassName""" def __init__(self, marathon_client, app): self.logger = logging.getLogger("Scaler") self.marathon_client = marathon_client self.app = app def scale(self, delta): """sacle ...
{ "repo_name": "cuongnb14/autoscaling-paas", "path": "project/autoscaling/autoscaling/scaler.py", "copies": "1", "size": "1070", "license": "mit", "hash": 8568042082940434000, "line_mean": 38.6296296296, "line_max": 88, "alpha_frac": 0.6224299065, "autogenerated": false, "ratio": 3.715277777777777...
class dstat_plugin(dstat): """ EVENTS COMMENT. """ def __init__(self): self.name = 'latency' self.type = 'p' self.width = 4 self.scale = 34 def vars(self): ret = [] for name in glob.glob('/tmp/dstat/sla/client[0-9]*'): ret.append(os.path...
{ "repo_name": "barzan/dbseer", "path": "middleware_old/dstat_for_server/plugins/dstat_client_latency.py", "copies": "4", "size": "1026", "license": "apache-2.0", "hash": -3124171144379731500, "line_mean": 24.65, "line_max": 96, "alpha_frac": 0.5019493177, "autogenerated": false, "ratio": 3.320388...
#pads with spaces and returns string,so it can be divided exactly by a certain amount def sim_pad(MESSAGE, PAD_TO_MULT): MESSAGE = MESSAGE + "1" pad = (((len(MESSAGE)/PAD_TO_MULT)+1)*PAD_TO_MULT)-len(MESSAGE) for i in range(pad): MESSAGE = MESSAGE + " " return MESSAGE #pads a string ...
{ "repo_name": "Curiousteenager/simplepad", "path": "simplepad.py", "copies": "1", "size": "1915", "license": "mit", "hash": -2354845574991672000, "line_mean": 35.5490196078, "line_max": 134, "alpha_frac": 0.6804177546, "autogenerated": false, "ratio": 3.0837359098228663, "config_test": false, ...
__author__ = 'Curtis Mackay' pe_index = 0; import itertools class PE(object): """ Data structure for storing PE dependency data """ newid = itertools.count().__next__ def __init__(self, operation, pe_inputs, pe_outputs, pe_id=None): self.operation = operation self.pe_inputs = pe_i...
{ "repo_name": "crnmrn/SPADE-ARCH", "path": "compiler/dpda_compiler/parser/dependency_tracker.py", "copies": "1", "size": "1991", "license": "bsd-3-clause", "hash": 392705441356094300, "line_mean": 31.6557377049, "line_max": 79, "alpha_frac": 0.5364138624, "autogenerated": false, "ratio": 3.555357...
__author__ = 'cutylewiwi' # -*- coding:utf-8 -*- import urllib import urllib2 import re class Group: def __init__(self, name, faculties): self.name = name self.faculties = faculties class GroupList: def __init__(self, baseUrl): self.baseUrl = baseUrl self.grou...
{ "repo_name": "doge-search/webdoge", "path": "wuyudong/UTA/UTA_research.py", "copies": "1", "size": "2593", "license": "unlicense", "hash": 7706575861810142000, "line_mean": 30.012345679, "line_max": 104, "alpha_frac": 0.5106054763, "autogenerated": false, "ratio": 3.5963938973647713, "config_t...
__author__ = 'cutylewiwi' # -*- coding:utf-8 -*- import urllib import urllib2 import re class Prof: def __init__(self, name, photoUrl, pUrl, title, area, office, phone, email): self.name = name self.photoUrl = photoUrl self.pUrl = pUrl self.title = title self.a...
{ "repo_name": "doge-search/webdoge", "path": "wuyudong/KSU/KSU.py", "copies": "1", "size": "4385", "license": "unlicense", "hash": 9212551889555674000, "line_mean": 38.2293577982, "line_max": 190, "alpha_frac": 0.5069555302, "autogenerated": false, "ratio": 3.404503105590062, "config_test": fal...
__author__ = 'cutylewiwi' # -*- coding:utf-8 -*- import urllib import urllib2 import re class Prof: def __init__(self, name, photoUrl, pUrl, title, area, office): self.name = name self.photoUrl = photoUrl self.pUrl = pUrl self.title = title self.area = area ...
{ "repo_name": "doge-search/webdoge", "path": "wuyudong/UTK/UTK.py", "copies": "1", "size": "2980", "license": "unlicense", "hash": -5998241134554957000, "line_mean": 31.4831460674, "line_max": 102, "alpha_frac": 0.4946308725, "autogenerated": false, "ratio": 3.401826484018265, "config_test": fa...
__author__ = 'cvdsouza' #Developed at : SEFCOM Labs by JJ SEO and Clinton Dsouza from bluetooth import * import threading class MyThread (threading.Thread): def __init__ (self, socket): self.socket = socket threading.Thread.__init__(self) def run (self): try: str = raw_input('Enter your input:') self.so...
{ "repo_name": "jtromo/ASU-Thesis-RaspberryPiSmartKey", "path": "RaspberryPiSmartKey/.sync/Archive/PyBlueServer.py", "copies": "1", "size": "1412", "license": "apache-2.0", "hash": 2074202821976899000, "line_mean": 23.7719298246, "line_max": 92, "alpha_frac": 0.652266289, "autogenerated": false, "...
__author__ = 'cvl' def numberic_system(base_system): result = {} for csc_n in base_system: result[csc_n] = base_system.find(csc_n) return result class CSC(object): system = {} def __init__(self, alphabet): self.system = numberic_system(alphabet) def csc(self, sym): ...
{ "repo_name": "cludtk/freedomain", "path": "csc.py", "copies": "1", "size": "1394", "license": "mit", "hash": 4554861451716396000, "line_mean": 26.3333333333, "line_max": 81, "alpha_frac": 0.449784792, "autogenerated": false, "ratio": 3.7074468085106385, "config_test": false, "has_no_keywords...
__author__ = 'cwhelan' # converts sam format to modil format # only works on data from one chromsome for now, so please split first! import sys current_read_id = "NA" read1_alignments = {} read2_alignments = {} def print_reads(read1_alignments, read2_alignments): for p1 in read1_alignments: for p2 in re...
{ "repo_name": "cwhelan/cloudbreak", "path": "src/main/scripts/nameSortedSamToMODIL.py", "copies": "1", "size": "1992", "license": "mit", "hash": -2189905813125169000, "line_mean": 36.5849056604, "line_max": 165, "alpha_frac": 0.546184739, "autogenerated": false, "ratio": 3.393526405451448, "con...
__author__ = 'CwT' from AbstractAnalysis import AbstractFlowAnalysis class GlobalAnalysis(AbstractFlowAnalysis): def __init__(self): self._globalvars = {} AbstractFlowAnalysis.__init__(self) @property def GlobalSet(self): return self._globalvars def flowTransfer(self, block): ...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/GlobalAnalysis.py", "copies": "1", "size": "1063", "license": "mit", "hash": 741299972539474000, "line_mean": 31.2121212121, "line_max": 63, "alpha_frac": 0.5305738476, "autogenerated": false, "ratio": 4.621739130434783, "config_test": false, ...
__author__ = 'CwT' from DexParse import * array = [0x32, 0xa, # if-eq v0, v0, 8 0x26, 0x3, 0x0, # fill-array-data v0, 3 0x0300, 0x2, 0x1, 0x0, 0x0 # fill-array-data-payload 0x0300, width, size, data[] ] array2 = [0x32, 0xd, # if-eq v0, v0, 8 0x1023, 0x06d7, # new-array v...
{ "repo_name": "CvvT/DexParse", "path": "AddJunk.py", "copies": "2", "size": "1572", "license": "apache-2.0", "hash": 1338007297107412500, "line_mean": 36.4285714286, "line_max": 92, "alpha_frac": 0.6164122137, "autogenerated": false, "ratio": 2.673469387755102, "config_test": false, "has_no_k...
__author__ = 'CwT' from ForwardFlowAnalysis import ForwardFlowAnalysis class SSAliasAnalysis(ForwardFlowAnalysis): def __init__(self): self._AliasSetBefore = {} self._AliasSetAfter = {} ForwardFlowAnalysis.__init__(self) def flowTransfer(self, block): set = self.getAliasSet(blo...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/AliasAnalysis.py", "copies": "1", "size": "3222", "license": "mit", "hash": 1238581724217521700, "line_mean": 36.4651162791, "line_max": 92, "alpha_frac": 0.5301055245, "autogenerated": false, "ratio": 3.900726392251816, "config_test": false, ...
__author__ = 'CwT' from ForwardFlowAnalysis import ForwardFlowAnalysis class SSAliasAnalysis(ForwardFlowAnalysis): def __init__(self): self._AliasSet = dict({'Must': [], 'May': []}) ForwardFlowAnalysis.__init__(self) @property def AliasSet(self): return self._AliasSet def flo...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/SSAliasAnalysis.py", "copies": "1", "size": "2103", "license": "mit", "hash": -6958093383351475000, "line_mean": 31.3538461538, "line_max": 92, "alpha_frac": 0.504041845, "autogenerated": false, "ratio": 3.938202247191011, "config_test": false, ...
__author__ = 'CwT' from ForwardFlowAnalysis import ForwardFlowAnalysis class SSALiteralAnalysis(ForwardFlowAnalysis): def __init__(self): self._LiteralSet = {} ForwardFlowAnalysis.__init__(self) @property def varMaps(self): return self._LiteralSet def flowTransfer(self, block)...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/SSALiteralAnalysis.py", "copies": "1", "size": "1081", "license": "mit", "hash": 6381821593756199000, "line_mean": 26.7179487179, "line_max": 55, "alpha_frac": 0.5689176688, "autogenerated": false, "ratio": 4.466942148760331, "config_test": fals...
__author__ = 'CwT' from Model import Node import Queue class InterProcTaintAnalysis(object): def __init__(self): self._graph = None self._FuncExist = {} self._FuncParams = {} self._SrcNodes = [] self._TargetNodes = [] self._Counter = 0 # Tainted Src Op and Va...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/cfl/InterProcTaintAnalysis.py", "copies": "1", "size": "9996", "license": "mit", "hash": -9168881039073787000, "line_mean": 42.0862068966, "line_max": 161, "alpha_frac": 0.5269107643, "autogenerated": false, "ratio": 4.166736140058358, "config_t...
__author__ = 'CwT' from type.Type import Literal, Normal from type.Type import Array as TArray class Graph(object): def __init__(self, data): self._func = {} for key, value in data.items(): self._func[key] = Function(key, value) @property def Entry(self): return self._f...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/Graph.py", "copies": "1", "size": "5159", "license": "mit", "hash": 7992706562260699000, "line_mean": 27.5027624309, "line_max": 100, "alpha_frac": 0.5406086451, "autogenerated": false, "ratio": 4.021044427123928, "config_test": false, "has_no...
__author__ = 'CwT' import struct import Util class OATHdr: def __init__(self): self.offset = 0 self.magic = [] self.version = [] self.checksum = 0 self.dexfileCount = 0 self.size = 0 self.keyvalueSize = 0 def readfd(self, file, offset): self.offs...
{ "repo_name": "CvvT/ElfParse", "path": "OatParse.py", "copies": "1", "size": "1908", "license": "apache-2.0", "hash": -2010881188756968000, "line_mean": 27.4776119403, "line_max": 82, "alpha_frac": 0.5780922432, "autogenerated": false, "ratio": 3.359154929577465, "config_test": false, "has_no...
__author__ = 'CwT' import struct def elf_hash(funcname): h = 0 for x in funcname: h = (h << 4) + ord(x) g = h & 0xf0000000 h ^= g h ^= g >> 24 print() return h class Ehdr: def __init__(self): self.ident = [] self.type = 0 # 0: unknow; 1: relocation...
{ "repo_name": "List3nt0/ElfParse", "path": "ElfParse.py", "copies": "3", "size": "14115", "license": "apache-2.0", "hash": -185202154555888580, "line_mean": 31.299771167, "line_max": 101, "alpha_frac": 0.5307828551, "autogenerated": false, "ratio": 3.3345145287030475, "config_test": false, "h...
__author__ = 'CwT' class CFLGraph(object): def __init__(self, SuperGraph): self._supGraph = SuperGraph self._nodes = {} @property def Entry(self): return self._supGraph.Entry @property def subgraphs(self): return self._supGraph.functions @property def AllN...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/cfl/Model.py", "copies": "1", "size": "3639", "license": "mit", "hash": 5028505321046524000, "line_mean": 25.3695652174, "line_max": 87, "alpha_frac": 0.5504259412, "autogenerated": false, "ratio": 3.95114006514658, "config_test": false, "has_...
__author__ = 'CwT' from DexParse import * if __name__ == '__main__': dexfile = DexFile("classes.dex") # @Params: classname, acces_flag(public, private...), parent_class_name, Filename classitem = dexfile.addclass("Lcom/cc/test/DexParse;", Access_Flag["public"], "Ljava/lang/Object;", "DexParse.java") ...
{ "repo_name": "peterdocter/DexParse", "path": "AddClass.py", "copies": "2", "size": "1874", "license": "apache-2.0", "hash": -1306748393954928400, "line_mean": 42.5813953488, "line_max": 94, "alpha_frac": 0.6531483458, "autogenerated": false, "ratio": 3.1077943615257047, "config_test": false, ...
__author__ = 'CwT' from ElfParse import * if __name__ == '__main__': file = open("libbaiduprotect.so", 'r+b') file.seek(0) elfheader = Ehdr() elfheader.readfromfd(file) elfheader.init_table() addr = elfheader.shtable.findsection(".text").offset if addr == -1: print("find section .t...
{ "repo_name": "List3nt0/ElfParse", "path": "Encrypt.py", "copies": "3", "size": "1065", "license": "apache-2.0", "hash": -5129427311128843000, "line_mean": 34.5, "line_max": 111, "alpha_frac": 0.5962441315, "autogenerated": false, "ratio": 2.974860335195531, "config_test": false, "has_no_keyw...
__author__ = 'CwT' from idaapi import * from idautils import * from idc import * import re def getDword(addr): return Dword(addr) def getByte(addr): return Byte(addr) def getWord(addr): return Word(addr) class DexorJar: def __init__(self): self.pfileName = 0 self.isDex = 0 s...
{ "repo_name": "CvvT/dumpDex", "path": "findcookie.py", "copies": "1", "size": "4305", "license": "apache-2.0", "hash": 5947876427478314000, "line_mean": 27.3223684211, "line_max": 88, "alpha_frac": 0.5479674797, "autogenerated": false, "ratio": 3.2055100521221145, "config_test": false, "has_n...
__author__ = 'CwT' from idaapi import * from idautils import * from idc import * import struct import os import hashlib Access_Flag = {'public': 1, 'private': 2, 'protected': 4, 'static': 8, 'final': 0x10, 'synchronized': 0x20, 'volatile': 0x40, 'bridge': 0x40, 'transient': 0x80, 'vararg...
{ "repo_name": "keulraesik/dumpDex", "path": "dump.py", "copies": "5", "size": "76543", "license": "apache-2.0", "hash": 968704851888276900, "line_mean": 34.5683085502, "line_max": 206, "alpha_frac": 0.551859739, "autogenerated": false, "ratio": 3.5134031029101256, "config_test": false, "has_n...
__author__ = 'CwT' from idaapi import * from idautils import * from idc import * import struct global baseAddr def writefile(file, addr, len): for i in range(len): one = getByte(addr+i) file.write(struct.pack("B", one)) def getDword(addr): return Dword(addr) def getByte(addr): return By...
{ "repo_name": "CvvT/dumpDex", "path": "lookup.py", "copies": "1", "size": "23228", "license": "apache-2.0", "hash": 9203349476013620000, "line_mean": 32.3256814921, "line_max": 98, "alpha_frac": 0.562166351, "autogenerated": false, "ratio": 3.4824587706146928, "config_test": false, "has_no_ke...
__author__ = 'CwT' import Queue class FlowAnalysis(object): def __init__(self): self.GenSet = {} self.KillSet = {} self._graph = None def doAnalysis(self, directGraph): self._graph = directGraph numofcomputation = 0 queue = Queue.Queue() # queue.put(di...
{ "repo_name": "Panalyzer/Panalyzer", "path": "src/FlowAnalysis.py", "copies": "1", "size": "1554", "license": "mit", "hash": -274345365934147400, "line_mean": 25.8103448276, "line_max": 73, "alpha_frac": 0.5566280566, "autogenerated": false, "ratio": 4.304709141274238, "config_test": false, "...
__author__ = 'CwT' OPCODE = {0: "nop", 1: "move", 2: "move/from16", 5: "move-wide/from16", 7: "move-object", 8: "move-object/from16", 0xa: "move-result", 0xb: "move-result-wide", 0xc: "move-result-object", 0xd: "move-exception", 0xe: "return-void", 0xf: "return", 0x10: "return-wide", 0x11: "return-...
{ "repo_name": "CvvT/DexParse", "path": "Instruction.py", "copies": "2", "size": "11175", "license": "apache-2.0", "hash": -876353120084651600, "line_mean": 54.5970149254, "line_max": 132, "alpha_frac": 0.5356599553, "autogenerated": false, "ratio": 2.753141167775314, "config_test": false, "ha...
__author__ = 'cyankw' import re import urllib.request from multiprocessing import Pool import time strtime = time.clock() #计时器启动 def getHtml (url): #用于读取网页源代码 page = urllib.request.urlopen(url) html = page.read() return html global year global keywd def getCVE(html): #对读取的网页源代码使用正则表达式进行筛...
{ "repo_name": "cyankw/Python-Crawler-Practice-01-Vulnerabilities-Detector", "path": "Vulnerabilities Detector.py", "copies": "1", "size": "3089", "license": "apache-2.0", "hash": 4426454802812552000, "line_mean": 27.8988764045, "line_max": 128, "alpha_frac": 0.5302745393, "autogenerated": false, ...
__author__ = 'cyhis' from suds.client import Client from suds import WebFault from model.project import Project class SoapHelper: def __init__(self, app): self.app = app self.username = self.app.config['webadmin']['username'] self.password = self.app.config['webadmin']['password'] def...
{ "repo_name": "galaktika81/python_training_mantis", "path": "fixture/soap.py", "copies": "1", "size": "1991", "license": "apache-2.0", "hash": -2530711195864215000, "line_mean": 34.5714285714, "line_max": 103, "alpha_frac": 0.611752888, "autogenerated": false, "ratio": 4.08829568788501, "config...
__author__ = 'cyrbuzz' from base import (ScrollArea, QLabel, QFrame, QVBoxLayout, QPushButton, QHBoxLayout, QTableWidget, QAbstractItemView) class DownloadFrame(ScrollArea): def __init__(self, parent=None): super().__init__() self.parent = parent self.setObjectName('dow...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/widgets/downloadFrame.py", "copies": "1", "size": "2503", "license": "mit", "hash": 7190364056942079000, "line_mean": 36.2727272727, "line_max": 98, "alpha_frac": 0.6823912159, "autogenerated": false, "ratio": 3.548340548340548, "confi...
__author__ = 'cyrbuzz' import addition from base import QObject, QTableWidgetItem transTime = addition.itv2time class ConfigRecommendFrame(QObject): def __init__(self, parent): super().__init__() self.recommendFrame = parent self.musicList = [] self.bindConnect() def se...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/features/configRecommendFrameFeatures.py", "copies": "1", "size": "1143", "license": "mit", "hash": 2782863357357006300, "line_mean": 29.8918918919, "line_max": 105, "alpha_frac": 0.7034120735, "autogenerated": false, "ratio": 3.74754098...
__author__ = 'cyrbuzz' import os import glob import pickle import os.path try: import eyed3 except ImportError: print('eyed3没有成功加载或安装,请不要使用本地音乐功能!') from base import QFileDialog, QObject, QTableWidgetItem, checkFolder from addition import itv2time def getAllFolder(topFolder): result = [] def findF...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/features/configNativeFeatures.py", "copies": "1", "size": "3832", "license": "mit", "hash": 8029725500049695000, "line_mean": 29.0158730159, "line_max": 127, "alpha_frac": 0.5446853517, "autogenerated": false, "ratio": 4.002116402116402,...
__author__ = 'cyrbuzz' import os import re import glob import pickle import os.path import logging try: import eyed3 except ImportError: print('eyed3没有成功加载或安装,当再次打开时下载的音乐会加载不到!') from apiRequestsBase import HttpRequest from asyncBase import aAsync, toTask from base import QFileDialog, QObject, QTableWidgetIte...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/features/configDownloadFrameFeatures.py", "copies": "1", "size": "7055", "license": "mit", "hash": -2431072981149056500, "line_mean": 31.75, "line_max": 127, "alpha_frac": 0.6148876817, "autogenerated": false, "ratio": 3.5979926043317487...
__author__ = 'cyrbuzz' """ 提供用于将函数包装成异步的基本功能。 """ import asyncio def aAsync(func, *args, **kwargs): """ future 用于将任意函数包装成一个awaitable对象。 例: future = aAsync(requests.get, 'http://www.xxx.com', headers=headers) data = yield from future """ # run_in_evecutor不支持**kwargs. # args是个元组,kw...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/features/asyncBase.py", "copies": "1", "size": "2150", "license": "mit", "hash": 4915872713588908000, "line_mean": 19.6333333333, "line_max": 80, "alpha_frac": 0.5350215517, "autogenerated": false, "ratio": 2.662840746054519, "config_t...
__author__ = 'cyrbuzz' """制作登陆区盒子。""" from base import QDialog, QFrame, HBoxLayout, HStretchBox, QLabel, QLineEdit, QPushButton, Qt, VBoxLayout, RequestThread class InputLine(QLineEdit): def __init__(self, parent=None, width=0, height=0, placeholderText=None): super(QLineEdit, self).__init__() s...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/widgets/loginFrames.py", "copies": "1", "size": "5711", "license": "mit", "hash": 4464577960630639600, "line_mean": 27.1055276382, "line_max": 120, "alpha_frac": 0.6348354793, "autogenerated": false, "ratio": 3.840659340659341, "config...
__author__ = 'cyrbuzz' # 方便扩展,抽象成基类。 from base import (QCursor, QFrame, Qt, QTabWidget, QTextEdit, QLabel, QIcon, QPushButton, QHBoxLayout, QVBoxLayout, QGridLayout, QTableWidgetItem, PicLabel, ScrollArea, TableWidget, VBoxLayout, HBoxLayout, pyqtSignal) import addition class S...
{ "repo_name": "HuberTRoy/MusicPlayer", "path": "MusicPlayer/widgets/singsFrameBase.py", "copies": "1", "size": "8770", "license": "mit", "hash": 4592259841820868600, "line_mean": 31.6117647059, "line_max": 138, "alpha_frac": 0.6465848966, "autogenerated": false, "ratio": 3.2895569620253164, "co...
__author__ = 'cyrfer' # epic pyparsing help provided by Paul McGuire # http://pyparsing.wikispaces.com/share/view/68890534 from ogre_parse.basereader import * from ogre_parse.submodel import * class ReadTextureUnit(ReadBase): def __init__(self): # TODO: need to separate the required member options ...
{ "repo_name": "cyrfer/ogre_parse", "path": "ogre_parse/subreader.py", "copies": "1", "size": "16636", "license": "mit", "hash": 5522130532067399000, "line_mean": 52.8381877023, "line_max": 229, "alpha_frac": 0.5770016831, "autogenerated": false, "ratio": 4.018357487922706, "config_test": false,...
__author__ = 'cyrfer' import array import math import copy def float_eq(a, b, epsilon=1e-7): # print('float_eq: type(a)=%s, type(b)=%s' % (type(a), type(b))) # print('float_eq(%s, %s)' % (a,b)) diff_val = math.fabs(a - b) # print('float_eq: diff_val = %s' % diff_val) return diff_val < epsilon ...
{ "repo_name": "cyrfer/ogre_parse", "path": "ogre_parse/basemodel.py", "copies": "1", "size": "2448", "license": "mit", "hash": -4869784341842968000, "line_mean": 28.1428571429, "line_max": 90, "alpha_frac": 0.5310457516, "autogenerated": false, "ratio": 3.4094707520891365, "config_test": false,...
__author__ = 'cyrfer' # from pyparsing import Optional, Word, Literal, Keyword, Forward, alphas, nums, alphanums, \ # Group, ZeroOrMore, OneOrMore, oneOf, delimitedList, cStyleComment, restOfLine, LineEnd, \ # cppStyleComment, Combine, Dict, dictOf, Regex, Suppress from pyparsing import * # import ogre_pars...
{ "repo_name": "cyrfer/ogre_parse", "path": "ogre_parse/basereader.py", "copies": "1", "size": "3633", "license": "mit", "hash": 4363126430530298000, "line_mean": 32.6388888889, "line_max": 169, "alpha_frac": 0.6710707404, "autogenerated": false, "ratio": 2.8316445830085737, "config_test": false...
__author__ = 'cyrfer' # This file defines 'readers' for the major classes of OGRE objects, including: # - materials # - shader declarations # - compositors # OGRE permits putting any of the major classes into any of the OGRE resource file types, including: # - .material # - .program # - .compositor # Because any scr...
{ "repo_name": "cyrfer/ogre_parse", "path": "ogre_parse/reader.py", "copies": "1", "size": "5640", "license": "mit", "hash": -7213373833509549000, "line_mean": 41.0895522388, "line_max": 148, "alpha_frac": 0.5764184397, "autogenerated": false, "ratio": 4.28246013667426, "config_test": false, "...
__author__ = 'Cyril de Vogelaere : 2814-11-00 & Thuin florian : 0656-11-00' import time import sys from copy import deepcopy from os import listdir, system from search import * # LEFT RIGHT UP DOWN directions = [[0, -1], [0, 1], [-1, 0], [1, 0]] global listOfGoalPos ############### # My function # ############### d...
{ "repo_name": "fthuin/artificial-intelligence", "path": "assignment2/Code/Sokoban.py", "copies": "1", "size": "8588", "license": "mit", "hash": 7897304180310724000, "line_mean": 32.8149606299, "line_max": 198, "alpha_frac": 0.5895435491, "autogenerated": false, "ratio": 3.286643704554152, "conf...
__author__ = 'czervenka' """ Simple database app settings BASIC USE --------- from models.config import settings version = settings['version'] # read settings settings['version'] = '1' # stores settings INITIALIZATION -------------- from models.config import settings settings['version'] = '1' ...
{ "repo_name": "xaralis/gap-sandbox", "path": "src/app/settings.py", "copies": "1", "size": "2302", "license": "apache-2.0", "hash": 2730642240078861000, "line_mean": 24.0217391304, "line_max": 70, "alpha_frac": 0.6068635969, "autogenerated": false, "ratio": 4.074336283185841, "config_test": fal...
__author__ = 'czhuang' import os import cPickle as pickle import numpy as np def is_valid_latin_square(grid): n_row, n_col = grid.shape assert n_row % n_col == 0 quotient = n_row / n_col sum_of_elements = np.sum(np.arange(n_col)) sum_of_col_wanted = quotient * sum_of_elements sum_of_cols = ...
{ "repo_name": "czhuang/ChordRipple", "path": "app/latin_squares_experiment_tools.py", "copies": "1", "size": "2219", "license": "mit", "hash": -5078612588845626000, "line_mean": 27.0886075949, "line_max": 79, "alpha_frac": 0.6349707075, "autogenerated": false, "ratio": 3.5110759493670884, "conf...
__author__ = 'cz' import os import math from vmb_db.conn import get_one from flask import request, redirect, url_for, flash, current_app, abort, render_template from flask.ext.login import login_required, current_user from werkzeug import secure_filename from vmb_db.contact_info import get_contact, get_contact_by_cas...
{ "repo_name": "cindy-zimmerman/vmb-mrest", "path": "flask_mrest/actions/invoice.py", "copies": "1", "size": "2217", "license": "mit", "hash": 6363787196036341000, "line_mean": 40.0555555556, "line_max": 116, "alpha_frac": 0.6580965268, "autogenerated": false, "ratio": 3.4803767660910516, "confi...
__author__ = 'cz' from flask import request, redirect, url_for, flash, current_app, abort, render_template from flask.ext.login import login_required, current_user from vmb_db.contact_info import get_contact, get_contact_by_casillero, set_contact_by_casillero, iter_pages from vmb_db.invoice_info import get_invoice_lis...
{ "repo_name": "cindy-zimmerman/vmb-mrest", "path": "flask_mrest/actions/client.py", "copies": "1", "size": "5538", "license": "mit", "hash": -1712777589072555300, "line_mean": 45.15, "line_max": 112, "alpha_frac": 0.5545323221, "autogenerated": false, "ratio": 3.496212121212121, "config_test": ...
from ps2_1 import evaluate_poly from ps2_2 import compute_deriv def compute_root(poly, x_0, epsilon): """ Uses Newton's Method to find and return a root of polynomial function. Returns a tuple containing the root and the number of iterations required to get the root. Example: >>> poly = (-13.39, 0.0, 17.5, 3....
{ "repo_name": "MarcusHolloway/6.00SC", "path": "ps2_3.py", "copies": "1", "size": "1241", "license": "mit", "hash": -3367153847151883000, "line_mean": 30.025, "line_max": 85, "alpha_frac": 0.6518936342, "autogenerated": false, "ratio": 2.7334801762114536, "config_test": false, "has_no_keyword...
import random import string WORD_LIST = "words.txt" def load_words(): """ Returns a list of valid words. Words are string of lowercase letters. Depending on the size of the word list, this function may take a while to finish. """ print "Loading word list from file..." fin = open(WORD_L...
{ "repo_name": "MarcusHolloway/6.00SC", "path": "ps2_4.py", "copies": "1", "size": "2507", "license": "mit", "hash": 7463818048138955000, "line_mean": 33.3098591549, "line_max": 106, "alpha_frac": 0.5791783008, "autogenerated": false, "ratio": 3.5916905444126073, "config_test": false, "has_no_...
def cal_credit_balance(): outstanding_balance = float(raw_input('Enter the outstanding balance on your credit card:')) annual_interest_rate = float(raw_input('Enter the annual credit card interest rate as decimal:')) min_monthly_payment_rate = float(raw_input('Enter the minimum monthly payment rate as ...
{ "repo_name": "MarcusHolloway/6.00SC", "path": "ps_1a.py", "copies": "1", "size": "1386", "license": "mit", "hash": 2886143291776234500, "line_mean": 38.7647058824, "line_max": 101, "alpha_frac": 0.63997114, "autogenerated": false, "ratio": 3.860724233983287, "config_test": false, "has_no_key...
def cal_min_fixed_monthly_payment(): outstanding_balance = float(raw_input('Enter the outstanding balance on your credit card:')) annual_interest_rate = float(raw_input('Enter the annual credit card interest rate as decimal:')) monthly_interest_rate = annual_interest_rate / 12.0 updated_balance ...
{ "repo_name": "MarcusHolloway/6.00SC", "path": "ps_1b.py", "copies": "1", "size": "1089", "license": "mit", "hash": 35078077625912436, "line_mean": 35.5517241379, "line_max": 101, "alpha_frac": 0.6271808999, "autogenerated": false, "ratio": 3.7294520547945207, "config_test": false, "has_no_ke...
def cal_min_payment(): outstanding_balance = float(raw_input('Enter the outstanding balance on your credit card:')) annual_interest_rate = float(raw_input('Enter the annual credit card interest rate as decimal:')) monthly_interest_rate = annual_interest_rate / 12.0 # New variables e...
{ "repo_name": "MarcusHolloway/6.00SC", "path": "ps_1c.py", "copies": "1", "size": "1650", "license": "mit", "hash": 9053954728276165000, "line_mean": 37.2857142857, "line_max": 101, "alpha_frac": 0.6212121212, "autogenerated": false, "ratio": 3.793103448275862, "config_test": false, "has_no_k...
__author__ = 'Daan Debie' from abc import ABCMeta from abc import abstractmethod from datetime import datetime def datetime_from_http_datestring(datestring): """ Converts a datestring as present in HTTP headers to a python datetime object """ return datetime.strptime(datestring, '%a, %d %b %Y %H:%M:%...
{ "repo_name": "davidsogn/PyPlaylist", "path": "playlist/cache.py", "copies": "1", "size": "2047", "license": "apache-2.0", "hash": 2729936508778319000, "line_mean": 23.6746987952, "line_max": 107, "alpha_frac": 0.6145578896, "autogenerated": false, "ratio": 4.0216110019646365, "config_test": fa...
__author__ = 'Daan Debie' from threading import Thread from Queue import Queue from generator import PlaylistGenerator class PLGeneratorThread(Thread): """ Class that provides threaded playlist generation. It takes one sentence off a queue and processes them. Results are stored in the Thread object itsel...
{ "repo_name": "davidsogn/PyPlaylist", "path": "playlist/plthreading.py", "copies": "1", "size": "2454", "license": "apache-2.0", "hash": 4595702250171069400, "line_mean": 39.2295081967, "line_max": 118, "alpha_frac": 0.7033414833, "autogenerated": false, "ratio": 4.312829525483304, "config_test...
__author__ = 'Daan Wierstra and Tom Schaul' from itertools import chain from scipy import zeros from pybrain.structure.networks.feedforward import FeedForwardNetwork from pybrain.structure.networks.recurrent import RecurrentNetwork from pybrain.structure.modules.neuronlayer import NeuronLayer from pybrain.structure....
{ "repo_name": "jackru/pybrain", "path": "pybrain/structure/networks/neurondecomposable.py", "copies": "25", "size": "4341", "license": "bsd-3-clause", "hash": -1961687884108220700, "line_mean": 36.4224137931, "line_max": 99, "alpha_frac": 0.6178299931, "autogenerated": false, "ratio": 4.255882352...