text
stringlengths
0
1.05M
meta
dict
__author__ = 'palmer' def nosmooth(mzs,intensities): return intensities def sg_smooth(mzs,intensities,n_smooth=1,w_size=5): import scipy.signal as signal for n in range(0,n_smooth): intensities = signal.savgol_filter(intensities,w_size,2) intensities[intensities<0]=0 return intensities de...
{ "repo_name": "andy-d-palmer/pyMS", "path": "smoothing.py", "copies": "1", "size": "1335", "license": "apache-2.0", "hash": 1376990448919979300, "line_mean": 32.375, "line_max": 84, "alpha_frac": 0.6988764045, "autogenerated": false, "ratio": 2.59727626459144, "config_test": false, "has_no_ke...
__author__ = 'palmer' def hdf5_centroids_IMS(input_filename, output_filename): # Convert hdf5 to imzML imsDataset = inMemoryIMS(input_filename,cache_spectra=False,do_summary=False) coords = imsDataset.coords coords -= np.amin(coords, axis=0) step = [] for i in range(3): u = list(np.dif...
{ "repo_name": "andy-d-palmer/pyIMS", "path": "pyImagingMSpec/convert/hdf5.py", "copies": "2", "size": "1833", "license": "apache-2.0", "hash": -6520832026413412000, "line_mean": 39.7555555556, "line_max": 95, "alpha_frac": 0.6164757229, "autogenerated": false, "ratio": 3.1549053356282273, "conf...
__author__ = 'Pamungkas Jayuda' from rest_framework import serializers <<<<<<< HEAD from MASTER.models import Kecamatan, Kelurahan, Kabupaten, Provinsi, Dusun ======= from MASTER.models import Kecamatan, Kelurahan, Kabupaten, Provinsi, Dusun, Peralatan >>>>>>> 58d9661c466c7b4de1d8096096fb78de7020e426 class Provinsi...
{ "repo_name": "ThinkBuntu/rembugdesa", "path": "MASTER/serializers.py", "copies": "1", "size": "1590", "license": "mit", "hash": -732903850387228000, "line_mean": 23.4615384615, "line_max": 85, "alpha_frac": 0.6088050314, "autogenerated": false, "ratio": 3.3333333333333335, "config_test": false...
__author__ = "Panagiotis Garefalakis" __copyright__ = "Imperial College London" # The MIT License (MIT) # # Copyright (c) 2016 Panagiotis Garefalakis # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the...
{ "repo_name": "pgaref/memcached_bench", "path": "Python_plots/plots/utilisation/memory/cluster_mem.py", "copies": "1", "size": "4481", "license": "mit", "hash": 223676992876890270, "line_mean": 34.2834645669, "line_max": 117, "alpha_frac": 0.6621289891, "autogenerated": false, "ratio": 3.32171979...
__author__ = 'pandazxx' from u115 import API import logging import os import time import sys logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) print "Please input username:" username = sys.stdin.readline().rstrip("\n") password = sys.stdin.readline().rstrip("\n") remote_path = "tobe_d...
{ "repo_name": "pandazxx/115machine", "path": "demo.py", "copies": "1", "size": "1867", "license": "bsd-2-clause", "hash": 5913256662915439000, "line_mean": 22.9358974359, "line_max": 87, "alpha_frac": 0.6673808249, "autogenerated": false, "ratio": 3.4194139194139193, "config_test": false, "ha...
#time complexity: O(length(string) + length(pattern)) #space complexity: O(length(string) + length(pattern)) #Link to theory: http://www.geeksforgeeks.org/z-algorithm-linear-time-pattern-searching-algorithm/ def z_algo(arr): z = [0 for i in range(len(arr))] left , right = 0 , 0 for k in range(1 , len(ar...
{ "repo_name": "mission-peace/interview", "path": "python/string/Z_Algorithm.py", "copies": "1", "size": "1438", "license": "apache-2.0", "hash": 3437119531827462700, "line_mean": 25.6296296296, "line_max": 98, "alpha_frac": 0.4826147427, "autogenerated": false, "ratio": 3.431980906921241, "conf...
__author__ = 'pankaj' import threading import time import psycopg2 conn= psycopg2.connect(dbname='devikadb', user='devikatest1', password='asdf1234',host='localhost') cur=conn.cursor() exit_thread=0 class myThread (threading.Thread): def __init__(self, threadID, name, counter): threading.Thread.__init_...
{ "repo_name": "pankajanand18/python-tests", "path": "databasetest.py", "copies": "1", "size": "1747", "license": "mit", "hash": 4190953492921532000, "line_mean": 22.2933333333, "line_max": 99, "alpha_frac": 0.6307956497, "autogenerated": false, "ratio": 3.4870259481037924, "config_test": true, ...
__author__ = 'pankaj' class HeapNode(object): def __init__(self,data): self.data= data self.count = 0 self.nodeLocation = None class Heap(object): capacity=10 def __init__(self): self.nodes=[None] * (Heap.capacity+1) self.size= 1 def maxHeapify(self,index): ...
{ "repo_name": "pankajanand18/python-tests", "path": "trees/word_count_heap.py", "copies": "1", "size": "3430", "license": "mit", "hash": 8847618788975076000, "line_mean": 23.8550724638, "line_max": 86, "alpha_frac": 0.5647230321, "autogenerated": false, "ratio": 3.7816979051819186, "config_test...
__author__ = 'pankaj' def getPallindromeCount(string): mid=0 right=0 left=0 counter =0 longest_length=0 while mid < len(string): right=mid left=mid found = True while right >=0 and left < len(string): if string[right] == string[left]: ...
{ "repo_name": "pankajanand18/python-tests", "path": "trees/pallindrome_count.py", "copies": "1", "size": "1211", "license": "mit", "hash": -5216490927087861000, "line_mean": 18.2222222222, "line_max": 50, "alpha_frac": 0.4616019818, "autogenerated": false, "ratio": 4.190311418685121, "config_te...
# this is an example of overiding and concept of super in python class Contact(): all_contacts= list() def __init__(self,name,email): self.name = name self.email = email Contact.all_contacts.append(self) def try0(self): print("hi im inside the contacts class") d...
{ "repo_name": "PankeshGupta/pynotes", "path": "overiding_super.py", "copies": "1", "size": "1291", "license": "mit", "hash": 7200767046025358000, "line_mean": 25.3469387755, "line_max": 83, "alpha_frac": 0.6057319907, "autogenerated": false, "ratio": 3.3187660668380463, "config_test": false, ...
__author__ = 'panzer' from swampy.TurtleWorld import * from math import pi def initTurtle(delay = 0.01): """ Initializes a turtle object :param delay: Delay before each action of the turtle. Lower it is the faster the turtle moves. :return: turtle object """ TurtleWorld() t = Turtle() t.delay = delay ...
{ "repo_name": "BigFatNoob-NCSU/x9115george2", "path": "hw/code/2/4_2.py", "copies": "1", "size": "2151", "license": "mit", "hash": 6295447243968492000, "line_mean": 19.6923076923, "line_max": 96, "alpha_frac": 0.6336587634, "autogenerated": false, "ratio": 3.0253164556962027, "config_test": fal...
__author__ = 'panzer' from swampy.TurtleWorld import * from math import radians, sin def initTurtle(delay = 0.01): """ Initializes a turtle object :param delay: Delay before each action of the turtle. Lower it is the faster the turtle moves. :return: turtle object """ TurtleWorld() t = Turtle() t.delay...
{ "repo_name": "BigFatNoob-NCSU/x9115george2", "path": "hw/code/2/4_3.py", "copies": "1", "size": "1206", "license": "mit", "hash": 2151840518107612400, "line_mean": 21.3518518519, "line_max": 96, "alpha_frac": 0.6384742952, "autogenerated": false, "ratio": 2.817757009345794, "config_test": fals...
__author__ = 'panzer' import sys, os sys.path.append(os.path.abspath(".")) from utils.lib import O class BinaryTree(O): def __init__(self): """ Points to root of the tree and number of children under it :return: """ O.__init__(self) self.n = 0 self.left = None self.right = None def...
{ "repo_name": "bigfatnoob/optima", "path": "algorithms/gale/binary_tree.py", "copies": "1", "size": "1456", "license": "mit", "hash": 6000435890196547000, "line_mean": 20.1014492754, "line_max": 79, "alpha_frac": 0.595467033, "autogenerated": false, "ratio": 3.6218905472636815, "config_test": f...
__author__ = 'paolinux' from urlparse import urlparse import json class Node: node = None def __init__(self,url,score,matchings,tree): self.node = {} self.node['children'] = [] self.node['parent'] = -1 self.node['own_score'] = score self.node['total_score'] = 0 ...
{ "repo_name": "paolinux79/SimpleScraper", "path": "ScrapeTree/Node.py", "copies": "1", "size": "1443", "license": "bsd-2-clause", "hash": 858026261615105400, "line_mean": 24.3157894737, "line_max": 83, "alpha_frac": 0.5703395703, "autogenerated": false, "ratio": 3.2945205479452055, "config_test...
__author__ = "Parag Baxi <parag.baxi@gmail.com>" __copyright__ = "Copyright 2013, Parag Baxi" __license__ = "Apache License 2.0" """ Module that contains classes for setting up connections to QualysGuard API and requesting data from it. """ import logging import time from collections import defaultdict import request...
{ "repo_name": "paragbaxi/qualysapi", "path": "qualysapi/connector.py", "copies": "1", "size": "23383", "license": "apache-2.0", "hash": -5276500249292499000, "line_mean": 39.5251299827, "line_max": 140, "alpha_frac": 0.5010477697, "autogenerated": false, "ratio": 4.586700666928207, "config_test...
__author__ = 'Parag Baxi <parag.baxi@gmail.com>' __license__ = 'Apache License 2.0' import qualysapi from lxml import objectify from lxml.builder import E # Setup connection to QualysGuard API. qgc = qualysapi.connect('config.txt') # # API v1 call: Scan the New York & Las Vegas asset groups # The call is our request'...
{ "repo_name": "paragbaxi/qualysapi", "path": "examples/qualysapi-example.py", "copies": "1", "size": "4538", "license": "apache-2.0", "hash": -3918017948606881000, "line_mean": 39.1592920354, "line_max": 170, "alpha_frac": 0.7210224769, "autogenerated": false, "ratio": 3.1935256861365238, "conf...
__author__ = 'parallels' import logging logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.CRITICAL) import pika import sys connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel = connection.channel() channel.exchange_declare(exchange='direct_logs', ...
{ "repo_name": "bkolowitz/IADSS", "path": "ml/receive_logs_direct.py", "copies": "2", "size": "1050", "license": "apache-2.0", "hash": -7729519507138006000, "line_mean": 25.9487179487, "line_max": 79, "alpha_frac": 0.6257142857, "autogenerated": false, "ratio": 3.6206896551724137, "config_test":...
from math import floor t = int(raw_input()) for _ in range(t): a = float(raw_input()) for x in range(12): y1 = 2.0 * (30*x - a) / 11.0 y2 = 2.0 * (30*x + a) / 11.0 y3 = 2.0 * (30*x - 360 + a) / 11.0 y4 = 2.0 * (30*x + 360 - a) / 11.0 fy1 = round(y1) fy2 = round(y2...
{ "repo_name": "paramsingh/cp", "path": "src/long/oct15/timeasr.py", "copies": "2", "size": "1117", "license": "mit", "hash": -5063416358988819000, "line_mean": 33.90625, "line_max": 63, "alpha_frac": 0.4297224709, "autogenerated": false, "ratio": 2.465783664459161, "config_test": false, "has_...
__author__ = 'parker' from src.parsers.base_parser import BaseParser from src.parsers import * director_matcher_pattern = '(.*?)\t+((.*? \(\S{4,}\)) ?(\(\S+\))? ?(?!\{\{SUSPENDED\}\})(\{(.*?) ?(\(\S+?\))?\})? ?(\{\{SUSPENDED\}\})?)\s*(\(.*\)|EDIT)?\s*(<.*>)?$' """ RegExp: /(.*?)\t+((.*? \(\S{4,}\)) ?(\(\S+\))? ?(?!...
{ "repo_name": "parkercoleman/imdb_parser", "path": "src/parsers/director_parser.py", "copies": "1", "size": "3115", "license": "mit", "hash": 5958617650509179000, "line_mean": 41.1081081081, "line_max": 165, "alpha_frac": 0.5313001605, "autogenerated": false, "ratio": 3.214654282765738, "config...
__author__ = 'parker' from src.settings import * from base_parser import * from src.parsers import * """ RegExp: /(.*?)\t+((.*? \(\S{4,}\)) ?(\(\S+\))? ?(?!\{\{SUSPENDED\}\})(\{(.*?) ?(\(\S+?\))?\})? ?(\{\{SUSPENDED\}\})?)\s*(\(.*?\))?\s*(\(.*\))?\s*(\[.*\])?\s*(<.*>)?$/gm pattern: (.*?)\t+((.*? \(\S{4,}\)) ?(\(\S+...
{ "repo_name": "parkercoleman/imdb_parser", "path": "src/parsers/preformers_parser.py", "copies": "1", "size": "4522", "license": "mit", "hash": 1325088484517773800, "line_mean": 44.6767676768, "line_max": 183, "alpha_frac": 0.5110570544, "autogenerated": false, "ratio": 3.4784615384615383, "con...
__author__ = 'PARKJINSANG' from collections import OrderedDict import json class SIMONGeneticAction: ActionName = "" ActionFunctionName = "" ExecutionFunctionName = "" FitnessFunctionName = "" def __init__(self, actionName = None, actionFunctionName = None, executionFunctionName = None, fitnessFu...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/objects/SIMONGeneticAction.py", "copies": "1", "size": "1534", "license": "apache-2.0", "hash": 3999810172757281000, "line_mean": 33.0888888889, "line_max": 145, "alpha_frac": 0.6825293351, "autogenerated": false, "ratio": 4....
__author__ = 'PARKJINSANG' from SIMON.algorithms.genetic.SIMONGeneticAlgorithm import SIMONGeneticAlgorithm # # genetic algorithm for learning and evaluating # # def run_genetic_algorithm(group, actionPool, propertyPool): algorithm = SIMONGeneticAlgorithm() for actionName, actionDnaList in actionPool.items...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/algorithms/SIMONAlgorithmMain.py", "copies": "1", "size": "1860", "license": "apache-2.0", "hash": -1170860137873169400, "line_mean": 32.2142857143, "line_max": 83, "alpha_frac": 0.6758064516, "autogenerated": false, "ratio":...
__author__ = 'PARKJINSANG' from SIMON.SIMONManager import SIMONManager from SIMON.objects.SIMONGeneticObject import SIMONGeneticObject sManager = SIMONManager("Test") from SIMON import SIMONFunction @SIMONFunction.Register def Foo1(): return "Hoo" @SIMONFunction.Register def Foo2(): return "Gaa" @SIM...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/test/test_manager.py", "copies": "1", "size": "3945", "license": "apache-2.0", "hash": 3484716679197359000, "line_mean": 27.1785714286, "line_max": 89, "alpha_frac": 0.721166033, "autogenerated": false, "ratio": 3.11611374407...
__author__ = 'PARKJINSANG' from collections import OrderedDict state_map = [] # # find whether the state is able to be mapped. # # def find_mapped_state(states, mapping_key_list): for state in states: correct_flag = 1 args_chk_iterator = 0 if(len(state) != len(mapping_key_list)): ...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/SIMONStatusManager.py", "copies": "1", "size": "1794", "license": "apache-2.0", "hash": 1666134843299647000, "line_mean": 25.3823529412, "line_max": 90, "alpha_frac": 0.6209587514, "autogenerated": false, "ratio": 3.691358024...
__author__ = 'PARKJINSANG' import os import csv def TextReadStream(fileName): fIn = open(fileName, 'r') text = fIn.read() fIn.close() return text def TextWriteStream(fileName, text): fOut = open(fileName, 'w') fOut.write(text) fOut.close() def TextAppendStream(fileName, text): fOut...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/utils/SIMONFileStream.py", "copies": "1", "size": "1241", "license": "apache-2.0", "hash": 6533382829593961000, "line_mean": 24.8541666667, "line_max": 89, "alpha_frac": 0.6212731668, "autogenerated": false, "ratio": 3.437673...
__author__ = 'PARKJINSANG' # def read_file(path): """ Read text from file path :param path: string of path of file to read :return: contents inside the file """ file = open(path, "r", encoding='ISO-8859-1') contents = "" while True: line = file.readline() if not line: ...
{ "repo_name": "ParkJinSang/Logle", "path": "sample/common/fileio.py", "copies": "2", "size": "1415", "license": "mit", "hash": 8251454989926213000, "line_mean": 22.5833333333, "line_max": 60, "alpha_frac": 0.5823321555, "autogenerated": false, "ratio": 3.5286783042394014, "config_test": false, ...
__author__ = 'Park' from collections import OrderedDict import json import SIMON class SIMONObjectSerializer: ObjectContainer = OrderedDict() def SaveJSON(self, fileName, jsonData): with open(fileName, 'w', encoding='utf-8') as outfile: json.dump(jsonData, outfile) def LoadJSON(sel...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/utils/SIMONObjectSerializer.py", "copies": "1", "size": "1448", "license": "apache-2.0", "hash": -2884912471098439000, "line_mean": 30.0243902439, "line_max": 106, "alpha_frac": 0.6761006289, "autogenerated": false, "ratio": ...
__author__ = 'Park' import sys from collections import OrderedDict def preparePoolSpace(group, record_name): if(not group.__contains__(record_name)): group[record_name] = [] # # make the genetic pool of the properties # # def generatePropertyPool(group): genePropertyPool = OrderedDict() for ele...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/SIMONIntelligence.py", "copies": "1", "size": "1080", "license": "apache-2.0", "hash": 7769083637493923000, "line_mean": 26.6923076923, "line_max": 84, "alpha_frac": 0.6990740741, "autogenerated": false, "ratio": 4.1379310344...
__author__ = 'Park' # (action, state(ordereddict)) 이렇게 튜플로 구성된 리스트인 q table을 만들자. from collections import OrderedDict # # 한개의 Agent 는 한개의 Object에 대해서만 작동하게끔 만들어야 한다. # # class SIMONQLearningAgent: # qtable에는 보상값을 넣어야한다는 것을 잊지말게. qtable = OrderedDict() reward = 0 gamma = 0 # state_for_agent ...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/agents/SIMONQLearningAgent.py", "copies": "1", "size": "6830", "license": "apache-2.0", "hash": -8611354427511170000, "line_mean": 30.4854368932, "line_max": 114, "alpha_frac": 0.5999074931, "autogenerated": false, "ratio": 3...
__author__ = 'Park' from SIMON import SIMONFunction from SIMON.utils import SIMONObjectSerializer, SIMONFileStream from collections import OrderedDict class SIMONUtilitybaseAgent: def __init__(self): pass # # make decision by utility base # select the action which is evaluated the b...
{ "repo_name": "ParkJinSang/SIMONFramework", "path": "src/SIMON_Py/SIMON/agents/SIMONUtilitybaseAgent.py", "copies": "1", "size": "3650", "license": "apache-2.0", "hash": -6468196181267932000, "line_mean": 37.0444444444, "line_max": 161, "alpha_frac": 0.4398364486, "autogenerated": false, "ratio":...
import sys import tornado.ioloop import tornado.web import sockjs.tornado import json class BaseHandler(tornado.web.RequestHandler): def post(self): self.user = self.get_argument('user', None) count = self.get_argument('count', 0) try: data = self.get_argument('data', None) ...
{ "repo_name": "parthz/inmar", "path": "inmar/services/tornado_server.py", "copies": "1", "size": "2815", "license": "apache-2.0", "hash": -2639693011112260000, "line_mean": 26.5980392157, "line_max": 79, "alpha_frac": 0.556660746, "autogenerated": false, "ratio": 4.097525473071324, "config_test...
from django.conf import settings from django.http import HttpResponseRedirect, HttpResponse BY_PASS = ['/o/token/', '/api/v1/'] def simple_middleware(get_response): # One-time configuration and initialization. def middleware(request): # Code to be executed for each request before # the view ...
{ "repo_name": "parthz/inmar", "path": "inmar/authentication/auth_middleware.py", "copies": "1", "size": "1173", "license": "apache-2.0", "hash": -5905438161893197000, "line_mean": 33.5, "line_max": 88, "alpha_frac": 0.6257459506, "autogenerated": false, "ratio": 4.4600760456273765, "config_test...
__author__ = 'parth' from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, ForeignKey, BigInteger, Integer from sqlalchemy.orm import relationship Base = declarative_base() # Model representing number of tweets for # particular user. # Note: This is more efficient than stori...
{ "repo_name": "ParthDesai/tweet_stats", "path": "models.py", "copies": "1", "size": "3186", "license": "mit", "hash": 1294227298958636500, "line_mean": 27.7027027027, "line_max": 93, "alpha_frac": 0.6399874451, "autogenerated": false, "ratio": 3.5478841870824054, "config_test": false, "has_no...
__author__ = 'parth' from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream from sqlalchemy.orm import sessionmaker import models import json import config from sqlalchemy import create_engine engine = create_engine(config.database_uri) models.Base.metadata.create_all(...
{ "repo_name": "ParthDesai/tweet_stats", "path": "background.py", "copies": "1", "size": "2543", "license": "mit", "hash": 1321532882689297000, "line_mean": 29.6385542169, "line_max": 85, "alpha_frac": 0.6551317342, "autogenerated": false, "ratio": 3.9734375, "config_test": true, "has_no_keywo...
__author__ = 'pasan fernando' ###################################################################################################################### import re import networkx as nx import collections ###### Reading the Vertebrate Taxonomy ontology (VTO) file to store relationships p = open('vtonewfinal.owl', 'r') G...
{ "repo_name": "pasanfernando/VTO_to_opentree_pipeline", "path": "2.matrixpreprocessor/matrixpreprocessor.py", "copies": "1", "size": "6245", "license": "mit", "hash": 1062180667180012800, "line_mean": 31.7015706806, "line_max": 119, "alpha_frac": 0.5258606886, "autogenerated": false, "ratio": 3.6...
################################################################################################# pec = [] pelvic =[] ''' To run this code, taxa with inferred presence states for pectoral fin (pectoralinferred.txt) and pelvic fin (pelvicinferred.txt) must be provided as separate lists. These lists are generated fro...
{ "repo_name": "pasanfernando/VTO_to_opentree_pipeline", "path": "4.inferredprecensereplace/inferredpresencereplace.py", "copies": "1", "size": "3472", "license": "mit", "hash": -7729623343212063000, "line_mean": 29.2, "line_max": 135, "alpha_frac": 0.6019585253, "autogenerated": false, "ratio": 3...
__author__ = 'pasan fernando' ################################################################################ import re import collections par ={} paired ={} both =[] pec =[] pel =[] presence=[] missing =[] # opening the input matrix with open tree names da = open('finalopentree_matrix_onlydata.txt', 'r') for line...
{ "repo_name": "pasanfernando/VTO_to_opentree_pipeline", "path": "paired_fin_analyzer/paired_fin_analyzer.py", "copies": "1", "size": "3503", "license": "mit", "hash": -1148514459025421400, "line_mean": 34.3838383838, "line_max": 139, "alpha_frac": 0.5375392521, "autogenerated": false, "ratio": 2....
__author__ = 'pascal' import mysql.connector from datetime import datetime import json class LSFEventDBAccess: def __init__(self): credentials = json.load(open('db_credentials_MYSQL.json', 'r')) self.cnx = mysql.connector.connect(**credentials) def add_events(self, events): cursor = ...
{ "repo_name": "pascalweiss/LSFEventScraper", "path": "LSFEventDBAccess_MYSQL.py", "copies": "1", "size": "2625", "license": "mit", "hash": -4713498604525572000, "line_mean": 34.9589041096, "line_max": 190, "alpha_frac": 0.5318095238, "autogenerated": false, "ratio": 3.6559888579387185, "config_...
__author__ = 'pascal' import psycopg2 from datetime import datetime import json class LSFEventDBAccess: chunk_size = 500 def __init__(self): credentials = json.load(open('db_credentials_PSQL.json', 'r')) self.cnx = psycopg2.connect(**credentials) def add_events_old(self, events): ...
{ "repo_name": "pascalweiss/LSFEventScraper", "path": "LSFEventDBAccess_PSQL.py", "copies": "1", "size": "4185", "license": "mit", "hash": -1993471228754179600, "line_mean": 34.4661016949, "line_max": 202, "alpha_frac": 0.4994026284, "autogenerated": false, "ratio": 3.993320610687023, "config_te...
__author__ = 'pascal' import time class LSFLogging: @staticmethod def log_event(event, file = 'log.txt'): with open(file, 'a') as f: f.write(LSFLogging.event_to_string(event).encode('utf8') + '\n') @staticmethod def event_to_string(event): begin = '' end = '' ...
{ "repo_name": "pascalweiss/LSFEventScraper", "path": "LSFLogging.py", "copies": "1", "size": "1329", "license": "mit", "hash": -6133973499661868000, "line_mean": 31.4390243902, "line_max": 76, "alpha_frac": 0.4529721595, "autogenerated": false, "ratio": 3.2653562653562656, "config_test": false,...
__author__ = 'pascal' class LSFTextUtils: @staticmethod def remove_spaces(str): result = '' for c in str: if c != ' ': result += c return result @staticmethod def remove_new_line_and_tab(str): name = '' for c in str: if ...
{ "repo_name": "pascalweiss/LSFEventScraper", "path": "LSFTextUtils.py", "copies": "1", "size": "2149", "license": "mit", "hash": -4043991770419628500, "line_mean": 22.1075268817, "line_max": 62, "alpha_frac": 0.4378780828, "autogenerated": false, "ratio": 4.213725490196079, "config_test": false...
__author__ = 'patelm' import logging class Registrar(): """Responsible for registering/deregistering backends and informing the Driver with the latest information Uses the datastore to keep track of known backends Call the driver with the latest known state of the backends """ datastore...
{ "repo_name": "mchao47/Elasticd", "path": "elasticd/registrar.py", "copies": "3", "size": "2043", "license": "apache-2.0", "hash": 1492248080042186500, "line_mean": 31.9516129032, "line_max": 110, "alpha_frac": 0.6000978953, "autogenerated": false, "ratio": 4.591011235955056, "config_test": fal...
import glob import gzip import re import string import math import sys from math import log from collections import defaultdict if len(sys.argv)<2: print "Usage: python comp.py <input-path>" exit() from sys import argv filename1= sys.argv[1] filename2= sys.argv[2] txt2 = open(filename2) for l2 in t...
{ "repo_name": "semantic-group1/twitter-lda", "path": "Python Scripts/CDS.py", "copies": "1", "size": "1123", "license": "apache-2.0", "hash": -8102842145023156000, "line_mean": 22.8936170213, "line_max": 123, "alpha_frac": 0.6874443455, "autogenerated": false, "ratio": 2.686602870813397, "confi...
import glob import gzip import re import string import math import sys from math import log from collections import defaultdict if len(sys.argv)<2: print "Usage: python comp.py <input-path>" exit() results = sys.argv[1] results2 = sys.argv[2] path = results+"/*" files=glob.glob(path) path2 ...
{ "repo_name": "semantic-group1/twitter-lda", "path": "Python Scripts/output.py", "copies": "1", "size": "1669", "license": "apache-2.0", "hash": 4087382142743692300, "line_mean": 16.2164948454, "line_max": 160, "alpha_frac": 0.594367885, "autogenerated": false, "ratio": 2.8432708688245314, "con...
__author__ = 'pather' # file = Lab2.py # programmer = Keith Murphy # date created = 1-15-2014 # last mod = 1-23-2014 # # Hello Mark, # This is the first stab at the lab2 assignment. I have everything # working as I designed it in regrades to the calculations but I have noticed I'm getting a message # stating 'inspectio...
{ "repo_name": "nomad-mystic/nomadmystic", "path": "fileSystem/school-projects/development/softwaredesignandcomputerlogiccis122/cis122lab2/python/lab2.1.py", "copies": "1", "size": "4393", "license": "mit", "hash": -405803161694742660, "line_mean": 29.5069444444, "line_max": 112, "alpha_frac": 0.67083...
__author__ = 'pather' import urllib.request import re africa_url_response = urllib.request.urlopen('http://worldpopulationreview.com/continents/africa-population/') africa_url_html = africa_url_response.read() africa_url_text = africa_url_html.decode('UTF-8') africa_current_population = re.search('<span>([^<]*)', afr...
{ "repo_name": "nomad-mystic/nomadmystic", "path": "fileSystem/school-projects/development/softwaredesignandcomputerlogiccis122/cis122lab3/python/testresponse.py", "copies": "1", "size": "1294", "license": "mit", "hash": 5214536106706644000, "line_mean": 33.0789473684, "line_max": 110, "alpha_frac": 0...
__author__ = 'pather' # Programmer = Keith Murphy # File = lab5.py # Date Created 3-5-2015 # Last Mod = 3-10-2015 # Hello Mark, This is Lab 5 take #2 which is way less ambitious as the last. :) Thanks for the extra point on the last # Lab I appreciate that. I worked many a hour to complete that Lab. I...
{ "repo_name": "nomad-mystic/nomadmystic", "path": "fileSystem/school-projects/development/softwaredesignandcomputerlogiccis122/cis122lab5/python/lab5.py", "copies": "1", "size": "6147", "license": "mit", "hash": 531876114242274900, "line_mean": 30.0454545455, "line_max": 120, "alpha_frac": 0.64421669...
__author__ = 'Pat McClernan and Dan Weggman' #input #0 for rock #1 for paper #2 for scissors # past move is array of numbers # our move followed by their move #Our strategy is to look at all past moves #In a large number of games, you would expect # each move to be seen an even amount of times #So our strategy is ...
{ "repo_name": "mccler89/RPS_Player", "path": "my_rps_player.py", "copies": "1", "size": "1272", "license": "apache-2.0", "hash": -8874410961895950000, "line_mean": 21.7142857143, "line_max": 49, "alpha_frac": 0.5487421384, "autogenerated": false, "ratio": 3.6342857142857143, "config_test": fals...
__author__ = 'Pat McClernan and Dan Wegmann' import Player import Message # input #0 for rock #1 for paper #2 for scissors # past move is array of numbers # our move followed by their move #Our strategy is to look at all past moves #In a large number of games, you would expect # each move to be seen an even amount ...
{ "repo_name": "geebzter/game-framework", "path": "DWPMPlayer.py", "copies": "1", "size": "3899", "license": "apache-2.0", "hash": -1594531504893314600, "line_mean": 31.4916666667, "line_max": 108, "alpha_frac": 0.5839958964, "autogenerated": false, "ratio": 3.942366026289181, "config_test": fal...
__author__ = 'pat' import re import sys import getopt import pickle from collections import defaultdict ### # Takes a 3 col mtx file and maps string entries to int id's # use -v to export string-int maps ### def process_seq(seq, token_counter, replace_digits, chars, double_vocab): # normalize digits except in $...
{ "repo_name": "patverga/torch-relation-extraction", "path": "bin/process/BothEncoderStringFile2IntFile.py", "copies": "1", "size": "7743", "license": "mit", "hash": -6706529845424866000, "line_mean": 38.912371134, "line_max": 148, "alpha_frac": 0.5890481725, "autogenerated": false, "ratio": 3.373...
__author__ = 'pat' import re import sys import getopt import pickle from collections import defaultdict ### # Takes a 4 col mtx file and maps string entries to int id's # use -v to export string-int maps ### def process_line(chars, ent_map, ep_map, line, rel_map, token_counter, double_vocab, replace_digits): e1...
{ "repo_name": "patverga/torch-relation-extraction", "path": "bin/process/StringFile2IntFile.py", "copies": "1", "size": "6993", "license": "mit", "hash": -1649580483208601300, "line_mean": 37.635359116, "line_max": 148, "alpha_frac": 0.5671385671, "autogenerated": false, "ratio": 3.40126459143968...
__author__ = 'Patricio Cerda, Joaquin Moreno y Pedro Zepeda' import os from time import time #Pseudocodigo de lo que se debe hacer para optimizar el algoritmo base: # #Unit propagation #If a clause is a unit clause, i.e. it contains only a single unassigned literal, #this clause can only be satisfied by assigning the...
{ "repo_name": "pcerdam/IMT1001", "path": "Ignore/DPLL P1.py", "copies": "1", "size": "5106", "license": "apache-2.0", "hash": -4803750770407346000, "line_mean": 35.7410071942, "line_max": 113, "alpha_frac": 0.6190755973, "autogenerated": false, "ratio": 3.161609907120743, "config_test": false, ...
__author__ = 'Patricio Cerda, Joaquin Moreno y Pedro Zepeda' import os import copy import random from time import time # Correcciones finales mediante testeo intensivo. ### DPLL BASICO ### def DPLL(alpha, recorrido): global eleccion, show if alpha == '': recorrido.sort() if show: print('La...
{ "repo_name": "pcerdam/IMT1001", "path": "DPLL_P1.py", "copies": "1", "size": "11150", "license": "apache-2.0", "hash": -1540259133428335900, "line_mean": 37.0546075085, "line_max": 238, "alpha_frac": 0.5331838565, "autogenerated": false, "ratio": 3.4276052874269904, "config_test": false, "ha...
__author__ = 'Patricio Cerda, Joaquin Moreno y Pedro Zepeda' import os import copy import random from time import time # Para el base, mostrar v1 sin funcion de simplificacion (y sin el caso base de clausula unitaria). # Eso es fuerza bruta. Luego el DPLL1, luego el DPLL2. ### DPLL MEJORADO ### def tautologia(alph...
{ "repo_name": "pcerdam/IMT1001", "path": "DPLL_P2.py", "copies": "1", "size": "13113", "license": "apache-2.0", "hash": -3898927792387531000, "line_mean": 34.6331521739, "line_max": 238, "alpha_frac": 0.5377106688, "autogenerated": false, "ratio": 3.406858924395947, "config_test": false, "has...
import os import sys import platform import re import sublime import sublime_plugin version = "1.5.0" def haveExt(_file,_extentions): rta = False if isinstance(_extentions, list): for ext in _extentions: if os.path.splitext(_file)[1] == ext: rta = True b...
{ "repo_name": "patriciogonzalezvivo/sublime-glslViewer", "path": "glslViewer.py", "copies": "1", "size": "3873", "license": "mit", "hash": -3588527769841126000, "line_mean": 32.6782608696, "line_max": 137, "alpha_frac": 0.5071004389, "autogenerated": false, "ratio": 3.8691308691308692, "config_...
import matplotlib.pyplot as plt import numpy as np import environment import random class Stateless_SRA(): def __init__(self): self.points = 0 def loc(self, env): curIndex = env.Location.index(1) if curIndex == 0: return 'A' elif curIndex == 1: return ...
{ "repo_name": "pblanc5/Artificial-Intelligence-", "path": "Homework1/stateless_simple_reflex_agent.py", "copies": "1", "size": "2130", "license": "mit", "hash": -5470746989717096000, "line_mean": 25.2962962963, "line_max": 91, "alpha_frac": 0.5535211268, "autogenerated": false, "ratio": 3.4244372...
import matplotlib.pyplot as plt import numpy as np import environment import random class Stateful_SRA(): def __init__(self): self.points = 0 self.mem = [0,0,0] def loc(self, env): curIndex = env.Location.index(1) if curIndex == 0: return 'A' elif curIndex...
{ "repo_name": "pblanc5/Artificial-Intelligence-", "path": "Homework1/stateful_simple_reflex_agent.py", "copies": "1", "size": "2500", "license": "mit", "hash": -858346061466590200, "line_mean": 25.5957446809, "line_max": 103, "alpha_frac": 0.5428, "autogenerated": false, "ratio": 3.44352617079889...
import matplotlib.pyplot as plt import numpy as np import environment import random class RSRA(): def __init__(self, env): self.points = 0 self.mem = [1 if x == 'Clean' else 0 for x in env.State] def status(self, env): curIndex = env.Location.index(1) state = env.State[curI...
{ "repo_name": "pblanc5/Artificial-Intelligence-", "path": "Homework1/random_simple_reflex_agent.py", "copies": "1", "size": "2159", "license": "mit", "hash": -8815191562036912000, "line_mean": 25.3292682927, "line_max": 91, "alpha_frac": 0.5488652154, "autogenerated": false, "ratio": 3.4488817891...
import matplotlib.pyplot as plt import numpy as np import environment import random class OSRA(): def __init__(self, env): self.points = 0 self.mem = [1 if x == 'Clean' else 0 for x in env.State] def loc(self, env): curIndex = env.Location.index(1) if curIndex == 0: ...
{ "repo_name": "pblanc5/Artificial-Intelligence-", "path": "Homework1/omni_simple_reflex_agent.py", "copies": "1", "size": "2404", "license": "mit", "hash": 3138571776187081000, "line_mean": 24.8494623656, "line_max": 98, "alpha_frac": 0.5386855241, "autogenerated": false, "ratio": 3.4490674318507...
import smbus import time class LiquidCrystal_I2C: # commands _LCD_CLEARDISPLAY = 0x01 _LCD_RETURNHOME = 0x02 _LCD_ENTRYMODESET = 0x04 _LCD_DISPLAYCONTROL = 0x08 _LCD_CURSORSHIFT = 0x10 _LCD_FUNCTIONSET = 0x20 _LCD_SETCGRAMADDR = 0x40 _LCD_SETDDRAMADDR = 0x80 # flags for displa...
{ "repo_name": "pl31/python-liquidcrystal_i2c", "path": "liquidcrystal_i2c/liquidcrystal_i2c.py", "copies": "1", "size": "8541", "license": "mit", "hash": -2065582460568999700, "line_mean": 33.164, "line_max": 99, "alpha_frac": 0.6301369863, "autogenerated": false, "ratio": 3.483278955954323, "c...
__author__ = 'patrickemami,tylorchilders' import sys,os,csv,numpy as np import random CONFIG_DIR = 'config' DATA_STORE = 'iris.data.txt'#'wine.data.txt' NUMBER_OF_ATTRIBUTES = 4#13 NUMBER_OF_CLASSES = 3 CLASS_1 = 'Iris-setosa'#'1' CLASS_2 = 'Iris-versicolor'#'2' CLASS_3 = 'Iris-virginica'#'3' CLASS_POS = -1#0 TRA...
{ "repo_name": "bchilders/Numerical-Analysis-Semester-Project", "path": "src/multi_class_linsqu.py", "copies": "1", "size": "4071", "license": "mit", "hash": -5043926773201726000, "line_mean": 25.1025641026, "line_max": 97, "alpha_frac": 0.5485138787, "autogenerated": false, "ratio": 3.08642911296...
__author__ = 'patrickemami,tylorchilders' import sys,os,csv,numpy as np import random CONFIG_DIR = 'config' DATA_STORE = 'wine.data.txt'#'iris.data.txt' NUMBER_OF_ATTRIBUTES = 13#4 CLASS_1 = '1'#'Iris-setosa' CLASS_n1 = '2'#'Iris-versicolor' CLASS_NULL = '3'#'Iris-virginica' CLASS_POS = 0#-1 TRAINING_SET = 10 di...
{ "repo_name": "bchilders/Numerical-Analysis-Semester-Project", "path": "src/linear_least_squares.py", "copies": "1", "size": "4966", "license": "mit", "hash": -8780808633642031000, "line_mean": 25.420212766, "line_max": 122, "alpha_frac": 0.548530004, "autogenerated": false, "ratio": 3.1213073538...
__author__ = 'Patrick Liu and Olga Botvinnik' import pandas as pd import string import glob import numpy as np import sys class Collector(object): def __init__(self, base_name=None): self.base_name = base_name self.tool_name = '' self.version = 0 return def parse(self, file_pat...
{ "repo_name": "YeoLab/gscripts", "path": "gscripts/output_parsers/rna_star_collector.py", "copies": "1", "size": "10711", "license": "mit", "hash": -6291873374436889000, "line_mean": 37.5287769784, "line_max": 105, "alpha_frac": 0.575856596, "autogenerated": false, "ratio": 3.7688247712878256, ...
__author__ = 'Patrick' import pygame from pygame.locals import K_w, K_a, K_s, K_d from math import cos, sin, atan2 class Player(object): """Handle player attributes and weapons fire.""" def __init__(self, area, surface): """Return Player""" # References self.surface = surface ...
{ "repo_name": "pathunstrom/shmup-survival-game", "path": "player.py", "copies": "1", "size": "3653", "license": "mit", "hash": -5143784777668110000, "line_mean": 28.4677419355, "line_max": 78, "alpha_frac": 0.5184779633, "autogenerated": false, "ratio": 3.4856870229007635, "config_test": false,...
__author__ = 'Patrick' import pygame from random import randint, choice from pygame import transform from pygame.locals import * from config import * class Body(pygame.sprite.Sprite): """Parent class for Head and Body""" def __init__(self, x, y, dictionary): super(Body, self).__init__() self....
{ "repo_name": "pathunstrom/candyjam-snake", "path": "snake.py", "copies": "1", "size": "7012", "license": "mit", "hash": -5292842361696399000, "line_mean": 35.1494845361, "line_max": 89, "alpha_frac": 0.5223901882, "autogenerated": false, "ratio": 3.5593908629441624, "config_test": false, "ha...
__author__ = 'Patrick' import pygame import random class Mobile(object): def __init__(self, (width, height), (red, green, blue), surface): """Return mobile""" self.rect = pygame.Rect(0, 0, width, height) self.color = (red, green, blue) self.xy = [float(self.rect.centerx), float(s...
{ "repo_name": "pathunstrom/shmup-survival-game", "path": "enemy.py", "copies": "1", "size": "2005", "license": "mit", "hash": 4445828000814805000, "line_mean": 27.6571428571, "line_max": 78, "alpha_frac": 0.5396508728, "autogenerated": false, "ratio": 3.7830188679245285, "config_test": false, ...
__author__ = 'Patrick' import pygame import sys from pygame.locals import * from pygame import transform import snake from config import * pygame.init() display = pygame.display.set_mode((square_size * spaces, square_size * spaces)) candy_images = [{'image': pygame.image.load('./images/bean_purple.png').convert(), ...
{ "repo_name": "pathunstrom/candyjam-snake", "path": "game.py", "copies": "1", "size": "4324", "license": "mit", "hash": -4178511042520368600, "line_mean": 50.4880952381, "line_max": 122, "alpha_frac": 0.564986124, "autogenerated": false, "ratio": 3.4619695756605284, "config_test": false, "has...
# A custom scheduler for bitbake which runs rm_work tasks more # aggressively than the default schedule chosen by rm_work. # To use it, add to local.conf: # BB_SCHEDULERS = "rmwork.RunQueueSchedulerRmWork" # BB_SCHEDULER = "rmwork" # Then run: # PYTHONPATH=<path to the directory with rmwork.py> bitbake ... # # O...
{ "repo_name": "01org/meta-intel-iot-security", "path": "scripts/rmwork.py", "copies": "1", "size": "9413", "license": "mit", "hash": 6370516093015018000, "line_mean": 49.8810810811, "line_max": 102, "alpha_frac": 0.5765430787, "autogenerated": false, "ratio": 4.217293906810036, "config_test": f...
__author__ = 'Patrick' import hashlib import urllib from xml.dom import minidom import yweather def windrichtung(winddir): if winddir <= 23: winddir = 'N' elif winddir <= 67: winddir = 'NE' elif winddir <= 113: winddir = 'E' elif winddir <= 158: winddir...
{ "repo_name": "PatteWi/pythonwetter", "path": "pythonwetter/functions.py", "copies": "1", "size": "1848", "license": "mit", "hash": 8212389935328958000, "line_mean": 30.4561403509, "line_max": 117, "alpha_frac": 0.6163419913, "autogenerated": false, "ratio": 3.019607843137255, "config_test": fa...
__author__ = 'Patrick' import hashlib import urllib import yweather from xml.dom import minidom def windrichtung(winddir): if winddir <= 23: winddir = 'N' elif winddir <= 67: winddir = 'NE' elif winddir <= 113: winddir = 'E' elif winddir <= 158: winddir = '...
{ "repo_name": "Benxxen/pythonwetter", "path": "pythonwetter/functions.py", "copies": "1", "size": "1546", "license": "mit", "hash": 2044625967890618600, "line_mean": 28.3529411765, "line_max": 77, "alpha_frac": 0.6151358344, "autogenerated": false, "ratio": 3.20746887966805, "config_test": fals...
__author__ = 'Patrick Sumby and Ben Roeder' import os import sys import argparse import subprocess import hashlib import time import re from subprocess import CalledProcessError from threading import Thread from queue import Queue winPath = re.compile('^(\w)\:[\\/](.*)$', re.IGNORECASE) default_num_threads = 3 defau...
{ "repo_name": "sohonetlabs/scp-chunk", "path": "scp-chunk.py", "copies": "1", "size": "20797", "license": "mit", "hash": 5119242318954149000, "line_mean": 36.3375224417, "line_max": 103, "alpha_frac": 0.4699235467, "autogenerated": false, "ratio": 4.039036706156535, "config_test": false, "has...
__author__ = 'Patrick Thunstrom' import pygame from pygame.locals import * import sys import player import enemy FPS = [] class Game(object): """Read the pygame event queue and call necessary methods.""" def __init__(self, main_display): """Return Game""" self.display = main_display ...
{ "repo_name": "pathunstrom/shmup-survival-game", "path": "game.py", "copies": "1", "size": "1639", "license": "mit", "hash": 7099543694261817000, "line_mean": 28.2678571429, "line_max": 78, "alpha_frac": 0.5747406955, "autogenerated": false, "ratio": 3.6914414414414414, "config_test": false, ...
__author__ = 'Patrizio Tufarolo' __email__ = 'patrizio.tufarolo@studenti.unimi.it' ''' Project: testagent Author: Patrizio Tufarolo <patrizio.tufarolo@studenti.unimi.it> Date: 20/04/15 ''' import json import logging from datetime import datetime from tornado.escape import json_decode from tornado.web import HTTPErro...
{ "repo_name": "patriziotufarolo/testagent", "path": "testagent/services/rest/tasks.py", "copies": "1", "size": "11719", "license": "bsd-3-clause", "hash": 7224161677205350000, "line_mean": 25.3370786517, "line_max": 76, "alpha_frac": 0.6016724977, "autogenerated": false, "ratio": 3.57613671040585...
__author__ = 'patty' import sys import os import rospy import numpy as np import cv2 import pcl import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import Image, PointCloud2 from cv_bridge import CvBridge from can_msg.msg import CANPacket from nmea_msgs.msg import Sentence save_path = None camera_img_0 = None ...
{ "repo_name": "ovpiNU/ros-dd-extraction-tool", "path": "driving_data/src/driving_data_tools/scripts/rosbag_data_extract.py", "copies": "1", "size": "4699", "license": "mit", "hash": 2264226951709263000, "line_mean": 30.3266666667, "line_max": 117, "alpha_frac": 0.6358799745, "autogenerated": false,...
__author__ = 'paulbaker' ''' wingif.py aka: My Lazy Meme Getter ''' import sys from os import path import os import requests from lxml import html import re def load_page(page_url): print('Parsing ' + page_url) r = requests.get(page_url) tree = html.fromstring(r.text) image_links = tree.xpath('//a[...
{ "repo_name": "TheWookie/python-experiments", "path": "web-scraping-tools/wingif.py", "copies": "2", "size": "3252", "license": "mit", "hash": -8079336840389089000, "line_mean": 35.1444444444, "line_max": 111, "alpha_frac": 0.5731857319, "autogenerated": false, "ratio": 3.394572025052192, "conf...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["geebzter"] # imports from ClientPackage import Player class RPSPlayerExample(Player.Player): """ Example of how to implement an RPS player within the framework Attributes: opponents_moves: the list of moves that the...
{ "repo_name": "PaulieC/rls-c", "path": "AvailablePlayers/RPSPlayerExample.py", "copies": "2", "size": "3773", "license": "apache-2.0", "hash": -8142436207823327000, "line_mean": 32.3982300885, "line_max": 108, "alpha_frac": 0.5854757487, "autogenerated": false, "ratio": 4.061356297093649, "conf...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["Greg Richards"] # imports from ServerPackage import Game class RockPaperScissors(Game.Game): """ this class simulates two players playing a game of rock, paper, scissors """ def __init__(self): self.name = "Rock-Paper-S...
{ "repo_name": "PaulieC/rls-c", "path": "AvailableGames/RockPaperScissors.py", "copies": "2", "size": "1888", "license": "apache-2.0", "hash": 1200903827603793200, "line_mean": 34.6226415094, "line_max": 84, "alpha_frac": 0.5656779661, "autogenerated": false, "ratio": 3.8141414141414143, "config...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["Joe Kvedaras, Collin Day"] # imports from bjsonrpc.handlers import BaseHandler from ServerPackage.TournamentData import * class TournamentService(BaseHandler): """ Supports the connection of players to the tournament.get_tournam...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ServerPackage/TournamentService.py", "copies": "2", "size": "15814", "license": "apache-2.0", "hash": -1810723790929617200, "line_mean": 37.5731707317, "line_max": 120, "alpha_frac": 0.5789174149, "autogenerated": false, "ratio": 4.515705311250714...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["Samantha Holloway, Joe Pannizzo"] # imports class Player(): """ Class Player is used as the top level class abstraction to play in a Tournament It specifies what a concrete Player must do to be a part of the Tournament E...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ClientPackage/Player.py", "copies": "2", "size": "2167", "license": "apache-2.0", "hash": 4163961031604572700, "line_mean": 25.7530864198, "line_max": 83, "alpha_frac": 0.5892939548, "autogenerated": false, "ratio": 4.035381750465549, "config_te...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["Tony"] # imports from ServerPackage.TournamentService import * from AvailablePlayers.RPSPlayerExample import * from AvailableGames.RockPaperScissors import * from AvailablePlayers.BEPCPlayer import * class RPSDriver(TournamentService): ...
{ "repo_name": "PaulieC/rls-c", "path": "ServerPackage/RPSDriver.py", "copies": "2", "size": "1174", "license": "apache-2.0", "hash": 3306292488027245600, "line_mean": 28.375, "line_max": 112, "alpha_frac": 0.6746166951, "autogenerated": false, "ratio": 3.738853503184713, "config_test": false, ...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["Victor M"] # imports import random from ClientPackage import Player class RPSPlayerSwitcharoo(Player.Player): """ Rock paper scissors player Attributes: strategy: An object designed to calculate/manipulate this pla...
{ "repo_name": "PaulieC/rls-c", "path": "ServerPackage/RPSPlayerSwitcharoo.py", "copies": "2", "size": "6830", "license": "apache-2.0", "hash": -3423557783649712000, "line_mean": 30.7720930233, "line_max": 119, "alpha_frac": 0.5960468521, "autogenerated": false, "ratio": 4.149453219927096, "conf...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["William Ezekiel"] # imports from ServerPackage.Tournament import * import random class SingleElimination(Tournament): """ SingleElimination Tournament Type: Every player plays an initial match, but only winners move on. ...
{ "repo_name": "PaulieC/sprint5-Council", "path": "AvailableTournaments/SingleElimination.py", "copies": "2", "size": "2861", "license": "apache-2.0", "hash": -8907930176233174000, "line_mean": 33.0714285714, "line_max": 108, "alpha_frac": 0.5948968892, "autogenerated": false, "ratio": 3.929945054...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["William Ezekiel"] # imports from ServerPackage.Tournament import * class AllPlayAll(Tournament): """ AllPlayAll Tournament Type, every player is in a match with every other player """ def __init__(self): """ Ini...
{ "repo_name": "PaulieC/rls-c", "path": "AvailableTournaments/AllPlayAll.py", "copies": "2", "size": "1192", "license": "apache-2.0", "hash": 7366517243051794000, "line_mean": 30.3684210526, "line_max": 90, "alpha_frac": 0.5687919463, "autogenerated": false, "ratio": 3.808306709265176, "config_t...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["William Ezekiel"] # imports from ClientPackage import Player import random class TestPlayer1(Player.Player): """ This is Bill and Paul's implemented Player class Attributes: past_moves: a list of the past moves...
{ "repo_name": "PaulieC/sprint5-Council", "path": "AvailablePlayers/TestPlayer1.py", "copies": "2", "size": "10073", "license": "apache-2.0", "hash": 6765183741726117000, "line_mean": 31.6019417476, "line_max": 91, "alpha_frac": 0.5764916112, "autogenerated": false, "ratio": 4.232352941176471, "...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["William Ezekiel"] # imports from ClientPackage import Player import random class TestPlayer2(Player.Player): """ This is Bill and Paul's implemented Player class Attributes: past_moves: a list of the past moves...
{ "repo_name": "PaulieC/sprint5-Council", "path": "AvailablePlayers/TestPlayer2.py", "copies": "2", "size": "10073", "license": "apache-2.0", "hash": -4171965089358833000, "line_mean": 31.6019417476, "line_max": 91, "alpha_frac": 0.5764916112, "autogenerated": false, "ratio": 4.232352941176471, ...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["William Ezekiel"] # imports from ClientPackage import Player class BEPCPlayer(Player.Player): """ This is Bill and Paul's implemented Player class Attributes: past_moves: a list of the past moves performed by t...
{ "repo_name": "PaulieC/sprint5-Council", "path": "AvailablePlayers/BEPCPlayer.py", "copies": "2", "size": "9805", "license": "apache-2.0", "hash": 7087517402122155000, "line_mean": 31.7959866221, "line_max": 91, "alpha_frac": 0.5767465579, "autogenerated": false, "ratio": 4.235421166306695, "co...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint1" __credits__ = ["William Ezekiel"] # imports from ClientPackage import Player class GMPlayer(Player.Player): """ Player class Attributes: past_moves: a list of the past moves performed by this player for the current match ...
{ "repo_name": "PaulieC/sprint5-Council", "path": "AvailablePlayers/GMPlayer.py", "copies": "2", "size": "9944", "license": "apache-2.0", "hash": 4561989192522390500, "line_mean": 31.8217821782, "line_max": 91, "alpha_frac": 0.5761263073, "autogenerated": false, "ratio": 4.240511727078891, "conf...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint2" # imports import bjsonrpc from ServerPackage.TournamentService import * from ServerPackage.ServerIPSearch import * class TournamentServer(): """ TODO """ # TODO needs details def __init__(self): """ :return: ...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ServerPackage/TournamentServer.py", "copies": "2", "size": "2330", "license": "apache-2.0", "hash": 2940155826409968000, "line_mean": 24.064516129, "line_max": 97, "alpha_frac": 0.5017167382, "autogenerated": false, "ratio": 4.755102040816326, "...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint2" """ This file will be used to hold instances of the current tournament and player information. This is a companion to the TournamentService as data doesn't stay persistent without an instance for the variable """ import importlib import operator __autho...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ServerPackage/TournamentData.py", "copies": "2", "size": "7643", "license": "apache-2.0", "hash": 3836789982858637000, "line_mean": 30.2, "line_max": 107, "alpha_frac": 0.6021195865, "autogenerated": false, "ratio": 4.305915492957746, "config_te...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint3" class MatchData: """ Called by TournamentData to track individual matches. """ def __init__(self, player1, player2, num_rounds): """ :param player1: str :param player2: str :param num_rounds: int "...
{ "repo_name": "PaulieC/rls-c", "path": "ServerPackage/MatchData.py", "copies": "2", "size": "7256", "license": "apache-2.0", "hash": 2347830198506747400, "line_mean": 31.9863636364, "line_max": 99, "alpha_frac": 0.5632579934, "autogenerated": false, "ratio": 3.882289994649545, "config_test": fa...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" __credits__ = ["Alex Ciaramella, Greg Suner"] # imports import time class Tournament(): """ Abstract Tournament Class Tournament is observable while players are observers Attributes: playerList: the array that holds the Player ...
{ "repo_name": "PaulieC/rls-c", "path": "ServerPackage/Tournament.py", "copies": "2", "size": "5758", "license": "apache-2.0", "hash": -3454944787571224600, "line_mean": 28.6804123711, "line_max": 81, "alpha_frac": 0.5797151789, "autogenerated": false, "ratio": 4.329323308270677, "config_test": ...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" def unique_match_sort(match_list): temp_list = match_list return_list = [] while temp_list: return_list.append(temp_list.pop(0)) return_list.append(temp_list.pop(len(temp_list) - 1)) return return_list def sort(sorted_lis...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ServerPackage/KoalaSort.py", "copies": "2", "size": "2479", "license": "apache-2.0", "hash": 2994264268648486000, "line_mean": 27.8372093023, "line_max": 89, "alpha_frac": 0.4711577249, "autogenerated": false, "ratio": 3.023170731707317, "config...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" from ClientPackage.PlayerClient import * class GameMasterClient(PlayerClient): """ An advanced client class to allow the GameController to handle the server in ways that a regular client cannot. Used to changed tournament type, max players,...
{ "repo_name": "PaulieC/rls-c", "path": "ClientPackage/GameMasterClient.py", "copies": "2", "size": "10075", "license": "apache-2.0", "hash": 3425758920184486000, "line_mean": 40.1224489796, "line_max": 120, "alpha_frac": 0.5901736973, "autogenerated": false, "ratio": 4.548532731376975, "config_...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" from Tkinter import * import tkMessageBox from ClientPackage.GameMasterClient import * from AvailablePlayers.GMPlayer import * my_player = GMPlayer() gmc = GameMasterClient(my_player) reg_status = "Closed" num_connections = 0 num_registered = 0 networ...
{ "repo_name": "PaulieC/rls-c", "path": "ClientPackage/GameMasterGUI.py", "copies": "2", "size": "8691", "license": "apache-2.0", "hash": -6189318592045545000, "line_mean": 34.6229508197, "line_max": 119, "alpha_frac": 0.6610286503, "autogenerated": false, "ratio": 3.462549800796813, "config_tes...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" from Tkinter import * import tkMessageBox from PlayerClient import * from AvailablePlayers.TestPlayer1 import * import importlib player = TestPlayer1() client = PlayerClient(player) def list_files(path): """ Lists files inside the given path ...
{ "repo_name": "PaulieC/rls-c", "path": "ClientPackage/PlayerGUI.py", "copies": "2", "size": "7109", "license": "apache-2.0", "hash": 2283258533357711000, "line_mean": 33.014354067, "line_max": 120, "alpha_frac": 0.656491771, "autogenerated": false, "ratio": 3.558058058058058, "config_test": fal...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" from Tkinter import * import tkMessageBox from ServerPackage.TournamentServer import * def set_ip(): """ Function to allow the user to set the ip for the running server. This new ip is then displayed in the respective GUI label. """ ...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ServerPackage/ServerGUI.py", "copies": "2", "size": "5235", "license": "apache-2.0", "hash": -1646541841273826300, "line_mean": 37.2189781022, "line_max": 105, "alpha_frac": 0.6361031519, "autogenerated": false, "ratio": 3.7934782608695654, "con...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" # imports import time import os import importlib import bjsonrpc from ClientPackage.PlayerService import * class PlayerClient(): """ Handles all the request creation """ def __init__(self, player): """ :param player: The...
{ "repo_name": "PaulieC/rls-c", "path": "ClientPackage/PlayerClient.py", "copies": "2", "size": "10223", "license": "apache-2.0", "hash": 976877044833083900, "line_mean": 37.4360902256, "line_max": 120, "alpha_frac": 0.5791841925, "autogenerated": false, "ratio": 4.3650725875320235, "config_test...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" import socket import fcntl import struct class NetworkToolbox: def __init__(self): pass def get_ip_address(self, ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl( ...
{ "repo_name": "PaulieC/sprint5-Council", "path": "ServerPackage/ServerIPSearch.py", "copies": "2", "size": "1295", "license": "apache-2.0", "hash": -7479667253000661000, "line_mean": 24.92, "line_max": 60, "alpha_frac": 0.4934362934, "autogenerated": false, "ratio": 3.877245508982036, "config_t...
__author__ = "Paul Council, Anand Patel" __version__ = "sprint5" """ This class will act like the game administrator. It should be connected by the person handling the tournament. This 'player' will manage the current tournament, game, number of players, etc... """ from ClientPackage.GameMasterClient import * from Av...
{ "repo_name": "PaulieC/rls-c", "path": "ClientPackage/EasyGameController.py", "copies": "2", "size": "2676", "license": "apache-2.0", "hash": -4017501292851034600, "line_mean": 26.0303030303, "line_max": 98, "alpha_frac": 0.754857997, "autogenerated": false, "ratio": 3.2515188335358443, "config...
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel" __version__ = "sprint1" __credits__ = ["Alex Ciaramella, Greg Suner"] # imports from ServerPackage import Display, Message, Observable import time # class Tournament(Observable.Observable): """ Abstract Tournament Class Tournament is observable wh...
{ "repo_name": "PaulieC/sprint2-Council", "path": "ServerPackage/Tournament.py", "copies": "1", "size": "6059", "license": "apache-2.0", "hash": 9131228719561748000, "line_mean": 30.0717948718, "line_max": 102, "alpha_frac": 0.5959729328, "autogenerated": false, "ratio": 4.34648493543759, "confi...