text
stringlengths
0
1.05M
meta
dict
__author__ = 'adeb' from spynet.models.layer_block import * import spynet.models.neuron_type as neuron_type from spynet.models.layer import * from spynet.models.network import Network class NetworkMNIST(Network): """ 2D convnet for MNIST dataset """ def __init__(self): Network.__init__(self) ...
{ "repo_name": "adbrebs/spynet", "path": "mnist_example/network_mnist.py", "copies": "1", "size": "2786", "license": "bsd-2-clause", "hash": 2977853251196921300, "line_mean": 37.1780821918, "line_max": 101, "alpha_frac": 0.5814788227, "autogenerated": false, "ratio": 3.3688029020556227, "config_...
__author__ = 'adeb' from theano import tensor as T class NeuronType(): """ Abstract class defining a neuron type. This class defines the activation function of the neuron. """ name = None def __init__(self): pass def activation_function(self, x): raise NotImplementedError ...
{ "repo_name": "adbrebs/spynet", "path": "models/neuron_type.py", "copies": "1", "size": "1337", "license": "bsd-2-clause", "hash": -4655806004862658000, "line_mean": 17.5694444444, "line_max": 100, "alpha_frac": 0.5923709798, "autogenerated": false, "ratio": 3.5653333333333332, "config_test": f...
__author__ = 'adeb' # Hack to be able to run this module import sys import os sys.path.insert(0, os.path.abspath('../..')) from shutil import copy2 import inspect from spynet.data.dataset import Dataset from spynet.models.network import * from spynet.models.neuron_type import * from spynet.training.trainer import * f...
{ "repo_name": "adbrebs/spynet", "path": "mnist_example/experiment_mnist_autoencoder.py", "copies": "1", "size": "3612", "license": "bsd-2-clause", "hash": -3795537665780356600, "line_mean": 32.1467889908, "line_max": 113, "alpha_frac": 0.6478405316, "autogenerated": false, "ratio": 3.712230215827...
__author__ = 'adeb' # Hack to be able to run this module import sys import os sys.path.insert(0, os.path.abspath('../..')) from shutil import copy2 import inspect from spynet.utils.utilities import analyse_classes from spynet.data.dataset import Dataset, Scaler from spynet.mnist_example.network_mnist import NetworkMN...
{ "repo_name": "adbrebs/spynet", "path": "mnist_example/experiment_mnist.py", "copies": "1", "size": "3566", "license": "bsd-2-clause", "hash": 5055568935549278000, "line_mean": 31.7247706422, "line_max": 112, "alpha_frac": 0.6561974201, "autogenerated": false, "ratio": 3.761603375527426, "confi...
__author__ = 'adeb' import math import numpy as np import theano.tensor as T from spynet.utils.utilities import share class CostFunction(): """ Cost function used during the training """ def __init__(self): pass def compute_cost_symb(self, pred_batch, tg_batch): """ Compu...
{ "repo_name": "adbrebs/spynet", "path": "training/cost_function.py", "copies": "1", "size": "3287", "license": "bsd-2-clause", "hash": 4222138379884774400, "line_mean": 30.6153846154, "line_max": 91, "alpha_frac": 0.5938545786, "autogenerated": false, "ratio": 3.449108079748164, "config_test": ...
__author__ = 'adeb' import numpy as np from spynet.utils.utilities import distrib_balls_in_bins def create_pick_voxel(config_ini): """ Factory function to create the objects responsible for picking the voxels """ where_vx = config_ini.pick_vx["where"] how_vx = config_ini.pick_vx["how"] if wh...
{ "repo_name": "adbrebs/spynet", "path": "data/utils_3d/pick_voxel.py", "copies": "1", "size": "6036", "license": "bsd-2-clause", "hash": -2254845302011138800, "line_mean": 31.4569892473, "line_max": 116, "alpha_frac": 0.6148111332, "autogenerated": false, "ratio": 3.4890173410404626, "config_te...
__author__ = 'adeb' import numpy as np class ParamSelector(): """ These classes determine on which basis the final trained network is selected. """ def __init__(self): self.best_params = None self.best_iter = None self.net = None def init(self, net): self.net = ne...
{ "repo_name": "adbrebs/spynet", "path": "training/parameters_selector.py", "copies": "1", "size": "1213", "license": "bsd-2-clause", "hash": -5392325664208795000, "line_mean": 27.2325581395, "line_max": 87, "alpha_frac": 0.6248969497, "autogenerated": false, "ratio": 3.8753993610223643, "config...
__author__ = 'adeb' import numpy as np class StoppingCriterion(): """ Abstract class defining a stopping criterion for the trainer """ def __init__(self): pass def init(self): pass def check_if_stop(self, epoch, minibatch_idx, id_minibatch, verbose=True): """ ...
{ "repo_name": "adbrebs/spynet", "path": "training/stopping_criterion.py", "copies": "1", "size": "3216", "license": "bsd-2-clause", "hash": -8398472261639024000, "line_mean": 30.5392156863, "line_max": 117, "alpha_frac": 0.6380597015, "autogenerated": false, "ratio": 4.091603053435114, "config_...
__author__ = 'adeb' import numpy as np def create_pick_features(config): """ Factory function to create the objects responsible for picking the patches """ ls_pick_features = [] for pick_features_dictionary in config.pick_features: ls_pick_features.extend(create_pick_features_from_dict(p...
{ "repo_name": "adbrebs/spynet", "path": "data/utils_3d/pick_patch.py", "copies": "1", "size": "8132", "license": "bsd-2-clause", "hash": -4382058955453157400, "line_mean": 34.3608695652, "line_max": 118, "alpha_frac": 0.6159616331, "autogenerated": false, "ratio": 3.5713658322353976, "config_te...
__author__ = 'adeb' import numpy as np def create_pick_target(config_ini): """ Factory function to the objects responsible for picking the targets """ how_tg = config_ini.pick_tg["how"] if how_tg == "center": pick_tg = PickTgCentered() # elif how_tg == "proportion": # pick_tg ...
{ "repo_name": "adbrebs/spynet", "path": "data/utils_3d/pick_target.py", "copies": "1", "size": "1692", "license": "bsd-2-clause", "hash": -8568619224250286000, "line_mean": 25.873015873, "line_max": 88, "alpha_frac": 0.5644208038, "autogenerated": false, "ratio": 3.2413793103448274, "config_tes...
__author__ = 'adeb' import sys import h5py from spynet.utils.utilities import get_h5file_attribute, error_rate from spynet.models.layer import * from spynet.models.layer_block import * from spynet.models import neuron_type class Network(object): """ Abstract class whose child classes define custom user netw...
{ "repo_name": "adbrebs/spynet", "path": "models/network.py", "copies": "1", "size": "14714", "license": "bsd-2-clause", "hash": 5436671487758694000, "line_mean": 35.3308641975, "line_max": 117, "alpha_frac": 0.5813510942, "autogenerated": false, "ratio": 3.5609874152952568, "config_test": false...
__author__ = 'adeb' import theano.tensor as T class Layer(): """ This abstract class represents a layer of a neural network. A spynet layer is more general than the common definition of a layer of neurons in the sense that a spynet layer is not necessary composed of neurons. As described in the child...
{ "repo_name": "adbrebs/spynet", "path": "models/layer.py", "copies": "1", "size": "4423", "license": "bsd-2-clause", "hash": 764022436158097400, "line_mean": 31.0579710145, "line_max": 118, "alpha_frac": 0.6084105811, "autogenerated": false, "ratio": 3.8030954428202923, "config_test": false, ...
__author__ = 'adeb' import time import numpy as np import theano import theano.tensor as T class Trainer(): """ Class that supervises the training of a neural network. Attributes: net (Network object): the network to be trained ds_training (Dataset object): the dataset on which the netw...
{ "repo_name": "adbrebs/spynet", "path": "training/trainer.py", "copies": "1", "size": "6391", "license": "bsd-2-clause", "hash": 4634555981907628000, "line_mean": 37.9756097561, "line_max": 120, "alpha_frac": 0.612893131, "autogenerated": false, "ratio": 4.104688503532434, "config_test": false,...
__author__ = 'adeb' from datetime import datetime import h5py import numpy as np from spynet.utils.utilities import open_h5file, share class Dataset(object): """ Class to store a dataset composed of two 2D numpy arrays called respectively inputs and outputs. Their rows represent datapoints. inputs' col...
{ "repo_name": "adbrebs/spynet", "path": "data/dataset.py", "copies": "1", "size": "7275", "license": "bsd-2-clause", "hash": -1689261674922278400, "line_mean": 31.3377777778, "line_max": 119, "alpha_frac": 0.6130584192, "autogenerated": false, "ratio": 3.8924558587479936, "config_test": false, ...
__author__ = 'adeb' import numpy as np import theano from theano.tensor.signal import downsample from theano.tensor.nnet import conv, conv3d2d from theano.tensor.shared_randomstreams import RandomStreams from spynet.utils.utilities import share, get_h5file_data from spynet.models.max_pool_3d import max_pool_3d cl...
{ "repo_name": "adbrebs/spynet", "path": "models/layer_block.py", "copies": "1", "size": "12434", "license": "bsd-2-clause", "hash": 3850670920298809000, "line_mean": 32.6081081081, "line_max": 118, "alpha_frac": 0.6126749236, "autogenerated": false, "ratio": 3.6710953646294655, "config_test": f...
__author__ = 'adeksandrcernov' # -*- coding: utf-8 -*- from model.group import Group from random import randrange def test_edit_group_name(app,db): if app.group.count() == 0: app.group.create(Group(name="test")) old_groups = db.get_group_list() index = randrange (len(old_groups...
{ "repo_name": "AlChernoff/python_training", "path": "test/test_edit_group.py", "copies": "1", "size": "1172", "license": "apache-2.0", "hash": 6183812898558406000, "line_mean": 39.4482758621, "line_max": 98, "alpha_frac": 0.6015358362, "autogenerated": false, "ratio": 3.1005291005291005, "confi...
__author__ = 'adeksandrcernov' from model.contact import Contact from random import randrange def test_edit_contact_lastname(app,db): if app.contacts.count() == 0: app.contacts.add_new_contact(Contact(firstname="test",address="test")) old_contacts = db.get_contacts_list() index...
{ "repo_name": "AlChernoff/python_training", "path": "test/test_edit_contact.py", "copies": "1", "size": "1364", "license": "apache-2.0", "hash": 1638336901595803100, "line_mean": 46.0689655172, "line_max": 106, "alpha_frac": 0.6480938416, "autogenerated": false, "ratio": 3.418546365914787, "con...
__author__ = 'adeksandrcernov' from pony.orm import * from datetime import * from model.group import Group from model.contact import Contact from pymysql.converters import decoders class ORMfixture: db = Database() class ORMGroup(db.Entity): _table_ = 'group_list' id = PrimaryKey(int, column...
{ "repo_name": "AlChernoff/python_training", "path": "fixture/orm.py", "copies": "1", "size": "2232", "license": "apache-2.0", "hash": -569014513225881660, "line_mean": 40.3518518519, "line_max": 179, "alpha_frac": 0.6527777778, "autogenerated": false, "ratio": 3.8219178082191783, "config_test":...
__author__ = 'adeksandrcernov' import mysql.connector from model.contact import Contact from model.group import Group class DbFixture: def __init__(self, host, name , user, password): self.host = host self.name = name self.user = user self.password = password self.connect...
{ "repo_name": "AlChernoff/python_training", "path": "fixture/Db.py", "copies": "1", "size": "2024", "license": "apache-2.0", "hash": 3252306621075301000, "line_mean": 38.7058823529, "line_max": 145, "alpha_frac": 0.6032608696, "autogenerated": false, "ratio": 4.06425702811245, "config_test": fa...
__author__ = 'adeksandrcernov' import re from random import randrange from test import test_phones def test_names_on_home_page(app): old_contacts = app.contacts.get_contacts_list() index = randrange (len(old_contacts)) name_from_home_page = app.contacts.get_contacts_list()[index] name_from_edit_page =...
{ "repo_name": "AlChernoff/python_training", "path": "test/test_names.py", "copies": "1", "size": "1169", "license": "apache-2.0", "hash": 4322906921077607400, "line_mean": 40.7857142857, "line_max": 98, "alpha_frac": 0.5782720274, "autogenerated": false, "ratio": 3.585889570552147, "config_test...
__author__ = 'adeksandrcernov' import re from random import randrange def test_phones_on_home_page(app): old_contacts = app.contacts.get_contacts_list() index = randrange (len(old_contacts)) contact_from_home_page = app.contacts.get_contacts_list()[index] contact_from_edit_page = app.contacts.get_con...
{ "repo_name": "AlChernoff/python_training", "path": "test/test_phones.py", "copies": "1", "size": "1470", "license": "apache-2.0", "hash": -6782900777250492000, "line_mean": 44.9375, "line_max": 118, "alpha_frac": 0.674829932, "autogenerated": false, "ratio": 3.259423503325942, "config_test": f...
__author__ = 'adeksandrcernov' from model.group import Group import random import string import os.path import jsonpickle import getopt import sys try: opts,args = getopt.getopt(sys.argv[1:], "n:f:", ["number od groups", "file"]) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f = "d...
{ "repo_name": "AlChernoff/python_training", "path": "generator/group.py", "copies": "1", "size": "1042", "license": "apache-2.0", "hash": -7180291143897491000, "line_mean": 23.8333333333, "line_max": 114, "alpha_frac": 0.6381957774, "autogenerated": false, "ratio": 3.1480362537764353, "config_t...
import json from bs4 import BeautifulSoup import urllib.request import os,sys import time import re import signal from contextlib import contextmanager class TimeoutException(Exception): pass @contextmanager def time_limit(seconds): def signal_handler(signum, frame): raise TimeoutException signal.signal(signal...
{ "repo_name": "vintageplayer/Scrape_Scientific_Journal_Data", "path": "IEEE/src/scrape_v2.py", "copies": "1", "size": "8711", "license": "mit", "hash": 6597323317522951000, "line_mean": 28.1371237458, "line_max": 114, "alpha_frac": 0.613247618, "autogenerated": false, "ratio": 3.1222222222222222,...
import json from bs4 import BeautifulSoup import urllib.request import signal from contextlib import contextmanager class TimeoutException(Exception): pass @contextmanager def time_limit(seconds): def signal_handler(signum, frame): raise TimeoutException signal.signal(signal.SIGALRM, signal_handler) signal.a...
{ "repo_name": "vintageplayer/Scrape_Scientific_Journal_Data", "path": "IEEE/src/scrape_nested.py", "copies": "1", "size": "5375", "license": "mit", "hash": -6904235561784284000, "line_mean": 28.0594594595, "line_max": 103, "alpha_frac": 0.6898604651, "autogenerated": false, "ratio": 3.26747720364...
__author__ = 'adityabhasin' import random from faker import Faker from faker.providers import BaseProvider class TechDataProvider(BaseProvider): base = '"name" : "{{att_name}}", "category" : "{{ cat_name }}", "parameters" : ' # bunch of pattersn for the Item properties. These are randomly chosed per item ...
{ "repo_name": "conlini/h2h", "path": "tech/utilities/_SampleGenerator.py", "copies": "1", "size": "3494", "license": "mit", "hash": -7744425610355364000, "line_mean": 35.0206185567, "line_max": 120, "alpha_frac": 0.6390955924, "autogenerated": false, "ratio": 3.736898395721925, "config_test": f...
###AUTHOR: ADITYA D PAI ###------SCRIPT FOR GEREATING IDEAL INVESTMENTS------- import numpy as np import matplotlib.pyplot as plt from sklearn import svm, preprocessing import pandas as pd from matplotlib import style import statistics from collections import Counter import warnings from sklearn.ensemble import Rando...
{ "repo_name": "aditya-pai/stockPrediction", "path": "get_invests.py", "copies": "1", "size": "3365", "license": "mit", "hash": 3773312737656499700, "line_mean": 26.5819672131, "line_max": 105, "alpha_frac": 0.667756315, "autogenerated": false, "ratio": 3.2957884427032322, "config_test": false, ...
from __future__ import print_function from .common import isvec from .common import ishomog from math import sqrt from numpy import trace from .transforms import * from ..tests.test_common import * from .graphics import * class Quaternion: def __init__(self, s=None, v=None): """ A quaternion is a ...
{ "repo_name": "adityadua24/robopy", "path": "robopy/base/quaternion.py", "copies": "1", "size": "15217", "license": "mit", "hash": 6086196403820201000, "line_mean": 31.4456289979, "line_max": 124, "alpha_frac": 0.5072616153, "autogenerated": false, "ratio": 3.266852726492057, "config_test": tru...
__author__ = 'aditya' import wbdata,datetime,time from flask import session from modules.rpy2_wrap import functions def get_countries(): if 'countries' not in session: session['countries'] = wbdata.get_country(display=False) return session['countries'] def make_key(oldkey): year, id = oldkey[1].y...
{ "repo_name": "ca9/world-stats", "path": "modules/opendataGet/functions.py", "copies": "1", "size": "2783", "license": "mit", "hash": -3853137439785723400, "line_mean": 46.9827586207, "line_max": 117, "alpha_frac": 0.479338843, "autogenerated": false, "ratio": 2.7581764122893953, "config_test":...
__author__ = 'Aditya Vikram Agarwal' import pygame from pygame.locals import * from random import randint import board import scoreboard class Game: def __init__(self, background, quitimage, yes_image, no_image, restart_image): pygame.font.init() self.screen = pygame.display.set_mode((1200, 620),...
{ "repo_name": "adityavagarwal/DonkeyKong", "path": "startGame.py", "copies": "1", "size": "10585", "license": "mpl-2.0", "hash": 8560075543095723000, "line_mean": 38.2037037037, "line_max": 106, "alpha_frac": 0.4752007558, "autogenerated": false, "ratio": 4.283690813435856, "config_test": false...
__author__ = 'Aditya Vikram Agarwal' import pygame from random import randint import random import player import princess import donkey import block import fireball import coin import ladder class Board: def __init__(self, screen, testmode): self.MODE = testmode self.blocks = [] self.ladd...
{ "repo_name": "adityavagarwal/DonkeyKong", "path": "board.py", "copies": "1", "size": "19483", "license": "mpl-2.0", "hash": 7843700141116881000, "line_mean": 42.6838565022, "line_max": 120, "alpha_frac": 0.5339013499, "autogenerated": false, "ratio": 3.5436522371771555, "config_test": false, ...
__author__ = 'Aditya Vikram Agarwal' import pygame import person class Player(person.PersonSprite): def __init__(self, image_left, image_right, image_straight, image_climb, position, width, height, state, lives): person.PersonSprite.__init__(self, image_left, image_right, position, width, height, state) ...
{ "repo_name": "adityavagarwal/DonkeyKong", "path": "player.py", "copies": "1", "size": "1387", "license": "mpl-2.0", "hash": 5243465007668985000, "line_mean": 27.8958333333, "line_max": 116, "alpha_frac": 0.6128334535, "autogenerated": false, "ratio": 3.6693121693121693, "config_test": false, ...
__author__ = 'Aditya Vikram Agarwal' import pygame class ScoreBoard(pygame.sprite.Sprite): def __init__(self, image, text, screen, life_image): font = pygame.font.SysFont("comicsansms", 70) text = font.render(str(text), True, (102, 51, 0)) pygame.sprite.Sprite.__init__(self) self.i...
{ "repo_name": "adityavagarwal/DonkeyKong", "path": "scoreboard.py", "copies": "1", "size": "1440", "license": "mpl-2.0", "hash": 9221288213720448000, "line_mean": 45.4516129032, "line_max": 99, "alpha_frac": 0.5923611111, "autogenerated": false, "ratio": 3.0835117773019274, "config_test": false...
__author__ = 'adiyoss' import os from optparse import OptionParser from lib.textgrid import * def create_text_grid(text_grid_path, label, num_of_frames): """ create TextGrid files from the labels_path file """ # should be different for every file format FRAME_RATE = 10 MILLISEC_2_SEC = 0.001...
{ "repo_name": "adiyoss/DeepWDM", "path": "front_end/lib/text_grid_creation.py", "copies": "1", "size": "1056", "license": "mit", "hash": 8182936792220168000, "line_mean": 34.2333333333, "line_max": 134, "alpha_frac": 0.6799242424, "autogenerated": false, "ratio": 2.823529411764706, "config_test...
__author__ = 'adiyoss' import os import sys from optparse import OptionParser import numpy as np import matplotlib.pyplot as plt NUM_OF_FEATURES = 20 graphIndex = 0 predict_line = 1 label_line = 1 phi_indicator = 0 def on_type(event): global graphIndex global predict_line global label_line global ph...
{ "repo_name": "adiyoss/AutoVowelDuration", "path": "visualization/Python/display_features_and_phi.py", "copies": "1", "size": "5523", "license": "mit", "hash": -8267305431936353000, "line_mean": 37.0965517241, "line_max": 120, "alpha_frac": 0.577584646, "autogenerated": false, "ratio": 3.28163992...
__author__ = 'Administrator' class ListNode: def __init__(self, x): self.val = x self.next = None def merge_list(head1, head2): fakehead = ListNode(0) lastnode = fakehead while head1 != None and head2 != None: if head1.val <= head2.val: lastnode.next = head1 ...
{ "repo_name": "deepbluech/leetcode", "path": "SwordOffer17_MergeList.py", "copies": "1", "size": "1123", "license": "mit", "hash": -8539987394498347000, "line_mean": 23.4347826087, "line_max": 54, "alpha_frac": 0.5983971505, "autogenerated": false, "ratio": 3.1633802816901406, "config_test": fa...
__author__ = 'Administrator' class Solution: # @param A, a list of integers # @param target, an integer to be searched # @return an integer def search(self, A, target): n = len(A) if n == 0: return -1 if n == 1: if A[0] == target: return 0 ...
{ "repo_name": "deepbluech/leetcode", "path": "Search in Rotated Sorted Array.py", "copies": "1", "size": "1768", "license": "mit", "hash": -5065643421320573000, "line_mean": 30.0350877193, "line_max": 64, "alpha_frac": 0.4949095023, "autogenerated": false, "ratio": 3.4263565891472867, "config_t...
__author__ = 'Administrator' # -*- coding:utf-8 -*- #KissPython import atm import sys product_list = [ ("Iphone",4000), ("Computer",5000), ("Coffee",300), ("Fruit",200), ("Mousse",100) ] shopping_list = [] count = 0 while True: index = 1 for i in product_list: print index,i ...
{ "repo_name": "kisspython/atm", "path": "shopping.py", "copies": "1", "size": "1827", "license": "apache-2.0", "hash": -589453120312307500, "line_mean": 29.4909090909, "line_max": 93, "alpha_frac": 0.4788312463, "autogenerated": false, "ratio": 2.9839857651245554, "config_test": false, "has_n...
__author__ = 'Administrator' # -*- coding:utf-8 -*- #KissPython import pickle,time,md5,sys def disk_load(disk_file): with open(disk_file) as fr: return pickle.load(fr) def disk_write(info,disk_file): with open(disk_file,'wb') as fw: pickle.dump(info,fw) def deciphering_md5(password): ret...
{ "repo_name": "kisspython/atm", "path": "atm.py", "copies": "1", "size": "5660", "license": "apache-2.0", "hash": 8397637703270422000, "line_mean": 35.4055944056, "line_max": 82, "alpha_frac": 0.432961967, "autogenerated": false, "ratio": 3.3307741522712733, "config_test": false, "has_no_keyw...
__author__ = 'Administrator' #coding:utf-8 from parseIni import * from parseIniFile import * def test0(): # 一般写法 # f = open("0.ini","rb") # print getValue(f,"global","port"); # f.close() # 自动管理close,try catch [with open as 从python2.5引入(需要通过 from __future__ import with_statement 导入后才可以使用),从 2.6 版本...
{ "repo_name": "xiaomogui/lulu", "path": "PythonObject/ppyconf/start.py", "copies": "2", "size": "1154", "license": "apache-2.0", "hash": -6926260300824765000, "line_mean": 24.675, "line_max": 121, "alpha_frac": 0.5838206628, "autogenerated": false, "ratio": 2.425531914893617, "config_test": fal...
__author__ = 'Administrator' #coding=utf-8 import binascii from parseData.ParseAMF0 import * from linkAMQ.ConnectAMQ import * def send_to_amq(data): print "\nin python function [send_to_amq] : " #得到字符串的字节码数组 #bytes = bytearray(data) #for byte in bytes: #print byte; hex_data = binascii.b2...
{ "repo_name": "xiaomogui/lulu", "path": "PythonObject/ProcessPcapData/processPcapData.py", "copies": "2", "size": "1255", "license": "apache-2.0", "hash": 3857742008065134000, "line_mean": 23.1960784314, "line_max": 85, "alpha_frac": 0.6666666667, "autogenerated": false, "ratio": 2.80865603644646...
__author__ = 'Administrator' #coding=utf-8 import threading from stompy.simple import Client # 单例模式 class ConnectAMQSinleton(object): __instance = None __lock = threading.Lock() # used to synchronize code __stompClient = None # 默认订阅amf_pcap_dataamf_pcap_data队列 __subscribe = '/queue/amf_pcap_data'...
{ "repo_name": "xiaomogui/lulu", "path": "lulu/lulu/python/linkAMQ/ConnectAMQ.py", "copies": "2", "size": "4337", "license": "apache-2.0", "hash": -5810222889464626000, "line_mean": 31.9298245614, "line_max": 98, "alpha_frac": 0.654676259, "autogenerated": false, "ratio": 2.727470930232558, "con...
__author__ = 'Administrator' # -*- coding:utf-8 -*- #KissPython import SocketServer,os,time from db import * class MyServer(SocketServer.BaseRequestHandler): def setup(self): pass def handle(self): while True: # print self.request,self.client_address,self.server #prin...
{ "repo_name": "kisspython/socket-ftp", "path": "server.py", "copies": "1", "size": "4232", "license": "apache-2.0", "hash": 5036930409563591000, "line_mean": 40.9387755102, "line_max": 110, "alpha_frac": 0.4240875912, "autogenerated": false, "ratio": 3.791512915129151, "config_test": false, "...
__author__ = 'Administrator' # -*- coding:utf-8 -*- #KissPython import sys,hashlib,socket,os from db import * ip_port = ('127.0.0.1',21) sk = socket.socket() def info(username): sk.connect(ip_port) while True: input = raw_input("ftp> ").strip() input = input.split() if input[0] == 'e...
{ "repo_name": "kisspython/socket-ftp", "path": "client.py", "copies": "1", "size": "4153", "license": "apache-2.0", "hash": 7094436220044958000, "line_mean": 29.6641221374, "line_max": 92, "alpha_frac": 0.3960667165, "autogenerated": false, "ratio": 4.000996015936255, "config_test": false, "h...
__author__ = 'Administrator' # -*- coding:utf-8 -*- #KissPython import MySQLdb # ftp测试用户名和密码均为kisspython db = MySQLdb.connect( host = '172.16.13.113', user = 'kisspython', passwd = 'kisspython', db = 'kisspython', port = 3306 ) #初始化数据库 def flushdb(): cur = db.cursor() sql = """ c...
{ "repo_name": "kisspython/socket-ftp", "path": "db.py", "copies": "1", "size": "1673", "license": "apache-2.0", "hash": -8632360628358502000, "line_mean": 25.9016393443, "line_max": 96, "alpha_frac": 0.6337599025, "autogenerated": false, "ratio": 3.2303149606299213, "config_test": false, "has...
__author__ = 'Administrator' #coding=utf-8 partLable = ("<",">") sectionLable = ("[","]") endlineLable = "\r\n"# windows下的行标志 #endlineLable = "\n"# linux下的行标志 equalLable = "="# 赋值标志 noteLable = '#'# 注释标志 # 得到总配置的map def getPlatformMap(strtmp,lable1 = partLable,lable2 = sectionLable): tmp = strtmp.split(lable1[0])...
{ "repo_name": "xiaomogui/lulu", "path": "PythonObject/ppyconf/parseIni.py", "copies": "2", "size": "1600", "license": "apache-2.0", "hash": 5308351640195095000, "line_mean": 30.7872340426, "line_max": 68, "alpha_frac": 0.6151271754, "autogenerated": false, "ratio": 2.58477508650519, "config_tes...
__author__ = 'Administrator' from config import * class Runner(pygame.sprite.Sprite): def __init__(self, screen): self.screen = screen pygame.sprite.Sprite.__init__(self) self.image = image1 self.rect = self.image.get_rect() self.rect.x = width/2 self.rect.y = heig...
{ "repo_name": "MasterOfDisguise/runner", "path": "classes.py", "copies": "1", "size": "14312", "license": "mit", "hash": 1164513585669559600, "line_mean": 33.3237410072, "line_max": 136, "alpha_frac": 0.5371017328, "autogenerated": false, "ratio": 3.6772867420349433, "config_test": false, "ha...
__author__ = 'Administrator' from django import template from django.template.loader import get_template from Utils import parsers class ButtonNode(template.Node): def __init__(self, vals): self.action = template.Variable(vals[1]) self.name = template.Variable(vals[2]) def render(self, context)...
{ "repo_name": "ehudmagal/robotqcapp", "path": "kioskApp/templatetags/kioskApp_tags.py", "copies": "2", "size": "1824", "license": "bsd-3-clause", "hash": 5425122783379173000, "line_mean": 34.0769230769, "line_max": 115, "alpha_frac": 0.6957236842, "autogenerated": false, "ratio": 3.58349705304518...
__author__ = 'Administrator' from py4j.java_gateway import JavaGateway, GatewayParameters class HWSRestMethod(object): gateway = JavaGateway(gateway_parameters=GatewayParameters(port=25535)) rest_method_java = gateway.entry_point @staticmethod def get(ak, sk, request_url, service_name, region): ...
{ "repo_name": "Hybrid-Cloud/orchard", "path": "code/hwcloud/java_gateway.py", "copies": "4", "size": "1128", "license": "apache-2.0", "hash": 3394146192442193400, "line_mean": 37.8965517241, "line_max": 100, "alpha_frac": 0.7127659574, "autogenerated": false, "ratio": 3.4922600619195046, "confi...
__author__ = 'Administrator' from PyQt5.QtCore import (QThread,pyqtSignal,QSemaphore,QUrl) from PyQt5.QtNetwork import (QNetworkAccessManager,QNetworkRequest) import requests import xxtea import time import json import random mutex=QSemaphore(20) class SearchThread(QThread): domain = 'kyfw.12306.cn' #请求域名(真实连接地址)...
{ "repo_name": "qhgongzi/xilinTicketV2", "path": "searchthread.py", "copies": "1", "size": "4668", "license": "bsd-3-clause", "hash": -8067277004323722000, "line_mean": 34.2442748092, "line_max": 129, "alpha_frac": 0.6288994801, "autogenerated": false, "ratio": 3.4785229841748304, "config_test":...
__author__ = 'Administrator' import json import time import random from cinder.volume import driver from hwcloud.database_manager import DatabaseManager from hwcloud.hws_service.client import HWSClient from cinder.openstack.common import log as logging from cinder.volume.drivers.hws import sshutils as sshclient from ...
{ "repo_name": "nash-x/hws", "path": "cinder/volume/drivers/hws/__init__.py", "copies": "1", "size": "32642", "license": "apache-2.0", "hash": 468459309570271170, "line_mean": 42.1772486772, "line_max": 120, "alpha_frac": 0.5405612401, "autogenerated": false, "ratio": 3.7911730545876887, "config...
__author__ = 'Administrator' import math import urllib.parse def stringToLongArray(string, includeLength): length = len(string) result = [] i = 0; while (i < length): re = 0 try: re = ord(string[i:i + 1]) re = re | (ord(string[i + 1:i + 2]) << 8) re ...
{ "repo_name": "qhgongzi/xilinTicketV2", "path": "xxtea.py", "copies": "1", "size": "3382", "license": "bsd-3-clause", "hash": -3278317229925475000, "line_mean": 25.2170542636, "line_max": 111, "alpha_frac": 0.4568302779, "autogenerated": false, "ratio": 2.948561464690497, "config_test": false, ...
__author__ = 'Administrator' import pygame import constants from spritesheet_functions import SpriteSheet class Player2(pygame.sprite.Sprite): """ This class represents the bar at the bottom that the player controls. """ # -- Attributes # Set speed vector of player change_x = 0 change_y = 0 ...
{ "repo_name": "saintdragon2/python-3-lecture-2015", "path": "civil_mid_final/10조/x.py", "copies": "1", "size": "7441", "license": "mit", "hash": 263786467389729300, "line_mean": 35.8415841584, "line_max": 88, "alpha_frac": 0.6071764548, "autogenerated": false, "ratio": 3.5705374280230324, "conf...
__author__ = 'Administrator' import requests import xlstr import time class Ticket: #车票信息 train_no = '' station_train_code = '' #车次编号,例如K540 from_station_telecode = '' from_station_name = '' to_station_telecode = '' to_station_name = '' yp_info = '' #未知信息 location_code = '' s...
{ "repo_name": "qhgongzi/xilinTicketV2", "path": "ticket.py", "copies": "1", "size": "1652", "license": "bsd-3-clause", "hash": -6177668610600837000, "line_mean": 34.8409090909, "line_max": 91, "alpha_frac": 0.6218274112, "autogenerated": false, "ratio": 2.8654545454545453, "config_test": false,...
__author__ = 'Administrator' import requests import xlstr import urllib.parse import urllib import xxtea import random import time class C12306: username = '' password = '' domain = 'kyfw.12306.cn' #请求域名(真实连接地址) host='kyfw.12306.cn' #请求的域名(host) http = requests.session() leftTicketUrl="leftTi...
{ "repo_name": "qhgongzi/xilinTicketV2", "path": "c12306.py", "copies": "1", "size": "13728", "license": "bsd-3-clause", "hash": -5554569168633279000, "line_mean": 43.2376237624, "line_max": 137, "alpha_frac": 0.6261563712, "autogenerated": false, "ratio": 3.290940338816597, "config_test": false...
__author__ = 'Administrator' import scrapy from scrapy.spider import BaseSpider from tutorial.items import NjuptItem import logging class njuptSpider(BaseSpider): name = "njupt" allowed_domains = ["njupt.edu.cn"] start_urls = [ "http://news.njupt.edu.cn/s/222/t/1100/p/1/c/6866/i/1/list.htm", ...
{ "repo_name": "xiaokaizh/PythonLearn", "path": "tutorial/tutorial/spiders/schoolnews.py", "copies": "1", "size": "1705", "license": "apache-2.0", "hash": -563866569022816830, "line_mean": 37.7727272727, "line_max": 104, "alpha_frac": 0.5184750733, "autogenerated": false, "ratio": 3.21092278719397...
__author__ = 'Administrator' import traceback import json import time from nova import exception from nova.openstack.common import loopingcall from nova.openstack.common import log as logging from hwcloud.database_manager import DatabaseManager import nova.virt.hws.wormhole_business from nova.virt.hws.wormhole_busines...
{ "repo_name": "nash-x/hws", "path": "nova/virt/hws/hyper_vm_driver.py", "copies": "1", "size": "23615", "license": "apache-2.0", "hash": 4671297391010652000, "line_mean": 50.1168831169, "line_max": 129, "alpha_frac": 0.5875926318, "autogenerated": false, "ratio": 3.8605525584436817, "config_tes...
__author__ = 'Administrator' import yaml import io import h5py import datetime as dt import math import numpy as np import sys, getopt from matplotlib.mlab import psd class FrequencyUtility: def __init__(self): """ Constructor """ def load_data(self, inputFileName): with open(...
{ "repo_name": "SidWatch/pyPSD", "path": "src/PowerSpectrumDensityProcessor.py", "copies": "1", "size": "2916", "license": "mit", "hash": -8238202812672942000, "line_mean": 27.0480769231, "line_max": 95, "alpha_frac": 0.5432098765, "autogenerated": false, "ratio": 3.8828229027962715, "config_tes...
__author__ = 'Administrator' from oslo.config import cfg from heat.engine.resources.hwcloud.hws_service.ecs_service import ECSService from heat.engine.resources.hwcloud.hws_service.evs_service import EVSService from heat.engine.resources.hwcloud.hws_service.ims_service import IMSService from heat.engine.resources.hwcl...
{ "repo_name": "hgqislub/hybird-orchard", "path": "code/hwcloud/hws_service/client.py", "copies": "1", "size": "3289", "license": "apache-2.0", "hash": -5947248428108573000, "line_mean": 43.4594594595, "line_max": 117, "alpha_frac": 0.6752812405, "autogenerated": false, "ratio": 2.667477696674777,...
__author__ = 'Administrator' from oslo.config import cfg from hwcloud.hws_service.ecs_service import ECSService from hwcloud.hws_service.evs_service import EVSService from hwcloud.hws_service.ims_service import IMSService from hwcloud.hws_service.vpc_service import VPCService from hwcloud.hws_service.vbs_service impor...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/client.py", "copies": "1", "size": "3058", "license": "apache-2.0", "hash": -8315673930292457000, "line_mean": 42.7, "line_max": 112, "alpha_frac": 0.6674296926, "autogenerated": false, "ratio": 2.649913344887348, "config_test": false, ...
__author__ = 'Administrator' from PyQt5.QtWidgets import QTableWidget from PyQt5 import QtWidgets from PyQt5 import QtCore from PyQt5 import QtGui from configparser import ConfigParser class TableWidget(QTableWidget): def __init__(self, parent): #QTableWidget.__init__(self, parent) super(TableWid...
{ "repo_name": "qhgongzi/xilinTicketV2", "path": "tablewidget.py", "copies": "1", "size": "4964", "license": "bsd-3-clause", "hash": -61403526855462220, "line_mean": 31.7083333333, "line_max": 126, "alpha_frac": 0.604670913, "autogenerated": false, "ratio": 3.3523131672597866, "config_test": tru...
__author__ = 'Administrator' from stompy.simple import Client from stompy.stomp import * def simple(): # 通过simple方式连接JMS服务器 # 指定hostname和port(tips:ActiveMQ支持多种协议连接stomp协议的默认端口为61613,这里不要写为61616) stomp = Client('192.168.1.166', 61613) #stomp = Client()#如果是ActiveMQ和ActiveMQ客户端(本程序)在同一台机器可使用默认值:hostname=...
{ "repo_name": "SainTestProject/stompy_link_AMQ", "path": "stompy_link_AMQ/connectAMQ.py", "copies": "1", "size": "2245", "license": "apache-2.0", "hash": -4601981624397923300, "line_mean": 27.2, "line_max": 94, "alpha_frac": 0.6523061328, "autogenerated": false, "ratio": 2.559014267185473, "con...
__author__ = 'Administrator' from urlparse import urljoin import json import time #from hwcloud import LOG from heat.openstack.common import log as logging LOG = logging.getLogger(__name__) from heat.engine.resources.hwcloud.java_gateway import HWSRestMethod def retry(times, interval): def _wrapper(f): ...
{ "repo_name": "hgqislub/hybird-orchard", "path": "code/hwcloud/hws_service/__init__.py", "copies": "1", "size": "2879", "license": "apache-2.0", "hash": 5799749079120495000, "line_mean": 31.7272727273, "line_max": 114, "alpha_frac": 0.5811045502, "autogenerated": false, "ratio": 3.691025641025641...
__author__ = 'Administrator' from urlparse import urljoin import json import time from hwcloud import LOG from hwcloud.java_gateway import HWSRestMethod def retry(times, interval): def _wrapper(f): def __wrapper(*args, **kwargs): timer = 0 while(True): response = ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/__init__.py", "copies": "1", "size": "2536", "license": "apache-2.0", "hash": -3089987130460696600, "line_mean": 30.7125, "line_max": 114, "alpha_frac": 0.5638801262, "autogenerated": false, "ratio": 3.7514792899408285, "config_test": fal...
__author__ = 'Administrator' import json from heat.engine.resources.hwcloud.hws_service import HWSService class EVSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(EVSService, self).__init__(ak, sk, 'EVS', region, protocol, host, port) def list(self, project_id, o...
{ "repo_name": "hgqislub/hybird-orchard", "path": "code/hwcloud/hws_service/evs_service.py", "copies": "1", "size": "4462", "license": "apache-2.0", "hash": -8501975692460959000, "line_mean": 28.9530201342, "line_max": 138, "alpha_frac": 0.4784849843, "autogenerated": false, "ratio": 3.60711398544...
__author__ = 'Administrator' import json from heat.engine.resources.hwcloud.hws_service import HWSService class ECSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(ECSService, self).__init__(ak, sk, 'ECS', region, protocol, host, port) def list(self, project_id, ...
{ "repo_name": "Hybrid-Cloud/cloud_manager", "path": "code/hwcloud/hws_service/ecs_service.py", "copies": "2", "size": "14152", "license": "apache-2.0", "hash": -1633222104952285700, "line_mean": 32.4562647754, "line_max": 163, "alpha_frac": 0.4810627473, "autogenerated": false, "ratio": 3.7648310...
__author__ = 'Administrator' import json from heat.engine.resources.hwcloud.hws_service import HWSService class IMSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(IMSService, self).__init__(ak, sk, 'IMS', region, protocol, host, port) def list(self, name=None): ...
{ "repo_name": "hgqislub/hybird-orchard", "path": "code/hwcloud/hws_service/ims_service.py", "copies": "1", "size": "1552", "license": "apache-2.0", "hash": 1848388410172251600, "line_mean": 27.2363636364, "line_max": 85, "alpha_frac": 0.5702319588, "autogenerated": false, "ratio": 3.4109890109890...
__author__ = 'Administrator' import json from heat.engine.resources.hwcloud.hws_service import HWSService class VBSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(VBSService, self).__init__(ak, sk, 'VPC', region, protocol, host, port) def create_backup(self, pro...
{ "repo_name": "Hybrid-Cloud/cloud_manager", "path": "code/hwcloud/hws_service/vbs_service.py", "copies": "3", "size": "2195", "license": "apache-2.0", "hash": -3324985466395946500, "line_mean": 30.3571428571, "line_max": 102, "alpha_frac": 0.474715262, "autogenerated": false, "ratio": 4.027522935...
__author__ = 'Administrator' import json from heat.engine.resources.hwcloud.hws_service import HWSService class VPCService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(VPCService, self).__init__(ak, sk, 'VPC', region, protocol, host, port) def list_vpc(self, project_...
{ "repo_name": "hgqislub/hybird-orchard", "path": "code/hwcloud/hws_service/vpc_service.py", "copies": "1", "size": "18665", "license": "apache-2.0", "hash": -3385705767318458400, "line_mean": 34.3522727273, "line_max": 89, "alpha_frac": 0.4543798553, "autogenerated": false, "ratio": 3.46032628846...
__author__ = 'Administrator' import json from hwcloud.hws_service import HWSService from hwcloud.hws_service import uri as hws_uri class ECSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(ECSService, self).__init__(ak, sk, 'ECS', region, protocol, host, port) def...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/ecs_service.py", "copies": "1", "size": "16467", "license": "apache-2.0", "hash": -8155163708523457000, "line_mean": 36.7683486239, "line_max": 163, "alpha_frac": 0.4723993441, "autogenerated": false, "ratio": 3.719674723288909, "config_t...
__author__ = 'Administrator' import json from hwcloud.hws_service import HWSService from hwcloud.hws_service.uri import EVS as evs_uri class EVSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(EVSService, self).__init__(ak, sk, 'EVS', region, protocol, host, port) ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/evs_service.py", "copies": "1", "size": "4569", "license": "apache-2.0", "hash": 1625309150355372800, "line_mean": 29.4666666667, "line_max": 138, "alpha_frac": 0.4909170497, "autogenerated": false, "ratio": 3.583529411764706, "config_tes...
__author__ = 'Administrator' import json from hwcloud.hws_service import HWSService from hwcloud.hws_service.uri import IMS as ims_uri class IMSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(IMSService, self).__init__(ak, sk, 'IMS', region, protocol, host, port) ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/ims_service.py", "copies": "1", "size": "1536", "license": "apache-2.0", "hash": 3991511812907292000, "line_mean": 27.462962963, "line_max": 85, "alpha_frac": 0.5885416667, "autogenerated": false, "ratio": 3.375824175824176, "config_test"...
__author__ = 'Administrator' import json from hwcloud.hws_service import HWSService from hwcloud.hws_service.uri import VBS as vbs_uri class VBSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(VBSService, self).__init__(ak, sk, 'VPC', region, protocol, host, port) ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/vbs_service.py", "copies": "1", "size": "2279", "license": "apache-2.0", "hash": 5480833994361490000, "line_mean": 31.5571428571, "line_max": 102, "alpha_frac": 0.4923211935, "autogenerated": false, "ratio": 3.9773123909249564, "config_te...
__author__ = 'Administrator' import json from hwcloud.hws_service import HWSService from hwcloud.hws_service.uri import VPC as vpc_uri class VPCService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(VPCService, self).__init__(ak, sk, 'VPC', region, protocol, host, port) ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/vpc_service.py", "copies": "1", "size": "6077", "license": "apache-2.0", "hash": 8203170583980075000, "line_mean": 33.5284090909, "line_max": 95, "alpha_frac": 0.4670067468, "autogenerated": false, "ratio": 3.3723640399556047, "config_tes...
__author__ = 'Administrator' import sqlite3 import sys import os import traceback import time #from hwcloud import LOG from heat.openstack.common import log as logging LOG = logging.getLogger(__name__) TIMES = 50 INTERVAL = 0.1 def retry(times, interval): def _wrapper(f): def __wrapper(*args, **kwargs...
{ "repo_name": "Hybrid-Cloud/orchard", "path": "code/hwcloud/database_manager.py", "copies": "2", "size": "17589", "license": "apache-2.0", "hash": -8404873660204930000, "line_mean": 36.2648305085, "line_max": 145, "alpha_frac": 0.6042981409, "autogenerated": false, "ratio": 3.519911947168301, "...
__author__ = 'Administrator' import sqlite3 import sys import os import traceback import time from hwcloud import LOG TIMES = 50 INTERVAL = 0.1 def retry(times, interval): def _wrapper(f): def __wrapper(*args, **kwargs): timer = 0 while(True): try: ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/database_manager.py", "copies": "1", "size": "17502", "license": "apache-2.0", "hash": -3169718230779795000, "line_mean": 36.3995726496, "line_max": 145, "alpha_frac": 0.6036452977, "autogenerated": false, "ratio": 3.5186972255729794, "config_test": ...
__author__ = 'Administrator' import sqlite3 import sys import os import traceback import time from log import LOG TIMES = 50 INTERVAL = 0.1 def retry(times, interval): def _wrapper(f): def __wrapper(*args, **kwargs): timer = 0 while(True): try: ...
{ "repo_name": "hgqislub/hybird-orchard", "path": "etc/hybrid_cloud/scripts/patches/patches_tool/hws_patch/database_manager.py", "copies": "1", "size": "17498", "license": "apache-2.0", "hash": 910259930782546600, "line_mean": 36.391025641, "line_max": 145, "alpha_frac": 0.603554692, "autogenerated"...
__author__ = 'Administrator' import time import traceback from functools import wraps from wormholeclient.client import Client from wormholeclient import constants as wormhole_constants from nova.virt.hws.exception_ex import RetryException from nova.openstack.common import log as logging LOG = logging.getLogger(__na...
{ "repo_name": "nash-x/hws", "path": "nova/virt/hws/wormhole_business.py", "copies": "1", "size": "15064", "license": "apache-2.0", "hash": 6840891618695736000, "line_mean": 42.4149855908, "line_max": 156, "alpha_frac": 0.5485262878, "autogenerated": false, "ratio": 3.898550724637681, "config_te...
__author__ = 'Administrator' import time import traceback from functools import wraps from wormholeclient.client import Client from wormholeclient import constants as wormhole_constants from jacket.compute.exception import * from oslo_log import log as logging LOG = logging.getLogger(__name__) class RetryDecora...
{ "repo_name": "HybridF5/jacket", "path": "jacket/worker/hypercontainer/wormhole_business.py", "copies": "1", "size": "9146", "license": "apache-2.0", "hash": 5580152488077610000, "line_mean": 42.7607655502, "line_max": 108, "alpha_frac": 0.5770828778, "autogenerated": false, "ratio": 4.2381835032...
__author__ = 'Administrator' import unittest import javabridge from TASSELpy.TASSELbridge import TASSELbridge try: try: javabridge.get_env() except AttributeError: print("AttributeError: start bridge") TASSELbridge.start() except AssertionError: print("AssertionError: start...
{ "repo_name": "er432/TASSELpy", "path": "TASSELpy/test/net/maizegenetics/taxa/TaxaListBuilderTest.py", "copies": "1", "size": "2311", "license": "bsd-3-clause", "hash": 1726566225332323600, "line_mean": 32.0142857143, "line_max": 90, "alpha_frac": 0.665512765, "autogenerated": false, "ratio": 3.3...
__author__ = 'Administrator' VERSION_1 = 'v1' VERSION_2 = 'v2' URI_SPE = '/' REPLACE_SERVER_ID = '{server_id}' REPLACE_DETACHMENT_ID = '{detachment_id}' class ECS(object): COMPOSITE_INTERFACE_ECS_PREFIX = "/%s/{project_id}/cloudservers" % VERSION_1 NATIVE_OPENSTACK_ECS_PREFIX = "/%s/{project_id}/servers" % ...
{ "repo_name": "nash-x/hws", "path": "hwcloud/hws_service/uri.py", "copies": "1", "size": "4269", "license": "apache-2.0", "hash": 3775147479689216000, "line_mean": 30.3897058824, "line_max": 124, "alpha_frac": 0.688451628, "autogenerated": false, "ratio": 2.904081632653061, "config_test": false...
__author__ = 'Administrator' from django.db import models class Product(models.Model): title = models.CharField(max_length=100, blank=False, unique=True) description = models.TextField() image_url = models.URLField(max_length=200) price = models.DecimalField(max_digits=8, decimal_places=1) ...
{ "repo_name": "HarrisonHDU/myerp", "path": "apps/depot/models.py", "copies": "1", "size": "1639", "license": "mit", "hash": 9124463774526781000, "line_mean": 24.0158730159, "line_max": 93, "alpha_frac": 0.6351433801, "autogenerated": false, "ratio": 3.911694510739857, "config_test": false, "h...
__author__ = 'Administrator' from django.http import HttpResponse from django.utils import simplejson from django.shortcuts import render_to_response from datetime import datetime from survey.forms import * from util import * from survey.models import * def showIP(request): if request.POST: cont...
{ "repo_name": "sfdye/ntusurvey", "path": "survey/cxq_views.py", "copies": "2", "size": "11779", "license": "mit", "hash": -2122918005494047000, "line_mean": 40.3705035971, "line_max": 126, "alpha_frac": 0.5810340436, "autogenerated": false, "ratio": 4.178432068109259, "config_test": false, "h...
__author__ = 'Administrator' from django.utils import encoding def intval(x, default=0): ''' convert str to int value. Returns: int ''' if not x or not str(x).isdigit(): return default return int(x) def start_limit(request, limit_default=0): ''' from HttpRequs...
{ "repo_name": "HarrisonHDU/myerp", "path": "apps/sims/tools/helper.py", "copies": "1", "size": "1711", "license": "mit", "hash": -5844547648495078000, "line_mean": 21.6142857143, "line_max": 81, "alpha_frac": 0.5741974561, "autogenerated": false, "ratio": 3.4978813559322033, "config_test": fals...
__author__ = 'Administrator' from Tkinter import * class Application(Frame): def say_hi(self): print "hi there, everyone!" def createWidgets(self): self.QUIT = Button(self) self.QUIT["text"] = "QUIT" self.QUIT["fg"] = "red" self.QUIT["command"] = self.quit...
{ "repo_name": "nash-x/mini-game", "path": "tetris/test_tkinter.py", "copies": "1", "size": "1025", "license": "apache-2.0", "hash": -806811758441642500, "line_mean": 25.0263157895, "line_max": 57, "alpha_frac": 0.5502439024, "autogenerated": false, "ratio": 3.349673202614379, "config_test": fal...
__author__ = 'Administrator' import json from django.core.serializers import serialize from django.db.models.query import QuerySet, ValuesQuerySet from django.db.models import Model import decimal import sys import datetime from erp import settings from django import http class DjangoJSONEncoder(json.JSON...
{ "repo_name": "HarrisonHDU/myerp", "path": "apps/sims/tools/tool.py", "copies": "1", "size": "1403", "license": "mit", "hash": -4942612856945218000, "line_mean": 31.4047619048, "line_max": 79, "alpha_frac": 0.612259444, "autogenerated": false, "ratio": 4.066666666666666, "config_test": false, ...
__author__ = 'Administrator' import json from django.db.models.query import QuerySet, ValuesQuerySet from django.db.models import Model import decimal import datetime from erp import settings from django import http class DjangoJSONEncoder(json.JSONEncoder): def default(self, o): if isinstance...
{ "repo_name": "HarrisonHDU/myerp", "path": "apps/myerp/tools/tool.py", "copies": "1", "size": "3195", "license": "mit", "hash": -464234936598865860, "line_mean": 31.0348837209, "line_max": 93, "alpha_frac": 0.551602677, "autogenerated": false, "ratio": 2.9758909853249476, "config_test": false, ...
__author__ = 'Administrator' import os class GtConfig: def __init__(self): pass @staticmethod def isPushSingleBatchAsync(): return os.getenv("gexin_pushSingleBatch_needAsync", False) @staticmethod def isPushListAsync(): return os.getenv("gexin_pushList_needA...
{ "repo_name": "jerryjobs/thirdpartPushSystem", "path": "push/getui/GtConfig.py", "copies": "2", "size": "3235", "license": "apache-2.0", "hash": 6653030507669488000, "line_mean": 29.7156862745, "line_max": 87, "alpha_frac": 0.5740340031, "autogenerated": false, "ratio": 4.053884711779449, "conf...
__author__ = 'Administrator' import sqlite3 import sys import os import traceback import time from log import LOG TIMES = 50 INTERVAL = 0.1 def retry(times, interval): def _wrapper(f): def __wrapper(*args, **kwargs): timer = 0 while(True): try: ...
{ "repo_name": "Hybrid-Cloud/orchard", "path": "etc/hybrid_cloud/scripts/patches/patches_tool/hws_patch/database_manager.py", "copies": "2", "size": "17965", "license": "apache-2.0", "hash": 4760243431761704000, "line_mean": 36.391025641, "line_max": 145, "alpha_frac": 0.5878652936, "autogenerated":...
__author__ = 'Administrator' def __intval(x, default=0): """ convert str to int value. Returns: int """ if not x or not str(x).isdigit(): return default return int(x) def __decorator_boolval(fn): """ 将形如'true' 或 'false'的字符串装换为 Python中的布尔值,如果不是则返回原值 """ def wrapper(*args, **kw...
{ "repo_name": "HarrisonHDU/myerp", "path": "apps/myerp/tools/helper.py", "copies": "1", "size": "3167", "license": "mit", "hash": -1200822336178941400, "line_mean": 29.5376344086, "line_max": 107, "alpha_frac": 0.5991129307, "autogenerated": false, "ratio": 3.0917721518987342, "config_test": fa...
__author__ = 'admin' #cepas=['2Ddes', '3PCE1s', '2Dmes', '2DP7s', '2Dres', '2LMGs', '2PCESs', '2PCP1s' , '2TCPAs', '2Y51s', '3LBEs', 'DCB2s', 'DhaTCE1_proteomes.txt' ] names=['Desulfitobacterium dehalogenans ATCC 51507', 'Desulfitobacterium sp. PCE1','Desulfitobacterium metallireducens DSM 15288', 'Desulfitobacterium h...
{ "repo_name": "elecabfer/OMA_github", "path": "oma_desulfito.py", "copies": "1", "size": "2464", "license": "mit", "hash": 5721805152057544000, "line_mean": 40.7796610169, "line_max": 511, "alpha_frac": 0.6059253247, "autogenerated": false, "ratio": 2.6240681576144835, "config_test": false, "...
from django import forms from MyRangoApp.models import Page, Category class CategoryForm(forms.ModelForm): name = forms.CharField(max_length=128, help_text="Please enter the category name.") views = forms.IntegerField(widget=forms.HiddenInput(), initial=0) likes = forms.IntegerField(widget=forms.HiddenInpu...
{ "repo_name": "octobertech/MyRangoApp", "path": "MyRangoApp/forms.py", "copies": "1", "size": "1555", "license": "apache-2.0", "hash": 6230676910855355000, "line_mean": 37.875, "line_max": 92, "alpha_frac": 0.6578778135, "autogenerated": false, "ratio": 4.157754010695188, "config_test": false, ...
__author__ = 'admin' import os from subprocess import call,Popen import subprocess from multiprocessing import Process import multiprocessing import re import traceback try: import urllib.request as urllib2 except ImportError: import urllib2 import logging from glob import glob import json from webmocker.mock_...
{ "repo_name": "sheltonpaul89/web-mocker3", "path": "webmocker/mock_helper/pretend_helpers.py", "copies": "1", "size": "5754", "license": "bsd-2-clause", "hash": -7198610692691711000, "line_mean": 36.6078431373, "line_max": 160, "alpha_frac": 0.6472019465, "autogenerated": false, "ratio": 3.627994...
__author__ = 'admin' import os from subprocess import call,Popen import subprocess from multiprocessing import Process import multiprocessing import re import urllib2 import logging import HttpMock import MockRequest,MockResponse from glob import glob import json from webmocker.mock_helper import pretender_defaults L...
{ "repo_name": "sheltonpaul89/web-mocker", "path": "webmocker/mock_helper/pretend_helpers.py", "copies": "1", "size": "5696", "license": "bsd-2-clause", "hash": 6915841093868510000, "line_mean": 37.7482993197, "line_max": 160, "alpha_frac": 0.6523876404, "autogenerated": false, "ratio": 3.52912019...
import os def populate(): python_cat = add_cat(name='Python', views=128, likes=64) add_page(cat=python_cat, title="Official Python Tutorial", url="http://docs.python.org/2/tutorial/") add_page(cat=python_cat, title="How to Think li...
{ "repo_name": "octobertech/MyRangoApp", "path": "populate_myrangoapp.py", "copies": "1", "size": "2021", "license": "apache-2.0", "hash": 8210041294670596000, "line_mean": 29.1791044776, "line_max": 86, "alpha_frac": 0.5888174171, "autogenerated": false, "ratio": 3.4196277495769882, "config_tes...
__author__ = 'Admin' import utils as john # list of holes in Complete_Geophysics.csv # ['DD0509' 'DD0541' 'DD0542' 'DD0544' 'DD0551' 'DD0473' 'DD0409' 'DD0415' # 'DD0980A' 'DD0989' 'DD1000' 'DD0991' 'DD1006' 'DD1005' 'DD1010' 'DD0992' # 'DD1012' 'DD1013' 'DD1014' 'DD1070' 'DD1073' 'DD1077' 'DD1080' 'DD1081' # 'DD1...
{ "repo_name": "johnny555/2d3g", "path": "main.py", "copies": "1", "size": "5336", "license": "bsd-2-clause", "hash": -6046389166866133000, "line_mean": 27.5347593583, "line_max": 139, "alpha_frac": 0.5708395802, "autogenerated": false, "ratio": 2.7058823529411766, "config_test": false, "has_n...
__author__ = 'admin' class ContactHelper: def __init__(self, app): self.app = app def create(self, contact): self.fill_contact_fields(contact) def modify(self, contact): # modify contact self.click_edit_button() self.fill_contact_fields(contact) def set_field_...
{ "repo_name": "dimchenkoAlexey/python_training", "path": "fixture/contact.py", "copies": "1", "size": "3347", "license": "apache-2.0", "hash": 5989230038582148000, "line_mean": 38.8452380952, "line_max": 94, "alpha_frac": 0.6187630714, "autogenerated": false, "ratio": 3.4187946884576097, "confi...
__author__ = 'admin' class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd self.app.navigation.open_home_page() # login wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear() ...
{ "repo_name": "dimchenkoAlexey/python_training", "path": "fixture/session.py", "copies": "1", "size": "1420", "license": "apache-2.0", "hash": 5658171582653878000, "line_mean": 29.8695652174, "line_max": 89, "alpha_frac": 0.5535211268, "autogenerated": false, "ratio": 3.429951690821256, "config...
__author__ = 'admin' import json import os from glob import glob import logging import time import webmocker.mock_helper.pretender_defaults import webmocker.mock_helper.pretend_helpers from webmocker.mock_helper import HttpMock, pretender_defaults,MockRequest,MockResponse, pretend_helpers LOGGER = logging.getLogger...
{ "repo_name": "sheltonpaul89/web-mocker", "path": "webmocker/stubbing_engine.py", "copies": "1", "size": "1057", "license": "bsd-2-clause", "hash": 8382540957883044000, "line_mean": 32.03125, "line_max": 129, "alpha_frac": 0.7492904447, "autogenerated": false, "ratio": 3.3662420382165603, "conf...
__author__ = 'admin' import ply.lex as lex PYTHON_KEYWORDS = [ 'and' , 'as' , 'assert' , 'break' , 'class' , 'continue' , 'def' , 'del' , 'elif' , 'else' , 'except' , 'exec' , 'finally' , 'for' , 'from' , 'global' , 'if' , 'import' , 'in' ...
{ "repo_name": "sayon/ignoreme", "path": "tokenizers/pythonlex/pythonsmartlex.py", "copies": "1", "size": "2427", "license": "mit", "hash": -6976706903152421000, "line_mean": 20.6785714286, "line_max": 81, "alpha_frac": 0.4857849197, "autogenerated": false, "ratio": 3.2446524064171123, "config_t...
__author__ = 'admin' import urllib2, base64 from models import AccountStatement CHARGES_DICTIONARY = { # Colegiatura '3010': 'Tuition', '5510': 'Tuition', '5520': 'Tuition', '5550': 'Tuition', '8010': 'Tuition', '9010': 'Tuition', '9020': 'Tuition', '9050': 'Tuition', '9101': '...
{ "repo_name": "EnriqueRE/Estado-de-Cuenta", "path": "Transaction Uploader/StatementProcessor.py", "copies": "1", "size": "4586", "license": "apache-2.0", "hash": -1618125944888663800, "line_mean": 36.9090909091, "line_max": 90, "alpha_frac": 0.4925861317, "autogenerated": false, "ratio": 3.923011...