index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
2,691 | seosaju/SoupKitchen | refs/heads/master | /booth/views.py | from django.http import HttpResponse
from django.shortcuts import render
from load_csv import load
from secret import MAP_KEY
from .models import Booth, Company
'''
def make_booth(request):
booth_list = load('./data.csv')
for booth in booth_list:
name = booth[3]
try:
company = Compa... | {"/booth/admin.py": ["/booth/models.py"], "/booth/views.py": ["/load_csv.py", "/booth/models.py"]} |
2,692 | seosaju/SoupKitchen | refs/heads/master | /booth/urls.py | from django.urls import path
from . import views
app_name = 'booth'
urlpatterns = [
# path('make_booth/', views.make_booth, name='make_booth'), csv νμΌ DBμ λ±λ‘ν λλ§ μ¬μ©νλ URL.
path('', views.maps, name='index'),
]
| {"/booth/admin.py": ["/booth/models.py"], "/booth/views.py": ["/load_csv.py", "/booth/models.py"]} |
2,693 | seosaju/SoupKitchen | refs/heads/master | /booth/models.py | from django.db import models
class Company(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Booth(models.Model):
name = models.CharField(max_length=50) # μμ€λͺ
road_address = models.CharField(max_length=100) # μμ¬μ§λλ‘λͺ
μ£Όμ
land_address = model... | {"/booth/admin.py": ["/booth/models.py"], "/booth/views.py": ["/load_csv.py", "/booth/models.py"]} |
2,701 | rossmounce/OpenArticleGauge | refs/heads/master | /openarticlegauge/recordmanager.py | from openarticlegauge import config
from datetime import datetime
def record_provider_url(record, url):
if not "provider" in record:
record['provider'] = {}
if not "url" in record["provider"]:
record["provider"]["url"] = []
if url not in record['provider']['url']:
record['provider']... | {"/openarticlegauge/workflow.py": ["/openarticlegauge/slavedriver.py"]} |
2,702 | rossmounce/OpenArticleGauge | refs/heads/master | /openarticlegauge/cache.py | import redis, json, datetime, logging
import config
log = logging.getLogger(__name__)
def check_cache(key):
"""
check the cache for an object stored under the given key, and convert it
from a string into a python object
"""
client = redis.StrictRedis(host=config.REDIS_CACHE_HOST, port=config.REDIS... | {"/openarticlegauge/workflow.py": ["/openarticlegauge/slavedriver.py"]} |
2,703 | rossmounce/OpenArticleGauge | refs/heads/master | /openarticlegauge/plugloader.py | import config
import logging
log = logging.getLogger(__name__)
"""
NOTE: these might be useful to someone in the future, but we don't need them
right now, so leaving them commented out
def get_info(callable_path):
if callable_path is None:
log.debug("attempted to load plugin with no plugin path")
... | {"/openarticlegauge/workflow.py": ["/openarticlegauge/slavedriver.py"]} |
2,704 | rossmounce/OpenArticleGauge | refs/heads/master | /openarticlegauge/plugin.py | from openarticlegauge import config, plugloader, recordmanager
from openarticlegauge.licenses import LICENSES
from openarticlegauge import oa_policy
import logging, requests
from copy import deepcopy
from datetime import datetime
log = logging.getLogger(__name__)
class Plugin(object):
## Capabilities that mu... | {"/openarticlegauge/workflow.py": ["/openarticlegauge/slavedriver.py"]} |
2,705 | rossmounce/OpenArticleGauge | refs/heads/master | /openarticlegauge/workflow.py | from celery import chain
from openarticlegauge import models, model_exceptions, config, cache, plugin, recordmanager
import logging
from openarticlegauge.slavedriver import celery
logging.basicConfig(filename='oag.log',level=logging.DEBUG)
log = logging.getLogger(__name__)
def lookup(bibjson_ids):
"""
Take a ... | {"/openarticlegauge/workflow.py": ["/openarticlegauge/slavedriver.py"]} |
2,706 | rossmounce/OpenArticleGauge | refs/heads/master | /openarticlegauge/slavedriver.py | from __future__ import absolute_import
from celery import Celery
celery = Celery()
from openarticlegauge import celeryconfig
celery.config_from_object(celeryconfig)
# Optional configuration, see the application user guide.
celery.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
)
if __name__ == '__main__':
c... | {"/openarticlegauge/workflow.py": ["/openarticlegauge/slavedriver.py"]} |
2,707 | marvin939/ZombiePygame | refs/heads/master | /tests/test_utilities.py | import math
import unittest
import utilities
class UtilitiesTestCase(unittest.TestCase):
def test_unit_circle_angle(self):
angles = list(range(-20, 20))
hypotenuse = 5
assumed_angles = {}
for angle in angles:
opposite = hypotenuse * math.sin(angle)
assumed_a... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,708 | marvin939/ZombiePygame | refs/heads/master | /tests/test_weapon.py | import unittest
import utilities
from weapon import *
from game import *
class WeaponSimplifiedTestCase(unittest.TestCase):
def setUp(self):
self.fire_rate = 3 # bullets per second
self.world = World()
self.owner_location = Vector2(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2)
self.owner =... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,709 | marvin939/ZombiePygame | refs/heads/master | /run.py | import pygame
from pygame.locals import *
from game import *
import sys
import mobs
from manager import ImageManager
from random import randint
image_dude = None
TITLE = 'Zombie Defence v0.0.0'
def main():
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption(TITLE)
c... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,710 | marvin939/ZombiePygame | refs/heads/master | /demo/demo_turret_rotate.py | from encodings.punycode import selective_find
import pygame
from manager import ImageManager
from game import *
from pygame.locals import *
from pygame.math import Vector2
from mobs import *
image_manager = None
def main():
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
clock = pygame.time.C... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,711 | marvin939/ZombiePygame | refs/heads/master | /utilities.py | import math
'''
def unit_angle(angle):
"""Convert radians to unit circle radians' range of 0 to 6.28"""
one_rev = math.pi * 2
if angle > 0:
return divmod(angle, math.pi * 2)[1]
if angle < 0:
angle = divmod(angle, one_rev)[1]
if angle < 0:
return angle + one_rev
r... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,712 | marvin939/ZombiePygame | refs/heads/master | /demo/demo_projectile.py | import sys
import pygame
from pygame.math import Vector2
from game import *
from pygame.locals import *
from weapon import Projectile
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption('Projectile object demonstration')
clock = pygame.time.Clock()
world = World()
CENTER_VEC = Vector... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,713 | marvin939/ZombiePygame | refs/heads/master | /mobs.py | from random import randint
from entity import *
from game import *
from pygame.math import Vector2
import math
import utilities
from effects import *
from weapon import WeaponSimplified
class Zombie(SentientEntity):
"""A Zombie wandering aimlessly"""
NAME = 'zombie'
def __init__(self, world, image, locat... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,714 | marvin939/ZombiePygame | refs/heads/master | /game.py | import copy
import math
import pygame
from pygame.math import Vector2
FPS = 60
SCREEN_WIDTH, SCREEN_HEIGHT = SCREEN_SIZE = (640, 480)
SCREEN_CENTER = (SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2)
TICK_SECOND = 1000 / FPS / 1000
# Colors
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255,... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,715 | marvin939/ZombiePygame | refs/heads/master | /effects.py | """This is where effects go. eg. Explosions, bullet effects, etc. that disappear in time"""
from entity import GameEntity
from game import *
import math
class BulletTravelEffect(GameEntity):
def __init__(self, world, origin, destination, color=YELLOW, speed=1000, length=50, duration=math.inf):
super()._... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,716 | marvin939/ZombiePygame | refs/heads/master | /tests/test_mobs.py | import unittest
from manager import ImageManager
import time
from mobs import *
from game import *
from pygame.math import Vector2
class SentryGunTestCase(unittest.TestCase):
def setUp(self):
pygame.init()
self.screen = pygame.display.set_mode(SCREEN_SIZE)
self.image_manager = ImageManage... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,717 | marvin939/ZombiePygame | refs/heads/master | /tests/test_entity.py | import unittest
from pygame.math import Vector2
from game import *
from entity import *
class GameEntityTestCase(unittest.TestCase):
def setUp(self):
self.world = World()
self.ENTITY_WIDTH, self.ENTITY_HEIGHT = self.ENTITY_SIZE = (32, 32)
self.entity_image = pygame.Surface(self.ENTITY_SIZE... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,718 | marvin939/ZombiePygame | refs/heads/master | /entity.py | from pygame.math import Vector2
import math
import pygame
import utilities
#from mobs import *
class GameEntity:
"""GameEntity that has states"""
def __init__(self, world, name, image, location=None, destination=None, speed=0):
self.world = world
self.name = name
self.image = image
... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,719 | marvin939/ZombiePygame | refs/heads/master | /demo/demo_rotate_towards_mouse.py | import pygame
from manager import ImageManager
from game import *
from pygame.locals import *
from pygame.math import Vector2
def main():
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
clock = pygame.time.Clock()
image_manager = ImageManager('../data/images')
sprite_image = image_mana... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,720 | marvin939/ZombiePygame | refs/heads/master | /manager.py | import os
import pygame
from errors import *
class ImageManager:
"""The thing that manages images"""
def __init__(self, dir='.'):
self.image_directory = os.path.abspath(dir)
self.surf_dict = {}
if pygame.display.get_surface() is None:
raise ScreenNotInitialized('ImageMan... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,721 | marvin939/ZombiePygame | refs/heads/master | /weapon.py | from random import *
from entity import *
from game import *
'''
self.pistol = Weapon(self.weap_damage, \
self.weap_clip, \
self.weap_reload_rate, \
self.weap_fire_rate, \
self.weap_spread, \
self.weap_rounds_per_s... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,722 | marvin939/ZombiePygame | refs/heads/master | /demo/demo_weapon.py | import sys
import pygame
from pygame.math import Vector2
from game import *
from pygame.locals import *
from weapon import Projectile, WeaponSimplified
from entity import GameEntity
import utilities
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption('Projectile object demonstration'... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,723 | marvin939/ZombiePygame | refs/heads/master | /demo/demo_effects.py | import time
import sys
import pygame
from game import *
from effects import *
from pygame.locals import *
from manager import ImageManager
GREEN = (0, 255, 0)
FPS = 30
"""
bullet_travel = BulletTravelEffect(world, Vector2(0, 0), Vector2(320, 240))
world.add_entity(bullet_travel)
"""
image_dude = None
def main():
... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,724 | marvin939/ZombiePygame | refs/heads/master | /tests/test_projectile.py | from weapon import Weapon, Projectile, Warhead
from unittest import TestCase
from game import *
import utilities
class DestinationProjectileTestCase(TestCase):
def setUp(self):
self.warhead = None
self.speed = 100
self.world = World()
self.location = Vector2(SCREEN_WIDTH / 2, SCRE... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,725 | marvin939/ZombiePygame | refs/heads/master | /tests/test_world.py | from mobs import *
from random import randint, random
import unittest
from game import *
import pygame
NUM_ZOMBIES = 10
NUM_SURVIVORS = 5
NUM_SENTRY_GUNS = 2
class WorldTestCase(unittest.TestCase):
def setUp(self):
self.world = World()
dummy_surface = pygame.Surface((16, 16))
w, h = dummy... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,726 | marvin939/ZombiePygame | refs/heads/master | /tests/test_image_manager.py | import unittest
from manager import ImageManager
import pygame
import os
from errors import *
class ImageManagerTestCaseA(unittest.TestCase):
def test_try_making_imagemanager(self):
"""ImageManager should raise an error if the screen surface has not been initialised yet"""
with self.assertRaises(... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,727 | marvin939/ZombiePygame | refs/heads/master | /demo/demo_image_manager.py | from manager import ImageManager
import sys
import os
import pygame
import time
# Add 1-dir-up to path (contains manager.py, and errors.py)
# sys.path += [os.path.join(os.getcwd(), '..')]
'''No need to do; just change the working directory of the file @ Run->Edit Configurations...
Don't forget to change relative paths... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,728 | marvin939/ZombiePygame | refs/heads/master | /tests/test_warhead.py | from weapon import Weapon, Projectile, Warhead
import unittest
from game import *
class WarheadTestCase(unittest.TestCase):
"""Warheads should be reusable for different projectiles of same type"""
def setUp(self):
"""
self.warhead = None
self.speed = 100
self.world = World()
... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,729 | marvin939/ZombiePygame | refs/heads/master | /tests/test_effects.py | import copy
from effects import BulletTravelEffect, ExplosionEffect
from game import World
import unittest
from pygame.math import Vector2
from game import *
TICK_SECOND = 1000 / 30 / 1000 # One tick represented by 30 frames per second; 33 milliseconds
class BulletTravelEffectTestCase(unittest.TestCase):
def se... | {"/tests/test_utilities.py": ["/utilities.py"], "/tests/test_weapon.py": ["/utilities.py", "/weapon.py", "/game.py"], "/run.py": ["/game.py", "/mobs.py", "/manager.py"], "/demo/demo_turret_rotate.py": ["/manager.py", "/game.py", "/mobs.py"], "/demo/demo_projectile.py": ["/game.py", "/weapon.py"], "/mobs.py": ["/entity.... |
2,732 | AklerQ/python_training | refs/heads/master | /data/contact_data.py | from model.contact import Contact
import random
import string
def random_string(prefix, maxlen):
symbols = string.ascii_letters + string.digits + " "*10
return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])
def random_number(maxlen):
symbols = string.digits + ")" + "... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,733 | AklerQ/python_training | refs/heads/master | /test/test_del_contact_from_group.py | # -*- coding: utf-8 -*-
from model.group import Group
from model.contact import Contact
from fixture.orm import ORMfixture
import random
db = ORMfixture(host="127.0.0.1", name="addressbook", user="root", password="")
def test_del_contact_from_group(app):
# ΠΡΠΎΠ²Π΅ΡΠΊΠ° Π½Π° Π½Π°Π»ΠΈΡΠΈΠ΅ Π³ΡΡΠΏΠΏ
if len(db.get_group_list()... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,734 | AklerQ/python_training | refs/heads/master | /test/test_edit_contact.py | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
def test_edit_contact_by_index(app, db, check_ui):
if app.contact.count_contacts() == 0:
app.contact.create(Contact(firstname="For modify", birth_date="//div[@id='content']/form/select[1]//option[1]",
birth_... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,735 | AklerQ/python_training | refs/heads/master | /fixture/group.py | # -*- coding: utf-8 -*-
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def create(self, group):
wd = self.app.wd
self.app.navigation.open_groups_page()
# init group creation
wd.find_element_by_name("new").click()
# fil... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,736 | AklerQ/python_training | refs/heads/master | /test/test_edit_group.py | # -*- coding: utf-8 -*-
from model.group import Group
import random
def test_edit_first_group_footer(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="For modification", header="For modification", footer="For modification"))
old_groups = db.get_group_list()
group =... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,737 | AklerQ/python_training | refs/heads/master | /fixture/contact.py | # -*- coding: utf-8 -*-
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
self.app.navigation.turn_to_home_page()
# create new contact
wd.find_element_by_link_text("add n... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,738 | AklerQ/python_training | refs/heads/master | /test/test_contact_data_validation.py | import re
from random import randrange
from model.contact import Contact
def test_random_contact_data_on_home_page(app):
contacts = app.contact.get_contact_list()
index = randrange(len(contacts))
contact_from_home_page = app.contact.get_contact_list()[index]
contact_from_edit_page = app.contact.get_co... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,739 | AklerQ/python_training | refs/heads/master | /test/test_del_contact.py | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
def test_delete_first_contact(app, db, check_ui):
if app.contact.count_contacts() == 0:
app.contact.create(Contact(firstname="Π’Π΅ΡΡ_ΠΈΠΌΠ΅Π½ΠΈ", lastname="Π’Π΅ΡΡ_ΡΠ°ΠΌΠΈΠ»ΠΈΠΈ",
birth_date="//div[@id='content']/form/selec... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,740 | AklerQ/python_training | refs/heads/master | /model/contact.py | from sys import maxsize
class Contact:
def __init__(self, firstname=None, middlename=None, lastname=None, nickname=None, companyname=None, address=None,
homenumber=None, worknumber=None, mobilenumber=None, faxnumber=None, email=None, email2=None,
birth_date=None, birth_month=Non... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,741 | AklerQ/python_training | refs/heads/master | /test/test_db_matches_ui.py | from model.group import Group
def test_group_list(app, db):
ui_list = app.group.get_group_list()
db_list = map(app.group.clean, db.get_group_list())
assert sorted(ui_list, key=Group.id_or_max) == sorted(db_list, key=Group.id_or_max)
| {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,742 | AklerQ/python_training | refs/heads/master | /test/test_add_contact_to_group.py | # -*- coding: utf-8 -*-
from model.group import Group
from model.contact import Contact
from fixture.orm import ORMfixture
import random
orm = ORMfixture(host="127.0.0.1", name="addressbook", user="root", password="root")
def test_add_contact_to_group(app, db):
# ΠΡΠΎΠ²Π΅ΡΠΊΠ° Π½Π° Π½Π°Π»ΠΈΡΠΈΠ΅ Π³ΡΡΠΏΠΏ
if len(db.get_group... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,743 | AklerQ/python_training | refs/heads/master | /generator/contact_gen.py | from model.contact import Contact
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/contacts.json"
for ... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,744 | AklerQ/python_training | refs/heads/master | /fixture/navigation.py | # -*- coding: utf-8 -*-
class NavigationHelper:
def __init__(self, app):
self.app = app
def open_home_page(self):
wd = self.app.wd
if not ((len(wd.find_elements_by_link_text("Create account")) > 0)
and (len(wd.find_elements_by_link_text("Forgot password")) > 0)):
... | {"/data/contact_data.py": ["/model/contact.py"], "/test/test_del_contact_from_group.py": ["/model/contact.py"], "/test/test_edit_contact.py": ["/model/contact.py"], "/fixture/contact.py": ["/model/contact.py"], "/test/test_contact_data_validation.py": ["/model/contact.py"], "/test/test_del_contact.py": ["/model/contact... |
2,765 | peteramazonian/simulation_project | refs/heads/master | /movement.py | import time_management
from time_management import add_to_fel
from system_arrival import SystemArrival
ss_list = __import__('service_station').ServiceStation.list
class Movement():
list = []
@classmethod
def check(cls):
x = len(ss_list)
if len(cls.list) == x + 1:
return
... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,766 | peteramazonian/simulation_project | refs/heads/master | /logger_multi_run.py | import xlsxwriter
from datetime import datetime
class LoggerMR:
def __init__(self, ss_names, replications):
self.total_replications = replications
self.ss_names = ss_names # Setting list of service ServiceStations
time = datetime.now().strftime("%d-%m-%Y--%H-%M-%S")
self.wb = xlsx... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,767 | peteramazonian/simulation_project | refs/heads/master | /logger_single_run.py | import xlsxwriter
from datetime import datetime
class LoggerSR:
def __init__(self, s_list):
self.s_list = s_list # Setting list of service ServiceStations
self.system_arrival = __import__('system_arrival').SystemArrival # Importing SystemArrival class. It
# should be imported inside init... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,768 | peteramazonian/simulation_project | refs/heads/master | /number_generator.py | import random
from math import exp
class NumberGenerator:
class Discrete(random.Random):
def __init__(self, x: tuple, fx: tuple, **kwargs):
self.x = None
self.fx_list = fx
self.x_list = x
if len(self.x_list) != len(self.fx_list):
raise ValueE... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,769 | peteramazonian/simulation_project | refs/heads/master | /main_single_run.py | from service_station import ServiceStation
from system_arrival import SystemArrival
from movement import Movement
from time_generator import TimeGenerator
from number_generator import NumberGenerator
import time_management
from logger_single_run import LoggerSR
# Its our simulation's main file.
# Here we import class... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,770 | peteramazonian/simulation_project | refs/heads/master | /main_multi_run.py | import sys
import importlib
from service_station import ServiceStation
from system_arrival import SystemArrival
from movement import Movement
from time_generator import TimeGenerator
from number_generator import NumberGenerator
import time_management
from logger_multi_run import LoggerMR
replications = 100
result = [... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,771 | peteramazonian/simulation_project | refs/heads/master | /time_management.py | import bisect
# ----------------------------------------------------------------------------------------------------------------
# In this module we handle anything related to FEL and clock. in another word this module is the engine that makes
# the code to move.
# ----------------------------------------------------... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,772 | peteramazonian/simulation_project | refs/heads/master | /system_arrival.py | import time_management
from time_management import add_to_fel
__id__ = 10000
# TODO new arrivals in fel dont have id?!?
def id_generator():
global __id__
__id__ += 1
return __id__
class SystemArrival:
list = []
costumers_inside_dict = {}
costumers_departured = 0
costumers_total_time = ... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,773 | peteramazonian/simulation_project | refs/heads/master | /time_generator.py | """ Random time generators to be used for inter arrival time or activity time in simulation models.
"""
import random
from math import sqrt, log
class TimeGenerator:
class Uniform(random.Random):
def __init__(self, lower_limit=0, upper_limit=1, **kwargs):
self.x = None
self.lower_... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,774 | peteramazonian/simulation_project | refs/heads/master | /service_station.py | import time_management
from time_management import add_to_fel, postponed_rest_log_editor
# ----------------------------------------------------------------
# Creating class ServiceStation
# Our service stations are objects of this class
# Costumer arrivals, departures, servers leaving for rest and getting back to wor... | {"/movement.py": ["/time_management.py", "/system_arrival.py"], "/main_single_run.py": ["/service_station.py", "/system_arrival.py", "/movement.py", "/time_generator.py", "/number_generator.py", "/time_management.py", "/logger_single_run.py"], "/main_multi_run.py": ["/service_station.py", "/system_arrival.py", "/moveme... |
2,785 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/data_curated/annotate_proteins.py | """
Given a CSV where some column indicates peptides, add a column indicating which
protein(s) from some specified proteome contain that peptide.
"""
import argparse
import time
import sys
import tqdm
import pandas
import numpy
import shellinford
from mhc2flurry.fasta import read_fasta_to_dataframe
parser = argpars... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,786 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/data_curated/curate_ms_by_pmid.py | """
Filter and combine various peptide/MHC datasets to derive a composite training set,
optionally including eluted peptides identified by mass-spec.
The handle_pmid_XXXX functions should return a DataFrame with columns:
- peptide
- sample_id
- hla [space separated list of alleles]
- pulldown_antibody
- format [m... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,787 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/data_curated/curate_t_cell_epitopes.py | """
Curate IEDB T cell epitopes. Currently this doesn't do much except rename the
peptide column from "Description" to "peptide".
"""
import sys
import argparse
import pandas
from mhc2flurry.amino_acid import COMMON_AMINO_ACIDS
parser = argparse.ArgumentParser(usage=__doc__)
parser.add_argument(
"--data-iedb",
... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,788 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/data_pdb/make_pdb_query.py | # Just print a JSON PDB query to stdout
# Doing this in a python script so we have comments.
import json
sequences = []
# DRA1*01:01
sequences.append(
"MAISGVPVLGFFIIAVLMSAQESWAIKEEHVIIQAEFYLNPDQSGEFMFDFDGDEIFHVDMAKKETVWRLEEFGRF"
"ASFEAQGALANIAVDKANLEIMTKRSNYTPITNVPPEVTVLTNSPVELREPNVLICFIDKFTPPVVNVTWLRNGKP"
"V... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,789 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/data_proteomes/index_fasta.py | """
Write a shellinford index for a fasta.
"""
import argparse
import time
import sys
import shellinford
from mhc2flurry.fasta import read_fasta_to_dataframe
parser = argparse.ArgumentParser(usage=__doc__)
parser.add_argument(
"input",
metavar="FASTA",
help="Input file")
parser.add_argument(
"outpu... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,790 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/data_pdb/parse_results.py | # From a PDB results json, print out a comma separated list of PDB IDs
import argparse
import sys
import json
parser = argparse.ArgumentParser()
parser.add_argument("results", metavar="JSON")
parser.add_argument("out", metavar="FILE")
args = parser.parse_args(sys.argv[1:])
parsed = json.load(open(args.results))
prin... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,791 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/allele_sequences/make_pseudosequences.py | """
Select allele sequences for pan-class II models by analyzing distances between
each MHC residue and the peptide across a set of structures from PDB.
"""
from __future__ import print_function
import sys
import argparse
import collections
import os
import operator
import numpy
import pandas
import tqdm
import ato... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,792 | luoyuan3316/mhc2flurry | refs/heads/master | /mhc2flurry/downloads.py | """
Manage local downloaded data.
"""
from __future__ import (
print_function,
division,
absolute_import,
)
import logging
import yaml
from os.path import join, exists
from os import environ
from pipes import quote
from collections import OrderedDict
from appdirs import user_data_dir
from pkg_resources imp... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,793 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/allele_sequences/filter_sequences.py | """
Filter and combine class II sequence fastas.
"""
from __future__ import print_function
import sys
import argparse
from mhc2flurry.common import normalize_allele_name
import Bio.SeqIO # pylint: disable=import-error
parser = argparse.ArgumentParser(usage=__doc__)
parser.add_argument(
"fastas",
nargs="+... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,794 | luoyuan3316/mhc2flurry | refs/heads/master | /mhc2flurry/allele_encoding_pair.py | from .allele_encoding import AlleleEncoding
class AlleleEncodingPair(object):
def __init__(
self,
alpha_allele_encoding,
beta_allele_encoding):
"""
"""
self.alpha_allele_encoding = alpha_allele_encoding
self.beta_allele_encoding = beta_allele_en... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,795 | luoyuan3316/mhc2flurry | refs/heads/master | /test/test_common.py | from mhc2flurry.common import make_allele_pairs
def test_allele_pairs():
alleles = [
"HLA-DRB1*07:01",
"HLA-DRB1*16:01",
"HLA-DRB4*01:03",
"HLA-DRB5*02:02",
"HLA-DPA1*01:03",
"HLA-DPB1*02:01",
"HLA-DPB1*23:01",
"HLA-DQA1*01:02",
"HLA-DQA1*02:... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,796 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/allele_sequences/assign_pdb_sequences_to_alpha_or_beta.py | # Assign PDB sequences (searched by mmseqs against IMGT sequences)
# to alpha vs beta based on mmseqs results
import argparse
import sys
import pandas
import os
from mhc2flurry.fasta import read_fasta_to_dataframe
parser = argparse.ArgumentParser()
parser.add_argument(
"pdb_sequences",
metavar="FASTA",
h... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,797 | luoyuan3316/mhc2flurry | refs/heads/master | /test/test_class2_neural_network.py | import logging
logging.getLogger('tensorflow').disabled = True
logging.getLogger('matplotlib').disabled = True
import numpy
import tensorflow.random
numpy.random.seed(0)
tensorflow.random.set_seed(0)
import pandas
from sklearn.metrics import roc_auc_score
import mhcgnomes
from mhc2flurry.allele_encoding_pair import... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,798 | luoyuan3316/mhc2flurry | refs/heads/master | /downloads-generation/allele_sequences/extract_pdb_sequences.py | # Given a set of PDB .cif.gz files, write out a fasta with the sequences of
# each chain. This will be used to align MHC II PDB structures against
# sequences from IMDB and other sources.
import argparse
import sys
import json
import os
import glob
import atomium
parser = argparse.ArgumentParser()
parser.add_argumen... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,799 | luoyuan3316/mhc2flurry | refs/heads/master | /mhc2flurry/testing_utils.py | """
Utilities used in MHC2flurry unit tests.
"""
from .common import configure_tensorflow
def startup():
"""
Configure Keras backend for running unit tests.
"""
configure_tensorflow("tensorflow-cpu", num_threads=2)
def cleanup():
"""
Clear tensorflow session and other process-wide resources.... | {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,800 | luoyuan3316/mhc2flurry | refs/heads/master | /mhc2flurry/__init__.py | """
Class II MHC ligand prediction package
"""
#from .class2_affinity_predictor import Class2AffinityPredictor
#from .class2_neural_network import Class2NeuralNetwork
from .version import __version__
__all__ = [
"__version__",
# "Class2AffinityPredictor",
# "Class2NeuralNetwork",
]
| {"/test/test_class2_neural_network.py": ["/mhc2flurry/allele_encoding_pair.py", "/mhc2flurry/testing_utils.py"]} |
2,801 | shym98/Recognizer | refs/heads/master | /imageTools.py | from PIL import Image
import numpy as np
def getProcessedData(image, imageSize):
image = image.resize((imageSize, imageSize), resample=Image.ANTIALIAS)
imageData = np.asarray(image, dtype=np.uint8).reshape(imageSize, imageSize, 1)
imageData = imageData/255.
return imageData
def getImageData(filename,i... | {"/songConverting.py": ["/config.py"], "/main.py": ["/songConverting.py", "/networkModel.py"]} |
2,802 | shym98/Recognizer | refs/heads/master | /config.py | # Paths
path = '/home/maxim/PycharmProjects/Recognizer/Songs/'
spectPath = '/home/maxim/PycharmProjects/Recognizer/Spect/'
slicePath = '/home/maxim/PycharmProjects/Recognizer/Spect/Slices/'
#Model parameters
batchSize = 128
numberOfEpoch = 20
#Slice parameters
sliceSize = 128
#Dataset parameters
filesPerGenre = 4000... | {"/songConverting.py": ["/config.py"], "/main.py": ["/songConverting.py", "/networkModel.py"]} |
2,803 | shym98/Recognizer | refs/heads/master | /songConverting.py | from subprocess import Popen, PIPE, STDOUT
import os
from PIL import Image
from config import *
currentPath = os.path.dirname(os.path.realpath(__file__))
def createSpectrogram(filename, newFilename):
command = "sox '{}' '/tmp/{}.mp3' remix 1,2".format(path + filename + '.mp3', newFilename)
p = Popen(command, ... | {"/songConverting.py": ["/config.py"], "/main.py": ["/songConverting.py", "/networkModel.py"]} |
2,804 | shym98/Recognizer | refs/heads/master | /main.py | import string
import argparse
import random
from songConverting import *
from networkModel import *
from dataset import *
from tkinter.filedialog import *
from tkinter import messagebox
from shutil import copyfile, rmtree
def toFixed(numObj, digits=0):
return f"{numObj:.{digits}f}"
#List genres
genres = os.listd... | {"/songConverting.py": ["/config.py"], "/main.py": ["/songConverting.py", "/networkModel.py"]} |
2,805 | shym98/Recognizer | refs/heads/master | /networkModel.py | import tflearn
from tflearn import input_data, conv_2d, max_pool_2d, fully_connected, dropout, regression
def createModel(classesNumber, imageSize):
print("[+] Creating model ...")
network = input_data(shape=[None, imageSize, imageSize, 1], name='input')
network = conv_2d(network, 64, 2, activation='elu'... | {"/songConverting.py": ["/config.py"], "/main.py": ["/songConverting.py", "/networkModel.py"]} |
2,823 | shacharr/roomba_sim | refs/heads/master | /arena_model.py | import pygame
from helper_functions import *
class RoomModel(object):
DIRTY_COLOR = (0,255,0)
CLEAN_COLOR = (0,0,255)
DEAD_ZONE_COLOR = (0,0,0)
def __init__(self, polygon, obstacles=[]):
self.polygon = polygon
self.obstacles = obstacles
max_x = max([x[0] for x in polygon])
... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,824 | shacharr/roomba_sim | refs/heads/master | /roomba_model.py | import math
import random
from cleaning_robot_model import CleaningRobotModel
from helper_functions import *
class RoombaModel(CleaningRobotModel):
MODE_TIME_LIMIT = [500,2000]
TURN_SIZE_ON_WALL_FOLLOW = math.pi/180.
MAX_TURN_STEPS = 360
SPIRAL_ANGLE_INIT = math.pi/18.
SPIRAL_ANGLE_RATIO = 0.995... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,825 | shacharr/roomba_sim | refs/heads/master | /simulator.py | import time
import pygame
import math
import random
import itertools
import arena_model
import arena_view
import roomba_model
def run_simulation(robot_params={}, room_params={}, stop_conditions={}, visual_feedback=True, draw_final_result=True):
stats = []
room_polygon = room_params["ROOM_POLYGON"]
obste... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,826 | shacharr/roomba_sim | refs/heads/master | /cleaning_robot_model.py | import math
from helper_functions import *
class CleaningRobotModel(object):
TURN_STEP_FOR_DRAWING = math.pi/18.
def __init__(self, location, size, cleaning_head_size, direction, speed, room):
self.loc = location
self.direction = direction
self.speed = speed
self.size = size
... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,827 | shacharr/roomba_sim | refs/heads/master | /controller.py | import matplotlib.pyplot
from simulator import run_simulation
from helper_functions import *
#ROOM_POLYGON = [(0,0),(640,0),(640,480),(0,480)]
#ROOM_POLYGON = [(0,0),(640,0),(640,480),(320,480),(320,240),(0,240)]
ROOM_POLYGON = [(0,0),(640,0),(640,480),(320,480),(250,240),(0,240)]
SMALL_SQUARE = [(0,0),(10,0),(10,1... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,828 | shacharr/roomba_sim | refs/heads/master | /helper_functions.py | import math
class Point(object):
def __init__(self,coords):
self.x = coords[0]
self.y = coords[1]
def delta(self,other):
return Point([self.x-other.x,self.y-other.y])
def dot(self,other):
return self.x*other.x + self.y*other.y
def rotate(coords, direction):
# from htt... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,829 | shacharr/roomba_sim | refs/heads/master | /arena_view.py | import time
import pygame
import math
from helper_functions import *
class ScreenView(object):
WHITE = (255,255,255)
BLACK = ( 0, 0, 0)
BLUE = ( 0, 0,255)
GREEN = ( 0,255, 0)
RED = (255, 0, 0)
ARROW_RELATIVE_COORDS = ((0,0.8),(0.4,0.5),(0.2,0.5),(0.2,-0.6),
... | {"/arena_model.py": ["/helper_functions.py"], "/simulator.py": ["/arena_model.py", "/arena_view.py", "/roomba_model.py"], "/cleaning_robot_model.py": ["/helper_functions.py"], "/controller.py": ["/simulator.py", "/helper_functions.py"], "/arena_view.py": ["/helper_functions.py"]} |
2,844 | gambler1541/book-mark | refs/heads/master | /app/bookmark/urls.py | from django.urls import path
from .views import BookmarkListView, BookmarkCreateView, BookmarkDetail, BookmarkUpdate, BookmarkDeleteView
urlpatterns = [
path('', BookmarkListView.as_view(), name='list'),
path('add/', BookmarkCreateView.as_view(), name='add'),
path('detail/<int:pk>/', BookmarkDetail.as_vie... | {"/app/bookmark/urls.py": ["/app/bookmark/views.py"]} |
2,845 | gambler1541/book-mark | refs/heads/master | /app/bookmark/views.py | from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView
from .models import Bookmark
class BookmarkListView(ListView):
# htmlμμ objectλΌλ λ³μλͺ
μΌλ‘ μ¬μ©
model = Bookmark
# ν νμ΄μ§μ λμ¬ κ°μ
paginate_by = 6
... | {"/app/bookmark/urls.py": ["/app/bookmark/views.py"]} |
2,846 | welloderx/wechat-2021-BigDataChallenge | refs/heads/master | /src/deepctr_ext/utils.py | from collections import OrderedDict
from .feat import SparseFeat, DenseFeat, VarLenSparseFeat
import torch.nn as nn
import numpy as np
import torch
from .layers import SequencePoolingLayer
def get_feature_names(feature_columns):
features = build_input_features(feature_columns)
return list(features.keys())
de... | {"/src/deepctr_ext/utils.py": ["/src/deepctr_ext/feat.py", "/src/deepctr_ext/layers.py"]} |
2,847 | welloderx/wechat-2021-BigDataChallenge | refs/heads/master | /src/core/entrypoint.py | from core.tasks.deepfm import DeepFM_Manager
from core.tasks.lgb import LightGBM_Manager
class EntryPoint(object):
def __init__(self, cfg):
self.cfg = cfg
def start(self):
if self.cfg.task == 'DeepFM':
task = DeepFM_Manager(self.cfg)
task.start()
elif self.cfg.... | {"/src/deepctr_ext/utils.py": ["/src/deepctr_ext/feat.py", "/src/deepctr_ext/layers.py"]} |
2,848 | welloderx/wechat-2021-BigDataChallenge | refs/heads/master | /src/core/tasks/lgb.py | """
LightGBM
"""
import lightgbm as lgb
import pandas
from utils import DecoratorTimer
class LightGBM_Manager(object):
model_name = 'LightGBM'
def __init__(self, cfg):
self.cfg = cfg
self.yml_cfg = self.cfg.yml_cfg
self.model_cfg = self.yml_cfg[self.model_name]
assert self.cfg... | {"/src/deepctr_ext/utils.py": ["/src/deepctr_ext/feat.py", "/src/deepctr_ext/layers.py"]} |
2,849 | welloderx/wechat-2021-BigDataChallenge | refs/heads/master | /src/deepctr_ext/layers.py | import torch.nn as nn
import torch
class FM(nn.Module):
"""Factorization Machine models pairwise (order-2) feature interactions
without linear term and bias.
Input shape
- 3D tensor with shape: ``(batch_size,field_size,embedding_size)``.
Output shape
- 2D tensor with shape: ``(batc... | {"/src/deepctr_ext/utils.py": ["/src/deepctr_ext/feat.py", "/src/deepctr_ext/layers.py"]} |
2,850 | welloderx/wechat-2021-BigDataChallenge | refs/heads/master | /src/main.py | from utils import UnionConfig, LoggerUtil, DecoratorTimer, PathUtil, add_argument_from_dict_format
from conf import settings
from core.entrypoint import EntryPoint
import os
import argparse
import logging
import shutil
import traceback
import copy
import sys
registered_task_list = ['DeepFM', 'LightGBM']
def get_con... | {"/src/deepctr_ext/utils.py": ["/src/deepctr_ext/feat.py", "/src/deepctr_ext/layers.py"]} |
2,851 | welloderx/wechat-2021-BigDataChallenge | refs/heads/master | /src/deepctr_ext/feat.py | from collections import namedtuple
class SparseFeat(namedtuple('SparseFeat',
['name', 'vocabulary_size', 'embedding_dim', 'use_hash', 'dtype', 'embedding_name'])):
__slots__ = ()
def __new__(cls, name, vocabulary_size, embedding_dim=4, use_hash=False, dtype="int32", embedding_name... | {"/src/deepctr_ext/utils.py": ["/src/deepctr_ext/feat.py", "/src/deepctr_ext/layers.py"]} |
2,860 | jeeva-srinivasan/sentimentHeroku | refs/heads/main | /app.py | from flask import Flask,render_template,request
import pickle
from predict import predict
recom_df=pickle.load(open("recom_engine_cosine.pickle", "rb"))
app = Flask(__name__)
@app.route("/",methods =["POST","GET"])
def home():
if request.method == "POST":
user_name = request.form.get("userN... | {"/app.py": ["/predict.py"]} |
2,861 | jeeva-srinivasan/sentimentHeroku | refs/heads/main | /predict.py | import pandas as pd
import time
def predict(user_name,recom_df):
predict_df=pd.read_csv('preprocessing_sample30.csv',index_col='Product')
dataframe_df=predict_df[predict_df.index.isin(recom_df.loc[user_name].sort_values(ascending=False)[0:20].index)]
time.sleep(6)
return dataframe_df
| {"/app.py": ["/predict.py"]} |
2,862 | SwannSG/womansSheltersZApython | refs/heads/master | /geoJsonAddPropName.py | """
geoJsonAddPropName.py
feature.properties = {key_1: value_1, ...}
add new properties {key_N: value_N} for wardId=NNNNNNN
feature.properties = {key_1: value_1, ..., key_N: value:N}
ADD_PROP = {wardId: {key_1: value_1, ...}
additional key-value pairs will be added to
feature.p... | {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
2,863 | SwannSG/womansSheltersZApython | refs/heads/master | /analyseWardPop.py | """
analyse ward population
"""
import pprint
import pickle
file = '/home/swannsg/development/womansSheleterPy/data/femalePopulationFromKirsty/wardPop.pkl'
fp = open(file, 'rb')
wardPops = pickle.load(fp)
fp.close()
l = []
for each in wardPops:
l.append(int(wardPops[each]))
l.sort()
# pprint.pprint(l)
a = ... | {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
2,864 | SwannSG/womansSheltersZApython | refs/heads/master | /wardPopulation.py | """
Statistics South Africa
Descriptive_Electoral_Wards
Table 1
Geography by Gender
for Person weighted
,"Male","Female","Grand Total"
"21001001: Ward 1",4242,4500,8742
National data is mapped to hash map (dict) called 'result'
key: value
wardId: #females
210010... | {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
2,865 | SwannSG/womansSheltersZApython | refs/heads/master | /mergeGeoJsonFiles.py | """
Merge ZA ward geoJson files into one output file
"""
import pprint
import json
# global settings
# ---temporary working directory
TEMP_WDIR = '/home/swannsg/development/womansSheleterPy/temp'
DST_FILENAME = 'merge.geojson'
# end global settings
srcFiles = [
'/home/swannsg/development/womansSheleterPy... | {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
2,866 | SwannSG/womansSheltersZApython | refs/heads/master | /geoJsonChgPropName.py | """
geoJsonChgPropName.py
Change the the name of the property
feature.properties = {key_1: value_1, ...}
Change key_oldName to key_newName, keeping value the same
An existing key_newName value will be overwritten
CHANGE_PROP_NAME = [(oldName, newName), ...]
"""
import json
import pickle
... | {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
2,867 | SwannSG/womansSheltersZApython | refs/heads/master | /view_mfp.py | """
View missing female populations for specific wardId
"""
import pprint
import pickle
MFP = '/home/swannsg/development/womansSheleterPy/data/femalePopulationFromKirsty/mfp.pkl'
fp = open(MFP, 'rb')
mfp = pickle.load(fp)
fp.close()
pprint.pprint(mfp)
| {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
2,868 | SwannSG/womansSheltersZApython | refs/heads/master | /kmlToJson.py | """
kml to geojson
shapefiles WC
handles all files
does not handle WC.kml format ????
Read population statistics at the same time
feature.properties.woman = #woman
see wardPopulation.py
Still needed/ to be checked:
can we minimise the file further eg. drop 3rd c... | {"/automate.py": ["/geoJsonAddPropName.py", "/geoJsonChgPropName.py", "/geoJsonDelPropName.py"], "/multiFilesKmlToJson.py": ["/kmlToJson.py", "/mergeGeoJsonFiles.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.