text stringlengths 0 1.05M | meta dict |
|---|---|
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Alex Ciaramella, Greg Suner"]
# imports
import Message
import Observable
import Display # TODO the display needs to be implemented
#
class Tournament(Observable.Observable):
"""
Abstract Tournament Class
To... | {
"repo_name": "PaulieC/sprint1_Council",
"path": "Tournament.py",
"copies": "1",
"size": "5409",
"license": "apache-2.0",
"hash": 6322716401349850000,
"line_mean": 31.3892215569,
"line_max": 102,
"alpha_frac": 0.6045479756,
"autogenerated": false,
"ratio": 4.419117647058823,
"config_test": fals... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["geebzter"]
# imports
from ServerPackage import Message
from ClientPackage import Player
class RPSPlayerExample(Player.Player):
"""
Example of how to implement an RPS player within the framework
Attributes:
... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "AvailablePlayers/RPSPlayerExample.py",
"copies": "2",
"size": "4050",
"license": "apache-2.0",
"hash": -6449923350167979000,
"line_mean": 33.6239316239,
"line_max": 108,
"alpha_frac": 0.5995061728,
"autogenerated": false,
"ratio": 4.01785714285714... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["geebzter"]
# imports
import Player
import Message
class RPSPlayerExample(Player.Player):
"""
Example of how to implement an RPS player within the framework
Attributes:
opponents_moves: the list of mo... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "RPSPlayerExample.py",
"copies": "1",
"size": "4012",
"license": "apache-2.0",
"hash": -3288149568244166000,
"line_mean": 33.2991452991,
"line_max": 108,
"alpha_frac": 0.5967098704,
"autogenerated": false,
"ratio": 4.0039920159680635,
"config_t... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["geebzter"]
class Message(object):
"""
Defines message types for standard framework message
Provides free (global) functions that help create standard messages
such as get_round_end_message etc.
Message... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ServerPackage/Message.py",
"copies": "3",
"size": "6224",
"license": "apache-2.0",
"hash": -2419553589233500000,
"line_mean": 31.9312169312,
"line_max": 102,
"alpha_frac": 0.6177699229,
"autogenerated": false,
"ratio": 4.519970951343501,
"config... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Greg Richards"]
# imports
import Game
class RPSGame(Game.Game):
""" this class simulates two players playing a game of rock, paper, scissors """
def __init__(self):
super(RPSGame, self).__init__()
d... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "RPSGame.py",
"copies": "1",
"size": "1649",
"license": "apache-2.0",
"hash": -1122285099988941300,
"line_mean": 30.1132075472,
"line_max": 84,
"alpha_frac": 0.5245603396,
"autogenerated": false,
"ratio": 3.8891509433962264,
"config_test": fals... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["jeffrey creighton"]
# imports
from ServerPackage import ScorekeeperHistoryItem, ScoreKeeperListItem
class Scorekeeper:
"""
Purpose: to collect and store scores from all players and matches
Attributes:
... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "ServerPackage/Scorekeeper.py",
"copies": "2",
"size": "3735",
"license": "apache-2.0",
"hash": 4004881280318222000,
"line_mean": 34.580952381,
"line_max": 114,
"alpha_frac": 0.6227576975,
"autogenerated": false,
"ratio": 3.964968152866242,
"conf... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["jeffrey creighton"]
# imports
import ScorekeeperHistoryItem
import ScoreKeeperListItem
class Scorekeeper:
"""
Purpose: to collect and store scores from all players and matches
Attributes:
leader_boar... | {
"repo_name": "PaulieC/sprint1_Council_b",
"path": "Scorekeeper.py",
"copies": "1",
"size": "3722",
"license": "apache-2.0",
"hash": -7558343518408593000,
"line_mean": 34.1226415094,
"line_max": 114,
"alpha_frac": 0.6219774315,
"autogenerated": false,
"ratio": 3.9595744680851066,
"config_test":... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["jeffrey creighton"]
class ScorekeeperListItem:
"""
Purpose: data structure for tracking tournament leaders
Attributes:
player: the player who this item is associated with
score: the current sc... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "ServerPackage/ScoreKeeperListItem.py",
"copies": "3",
"size": "1043",
"license": "apache-2.0",
"hash": -7142386786606364000,
"line_mean": 24.4634146341,
"line_max": 66,
"alpha_frac": 0.5819750719,
"autogenerated": false,
"ratio": 4.364016736401673... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Joe Kvedaras, Collin Day"]
# imports
from AllPlayAll import *
class TournamentService:
"""
Set up a tournament with a game and register players
Attributes:
game: the game corresponding to thi... | {
"repo_name": "PaulieC/sprint1_Council_b",
"path": "TournamentService.py",
"copies": "1",
"size": "2191",
"license": "apache-2.0",
"hash": -1164785767181435000,
"line_mean": 30.3142857143,
"line_max": 71,
"alpha_frac": 0.6120492926,
"autogenerated": false,
"ratio": 4.364541832669323,
"config_te... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Joe Kvedaras, Collin Day"]
# imports
from bjsonrpc.handlers import BaseHandler
from AvailableTournaments.AllPlayAll import *
from AvailableGames.RockPaperScissors import *
import importlib
class TournamentService(BaseHan... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "ServerPackage/TournamentService.py",
"copies": "1",
"size": "9787",
"license": "apache-2.0",
"hash": 7988094286459392000,
"line_mean": 36.5019157088,
"line_max": 120,
"alpha_frac": 0.5909880454,
"autogenerated": false,
"ratio": 4.428506787330317,
... |
__author__ = "Paul Council, Joseph Gonzoph, 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 tourna... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ServerPackage/TournamentService.py",
"copies": "1",
"size": "14186",
"license": "apache-2.0",
"hash": -4823307564563568000,
"line_mean": 38.5181058496,
"line_max": 120,
"alpha_frac": 0.5797264909,
"autogenerated": false,
"ratio": 4.402855369335816... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Samantha Holloway, Joe Pannizzo"]
# imports
from ServerPackage import Observer
class Player(Observer.Observer):
"""
Class Player is used as the top level class abstraction to play in a Tournament
It specifies... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "ClientPackage/Player.py",
"copies": "1",
"size": "2234",
"license": "apache-2.0",
"hash": -8729218663376257000,
"line_mean": 26.256097561,
"line_max": 83,
"alpha_frac": 0.5984780662,
"autogenerated": false,
"ratio": 4.025225225225225,
"config_te... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Samantha Holloway, Joe Pannizzo"]
# imports
import Observer
class Player(Observer.Observer):
"""
Class Player is used as the top level class abstraction to play in a Tournament
It specifies what a concrete Pl... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "Player.py",
"copies": "1",
"size": "1527",
"license": "apache-2.0",
"hash": 2372174718213823500,
"line_mean": 28.9411764706,
"line_max": 83,
"alpha_frac": 0.660772757,
"autogenerated": false,
"ratio": 4.195054945054945,
"config_test": false,
... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Tara Crittenden"]
# imports
from ServerPackage import Observer
from ServerPackage.Message import *
class Display(Observer.Observer):
"""
Displays the state of the game in a simple text format.
"""
def no... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ServerPackage/Display.py",
"copies": "2",
"size": "5114",
"license": "apache-2.0",
"hash": -359061373844558340,
"line_mean": 28.738372093,
"line_max": 86,
"alpha_frac": 0.5281579977,
"autogenerated": false,
"ratio": 3.936874518860662,
"config_te... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Tara Crittenden"]
# imports
import Observer
from Message import *
class Display(Observer.Observer):
"""
Displays the state of the game in a simple text format.
"""
def notify(self, msg):
"""
... | {
"repo_name": "PaulieC/sprint1_Council",
"path": "Display.py",
"copies": "1",
"size": "5081",
"license": "apache-2.0",
"hash": 3612379279119723500,
"line_mean": 28.5465116279,
"line_max": 86,
"alpha_frac": 0.5256839205,
"autogenerated": false,
"ratio": 3.9296210363495745,
"config_test": false,
... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Tony"]
# imports
from ServerPackage.TournamentService import *
from AvailablePlayers.RPSPlayerExample import *
from AvailableGames.RockPaperScissors import *
from ServerPackage.Display import *
from AvailablePlayers.BEPCPl... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ServerPackage/RPSDriver.py",
"copies": "2",
"size": "1226",
"license": "apache-2.0",
"hash": 5352283108832383000,
"line_mean": 28.9268292683,
"line_max": 112,
"alpha_frac": 0.6810766721,
"autogenerated": false,
"ratio": 3.7151515151515153,
"conf... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Tony"]
# imports
from TournamentService import *
from RPSPlayerExample import *
from RPSGame import *
from Display import *
from BEPCPlayer import *
class RPSDriver(TournamentService):
"""
Create a tournament ser... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "RPSDriver.py",
"copies": "1",
"size": "1140",
"license": "apache-2.0",
"hash": 6468768209996988000,
"line_mean": 21.3529411765,
"line_max": 112,
"alpha_frac": 0.651754386,
"autogenerated": false,
"ratio": 3.7012987012987013,
"config_test": fal... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Victor M"]
# imports
import random
import Player
import Message
class RPSPlayerSwitcharoo(Player.Player):
"""
Rock paper scissors player
Attributes:
strategy: An object designed to calculate/manipula... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "RPSPlayerSwitcharoo.py",
"copies": "1",
"size": "6841",
"license": "apache-2.0",
"hash": -1258663704705839000,
"line_mean": 30.823255814,
"line_max": 119,
"alpha_frac": 0.5964040345,
"autogenerated": false,
"ratio": 4.138535995160314,
"config_... |
__author__ = "Paul Council, Joseph Gonzoph, 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/man... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ServerPackage/RPSPlayerSwitcharoo.py",
"copies": "2",
"size": "6846",
"license": "apache-2.0",
"hash": 8430946373754488000,
"line_mean": 30.8465116279,
"line_max": 119,
"alpha_frac": 0.5965527315,
"autogenerated": false,
"ratio": 4.139056831922612... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["William Ezekiel"]
# imports
from ServerPackage import Tournament
import random
class SingleElimination(Tournament.Tournament):
"""
SingleElimination Tournament Type:
Every player plays an initial match, but o... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "AvailableTournaments/SingleElimination.py",
"copies": "1",
"size": "2895",
"license": "apache-2.0",
"hash": -2292734186978979300,
"line_mean": 33.4761904762,
"line_max": 108,
"alpha_frac": 0.5993091537,
"autogenerated": false,
"ratio": 3.922764227... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["William Ezekiel"]
# imports
from ServerPackage import Tournament
class AllPlayAll(Tournament.Tournament):
""" AllPlayAll Tournament Type, every player is in a match with every other player """
def __init__(self,... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "AvailableTournaments/AllPlayAll.py",
"copies": "1",
"size": "1266",
"license": "apache-2.0",
"hash": 3769999766855089000,
"line_mean": 31.4871794872,
"line_max": 90,
"alpha_frac": 0.579778831,
"autogenerated": false,
"ratio": 3.7904191616766467,
... |
__author__ = "Paul Council, Joseph Gonzoph, 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 winne... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "AvailableTournaments/SingleElimination.py",
"copies": "1",
"size": "2877",
"license": "apache-2.0",
"hash": -2815508908252727300,
"line_mean": 33.2619047619,
"line_max": 108,
"alpha_frac": 0.596107056,
"autogenerated": false,
"ratio": 3.9089673913... |
__author__ = "Paul Council, Joseph Gonzoph, 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):
... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "AvailableTournaments/AllPlayAll.py",
"copies": "1",
"size": "1208",
"license": "apache-2.0",
"hash": 2835386331294202000,
"line_mean": 30.7894736842,
"line_max": 90,
"alpha_frac": 0.5720198675,
"autogenerated": false,
"ratio": 3.763239875389408,
... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["William Ezekiel"]
# imports
import Tournament
class AllPlayAll(Tournament.Tournament):
""" AllPlayAll Tournament Type, every player is in a match with every other player """
def __init__(self, rounds=5):
... | {
"repo_name": "PaulieC/sprint1_Council",
"path": "AllPlayAll.py",
"copies": "1",
"size": "1215",
"license": "apache-2.0",
"hash": -6147766977528387000,
"line_mean": 30.9736842105,
"line_max": 90,
"alpha_frac": 0.5769547325,
"autogenerated": false,
"ratio": 3.796875,
"config_test": false,
"has... |
__author__ = "Paul Council, Joseph Gonzoph, 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 o... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "AvailablePlayers/TestPlayer1.py",
"copies": "1",
"size": "10089",
"license": "apache-2.0",
"hash": -1057628417287850500,
"line_mean": 31.6537216828,
"line_max": 91,
"alpha_frac": 0.5768658935,
"autogenerated": false,
"ratio": 4.224874371859296,
... |
__author__ = "Paul Council, Joseph Gonzoph, 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 o... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "AvailablePlayers/TestPlayer2.py",
"copies": "1",
"size": "10089",
"license": "apache-2.0",
"hash": 789238850268233900,
"line_mean": 31.6537216828,
"line_max": 91,
"alpha_frac": 0.5768658935,
"autogenerated": false,
"ratio": 4.224874371859296,
"c... |
__author__ = "Paul Council, Joseph Gonzoph, 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 move... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "AvailablePlayers/BEPCPlayer.py",
"copies": "2",
"size": "9821",
"license": "apache-2.0",
"hash": -3887238922410814000,
"line_mean": 31.8494983278,
"line_max": 91,
"alpha_frac": 0.5771306384,
"autogenerated": false,
"ratio": 4.227722772277228,
"c... |
__author__ = "Paul Council, Joseph Gonzoph, 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 curren... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "AvailablePlayers/GMPlayer.py",
"copies": "2",
"size": "9960",
"license": "apache-2.0",
"hash": -5056651528802195000,
"line_mean": 31.8745874587,
"line_max": 91,
"alpha_frac": 0.5765060241,
"autogenerated": false,
"ratio": 4.232894177645559,
"con... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["William Ezekiel"]
# imports
from ClientPackage import Player
class TestPlayer1(Player.Player):
"""
This is Bill and Paul's implemented
Player class
Attributes:
past_moves: a list of the past mov... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "AvailablePlayers/TestPlayer1.py",
"copies": "1",
"size": "10036",
"license": "apache-2.0",
"hash": 1061088047329673900,
"line_mean": 31.6938110749,
"line_max": 91,
"alpha_frac": 0.576624153,
"autogenerated": false,
"ratio": 4.231028667790894,
"c... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["William Ezekiel"]
# imports
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 this... | {
"repo_name": "PaulieC/sprint1_Council",
"path": "BEPCPlayer.py",
"copies": "1",
"size": "10018",
"license": "apache-2.0",
"hash": 3792450546981500000,
"line_mean": 31.6351791531,
"line_max": 91,
"alpha_frac": 0.5758634458,
"autogenerated": false,
"ratio": 4.225221425558836,
"config_test": fals... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint2"
# imports
import bjsonrpc
from ClientPackage.PlayerService import *
import os
class PlayerClient():
"""
TODO
"""
# TODO needs details
def __init__(self, player):
"""
:param player: The player associa... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "ClientPackage/PlayerClient.py",
"copies": "1",
"size": "5646",
"license": "apache-2.0",
"hash": 7793641555008301000,
"line_mean": 29.3602150538,
"line_max": 116,
"alpha_frac": 0.537194474,
"autogenerated": false,
"ratio": 4.235558889722431,
"con... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint2"
# imports
import bjsonrpc
from ServerPackage.TournamentService import *
from ServerPackage.server_ipsearch import *
class TournamentServer():
"""
TODO
"""
# TODO needs details
def __init__(self):
"""
... | {
"repo_name": "PaulieC/sprint2-Council",
"path": "ServerPackage/TournamentServer.py",
"copies": "1",
"size": "1771",
"license": "apache-2.0",
"hash": -8629424182574070000,
"line_mean": 25.0588235294,
"line_max": 93,
"alpha_frac": 0.5364201016,
"autogenerated": false,
"ratio": 4.147540983606557,
... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint2"
# imports
import bjsonrpc, time
from ClientPackage.PlayerService import *
import os
class PlayerClient():
"""
TODO
"""
# TODO needs details
def __init__(self, player):
"""
:param player: The player a... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ClientPackage/PlayerClient.py",
"copies": "1",
"size": "7509",
"license": "apache-2.0",
"hash": -6681807858578339000,
"line_mean": 32.3777777778,
"line_max": 116,
"alpha_frac": 0.551604741,
"autogenerated": false,
"ratio": 4.178631051752921,
"co... |
__author__ = "Paul Council & William Ezekiel"
__date__ = "November 24 2014"
__version__ = "1.0.1"
#imports
import Tournament
""" AllPlayAll Tournament Type, every player is in a match with every other player """
class AllPlayAll(Tournament.Tournament):
def __init__(self,rounds = 5):
""" Initialize Al... | {
"repo_name": "PaulieC/RPSPlayer",
"path": "AllPlayAll.py",
"copies": "3",
"size": "1100",
"license": "apache-2.0",
"hash": 8409371312300416000,
"line_mean": 34.4838709677,
"line_max": 86,
"alpha_frac": 0.5927272727,
"autogenerated": false,
"ratio": 3.642384105960265,
"config_test": false,
"h... |
__author__ = "Paul Council & William Ezekiel"
__date__ = "November 30 2014"
__version__ = "1.0.1"
#imports
import Tournament
class AllPlayAll(Tournament.Tournament):
""" AllPlayAll Tournament Type, every player is in a match with every other player"""
def __init__(self, rounds=5):
""" Initialize All... | {
"repo_name": "PaulieC/sprint1_Council_a",
"path": "AllPlayAll.py",
"copies": "3",
"size": "1088",
"license": "apache-2.0",
"hash": 2900063034041227300,
"line_mean": 33,
"line_max": 89,
"alpha_frac": 0.5900735294,
"autogenerated": false,
"ratio": 3.7006802721088436,
"config_test": false,
"has... |
import time
# BME280 default address.
BME280_I2CADDR = 0x77
# Operating Modes
BME280_OSAMPLE_1 = 1
BME280_OSAMPLE_2 = 2
BME280_OSAMPLE_4 = 3
BME280_OSAMPLE_8 = 4
BME280_OSAMPLE_16 = 5
# BME280 Registers
BME280_REGISTER_DIG_T1 = 0x88 # Trimming parameter registers
BME280_REGISTER_DIG_T2 = 0x8A
BME280_REGISTER_DIG... | {
"repo_name": "OffenesJena/JenLoRa",
"path": "LoPy/LoAirRohr01/lib/bme280.py",
"copies": "1",
"size": "12274",
"license": "apache-2.0",
"hash": 5806819415676880000,
"line_mean": 37.8417721519,
"line_max": 82,
"alpha_frac": 0.6192765195,
"autogenerated": false,
"ratio": 3.1650335224342445,
"conf... |
__author__="Paul H, Horea Christian"
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
def remappedColorMap(cmap, start=0, midpoint=0.5, stop=1.0,
name='shiftedcmap'):
'''
Function to offset the median value of a colormap, and scale the
remain... | {
"repo_name": "dblalock/flock",
"path": "python/analyze/classify/colormap_utils.py",
"copies": "1",
"size": "2079",
"license": "mit",
"hash": -173836164790273150,
"line_mean": 34.2542372881,
"line_max": 72,
"alpha_frac": 0.6195286195,
"autogenerated": false,
"ratio": 3.6219512195121952,
"config... |
__author__ = 'paulie'
import socket
import fcntl
import struct
import sys
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(
s.fileno(),
0x891... | {
"repo_name": "PaulieC/sprint3-Council",
"path": "ServerPackage/server_ipsearch.py",
"copies": "2",
"size": "1261",
"license": "apache-2.0",
"hash": 4572502761872039400,
"line_mean": 25.2916666667,
"line_max": 60,
"alpha_frac": 0.4908802538,
"autogenerated": false,
"ratio": 3.940625,
"config_te... |
__author__ = 'Paulina Kania'
import os
import parser
import random
options = parser.parser()
input_type = options.input_type
folder_path = options.input_path
file_path = options.filename
output_path_def = options.output_path
if folder_path == '':
path = os.listdir(os.getcwd())
else:
path = os.listdir(folder_... | {
"repo_name": "paulinapmk/VCF_converter",
"path": "vcf_converter.py",
"copies": "1",
"size": "11463",
"license": "mit",
"hash": 2105089104561743400,
"line_mean": 38.9442508711,
"line_max": 146,
"alpha_frac": 0.455727122,
"autogenerated": false,
"ratio": 4.033427163969036,
"config_test": false,
... |
import unittest
from pysqlite2 import dbapi2 as sqlite
class DumpTests(unittest.TestCase):
def setUp(self):
self.cx = sqlite.connect(":memory:")
self.cu = self.cx.cursor()
def tearDown(self):
self.cx.close()
def CheckTableDump(self):
expected_sqls = [
"CRE... | {
"repo_name": "x303597316/hue",
"path": "desktop/core/ext-py/pysqlite/pysqlite2/test/dump.py",
"copies": "45",
"size": "1755",
"license": "apache-2.0",
"hash": 2207630377428886000,
"line_mean": 32.75,
"line_max": 77,
"alpha_frac": 0.5048433048,
"autogenerated": false,
"ratio": 3.5240963855421685,... |
import unittest
import sqlite3 as sqlite
class DumpTests(unittest.TestCase):
def setUp(self):
self.cx = sqlite.connect(":memory:")
self.cu = self.cx.cursor()
def tearDown(self):
self.cx.close()
def CheckTableDump(self):
expected_sqls = [
"""CREATE TABLE "i... | {
"repo_name": "maxdeliso/elevatorSim",
"path": "Lib/sqlite3/test/dump.py",
"copies": "3",
"size": "2074",
"license": "bsd-2-clause",
"hash": -6920080475124854000,
"line_mean": 33.5666666667,
"line_max": 77,
"alpha_frac": 0.4807135969,
"autogenerated": false,
"ratio": 3.6903914590747333,
"config... |
#!/usr/bin/python
import flask
import time
import subprocess as sub
import subprocess
import re
import fcntl
import sys
import os
import filecmp
from flask import Flask, render_template, request, jsonify, url_for, Response
from flask_jsonrpc import JSONRPC
app = Flask(__name__)
jsonrpc=JSONRPC(app,'/api',enable_web... | {
"repo_name": "benno16/extraFiles",
"path": "FlaskApp/ImagerModule/__init__.py",
"copies": "1",
"size": "6057",
"license": "mit",
"hash": -4132746197211369500,
"line_mean": 29.285,
"line_max": 157,
"alpha_frac": 0.596169721,
"autogenerated": false,
"ratio": 3.3408714837286264,
"config_test": fa... |
__author__ = 'paul'
import nightoutdata
import numpy
import math
class id3node:
def __init__(self, name):
self.isDecision = False
self.name = name
self.branches = []
def id3(rows, attributes, target):
if(rows == None or len(rows) == 0):
node = id3node('None')
node.isDe... | {
"repo_name": "hakuliu/inf552",
"path": "hw1/ID3.py",
"copies": "1",
"size": "4293",
"license": "apache-2.0",
"hash": -1850436136292777000,
"line_mean": 27.8187919463,
"line_max": 84,
"alpha_frac": 0.6177498253,
"autogenerated": false,
"ratio": 3.6818181818181817,
"config_test": false,
"has_n... |
__author__ = 'paul'
import string
import sys
from itertools import imap
from sets import Set
from cdr import CDR
from utils import quiet_logs
from pyspark import SparkContext, StorageLevel
"""Spatio-temporal Aggregation module.
Given a CDR dataset and a set of geographical regions, it returns presence timeseries f... | {
"repo_name": "project-asap/telecom-analytics",
"path": "src/python/statistics/spatio_temporal_aggregation.py",
"copies": "1",
"size": "2616",
"license": "apache-2.0",
"hash": 774019301675832000,
"line_mean": 35.8450704225,
"line_max": 115,
"alpha_frac": 0.6976299694,
"autogenerated": false,
"rat... |
__author__ = 'paul'
class NodeSingleLL:
def __init__(self, data=None, nextnode=None):
self.data = data
self.nextnode = nextnode
return
def getdata(self):
return self.data
def getnext(self):
return self.nextnode
def setnext(self, nextnode):
self.nextnod... | {
"repo_name": "hakuliu/codepractice",
"path": "datastructures/linkedlist.py",
"copies": "1",
"size": "3810",
"license": "apache-2.0",
"hash": -6116691288221852000,
"line_mean": 27.6541353383,
"line_max": 101,
"alpha_frac": 0.567191601,
"autogenerated": false,
"ratio": 3.993710691823899,
"config... |
__author__ = 'Paul'
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth import logout
from django.core import serializers
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mode... | {
"repo_name": "snetdev1/snetDjango",
"path": "snet/views.py",
"copies": "1",
"size": "3682",
"license": "mit",
"hash": -3764337189970108000,
"line_mean": 31.0260869565,
"line_max": 87,
"alpha_frac": 0.6700162955,
"autogenerated": false,
"ratio": 4.132435465768799,
"config_test": false,
"has_n... |
__author__ = 'paul'
import logging
import random
import Quote
import QuoteGroup
from google.appengine.ext import ndb
class QuotePersistenceManager(object):
@ndb.transactional
def create_quote(self, group, quote, author, contributor):
quote_group_key = ndb.Key(QuoteGroup.QuoteGroup, group)
qu... | {
"repo_name": "marshalllaw18/quotechu",
"path": "quotechu-server/app/QuotePersistenceManager.py",
"copies": "1",
"size": "1846",
"license": "apache-2.0",
"hash": -5904495042279072000,
"line_mean": 28.3174603175,
"line_max": 79,
"alpha_frac": 0.5801733478,
"autogenerated": false,
"ratio": 3.969892... |
__author__ = 'paul'
import os
import random
import sys
import unittest
from google.appengine.ext import ndb
from google.appengine.ext import testbed
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'app'))
import helpers
import QuotePersistenceManager
import Quote
class MyTestCase(unittest.TestCase):
... | {
"repo_name": "marshalllaw18/quotechu",
"path": "quotechu-server/test/testQuotePersistenceManager.py",
"copies": "1",
"size": "3588",
"license": "apache-2.0",
"hash": -5369819842209877000,
"line_mean": 35.2424242424,
"line_max": 78,
"alpha_frac": 0.6518952062,
"autogenerated": false,
"ratio": 4.0... |
__author__ = 'paul'
import random
import numpy
TARGETDIM = 2
class FastMapper:
def __init__(self, distances):
self.distances = distances.copy()
self.n = len(distances)
self.images = numpy.zeros((self.n,TARGETDIM))
self.pivots = numpy.zeros((2,TARGETDIM))
self.col = -1
... | {
"repo_name": "hakuliu/inf552",
"path": "hw3/fastmap.py",
"copies": "1",
"size": "2201",
"license": "apache-2.0",
"hash": 4264699878040198700,
"line_mean": 29.1643835616,
"line_max": 104,
"alpha_frac": 0.532485234,
"autogenerated": false,
"ratio": 3.3097744360902257,
"config_test": false,
"ha... |
__author__ = 'paul'
SIZE = 'Size'
OCCUPIED = 'Occupied'
PRICE = 'Price'
MUSIC = 'Music'
LOCATION = 'Location'
VIP = 'VIP'
BEER = 'Favorite Beer'
ENJOY = 'Enjoy'
class Row:
def __init__(self, size, occupied, price, music, location, vip, beer, enjoyed):
self.attr = {
SIZE: size,
OCCU... | {
"repo_name": "hakuliu/inf552",
"path": "hw1/nightoutdata.py",
"copies": "1",
"size": "1114",
"license": "apache-2.0",
"hash": -2143806831983209000,
"line_mean": 20.4230769231,
"line_max": 88,
"alpha_frac": 0.5251346499,
"autogenerated": false,
"ratio": 2.6973365617433416,
"config_test": false,... |
__author__ = 'pauloalmeida'
import requests
import json
import math
from threading import Thread
HOST = 'http://<your-website>/'
ENDPOINTTRANSLATE = '/translate.php?from=%s&to=%s&txt=%s'
class GoogleTranslateService:
def __init__(self):
pass
@staticmethod
def execute(from_lang='en', to_lang=''... | {
"repo_name": "LoduccaPublicidade/easywaylyrics_public",
"path": "02-Sourcecode/01-Server/easywaylyrics/shared/googletranslate.py",
"copies": "1",
"size": "5835",
"license": "mit",
"hash": -2291329345261612300,
"line_mean": 36.6516129032,
"line_max": 158,
"alpha_frac": 0.5588688946,
"autogenerated"... |
__author__ = 'pauloalmeida'
"""
Constants for BaseResponse
"""
HTTP_RESPONSE_ERROR = -1
HTTP_RESPONSE_ARTIST_SONG_NOTFOUND = -2
HTTP_RESPONSE_OK = 0
HTTP_RESPONSE_TIMESTAMPED_LYRICS_NOTFOUND = 1
"""
Constants for SearchArtistSongLyricWithLyricsResponse
"""
HTTP_RESPONSE_LYRICS_TRACKINSTRUMENTAL=2
class BaseRespo... | {
"repo_name": "LoduccaPublicidade/easywaylyrics_public",
"path": "02-Sourcecode/01-Server/easywaylyrics/shared/response.py",
"copies": "1",
"size": "2020",
"license": "mit",
"hash": -732660612468029700,
"line_mean": 28.7058823529,
"line_max": 155,
"alpha_frac": 0.7108910891,
"autogenerated": false,... |
__author__ = 'paulo.rodenas'
from scipy.io import wavfile
import numpy as np
import ewlplot
import math
import sys
rate_full_music, dat_full_music = wavfile.read('/Users/paulo.rodenas/workspaceIdea/easywaylyrics/05-Sourcecode/03-Reference/echonestsyncprint/music/Iron_Maiden_Judas_Be_My_Guide_NoiseRemoval.wav')
# rate_... | {
"repo_name": "LoduccaPublicidade/easywaylyrics_public",
"path": "02-Sourcecode/03-Reference/echonestsyncprint/main.py",
"copies": "1",
"size": "2962",
"license": "mit",
"hash": 8620919612180487000,
"line_mean": 62.0212765957,
"line_max": 292,
"alpha_frac": 0.7434166104,
"autogenerated": false,
"... |
__author__ = 'paulo.rodenas'
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile
from numpy import linspace
import math
import sys
from utility import pcm2float
rate_full_music, dat_full_music = wavfile.read('/Users/paulo.rodenas/workspaceIdea/easywaylyrics/05-Sourcecode/03-Reference/echon... | {
"repo_name": "LoduccaPublicidade/easywaylyrics_public",
"path": "02-Sourcecode/03-Reference/echonestsyncprint/ewlplotxcorr.py",
"copies": "1",
"size": "1209",
"license": "mit",
"hash": -1756311488638701000,
"line_mean": 36.8125,
"line_max": 176,
"alpha_frac": 0.7816377171,
"autogenerated": false,
... |
__author__ = 'paulo.rodenas'
from itertools import ifilter, imap
import regex as re
from validation.cnpj import Cnpj
from validation.date import Date
import logging
class BaseFuzzyRegex(object):
@staticmethod
def approximate_match(word_re, lines, fuzziness='e<=1'):
logger = logging.getLogger(__name_... | {
"repo_name": "willschumekel/ocr-process-service",
"path": "service/postprocessing.py",
"copies": "4",
"size": "5134",
"license": "mit",
"hash": -1715429246665847600,
"line_mean": 34.9090909091,
"line_max": 93,
"alpha_frac": 0.5490845345,
"autogenerated": false,
"ratio": 3.393258426966292,
"con... |
__author__ = 'paulo.rodenas'
from pylab import plot, show, title, xlabel, ylabel, subplot, savefig
from scipy import fft, arange, ifft
from numpy import sin, linspace, pi
from scipy.io.wavfile import read,write
def plotSpectru(y,Fs):
n = len(y) # lungime semnal
k = arange(n)
T = n/Fs
frq = k/T # two ... | {
"repo_name": "LoduccaPublicidade/easywaylyrics_public",
"path": "02-Sourcecode/03-Reference/echonestsyncprint/freqanalysistest.py",
"copies": "1",
"size": "1028",
"license": "mit",
"hash": -8642319975831329000,
"line_mean": 24.7,
"line_max": 151,
"alpha_frac": 0.670233463,
"autogenerated": false,
... |
__author__ = 'paulo.rodenas'
"""
Helper functions for working with audio files in NumPy.
"""
import numpy as np
import contextlib
def pcm2float(sig, dtype=np.float64):
"""
Convert PCM signal to floating point with a range from -1 to 1.
Use dtype=np.float32 for single precision.
Parameters
------... | {
"repo_name": "LoduccaPublicidade/easywaylyrics_public",
"path": "02-Sourcecode/03-Reference/echonestsyncprint/utility.py",
"copies": "1",
"size": "1392",
"license": "mit",
"hash": 3636910640182226000,
"line_mean": 23.8571428571,
"line_max": 78,
"alpha_frac": 0.6300287356,
"autogenerated": false,
... |
__author__ = 'paulo.rodenas'
import logging
import os
from PIL import Image
import pyocr
import pyocr.builders
from pyocr.cuneiform import CuneiformError
from wand.image import Image as WandImage
from opencv import OpenCVIntegration
from threading import Thread
class PyOCRIntegration(object):
def __init__(self,... | {
"repo_name": "willschumekel/ocr-process-service",
"path": "service/ocr.py",
"copies": "2",
"size": "4625",
"license": "mit",
"hash": -2633349332017156000,
"line_mean": 34.5846153846,
"line_max": 82,
"alpha_frac": 0.5351351351,
"autogenerated": false,
"ratio": 4.512195121951219,
"config_test": ... |
__author__ = 'paulo.rodenas'
import random
class Cnpj:
"""
Utilty class defines certain methods related to Brazilian CNPJs validation
"""
@staticmethod
def validate(cnpj):
"""
Method to validate brazilian cnpjs
Tests:
>>> print Cnpj.validate('61882613000194')
... | {
"repo_name": "nfscan/fuzzy_cnpj_matcher",
"path": "models/Cnpj.py",
"copies": "1",
"size": "3995",
"license": "mit",
"hash": 6079553386229893000,
"line_mean": 24.6153846154,
"line_max": 85,
"alpha_frac": 0.5181476846,
"autogenerated": false,
"ratio": 3.438037865748709,
"config_test": false,
... |
__author__ = 'paulpm'
class Astar(object):
def __init__(self):
# variable used to determined search function
self.nodes_expanded= 0
self.nodes_created = 0
self.closedlist = []
self.opendict = dict()
self.closeddict = dict()
self.openlist = self.generate_ope... | {
"repo_name": "pmitche/it3105-aiprogramming",
"path": "project1/common/astar.py",
"copies": "1",
"size": "4262",
"license": "mit",
"hash": -3761691279950471000,
"line_mean": 34.2314049587,
"line_max": 85,
"alpha_frac": 0.6168465509,
"autogenerated": false,
"ratio": 4.133850630455868,
"config_te... |
__author__ = 'paulpm, sondredyvik'
import cspstate as state
from collections import deque
'''
NOTE
Something is very odd. Probably because there is no check to see whether a search state is a success or not.
It will start iterating over the elements of a string instead.
'''
# TODO Implement functionality to check if... | {
"repo_name": "pmitche/it3105-aiprogramming",
"path": "project1/module2/gac.py",
"copies": "1",
"size": "3307",
"license": "mit",
"hash": -3975134181039715000,
"line_mean": 43.0933333333,
"line_max": 108,
"alpha_frac": 0.6483217418,
"autogenerated": false,
"ratio": 4.180783817951959,
"config_te... |
__author__ = "paul.tunison@kitware.com"
from . import ncr
def next_perm(v):
"""
Compute the lexicographically next bit permutation
Generates next permutation with a given amount of set bits,
given the previous lexicographical value.
Taken from http://graphics.stanford.edu/~seander/bithacks.html... | {
"repo_name": "kfieldho/SMQTK",
"path": "python/smqtk/utils/bit_utils.py",
"copies": "1",
"size": "2128",
"license": "bsd-3-clause",
"hash": 3430433066115895300,
"line_mean": 21.8817204301,
"line_max": 76,
"alpha_frac": 0.5789473684,
"autogenerated": false,
"ratio": 3.4212218649517685,
"config_... |
__author__ = "paul.tunison@kitware.com"
def partition_string(s, segments):
"""
Partition a string into a number of segments. If the given number of
segments does not divide evenly into the string's length, extra characters
are added to the leading segments in order to allow for the requested number
... | {
"repo_name": "kfieldho/SMQTK",
"path": "python/smqtk/utils/string_utils.py",
"copies": "2",
"size": "1804",
"license": "bsd-3-clause",
"hash": -8028845221184212000,
"line_mean": 31.2142857143,
"line_max": 105,
"alpha_frac": 0.6197339246,
"autogenerated": false,
"ratio": 3.6666666666666665,
"co... |
__author__ = 'Pavan Prabhakar Bhat'
"""
CSCI-603: Intro Lecture (week 1)
Section
Author: Pavan Prbahakar Bhat
This is a demo program that draws several Python heads. It demonstrates
the importance of using a hierarchy of functions that can be re-used.
"""
# modules required by the program imported here
i... | {
"repo_name": "pavanbhat/Python-Labs",
"path": "typography.py",
"copies": "1",
"size": "7475",
"license": "bsd-3-clause",
"hash": 8202769491657888000,
"line_mean": 20.7896341463,
"line_max": 97,
"alpha_frac": 0.5776588629,
"autogenerated": false,
"ratio": 3.2670454545454546,
"config_test": fals... |
__author__ = 'pavel'
import argparse
from itertools import chain
def filter_marking(marking):
marking = open(marking, "rt")
lines = []
for line in marking:
name = line.strip().split('\t')[0]
data = [int(k) for k in line.strip().split('\t')[1:]]
borders = [c for i, c in enumerate(... | {
"repo_name": "zmactep/igcat",
"path": "scripts/filter_marking.py",
"copies": "1",
"size": "1327",
"license": "bsd-2-clause",
"hash": 4007601722325524000,
"line_mean": 27.2340425532,
"line_max": 73,
"alpha_frac": 0.5139412208,
"autogenerated": false,
"ratio": 3.351010101010101,
"config_test": f... |
__author__ = 'pavel'
import argparse
import sys
from multiprocessing import Pool, cpu_count
from rdkit import Chem
from rdkit.Chem import rdMMPA
def fragment_mol(smi, smi_id=''):
mol = Chem.MolFromSmiles(smi)
outlines = set()
if mol is None:
sys.stderr.write("Can't generate mol for: %s\n" % sm... | {
"repo_name": "DrrDom/crem",
"path": "crem/fragmentation.py",
"copies": "1",
"size": "2949",
"license": "bsd-3-clause",
"hash": -3813895142334578000,
"line_mean": 31.7666666667,
"line_max": 119,
"alpha_frac": 0.5683282469,
"autogenerated": false,
"ratio": 3.2803114571746383,
"config_test": fals... |
__author__ = 'pavel'
import argparse
import sys
from itertools import permutations
from multiprocessing import Pool, cpu_count
from rdkit import Chem
from .mol_context import get_std_context_core_permutations
def process_line(line):
# returns env_smi, core_smi, heavy_atoms_num, core_smarts
output = []
... | {
"repo_name": "DrrDom/crem",
"path": "crem/frag_to_env_mp.py",
"copies": "1",
"size": "6389",
"license": "bsd-3-clause",
"hash": -2186754391539619800,
"line_mean": 43.0620689655,
"line_max": 120,
"alpha_frac": 0.5498513069,
"autogenerated": false,
"ratio": 3.938964241676942,
"config_test": fals... |
__author__ = 'pavel'
import argparse
def parse(filename):
query_pattern = "<b>Query=</b> "
region_pattern = "<tr><td> {}"
region_split = " </td><td> "
current = None
curreg = []
result = []
with open(filename, "rt") as fd:
for line in fd:
if line.startswith(query_patte... | {
"repo_name": "zmactep/igcat",
"path": "scripts/parser/igblast_html_parser.py",
"copies": "1",
"size": "1772",
"license": "bsd-2-clause",
"hash": 9073587751360997000,
"line_mean": 30.6607142857,
"line_max": 72,
"alpha_frac": 0.4667042889,
"autogenerated": false,
"ratio": 4.027272727272727,
"con... |
# ----------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------------
from __future__ import with_statement
import os
import re
import logging
import glob
import unicodedata
import ctypes
import win32api
import win32con... | {
"repo_name": "curaloucura/Enso-Ubuntu",
"path": "enso/contrib/open/platform/win32/control_panel_vista_win7.py",
"copies": "1",
"size": "17657",
"license": "bsd-3-clause",
"hash": 4954838614414838000,
"line_mean": 36.0945378151,
"line_max": 129,
"alpha_frac": 0.5995922297,
"autogenerated": false,
... |
# ----------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------------
import sys
import logging
# ----------------------------------------------------------------------------
# Globals
# ------------------------------... | {
"repo_name": "curaloucura/Enso-Ubuntu",
"path": "enso/contrib/platform/__init__.py",
"copies": "1",
"size": "4433",
"license": "bsd-3-clause",
"hash": -1790485092175448600,
"line_mean": 36.5677966102,
"line_max": 91,
"alpha_frac": 0.6293706294,
"autogenerated": false,
"ratio": 4.570103092783505,... |
import os
import ctypes
import win32api
import logging
from ctypes import wintypes
class ControlPanelInfo(object):
CPL_INIT = 1
CPL_GETCOUNT = 2
CPL_INQUIRE = 3
CPL_EXIT = 7
CPL_NEWINQUIRE = 8
class NEWCPLINFO(ctypes.Structure):
class _NEWCPLINFO_UNION(ctypes.Union)... | {
"repo_name": "curaloucura/Enso-Ubuntu",
"path": "enso/contrib/open/platform/win32/control_panel.py",
"copies": "1",
"size": "7803",
"license": "bsd-3-clause",
"hash": 3595093790546561000,
"line_mean": 39.7272727273,
"line_max": 106,
"alpha_frac": 0.5240292195,
"autogenerated": false,
"ratio": 4.... |
import os
import logging
import pythoncom
from win32com.shell import shell, shellcon
from enso.contrib.open.interfaces import abstractMethod
class _PyShortcut():
def __init__(self, base, filename=None):
self._base = base
self._base_loaded = False
self._shortcut_type = None... | {
"repo_name": "curaloucura/Enso-Ubuntu",
"path": "enso/contrib/open/platform/win32/win_shortcuts.py",
"copies": "1",
"size": "7476",
"license": "bsd-3-clause",
"hash": 2624212215029667300,
"line_mean": 36.5463917526,
"line_max": 107,
"alpha_frac": 0.5964419476,
"autogenerated": false,
"ratio": 4.... |
# ----------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------------
import re
import os
import win32api
def expand_win_path_variables(file_path):
re_env = re.compile(r'%\w+%')
def expander(mo):
... | {
"repo_name": "curaloucura/Enso-Ubuntu",
"path": "enso/contrib/open/platform/win32/utils.py",
"copies": "1",
"size": "4949",
"license": "bsd-3-clause",
"hash": -8576967938384001000,
"line_mean": 35.5075757576,
"line_max": 95,
"alpha_frac": 0.5999191756,
"autogenerated": false,
"ratio": 4.12416666... |
from EMAN2_cppwrap import *
from global_def import *
import sys
import types
def ali3d(stack, ref_vol, outdir, maskfile = None, ir = 1, ou = -1, rs = 1,
xr = "4 2 2 1", yr = "-1", ts = "1 1 0.5 0.25", delta = "10 6 4 4", an = "-1",
center = 0, maxit = 5, term = 95, CTF = False, fourvar = False, snr = 1.0... | {
"repo_name": "mcianfrocco/Appion_freehand",
"path": "lib/functions.py",
"copies": "2",
"size": "37878",
"license": "mit",
"hash": -2423910857096213500,
"line_mean": 36.7270916335,
"line_max": 212,
"alpha_frac": 0.6424573631,
"autogenerated": false,
"ratio": 2.537889447236181,
"config_test": fa... |
__author__ = 'pawel'
import re
import csv
def oscToTempConverter(raw_results, calibrations, final_results):
with open(raw_results, 'r') as raw_results_data, open(calibrations) as calibration_data,\
open(final_results, 'w+') as final_results_data:
coeffs = getCalibrationCoefficients(calibration_d... | {
"repo_name": "ComputerArchitectureGroupPWr/Simulio",
"path": "build/lib.linux-x86_64-2.7/Simulio/converter.py",
"copies": "2",
"size": "1954",
"license": "mit",
"hash": 3986090021743793700,
"line_mean": 34.5272727273,
"line_max": 115,
"alpha_frac": 0.5307062436,
"autogenerated": false,
"ratio": ... |
__author__ = 'PAY.ON'
import opp
import logging
import threading
logger = logging.getLogger("example_facade_concurrent")
def success_worker(num, worker_api):
#success_worker creates a transaction and should succeed
# create payment parameters
basic_payment = opp.facade.BasicPayment(amount='92.00', curre... | {
"repo_name": "OpenPaymentPlatform/python",
"path": "example_facade_concurrent.py",
"copies": "1",
"size": "2014",
"license": "mit",
"hash": -1164026654675304700,
"line_mean": 36.2962962963,
"line_max": 121,
"alpha_frac": 0.6479642502,
"autogenerated": false,
"ratio": 3.8,
"config_test": false,... |
__author__ = 'PAY.ON'
import tests.core
import tests
class TestRegistration(tests.core.abstract_payments_test_case.AbstractPaymentsTestCase):
def test_create_get_delete_registration(self):
registration1 = self.API.registrations().create(**{"paymentBrand": "AMEX",
... | {
"repo_name": "OpenPaymentPlatform/python",
"path": "tests/core/test_registrations.py",
"copies": "1",
"size": "1264",
"license": "mit",
"hash": 5116689991625753000,
"line_mean": 51.6666666667,
"line_max": 92,
"alpha_frac": 0.5047468354,
"autogenerated": false,
"ratio": 5.096774193548387,
"conf... |
__author__ = 'pbatra'
import httplib
import zipfile
import StringIO
import calendar
import Predict_StockMarket.config as cnf
import datetime
import Database.SQLiteDBOperations as d
#Function to find next date in int from int according to the parameter given
def dateAfterDays(startDate='',numOfDays=1):
#print "H... | {
"repo_name": "PaarthBatra/Predict_StockMarket",
"path": "download_bhav.py",
"copies": "1",
"size": "7425",
"license": "mit",
"hash": 1791103329207888000,
"line_mean": 37.8795811518,
"line_max": 160,
"alpha_frac": 0.682020202,
"autogenerated": false,
"ratio": 3.291223404255319,
"config_test": f... |
__author__ = "pbaxi"
from collections import defaultdict
api_methods = defaultdict(set)
api_methods["1"] = {
"about.php",
"action_log_report.php",
"asset_data_report.php",
"asset_domain.php",
"asset_domain_list.php",
"asset_group_delete.php",
"asset_group_list.php",
"asset_ip_list.php... | {
"repo_name": "paragbaxi/qualysapi",
"path": "qualysapi/api_methods.py",
"copies": "1",
"size": "4287",
"license": "apache-2.0",
"hash": -6850675505483666000,
"line_mean": 28.1632653061,
"line_max": 95,
"alpha_frac": 0.5980872405,
"autogenerated": false,
"ratio": 2.780155642023346,
"config_test... |
__author__ = 'pbmanis'
"""
Copyright 2014 Paul Manis and Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
import re
from PyQt4 import QtGui, QtCore
import acq4.pyqtgraph as pg
try:
import matplotlib as MP
from matplotlib.ticker import FormatStrFormatter
import ma... | {
"repo_name": "tropp/acq4",
"path": "acq4/util/matplotlibexporter.py",
"copies": "3",
"size": "7794",
"license": "mit",
"hash": -3836043300027751400,
"line_mean": 36.1142857143,
"line_max": 107,
"alpha_frac": 0.6259943546,
"autogenerated": false,
"ratio": 3.630181648812296,
"config_test": false... |
__author__ = 'pbmanis'
"""
dataSummary: This script reads all of the data files in a given directory, and prints out top level information
including notes, protocols run (and whether or not they are complete), and image files associated with a cell.
Currently, this routine makes assumptions about the layout as a hierar... | {
"repo_name": "mgraupe/acq4",
"path": "acq4/analysis/scripts/dataSummary.py",
"copies": "3",
"size": "24242",
"license": "mit",
"hash": 6621651706880182000,
"line_mean": 42.3685152057,
"line_max": 152,
"alpha_frac": 0.5337843412,
"autogenerated": false,
"ratio": 4.0336106489184695,
"config_test... |
__author__ = 'pbmanis'
from collections import OrderedDict
import re
import numpy as np
import scipy.stats
#initialized = False
#
#if not initialized:
# global summary, initialized
# summary=[]
# initialized = True
class Params(object):
"""
Class to make organized data a bit like a C struct.
In... | {
"repo_name": "tropp/acq4",
"path": "acq4/analysis/scripts/chr2analysis.py",
"copies": "3",
"size": "17064",
"license": "mit",
"hash": -1459722321718602800,
"line_mean": 47.0676056338,
"line_max": 132,
"alpha_frac": 0.5271917487,
"autogenerated": false,
"ratio": 3.7735515258735073,
"config_test... |
__author__ = 'pc1'
from tkinter import *
import random
import time
import pygame
class Ball:
def __init__(self, canvas, paddle, color):
self.canvas = canvas
self.paddle = paddle
self.id = canvas.create_oval(10, 10, 25, 25, fill=color)
self.canvas.move(self.id, 245, 100)
sta... | {
"repo_name": "saintdragon2/python-3-lecture-2015",
"path": "sinsojael_final/2nd_presentation/3조/break.py",
"copies": "1",
"size": "2641",
"license": "mit",
"hash": 3792292279592342500,
"line_mean": 27.0957446809,
"line_max": 70,
"alpha_frac": 0.5509276789,
"autogenerated": false,
"ratio": 3.1477... |
__author__ = 'pc1'
from tkinter import *
import random
import time
tk = Tk()
tk.title("Break bricks")
tk.resizable(0,0)
tk.wm_attributes("-topmost", 1)
canvas = Canvas(tk, width=500, height=400, bd=0, highlightthickness=0)
canvas.pack()
tk.update()
class Ball:
def __init__(self, canvas, color):
self.canva... | {
"repo_name": "saintdragon2/python-3-lecture-2015",
"path": "sinsojael_final/1st_presentation/3조/gameone.py",
"copies": "1",
"size": "1159",
"license": "mit",
"hash": -5593625768823117000,
"line_mean": 22.18,
"line_max": 70,
"alpha_frac": 0.5910267472,
"autogenerated": false,
"ratio": 2.890274314... |
__author__ = 'pcamargo'
from datetime import timedelta
import numpy as np
import pandas as pd
from rtree import index # Wheel from Chris Gohlke's website
from map_matching.aequilibrae import Graph, PathResults, path_computation
from geopy.distance import vincenty as gc
def find_route(trip, network):
vehicle_... | {
"repo_name": "pedrocamargo/map_matching",
"path": "map_matching/finding_routes.py",
"copies": "1",
"size": "8583",
"license": "apache-2.0",
"hash": 2195880338810268700,
"line_mean": 41.4900990099,
"line_max": 151,
"alpha_frac": 0.5122917395,
"autogenerated": false,
"ratio": 3.7529514648010496,
... |
__author__ = 'pchaosgit'
__email__ = 'drifthua@gmail.com'
# -*-coding:utf-8-*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import datetime
import wget
import os
import tempfile
from bs4 import BeautifulSoup
import logging
logging.basicConfig... | {
"repo_name": "pchaosgit/SSEannouncement",
"path": "SSEannouncement.py",
"copies": "1",
"size": "5255",
"license": "apache-2.0",
"hash": -1505105773371596000,
"line_mean": 37.9924242424,
"line_max": 169,
"alpha_frac": 0.6425102001,
"autogenerated": false,
"ratio": 3.1156174334140436,
"config_te... |
__author__ = 'pchaosgit'
__email__ = 'drifthua@gmail.com'
# -*-coding:utf-8-*-
# http://disclosure.szse.cn/m/search0425.jsp?stockCode=000998&startTime=2013-10-02&endTime=2015-10-18
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as ui
import datetime
f... | {
"repo_name": "pchaosgit/SSEannouncement",
"path": "SZSEAnnouncement.py",
"copies": "1",
"size": "4619",
"license": "apache-2.0",
"hash": 7838390047816255000,
"line_mean": 37.4661016949,
"line_max": 138,
"alpha_frac": 0.6228244107,
"autogenerated": false,
"ratio": 3.3155588020452886,
"config_te... |
__author__ = 'PC-LiNing buaa'
import time
from bigchaindb import payload
from collections import deque
from cryptoconditions import crypto
from bigchaindb import exceptions
"""Added tools for SimpleChaindb
1.convert between timestamp and time
2.operations with payload
3.construct transaction
... | {
"repo_name": "charitychain/Charitychain",
"path": "Simplechaindb/bigchaindb/tool.py",
"copies": "1",
"size": "6618",
"license": "apache-2.0",
"hash": 3248624918111039000,
"line_mean": 27.6493506494,
"line_max": 84,
"alpha_frac": 0.578120278,
"autogenerated": false,
"ratio": 3.906729634002361,
... |
__author__ = 'PC-LiNing'
from bigchaindb import Bigchain
from bigchaindb import crypto
import time
b=Bigchain()
# user A
testuser1_priv, testuser1_pub = crypto.generate_key_pair()
print("testuser1_priv:"+testuser1_priv)
print("testuser1_pub:"+testuser1_pub)
payload = {
"msg" : "first charge for user A",... | {
"repo_name": "charitychain/Charitychain",
"path": "Simplechaindb/test/create.py",
"copies": "1",
"size": "1414",
"license": "apache-2.0",
"hash": 7522979112095085000,
"line_mean": 28.4583333333,
"line_max": 81,
"alpha_frac": 0.5933521924,
"autogenerated": false,
"ratio": 3.1918735891647856,
"c... |
__author__ = 'PC-LiNing'
import logging
import rethinkdb as r
from bigchaindb import crypto,util,Bigchain
logger = logging.getLogger(__name__)
class ChainQuery(object):
def __init__(self, host=None, port=None, dbname=None,pub_key=None,priv_key=None,keyring=[],
consensus_plugin=None):
... | {
"repo_name": "charitychain/Charitychain",
"path": "Simplechaindb/test/bigchainQuery.py",
"copies": "1",
"size": "2977",
"license": "apache-2.0",
"hash": -991890337661670700,
"line_mean": 32.4494382022,
"line_max": 156,
"alpha_frac": 0.6503191132,
"autogenerated": false,
"ratio": 3.54404761904761... |
__author__ = 'pc'
#a simple database usage
import shelve
def store_person(db):
"""
Query user for data and store it in the shelf object
"""
pid = raw_input('Enter unique ID number: ')
person = {}
person['name'] = raw_input('Enter name: ')
person['age'] = raw_input('Enter age: ')
perso... | {
"repo_name": "hisuley/sxj",
"path": "practice/test6.py",
"copies": "1",
"size": "1584",
"license": "mit",
"hash": -925191474558941300,
"line_mean": 23.3692307692,
"line_max": 78,
"alpha_frac": 0.5656565657,
"autogenerated": false,
"ratio": 3.9014778325123154,
"config_test": false,
"has_no_ke... |
__author__ = 'pc'
#a small server
import socket
s = socket.socket()
host = s.getpeername
port = 1234
s.bind(host, sort)
s.listen(5)
while True:
c, addr = s.accept()
print 'Got connection from ', addr
c.send('Thank you for connecting')
c.close()
import socket
s = socket.socket()
host = socket.get... | {
"repo_name": "hisuley/sxj",
"path": "practice/test11.py",
"copies": "1",
"size": "2406",
"license": "mit",
"hash": 4909776516572077000,
"line_mean": 19.75,
"line_max": 72,
"alpha_frac": 0.5872817955,
"autogenerated": false,
"ratio": 3.695852534562212,
"config_test": false,
"has_no_keywords":... |
__author__ = 'pc'
#decprator
class MyClass:
@staticmethod
def smeth():
print "This is a static method"
@classmethod
def cmeth(cls):
print "This is a class of ", cls
MyClass.smeth()
MyClass.cmeth()
#__setattr__ and __getattr__
class Rectangle:
def __init__(self):
self.... | {
"repo_name": "hisuley/sxj",
"path": "practice/test4.py",
"copies": "1",
"size": "1485",
"license": "mit",
"hash": -3091671933739775000,
"line_mean": 15.875,
"line_max": 48,
"alpha_frac": 0.5043771044,
"autogenerated": false,
"ratio": 3.6486486486486487,
"config_test": false,
"has_no_keywords... |
__author__ = 'pdh21'
from astropy.io import fits
import scipy.stats as st
import numpy as np
from astropy.io import fits
def ymod_map(prior,flux):
"""Create replicated model map (no noise or background) i.e. A*f
:param prior: xidplus.prior class
:param flux: flux vector
:return: map array, in same fo... | {
"repo_name": "H-E-L-P/XID_plus",
"path": "xidplus/posterior_maps.py",
"copies": "2",
"size": "4459",
"license": "mit",
"hash": 3542638378726926300,
"line_mean": 37.4482758621,
"line_max": 113,
"alpha_frac": 0.6115721014,
"autogenerated": false,
"ratio": 3.0520191649555097,
"config_test": false... |
__author__ = 'pdh21'
from pymoc import MOC
from healpy import pixelfunc
from pymoc.util import catalog
import healpy as hp
import numpy as np
def get_HEALPix_pixels(order,ra,dec,unique=True):
"""Work out what HEALPix a source is in
:param order: order of HEALPix
:param ra: Right Ascension
:param de... | {
"repo_name": "pdh21/XID_plus",
"path": "xidplus/moc_routines.py",
"copies": "2",
"size": "5819",
"license": "mit",
"hash": 5524836770580832000,
"line_mean": 30.9725274725,
"line_max": 115,
"alpha_frac": 0.6739989689,
"autogenerated": false,
"ratio": 3.2078280044101435,
"config_test": false,
... |
__author__ = 'pdh21'
import os
import numpy as np
from numpy import long
output_dir=os.getcwd()
full_path = os.path.realpath(__file__)
path, file = os.path.split(full_path)
stan_path=os.path.split(os.path.split(path)[0])[0]+'/stan_models/'
def all_bands(PACS_100,PACS_160,chains=4,iter=1000):
"""
Fit the two ... | {
"repo_name": "pdh21/XID_plus",
"path": "xidplus/stan_fit/PACS.py",
"copies": "2",
"size": "2936",
"license": "mit",
"hash": -6833806885622773000,
"line_mean": 38.1466666667,
"line_max": 87,
"alpha_frac": 0.5640326975,
"autogenerated": false,
"ratio": 2.546400693842151,
"config_test": false,
... |
__author__ = 'pdh21'
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, NUTS
import jax.numpy as jnp
from jax import random
import numpy as np
import jax
import os
from xidplus.numpyro_fit.misc import sp_matmul
numpyro.set_host_device_count(os.cpu_count())
def mips_model(priors):
... | {
"repo_name": "H-E-L-P/XID_plus",
"path": "xidplus/numpyro_fit/MIPS.py",
"copies": "2",
"size": "1599",
"license": "mit",
"hash": 2458454055537199000,
"line_mean": 39,
"line_max": 124,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 2.7055837563451774,
"config_test": false,
"has_... |
_author__ = 'pdh21'
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, NUTS
import jax.numpy as jnp
from jax import random
import numpy as np
import jax
import os
from xidplus.numpyro_fit.misc import sp_matmul
numpyro.set_host_device_count(os.cpu_count())
def pacs_model(priors):
... | {
"repo_name": "H-E-L-P/XID_plus",
"path": "xidplus/numpyro_fit/PACS.py",
"copies": "2",
"size": "2131",
"license": "mit",
"hash": -6872688985073864000,
"line_mean": 42.5102040816,
"line_max": 124,
"alpha_frac": 0.6499296105,
"autogenerated": false,
"ratio": 2.6537982565379825,
"config_test": fa... |
_author__ = 'pdh21'
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, NUTS
import jax.numpy as jnp
from jax import random
import numpy as np
import jax
import os
numpyro.set_host_device_count(os.cpu_count())
from xidplus.numpyro_fit.misc import sp_matmul
def spire_model(priors):
... | {
"repo_name": "H-E-L-P/XID_plus",
"path": "xidplus/numpyro_fit/SPIRE.py",
"copies": "2",
"size": "2619",
"license": "mit",
"hash": -3633090303626748000,
"line_mean": 48.4339622642,
"line_max": 124,
"alpha_frac": 0.6422298587,
"autogenerated": false,
"ratio": 2.634808853118712,
"config_test": fa... |
_author__ = 'pdh21'
import numpyro
import numpyro.distributions as dist
from numpyro.infer.reparam import TransformReparam
import jax.numpy as jnp
import numpy as np
from xidplus.numpyro_fit.misc import sp_matmul
def spire_model_CIGALE(priors, sed_prior,params):
"""
numpyro model for SPIRE maps using cigale... | {
"repo_name": "pdh21/XID_plus",
"path": "xidplus/numpyro_fit/SED_prior.py",
"copies": "2",
"size": "7197",
"license": "mit",
"hash": -5340440886992410000,
"line_mean": 46.98,
"line_max": 121,
"alpha_frac": 0.6049742948,
"autogenerated": false,
"ratio": 3.211512717536814,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.