index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
92,620
tiru1930/text-recognition
refs/heads/master
/demo.py
import torch from torch.autograd import Variable import utils import dataset from PIL import Image import models.crnn as c_rnn def getPrediction(imagePath): model_path = './expr/netCRNN_999.pth' alphabet = '0123456789abcdefghijklmnopqrstuvwxyz' model = c_rnn.CRNN(32, 1, 37, 256) if torch.cuda.is_avail...
{"/demo.py": ["/models/crnn.py"]}
92,639
YoungsoonLee/Frest
refs/heads/master
/app/config.py
# -*- coding: utf-8 -*- import os import sys # ----------------------------- # COMMON CONFIG # ----------------------------- basedir = os.path.abspath(os.path.dirname(__file__)) # print(basedir) if os.path.exists('config.env'): print('Importing environment from .env file') for line in open('config.env'): ...
{"/app/routes/api/v1/auth/reset_password.py": ["/app/models/user_model.py"], "/app/routes/api/v1/confirm.py": ["/app/models/user_model.py"], "/app/routes/api/v1/users/user.py": ["/app/models/user_model.py"]}
92,640
YoungsoonLee/Frest
refs/heads/master
/app/routes/api/v1/auth/reset_password.py
# -*- coding: utf-8 -*- from flask import request from flask_api import status from flask_restful import Resource from app.modules import frest from app.models.user_model import UserModel, get_user from sqlalchemy.exc import IntegrityError from werkzeug.security import generate_password_hash from app import db from ap...
{"/app/routes/api/v1/auth/reset_password.py": ["/app/models/user_model.py"], "/app/routes/api/v1/confirm.py": ["/app/models/user_model.py"], "/app/routes/api/v1/users/user.py": ["/app/models/user_model.py"]}
92,641
YoungsoonLee/Frest
refs/heads/master
/app/routes/api/v1/confirm.py
# -*- coding: utf-8 -*- from flask import request from flask_api import status from flask_restful import Resource from app.modules import frest from app import db from app.models.user_model import UserModel, email_confirmed from app.modules.frest.serialize.user import serialize_user from app.models.user_token_model im...
{"/app/routes/api/v1/auth/reset_password.py": ["/app/models/user_model.py"], "/app/routes/api/v1/confirm.py": ["/app/models/user_model.py"], "/app/routes/api/v1/users/user.py": ["/app/models/user_model.py"]}
92,642
YoungsoonLee/Frest
refs/heads/master
/app/routes/api/v1/users/user.py
# # -*- coding: utf-8 -*- import re import datetime from flask import request from flask_api import status from flask_restful import Resource from sqlalchemy.exc import IntegrityError from werkzeug.security import generate_password_hash from app import db, token_auth from app.models.user_model import UserModel, get_u...
{"/app/routes/api/v1/auth/reset_password.py": ["/app/models/user_model.py"], "/app/routes/api/v1/confirm.py": ["/app/models/user_model.py"], "/app/routes/api/v1/users/user.py": ["/app/models/user_model.py"]}
92,643
YoungsoonLee/Frest
refs/heads/master
/app/models/user_model.py
# -*- coding: utf-8 -*- import datetime from sqlalchemy import Column, Integer, String, DateTime from app import db class UserModel(db.Model): __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(String(255), unique=True, nullable=False) email = Column(String(255), unique=...
{"/app/routes/api/v1/auth/reset_password.py": ["/app/models/user_model.py"], "/app/routes/api/v1/confirm.py": ["/app/models/user_model.py"], "/app/routes/api/v1/users/user.py": ["/app/models/user_model.py"]}
92,644
devnicg/CsvParser
refs/heads/master
/testcsv.py
import os, random, sys from pathlib import Path class TestCsvs(): def __init__(self, folder): self.folder = Path(folder) self.csvList = [] self.importFilesToCsvList() def importFilesToCsvList(self): try: # os.walk() retrieves the 3-tuple root, dirs, files of the g...
{"/csvparser.py": ["/testcsv.py"]}
92,645
devnicg/CsvParser
refs/heads/master
/csvparser.py
from testcsv import TestCsvs import os, json, sqlite3, sys os.chdir(sys.path[0]) class CsvParser(): def __init__(self, csv_file, seperator): """Initialize the CsvParser. Args: csv_file (String): path to a CSV file. sep (String): Seperator used in given CSV file. ""...
{"/csvparser.py": ["/testcsv.py"]}
92,649
druckmann-lab/EntericNervousSystemAnalysis
refs/heads/main
/AnalysisPanel.py
import spatial_analysis_utils as utils0 import numpy as np import pandas as pd import copy, os import matplotlib.pyplot as plt from PIL import Image import utils from matplotlib import gridspec import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 class AnalysisP...
{"/AnalysisPanel.py": ["/spatial_analysis_utils.py", "/utils.py"], "/utils.py": ["/spatial_analysis_utils.py"]}
92,650
druckmann-lab/EntericNervousSystemAnalysis
refs/heads/main
/spatial_analysis_utils.py
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from scipy.interpolate import interp1d import matplotlib matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 def load_multi_sheet_data(data_file): # load xls = pd.ExcelFile(data_file) loc_array_l...
{"/AnalysisPanel.py": ["/spatial_analysis_utils.py", "/utils.py"], "/utils.py": ["/spatial_analysis_utils.py"]}
92,651
druckmann-lab/EntericNervousSystemAnalysis
refs/heads/main
/utils.py
import numpy as np import spatial_analysis_utils as utils0 import matplotlib.pyplot as plt import copy from scipy.interpolate import interp1d import os import matplotlib import copy from sklearn.metrics import auc as sklearn_auc matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 ...
{"/AnalysisPanel.py": ["/spatial_analysis_utils.py", "/utils.py"], "/utils.py": ["/spatial_analysis_utils.py"]}
92,669
0h-n0/bioplot
refs/heads/master
/bioplot/bioplot.py
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import cm one_letter_to_three_letter = { 'A' : 'ALA', 'R' : 'ARG', 'N' : 'ASN', 'D' : 'ASP', 'B' : 'ASX', 'C' : 'CYS', 'E' : 'GLU', 'Q' : 'GLN', 'Z' : 'GLX', 'G' : 'GLY', 'H' : 'HIS',...
{"/bioplot/__init__.py": ["/bioplot/bioplot.py"]}
92,670
0h-n0/bioplot
refs/heads/master
/bioplot/__init__.py
__version__ = "0.0.2" from .bioplot import Bioplot
{"/bioplot/__init__.py": ["/bioplot/bioplot.py"]}
92,675
marx-merten/pygameTest
refs/heads/master
/main.py
#!/usr/bin/env python3 from simplegame import Game if __name__ == '__main__': game = Game() game.init() game.run()
{"/main.py": ["/simplegame/__init__.py"]}
92,676
marx-merten/pygameTest
refs/heads/master
/simplegame/__init__.py
import pygame from pygame.locals import * class Player(pygame.sprite.Sprite): def __init__(self, x, y): super(Player, self).__init__() self.pos = (x, y) self.surf = pygame.Surface((75, 75)) self.surf.fill((255, 255, 255)) pygame.draw.line(self.surf, (29, 93, 22), (20, 22), ...
{"/main.py": ["/simplegame/__init__.py"]}
92,677
marx-merten/pygameTest
refs/heads/master
/game1.py
#!/usr/bin/env python3 import xml.etree.ElementTree as ET import re root = ET.parse('./assets/spaceshooter/Spritesheet/sheet.xml').getroot() for st in root.findall('SubTexture'): print((re.sub(r'(.*)\.png', r'\1', st.get('name'))), st.get('x'), st.get('y'), st.get('width'), st.get('height'))
{"/main.py": ["/simplegame/__init__.py"]}
92,682
boris-turner/samlkeygen
refs/heads/master
/samlkeygen/__init__.py
#!/usr/bin/env python from ._version import __version__, __version_info__ from .entry_points import authenticate, list_profiles, select_profile, samld, awsprof, awsprofs, awsrun, main
{"/samlkeygen/__main__.py": ["/samlkeygen/__init__.py"]}
92,683
boris-turner/samlkeygen
refs/heads/master
/samlkeygen/__main__.py
#!/usr/bin/env python import samlkeygen samlkeygen.entry_points.main()
{"/samlkeygen/__main__.py": ["/samlkeygen/__init__.py"]}
92,684
boris-turner/samlkeygen
refs/heads/master
/setup.py
from setuptools import setup, find_packages import os, sys setup( name='samlkeygen', version=os.popen('{} samlkeygen/_version.py'.format(sys.executable)).read().rstrip(), author='Mark J. Reed', author_email='mark.reed@turner.com', packages=find_packages(), py_modules=['samlkeygen'], url='http://github.co...
{"/samlkeygen/__main__.py": ["/samlkeygen/__init__.py"]}
92,685
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/gates.py
# Copyright 2019-, Gavin E. Crooks and contributors # Copyright 2016-2018, Rigetti Computing # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. from typing import TextIO import numpy as np import scipy from . import tenso...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,686
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/modules_test.py
# Copyright 2020-, Gavin E. Crooks and contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. import networkx as nx import numpy as np import pytest import scipy.linalg import quantumflow as qf def test_identity...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,687
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/qubits.py
# Copyright 2020-, Gavin E. Crooks and contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ .. module:: quantumflow .. contents:: :local: .. currentmodule:: quantumflow Qubits ====== States, gates, and vario...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,688
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/gates_test.py
# Copyright 2019-, Gavin E. Crooks and contributors # Copyright 2016-2018, Rigetti Computing # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. import io from typing import Type import numpy as np import pytest import quan...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,689
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/xforest.py
# Copyright 2016-2018, Rigetti Computing # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ .. module:: quantumflow.xforest Interface to pyQuil and the Rigetti Forest. .. autofunction:: circuit_to_pyquil .. autofunctio...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,690
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/xqiskit.py
# Copyright 2019-, Gavin E. Crooks and the QuantumFlow contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ .. contents:: :local: .. currentmodule:: quantumflow.xqiskit Interface between IBM's Qiskit and Qua...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,691
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/xqsim.py
# Copyright 2019-, Gavin E. Crooks and the QuantumFlow contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ .. contents:: :local: .. currentmodule:: quantumflow.xquirk Interface to qsim https://github.com/qu...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,692
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/stdops.py
# Copyright 2019-, Gavin E. Crooks and the QuantumFlow contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ ======================== Miscellaneous Operations ======================== .. currentmodule:: quant...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,693
alexgalda/quantumflow-dev
refs/heads/master
/examples/examples_test.py
# Copyright 2019-, Gavin E. Crooks and the QuantumFlow contributors # # Copyright 2016-2018, Rigetti Computing # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ Unit tests for quantumflow examples. """ import subproces...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,694
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/modules.py
# Copyright 2020-, Gavin E. Crooks and the QuantumFlow contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """ .. contents:: :local: .. currentmodule:: quantumcompiler Gate Modules ############ Larger unitary c...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,695
alexgalda/quantumflow-dev
refs/heads/master
/quantumflow/stdgates/stdgates_test.py
# Copyright 2020-, Gavin E. Crooks and contributors # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. import random from itertools import chain from typing import Type import numpy as np import pytest import quantumflow a...
{"/quantumflow/gates.py": ["/quantumflow/qubits.py"], "/quantumflow/gates_test.py": ["/quantumflow/stdgates/stdgates_test.py"], "/quantumflow/xforest.py": ["/quantumflow/stdops.py"], "/quantumflow/xqiskit.py": ["/quantumflow/qubits.py", "/quantumflow/stdops.py"], "/quantumflow/xqsim.py": ["/quantumflow/qubits.py"], "/q...
92,712
dev-mendel/simulation
refs/heads/master
/src/generator/generator.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 10:50:10$" from abc import abstractmethod from debug.logger import Loggable #from objects.object import Object class Generator(Loggable): def __init__(self, INI_FILE, INI_LOADER_NAME): super().__init__() self.ini = ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,713
dev-mendel/simulation
refs/heads/master
/src/debug/iniLoader.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$23.12.2018 22:43:10$" import configparser from .logger import Logger class IniLoader: """ Loads data from ini file. Path is separated by '.' and first part is name of .ini file example: db.ini.load will load from ..co...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,714
dev-mendel/simulation
refs/heads/master
/src/visualization/data_picker.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$30.9.2020 20:29:10$" from debug.logger import Loggable, Logger from debug.iniLoader import IniLoader from shutil import copyfile import os class DataPicker(Loggable): def __init__(self, INI_FILE): super().__init__() self.time =...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,715
dev-mendel/simulation
refs/heads/master
/src/utils/pool.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 12:53:10$" from typing import List, Tuple import numpy as np from debug.iniLoader import IniLoader from debug.logger import Loggable #from objects.object import Object from utils.vector import Vector class Grid: """ Singleton clas...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,716
dev-mendel/simulation
refs/heads/master
/src/objects/object.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 11:42:10$" from abc import abstractmethod from enum import Enum from debug.logger import Loggable from generator.ID import ID from utils.vector import Vector from utils.pool import Grid class ObjectTypes(Enum): UNKNOWN = 1, CYANO...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,717
dev-mendel/simulation
refs/heads/master
/src/visualization/graphs.py
import json import matplotlib.pyplot as plt import plotly.graph_objs as go from plotly.offline import iplot, init_notebook_mode def getJsonArray(filepath): """deprecated""" with open(filepath) as file: lines = file.readlines() #print(lines[0:4]) return list(map(lambda x: jso...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,718
dev-mendel/simulation
refs/heads/master
/src/debug/logger.py
# To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. __author__ = "Pavel Kohout <xkohou15@stud.fit.vutbr.cz>" __date__ = "$5.6.2018 22:43:10$" import configparser import datetime import os class ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,719
dev-mendel/simulation
refs/heads/master
/src/generator/ball_generator.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 10:43:10$" from debug.iniLoader import IniLoader from utils.vector import Vector from objects.ball import Ball from generator.generator import Generator import random class BallGenerator(Generator): def __init__(self, INI_FILE): ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,720
dev-mendel/simulation
refs/heads/master
/src/generator/machine_entry.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 10:43:10$" from debug.iniLoader import IniLoader from utils.vector import Vector from objects.cyanobacteria import CyanoBacteria from generator.generator import Generator from random import randint class MachineEntry(Generator): def ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,721
dev-mendel/simulation
refs/heads/master
/src/utils/simulation.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 15:42:10$" from debug.logger import Loggable from debug.iniLoader import IniLoader from utils.pool import Grid from generator.generator import Generator from objects.object import Object from visualization.data_picker import DataPicker cl...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,722
dev-mendel/simulation
refs/heads/master
/src/objects/ball.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 16:21:10$" from objects.object import Object, ObjectTypes #from objects.cyanobacteria import CyanoBacteria from utils.vector import Vector from utils.simulation import SimulationManager from debug.iniLoader import IniLoader class Ball(Obj...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,723
dev-mendel/simulation
refs/heads/master
/src/generator/machine_exit.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 10:43:10$" from debug.iniLoader import IniLoader from utils.vector import Vector from utils.pool import Grid from utils.simulation import SimulationManager from generator.generator import Generator from objects.object import Object, ObjectT...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,724
dev-mendel/simulation
refs/heads/master
/src/main.py
import sys from utils.simulation import SimulationManager from generator.machine_entry import MachineEntry from generator.machine_exit import MachineExit from generator.ball_generator import BallGenerator from debug.iniLoader import IniLoader from debug.logger import Logger if __name__ == '__main__': if len(sys....
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,725
dev-mendel/simulation
refs/heads/master
/src/objects/cyanobacteria.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 16:05:10$" from objects.object import Object, ObjectTypes from objects.ball import Ball from utils.vector import Vector class CyanoBacteria(Object): def __init__(self, INI_FILE: str, pos: Vector, dir: Vector): super().__init_...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,726
dev-mendel/simulation
refs/heads/master
/src/visualization/3dScatterTest.py
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111, projection='3d') X = list(range(10)) Y = [5, 6, 2, 3, 13, 4, 1, 2, 4, 8] Z = [3, 5, 2, 6, 7, 3, 14, 3, 2, 9] ax.scatter(X, Y, Z, c='r', marker='o') plt.show()
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,727
dev-mendel/simulation
refs/heads/master
/src/generator/ID.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 10:50:10$" class ID: """ Singleton class for generating of unique ids """ generator = None def __init__(self): if not ID.generator: ID.generator = ID.__ID() def getID(self): ID.generato...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,728
dev-mendel/simulation
refs/heads/master
/src/visualization/plotly_simulation.py
import matplotlib.pyplot as plt import plotly.graph_objs as go from plotly.offline import iplot, init_notebook_mode def create_graph(balls, cyas, bubbles): assert len(balls) == len(cyas) and len(cyas) == len(bubbles) trace0 = go.Scatter(x=list(range(len(balls))), y=balls, ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,729
dev-mendel/simulation
refs/heads/master
/src/objects/bubble.py
from objects.object import Object, ObjectTypes #from objects.cyanobacteria import CyanoBacteria from utils.vector import Vector from utils.simulation import SimulationManager from debug.iniLoader import IniLoader class Bubble(Object): def __init__(self, INI_FILE: str, pos: Vector, dir: Vector): ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,730
dev-mendel/simulation
refs/heads/master
/src/utils/vector.py
__author__ = "Petr Kohout <xkohou14@stud.fit.vutbr.cz>" __date__ = "$29.8.2020 12:09:10$" class Vector: def __init__(self, x, y, z): self.v = (x, y, z) def plus(self, vec): x, y, z = self.v x2, y2, z2 = vec.v self.v = (x + x2, y + y2, z + z2) def minus(self, vec): ...
{"/src/debug/iniLoader.py": ["/src/debug/logger.py"]}
92,733
Allan690/social-app
refs/heads/master
/social/authentication/tests/test_retrieve_user.py
from unittest.mock import patch,Mock from rest_framework import status from .base_test import TestBaseCase class MockThread: def start(self): pass class RetrieveUserTest(TestBaseCase): """ Test for account verification """ @patch('social.authentication.views.UpdateUserThread', Mock( ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,734
Allan690/social-app
refs/heads/master
/social/posts/tests/test_update_post.py
from unittest.mock import patch, Mock from rest_framework.views import status from .base_test import TestBaseCase from ...authentication.tests.test_retrieve_user import MockThread class PostUpdateTest(TestBaseCase): @patch('social.authentication.views.UpdateUserThread', Mock( return_value=MockThread()) ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,735
Allan690/social-app
refs/heads/master
/social/posts/validators/validate_post.py
from rest_framework.serializers import ValidationError from ..models import Post from ...helpers.serialization_errors import error_dict def validate_post_id(user_id, post_id, method=None): """Validate that the post exists Args: post_id (str): the post id user_id(str): the user id metho...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,736
Allan690/social-app
refs/heads/master
/social/authentication/views.py
from rest_framework import status from rest_framework import generics, mixins from rest_framework.response import Response from rest_framework.permissions import AllowAny, IsAuthenticated from ..helpers.renderers import RequestJSONRenderer from .serializers import (RegistrationSerializer, LoginSerializer, ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,737
Allan690/social-app
refs/heads/master
/social/posts/views.py
import uuid from rest_framework import generics, status, mixins, viewsets from rest_framework.decorators import action from rest_framework.filters import SearchFilter from rest_framework.permissions import IsAuthenticated from rest_framework.renderers import JSONRenderer from rest_framework.response import Response f...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,738
Allan690/social-app
refs/heads/master
/social/helpers/serialization_errors.py
error_dict = { "required": "This field is required.", "empty_field": "This field cannot be empty.", "already_exist": "{0} already exist.", "invalid_password": "Password must have at least a number, " "and a least an uppercase and a lowercase letter.", "min_length": "{0} must ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,739
Allan690/social-app
refs/heads/master
/social/posts/tests/test_delete_post.py
from unittest.mock import patch, Mock from rest_framework.reverse import reverse from rest_framework.views import status from .base_test import TestBaseCase from ...authentication.tests.test_retrieve_user import MockThread class PostDeleteTest(TestBaseCase): @patch('social.authentication.views.UpdateUserThread'...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,740
Allan690/social-app
refs/heads/master
/social/posts/tests/base_test.py
import uuid from rest_framework.test import APITestCase from rest_framework.reverse import reverse from rest_framework.reverse import reverse as api_reverse from ...authentication.models import User from ..models import Post class TestBaseCase(APITestCase): def setUp(self): """ Method for setting...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,741
Allan690/social-app
refs/heads/master
/social/like_dislike/apps.py
from django.apps import AppConfig class LikeDislikeConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'social.like_dislike'
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,742
Allan690/social-app
refs/heads/master
/social/authentication/tests/test_signup.py
import json import time from unittest.mock import patch, Mock from rest_framework import status from .base_test import TestBaseCase from .test_retrieve_user import MockThread from ...helpers.constants import SIGNUP_SUCCESS_MESSAGE class RegistrationTest(TestBaseCase): """ User signup test cases """ ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,743
Allan690/social-app
refs/heads/master
/social/posts/serializers.py
from rest_framework import serializers from social.authentication.serializers import UserSearchSerializer from social.posts.models import Post class PostCreationSerializer(serializers.ModelSerializer): """ post creation serializer""" creator = serializers.CharField(read_only=True) body = serializers.CharF...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,744
Allan690/social-app
refs/heads/master
/social/like_dislike/views.py
import json from django.contrib.contenttypes.models import ContentType from rest_framework import generics, status from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from ..helpers.renderers import RequestJSONRenderer from ..like_dislike.models import LikeDislike cla...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,745
Allan690/social-app
refs/heads/master
/social/posts/tests/test_like_post.py
from unittest.mock import patch, Mock from rest_framework.reverse import reverse from .base_test import TestBaseCase from ...authentication.tests.test_retrieve_user import MockThread class PostLikeDislike(TestBaseCase): @patch('social.authentication.views.UpdateUserThread', Mock( return_value=MockThread...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,746
Allan690/social-app
refs/heads/master
/social/posts/tests/test_create_post.py
from unittest.mock import patch, Mock from rest_framework.views import status from social.helpers.constants import POST_CREATION_SUCCESS_MESSAGE from .base_test import TestBaseCase from ...authentication.tests.test_retrieve_user import MockThread class CreatePostTest(TestBaseCase): @patch('social.authentication...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,747
Allan690/social-app
refs/heads/master
/social/authentication/tests/base_test.py
import uuid from rest_framework.test import APITestCase, APITransactionTestCase from rest_framework.reverse import reverse as api_reverse from social.authentication.models import User class TestBaseCase(APITransactionTestCase): def setUp(self): """ Method for setting up user """ s...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,748
Allan690/social-app
refs/heads/master
/social/posts/models.py
from django.contrib.contenttypes.fields import GenericRelation from django.db import models from ..authentication.models import User from ..like_dislike.models import LikeDislike from ..models import BaseModel class Post(BaseModel): """ the posts model""" body = models.CharField(max_length=300) votes = G...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,749
Allan690/social-app
refs/heads/master
/social/helpers/update_user.py
from django.shortcuts import get_object_or_404 from django.db import connection from ..authentication.models import User from ..helpers.geolocation_helper import GeolocationCountriesHelper import threading class UpdateUserThread(threading.Thread): def __init__(self, email, **kwargs): self.user = email ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,750
Allan690/social-app
refs/heads/master
/social/helpers/constants.py
SIGNUP_SUCCESS_MESSAGE = "Congratulations! You registered successfully" POST_CREATION_SUCCESS_MESSAGE = "Your post has been created successfully" GEO_URL = "https://ipgeolocation.abstractapi.com/v1" HOLIDAY_URL = "https://holidays.abstractapi.com/v1"
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,751
Allan690/social-app
refs/heads/master
/social/models.py
import uuid from django.db import models class BaseModel(models.Model): """ The common field in all the models are defined here """ # Add id to every entry in the database id = models.UUIDField( db_index=True, primary_key=True, default=uuid.uuid4, editable=False ...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,752
Allan690/social-app
refs/heads/master
/social/like_dislike/models.py
from django.contrib.contenttypes.models import ContentType from django.db import models from django.contrib.contenttypes.fields import GenericForeignKey from social.authentication.models import User class LikeDislikeManager(models.Manager): use_for_related_fields = True def likes(self): # We take th...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,753
Allan690/social-app
refs/heads/master
/social/posts/tests/test_retrieve_post.py
from unittest.mock import patch, Mock from rest_framework.views import status from .base_test import TestBaseCase from ...authentication.tests.test_retrieve_user import MockThread class PostRetrieveTest(TestBaseCase): @patch('social.authentication.views.UpdateUserThread', Mock( return_value=MockThread()...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,754
Allan690/social-app
refs/heads/master
/social/helpers/geolocation_helper.py
from datetime import datetime import os import requests from tenacity import retry, wait_exponential from .constants import GEO_URL, HOLIDAY_URL class GeolocationCountriesHelper: """ universal geolocation helper """ def __init__(self): self.country_code = None @retry(wait=wait_exponentia...
{"/social/authentication/tests/test_retrieve_user.py": ["/social/authentication/tests/base_test.py"], "/social/posts/tests/test_update_post.py": ["/social/posts/tests/base_test.py", "/social/authentication/tests/test_retrieve_user.py"], "/social/posts/validators/validate_post.py": ["/social/posts/models.py", "/social/h...
92,755
buzmakov/tomo_report
refs/heads/master
/utils.py
#encoding: utf-8 import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import numpy as np import pylab as plt import errno import sys import os import subprocess import yaml import hashlib from werkzeug.utils import secure_filename sys.path.insert(0, os.path.join('..', 'fastlib'...
{"/tomo_report.py": ["/utils.py"]}
92,756
buzmakov/tomo_report
refs/heads/master
/tomo_report.py
# -*- coding: utf-8 -*- from flask import Flask, render_template, jsonify, request, g import flask_sijax import os import sys path = os.path.join('.', os.path.dirname(__file__), '../') sys.path.append(path) import utils app = Flask(__name__) # The path where you want the extension to create the needed javascript fi...
{"/tomo_report.py": ["/utils.py"]}
92,757
mstrassassin1st/TREYESpassing
refs/heads/master
/django-pwademo/TREYESpassing/demoapp/videomain.py
import os import sys import cv2 import numpy as np import string import random from .HumanDetector import HumanDetector def process(): base_dir = os.path.dirname(__file__) hd = HumanDetector(os.path.join(base_dir +'/models/best.h5'), "GSOC") detected = hd.detect(os.path.join(base_dir + '/static/video/' + '...
{"/django-pwademo/TREYESpassing/demoapp/videomain.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector.py"], "/django-pwademo/TREYESpassing/demoapp/views.py": ["/django-pwademo/TREYESpassing/demoapp/models.py"], "/django-pwademo/TREYESpassing/demoapp/demo.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector...
92,758
mstrassassin1st/TREYESpassing
refs/heads/master
/django-pwademo/TREYESpassing/demoapp/urls.py
from django.conf.urls import url, include from django.urls import path from django.views.generic import ListView, DetailView from . import views urlpatterns = [ path('processVideo/', views.processVideo, name="api-key"), path('notif/', views.get_notif, name="get-notif") ]
{"/django-pwademo/TREYESpassing/demoapp/videomain.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector.py"], "/django-pwademo/TREYESpassing/demoapp/views.py": ["/django-pwademo/TREYESpassing/demoapp/models.py"], "/django-pwademo/TREYESpassing/demoapp/demo.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector...
92,759
mstrassassin1st/TREYESpassing
refs/heads/master
/django-pwademo/TREYESpassing/demoapp/views.py
from django.shortcuts import render from django.http import HttpResponse, JsonResponse from . import videomain as videoProcesser from .models import Notification def processVideo(request): if request.method == "GET": detected = videoProcesser.process() if detected: response = JsonResponse({"dete...
{"/django-pwademo/TREYESpassing/demoapp/videomain.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector.py"], "/django-pwademo/TREYESpassing/demoapp/views.py": ["/django-pwademo/TREYESpassing/demoapp/models.py"], "/django-pwademo/TREYESpassing/demoapp/demo.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector...
92,760
mstrassassin1st/TREYESpassing
refs/heads/master
/django-pwademo/TREYESpassing/demoapp/demo.py
from .HumanDetector import HumanDetector import cv2 detector = HumanDetector('./models/best.h5', "CNT") detected, detected_imgs = detector.detect("group_walking.mp4", return_image=True) if detected: cv2.imshow("Detected {} frames".format(len(detected_imgs)), detected_img...
{"/django-pwademo/TREYESpassing/demoapp/videomain.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector.py"], "/django-pwademo/TREYESpassing/demoapp/views.py": ["/django-pwademo/TREYESpassing/demoapp/models.py"], "/django-pwademo/TREYESpassing/demoapp/demo.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector...
92,761
mstrassassin1st/TREYESpassing
refs/heads/master
/django-pwademo/TREYESpassing/demoapp/models.py
from django.db import models class Notification(models.Model): notifheader = models.CharField(max_length=100) date = models.DateTimeField() image = models.TextField() def __str__(self): return self.notifheader + '#' + str(self.date) + '#' + str(self.image)
{"/django-pwademo/TREYESpassing/demoapp/videomain.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector.py"], "/django-pwademo/TREYESpassing/demoapp/views.py": ["/django-pwademo/TREYESpassing/demoapp/models.py"], "/django-pwademo/TREYESpassing/demoapp/demo.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector...
92,762
mstrassassin1st/TREYESpassing
refs/heads/master
/django-pwademo/TREYESpassing/demoapp/HumanDetector.py
import os import cv2 as cv import tensorflow as tf from tensorflow import keras import numpy as np from .models import Notification from datetime import datetime import time class InvalidBackSubAlgo(Exception): def __init__(self): super().__init__(self,"Invalid Algorithm for background subtraction") clas...
{"/django-pwademo/TREYESpassing/demoapp/videomain.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector.py"], "/django-pwademo/TREYESpassing/demoapp/views.py": ["/django-pwademo/TREYESpassing/demoapp/models.py"], "/django-pwademo/TREYESpassing/demoapp/demo.py": ["/django-pwademo/TREYESpassing/demoapp/HumanDetector...
92,767
jmmontem/community_posts
refs/heads/master
/server.py
from server_database import Database_Manager, EventAlreadyExist, EventDoesNotExist import socket import select import json # server location SERVER_IP = socket.gethostbyname(socket.gethostname()) PUBLIC_IP = '71.204.145.90' SERVER_PORT = 8000 db = Database_Manager() def run_server(): global socket # cre...
{"/server.py": ["/server_database.py"]}
92,768
jmmontem/community_posts
refs/heads/master
/Client.py
from datetime import datetime import socket import select import json server_ip = socket.gethostbyname(socket.gethostname()) public_ip = '71.204.145.90' port = 8000 ''' Client will be in 1 of 3 modes - zipcode mode: will enter zipcode location - event mode: can request existing events, create new event, ente...
{"/server.py": ["/server_database.py"]}
92,769
jmmontem/community_posts
refs/heads/master
/server_database.py
from pathlib import Path import json class EventAlreadyExist(Exception): pass class EventDoesNotExist(Exception): pass class Database_Manager: # Code for requesting data def request_events(self, zip_code: str) -> [str]: ''' Return list of events associated with specified zipcode ''' ...
{"/server.py": ["/server_database.py"]}
92,961
Irlyue/ProbML
refs/heads/master
/demos/knn_mnist.py
import utils from probml import datasets from probml.supervised import KNN def main(): (X_train, y_train), (X_test, y_test) = datasets.load_mnist(flatten=True, nb_train=10000, nb_test=100...
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,962
Irlyue/ProbML
refs/heads/master
/probml/supervised/knn.py
import numpy as np from .base import SupervisedBaseModel from scipy import stats class KNN(SupervisedBaseModel): def __init__(self, k, n_classes=None): """ :param k: int, :param n_classes: int, default to None. If None, `n_classes` will be inferred from the training label `y`. ...
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,963
Irlyue/ProbML
refs/heads/master
/probml/supervised/__init__.py
from .knn import KNN from .naive_bayes import NaiveBayes
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,964
Irlyue/ProbML
refs/heads/master
/utils/__init__.py
from .os_utils import * from .other_utils import * from .np_utils import *
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,965
Irlyue/ProbML
refs/heads/master
/probml/datasets/__init__.py
from .mnist import load_mnist
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,966
Irlyue/ProbML
refs/heads/master
/utils/np_utils.py
import numpy as np def softmax(x): """ :param x: np.array, shape(m, n) :return: np.array, shape(m, n) """ x = x - x.max(axis=1, keepdims=True) expX = np.exp(x) probs = expX / expX.sum(axis=1, keepdims=True) return probs
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,967
Irlyue/ProbML
refs/heads/master
/utils/os_utils.py
import os from time import time class Timer: def __enter__(self): self._tic = time() return self def __exit__(self, *args): self.elapsed = time() - self._tic def path_exists(path): return os.path.exists(path) def create_if_not_exists(path): if not path_exists(path): ...
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,968
Irlyue/ProbML
refs/heads/master
/probml/datasets/mnist.py
import numpy as np def load_mnist(flatten=False, nb_train=None, nb_test=None): """ :param nb_train: int, default to None. If given, only that number of images are loaded for training. :param nb_test: int, :param flatten: bool, whether to flatten the image to 1d vector. :return: (X_train, y_tra...
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,969
Irlyue/ProbML
refs/heads/master
/probml/supervised/base.py
import numpy as np from abc import ABC class SupervisedBaseModel: def __repr__(self): return '{}()'.format(type(self).__name__) def fit(self, X, y): self.X, self.y = X, y def predict(self, X): raise NotImplementedError class ClassificationBaseModel(SupervisedBaseModel, ABC): ...
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,970
Irlyue/ProbML
refs/heads/master
/utils/other_utils.py
def common_repr(obj, keys, **extras): properties = ',\n'.join(' {}={}'.format(key, getattr(obj, key)) for key in keys) extras = ',\n'.join(' {}={}'.format(k, v) for k, v in extras.items()) return '{}(\n{},\n{})'.format(type(obj).__name__, properties, extras)
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
92,971
Irlyue/ProbML
refs/heads/master
/probml/supervised/naive_bayes.py
import utils import numpy as np from .base import ClassificationBaseModel class NaiveBayes(ClassificationBaseModel): def __init__(self, pseudo_counts=1): """ :param pseudo_counts: int, 0 for MLE and 1 for MAP """ super().__init__() self.pseudo_counts = pseudo_c...
{"/demos/knn_mnist.py": ["/utils/__init__.py", "/probml/supervised/__init__.py"], "/probml/supervised/knn.py": ["/probml/supervised/base.py"], "/probml/supervised/__init__.py": ["/probml/supervised/knn.py", "/probml/supervised/naive_bayes.py"], "/utils/__init__.py": ["/utils/os_utils.py", "/utils/other_utils.py", "/uti...
93,010
GabrielNicolasC/boxingSimulation
refs/heads/main
/bout.py
from boxer import Boxer from math import sqrt, atan2,pi, degrees import numpy as np class Bout: def __init__(self, boxer1, boxer2): self.boxer1 = boxer1 self.boxer2 = boxer2 def xDistanceBetweenFighters(self, xLocationBoxer1, xLocationBoxer2): return(abs(xLocationBoxer1 - xLo...
{"/bout.py": ["/boxer.py"], "/exchange.py": ["/bout.py"], "/main.py": ["/boxer.py", "/bout.py", "/exchange.py", "/decision.py"], "/decision.py": ["/exchange.py", "/boxer.py"]}
93,011
GabrielNicolasC/boxingSimulation
refs/heads/main
/exchange.py
from bout import Bout class Exchange: def __init__(self,thrower, receiver, pythagDistance, punchType): self.thrower = thrower self.receiver = receiver self.pythagDistance = pythagDistance self.punchType = punchType def strikeThrown(self,thrower, receiver, pythagDistanc...
{"/bout.py": ["/boxer.py"], "/exchange.py": ["/bout.py"], "/main.py": ["/boxer.py", "/bout.py", "/exchange.py", "/decision.py"], "/decision.py": ["/exchange.py", "/boxer.py"]}
93,012
GabrielNicolasC/boxingSimulation
refs/heads/main
/boxer.py
class Boxer: def __init__(self, name, stance, reach, chin, xLocation, yLocation, directionFacingInDegrees): self.name = name self.stance = stance self.reach = reach self.chin = chin self.xLocation = xLocation self.yLocation = yLocation self.direction...
{"/bout.py": ["/boxer.py"], "/exchange.py": ["/bout.py"], "/main.py": ["/boxer.py", "/bout.py", "/exchange.py", "/decision.py"], "/decision.py": ["/exchange.py", "/boxer.py"]}
93,013
GabrielNicolasC/boxingSimulation
refs/heads/main
/main.py
from boxer import Boxer from bout import Bout import numpy as np from exchange import Exchange from decision import Decision class Main(): boxer1 = Boxer("Gabe", "southpaw", 1.7, 10, 3,3,135) boxer2 = Boxer("Jerry", "orthodox", 1.6, 7, 7,7,315) boxer3 = Boxer("Tom", "orthodox", 1.65, 3, 7,7,315)...
{"/bout.py": ["/boxer.py"], "/exchange.py": ["/bout.py"], "/main.py": ["/boxer.py", "/bout.py", "/exchange.py", "/decision.py"], "/decision.py": ["/exchange.py", "/boxer.py"]}
93,014
GabrielNicolasC/boxingSimulation
refs/heads/main
/decision.py
from exchange import Exchange from boxer import Boxer import inquirer class Decision: def askContinueQuestion(): continueQuestion = [ inquirer.List('continueQuestion', message="Do you wish to continue? ", choices=['Yes', 'No'], ...
{"/bout.py": ["/boxer.py"], "/exchange.py": ["/bout.py"], "/main.py": ["/boxer.py", "/bout.py", "/exchange.py", "/decision.py"], "/decision.py": ["/exchange.py", "/boxer.py"]}
93,015
MaliYudina/AdPY
refs/heads/master
/HW5/original.py
import email import smtplib import imaplib from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart SMTPS_PORT = 587 LAST_ELEMENT = -1 class EmailManager: def __init__(self, smtp_host, imap_host, login, password): self.smtp_host = smtp_host self.imap_host = imap_host ...
{"/HW5/main.py": ["/HW5/original.py"], "/HW2/hash_coding.py": ["/HW2/countries_parser.py"]}
93,016
MaliYudina/AdPY
refs/heads/master
/HW6/src/tests/tests.py
import unittest import HW6.src.helpers.config as config import sys from HW6.src.helpers.config import APP_NAME test_config = config.Config() class TestApp(unittest.TestCase): def setUp(self): """Hook method for setting up the test fixture before exercising it.""" self.test_config = config.Config...
{"/HW5/main.py": ["/HW5/original.py"], "/HW2/hash_coding.py": ["/HW2/countries_parser.py"]}