index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
36 | Yuliashka/Snake-Game | refs/heads/main | /food.py |
from turtle import Turtle
import random
# we want this Food class to inherit from the Turtle class, so it will have all the capapibilities from
# the turtle class, but also some specific things that we want
class Food(Turtle):
# creating initializer for this class
def __init__(self):
# we... | {"/main.py": ["/snake.py", "/food.py", "/scoreboard.py"]} |
37 | Yuliashka/Snake-Game | refs/heads/main | /snake.py |
from turtle import Turtle
STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)]
MOVE_DISTANCE = 20
UP = 90
DOWN = 270
RIGHT = 0
LEFT = 180
class Snake:
# The code here is going to determine what should happen when we initialize a new snake object
def __init__(self):
# below we create a new... | {"/main.py": ["/snake.py", "/food.py", "/scoreboard.py"]} |
38 | Yuliashka/Snake-Game | refs/heads/main | /main.py |
from turtle import Screen
import time
from snake import Snake
from food import Food
from scoreboard import Score
# SETTING UP THE SCREEN:
screen = Screen()
screen.setup(width=600, height=600)
screen.bgcolor("black")
screen.title("My Snake Game")
# to turn off the screen tracer
screen.tracer(0)
# CREAT... | {"/main.py": ["/snake.py", "/food.py", "/scoreboard.py"]} |
39 | Yuliashka/Snake-Game | refs/heads/main | /scoreboard.py |
from turtle import Turtle
ALIGMENT = "center"
FONT = ("Arial", 18, "normal")
class Score(Turtle):
def __init__(self):
super().__init__()
self.score = 0
self.color("white")
self.penup()
self.goto(0, 270)
self.write(f"Current score: {self.score}", align... | {"/main.py": ["/snake.py", "/food.py", "/scoreboard.py"]} |
46 | marcin-mulawa/Water-Sort-Puzzle-Bot | refs/heads/main | /loading_phone.py | import numpy as np
import cv2
import imutils
picture = 'puzzle.jpg'
def load_transform_img(picture):
image = cv2.imread(picture)
image = imutils.resize(image, height=800)
org = image.copy()
#cv2.imshow('orginal', image)
mask = np.zeros(image.shape[:2], dtype = "uint8")
cv2.rectangle(mask, (15... | {"/auto_puzzle.py": ["/solver.py"], "/solver.py": ["/loading_pc.py"]} |
47 | marcin-mulawa/Water-Sort-Puzzle-Bot | refs/heads/main | /loading_pc.py | import numpy as np
import cv2
import imutils
picture = 'puzzle.jpg'
def load_transform_img(picture):
image = cv2.imread(picture)
#image = imutils.resize(image, height=800)
org = image.copy()
#cv2.imshow('orginal', image)
mask = np.zeros(image.shape[:2], dtype = "uint8")
cv2.rectangle(mask, (6... | {"/auto_puzzle.py": ["/solver.py"], "/solver.py": ["/loading_pc.py"]} |
48 | marcin-mulawa/Water-Sort-Puzzle-Bot | refs/heads/main | /auto_puzzle.py | import pyautogui as pya
import solver
import time
import glob
import os
import numpy as np
import cv2
import shutil
path = os.getcwd()
path1 = path + r'/temp'
path2 = path +r'/level'
try:
shutil.rmtree(path1)
except:
pass
try:
os.mkdir('temp')
except:
pass
try:
os.mkdir('level')
except:
pass
... | {"/auto_puzzle.py": ["/solver.py"], "/solver.py": ["/loading_pc.py"]} |
49 | marcin-mulawa/Water-Sort-Puzzle-Bot | refs/heads/main | /solver.py | from collections import deque
import random
import copy
import sys
import loading_pc
import os
def move(new_list, from_, to):
temp = new_list[from_].pop()
for _i in range(0,4):
if len(new_list[from_])>0 and abs(int(temp) - int(new_list[from_][-1]))<3 and len(new_list[to])<3:
temp = new_li... | {"/auto_puzzle.py": ["/solver.py"], "/solver.py": ["/loading_pc.py"]} |
54 | TheDinner22/lightning-sim | refs/heads/main | /lib/board.py | # represent the "board" in code
# dependencies
import random
class Board:
def __init__(self, width=10):
self.width = width
self.height = width * 2
self.WALL_CHANCE = .25
self.FLOOR_CHANCE = .15
# create the grid
self.create_random_grid()
def create_random_gri... | {"/main.py": ["/lib/board.py", "/lib/window.py"]} |
55 | TheDinner22/lightning-sim | refs/heads/main | /lib/window.py | # use pygame to show the board on a window
# dependencies
import pygame, random
class Window:
def __init__(self, board):
# init py game
pygame.init()
# width height
self.WIDTH = 600
self.HEIGHT = 600
# diffenet display modes
self.display_one = False
... | {"/main.py": ["/lib/board.py", "/lib/window.py"]} |
56 | TheDinner22/lightning-sim | refs/heads/main | /main.py | # this could and will be better i just needed to make it here as a
# proof of concept but it will be online and better later
import os, sys
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # adds project dir to places it looks for the modules
sys.path.append(BASE_PATH)
from lib.board import B... | {"/main.py": ["/lib/board.py", "/lib/window.py"]} |
79 | igoryuha/wct | refs/heads/master | /eval.py | import torch
from models import NormalisedVGG, Decoder
from utils import load_image, preprocess, deprocess, extract_image_names
from ops import style_decorator, wct
import argparse
import os
parser = argparse.ArgumentParser(description='WCT')
parser.add_argument('--content-path', type=str, help='path to the content ... | {"/eval.py": ["/models.py", "/utils.py", "/ops.py"], "/utils.py": ["/ops.py"]} |
80 | igoryuha/wct | refs/heads/master | /models.py | import torch
import torch.nn as nn
import copy
normalised_vgg_relu5_1 = nn.Sequential(
nn.Conv2d(3, 3, 1),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(3, 64, 3),
nn.ReLU(),
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(64, 64, 3),
nn.ReLU(),
nn.MaxPool2d(2, ceil_mode=True),
nn.Reflec... | {"/eval.py": ["/models.py", "/utils.py", "/ops.py"], "/utils.py": ["/ops.py"]} |
81 | igoryuha/wct | refs/heads/master | /ops.py | import torch
import torch.nn.functional as F
def extract_image_patches_(image, kernel_size, strides):
kh, kw = kernel_size
sh, sw = strides
patches = image.unfold(2, kh, sh).unfold(3, kw, sw)
patches = patches.permute(0, 2, 3, 1, 4, 5)
patches = patches.reshape(-1, *patches.shape[-3:]) # (patch_nu... | {"/eval.py": ["/models.py", "/utils.py", "/ops.py"], "/utils.py": ["/ops.py"]} |
82 | igoryuha/wct | refs/heads/master | /utils.py | import torch
from torchvision import transforms
from ops import relu_x_1_style_decorator_transform, relu_x_1_transform
from PIL import Image
import os
def eval_transform(size):
return transforms.Compose([
transforms.Resize(size),
transforms.ToTensor()
])
def load_image(path):
return Imag... | {"/eval.py": ["/models.py", "/utils.py", "/ops.py"], "/utils.py": ["/ops.py"]} |
89 | tattle-made/archive-telegram-bot | refs/heads/master | /tattle_helper.py | import os
import json
import boto3
import requests
from logger import log, logError
from dotenv import load_dotenv
load_dotenv()
s3 = boto3.client("s3",aws_access_key_id=os.environ.get('S3_ACCESS_KEY'),aws_secret_access_key=os.environ.get('S3_SECRET_ACCESS_KEY'))
API_BASE_URL = "https://archive-server.tattle.co.in"
#... | {"/tattle_helper.py": ["/logger.py"], "/test.py": ["/tattle_helper.py"], "/prototype.py": ["/logger.py", "/tattle_helper.py"]} |
90 | tattle-made/archive-telegram-bot | refs/heads/master | /post_request.py | token = "78a6fc20-fa83-11e9-a4ad-d1866a9a3c7b" # add your token here
url = "<base-api-url>/api/posts"
try:
payload = d
payload = json.dumps(payload)
headers = {
'token': token,
'Content-Type': "application/json",
'cache-control': "no-cache",
}
r = requests.post(url, data=... | {"/tattle_helper.py": ["/logger.py"], "/test.py": ["/tattle_helper.py"], "/prototype.py": ["/logger.py", "/tattle_helper.py"]} |
91 | tattle-made/archive-telegram-bot | refs/heads/master | /test.py | from tattle_helper import register_post, upload_file
data = {
"type" : "image",
"data" : "",
"filename": "asdf",
"userId" : 169
}
response = upload_file(file_name='denny.txt')
print(response)
# register_post(data) | {"/tattle_helper.py": ["/logger.py"], "/test.py": ["/tattle_helper.py"], "/prototype.py": ["/logger.py", "/tattle_helper.py"]} |
92 | tattle-made/archive-telegram-bot | refs/heads/master | /prototype.py | import os
import sys
import json
import requests
import telegram
import logging
import re
from threading import Thread
from telegram.ext import CommandHandler, MessageHandler, Updater, Filters, InlineQueryHandler
from telegram import InlineQueryResultArticle, InputTextMessageContent
from telegram.ext.dispatcher import ... | {"/tattle_helper.py": ["/logger.py"], "/test.py": ["/tattle_helper.py"], "/prototype.py": ["/logger.py", "/tattle_helper.py"]} |
93 | tattle-made/archive-telegram-bot | refs/heads/master | /logger.py | from datetime import datetime
def log(data):
print('----', datetime.now(), '----')
print(data)
def logError(error):
print('****', datetime.now(), '****')
print(error) | {"/tattle_helper.py": ["/logger.py"], "/test.py": ["/tattle_helper.py"], "/prototype.py": ["/logger.py", "/tattle_helper.py"]} |
143 | shuishen112/pairwise-rnn | refs/heads/master | /main.py |
import data_helper
import time
import datetime
import os
import tensorflow as tf
import numpy as np
import evaluation
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)
timeDay = time.strftime("%Y%m%d", timeArray)
print (timeStamp)
def main(args):
ar... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
144 | shuishen112/pairwise-rnn | refs/heads/master | /config.py | class Singleton(object):
__instance=None
def __init__(self):
pass
def getInstance(self):
if Singleton.__instance is None:
# Singleton.__instance=object.__new__(cls,*args,**kwd)
Singleton.__instance=self.get_test_flag()
print("build FLAGS over")
ret... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
145 | shuishen112/pairwise-rnn | refs/heads/master | /run.py | from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime,os
import models
import numpy as np
import evaluation
import sys
import logging
import time
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
146 | shuishen112/pairwise-rnn | refs/heads/master | /models/QA_CNN_pairwise.py | #coding:utf-8
import tensorflow as tf
import numpy as np
from tensorflow.contrib import rnn
import models.blocks as blocks
# model_type :apn or qacnn
class QA_CNN_extend(object):
# def __init__(self,max_input_left,max_input_right,batch_size,vocab_size,embedding_size,filter_sizes,num_filters,hidden_size,
# dro... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
147 | shuishen112/pairwise-rnn | refs/heads/master | /models/my/nn.py | from my.general import flatten, reconstruct, add_wd, exp_mask
import numpy as np
import tensorflow as tf
_BIAS_VARIABLE_NAME = "bias"
_WEIGHTS_VARIABLE_NAME = "kernel"
def linear(args, output_size, bias, bias_start=0.0, scope=None, squeeze=False, wd=0.0, input_keep_prob=1.0,
is_train=None):#, name_w='',... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
148 | shuishen112/pairwise-rnn | refs/heads/master | /models/__init__.py | from .QA_CNN_pairwise import QA_CNN_extend as CNN
from .QA_RNN_pairwise import QA_RNN_extend as RNN
from .QA_CNN_quantum_pairwise import QA_CNN_extend as QCNN
def setup(opt):
if opt["model_name"]=="cnn":
model=CNN(opt)
elif opt["model_name"]=="rnn":
model=RNN(opt)
elif opt['model_name']=='qcnn':
model=QCNN(opt... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
149 | shuishen112/pairwise-rnn | refs/heads/master | /test.py | # -*- coding: utf-8 -*-
from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime
import os
import models
import numpy as np
import evaluation
from data_helper import log_time_delta,getLogger
logger=getLogger()
args = Singleton().get_rnn_flag()
#args... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
150 | shuishen112/pairwise-rnn | refs/heads/master | /data_helper.py | #-*- coding:utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import string
from collections import Counter
import pandas as pd
from tqdm import tqdm
import random
from functools import wraps
import time
import pickle
def log_time_delta(func):
@wraps(func)
def _deco(*args, **kwargs):
star... | {"/main.py": ["/data_helper.py"], "/run.py": ["/config.py", "/data_helper.py", "/models/__init__.py"], "/models/__init__.py": ["/models/QA_CNN_pairwise.py"], "/test.py": ["/config.py", "/data_helper.py", "/models/__init__.py"]} |
158 | pedromeldola/Desafio | refs/heads/master | /core/models.py | from django.db import models
#criação da classe com os atributos
class Jogo(models.Model):
idJogo = models.AutoField(primary_key=True)
placar = models.IntegerField()
placarMin = models.IntegerField()
placarMax = models.IntegerField()
quebraRecMin = models.IntegerField()
quebraRecMax = models.In... | {"/core/views.py": ["/core/models.py"]} |
159 | pedromeldola/Desafio | refs/heads/master | /core/views.py | from django.shortcuts import render,redirect
from .models import Jogo
from django.views.decorators.csrf import csrf_protect
#método para chamar todos os objetos que estão na classe Jogo quando entrar na home page
def home_page(request):
jogo = Jogo.objects.all()
return render (request,'home.html',{'jogo':jogo}... | {"/core/views.py": ["/core/models.py"]} |
160 | pedromeldola/Desafio | refs/heads/master | /core/migrations/0002_auto_20200930_2254.py | # Generated by Django 3.1 on 2020-10-01 01:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='jogo',
name='id',
),
migr... | {"/core/views.py": ["/core/models.py"]} |
161 | pedromeldola/Desafio | refs/heads/master | /core/migrations/0001_initial.py | # Generated by Django 3.1.1 on 2020-09-28 18:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Jogo',
fields=[
('id', models.AutoField(aut... | {"/core/views.py": ["/core/models.py"]} |
185 | andrewjschuang/Turing | refs/heads/master | /turing.py | import time
from datetime import datetime
from flask import (Flask, abort, flash, redirect, render_template, request,
session, url_for)
from sqlalchemy.exc import IntegrityError
from wtforms import (Form, RadioField, StringField, SubmitField, TextAreaField, TextField,
validators)... | {"/test.py": ["/turing.py"]} |
186 | andrewjschuang/Turing | refs/heads/master | /test.py | from flask_testing import TestCase
from models.shared import db
from models.model import User, Task, Project, Question, Response, Questionnaire
from turing import create_app
import unittest
class MyTest(TestCase):
def create_app(self):
config = {
'SQLALCHEMY_DATABASE_URI': 'sqlite:///test.db... | {"/test.py": ["/turing.py"]} |
187 | andrewjschuang/Turing | refs/heads/master | /functionalities.py | functionalities = {
'Login': 'Login page',
'Feedback': 'This feedback form',
'Todo': 'To do module',
'Projects': 'Anything related to projects',
'Code': 'Code editor',
'Forum': 'The forum',
'Profile': 'Your profile page',
}
| {"/test.py": ["/turing.py"]} |
188 | yywang0514/dsnre | refs/heads/master | /train.py | import sys
import os
import time
import numpy as np
import torch
import torch.nn.functional as F
import argparse
import logging
from lib import *
from model import *
def train(options):
if not os.path.exists(options.folder):
os.mkdir(options.folder)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(... | {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
189 | yywang0514/dsnre | refs/heads/master | /lib/module.py | import torch
import torch.nn as nn
import math
class LayerNorm(nn.Module):
"""Layer Normalization class"""
def __init__(self, features, eps=1e-6):
super(LayerNorm, self).__init__()
self.a_2 = nn.Parameter(torch.ones(features))
self.b_2 = nn.Parameter(torch.zeros(features))
self.eps = eps
def forward(self... | {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
190 | yywang0514/dsnre | refs/heads/master | /model.py | import torch
import torch.nn as nn
from lib import *
class Model(nn.Module):
def __init__(self,
fine_tune,
pre_train_emb,
part_point,
size_vocab,
dim_emb, ... | {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
191 | yywang0514/dsnre | refs/heads/master | /lib/__init__.py | from module import *
from util import *
from data_iterator import *
| {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
192 | yywang0514/dsnre | refs/heads/master | /format.py | import sys
import codecs
class InstanceBag(object):
def __init__(self, entities, rel, num, sentences, positions, entitiesPos):
self.entities = entities
self.rel = rel
self.num = num
self.sentences = sentences
self.positions = positions
self.entitiesPos = entitiesPos
def bags_decompose(data_bags):
bag... | {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
193 | yywang0514/dsnre | refs/heads/master | /lib/util.py | import sys
import re
import numpy as np
import cPickle as pkl
import codecs
import logging
from data_iterator import *
logger = logging.getLogger()
extra_token = ["<PAD>", "<UNK>"]
def display(msg):
print(msg)
logger.info(msg)
def datafold(filename):
f = open(filename, 'r')
data = []
while 1:
line = f.readl... | {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
194 | yywang0514/dsnre | refs/heads/master | /lib/data_iterator.py | import time
import cPickle
import numpy as np
import torch
class InstanceBag(object):
def __init__(self, entities, rel, num, sentences, positions, entitiesPos):
self.entities = entities
self.rel = rel
self.num = num
self.sentences = sentences
self.positions = positions
self.entitiesPos = entitiesPos
def ... | {"/train.py": ["/lib/__init__.py", "/model.py"], "/model.py": ["/lib/__init__.py"]} |
210 | rodelrod/pomodoro-report | refs/heads/master | /test_notebook_parser.py | #!/usr/bin/env python
import unittest
from notebook_parser import *
import os
import errno
from datetime import datetime
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST:
pass
else:
raise
class TestParser(unittest... | {"/test_notebook_parser.py": ["/notebook_parser.py"]} |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 20