index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
59,634
zhuokaizhao/artifice
refs/heads/master
/artifice/cutils/__init__.py
from .cutils import detect_peaks __all__ = [detect_peaks]
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,635
zhuokaizhao/artifice
refs/heads/master
/artifice/utils.py
"""Generic utils.""" import os import json import shutil import numpy as np from artifice.log import logger def divup(a, b): return (a + b - 1) // b def listwrap(val): """Wrap `val` as a list. :param val: iterable or constant :returns: `list(val)` if `val` is iterable, else [val] """ if isinstance(v...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,636
zhuokaizhao/artifice
refs/heads/master
/test_utils/experiment.py
"""experiments is a tool for creating large, labeled training sets for semantic segmentation and/or object detection, with the ray-tracing tool POV-Ray. Dependencies: * numpy * POV-Ray * vapory On masks and annotations: A "mask" is a tuple of arrays, such as those returned by skimage.draw functions, which index into ...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,637
zhuokaizhao/artifice
refs/heads/master
/artifice/conversions.py
"""Module for converting data to standard form expected by Artifice. To create custom conversions, create a new function in the style of `png_dir_and_npy_file`, the name of which specifies that the images have a '.png' extension and the labels be in a single 'labels.npy' file in the data_root. A conversion function sh...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,638
zhuokaizhao/artifice
refs/heads/master
/test_utils/springs.py
"""Analayze positions of two spheres to try to gauge the spring constant connecting the two.""" import numpy as np from artifice import vis def find_constant(labels, tethered=[]): """ :param labels: `(num_examples, num_objects, label_dim)` array of labeles or detections :param tethered: list of object IDs w...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,639
zhuokaizhao/artifice
refs/heads/master
/artifice/conv_utils.py
"""Borrowed largely from Tensorflow source. """ import tensorflow as tf from artifice.log import logger # noqa def _dim_val(dim): if tf.executing_eagerly(): out = dim else: out = dim.value return out def divup(a, b): return (a + b - 1) // b def conv_output_length(input_length, filter_size, paddi...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,640
zhuokaizhao/artifice
refs/heads/master
/test_utils/annotate.py
"""Messing around with annotating the gyros data. These annotators are highly ad-hoc and not what would eventually be used, in all likelihood. They're more the sort of thing we want to avoid.""" import numpy as np from artifice.utils import img, vis from glob import glob from skimage.feature import canny from skimage....
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,641
zhuokaizhao/artifice
refs/heads/master
/artifice/sparse/sparse_lib.py
"""Sparse ops implementation using tf primitives. """ import numpy as np from collections import namedtuple import tensorflow as tf from artifice.log import logger # noqa: unused from artifice import utils def _compute_bcount(size, bstride): return [utils.divup(size[0], bstride[0]), utils.divup(size[1]...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,642
zhuokaizhao/artifice
refs/heads/master
/artifice/windows/__init__.py
from .annotator_window import *
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,643
zhuokaizhao/artifice
refs/heads/master
/artifice/dat.py
""" Functions for reading and writing datasets in tfrecords, as needed by artifice and test_utils. Data class for feeding data into models, possibly with augmentation. We expect labels to be of the form: |-------|-------|--------------------------------------| | x pos | y pos | object pose parameters | ...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,644
zhuokaizhao/artifice
refs/heads/master
/scripts/waltzing_spheres.py
"""Create a dataset of two spheres that walk regularly along the image plane, separated, with some step size between each one. Useful for a test-set. Each "time step" is just a shift over. "steps_per_frame" is useful for skipping by a few pixels at a time. """ import vapory import numpy as np import matplotlib.pyplo...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,645
zhuokaizhao/artifice
refs/heads/master
/artifice/sharedobjects/shared.py
from os.path import exists import pickle from filelock import FileLock class SharedDict(dict): """Maintain a dict. Doesn't allow reads or writes unless the dict is acquired. If path already exists, does not clear it unless clear() method is called. """ def __init__(self, path): self.path = path if...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,646
zhuokaizhao/artifice
refs/heads/master
/artifice/log/logger.py
import logging logger = logging.getLogger('artifice') logger.setLevel(logging.DEBUG) handler = logging.StreamHandler() handler.setFormatter(logging.Formatter('%(levelname)s:artifice:%(message)s')) logger.addHandler(handler) def set_verbosity(verbose): if verbose == 0: logger.setLevel(logging.WARNING) elif ve...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,647
zhuokaizhao/artifice
refs/heads/master
/artifice/prio.py
"""Module for artifice's selector. """ from time import sleep, time import numpy as np import tensorflow as tf from artifice.log import logger from artifice import ann class Prioritizer: def __init__(self, data_set, *, info_path): self.data_set = data_set self.info = ann.AnnotationInfo(info_path, clear_p...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,648
zhuokaizhao/artifice
refs/heads/master
/artifice/vis.py
"""Utils for visualizing artifice output. (Mostly for testing). TODO: make `show` functions wrappers around `plot` functions, which can be called without clearing the matplotlib buffer. """ from glob import glob from os.path import join, basename from stringcase import pascalcase, titlecase import matplotlib as mpl ...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,649
zhuokaizhao/artifice
refs/heads/master
/artifice/main.py
"""The main script for running artifice. """ import os from os.path import join, exists import sys from time import time, asctime from glob import glob import argparse import numpy as np import tensorflow as tf from artifice import log from artifice.log import logger from artifice import dat from artifice import mo...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,650
zhuokaizhao/artifice
refs/heads/master
/artifice/sparse/__init__.py
from .sparse import reduce_mask, gather, scatter # noqa
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,651
zhuokaizhao/artifice
refs/heads/master
/artifice/ann.py
"""Module for artifice's annotator, probably labelimg. """ import os from time import sleep, strftime, time import itertools from operator import itemgetter import numpy as np from sortedcontainers import SortedList from skimage.draw import circle from artifice.log import logger from artifice.sharedobjects import Sh...
{"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts...
59,665
Mesratya/Projet_Domino
refs/heads/master
/test.py
""" Quelques notes... """"" # Images pixmap = QtGui.QPixmap("images/4/orange.png") """Méthodo pour communiquer avec l'IHM' : Utiliser des signaux """ "1/ créer le signal sous la class ThreadGame:" signalGameOk = QtCore.pyqtSignal() "2/ le connecter à la méthode voulu dans la class UI" self.t...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,666
Mesratya/Projet_Domino
refs/heads/master
/Plateau.py
import numpy as np """ [Module secondaire] Ce module est destiné à la définition de la classe plateau """ class Plateau(list): """La classe plateau modélise un plateau de jeu. Elle hérite de list. Ainsi la liste plateau est la chaîne de dominos posés. La gestion de l'espace de jeu et des contrainte...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,667
Mesratya/Projet_Domino
refs/heads/master
/interface.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\Yassi\PycharmProjects\ProjetDomino\interface.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtMultim...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,668
Mesratya/Projet_Domino
refs/heads/master
/IHM.py
# -*- coding: utf-8 -*- import sys from PyQt5 import QtGui, QtCore, QtWidgets from interface import Ui_MainWindow from Main import * from PyQt5.QtMultimedia import QSound class ClickableLabel(QtWidgets.QLabel): """ label clicable inspiré de https://stackoverflow.com/questions/21354516/is-possible-to...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,669
Mesratya/Projet_Domino
refs/heads/master
/Main.py
from Dominos import * from Plateau import * from PyQt5 import QtCore from time import sleep """ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ____ _ ____ | _ \ ___ _ __ ___ (_)_ __ ___ / ___| __ _ _ __ ___ ___ | | | |/ _ \| '_ ` _ \| | '_ \ /...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,670
Mesratya/Projet_Domino
refs/heads/master
/Tests_unitaires.py
import unittest from Main import * """Ce module contient quelques tests unitaires du Projet Domino Ces tests sont pour l'instant écrit à des fins essentiellement pédagogique puisque le dévloppement du code pré-IHM c'est fait en testant systématiquement le code en faisant jouer des IA (aux stratégies ...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,671
Mesratya/Projet_Domino
refs/heads/master
/interface2.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\Yassi\PycharmProjects\ProjetDomino\interface_2.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(ob...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,672
Mesratya/Projet_Domino
refs/heads/master
/Dominos.py
import random """ [Module secondaire] Ce module est destiné à la définition des classes Domino, Hand et Talon car ces classes sont taille raisonable """ class Domino: """ La classe domino modelise un domino par ses valeurs et la position des demi-dominos Initialement les dominos ne sont pas posé...
{"/IHM.py": ["/interface.py", "/Main.py"], "/Main.py": ["/Dominos.py", "/Plateau.py"], "/Tests_unitaires.py": ["/Main.py"]}
59,686
southwestmogrown/saltandpreppr
refs/heads/main
/app/forms/recipe_form.py
from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired, Length, ValidationError class RecipeForm(FlaskForm): name = StringField('name', validators=[DataRequired(), Length(max=55)]) type = StringField('type',validators=[DataRequired(), Length(max=10)]) i...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,687
southwestmogrown/saltandpreppr
refs/heads/main
/app/forms/add_mealplan_form.py
from flask_wtf import FlaskForm from wtforms import StringField, IntegerField from wtforms.validators import DataRequired, Length class AddMealplanForm(FlaskForm): name = StringField('name', validators=[DataRequired(), Length(max=55)]) userId = IntegerField('userId')
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,688
southwestmogrown/saltandpreppr
refs/heads/main
/app/forms/instruction_form.py
from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class InstructionForm(FlaskForm): instructions = StringField('instructions', validators=[DataRequired()])
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,689
southwestmogrown/saltandpreppr
refs/heads/main
/app/seeds/ingredients.py
from app.models import db from app.models.ingredient import Ingredient # Adds a demo user, you can add other users here if you want def seed_ingredients(): i1 = Ingredient( recipeId=1, name='Tortillas', type='Starch/Bread', amount='30', ) i2 = Ingredient( recipeId...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,690
southwestmogrown/saltandpreppr
refs/heads/main
/app/models/meal_plan.py
from .db import db class Mealplan(db.Model): """Table to connect recipes to users""" __tablename__ = 'Mealplans' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(55), nullable=False) userId = db.Column(db.Integer, db.ForeignKey('Users.id'), nullable=False) user = db.rel...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,691
southwestmogrown/saltandpreppr
refs/heads/main
/app/models/__init__.py
from .db import db from .user import User from .recipe import Recipe
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,692
southwestmogrown/saltandpreppr
refs/heads/main
/app/seeds/meal_plans.py
from app.models import db from app.models.meal_plan import Mealplan def seed_meal_plans(): mp1 = Mealplan(userId=1, name='mealplan 1') mp2 = Mealplan(userId=1, name='mealplan 2') mp3 = Mealplan(userId=2, name='mealplan 3') db.session.add(mp1) db.session.add(mp2) db.session.add(mp3) db.s...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,693
southwestmogrown/saltandpreppr
refs/heads/main
/app/forms/add_recipe_to_mealplan_form.py
from flask_wtf import FlaskForm from wtforms import SelectField from wtforms.validators import DataRequired class AddRecipeToMealplanForm(FlaskForm): recipe_id = SelectField('Recipe Id', coerce=int)
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,694
southwestmogrown/saltandpreppr
refs/heads/main
/app/seeds/mealplan_recipe.py
from app.models import db from app.models.mealplan_recipes import MealplanRecipe def seed_mealplan_recipes(): mpr1 = MealplanRecipe( mealplanId = 1, recipeId = 1 ) mpr2 = MealplanRecipe( mealplanId = 1, recipeId = 2 ) mpr3 = MealplanRecipe( mealplanId = 1,...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,695
southwestmogrown/saltandpreppr
refs/heads/main
/app/forms/ingredient_form.py
from flask_wtf import FlaskForm from wtforms import StringField, IntegerField from wtforms.validators import DataRequired, Length class IngredientForm(FlaskForm): userId = IntegerField('userId') recipeId = IntegerField('recipeId') name = StringField('name', validators=[DataRequired(), Length(max=100)]) ...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,696
southwestmogrown/saltandpreppr
refs/heads/main
/app/models/ingredient.py
from .db import db class Ingredient(db.Model): __tablename__ = 'Ingredients' id = db.Column(db.Integer, primary_key=True) recipeId = db.Column(db.Integer, db.ForeignKey('Recipes.id'), nullable=False) name = db.Column(db.String(100), nullable=False) type = db.Column(db.String(20), nullable=True) ...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,697
southwestmogrown/saltandpreppr
refs/heads/main
/app/forms/__init__.py
from .login_form import LoginForm from .signup_form import SignUpForm from .recipe_form import RecipeForm from .instruction_form import InstructionForm from .ingredient_form import IngredientForm from .edit_ingredient_form import EditIngredientForm from .add_mealplan_form import AddMealplanForm from .add_recipe_to_meal...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,698
southwestmogrown/saltandpreppr
refs/heads/main
/app/models/mealplan_recipes.py
from .db import db class MealplanRecipe(db.Model): __tablename__ = 'MealplanRecipes' id = db.Column(db.Integer, primary_key=True) mealplanId = db.Column(db.Integer, db.ForeignKey('Mealplans.id'), nullable=False) recipeId = db.Column(db.Integer, db.ForeignKey('Recipes.id'), nullable=False) mealplan...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,699
southwestmogrown/saltandpreppr
refs/heads/main
/app/models/recipe.py
from .db import db class Recipe(db.Model): __tablename__ = 'Recipes' id = db.Column(db.Integer, primary_key=True) userId = db.Column(db.Integer, db.ForeignKey('Users.id'), nullable=False) name = db.Column(db.String(255), nullable=False) type = db.Column(db.String(10)) instructions = db.Column(...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,700
southwestmogrown/saltandpreppr
refs/heads/main
/app/api/user_routes.py
from app.forms.add_recipe_to_mealplan_form import AddRecipeToMealplanForm from app.forms.edit_ingredient_form import EditIngredientForm from app.models import ingredient from app.models.ingredient import Ingredient from flask import Blueprint, jsonify, request from flask_login import login_required from app.models impo...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,701
southwestmogrown/saltandpreppr
refs/heads/main
/app/seeds/recipes.py
from app.models import db, Recipe # Adds a demo user, you can add other users here if you want def seed_recipes(): r1 = Recipe( userId=1, name='Enchiladas', type='Dinner', instructions='Nulla porttitor accumsan tincidunt. Proin eget tortor risus. Donec sollicitudin molestie males...
{"/app/seeds/ingredients.py": ["/app/models/__init__.py", "/app/models/ingredient.py"], "/app/models/__init__.py": ["/app/models/recipe.py"], "/app/seeds/meal_plans.py": ["/app/models/__init__.py", "/app/models/meal_plan.py"], "/app/seeds/mealplan_recipe.py": ["/app/models/__init__.py", "/app/models/mealplan_recipes.py...
59,707
diegoplascencia/Warehouse_REST_API
refs/heads/master
/create_database.py
import sqlite3 def create_db(): connection = sqlite3.connect('warehouse_inventory.db') cursor = connection.cursor() print("\n......................................") print("Creating DB...") print("......................................\n") create_table = """CREATE TABLE IF NOT EXISTS inventory (id INTEGER PRIMAR...
{"/app.py": ["/create_database.py"]}
59,708
diegoplascencia/Warehouse_REST_API
refs/heads/master
/app.py
from flask import Flask, render_template from flask_restful import Resource, Api, reqparse import sqlite3 from create_database import create_db create_db() app = Flask(__name__) api = Api(app) @app .route('/') def index(): return render_template("base.html") class ItemList(Resource): def get(self): all_items ...
{"/app.py": ["/create_database.py"]}
59,709
jesuschm/tasca
refs/heads/master
/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py
import pytest import uuid from src.domain.users.user import User from dataclasses import asdict, dataclass dummy_data = { 'id': uuid.uuid4(), 'username': 'dummy_name', 'follows': [] } @pytest.fixture def dummy_user_instance_fixture(): dummy_user_instance_fixture = User(id = dummy_data.get('id'), usern...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,710
jesuschm/tasca
refs/heads/master
/src/domain/messages/message.py
from datetime import datetime import uuid import timeago from dataclasses import dataclass, asdict, field @dataclass class Message(): content: str user_id: uuid.UUID id: uuid.UUID = field(default_factory=uuid.uuid4) created_at: datetime = datetime.now() @classmethod def from_dict(self...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,711
jesuschm/tasca
refs/heads/master
/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py
import pytest from src.infra.databases.mongo import MongoRepository bad_data = { 'good_id': 1 } @pytest.fixture def mongo_repo_instance_fixture(): repo = MongoRepository() return repo
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,712
jesuschm/tasca
refs/heads/master
/src/infra/databases/repo.py
from abc import ABCMeta, abstractmethod from dataclasses import dataclass @dataclass class Repo(metaclass=ABCMeta): @classmethod def __subclasshook_(cls, subclass): return (hasattr(subclass, 'upsert') and callable(subclass.upsert) and hasattr(subclass, 'get') and ...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,713
jesuschm/tasca
refs/heads/master
/tests/unit_tests/domain/messages/test_message_model.py
import pytest from .fixtures.message_model_fixtures import dummy_message_instance_fixture, dummy_data class TestMessageModel(object): def test_001_from_dict(self, dummy_message_instance_fixture): msg = dummy_message_instance_fixture.from_dict(dummy_data) assert msg.to_dict() == dummy_data
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,714
jesuschm/tasca
refs/heads/master
/tests/unit_tests/application/test_users_service.py
import pytest import mock from src.application.users_service import create_user, get_user @pytest.fixture def mocked_mongo_repo(): mocked_repo = mock.Mock() mocked_repo.create_user.return_value = True mocked_repo.get_user.return_value = ['dummy_user'] return mocked_repo class TestUsersService(obje...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,715
jesuschm/tasca
refs/heads/master
/src/application/commands_service.py
import logging from src.domain.messages.message import Message from src.domain.users.user import User from src.domain.messages.message import Message def post(repo, username: str, message: str): res = False logging.debug(f"[+] {username} user is posting: {message}.") user = User.from_dict(repo.get_use...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,716
jesuschm/tasca
refs/heads/master
/src/tasca.py
import sys import logging from application.commands_service import post, read, follow, wall from infra.databases.mongo import MongoRepository _repo = MongoRepository() _verbose = False def main(): try: command = None if _repo.client: logging.info("[+] Hello friend! Welcome to the Tasca...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,717
jesuschm/tasca
refs/heads/master
/tests/unit_tests/application/test_commands_service.py
from src.application.commands_service import post, read, follow, wall from .fixtures.commands_service_fixtures import mocked_mongo_repo class TestCommandsService(object): def test_001_post(self, mocked_mongo_repo): rc = post(repo = mocked_mongo_repo, username = 'dummy_user', message = 'dummy_message') ...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,718
jesuschm/tasca
refs/heads/master
/tests/unit_tests/application/fixtures/commands_service_fixtures.py
import pytest from uuid import uuid4 import mock from src.domain.users.user import User from src.domain.messages.message import Message @pytest.fixture def mocked_mongo_repo(): mocked_repo = mock.Mock() mocked_repo.insert_message.return_value = True mocked_repo.get_messages.return_value = [Message(content ...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,719
jesuschm/tasca
refs/heads/master
/src/application/users_service.py
import logging from src.domain.users.user import User def create_user(repo, username): res = False logging.debug(f"[+] Creating the user {username}") user = User(username=username) if user: res = repo.create_user(user = user.to_dict()) return res def get_user(repo, username)...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,720
jesuschm/tasca
refs/heads/master
/src/config/settings.py
import sys import os.path import configparser import logging import logging.config from pathlib import Path CONFIG_FILE = os.path.join(Path(__file__).parent.parent.parent, 'tasca.conf') config = configparser.ConfigParser() if os.path.isfile(CONFIG_FILE): logging.debug('[+] Loading config file tasca.conf') co...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,721
jesuschm/tasca
refs/heads/master
/src/scripts/createuser.py
import logging import argparse from src.application.users_service import create_user from src.infra.databases.mongo import MongoRepository _repo = MongoRepository() def main(): """Main function """ try: # Initiate the parser parser = argparse.ArgumentParser() # Add long and short a...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,722
jesuschm/tasca
refs/heads/master
/src/domain/users/user.py
import uuid from dataclasses import dataclass, asdict, field @dataclass class User(): username: str id: uuid.UUID = field(default_factory=uuid.uuid4) follows: list = field(default_factory=list) @classmethod def from_dict(self, d): return self(**d) if isinstance(d, dict) else None ...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,723
jesuschm/tasca
refs/heads/master
/tests/unit_tests/domain/users/test_user_model.py
import pytest from .fixtures.user_model_fixtures import dummy_user_instance_fixture, dummy_data class TestUserModel(object): def test_001_from_dict(self, dummy_user_instance_fixture): user = dummy_user_instance_fixture.from_dict(dummy_data) assert user.to_dict() == dummy_data
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,724
jesuschm/tasca
refs/heads/master
/tests/integration_tests/infra/databases/test_mongo_repo.py
import pytest from .fixtures.mongo_repo_fixtures import mongo_repo_instance_fixture, bad_data class TestMongoRepository(object): @pytest.mark.parametrize( 'data', [pytest.param(bad_data, marks=pytest.mark.xfail)] ) def test001_upsert(self, data, mongo_repo_instance_fixture): rc...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,725
jesuschm/tasca
refs/heads/master
/src/infra/databases/mongo.py
import logging from pymongo import MongoClient from src.config.settings import MONGO_HOST, MONGO_PORT, MONGO_USER, MONGO_PASSWORD, MONGO_DB, MESSAGES_COLLECTION, USERS_COLLECTION from .repo import Repo class MongoRepository(Repo): def __init__(self): self.client = self._get_client() def _get_c...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,726
jesuschm/tasca
refs/heads/master
/tests/unit_tests/domain/messages/fixtures/message_model_fixtures.py
import pytest import uuid from datetime import datetime from src.domain.messages.message import Message from dataclasses import asdict, dataclass dummy_data = { 'id': uuid.uuid4, 'user_id': uuid.uuid4, 'content': 'dummy_message', 'created_at': datetime.now() } @pytest.fixture def dummy_message_instance...
{"/tests/unit_tests/domain/users/fixtures/user_model_fixtures.py": ["/src/domain/users/user.py"], "/tests/integration_tests/infra/databases/fixtures/mongo_repo_fixtures.py": ["/src/infra/databases/mongo.py"], "/tests/unit_tests/domain/messages/test_message_model.py": ["/tests/unit_tests/domain/messages/fixtures/message...
59,727
echudov/199-stocks
refs/heads/master
/main.py
import simulations import time import csvParser import numpy as np import graphing class SingleIteration: index = None data_points = None p = None simulate_index = None real_streak_counts = None average_streaks = None largest_streaks = None def __init__(self, set_index): self....
{"/main.py": ["/simulations.py", "/csvParser.py", "/graphing.py"]}
59,728
echudov/199-stocks
refs/heads/master
/simulations.py
import random class MultipleSimulations: k = None n = None p = None totalstreaklist = None largeststreaklist = None def __init__(self, setk, setn, setp): self.k = setk self.n = setn self.p = setp self.totalstreaklist = [] self.largeststreaklist = [] ...
{"/main.py": ["/simulations.py", "/csvParser.py", "/graphing.py"]}
59,729
echudov/199-stocks
refs/heads/master
/graphing.py
import plotly.graph_objects as go import numpy as np def dual_bar_chart(index_name, r_streaks, sim_streaks): labels = [] simulated_streaks = sim_streaks[1:].copy() real_streaks = r_streaks[1:].copy() for i in range(len(real_streaks)): real_streaks[i] = int(real_streaks[i]) while len(simula...
{"/main.py": ["/simulations.py", "/csvParser.py", "/graphing.py"]}
59,730
echudov/199-stocks
refs/heads/master
/csvParser.py
import csv important_values = "importantValues.csv" streak_data = "StreakData.csv" important_values_fields = [] important_values_rows = [] streak_data_indicies = [] streak_data_rows = [] with open(important_values, 'r') as csvfile: csvreader = csv.reader(csvfile) important_values_fields = next(csvreader) ...
{"/main.py": ["/simulations.py", "/csvParser.py", "/graphing.py"]}
59,731
jsosulski/tdlda
refs/heads/main
/tdlda/classification/__init__.py
from .tdlda import TimeDecoupledLda from .feature_preprocessing import Vectorizer
{"/tdlda/classification/__init__.py": ["/tdlda/classification/tdlda.py"], "/tdlda/__init__.py": ["/tdlda/classification/__init__.py"]}
59,732
jsosulski/tdlda
refs/heads/main
/tdlda/__init__.py
from .classification import TimeDecoupledLda from .classification import Vectorizer
{"/tdlda/classification/__init__.py": ["/tdlda/classification/tdlda.py"], "/tdlda/__init__.py": ["/tdlda/classification/__init__.py"]}
59,733
jsosulski/tdlda
refs/heads/main
/tdlda/classification/tdlda.py
from typing import Tuple import numpy as np import sklearn import sklearn.utils.multiclass import sklearn.linear_model from sklearn.preprocessing import StandardScaler def diag_indices_with_offset(p, offset): idxdiag = np.diag_indices(p) idxdiag_with_offset = list() idxdiag_with_offset.append(np.array([i...
{"/tdlda/classification/__init__.py": ["/tdlda/classification/tdlda.py"], "/tdlda/__init__.py": ["/tdlda/classification/__init__.py"]}
59,738
SimonaytesYan/profile
refs/heads/master
/MyApp/views.py
from django.shortcuts import render from django.http import HttpResponse def start(request): return render(request, 'Start.html') def hobby(request): return render(request, 'hobby.html') # Create your views here. def project(request): return render(request,'Projects.html') def progress(request): return...
{"/first/urls.py": ["/MyApp/views.py"]}
59,739
SimonaytesYan/profile
refs/heads/master
/first/urls.py
"""first URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based v...
{"/first/urls.py": ["/MyApp/views.py"]}
59,782
JhonTXdons/RecyclerMan
refs/heads/master
/data/trash_tube.py
import pygame import random class Tube: def __init__(self): self._dimX = 300 self._dimY = 0 self._weight = 300 self._height = 100 self.tube = ['tubo1', 'tubo2', 'tubo3'] # Immagine del Tubo self.trash_tube = pygame.image.load('data/assets/images/tubo-1.png...
{"/data/trash.py": ["/data/trash_tube.py"], "/main.py": ["/data/trash.py", "/data/player.py", "/data/ui.py"], "/data/player.py": ["/data/bin_collector.py"]}
59,783
JhonTXdons/RecyclerMan
refs/heads/master
/data/trash.py
from data.trash_tube import * class Trash: def __init__(self): self._dimX = 200 self._dimY = 20 self._weight = 50 self._height = 50 self._velocity = 2 self._color = 255, 0, 0 self._t_tube = Tube() self.TRASH = 5 # VETRO ------------------...
{"/data/trash.py": ["/data/trash_tube.py"], "/main.py": ["/data/trash.py", "/data/player.py", "/data/ui.py"], "/data/player.py": ["/data/bin_collector.py"]}
59,784
JhonTXdons/RecyclerMan
refs/heads/master
/main.py
import pygame.rect from data.trash import * from data.player import * from data.ui import * class App: def __init__(self): self._running = True # GAME STATES ------------------------------------------------------------------------------------------------- self.menu = True self.P...
{"/data/trash.py": ["/data/trash_tube.py"], "/main.py": ["/data/trash.py", "/data/player.py", "/data/ui.py"], "/data/player.py": ["/data/bin_collector.py"]}
59,785
JhonTXdons/RecyclerMan
refs/heads/master
/data/ui.py
import pygame class Ui: def __init__(self): # Immagine di Bottone Play self.b_play = pygame.image.load('data/assets/images/play_button.png') self.b_play_resized = pygame.transform.scale(self.b_play, (60, 60)) self.play_rect = self.b_play_resized.get_rect() self.play_rect.x ...
{"/data/trash.py": ["/data/trash_tube.py"], "/main.py": ["/data/trash.py", "/data/player.py", "/data/ui.py"], "/data/player.py": ["/data/bin_collector.py"]}
59,786
JhonTXdons/RecyclerMan
refs/heads/master
/data/player.py
from data.bin_collector import * import pygame class Player: def __init__(self): self._dimX = 300 self._dimY = 900 self._weight = 150 self._height = 300 self._velocity = 10 self._orientation = '' self._color = 244, 164, 96 self.playable_screen = 90...
{"/data/trash.py": ["/data/trash_tube.py"], "/main.py": ["/data/trash.py", "/data/player.py", "/data/ui.py"], "/data/player.py": ["/data/bin_collector.py"]}
59,787
JhonTXdons/RecyclerMan
refs/heads/master
/data/bin_collector.py
import pygame class Bin(): def __init__(self): self._dimX = 400 self._dimY = 950 self._weight = 100 self._height = 100 self._velocity = 10 self._orientation = True self._color = 'blu' # BIDONI -------------------------------------------------------...
{"/data/trash.py": ["/data/trash_tube.py"], "/main.py": ["/data/trash.py", "/data/player.py", "/data/ui.py"], "/data/player.py": ["/data/bin_collector.py"]}
59,792
nehasaini-git/Calculator
refs/heads/master
/steps/steps.py
from behave import given, when, then from calculator import Calculator @given("I have entered {number1:d} into the calculator") def step_impl(context, number1): context.number1 = number1 @given("I have also entered {number2:d} into the calculator") def step_impl(context, number2): context.number2 = number2 ...
{"/steps/steps.py": ["/calculator.py"]}
59,793
nehasaini-git/Calculator
refs/heads/master
/calculator.py
class Calculator: def add(self, num1, num2): self.num1 = num1 self.num2 = num2 return num1 + num2
{"/steps/steps.py": ["/calculator.py"]}
59,836
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/libs/django/decorators.py
from functools import wraps from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from mtvc_client.client import APIClientException def view_exception_handler(view_func): """ A view decorator that undestands MTVC error codes and how to deal with the state changes that...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,837
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/libs/django/urls.py
from django.conf.urls import patterns, url from mtvc_client.libs.django import views urlpatterns = patterns( '', url(r'^$', views.ChannelsView.as_view(), name='home'), url(r'^channels/$', views.ChannelsView.as_view(), name='channels'), url(r'^channel/(?P<slug>[\w-]+)/$', views.EPGView.as_view(), name...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,838
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/libs/django/utils.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.cache import cache from mtvc_client.client import APIClient def get_request_msisdn(request): try: return request.META.get(settings.MSISDN_HEADER, '') except AttributeError: raise Improper...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,839
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/libs/django/middleware.py
import base64 from django.http import HttpResponse from django.template import RequestContext from django.shortcuts import render from django.conf import settings from mtvc_client.client import APIClientException class APIClientExceptionMiddleware(object): """ A middleware class that adds additional context...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,840
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/libs/django/forms.py
import datetime import json from django import forms from django.utils.functional import lazy from django.core.exceptions import ValidationError from django.forms.widgets import RadioFieldRenderer, mark_safe, \ RadioChoiceInput, conditional_escape from django.utils.encoding import force_text from mtvc_client.libs...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,841
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/libs/django/views.py
from django.conf import settings from django.http import Http404 from django.views.generic import TemplateView from django.views.generic.edit import FormView from django.utils.decorators import method_decorator from mtvc_client.client import APIClient from mtvc_client.libs.django import utils from mtvc_client.libs.dja...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,842
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/tests/test_client.py
import unittest import threading import SocketServer import BaseHTTPServer from nose.tools import assert_raises from mtvc_client.client import APIClient, APIClientException HOST_NAME = 'localhost' PORT_NUMBER = 9999 RESP_SUBS_VALIDATION_ERROR = """{ "subscriberprofile": { "subscriber": [ "S...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,843
praekelt/mtvc-api-client
refs/heads/master
/mtvc_client/client.py
import logging import hammock from requests.auth import AuthBase logger = logging.getLogger(__name__) class APIClientException(Exception): """ Exception class that contains the error code and message from the MTVC """ def __init__(self, error_code=None, error_message=None, **kwargs): s...
{"/mtvc_client/libs/django/utils.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/middleware.py": ["/mtvc_client/client.py"], "/mtvc_client/libs/django/views.py": ["/mtvc_client/client.py", "/mtvc_client/libs/django/forms.py", "/mtvc_client/libs/django/decorators.py"]}
59,860
ZihengZZH/christmas-hat
refs/heads/master
/camera.py
# camera.py import math import numpy as np import cv2 import dlib w_h_ratio = 0.6 hat_file = "./hats/02.png" landmarks_file = "./database/shape_predictor_68_face_landmarks.dat" class VideoCamera(object): # Constructor def __init__(self, visual=False): self.video = cv2.VideoCapture(-1) # loa...
{"/main.py": ["/camera.py"]}
59,861
ZihengZZH/christmas-hat
refs/heads/master
/main.py
# main.py import os from flask import Flask, render_template, Response, request, url_for, send_from_directory from werkzeug.utils import secure_filename from camera import VideoCamera htmlfile = open('./templates/index.html', 'r') html = htmlfile.read() ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']) app = F...
{"/main.py": ["/camera.py"]}
59,864
cxrodgers/STRF
refs/heads/master
/__init__.py
import io from base import *
{"/__init__.py": ["/io.py", "/base.py"]}
59,865
cxrodgers/STRF
refs/heads/master
/io.py
"""STRFlab-type format spec Each stimulus is labeled with a string suffix, such as '0001'. Each stimulus has 3 corresponding files: Stimulus files, eg stim0001.wav * A wav file Spike files, eg spike0001 * Plain-text * Each line of the file is the spike times, in seconds, from a single ...
{"/__init__.py": ["/io.py", "/base.py"]}
59,866
cxrodgers/STRF
refs/heads/master
/base.py
import numpy as np import io from io import STRFlabFileSchema import kkpandas, pandas def metric(b_real, b_pred): return np.sum((b_real - b_pred) ** 2, axis=0) def iterboost_fast(A_train, b_train, A_test=None, b_test=None, niters=100, step_size=None, return_metrics=False): """Iteratively find regulariz...
{"/__init__.py": ["/io.py", "/base.py"]}
59,867
cxrodgers/STRF
refs/heads/master
/STRF_tools.py
import numpy as np import glob import os.path import matplotlib.mlab as mlab import wave import struct import matplotlib.pyplot as plt from myutils import Spectrogrammer import myutils def my_imshow(C, x=None, y=None, ax=None): if x is None: x = range(C.shape[1]) if y is None: y = range(C.shape...
{"/__init__.py": ["/io.py", "/base.py"]}
59,868
Mrxiahelong/sylfk
refs/heads/master
/sylfk/execptions.py
class SYLFKException(Exception): def __init__(self,code='',message='Error'): self.code=code #异常编号 self.message=message #异常信息 def __str__(self): return self.message #当作为字符串使用时,返回异常信息 #节点已经存在 class EndpointExistsError(SYLFKException): def __init__(self,message='Endpoint exists'):...
{"/main.py": ["/sylfk/__init__.py"]}
59,869
Mrxiahelong/sylfk
refs/heads/master
/main.py
from sylfk import SYLFK app=SYLFK() app.run()
{"/main.py": ["/sylfk/__init__.py"]}
59,870
Mrxiahelong/sylfk
refs/heads/master
/sylfk/__init__.py
from werkzeug.serving import run_simple from sylfk.wsgi_adapter import wsgi_app from werkzeug.wrappers import Response from sylfk.exceptions as exceptions from sylfk.helper import parse_static_key #定义常见服务异常的响应体 ERROR_MAP={ '401':Response('<h1>401 Unknow or unsupport method</h1>',content_type='text/html;charset=UTF...
{"/main.py": ["/sylfk/__init__.py"]}
59,871
Mrxiahelong/sylfk
refs/heads/master
/sylfk/exceptions/__init__.py
class SYLFKException(Exception): def __init__(self,code='',message='Error'): self.code=code #异常编码 self.message=message #异常信息 def __str__(self): return self.message #当作为字符串使用时,返回异常信息 class EndpointExistsError(SYLFKException): def __init__(self,message='Endpoint exists'): ...
{"/main.py": ["/sylfk/__init__.py"]}
59,872
Mrxiahelong/sylfk
refs/heads/master
/sylfk/helper/__init__.py
#以“”分割文件名字,获取文件后缀类型 def parse_static_key(filename): return filename.spilt(".")[-1]
{"/main.py": ["/sylfk/__init__.py"]}
59,873
WilfredLemus/antivirus
refs/heads/master
/antivirus/apps/home/models.py
from django.db import models class Categoria(models.Model): nombre = models.CharField(max_length=50) slug = models.SlugField(editable=False) def save(self,*args, **kwargs): if not self.id: self.slug = slugify(self.nombre) super(Categoria, self).save(*args, **kwargs) def __unicode__(self): return self.n...
{"/antivirus/apps/home/admin.py": ["/antivirus/apps/home/models.py"]}
59,874
WilfredLemus/antivirus
refs/heads/master
/antivirus/apps/home/migrations/0003_auto_20150602_0337.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('home', '0002_auto_20150602_0319'), ] operations = [ migrations.AlterField( model_name='antivirus', n...
{"/antivirus/apps/home/admin.py": ["/antivirus/apps/home/models.py"]}