index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
47,701
dfana01/pbx-dashboard
refs/heads/master
/run.py
from app import create_app, sk if __name__ == '__main__': app = create_app() sk.run(app, debug=False, host="0.0.0.0", port=8080)
{"/app/__init__.py": ["/app/extensions.py"], "/run.py": ["/app/__init__.py"]}
47,712
Fati3521/Mpredicve
refs/heads/main
/fonction.py
import pandas as pd #from tensorflow.keras.utils import to_categorical #from keras.models import load_model import seaborn as sns from scipy.stats import iqr import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from os.path import join from os import listdir import os from sklearn....
{"/app.py": ["/fonction.py"]}
47,713
Fati3521/Mpredicve
refs/heads/main
/app.py
import streamlit as st import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import joblib import shap from fonction import * import plotly.express as px from umap import UMAP plt.style.use('fivethirtyeight') #sns.set_style('darkgrid')scaler1 def main() : #@st.cach...
{"/app.py": ["/fonction.py"]}
47,747
PetarPeychev/automatagen
refs/heads/master
/automatagen/__init__.py
from automatagen.automatagen import TerrainGenerator
{"/automatagen/__init__.py": ["/automatagen/automatagen.py"]}
47,748
PetarPeychev/automatagen
refs/heads/master
/automatagen/automatagen.py
import random class TerrainGenerator: def __init__(self, initial_density = 0.48, steps = 5, loneliness_limit = 4): self.initial_density = initial_density self.steps = steps self.loneliness_limit = loneliness_limit def _randomize(self...
{"/automatagen/__init__.py": ["/automatagen/automatagen.py"]}
47,750
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/model/MLP.py
import torch import torch.nn as nn class Mlp(nn.Module): def __init__(self, in_channel, hidden_channel, out_channel, hidden_num): super(Mlp, self).__init__() self.layer1 = nn.Sequential(nn.Linear(in_channel, hidden_channel, bias=True), nn.ReLU()) self.hidden_num = hidden_num if hidd...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,751
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/MLP_Cifar10.py
import torch import torch.nn as nn import torchvision from torch.utils.data import Dataset,DataLoader,TensorDataset from torch.autograd import Variable import os import numpy as np from sklearn.metrics import classification_report from utils.util import dim_redu, get_kfold_data, WriteExcelRow from model.MLP import Ml...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,752
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/utils/util.py
import torch from PIL import Image import numpy as np import openpyxl from sklearn.decomposition import PCA def dim_redu(data, gray, dim_ratio): """ 将三通道图片灰度处理后进行PCA降维 cifar10图片原大小为32*32*3,展开为3072,总共包含3072个特征值,如果做灰度处理会减少为1024,然后按pca设定的比例进行降维 Args: data:输入数据为四维[batch,H,W,C] gray:是否进行灰度处...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,753
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/model/CNN.py
import torch import torch.nn as nn import torch.nn.functional as F class Mish(nn.Module): def __init__(self): super(Mish, self).__init__() def forward(self, x): return x * torch.tanh(F.softplus(x)) class CBL(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1)...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,754
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/draw.py
r""" 训练完成后平均F1值会存在result文件夹下的表格里, 运行task2_draw可以画出折线图(储存结果数据可以自己改,也可以画出来) 不知道为什么降维以后效果会很差,可能本来就这样吧、、、 """ import pandas as pd import matplotlib.pyplot as plt sheet = "features" df = pd.read_excel("./result/result.xlsx", names=None, sheet_name=sheet) df = df.sort_values("ratio") plt.plot(df['ratio'], df["mean F1"]) ...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,755
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/CNN_Cifar.py
import torch import torch.nn as nn import torchvision from torch.utils.data import Dataset,DataLoader,TensorDataset from torch.autograd import Variable import os import numpy as np from sklearn.metrics import classification_report from model.CNN import CNNnet def fit_one_train(epoch, train_loader, model, criterion, ...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,756
carryg1998/Cifar10_Mlp_CNN
refs/heads/main
/PCA.py
r""" 降维的函数详见utils.util.dim_redu函数 """ import torch import torchvision import numpy as np from PIL import Image from utils.util import dim_redu data_path = "./cifar10/" train_data = torchvision.datasets.CIFAR10( root=data_path, train=True, transform=torchvision.transforms.ToTensor(), download=False,...
{"/MLP_Cifar10.py": ["/utils/util.py", "/model/MLP.py"], "/CNN_Cifar.py": ["/model/CNN.py"], "/PCA.py": ["/utils/util.py"]}
47,758
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__sr.py
import phunspell import inspect import unittest # TODO class TestSR(unittest.TestCase): pspell = phunspell.Phunspell('sr') def test_true(self): self.assertTrue(True) # def test_word_found(self): # self.assertTrue(self.pspell.lookup("фекетић")) # def test_word_not_found(self): #...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,759
dvwright/phunspell
refs/heads/main
/phunspell/tests/test_multi_load_no_cache.py
import phunspell import inspect import unittest dicts_words = { "af_ZA": "voortgewoed", "an_ES": "vengar", "be_BY": "ідалапаклонніцкі", "bg_BG": "удържехме", "br_FR": "c'huñvderioù", "de_DE": "schilffrei", "en_GB": "indict", "es_MX": "pianista", "fr_FR": "zoomorphe", } dicts_words_...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,760
dvwright/phunspell
refs/heads/main
/phunspell/tests/test_phunspell.py
import phunspell import inspect import unittest class TestPhunspell(unittest.TestCase): pspell = phunspell.Phunspell('en_US') def setUp(self): pass def tearDown(self): pass def test_package(self): self.assertTrue(inspect.ismodule(phunspell)) def test_exception_if_not_di...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,761
dvwright/phunspell
refs/heads/main
/phunspell/__init__.py
import os import sys __name__ = "phunspell" __author__ = "David Wright" __email__ = "dvwright@cpan.org" __version__ = "0.1.6" # For relative imports to work in Python 3.6 sys.path.append(os.path.dirname(os.path.realpath(__file__))) from .phunspell import Phunspell, PhunspellError # noqa F401
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,762
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__gug.py
import phunspell import inspect import unittest class TestGug(unittest.TestCase): pspell = phunspell.Phunspell('gug_PY') def test_word_found(self): self.assertTrue(self.pspell.lookup("mba'erepy")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def t...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,763
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__ca.py
import phunspell import inspect import unittest class TestCaPY(unittest.TestCase): pspell = phunspell.Phunspell('ca') def test_word_found(self): self.assertTrue(self.pspell.lookup("Ogooué-Ivindo")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def ...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,764
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__no.py
import phunspell import inspect import unittest class TestNO(unittest.TestCase): pspell = phunspell.Phunspell('nb_NO') def test_word_found(self): self.assertTrue(self.pspell.lookup("sjøfarende")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def te...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,765
dvwright/phunspell
refs/heads/main
/phunspell/tests/test_multi_load_cache.py
import phunspell import inspect import unittest dicts_words = { "af_ZA": "voortgewoed", "an_ES": "vengar", "be_BY": "ідалапаклонніцкі", "bg_BG": "удържехме", "br_FR": "c'huñvderioù", "de_DE": "schilffrei", "en_GB": "indict", "es_MX": "pianista", "fr_FR": "zoomorphe", } # use cache ...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,766
dvwright/phunspell
refs/heads/main
/setup.py
from setuptools import setup from setuptools import find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name='phunspell', version='0.1.6', url='https://github.com/dvwright/phunspell', download_url='https://github.com/dvwright/phunspell/archive/v0.1.6.tar.gz', l...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,767
dvwright/phunspell
refs/heads/main
/phunspell/tests/test_object_store_not_exist.py
import os import time import phunspell import inspect import unittest import tempfile TEMPDIR = tempfile.gettempdir() class TestPhunspellObjectStoreNotExist(unittest.TestCase): pspell = phunspell.Phunspell(object_storage=TEMPDIR) def setUp(self): self._rm_locale("ru_RU") def tearDown(self): ...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,768
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__ar.py
import phunspell import inspect import unittest class TestArPy(unittest.TestCase): pspell = phunspell.Phunspell('ar') def test_word_found(self): self.assertTrue(self.pspell.lookup("يقرحان")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def test_lo...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,769
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__ne_NP.py
import phunspell import inspect import unittest class TestNeNP(unittest.TestCase): pspell = phunspell.Phunspell('ne_NP') def test_word_found(self): self.assertTrue(self.pspell.lookup("डम्फु")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def test_...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,770
dvwright/phunspell
refs/heads/main
/phunspell/phunspell.py
# Copyright (c) 2021 David Wright # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distri...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,771
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__cs_CZ.py
import phunspell import inspect import unittest # TODO class TestCsCZ(unittest.TestCase): pass # pspell = phunspell.Phunspell('cs_CZ') # def test_word_found(self): # self.assertTrue(true) if __name__ == "__main__": unittest.main()
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,772
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__is.py
import phunspell import inspect import unittest class TestIS(unittest.TestCase): pspell = phunspell.Phunspell('is') def test_word_found(self): self.assertTrue(self.pspell.lookup("vonbiðilsins")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def tes...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,773
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__uk_UA.py
import phunspell import inspect import unittest class TestUkUA(unittest.TestCase): pspell = phunspell.Phunspell('uk_UA') def test_word_found(self): self.assertTrue(self.pspell.lookup("фосфоричність")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) d...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,774
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__te_IN.py
import phunspell import inspect import unittest class TestTeIN(unittest.TestCase): pspell = phunspell.Phunspell('te_IN') def test_word_found(self): self.assertTrue(self.pspell.lookup("గుర్రుమని")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def t...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,775
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__pl_PL.py
import phunspell import inspect import unittest # TODO: class TestPhunspellLangs(unittest.TestCase): pass # pspell = phunspell.Phunspell('pl_PL') if __name__ == "__main__": unittest.main()
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,776
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__zu_ZA.py
import phunspell import inspect import unittest # TODO class TestZuAZ(unittest.TestCase): pass # pspell = phunspell.Phunspell('zu_ZA') if __name__ == "__main__": unittest.main()
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,777
dvwright/phunspell
refs/heads/main
/phunspell/tests/test_object_store_expected.py
import os import phunspell import inspect import unittest import tempfile TEMPDIR = tempfile.gettempdir() class TestPhunspellObjectStoreExpected(unittest.TestCase): loc = "ru_RU" # use object path pspell = phunspell.Phunspell(object_storage=TEMPDIR) pspell.dictionary_loader([loc]) def tearDown(s...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,778
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__ro.py
import phunspell import inspect import unittest class TestRO(unittest.TestCase): pspell = phunspell.Phunspell('ro_RO') def test_word_found(self): self.assertTrue(self.pspell.lookup("nesesizată")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def te...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,779
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__kmr_Latn.py
import phunspell import inspect import unittest class TestKmrLatn(unittest.TestCase): pspell = phunspell.Phunspell('kmr_Latn') def test_word_found(self): self.assertTrue(self.pspell.lookup("dîrok")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,780
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__el_GR.py
import phunspell import inspect import unittest # TODO class TestElGR(unittest.TestCase): pspell = phunspell.Phunspell('el_GR') def test_true(self): self.assertTrue(True) # def test_word_found(self): # # self.assertTrue(self.pspell.lookup("åðéóðåýóáíôá")) # self.assertTrue(self...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,781
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__bn_BD.py
import phunspell import inspect import unittest class TestBnBD(unittest.TestCase): pspell = phunspell.Phunspell('bn_BD') def test_word_found(self): self.assertTrue(self.pspell.lookup("জিয়ান")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def test_...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,782
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__hi_IN.py
import phunspell import inspect import unittest class TestHiIN(unittest.TestCase): pspell = phunspell.Phunspell('hi_IN') def test_word_found(self): self.assertTrue(self.pspell.lookup("एनटीटीडोकोमो")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) de...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,783
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__sk_SK.py
import phunspell import inspect import unittest class TestSkSK(unittest.TestCase): pspell = phunspell.Phunspell('sk_SK') def test_word_found(self): self.assertTrue(self.pspell.lookup("nezbožštite")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,784
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__th_TH.py
import phunspell import inspect import unittest class TestThTH(unittest.TestCase): pspell = phunspell.Phunspell('th_TH') def test_word_found(self): self.assertTrue(self.pspell.lookup("พริ้มเพรา")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def t...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,785
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__bg_BG.py
import phunspell import inspect import unittest class TestBgBG(unittest.TestCase): pspell = phunspell.Phunspell('bg_BG') def test_word_found(self): self.assertTrue(self.pspell.lookup("удържехме")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) def t...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,786
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__br_FR.py
import phunspell import inspect import unittest class TestBrFR(unittest.TestCase): pspell = phunspell.Phunspell('br_FR') def test_word_found(self): self.assertTrue(self.pspell.lookup("c'huñvderioù")) def test_word_not_found(self): self.assertFalse(self.pspell.lookup("phunspell")) de...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,787
dvwright/phunspell
refs/heads/main
/phunspell/tests/test__sl_SI.py
import phunspell import inspect import unittest # TODO class TestSlSL(unittest.TestCase): pspell = phunspell.Phunspell('sl_SI') def test_true(self): self.assertTrue(True) # def test_word_found(self): # self.assertTrue(self.pspell.lookup("Podvr¹ièe")) # def test_word_not_found(self)...
{"/phunspell/tests/test__sr.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_multi_load_no_cache.py": ["/phunspell/__init__.py"], "/phunspell/tests/test_phunspell.py": ["/phunspell/__init__.py"], "/phunspell/__init__.py": ["/phunspell/phunspell.py"], "/phunspell/tests/test__gug.py": ["/phunspell/__init__.py"], "...
47,792
bdomars/mortar-py
refs/heads/master
/mortarlib/gridref.py
import numpy as np import re from .errors import GridError, ParseError BASE_GRID = 300.0 class GridRef(object): ''' GridRef is a class to contain grid references in a meaningful way for calculations. A GridRef is usually constructed using the classmethod GridRef.from_string(). ''' def __init__(...
{"/mortarlib/__init__.py": ["/mortarlib/gridref.py"]}
47,793
bdomars/mortar-py
refs/heads/master
/grid.py
#!/usr/bin/env python2 import argparse import math import numpy as np import numpy.linalg as la from scipy import interpolate from mortarlib import GridRef from mortarlib.errors import Error NORTH = np.array([0, -100]) ranges = np.arange(50, 1251, 50) mils = np.array([ 1579, 1558, 1538, 1517, 14...
{"/mortarlib/__init__.py": ["/mortarlib/gridref.py"]}
47,794
bdomars/mortar-py
refs/heads/master
/mortarlib/__init__.py
from .gridref import GridRef # NOQA
{"/mortarlib/__init__.py": ["/mortarlib/gridref.py"]}
47,804
Nuzhny007/clcommons
refs/heads/master
/tests/kernels.py
import pyopencl as cl import pyopencl.array as clarray from time import time import numpy as np import os from median_of_medians import base_path from common import * from numpy import uint32, int32 common_lib_path = base_path #ctx = cl.create_some_context() platform = cl.get_platforms()[0] devices = [device for devi...
{"/tests/platform.py": ["/tests/common.py"]}
47,805
Nuzhny007/clcommons
refs/heads/master
/tests/platform.py
from .common import * platform = cl.get_platforms()[0] devices = [device for device in platform.get_devices() if device.type == cl.device_type.GPU] device = [devices[0]] queue_properties = cl.command_queue_properties.PROFILING_ENABLE ctx = cl.Context(devices) queues = [cl.CommandQueue(ctx, device, properties=queue_pro...
{"/tests/platform.py": ["/tests/common.py"]}
47,806
Nuzhny007/clcommons
refs/heads/master
/tests/unit_tests.py
import unittest from .common import * from .platform import * def prefix_sum_test(input_data, kernel, dtype, exclusive): #print 'wg_size: %r'%(wg_size,) wg_size = len(input_data) ref_result = prefix_sum(input_data, exclusive, dtype=dtype) src_buf = cl.Buffer(ctx, cl.mem_flags.READ_WRITE, wg_size*dty...
{"/tests/platform.py": ["/tests/common.py"]}
47,807
Nuzhny007/clcommons
refs/heads/master
/tests/common.py
import unittest import os from os.path import join as pjoin import pyopencl as cl import pyopencl.array as clarray import numpy as np from numpy import uint32, int32 common_lib_path = os.path.normpath(pjoin(os.path.dirname(os.path.realpath(__file__)), '..', 'include')) base_path = os.path.dirname(os.path.realpath(__f...
{"/tests/platform.py": ["/tests/common.py"]}
47,809
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/estoque/__init__.py
# arquivo obrigatorio para um package
{"/main.py": ["/estoque/utilidades/moeda.py"]}
47,810
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/estoque/produto.py
def cadastrar_produto(produto): nome = produto['nome'] print(f'Produto: {nome} cadastrado') def remover_produto(): print('produto removido')
{"/main.py": ["/estoque/utilidades/moeda.py"]}
47,811
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/main.py
""" Um módulo é um arquivo contendo definições e instruções Python que podem ser importados para utilização de seus recursos. https://docs.python.org/pt-br/3/tutorial/modules.html """ # from operacoes import * # import operacoes from operacoes import * desaconselhavel utilizar importe apenas o que for utilizar pois se...
{"/main.py": ["/estoque/utilidades/moeda.py"]}
47,812
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/estoque/inventario.py
def atualizar_quantidade_produto(produto): nome = produto['nome'] qtd = produto['quantidade'] print(f'produto: {nome}, unidades: {qtd}')
{"/main.py": ["/estoque/utilidades/moeda.py"]}
47,813
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/estoque/utilidades/moeda.py
def formatar_real(preco): return f'R$ {preco:.2f}'.replace('.',',')
{"/main.py": ["/estoque/utilidades/moeda.py"]}
47,814
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/modulos-padroes.py
""" Um módulo é im arquivo contendo definições e instruções Python que podem ser importados para utilização de seus recursos Permitem expandir as funcionalidades da linguagem além dos recursos padrões 1) É possível utilizar módulos padrões do Python 2) É possível instalar módulos https://docs.python.org/pt-br/3/py-modi...
{"/main.py": ["/estoque/utilidades/moeda.py"]}
47,815
GustavoHMFonseca/Desenvolimento-Web-full-Stack-com-Python-e-Django---Python-Moudulos-e-Pacotes
refs/heads/main
/operacoes.py
nome_empresa = 'mirror-sistemas' def somar(n1, n2): return n1 + n2 def multiplicar(n1, n2): return n1 * n2 def subtrair(n1, n2): return n1 - n2 print(__name__) # Caso rode este codigo aqui aparecerá __main__ pois esse quando executado diretamente é o arquivo # principal! if __name__ == '__main__': ...
{"/main.py": ["/estoque/utilidades/moeda.py"]}
48,035
DeanDro/Battleship
refs/heads/main
/player.py
class Player: """This class represents a player in the game""" def __init__(self, name): """The class creates a Player for the game. It takes the username for the player.""" self._username = name def get_username(self): """Returns the name of the player""" return self._us...
{"/game.py": ["/game_logic.py"], "/main.py": ["/game.py"], "/game_logic.py": ["/player.py"]}
48,036
DeanDro/Battleship
refs/heads/main
/game.py
"""This class starts the battleship game and works as presentation layer""" import pygame import sys from game_logic import GameLogic class BattleShip: """Represents a battleship game""" def __init__(self, username): """Initiates the game and takes as a parameter the users name""" pygame.ini...
{"/game.py": ["/game_logic.py"], "/main.py": ["/game.py"], "/game_logic.py": ["/player.py"]}
48,037
DeanDro/Battleship
refs/heads/main
/main.py
# Author: Konstantinos Drosos # Date: 5/15/2021 # Description: A battleship game import tkinter as tk from tkinter import * from game import BattleShip import os class Application(tk.Frame): """This class represents the starting page of the game""" def __init__(self, master, image): """Initializes...
{"/game.py": ["/game_logic.py"], "/main.py": ["/game.py"], "/game_logic.py": ["/player.py"]}
48,038
DeanDro/Battleship
refs/heads/main
/game_logic.py
# In this class we will hold all decisions made for AI in the game as well as respond to user moves import random from player import Player class GameLogic: """ This class manages all decisions made by AI and response to user interaction. """ def __init__(self, human_name): """This class wi...
{"/game.py": ["/game_logic.py"], "/main.py": ["/game.py"], "/game_logic.py": ["/player.py"]}
48,039
kirillvh/Robotism
refs/heads/master
/kalmanAccVel.py
import numpy as np import matplotlib.pyplot as plt import math from numpy.linalg import inv class kalmanKinematic2: def __init__(self, encoder_sampl_period, encResolution,uncertaintyGain): self.T = encoder_sampl_period self.encResolution = encResolution self.x = np.zeros((2,1)) self.P = np.zeros((2,2)) self...
{"/QPtrajectory.py": ["/QP.py"]}
48,040
kirillvh/Robotism
refs/heads/master
/QP.py
# -*- coding: utf-8 -*- """ Created on Thu Oct 13 21:42:37 2016 @author: Kirill Van Heerden """ import numpy as np import matplotlib.pyplot as plt import os import math import quadprog # x.T*Q*x + q.T*x + r = 0 class Quadratic(object): def __init__(self, Q=None, q=None, r=0.0): assert Q is None or type...
{"/QPtrajectory.py": ["/QP.py"]}
48,041
kirillvh/Robotism
refs/heads/master
/QPtrajectory.py
# -*- coding: utf-8 -*- """ Created on Tue Jan 3 17:43:39 2017 @author: Kirill Van Heerden """ from QP import * import numpy as np import matplotlib.pyplot as plt class QPTrajectory(object): def __init__(self, initalState=[0.,0.,0.],samplingTime=0.1, COMHeight=0.5,numtrjPoints=16): self.initalState = np...
{"/QPtrajectory.py": ["/QP.py"]}
48,042
kirillvh/Robotism
refs/heads/master
/forceDistributor.py
# -*- coding: utf-8 -*- """ Created on Tue Jan 3 01:22:40 2017 @author: Kirill Van Heerden """ import numpy as np class forceDistributor(object): def __init__(self): # COM coordinates # # F_z1------F_z2 . F_z5------F_z6 # | | x /|\ ...
{"/QPtrajectory.py": ["/QP.py"]}
48,052
scottdk/gurgle
refs/heads/master
/module/sheet.py
from urllib2 import urlopen from urllib import urlencode from config import Config from cache import IsNotInCache, CacheUpdate import json import time # Logger instance used by the functions in this module _LOGGER = Config.getLogger("sheet") # Configuration for the Google Sheet interaction __SHEET_URL = Config.getReq...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,053
scottdk/gurgle
refs/heads/master
/module/config.py
"""Provides for basic configuration of the system parameters and logging infrastructure.""" import ConfigParser import json import logging import logging.config import md5 from os import makedirs from os.path import isdir, isfile # Defines the file names checked for configuration overrides _CONFIG_FILES = ['gurgle-loc...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,054
scottdk/gurgle
refs/heads/master
/module/filter.py
from math import pow from datetime import datetime as dt from config import Config # Logger instance used by the functions in this module _LOGGER = Config.getLogger("filter") # Determine if only looking for events today _TODAY_ONLY = Config.getBoolean('events', 'today_only', True) # Allow specific named systems to be...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,055
scottdk/gurgle
refs/heads/master
/eddn.py
import zlib import zmq import json import time from module.config import Config from module.influence import ConsumeFSDJump # Configuration specified for the EDDN connection __EDDN_RELAY = Config.getString('eddn', 'relay') __EDDN_TIMEOUT = Config.getInteger('eddn', 'timeout', 60000) __EDDN_RECONNECT = Config.getIntege...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,056
scottdk/gurgle
refs/heads/master
/file.py
import json import sys from module.config import Config from module.influence import ConsumeFSDJump def main(): """Main method that reads file for update.""" logger = Config.getLogger("file") fileName = sys.argv[1] logger.info("Reading file: %s", fileName) try: with open(fileName, "r") as f...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,057
scottdk/gurgle
refs/heads/master
/module/cache.py
from datetime import datetime as dt # Cache mechanism that attempts to prevent duplicate updates # While ideally we wanted the Google Sheet to prevent duplicates, this is # actually very difficult to achieve due to a lack of optimised search functionality. # Instead we'll attempt to prevent duplicates within a sing...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,058
scottdk/gurgle
refs/heads/master
/module/influence.py
from math import pow, sqrt from config import Config from filter import IsInteresting from sheet import PostUpdate import re # Logger instance used by the functions in this module _LOGGER = Config.getLogger("influence") # Determine whether we are rounding the distance or location _ROUND_DISTANCE = Config.getInteger('...
{"/file.py": ["/module/config.py", "/module/influence.py"]}
48,059
cretomoharada/dddpy
refs/heads/main
/dddpy/domain/book/book.py
from typing import Optional from .isbn import Isbn class Book: """Book represents your collection of books as an entity.""" def __init__( self, id: str, isbn: Isbn, title: str, page: int, read_page: int = 0, created_at: Optional[int] = None, up...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,060
cretomoharada/dddpy
refs/heads/main
/main.py
import logging from logging import config from typing import Iterator, List from fastapi import Depends, FastAPI, HTTPException, status from sqlalchemy.orm.session import Session from dddpy.domain.book import ( BookIsbnAlreadyExistsError, BookNotFoundError, BookRepository, BooksNotFoundError, ) from d...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,061
cretomoharada/dddpy
refs/heads/main
/tests/domain/book/test_book.py
import pytest from dddpy.domain.book import Book, Isbn class TestBook: def test_constructor_should_create_instance(self): book = Book( id="book_01", isbn=Isbn("978-0321125217"), title="Domain-Driven Design: Tackling Complexity in the Heart of Softwares", pa...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,062
cretomoharada/dddpy
refs/heads/main
/dddpy/infrastructure/sqlite/book/book_dto.py
from datetime import datetime from typing import Union from sqlalchemy import Column, Integer, String from dddpy.domain.book import Book, Isbn from dddpy.infrastructure.sqlite.database import Base from dddpy.usecase.book import BookReadModel def unixtimestamp() -> int: return int(datetime.now().timestamp() * 10...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,063
cretomoharada/dddpy
refs/heads/main
/dddpy/usecase/book/book_query_usecase.py
from abc import ABC, abstractmethod from typing import List, Optional from dddpy.domain.book import BookNotFoundError, BooksNotFoundError from .book_query_model import BookReadModel from .book_query_service import BookQueryService class BookQueryUseCase(ABC): """BookQueryUseCase defines a query usecase inteface...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,064
cretomoharada/dddpy
refs/heads/main
/dddpy/domain/book/book_repository.py
from abc import ABC, abstractmethod from typing import List, Optional from dddpy.domain.book import Book class BookRepository(ABC): """BookRepository defines a repository interface for Book entity.""" @abstractmethod def create(self, book: Book) -> Optional[Book]: raise NotImplementedError ...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,065
cretomoharada/dddpy
refs/heads/main
/dddpy/infrastructure/sqlite/book/book_repository.py
from typing import Optional from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.orm.session import Session from dddpy.domain.book import Book, BookRepository from dddpy.usecase.book import BookCommandUseCaseUnitOfWork from .book_dto import BookDTO class BookRepositoryImpl(BookRepository): """BookRepos...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,066
cretomoharada/dddpy
refs/heads/main
/dddpy/domain/book/__init__.py
from .book import Book from .book_exception import ( BookIsbnAlreadyExistsError, BookNotFoundError, BooksNotFoundError, ) from .book_repository import BookRepository from .isbn import Isbn
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,067
cretomoharada/dddpy
refs/heads/main
/dddpy/domain/book/isbn.py
import re from dataclasses import dataclass regex = r"978[-0-9]{10,15}" pattern = re.compile(regex) @dataclass(init=False, eq=True, frozen=True) class Isbn: """Isbn represents an ISBN code as a value object""" value: str def __init__(self, value: str): if pattern.match(value) is None: ...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,068
cretomoharada/dddpy
refs/heads/main
/dddpy/presentation/schema/book/book_error_message.py
from pydantic import BaseModel, Field from dddpy.domain.book import ( BookIsbnAlreadyExistsError, BookNotFoundError, BooksNotFoundError, ) class ErrorMessageBookNotFound(BaseModel): detail: str = Field(example=BookNotFoundError.message) class ErrorMessageBooksNotFound(BaseModel): detail: str = ...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,069
cretomoharada/dddpy
refs/heads/main
/tests/usecase/book/test_book_query_usecase.py
from unittest.mock import MagicMock, Mock import pytest from dddpy.domain.book import BookNotFoundError from dddpy.infrastructure.sqlite.book import BookQueryServiceImpl from dddpy.usecase.book import BookQueryUseCaseImpl, BookReadModel class TestBookQueryUseCase: def test_fetch_book_by_id_should_return_book(se...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,070
cretomoharada/dddpy
refs/heads/main
/tests/domain/book/test_isbn.py
import dataclasses import pytest from dddpy.domain.book import Isbn class TestIsbn: @pytest.mark.parametrize( "value", [ ("978-0321125217"), ("978-4-949999-12-0"), ], ) def test_constructor_should_create_instance(self, value): isbn = Isbn(value) ...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,071
cretomoharada/dddpy
refs/heads/main
/dddpy/usecase/book/book_command_usecase.py
from abc import ABC, abstractmethod from typing import Optional, cast import shortuuid from dddpy.domain.book import ( Book, BookIsbnAlreadyExistsError, BookNotFoundError, BookRepository, Isbn, ) from .book_command_model import BookCreateModel, BookUpdateModel from .book_query_model import BookRe...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,072
cretomoharada/dddpy
refs/heads/main
/dddpy/usecase/book/book_query_model.py
from typing import cast from pydantic import BaseModel, Field from dddpy.domain.book import Book class BookReadModel(BaseModel): """BookReadModel represents data structure as a read model.""" id: str = Field(example="vytxeTZskVKR7C7WgdSP3d") isbn: str = Field(example="978-0321125217") title: str = ...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,073
cretomoharada/dddpy
refs/heads/main
/dddpy/infrastructure/sqlite/book/__init__.py
from .book_dto import BookDTO from .book_query_service import BookQueryServiceImpl from .book_repository import BookCommandUseCaseUnitOfWorkImpl, BookRepositoryImpl
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,074
cretomoharada/dddpy
refs/heads/main
/dddpy/usecase/book/book_command_model.py
from pydantic import BaseModel, Field, validator class BookCreateModel(BaseModel): """BookCreateModel represents a write model to create a book.""" isbn: str = Field(example="978-0321125217") title: str = Field( example="Domain-Driven Design: Tackling Complexity in the Heart of Softwares" ) ...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,075
cretomoharada/dddpy
refs/heads/main
/dddpy/usecase/book/book_query_service.py
from abc import ABC, abstractmethod from typing import List, Optional from .book_query_model import BookReadModel class BookQueryService(ABC): """BookQueryService defines a query service inteface related Book entity.""" @abstractmethod def find_by_id(self, id: str) -> Optional[BookReadModel]: ra...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,076
cretomoharada/dddpy
refs/heads/main
/dddpy/usecase/book/__init__.py
from .book_command_model import BookCreateModel, BookUpdateModel from .book_command_usecase import ( BookCommandUseCase, BookCommandUseCaseImpl, BookCommandUseCaseUnitOfWork, ) from .book_query_model import BookReadModel from .book_query_service import BookQueryService from .book_query_usecase import BookQu...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,077
cretomoharada/dddpy
refs/heads/main
/tests/infrastructure/sqlite/book/test_book_dto.py
import pytest from dddpy.domain.book import Book, Isbn from dddpy.infrastructure.sqlite.book import BookDTO class TestBookDTO: def test_to_read_model_should_create_entity_instance(self): book_dto = BookDTO( id="book_01", isbn="978-0321125217", title="Domain-Driven Desi...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,078
cretomoharada/dddpy
refs/heads/main
/dddpy/infrastructure/sqlite/book/book_query_service.py
from typing import List, Optional from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.orm.session import Session from dddpy.usecase.book import BookQueryService, BookReadModel from .book_dto import BookDTO class BookQueryServiceImpl(BookQueryService): """BookQueryServiceImpl implements READ operations...
{"/dddpy/domain/book/book.py": ["/dddpy/domain/book/isbn.py"], "/main.py": ["/dddpy/domain/book/__init__.py", "/dddpy/infrastructure/sqlite/book/__init__.py", "/dddpy/presentation/schema/book/book_error_message.py", "/dddpy/usecase/book/__init__.py"], "/tests/domain/book/test_book.py": ["/dddpy/domain/book/__init__.py"...
48,079
whiterson/mockingJay
refs/heads/master
/tribute.py
import random import engine import json import copy import sys from probability import uniform_variable as U from weaponInfo import weaponInfo from weapon import weapon import mapReader class Particle(object): def __init__(self, state=(0, 0), width=1, height=1): self.state = state self.width, self....
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,080
whiterson/mockingJay
refs/heads/master
/probability.py
__author__ = 'Nathan' import random def uniform_variable(mean, spread): base = random.randrange(0, 2*spread) - spread s = base + mean return s def discrete_variable(pmf, domain): cum_sum = 0 cdf = [0] for x in range(domain[0], domain[1]): cum_sum += pmf(x) cdf.append(cum_sum...
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,081
whiterson/mockingJay
refs/heads/master
/weaponInfo.py
class weaponInfo: def __init__(self): self.bow = ['longStick', 'shortStick', 'vine', 'sharpStone', 'feather'] self.slingshot= ['longGrass', 'pebbles'] self.blowgun = ['reeds', 'feather', 'thorn'] self.hammer = ['broadStone','shortStick'] self.mace = ['sharpStone', 'thorn', 's...
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,082
whiterson/mockingJay
refs/heads/master
/action.py
class Action: def __init__(self, values, effected, duration, index, delta_state, desc=''): self.values = values self.effected = effected self.duration = duration self.index = index self.delta_state = delta_state self.description = desc def __repr__(self): ...
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,083
whiterson/mockingJay
refs/heads/master
/engine.py
__author__ = 'Nathan' import pygame import graphics import random import map from action import Action from tribute import Tribute from goal import Goal from mapReader import readMap from random import randint from pygame.locals import * import json class GameEngine(object): """ here we will essentially manag...
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,084
whiterson/mockingJay
refs/heads/master
/goal.py
class Goal: def __init__(self, name, value): self.name = name self.value = value self.rate = 1 def clone(self): g = Goal(self.name[:], self.value) g.rate = self.rate return g def modify_value(self, mod): self.value = max(self.value + mod, 0)
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,085
whiterson/mockingJay
refs/heads/master
/main.py
__author__ = 'Nathan' """ This file is for testing only """ import pygame from engine import GameEngine from tribute import Tribute pygame.init() GameEngine.start()
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,086
whiterson/mockingJay
refs/heads/master
/graphics.py
__author__ = 'Nathan' import pygame from pygame import Rect class GameView(object): """ GameView constructs the main GUI window and handles all the drawing routines """ def __init__(self, width, height, cell_size=(10, 10)): self.buttons = [] self.names = [] self.size = self.wi...
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}
48,087
whiterson/mockingJay
refs/heads/master
/map.py
import mapReader import PIL import game class Map: def __init__(self, path): self.map_image = PIL.Image.open(path) self.pixel_map = self.map_image.load() def seed_game_state(self, parts): gs = game.GameState(parts) gs.world['ground'] = self gs.grid['ground'] = [(x, y, ...
{"/main.py": ["/engine.py", "/tribute.py"], "/map.py": ["/mapReader.py", "/game.py"], "/mapReader.py": ["/locationDef.py"], "/game.py": ["/tribute.py"], "/locationDef.py": ["/tribute.py"], "/weapon.py": ["/weaponInfo.py"]}