index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
20,571 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/models/model.py | import os
from googlespreadsheet2django.models.field import *
from googlespreadsheet2django.models.abstract_model import *
class Model(object):
FIELDS_STARTROW = 3
def __init__(self, modelLoader, name, worksheet, answers):
self._modelLoader = modelLoader
self._name = name
self._answers = answers
self... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,572 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/answers/answers.py | from googlespreadsheet2django.answers.choice import *
class Answers(object):
def __init__(self, name):
self._name = name
self._choices = []
def __unicode__(self):
res = '%s = (\n' % self._name
res += ",\n".join( map( str, self._choices ) )+','
res += '\n)\n'
return res
def __str__(self): return self._... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,573 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /tests/django/details/admins/CountryAdmin.py |
from details.models import Country
from django.forms import Textarea, CheckboxSelectMultiple
from django.forms.models import ModelMultipleChoiceField
from django.utils.translation import ugettext as _
from django.contrib import admin
from django.conf import settings
from django.db import models
from common.admintools ... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,574 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/models/models_loader.py | from googlespreadsheet2django.models.field import *
from googlespreadsheet2django.models.model import *
class ModelsLoader(object):
def __init__(self, workbook, answers):
self._models = []
for worksheetName in workbook.sheet_names():
if worksheetName.startswith('Table_'):
worksheet = workbook.sheet_by_na... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,575 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/answers/answers_loader.py | from googlespreadsheet2django.answers.choice import *
from googlespreadsheet2django.answers.answers import *
class AnswersLoader(object):
def __init__(self, workbook):
self._answersList = []
worksheet = workbook.sheet_by_name('Answers')
for line in range(1, worksheet.nrows, 2):
answersname = worksheet.c... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,576 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/builder.py | # -*- coding: utf-8 -*-
import argparse, os, requests, xlrd
from googlespreadsheet2django.models.models_loader import ModelsLoader
from googlespreadsheet2django.answers.answers_loader import AnswersLoader
def export_code(documentID, path):
INPUTFILE = os.path.join(path, documentID+'.xlsx' )
r = requests.get('https... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,577 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/models/field.py | # -*- coding: utf-8 -*-
import os
class Field(object):
CHOICES_ABBR_LEN = 10 # Number of characters in each answer abbreviation (choice)
def __init__(self, model, answers, tab, group, worksheet, row):
self._answers = answers
self._model = model
self._tab = tab
self._group = group
self._colum... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,578 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /tests/django/details/models.py | ##### auto:start:Person #####
from abstractmodels.Person import AbstractPerson
class Person(AbstractPerson):
pass
##### auto:end:Person #####
##### auto:start:Country #####
from abstractmodels.Country import AbstractCountry
class Country(AbstractCountry):
pass
##### auto:end:Country #####
| {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,579 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /googlespreadsheet2django/models/abstract_model.py | from googlespreadsheet2django.models.field import *
class AbstractModel(object):
def __init__(self, tab, group):
self._tab = tab
self._group = group
self._fields = []
def addField(self, field):
self._fields.append(field)
def __unicode__(self):
res = "class %s(models.Model):\n" % self.tablename
res +... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,580 | UmSenhorQualquer/googlespreadsheet2django | refs/heads/master | /setup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = "0.0"
__maintainer__ = "Ricardo Ribeiro"
__email__ = "ricardojvr@gmail.com"
__status__ = "Development"
from setuptools import setup
setup(
name ... | {"/tests/test1.py": ["/googlespreadsheet2django/builder.py"], "/googlespreadsheet2django/answers/answers.py": ["/googlespreadsheet2django/answers/choice.py"], "/googlespreadsheet2django/models/models_loader.py": ["/googlespreadsheet2django/models/field.py", "/googlespreadsheet2django/models/model.py"], "/googlespreadsh... |
20,589 | yinchuandong/A3C-FlappyBird | refs/heads/master | /a3c.py | import os
import sys
import tensorflow as tf
import numpy as np
import math
import threading
import signal
from a3c_network import A3CFFNetwork, A3CLSTMNetwork
from a3c_actor_thread import A3CActorThread
from config import *
def log_uniform(lo, hi, rate):
log_lo = math.log(lo)
log_hi = math.log(hi)
v =... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,590 | yinchuandong/A3C-FlappyBird | refs/heads/master | /game/test_client.py | import socket
import sys
import numpy as np
import cPickle
import time
HOST, PORT = "localhost", 9600
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def main():
# data = " ".join(sys.argv[1:])
# send action
sock.sendto(str(1), (HOST, PORT))
header = sock.recv(1000)
header = cPickle... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,591 | yinchuandong/A3C-FlappyBird | refs/heads/master | /DRQN.py | import tensorflow as tf
import numpy as np
import random
import time
import os
import sys
from netutil import *
from game.flappy_bird import FlappyBird
from replay_buffer import ReplayBuffer
INPUT_SIZE = 84
INPUT_CHANNEL = 4
ACTIONS_DIM = 2
LSTM_UNITS = 256
LSTM_MAX_STEP = 8
GAMMA = 0.99
FINAL_EPSILON = 0.0001
INITI... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,592 | yinchuandong/A3C-FlappyBird | refs/heads/master | /customgame/custom_flappy_bird.py | import os
import sys
import numpy as np
import random
import pygame
import pygame.surfarray as surfarray
# from pygame.locals import *
from itertools import cycle
class CustomFlappyBird(object):
def __init__(self, fps=60, screen_width=288, screen_height=512, display_screen=True, frame_skip=1):
pygame.init... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,593 | yinchuandong/A3C-FlappyBird | refs/heads/master | /customgame/__init__.py | from customgame.custom_flappy_bird import CustomFlappyBird | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,594 | yinchuandong/A3C-FlappyBird | refs/heads/master | /a3c_actor_thread.py | import tensorflow as tf
import numpy as np
import random
import time
from a3c_network import A3CFFNetwork, A3CLSTMNetwork
from config import *
from game.game_state import GameState
def timestamp():
return time.time()
class A3CActorThread(object):
def __init__(self,
thread_index,
... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,595 | yinchuandong/A3C-FlappyBird | refs/heads/master | /config.py | GAME = 'flappy-bird'
STATE_DIM = 84
STATE_CHN = 4
ACTION_DIM = 2
LOCAL_T_MAX = 5 # repeat step size
RMSP_ALPHA = 0.99 # decay parameter for RMSProp
RMSP_EPSILON = 0.1 # epsilon parameter for RMSProp
GAMMA = 0.99
ENTROPY_BETA = 0.0 # 0.01 for FFNet
MAX_TIME_STEP = 10 * 10**7
INITIAL_ALPHA_LOW = 1e-4 # log_unifor... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,596 | yinchuandong/A3C-FlappyBird | refs/heads/master | /replay_buffer.py | from collections import deque
import random
import numpy as np
class ReplayBuffer(object):
def __init__(self, capacity):
self.capacity = capacity
self.buffer = deque(maxlen=self.capacity)
return
def sample(self, batch_size, timestep):
'''
sample from buffer, get [batch... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,597 | yinchuandong/A3C-FlappyBird | refs/heads/master | /netutil.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.01)
return tf.Variable(initial)
def bias_variable(shape):
initial =... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,598 | yinchuandong/A3C-FlappyBird | refs/heads/master | /game_server.py | import sys
import cPickle
import math
from game.flappy_bird import FlappyBird
from SocketServer import BaseRequestHandler, UDPServer
flapp_bird = FlappyBird()
class UDPHandler(BaseRequestHandler):
def handle(self):
action = self.request[0]
action = cPickle.loads(action)
socket = self.r... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,599 | yinchuandong/A3C-FlappyBird | refs/heads/master | /dqn_custom.py | import tensorflow as tf
import numpy as np
import random
import time
import os
from collections import deque
from netutil import conv_variable, fc_variable, conv2d, flatten_conv_layer, max_pool_2x2
from customgame import CustomFlappyBird
from PIL import Image
INPUT_SIZE = 84
INPUT_CHANNEL = 4
ACTIONS_DIM = 2
GAMMA = ... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,600 | yinchuandong/A3C-FlappyBird | refs/heads/master | /DQN.py | import tensorflow as tf
import numpy as np
import random
import time
import os
import sys
from netutil import *
from game.flappy_bird import FlappyBird
from collections import deque
INPUT_SIZE = 84
INPUT_CHANNEL = 4
ACTIONS_DIM = 2
LSTM_UNITS = 512
GAMMA = 0.99
FINAL_EPSILON = 0.0001
INITIAL_EPSILON = 0.0001
ALPHA ... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,601 | yinchuandong/A3C-FlappyBird | refs/heads/master | /game/game_state.py | import socket
import numpy as np
import cPickle
class GameState:
def __init__(self, index=0, host='localhost', port=9600):
self.host = host
self.port = port + index
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.reset()
return
def frame_step(self, in... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,602 | yinchuandong/A3C-FlappyBird | refs/heads/master | /game_gym_server.py | import sys
import cPickle
import math
from SocketServer import BaseRequestHandler, UDPServer
from ple.games.flappybird import FlappyBird
from ple import PLE
flapp_bird = FlappyBird()
ple = PLE(flapp_bird, fps=30, display_screen=True)
print ple.getActionSet()
ple.init()
def test():
global ple
for i in range... | {"/customgame/__init__.py": ["/customgame/custom_flappy_bird.py"]} |
20,606 | airring/pubg | refs/heads/master | /pubg-flask.py | from flask import Flask,redirect,url_for,render_template,request,session
import os,socket,time,json
import config
from flask import current_app
app = Flask(__name__)
############ๅ ่ฝฝdb้
็ฝฎ
app.config.from_object(config)
##############sessionๅ ็
app.config['SECRET_KEY'] = '~\xc8\xc6\xe0\xf3,\x98O\xa8z4\xfb=\rNd'
#db=SQLAlc... | {"/pubg-flask.py": ["/config.py"]} |
20,607 | airring/pubg | refs/heads/master | /config.py |
dialect='mysql'
driver='mysqldb'
username='pd'
password='test123456'
host='192.168.3.105'
port='3306'
database='uppor'
#dialect+driver://username:password@host:port/database
SQLALCHEMY_DATABASE_URI="{}+{}://{}:{}@{}:{}/{}?charset=utf8".format(dialect,driver,username,password,host,port,database)
SQLALCHEMY_TRACK_MODI... | {"/pubg-flask.py": ["/config.py"]} |
20,609 | texuf/whiskeynode | refs/heads/master | /whiskeynode/terminals.py |
from functools import partial
from whiskeynode import whiskeycache
from whiskeynode import WhiskeyNode
from whiskeynode.edges import Edge
from whiskeynode.terminaltypes import TerminalType
from whiskeynode.exceptions import (BadEdgeRemovalException,
InvalidEdgeDataException,
... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,610 | texuf/whiskeynode | refs/heads/master | /examples/friendsoffriends.py |
'''
to run in python terminal:
python -c "execfile('examples/friendsoffriends.py')"
'''
from examples.helpers import Nameable
from random import random
from whiskeynode import WhiskeyNode
from whiskeynode.db import db
from whiskeynode.edges import Edge
from whiskeynode.terminals import outbound_node, bidirectional_lis... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,611 | texuf/whiskeynode | refs/heads/master | /tests/__main__.py |
if __name__ == "__main__":
import nose
if not nose.run():
import sys
global mongo
import mongomock as mongo
sys.exit(123) #if the tests fail, return non zero value to break build script
| {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,612 | texuf/whiskeynode | refs/heads/master | /whiskeynode/voter.py | from whiskeynode import WhiskeyNode
from whiskeynode.db import db
from whiskeynode.exceptions import InvalidEdgeParameterException
from whiskeynode.fieldtypes import _none
class Voter(WhiskeyNode):
'''
DOCUMENTBASE PROPERTIES
'''
COLLECTION_NAME = 'edges_voters'
COLLECTION = db[COLLECTION_NAME]
... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,613 | texuf/whiskeynode | refs/heads/master | /tests/test_whiskeynode.py | from bson.objectid import ObjectId
from bson.dbref import DBRef
from datetime import datetime, timedelta
from functools import partial
from unittest import TestCase
from whiskeynode import WhiskeyNode
from whiskeynode import whiskeycache
from whiskeynode.db import db
from whiskeynode.exceptions import InvalidFieldNameE... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,614 | texuf/whiskeynode | refs/heads/master | /whiskeynode/fieldtypes.py | '''
because sometimes you want a boolean that defaults to true
'''
#suppored types from pymongo:
'''
=================================== ============= ===================
Python Type BSON Type Supported Direction
=================================== ============= ==========... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,615 | texuf/whiskeynode | refs/heads/master | /profile.py | import sys
import timeit
print 'fuck yes'
def run_profile():
print 'oh yeah'
setup='''
from whiskeynode import WhiskeyNode
from whiskeynode import whiskeycache
from whiskeynode.db import db
default_sort = [('_id', -1)]
class Node(WhiskeyNode):
COLLECTION_NAME = 'test_node'
COLLECTION = db[COLLECTI... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,616 | texuf/whiskeynode | refs/heads/master | /examples/activities.py |
'''
to run in python terminal:
python -c "execfile('examples/activities.py')"
'''
from bson.code import Code
from examples.helpers import Nameable, make_list
from random import random
from whiskeynode import WhiskeyNode
from whiskeynode.db import db
from whiskeynode.edges import Edge
from whiskeynode.terminals import ... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,617 | texuf/whiskeynode | refs/heads/master | /whiskeynode/events.py | from bson.objectid import ObjectId
from whiskeynode import WhiskeyNode
from whiskeynode.db import db
from whiskeynode.exceptions import InvalidEdgeParameterException
from whiskeynode.fieldtypes import _none
class WhiskeyEvent(WhiskeyNode):
'''
DOCUMENTBASE PROPERTIES
'''
COLLECTION_NAME = 'whiskeynod... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,618 | texuf/whiskeynode | refs/heads/master | /examples/helpers.py |
class Nameable():
'''little mixin to pull records by name'''
@classmethod
def from_name(cls, name):
c = cls.find_one({'name':name})
return c if c else cls({'name':name})
def make_list(items):
''' takes list of Nameable or string, returns punctiated string - any library version shouldn'... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,619 | texuf/whiskeynode | refs/heads/master | /whiskeynode/terminaltypes.py |
class TerminalType():
NODE = 'node'
LIST_OF_NODES = 'list_of_nodes'
class TerminalDict(dict):
def __getattr__(self, attr):
return self.get(attr, None)
__setattr__= dict.__setitem__
__delattr__= dict.__delitem__
def __repr__(self):
ret_val = ['{\n']
keys = self.keys... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,620 | texuf/whiskeynode | refs/heads/master | /whiskeynode/db.py | import os
## Environment
environment = os.environ.get('ENVIRONMENT', 'test')
## Database
global mongo
if environment == 'test':
global mongo
import mongomock as mongo
else:
global mongo
import pymongo as mongo
db_uri = os.environ.get('MONGOLAB_URI', 'mongodb://localhost')
db_name = os.environ.get('... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,621 | texuf/whiskeynode | refs/heads/master | /tests/test_edge.py | from unittest import TestCase
from whiskeynode.edges import Edge
class EdgeBaseTest(TestCase):
def tearDown(self):
Edge.COLLECTION.drop()
def test_init_should_return_yeah(self):
d = Edge()
self.assertIsInstance(d, Edge)
| {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,622 | texuf/whiskeynode | refs/heads/master | /whiskeynode/__init__.py | from bson.objectid import ObjectId, InvalidId
from collections import deque
from datetime import datetime
from functools import partial
from pprint import pformat
from pprintpp import pprint
from whiskeynode import whiskeycache
from whiskeynode.db import db
from whiskeynode.exceptions import (BadEdgeRemovalException,
... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,623 | texuf/whiskeynode | refs/heads/master | /whiskeynode/traversals.py |
from functools import partial
from whiskeynode.terminaltypes import TerminalType
def lazy_traversal(path, render=True, default_value=None, default_attr=None):
return partial(LazyTraversal, path, render=render, default_value=default_value, default_attr=default_attr)
class LazyTraversal():
def __init__(sel... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,624 | texuf/whiskeynode | refs/heads/master | /whiskeynode/edges.py | from whiskeynode import WhiskeyNode
from whiskeynode.db import db
from whiskeynode.exceptions import InvalidEdgeParameterException
from whiskeynode.fieldtypes import _none
class Edge(WhiskeyNode):
'''
DOCUMENTBASE PROPERTIES
'''
COLLECTION_NAME = 'whiskeynode_edges'
COLLECTION = db[COLLECTI... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,625 | texuf/whiskeynode | refs/heads/master | /tests/test_whiskeynode_terminals.py | from bson.objectid import ObjectId
from unittest import TestCase
from whiskeynode import WhiskeyNode
from whiskeynode.db import db
from whiskeynode.edges import Edge
from whiskeynode.exceptions import InvalidConnectionNameException, InvalidTerminalException, InvalidTerminalStateException
from whiskeynode.terminals impo... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,626 | texuf/whiskeynode | refs/heads/master | /setup.py | import os
import platform
from setuptools import setup
install_requires = ['mongomock', 'pymongo', 'pprintpp']
if platform.python_version() < '2.7':
install_requires.append('unittest2')
setup(
name='whiskeynode',
version='0.1',
url='https://github.com/texuf/whiskeynode',
classifiers = [
... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,627 | texuf/whiskeynode | refs/heads/master | /whiskeynode/exceptions.py |
class WhiskeyNodeException(Exception):pass
'''
cache
'''
class WhiskeyCacheException(WhiskeyNodeException):pass
'''
node connections
'''
class ConnectionNotFoundException(WhiskeyNodeException):pass
class FieldNameNotDefinedException(WhiskeyNodeException):pass
class CollectionNotDefinedException(WhiskeyNodeExcepti... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,628 | texuf/whiskeynode | refs/heads/master | /tests/test_whiskeynode_traversals.py | from bson.objectid import ObjectId
from bson.dbref import DBRef
from datetime import datetime
from functools import partial
from unittest import TestCase
from whiskeynode import WhiskeyNode
from whiskeynode import whiskeycache
from whiskeynode.db import db
from whiskeynode.edges import Edge
from whiskeynode.exceptions ... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,629 | texuf/whiskeynode | refs/heads/master | /whiskeynode/indexes.py | ''' to run:
from whiskeynode.indexes import ensure_indexes
ensure_indexes()
'''
import pkgutil
import pyclbr
import whiskeynode
try:
import nodes
except:
nodes = None
def ensure_indexes(logger=None, do_print=True):
if nodes:
_ensure_index(nodes, logger, do_print)
_ensure_index(whiskeynode, lo... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,630 | texuf/whiskeynode | refs/heads/master | /whiskeynode/whiskeycache.py | from bson.objectid import ObjectId
from operator import attrgetter
from threading import Lock
from whiskeynode.exceptions import WhiskeyCacheException
import itertools
import weakref
'''
Weak Reference RAM - if something exists in memory, you should be able to find it here
'''
#MONKEY PATCH FOR 2.7
def weak_ref_len(s... | {"/whiskeynode/voter.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/whiskeynode/events.py": ["/whiskeynode/__init__.py", "/whiskeynode/db.py", "/whiskeynode/exceptions.py", "/whiskeynode/fieldtypes.py"], "/tests/test_edge.py": ["/whiskeynode/edges.... |
20,631 | phoeinx/EvaP | refs/heads/master | /evap/results/tests/test_tools.py |
from django.test.testcases import TestCase
from django.core.cache import caches
from django.conf import settings
from django.test import override_settings
from model_mommy import mommy
from evap.evaluation.models import Contribution, RatingAnswerCounter, Questionnaire, Question, Course, UserProfile
from evap.results... | {"/evap/results/tests/test_tools.py": ["/evap/results/tools.py"], "/evap/results/views.py": ["/evap/results/tools.py"], "/evap/results/templatetags/results_templatetags.py": ["/evap/results/tools.py"]} |
20,632 | phoeinx/EvaP | refs/heads/master | /evap/results/views.py | from collections import OrderedDict, namedtuple
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, render
from django.contrib.auth.decorators import login_required
from evap.evaluation.models import Semester, Degree, Contribution
from evap.evaluation.auth import intern... | {"/evap/results/tests/test_tools.py": ["/evap/results/tools.py"], "/evap/results/views.py": ["/evap/results/tools.py"], "/evap/results/templatetags/results_templatetags.py": ["/evap/results/tools.py"]} |
20,633 | phoeinx/EvaP | refs/heads/master | /evap/results/tools.py | from collections import namedtuple, defaultdict, OrderedDict
from functools import partial
from math import ceil
from statistics import pstdev, median
from django.conf import settings
from django.core.cache import caches
from django.db.models import Sum
from evap.evaluation.models import TextAnswer, Contribution, Rat... | {"/evap/results/tests/test_tools.py": ["/evap/results/tools.py"], "/evap/results/views.py": ["/evap/results/tools.py"], "/evap/results/templatetags/results_templatetags.py": ["/evap/results/tools.py"]} |
20,634 | phoeinx/EvaP | refs/heads/master | /evap/results/templatetags/results_templatetags.py | from django.template import Library
from evap.results.tools import get_grade_color, get_deviation_color
register = Library()
@register.filter(name='gradecolor')
def gradecolor(grade):
return 'rgb({}, {}, {})'.format(*get_grade_color(grade))
@register.filter(name='deviationcolor')
def deviationcolor(deviation):... | {"/evap/results/tests/test_tools.py": ["/evap/results/tools.py"], "/evap/results/views.py": ["/evap/results/tools.py"], "/evap/results/templatetags/results_templatetags.py": ["/evap/results/tools.py"]} |
20,635 | socrateschieregato/TravelsTest | refs/heads/master | /travels/helpers.py | import json
import logging
import urllib.parse
from travels.exceptions import NotFoundException
from travels.urls import urls, Views
logger = logging.getLogger('backend')
def route_data_or_404(pieces):
try:
method, url_data, protocol = pieces[0].strip().split()
query_params = {}
if '?' i... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,636 | socrateschieregato/TravelsTest | refs/heads/master | /travels/urls.py | from travels.views import Views
r = Views()
urls = [
('routes', r.routes),
('new_route', r.new_route),
('get_route', r.get_route)
]
| {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,637 | socrateschieregato/TravelsTest | refs/heads/master | /travels/views.py | from travels.exceptions import ErrorWriteFile
from travels.script import FindRoute, write_file
from settings import FILE
class Views:
def __init__(self, route_data=None, file_data=None):
self.data = file_data or FILE
self.route = FindRoute(file_data=self.data)
self.route_data = route_data... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,638 | socrateschieregato/TravelsTest | refs/heads/master | /tests/test_api.py | import json
import unittest
from socket import socket, AF_INET, SOCK_STREAM
from travels.script import FindRoute
from settings import FILE, INITIAL_DATA
def remove_last_line():
with open(FILE, 'w') as f:
for row in INITIAL_DATA:
f.writelines(row)
class TestApi(unittest.TestCase):
def s... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,639 | socrateschieregato/TravelsTest | refs/heads/master | /tests/test_script.py | import logging
import mock
import os
import unittest
from getopt import GetoptError
from travels.exceptions import ErrorWriteFile
from travels.script import FindRoute, write_file, file_data_console
from settings import FILE
logger = logging.getLogger('backend')
class TestScript(unittest.TestCase):
def setUp(se... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,640 | socrateschieregato/TravelsTest | refs/heads/master | /travels/exceptions.py |
class NotFoundException(Exception):
pass
class ErrorWriteFile(Exception):
pass
| {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,641 | socrateschieregato/TravelsTest | refs/heads/master | /travels/script.py | #!/usr/bin/python
import logging
import sys
import getopt
from travels.exceptions import ErrorWriteFile
logger = logging.getLogger('backend')
class FindRoute:
def __init__(self, source=None, destination=None, file_data=None):
self.source = source.upper() if source else None
self.destination = d... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,642 | socrateschieregato/TravelsTest | refs/heads/master | /settings.py | import os
FILE = os.environ.get('FILE', 'tests/input-file-test.csv')
DATA_STRUCTURE = "HTTP/1.1 {status_code} {status}\r\n" \
"Content-Type: application/json; charset=utf-8" \
"\r\n\r\n{body}\r\n\r\n"
INITIAL_DATA = [
'GRU,BRC,10\n',
'BRC,SCL,5\n',
'GRU,CDG,75\n',
'GRU,SCL,2... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,643 | socrateschieregato/TravelsTest | refs/heads/master | /server.py | import logging
from socket import (
AF_INET,
socket,
SOCK_STREAM,
SHUT_WR
)
from travels.exceptions import NotFoundException
from travels.helpers import route_data_or_404, get_view
from settings import DATA_STRUCTURE
logger = logging.getLogger('backend')
class Server:
def create_server(self):
... | {"/travels/helpers.py": ["/travels/exceptions.py", "/travels/urls.py"], "/travels/urls.py": ["/travels/views.py"], "/travels/views.py": ["/travels/exceptions.py", "/travels/script.py", "/settings.py", "/travels/helpers.py"], "/tests/test_api.py": ["/travels/script.py", "/settings.py"], "/tests/test_script.py": ["/trave... |
20,656 | ouyangwuhai/freemind_to_excel | refs/heads/master | /lib/freemind_to_project.py | #!/usr/bin/env python3
#
# freemind_to_project.py
#
# Copyright LiKneu 2019
#
import pprint # Similar to Data::Dumper
import lxml.etree as ET # handling XML
def main(args):
return 0
def get_pj_path(fm_path):
'''Takes the XPATH of the Freemind parent element and returns the XPATH
of the Freemind element... | {"/main.py": ["/lib/freemind_to_excel.py", "/lib/freemind_to_project.py", "/lib/freemind_to_word.py"]} |
20,657 | ouyangwuhai/freemind_to_excel | refs/heads/master | /lib/freemind_to_word.py | #!/usr/bin/env python3
#
# freemind_to_word.py
#
# Copyright LiKneu 2019
#
import lxml.etree as ET # handling XML
import docx # handling of MS Word documents
def main(args):
return 0
def to_word(input_file, output_file):
'''Converts the Freeemind XML file into an MS Mord DOCX file.'''
print... | {"/main.py": ["/lib/freemind_to_excel.py", "/lib/freemind_to_project.py", "/lib/freemind_to_word.py"]} |
20,658 | ouyangwuhai/freemind_to_excel | refs/heads/master | /main.py | #!/usr/bin/env python3
#
# Copyright LiKneu 2019
#
# Converts Freemind XML files into other file formats like:
# * Excel
#
import sys # command line options
from lib.freemind_to_excel import to_excel
from lib.freemind_to_project import to_project
from lib.freemind_to_word import to_word
def main():
script = sy... | {"/main.py": ["/lib/freemind_to_excel.py", "/lib/freemind_to_project.py", "/lib/freemind_to_word.py"]} |
20,659 | ouyangwuhai/freemind_to_excel | refs/heads/master | /lib/freemind_to_excel.py | #!/usr/bin/env python3
def to_excel(input_file, output_file):
'''Converts the Freeemind XML file into an Excel sheet.'''
import lxml.etree as ET # handling XML
import openpyxl # handling Excel files
from tqdm import tqdm # progress bar
print('Converting to Excel')
print('Input file ... | {"/main.py": ["/lib/freemind_to_excel.py", "/lib/freemind_to_project.py", "/lib/freemind_to_word.py"]} |
20,661 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/streaming/util/show_single.py | import numpy as np
import matplotlib.pyplot as plt
from encoding import UYVY_RAW2RGB_PIL
with open('test.raw', 'rb') as f:
data = np.array(list(f.read()), dtype='uint8')
img = UYVY_RAW2RGB_PIL(data, 720, 576)
img.show()
#frame = data[1::2].reshape(720, 576)
#plt.imshow(frame)
#plt.show()
| {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,662 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/argos.py | """
Argos reel for LED wall.
Just some harmless eyes, looking around.
TODO: check if colours look decent on wall.
Created by kratenko.
"""
import numpy as np
import time
import random
from fluter import Fluter
iris = """
-
aaaa -
aaaaaa -
aaaooaaa -
aaooooaa -
... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,663 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/audio_beatdetection.py | import datetime
import numpy as np
class AudioBeatdetection:
def __init__(self, _num_leds_h=16, _num_leds_v=24):
self.num_leds_h = _num_leds_h
self.num_leds_v = _num_leds_v
self.leds = np.zeros((_num_leds_v, _num_leds_h, 3))
self.last_measurement = datetime.datetime.now()
#T... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,664 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/image_loader.py | import numpy as np
from os import listdir
from os.path import isfile, join
import random
from PIL import Image
from PIL import ImageEnhance
_FORMAT = "RGB"
class ImageLoader:
def __init__(self, _num_leds_h=16, _num_leds_v=24):
self.num_leds_h = _num_leds_h
self.num_leds_v = _num_leds_v
se... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,665 | deepestcyber/rgb-tetris-wall | refs/heads/master | /pixelflut/spi_brain.py | import logging
import base64
import pigpio
from pygame.surfarray import array3d
# GPIO pin numbers
SYNC_PIN = 24
# canvas parameters
CANVAS_WIDTH = 16
CANVAS_HEIGHT = 24
log = logging.getLogger('brain')
log.debug('lol')
ticks = 0
try:
pi = pigpio.pi()
spi = pi.spi_open(0, 500000, 0) # 243750 487500 97500... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,666 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/slowimg.py | """
Image sending reel using PX command.
Simple reel that sends random images from a directory to the Wall.
Uses the standard pixelflut PX command to send one pixel at a time.
This is very slow and you can see the image change.
Created by kratenko.
"""
import os
import random
import time
import numpy as np
from PIL ... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,667 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/wator.py | """
RGB Reel Wator Simulation
A reel implementing the Wator Simulation. Uses the energy based version for
the predators. When the simulation hits either final state it restarts.
TODO: configuration of parameters from outside (program args)
TODO: biased initialization
TODO: non-energy-based variant
See https://en.wik... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,668 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/test_spi.py | import serial
import time
import datetime
import base64
import pigpio
USBPORT = '/dev/ttyACM0' #check correct port first
#USBPORT = 'COM3' #check correct port first
NUM_LEDS_H = 16 #16
NUM_LEDS_V = 24 #24
FPS = 25
WAITTIME_VSTREAM = 0.040 #40 ms
WAITTIME_ISTREAM = 1.0 #40 ms
b64dict = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcde... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,669 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/streaming/util/capture_single.py | from pyv4l2.frame import Frame
from pyv4l2.control import Control
frame = Frame('/dev/video1')
frame_data = frame.get_frame()
control = Control("/dev/video1")
#control.get_controls()
#control.get_control_value(9963776)
#control.set_control_value(9963776, 8)
with open('test.raw', 'wb') as f:
f.write(frame_data)
| {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,670 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/wireworld.py | """"
Wireworld Reel
Implementation for Wireworld for our RGB-Wall
See https://en.wikipedia.org/wiki/Wireworld
TODO: multiple board layouts to chose from by program parm
TODO: set board layout by program parm
Created by kratenko
"""
import numpy as np
import time
from fluter import Fluter
fluter = Fluter()
W, H =... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,671 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/streaming/lib/cropping.py | # QnD extraction pixels from screenshot
from PIL import Image
def extract_single_player_area(im, area=None):
if area is None:
area = (96, 40, 96+10*8, 40+20*8)
return im.crop(area)
def extract_square(im, coords):
sx, sy = coords
square = (sx*8, sy*8, (sx+1)*8, (sy+1)*8)
return im.crop(squ... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,672 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/controller.py | import datetime
import numpy as np
import pigpio
from threading import Thread
from queue import Queue
import time
import sys
from utils_ui import Logger
import stream_pixelflut as pixelflut
#import sys
#sys.path.append("..")
#from pixelflut import pixelflut
from stream_nes import StreamNES
from image_loader import Ima... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,673 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/nes_tetris.py | from PIL import Image
from PIL import ImageFilter
from PIL import ImageEnhance
_FORMAT = "RGB" #HSV
_COLOR_ENHANCE_FACTOR = 3.0
class NesTetris:
#def __init__(self, _num_leds_h=16, _num_leds_v=24, _gray=(95, 7, 128)): #RGB
def __init__(self, _num_leds_h=16, _num_leds_v=24, _gray=(116, 116, 108)): #HSV
... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,674 | deepestcyber/rgb-tetris-wall | refs/heads/master | /pixelflut/canvas_brain.py | import logging
log = logging.getLogger('brain')
log.debug('lol')
ticks = 0
@on('RESIZE')
def resize(canvas):
global log
log.debug('resize event')
@on('QUIT')
def quit(canvas):
global log
log.debug('quit event')
@on('TICK')
def tick(canvas):
global log
global ticks
if ticks % 50 == 0:... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,675 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/send_serial.py | import serial
import time
import datetime
import base64
import os
USBPORT = os.environ.get("USBPORT", '/dev/ttyACM0') #check correct port first
#USBPORT = '/dev/ttyAMA0' #check correct port first
#USBPORT = 'COM3' #check correct port first
NUM_LEDS_H = 16 #16
NUM_LEDS_V = 24 #24
FPS = 25
WAITTIME_VSTREAM = float(os.env... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,676 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/gol.py | """
RGB-Reel Conway's Game of Life
Simple implementation of Conway's Game of Life as reel for your wall. Runs in
a torus world and get's initialized randomly.
See https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
created by kratenko
"""
import numpy as np
import time
from fluter import Fluter
fluter = Fluter()
... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,677 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/streaming/stream.py | import os
import argparse
import numpy as np
from time import sleep
from time import time
from pyv4l2.frame import Frame
from pyv4l2.control import Control
from lib.encoding import UYVY_RAW2RGB_PIL
from lib.visualization import send_visdom
from lib.cropping import extract_single_player_area
from lib.cropping import e... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,678 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/fluter/__init__.py | """
Module for sending to deep pixelflut server.
Simple functions to send to a pixelflut server from a python script.
Handles connecting to the server on its own (but does never disconnect).
In addition to setting individual pixels it supports a command "WL" to
send a complete picture to our LED-Tetris-Wall.
To speci... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,679 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/streaming/lib/encoding.py | from PIL import Image
def UYVY_RAW2RGB_PIL(data, w, h):
y=Image.frombytes('L',(w,h),data[1::2].copy())
u=Image.frombytes('L',(w,h),data[0::4].reshape(w//2,h).copy().repeat(2, 0))
v=Image.frombytes('L',(w,h),data[2::4].reshape(w//2,h).copy().repeat(2, 0))
return Image.merge('YCbCr',(y,u,v))
| {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,680 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/stream_nes.py | import os
import base64
import numpy as np
#from pyv4l2.frame import Frame
from PyV4L2Camera.camera import Camera
from PIL import Image
from PIL import ImageFilter
from nes_tetris import NesTetris
""" Computational costs on raspi:
- grab the frame: 13-17 ms
- convert frame to RGB PIL img: 5 - 6 ms
- cut game area: 2-... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,681 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/send_spi.py | mport serial
import time
import datetime
import base64
import pigpio
import numpy as np
USBPORT = '/dev/ttyACM0' #check correct port first
#USBPORT = 'COM3' #check correct port first
NUM_LEDS_H = 16 #16
NUM_LEDS_V = 24 #24
FPS = 25
WAITTIME_VSTREAM = 0.040 #40 ms
WAITTIME_ISTREAM = 1.0 #40 ms
b64dict = 'ABCDEFGHIJKLM... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,682 | deepestcyber/rgb-tetris-wall | refs/heads/master | /reels/rauschen.py | """
Rauschen reel.
Just some randomly changing gray values, to emulate random noise on a television.
Created by kratenko.
"""
import numpy as np
import time
from fluter import Fluter
fluter = Fluter()
while True:
# great gray pixels
f = np.random.randint(256, size=(fluter.height, fluter.width), dtype=np.uin... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,683 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/streaming/lib/visualization.py | from six import BytesIO
import base64 as b64
def send_visdom(vis, im, win=None, env=None, opts=None):
opts = {} if opts is None else opts
opts['height'] = opts.get('height', im.height)
opts['width'] = opts.get('width', im.width)
buf = BytesIO()
im.save(buf, format='PNG')
b64encoded = b64.b64e... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,684 | deepestcyber/rgb-tetris-wall | refs/heads/master | /fluter.py | # just wrap fluter module, so pycharm finds it
from reels.fluter import Fluter | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,685 | deepestcyber/rgb-tetris-wall | refs/heads/master | /raspi_preproc/workbench/s1.py | import time
import pigpio
pi = pigpio.pi()
if not pi.connected:
print("nope")
exit(0)
h = pi.spi_open(0, 1152000)
n = 0
try:
while True:
n += 1
s = "n:%04x\n" % n
pi.spi_xfer(h, s)
print(s)
#time.sleep(0.01)
except KeyboardInterrupt:
print("Byebye")
pi.spi_... | {"/reels/argos.py": ["/fluter.py"], "/reels/slowimg.py": ["/fluter.py"], "/reels/wator.py": ["/fluter.py"], "/reels/wireworld.py": ["/fluter.py"], "/reels/gol.py": ["/fluter.py"], "/reels/rauschen.py": ["/fluter.py"], "/fluter.py": ["/reels/fluter/__init__.py"]} |
20,686 | daigo0927/ctci-6th | refs/heads/master | /chap4/Q12.py | import os, sys
sys.path.append(os.pardir)
from utils.tree import TreeNode
def count_paths_with_sum(root, sum_tar):
"""
Args:
- TreeNode root
- int sum_tar
Returns:
- int sum of paths
"""
if root is None:
return 0
# Count pats with sum starting from the root node
paths_... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,687 | daigo0927/ctci-6th | refs/heads/master | /chap2/Q3_remove_middle_node.py | """
ใใฎๅ้กใ้ฃใใใฎใฏใไธญ้ใใผใใ ใไธใใใใใจใใซใใใใๅใฎใใผใใ่ฆใใชใ็นใงใใใใใใใฃใฆไธญ้ใใผใใๅ้คใใใซใฏไธญ่บซ่ชไฝใ้ๆฌกๆธใๆใใชใใใฐใใใชใใ
"""
from linkedlist import Node
def remove_this_node(node):
n = node
while n.next != None:
n.data = n.next.data
# ็ต็ซฏๅฆ็ใๆๅพใฎใใผใใไธๅๆถใใ
if n.next.next == None:
n.next = None
else:
... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,688 | daigo0927/ctci-6th | refs/heads/master | /chap8/Q11.py | def make_change(amount, denoms, index):
if index >= len(denoms)-1:
return 1
denom_amount = denoms[index]
ways = 0
i = 0
while i*denom_amount <= amount:
amount_remain = amount - i*denom_amount
ways += make_change(amount_remain, denoms, index+1)
i += 1
return ways
... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,689 | daigo0927/ctci-6th | refs/heads/master | /chap5/Q6.py | def bit_swap_required(a, b):
count = 0
c = a^b
while not c in [0, -1]:
count += c&1
c >>= 1
return count
if __name__ == '__main__':
a = -23432
b = 512132
ans = bit_swap_required(a, b)
print(f'{ans} bit required to convert {bin(a)} <-> {bin(b)}')
| {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,690 | daigo0927/ctci-6th | refs/heads/master | /chap8/Q5.py | def min_product(a, b):
bigger = b if a < b else a
smaller = a if a < b else b
return min_product_helper(smaller, bigger)
def min_product_helper(smaller, bigger):
global counter
if smaller == 0:
return 0
elif smaller == 1:
return bigger
s = smaller>>1
side1 = min_product... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,691 | daigo0927/ctci-6th | refs/heads/master | /chap8/Q3.py | import random
def magic_slow(array):
'''
Get magic index (slow)
Args: list<int> array: target sorted array
Returns: int: magic index, -1 if not exists
'''
for i in range(len(array)):
if array[i] == i:
return i
return -1
def magic_fast(array, start, end):
if end < st... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,692 | daigo0927/ctci-6th | refs/heads/master | /chap5/Q3_alt2.py | SEQ_LENGTH = 32
def get_max_seq(seqs):
"""
Get length of the longest sequences of 1s by flipping
Args: list<int> seqs: three sequences ordered as (0s, then 1s, then 0s)
Returns: int: length of the longest sequence
"""
if seqs[1] == 1: # single 0 -> marge sequences
return seqs[0] + seqs... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,693 | daigo0927/ctci-6th | refs/heads/master | /utils/tree.py | class TreeNode(object):
def __init__(self, data):
self.data = data
self.left = None
self.right = None
self.parent = None
self._size = 1
def _set_left(self, left):
self.left = left
if left is not None:
left.parent = self
def _set_right(sel... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,694 | daigo0927/ctci-6th | refs/heads/master | /chap10/Q9.py | def find_element(matrix, elem):
row = 0
col = len(matrix[0]) - 1
while row < len(matrix) and col >= 0:
if matrix[row][col] == elem:
return True
elif matrix[row][col] > elem:
col -= 1
else:
row += 1
return False
if __name__ == '__main__':
... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
20,695 | daigo0927/ctci-6th | refs/heads/master | /chap8/Q11_alt.py | def make_change(amount, denoms, index, map_):
if map_[amount][index] > 0:
return map_[amount][index]
if index >= len(denoms)-1:
return 1
denom_amount = denoms[index]
ways, i = 0, 0
while i*denom_amount <= amount:
amount_remain = amount - i*denom_amount
ways += make_ch... | {"/chap4/Q12.py": ["/utils/tree.py"], "/chap4/Q11.py": ["/utils/tree.py"], "/chap4/Q10.py": ["/utils/misc.py"], "/chap4/Q12_alt.py": ["/utils/tree.py"], "/chap2/Q5.py": ["/utils/linkedlist.py"], "/utils/misc.py": ["/utils/tree.py"], "/chap2/Q7.py": ["/utils/linkedlist.py"], "/chap2/Q8.py": ["/utils/linkedlist.py"], "/c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.