index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
96,936
deekshith-hari/twitterclone
refs/heads/master
/tweet/migrations/0002_alter_tweet_image.py
# Generated by Django 3.2 on 2021-04-21 23:39 import cloudinary.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('tweet', '0001_initial'), ] operations = [ migrations.AlterField( model_name='tweet', name='image', ...
{"/accounts/views.py": ["/accounts/models.py"], "/tweet/views.py": ["/tweet/models.py", "/accounts/models.py"]}
96,937
deekshith-hari/twitterclone
refs/heads/master
/tweet/migrations/0006_auto_20210425_1543.py
# Generated by Django 3.1.1 on 2021-04-25 15:43 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('tweet', '0005_auto_20210424_0041'), ] operations...
{"/accounts/views.py": ["/accounts/models.py"], "/tweet/views.py": ["/tweet/models.py", "/accounts/models.py"]}
96,945
feiliu23/picturesques.ai
refs/heads/master
/predict.py
import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.autograd import Variable from PIL import Image import os class ImagePredictor(object): def __init__(self, model_root): self.model_classification = torch.load(os.path.join(model_root, 'model_classific...
{"/app.py": ["/predict.py"]}
96,946
feiliu23/picturesques.ai
refs/heads/master
/predict_old.py
import pandas as pd import numpy as np import torch import torchvision.transforms as transforms from torch.autograd import Variable from PIL import Image class ImagePredictor(object): def __init__(self, model_path): self.model = torch.load(model_path) self.transform = transforms.Compose( [transforms.Cente...
{"/app.py": ["/predict.py"]}
96,947
feiliu23/picturesques.ai
refs/heads/master
/app.py
""" @author: Chen Wang, Fei Liu """ import os import numpy as np # We'll render HTML templates and access data sent by POST # using the request object from flask. Redirect and url_for # will be used to redirect the user once the upload is done # and send_from_directory will help us to send/show on the # browser the f...
{"/app.py": ["/predict.py"]}
96,948
feiliu23/picturesques.ai
refs/heads/master
/database/sql_db_insert.py
import datetime import psycopg2 def insert_users(id, name, email, subscriber, sessions_to_date): """ This function inserts a row of new user information """ SQLCursor = LCLconnR.cursor() SQLCursor.execute( """ INSERT INTO picturesque.users (id, name, email, subscriber, sess...
{"/app.py": ["/predict.py"]}
96,949
feiliu23/picturesques.ai
refs/heads/master
/model/train.py
import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms from torchvision import models from torch.autograd import Variable from torch.utils.data import Dataset from torch.utils.data.sampler import SubsetRandomSampler import matplotlib.pyplot as plt i...
{"/app.py": ["/predict.py"]}
96,950
feiliu23/picturesques.ai
refs/heads/master
/model/train_classifier.py
import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms from torchvision import models from torch.autograd import Variable from torch.utils.data import Dataset from torch.utils.data.sampler import SubsetRandomSampler import matplotlib.pyplot as plt i...
{"/app.py": ["/predict.py"]}
96,951
feiliu23/picturesques.ai
refs/heads/master
/database/sql_db_update.py
import datetime import psycopg2 # Note that we may need to write different functions to # update different pieces of the record. I only give an # example template here def update_subscriber(id, subscriber_boolean): SQLCursor = LCLconnR.cursor() SQLCursor.execute( """ UPDATE picturesque.users...
{"/app.py": ["/predict.py"]}
96,952
feiliu23/picturesques.ai
refs/heads/master
/database/sql_db_create.py
import os import psycopg2 # Note that it is assumed that we already have the database connected # before calling all the SQL-related statements def create_schema(schema_name='picturesque'): """ This function allows the user to specify the name of the schema to be created and create it accordingly ""...
{"/app.py": ["/predict.py"]}
96,953
feiliu23/picturesques.ai
refs/heads/master
/model/fetch_data.py
import flickrapi import urllib.request import pandas as pd import numpy as np import random import os import shutil class DataFetcher(object): def __init__(self): api_key = u'6a8cc99493d649ae15c809a48c1057b7' api_secret = u'411afb1eff6129e2' self.flickr = flickrapi.FlickrAPI(api_key, api_s...
{"/app.py": ["/predict.py"]}
96,962
Jungle20m/chamcong_v2_producer
refs/heads/master
/app/entity/camera.py
from threading import Thread import numpy as np import cv2 class VideoStream: def __init__(self, src): self.stream = cv2.VideoCapture(src) (self.grabbed, self.frame) = self.stream.read() self.stream.set(3,1280) self.stream.set(4,720) self.stopped = False def start(sel...
{"/app/workers/producer.py": ["/app/core/config.py", "/app/entity/camera.py"]}
96,963
Jungle20m/chamcong_v2_producer
refs/heads/master
/app/core/config.py
import os from starlette.config import Config config = Config(".env-dev") # **DATABASE DATABASE_URL: str = config("DB_CONNECTION") POOL_RECYCLE = 3600 # ** REGISTRY_API: str = config("REGISTRY_API")
{"/app/workers/producer.py": ["/app/core/config.py", "/app/entity/camera.py"]}
96,964
Jungle20m/chamcong_v2_producer
refs/heads/master
/app/workers/producer.py
import time import requests from typing import List from multiprocessing import Process from kafka import KafkaProducer from chamcong_io.api.producer import ResponseConfig, DataConfig, Camera from chamcong_io.api.common import Kafka as KafkaIo from app.core.config import REGISTRY_API from app.entity.camera import Vid...
{"/app/workers/producer.py": ["/app/core/config.py", "/app/entity/camera.py"]}
96,976
morshedmasud/django_blog
refs/heads/master
/blog_app/urls.py
from django.urls import path from . import views from django.conf import settings from django.conf.urls.static import static app_name="blog_app" urlpatterns = [ path('', views.index.as_view(), name='index'), path('author/<name>', views.getauthor, name="author"), path('article/<int:id>', views.getsingle, na...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,977
morshedmasud/django_blog
refs/heads/master
/blog_app/models.py
from django.db import models from django.contrib.auth.models import User from django.urls import reverse from ckeditor.fields import RichTextField from ckeditor_uploader.fields import RichTextUploadingField # Create your models here. class author(models.Model): name = models.ForeignKey(User, on_delete=models.CASC...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,978
morshedmasud/django_blog
refs/heads/master
/blog_app/forms.py
from django import forms from .models import article, author, Comment, category from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm class ArticleForm(forms.ModelForm): class Meta: model = article fields = [ 'title', 'video', ...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,979
morshedmasud/django_blog
refs/heads/master
/blog_app/require.py
from io import BytesIO, StringIO from django.http import HttpResponse from django.template.loader import get_template from xhtml2pdf import pisa import datetime def render_to_pdf(template, content_dic={}): t = get_template(template) send_data = t.render(content_dic) result = BytesIO() pdf = pisa.pisaDo...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,980
morshedmasud/django_blog
refs/heads/master
/blog_app/views.py
from django.shortcuts import render, Http404, get_object_or_404, redirect, HttpResponse, HttpResponseRedirect from .models import author, category, article, Comment from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.views.decorators.http imp...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,981
morshedmasud/django_blog
refs/heads/master
/blog_app/migrations/0002_auto_20190415_0254.py
# Generated by Django 2.1 on 2019-04-14 20:54 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog_app', '0001_initial'), ] operations = [ migrations.AlterField( model_name='comment', ...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,982
morshedmasud/django_blog
refs/heads/master
/blog_app/migrations/0001_initial.py
# Generated by Django 2.1 on 2019-04-14 20:52 import ckeditor_uploader.fields from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AU...
{"/blog_app/forms.py": ["/blog_app/models.py"], "/blog_app/views.py": ["/blog_app/models.py", "/blog_app/forms.py", "/blog_app/require.py"]}
96,986
goldenBill/Power_Control
refs/heads/master
/train.py
import os import torch import argparse import torch.nn as nn import torch.utils.data import numpy as np from network import Approx, Dual, Lagrange, objective from utils import * import time class DataIterator(object): def __init__(self, dataloader): self.dataloader = dataloader self.iterator = enu...
{"/train.py": ["/network.py", "/utils.py"]}
96,987
goldenBill/Power_Control
refs/heads/master
/network.py
import torch import torch.nn as nn import numpy as np class Approx(nn.Module): def __init__(self, inp=4, oup=2, hidden_dim=20): super(Approx, self).__init__() self.inp = inp self.oup = oup self.hidden_dim = hidden_dim self.architecture = nn.Sequential( nn.Linear(...
{"/train.py": ["/network.py", "/utils.py"]}
96,988
goldenBill/Power_Control
refs/heads/master
/utils.py
import os import re import torch def save_checkpoint(state, iters, tag='', path = './models'): if not os.path.exists(path): os.makedirs(path) filename = os.path.join(path+"/{}checkpoint-{:06}.pth.tar".format(tag, iters)) torch.save(state, filename) def get_lastest_model(path='./models', exact = No...
{"/train.py": ["/network.py", "/utils.py"]}
96,996
nordicdyno/AoC-2019
refs/heads/master
/day05/intcode.py
from enum import IntEnum from typing import List, Dict, Callable from dataclasses import dataclass, field import functools # parameter modes: p_mod = 0 # position mode i_mod = 1 # immediate mode class AddrMode(IntEnum): POSITION = 0 IMMEDIATE = 1 # returns opcode & mode flags coded in instruction def parse_i...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
96,997
nordicdyno/AoC-2019
refs/heads/master
/day09/test_intcode.py
import intcode def test_memory_rw(): cpu = intcode.CPU(code=[]) value = 1125899906842624 cpu.write_memory(10000, value) got_value = cpu.read_memory(10000) assert value == got_value def test_parse_opcode(): got_op, got_modes = intcode.parse_instruction(109) assert 9 == got_op assert [1,...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
96,998
nordicdyno/AoC-2019
refs/heads/master
/day07/intcode.py
from enum import IntEnum from typing import List, Dict, Callable, Type from dataclasses import dataclass, field import functools class Interrupt(IntEnum): OUTPUT = 4 HALT = 99 class OutputInt(Exception): pass class HaltInt(Exception): pass @dataclass class CPU(): memory: List[int] IP: int...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
96,999
nordicdyno/AoC-2019
refs/heads/master
/day09/second.py
import intcode if __name__ == "__main__": amplifiers = [] program = intcode.read_file('code.txt') cpu = intcode.CPU(code=program, input=[2], max_steps=1_000_000) cpu.execute() print("CPU steps:", cpu.step) # 371205 (~40s on MacbookPro 2018) print("output:", cpu.output)
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,000
nordicdyno/AoC-2019
refs/heads/master
/day09/first.py
import intcode if __name__ == "__main__": amplifiers = [] program = intcode.read_file('code.txt') cpu = intcode.CPU(code=program, input=[1]) cpu.debug = True cpu.execute() print("output:", cpu.output)
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,001
nordicdyno/AoC-2019
refs/heads/master
/day11/intcode.py
from enum import IntEnum from typing import List, Dict, Callable, Type from dataclasses import dataclass, field import functools class Interrupt(IntEnum): OUTPUT = 4 HALT = 99 class OutputInt(Exception): pass class HaltInt(Exception): pass @dataclass class CPU(): code: List[int] code_size:...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,002
nordicdyno/AoC-2019
refs/heads/master
/day01/test_second.py
from . import second def test_14(): assert second.module_fuel(14) == 2 def test_print_second_solution(): second.print_solution()
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,003
nordicdyno/AoC-2019
refs/heads/master
/day08/test_sif.py
from sif import * from typing import List, Dict, Callable, Type def test_decode_layers(): sif = split_digits("123456789012") layers = decode_layers(sif, 3, 2) img1 = [[1,2,3], [4,5,6]] img2 = [[7,8,9],[0,1,2]] expect = [img1, img2] assert 2 == len(layers) assert expect == layers def find_...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,004
nordicdyno/AoC-2019
refs/heads/master
/day07/first.py
import intcode from itertools import permutations, repeat, product from typing import List, Dict, Callable def find_best_phase_settings(program: List[int]) -> (int, List[int]): phase_settings_values = [i for i in range(5)] max_value = 0 best_settings = [] for phase_settings in permutations(phase_settin...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,005
nordicdyno/AoC-2019
refs/heads/master
/day10/test_ims.py
import ims def test_ok(): assert True def test_parse(): example_map = [ ".#..#", ".....", "#####", "....#", "...##", ] expect_arr = [ [0,1,0,0,1], [0,0,0,0,0], [1,1,1,1,1], [0,0,0,0,1], [0,0,0,1,1], ] m = ims.parse...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,006
nordicdyno/AoC-2019
refs/heads/master
/day03/first.py
def direction_deltas(direction) -> (int, int, str): d, length = direction[0], int(direction[1:]) if d == "R": return length, 0, d if d == "D": return 0, -length, d if d == "U": return 0, +length, d if d == "L": return -length, 0, d def is_horizontal(d): return d ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,007
nordicdyno/AoC-2019
refs/heads/master
/day10/second.py
import ims def vaporize_until(m: ims.Map, base: ims.Point, n: int=200) -> ims.Point: i = 0 while m.asteroids(): for p in m.loop_scan(base_coord): m.vaporize(p) i += 1 if i == 200: return p return None if __name__ == "__main__": amplifiers = ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,008
nordicdyno/AoC-2019
refs/heads/master
/day10/test_rotate.py
import ims import math # from typing import List, Dict, Callable, Type, Iterable, Tuple # Point = Tuple[int, int] def test_rotate_1(): print() map_data = [ #01234567890123456 ".#....#####...#..", # 0 "##...##.#####..##", # 1 "##...#...#.#####.", # 2 "..#.....X...###.."...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,009
nordicdyno/AoC-2019
refs/heads/master
/day07/second_test.py
import second def test_second_case1(): program = [3,26,1001,26,-4,26,3,27,1002,27,2,27,1,27,26,27,4,27,1001,28,-1,28,1005,28,6,99,0,0,5] phase_settings = [9,8,7,6,5] thruster_signal = second.check_phase_settings_loop(program, phase_settings) assert 139629729 == thruster_signal def test_second_case2():...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,010
nordicdyno/AoC-2019
refs/heads/master
/day02/first.py
from typing import List, Dict from pydantic import BaseModel def add(idx: int, mem: List[int]): mem[mem[idx+3]] = mem[mem[idx+1]] + mem[mem[idx+2]] def mul(idx: int, mem: List[int]): mem[mem[idx+3]] = mem[mem[idx+1]] * mem[mem[idx+2]] opcodes = {1: add, 2: mul} class CPU(BaseModel): # opcodes: Dict ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,011
nordicdyno/AoC-2019
refs/heads/master
/day11/test_robopaint.py
from robopaint import Direction, Rotate, change_direction, move_to_direction def test_change_direction(): # "^" + L> => "<" assert Direction.Left == change_direction(Direction.Up, Rotate.Left) # "^" + R => ">" assert Direction.Right == change_direction(Direction.Up, Rotate.Right) # "<" + L = "V" ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,012
nordicdyno/AoC-2019
refs/heads/master
/day05/test_intcode.py
from . import intcode def test_parse_opcode_1(): code, modes = intcode.parse_instruction(1) assert 1 == code assert [] == modes code, modes = intcode.parse_instruction(101) assert 1 == code assert [1] == modes code, modes = intcode.parse_instruction(10001) assert 1 == code assert ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,013
nordicdyno/AoC-2019
refs/heads/master
/day01/second.py
#!python3 def extra_fuel(amount): extra = 0 while amount > 0: extra += amount amount = amount//3 - 2 return extra def module_fuel(mass): fuel = 0 extra_fuel = mass//3 - 2 while extra_fuel > 0: fuel += extra_fuel extra_fuel = extra_fuel//3 - 2 return fuel de...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,014
nordicdyno/AoC-2019
refs/heads/master
/day08/sif.py
""" SIF - Space Image Format https://adventofcode.com/2019/day/8 """ from typing import List, Dict, Callable, Type from dataclasses import dataclass, field from itertools import chain def split_digits(*args) -> List[int]: return [int(x) for x in chain(*args)] def read_file(sif_file: str) -> List: code...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,015
nordicdyno/AoC-2019
refs/heads/master
/day02/test_opcodes.py
from . import first def test_add(): mem = [1,9,10,3, 2,3,11,0, 99,30,40,50] expect = [1,9,10,30+40, 2,3,11,0, 99,30,40,50] first.add(0, mem) assert mem == expect def test_mul(): mem = [1,9,10,3, 2,3,11,0, 99,30,40,50] expect = [1,9,10,30*40, 2,3,11,0, 99,30,40,50] first.mul(0, mem)...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,016
nordicdyno/AoC-2019
refs/heads/master
/day09/test_day9.py
from typing import List, Dict, Callable, Type def test_smth(): assert 1 == 1
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,017
nordicdyno/AoC-2019
refs/heads/master
/day04/second.py
def check_password2(pwd: int) -> bool: digits = [int(c) for c in str(pwd)] last_value = digits[0] series_length = 1 has_dup = False for d in digits[1:]: if d < last_value: return False if d == last_value: series_length += 1 else: has_dup ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,018
nordicdyno/AoC-2019
refs/heads/master
/day07/first_test.py
import intcode import first def test_cpu_init(): cpu = intcode.CPU(memory=[], input=[]) assert [] == cpu.output def test_case1(): program = [3,15,3,16,1002,16,10,16,1,16,15,15,4,15,99,0,0] phase_settings = [4,3,2,1,0] thruster_signal = first.check_phase_settings(program, phase_settings) assert...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,019
nordicdyno/AoC-2019
refs/heads/master
/day02/second.py
# import os, sys; sys.path.append(os.path.dirname(os.path.realpath(__file__))) import first import itertools def check_pair(noun, verb): cpu = first.CPU(memory=first.program) cpu.memory[1] = noun cpu.memory[2] = verb cpu.execute() return cpu.memory[0] == 19690720 if __name__ == "__main__": no...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,020
nordicdyno/AoC-2019
refs/heads/master
/day05/first.py
import intcode if __name__ == "__main__": program = intcode.read_file('code.txt') # print(program) cpu = intcode.CPU(memory=program, input=1) cpu.execute() # print("[0]", cpu.memory[0])
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,021
nordicdyno/AoC-2019
refs/heads/master
/day07/second.py
import intcode from itertools import permutations, repeat, product from typing import List, Dict, Callable def find_best_phase_settings(program: List[int]) -> (int, List[int]): phase_settings_values = [i for i in range(5,10)] max_value = 0 best_settings = [] for phase_settings in permutations(phase_set...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,022
nordicdyno/AoC-2019
refs/heads/master
/day04/first.py
def check_password1(pwd: int) -> bool: digits = [int(c) for c in str(pwd)] if len(digits) != 6: return False last_value = digits[0] has_dup = False for d in digits[1:]: if d < last_value: return False if not has_dup: has_dup = last_value == d ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,023
nordicdyno/AoC-2019
refs/heads/master
/day04/test_secure.py
from .first import check_password1 from .second import check_password2 def test_check_password1(): assert check_password1(111111) assert not check_password1(223450) assert not check_password1(123789) assert check_password1(455667) def test_check_password2(): assert not check_password2(111111) ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,024
nordicdyno/AoC-2019
refs/heads/master
/day10/ims.py
""" IMS - Instant Monitoring Station """ from enum import IntEnum from typing import List, Dict, Callable, Type, Iterable, Tuple from dataclasses import dataclass, field import functools from dataclasses import dataclass, field import math Point = Tuple[int, int] def normalize_points(p1: Point, p2: Point) -> Tupl...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,025
nordicdyno/AoC-2019
refs/heads/master
/day01/first.py
#!python3 required_fuel = 0 # ship_modules = [] with open('testdata/first-input.txt') as f: for line in f: if line: mass = int(line) # print(mass, "/3", mass/3, "//3", mass//3) required_fuel += mass//3 - 2 # ship_modules.append() # print(ship_modules) print(re...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,026
nordicdyno/AoC-2019
refs/heads/master
/day11/second.py
import intcode # from robopaint import Direction, change_direction, move_to_direction import robopaint if __name__ == "__main__": amplifiers = [] program = intcode.read_file('code.txt') cpu = intcode.CPU(code=program) robo = robopaint.Robot(cpu=cpu) robo.paint(start_color=robopaint.ColorNum.White...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,027
nordicdyno/AoC-2019
refs/heads/master
/day03/test_search.py
from .first import sections_extract, find_intersections, find_closest from .second import find_fewest_combined_steps def test_sections_extract(): print("Extract") got1 = sections_extract(["R8","U5","L5","D3"]) assert [[0, 0, 8, 0], [3, 5, 8, 5]], [[8, 0, 8, 5], [3, 2, 3, 5]] == got1 # print(got1) g...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,028
nordicdyno/AoC-2019
refs/heads/master
/day10/first.py
import ims if __name__ == "__main__": amplifiers = [] coords = ims.read_file('map.txt') m = ims.Map(coords=coords) value, coord = m.best_observer() print(f"value: {value}, coord: {coord}:")
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,029
nordicdyno/AoC-2019
refs/heads/master
/day03/second.py
from first import sections_extract, find_intersections, \ read_input, direction_deltas, is_horizontal, is_vertical def find_fewest_combined_steps(w1, w2): # print("") intersections = all_intersections(w1, w2) # print("intersections", intersections) d1 = intersection_distances(w1, intersections) ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,030
nordicdyno/AoC-2019
refs/heads/master
/day11/first.py
import intcode import robopaint # from robopaint import Direction, change_direction, move_to_direction print("probe program") # def probe_paint_code(cpu: intcode.CPU): # # cpu.debug = True # cpu.max_steps = 100_000 # painted_once = 0 # paints_count = 0 # painted = {} # default_color = 0 # ...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,031
nordicdyno/AoC-2019
refs/heads/master
/day06/test_day6.py
import functools from dataclasses import dataclass, field from collections import defaultdict from typing import Type, List, Dict def read_coded_orbits(data: List) -> Dict: orbits = {} for coded_orbit in data: parent_name, name = coded_orbit.split(")") orbits[name] = parent_name return orbi...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,032
nordicdyno/AoC-2019
refs/heads/master
/day11/robopaint.py
from dataclasses import dataclass, field from enum import Enum, IntEnum import intcode from typing import List, Dict, Callable, Type, Tuple, Any Point = Tuple[int, int] class ColorNum(IntEnum): Black = 0 # 0 for robot White = 1 # 1 for robot class Color(Enum): Black = '.' # 0 for robot White = '#' #...
{"/day04/test_secure.py": ["/day04/first.py", "/day04/second.py"], "/day03/test_search.py": ["/day03/first.py", "/day03/second.py"]}
97,033
joudi12/math-series
refs/heads/master
/tests/test_series.py
from math_series import __version__ from math_series.series import fibonacci,lucas,sum_series from math_series.series import series_new def test_version(): assert __version__ == '0.1.0' def test_six(): actual= fibonacci(6) expected = 8 assert actual == expected def test_four(): actual = lucas(4)...
{"/tests/test_series.py": ["/math_series/series.py"]}
97,034
joudi12/math-series
refs/heads/master
/math_series/series.py
def fibonacci(n): """ Generates the nth Fibonacci series for a given number Arguments: n {integer} -- the number to find the Fibonacci series for Output: The nth Fibbonacci series """ if n == 0: return 0 if n == 1: return 1 if n > 1: ...
{"/tests/test_series.py": ["/math_series/series.py"]}
97,037
maqnius/ml
refs/heads/master
/own_svm/test_own_svm.py
# Copyright (C) 2017 Mark Niehues, Stefaan Hessmann # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
{"/own_svm/test_own_svm.py": ["/own_svm/own_svm.py"], "/own_svm/own_svm.py": ["/own_svm/kernels.py"]}
97,038
maqnius/ml
refs/heads/master
/own_svm/own_svm.py
# Copyright (C) 2017 Mark Niehues, Stefaan Hessmann # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
{"/own_svm/test_own_svm.py": ["/own_svm/own_svm.py"], "/own_svm/own_svm.py": ["/own_svm/kernels.py"]}
97,039
maqnius/ml
refs/heads/master
/own_svm/kernels.py
# Copyright (C) 2017 Mark Niehues, Stefaan Hessmann # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
{"/own_svm/test_own_svm.py": ["/own_svm/own_svm.py"], "/own_svm/own_svm.py": ["/own_svm/kernels.py"]}
97,040
shalei120/neural_cpu
refs/heads/master
/test_ptr_pool_reg.py
import os, time, pickle, copy,sys import numpy as np import tensorflow as tf from random import randint from collections import defaultdict from tensorflow.python.ops import array_ops from tensorflow.contrib.legacy_seq2seq import sequence_loss from ops import l2_loss, weight from utils import progress from ptr_cell ...
{"/test_ptr_pool_reg.py": ["/ops.py"], "/test_ptr_qa.py": ["/ops.py"], "/ptr_cell_1M.py": ["/ops.py"]}
97,041
shalei120/neural_cpu
refs/heads/master
/test_ptr_qa.py
import os, time, pickle, sys import numpy as np import tensorflow as tf from random import randint from tensorflow.python.ops import array_ops from tensorflow.contrib.seq2seq import sequence_loss from ops import l2_loss, weight from utils import progress from data_utils import load_task, vectorize_data from six.moves ...
{"/test_ptr_pool_reg.py": ["/ops.py"], "/test_ptr_qa.py": ["/ops.py"], "/ptr_cell_1M.py": ["/ops.py"]}
97,042
shalei120/neural_cpu
refs/heads/master
/ptr_cell_1M.py
import os import numpy as np import tensorflow as tf from ops import Linear, linear, weight def C(M, length, k, beta): M_norm = tf.sqrt(tf.reduce_sum(tf.square(M), 1, keep_dims=True)) # N * 1 k_norm = tf.sqrt(tf.reduce_sum(tf.square(k), 1, keep_dims=True)) M_dot_k = tf.matmul(M, tf.reshape(k, [-1, ...
{"/test_ptr_pool_reg.py": ["/ops.py"], "/test_ptr_qa.py": ["/ops.py"], "/ptr_cell_1M.py": ["/ops.py"]}
97,043
shalei120/neural_cpu
refs/heads/master
/ops.py
import math import numpy as np import tensorflow as tf from tensorflow.python.ops import array_ops from tensorflow.python.ops import init_ops from tensorflow.python.framework import ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import variable_scope as vs def linear(args, output_size, bia...
{"/test_ptr_pool_reg.py": ["/ops.py"], "/test_ptr_qa.py": ["/ops.py"], "/ptr_cell_1M.py": ["/ops.py"]}
97,044
shalei120/neural_cpu
refs/heads/master
/plot_ptr.py
import matplotlib.pyplot as plt import numpy as np import pickle, sys np.set_printoptions(suppress=True, precision=1, linewidth=200) def pprint(seq): seq = np.array(seq) dim = 1 seq = np.char.mod('%d', np.around(seq)) seq[:, (dim, dim+2, dim+4)] = ' ' print("\n".join(["".join(x) for x in seq.tolis...
{"/test_ptr_pool_reg.py": ["/ops.py"], "/test_ptr_qa.py": ["/ops.py"], "/ptr_cell_1M.py": ["/ops.py"]}
97,047
dharchibald/bandlog
refs/heads/master
/music/admin.py
from django.contrib import admin # Register your models here. from .models import Artist, Membership, Album, Song, Genre, Tag from .models import UserProfile, UserRating, GenreVote, TagVote, Discussion, UserPost admin.site.register(Artist) admin.site.register(Membership) admin.site.register(Album) admin.site.registe...
{"/music/admin.py": ["/music/models.py"], "/music/views.py": ["/music/library.py", "/music/models.py", "/music/forms.py"], "/music/forms.py": ["/music/models.py"]}
97,048
dharchibald/bandlog
refs/heads/master
/music/views.py
import random from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, Http404 from django.db.models import Q from .library import group, pagebreak from .models import * from .forms import * # Create your vi...
{"/music/admin.py": ["/music/models.py"], "/music/views.py": ["/music/library.py", "/music/models.py", "/music/forms.py"], "/music/forms.py": ["/music/models.py"]}
97,049
dharchibald/bandlog
refs/heads/master
/music/library.py
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # Yields a list chunk of size n from list def group(list, n): for i in range(0, len(list), n): yield list[i:i+n] # Takes requested data and breaks it up into a number of pages, # each with n pages def pagebreak(request, data, n): pagi...
{"/music/admin.py": ["/music/models.py"], "/music/views.py": ["/music/library.py", "/music/models.py", "/music/forms.py"], "/music/forms.py": ["/music/models.py"]}
97,050
dharchibald/bandlog
refs/heads/master
/music/forms.py
from django import forms from .models import * class ArtistForm(forms.ModelForm): class Meta: model = Artist fields = ['name', 'from_date', 'to_date', 'country', 'bio', 'img_path'] class BandForm(forms.ModelForm): class Meta: model = Artist fields = ['name', 'members', 'from_date',...
{"/music/admin.py": ["/music/models.py"], "/music/views.py": ["/music/library.py", "/music/models.py", "/music/forms.py"], "/music/forms.py": ["/music/models.py"]}
97,051
dharchibald/bandlog
refs/heads/master
/music/models.py
from django.db import models from django.utils import timezone from django.urls import reverse from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import Conten...
{"/music/admin.py": ["/music/models.py"], "/music/views.py": ["/music/library.py", "/music/models.py", "/music/forms.py"], "/music/forms.py": ["/music/models.py"]}
97,052
dharchibald/bandlog
refs/heads/master
/music/urls.py
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('artist/new', views.artist_create, name='artist_create'), path('artist/<int:artist_id>/', views.artist_detail, name='artist_detail'), path('release/album/<int:album_id>/', views.album_detail, name='album_...
{"/music/admin.py": ["/music/models.py"], "/music/views.py": ["/music/library.py", "/music/models.py", "/music/forms.py"], "/music/forms.py": ["/music/models.py"]}
97,055
fantix/gen3
refs/heads/master
/gen3/cli/config.py
from .. import config def main(args): for key in config.__all__: if not getattr(args, "names", None) or key in args.names: print(f"{key}={getattr(config, key)}")
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,056
fantix/gen3
refs/heads/master
/gen3/init.py
import logging import edgedb from aiohttp import web from . import config log = logging.getLogger(__name__) async def init_db(): log.critical("Creating EdgeDB connection pool...") return await edgedb.create_async_pool( database=config.EDGEDB_DATABASE, user=config.EDGEDB_USER, passw...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,057
fantix/gen3
refs/heads/master
/gen3/dictionary/loader.py
import logging import os from collections import namedtuple from copy import deepcopy from jsonschema import RefResolver, validate from ruamel.yaml import YAML log = logging.getLogger(__name__) ResolverPair = namedtuple("ResolverPair", ["resolver", "source"]) METASCHEMA_PATH = "metaschema.yaml" DEFINITIONS_PATHS = ["...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,058
fantix/gen3
refs/heads/master
/gen3/__init__.py
"""Top-level package for Gen3 Data Commons.""" __author__ = """University of Chicago""" __email__ = "cdis@uchicago.edu" __version__ = "3.2.0"
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,059
fantix/gen3
refs/heads/master
/gen3/peregrine/__init__.py
import logging import os from tartiflette import Engine from tartiflette_aiohttp import register_graphql_handlers from .. import config log = logging.getLogger(__name__) async def init(app): log.critical("Loading GraphQL SDL and install resolvers...") engine = app["engine"] = Engine( os.path.join(...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,060
fantix/gen3
refs/heads/master
/gen3/cli/db.py
from . import with_loop @with_loop def main(args, loop): pass
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,061
fantix/gen3
refs/heads/master
/setup.py
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() requirements = [ "aiohttp", "edgedb", "jsonschema", "ruamel.y...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,062
fantix/gen3
refs/heads/master
/gen3/cli/__init__.py
import argparse import asyncio import logging log = logging.getLogger(__name__) parser = argparse.ArgumentParser() parser.add_argument("--loop", choices=["asyncio", "uvloop"], default="uvloop") subparsers = parser.add_subparsers(dest="command") run = subparsers.add_parser("run") run.add_argument("-H", "--host") run...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,063
fantix/gen3
refs/heads/master
/gen3/config.py
EDGEDB_DATABASE = "gen3" EDGEDB_USER = "gen3" EDGEDB_PASSWORD = "gen3" WEB_HOST = "0.0.0.0" WEB_PORT = 8080 PEREGRINE_PREFIX = "/" PEREGRINE_GRAPHIQL = True __all__ = list( sorted(key for key in globals().keys() if key.isupper() and not key.startswith("_")) ) def _load(): import json import os fo...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,064
fantix/gen3
refs/heads/master
/gen3/cli/dict.py
import glob import json import os import aiohttp from ruamel.yaml import YAML from . import with_loop, log from ..dictionary import loader @with_loop async def main(args, loop): if args.url.startswith("http"): log.critical("Downloading dictionary JSON...") async with aiohttp.ClientSession(loop=l...
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,065
fantix/gen3
refs/heads/master
/gen3/peregrine/resolvers.py
import time from tartiflette import Resolver @Resolver("Query.now") async def resolver_now(parent, args, context, info): print(parent, args, context, info) return str(time.time())
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,066
fantix/gen3
refs/heads/master
/gen3/cli/run.py
from aiohttp import web from . import with_loop from .. import config from .. import init @with_loop def main(args, loop): app = loop.run_until_complete(init.init_web()) web.run_app( app, host=args.host or config.WEB_HOST, port=args.port or config.WEB_PORT )
{"/gen3/cli/config.py": ["/gen3/__init__.py"], "/gen3/init.py": ["/gen3/__init__.py"], "/gen3/peregrine/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/db.py": ["/gen3/cli/__init__.py"], "/gen3/cli/__init__.py": ["/gen3/__init__.py"], "/gen3/cli/dict.py": ["/gen3/cli/__init__.py"], "/gen3/cli/run.py": ["/gen3/cli/__ini...
97,071
HaykInanc/djangoProj1
refs/heads/master
/product/views.py
from django.shortcuts import render from django.http import HttpResponse from .models import * def getProducts(request): data = {} data['goods'] = Good.objects.all() return render(request, 'product/index.html', context=data)
{"/product/views.py": ["/product/models.py"]}
97,072
HaykInanc/djangoProj1
refs/heads/master
/product/models.py
from django.db import models class Sale(models.Model): reason = models.CharField(max_length=128) percent = models.IntegerField() def __str__(self): return '{} => {}'.format(self.reason, self.percent) class Good(models.Model): title = models.CharField(max_length=128) description = models.TextField() price =...
{"/product/views.py": ["/product/models.py"]}
97,076
hristo-vrigazov/CarND-Vehicle-Detection
refs/heads/master
/car_not_car_classifier.py
import os import pickle import time import numpy as np from imutils import paths from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.svm import LinearSVC from utils import extract_features_from_filenames from utils import extract_features_single_image fro...
{"/car_detector.py": ["/car_not_car_classifier.py", "/yolo_object_detector.py"]}
97,077
hristo-vrigazov/CarND-Vehicle-Detection
refs/heads/master
/car_detector.py
import numpy as np from moviepy.editor import VideoFileClip from car_not_car_classifier import CarNotCarClassifier from utils import draw_boxes, get_cars, draw_labeled_bounding_boxes from utils import find_cars_bounding_boxes, create_heatmap import matplotlib.pyplot as plt from yolo_object_detector import YoloObject...
{"/car_detector.py": ["/car_not_car_classifier.py", "/yolo_object_detector.py"]}
97,078
hristo-vrigazov/CarND-Vehicle-Detection
refs/heads/master
/yolo_object_detector.py
from keras.models import model_from_json from utils import draw_boxes import cv2 import numpy as np class YoloObjectDetector: def __init__(self, path_to_architecture='yolo_model.json', path_to_weights='yolo_weights.h5'): print('Reading architecture') with open(path_to_architecture) as json_file: ...
{"/car_detector.py": ["/car_not_car_classifier.py", "/yolo_object_detector.py"]}
97,093
RafaelRani/CRUD-Produtos-Django
refs/heads/master
/produtos/forms.py
#criando um form em django from django.forms import ModelForm from .models import Produto class ProdutoForm(ModelForm): class Meta: model = Produto fields = ['descricao', 'marca', 'preco', 'categoria']
{"/produtos/forms.py": ["/produtos/models.py"], "/produtos/views.py": ["/produtos/models.py", "/produtos/forms.py"], "/produtos/urls.py": ["/produtos/views.py"]}
97,094
RafaelRani/CRUD-Produtos-Django
refs/heads/master
/produtos/views.py
from django.http import HttpResponse from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required # só tem acesso às views se estiver logado from .models import Produto from .forms import ProdutoForm @login_required # só tem acesso a essa view se estiver...
{"/produtos/forms.py": ["/produtos/models.py"], "/produtos/views.py": ["/produtos/models.py", "/produtos/forms.py"], "/produtos/urls.py": ["/produtos/views.py"]}
97,095
RafaelRani/CRUD-Produtos-Django
refs/heads/master
/produtos/urls.py
from django.urls import path from .views import produtos_list, produtos_new, produtos_update, produtos_delete urlpatterns = [ path('list/', produtos_list, name="produtos_list"), path('new/', produtos_new, name="produtos_new"), path('update/<int:id>/', produtos_update, name="produtos_update"), path('de...
{"/produtos/forms.py": ["/produtos/models.py"], "/produtos/views.py": ["/produtos/models.py", "/produtos/forms.py"], "/produtos/urls.py": ["/produtos/views.py"]}
97,096
RafaelRani/CRUD-Produtos-Django
refs/heads/master
/produtos/models.py
from django.db import models class Produto(models.Model): CATEGORIA_CHOICES = ( (1, "Importados"), (2, "Vestuário"), (3, "Acessórios"), (4, "Eletrodomésticos") ) descricao = models.CharField(max_length=100) marca = models.CharField(max_length=100) ...
{"/produtos/forms.py": ["/produtos/models.py"], "/produtos/views.py": ["/produtos/models.py", "/produtos/forms.py"], "/produtos/urls.py": ["/produtos/views.py"]}
97,108
Shanta-Marasini/ShantaMarasini
refs/heads/main
/contact/views.py
from django.shortcuts import render from django.http import HttpResponse from .forms import ContactForm from django.urls import reverse_lazy # Create your views here. def contactme(request): if request.method == 'POST': contact_form = ContactForm(data=request.POST) if contact_form.is_valid(): ...
{"/blog/urls.py": ["/blog/views.py"], "/github/urls.py": ["/github/views.py"], "/github/views.py": ["/github/models.py"]}
97,109
Shanta-Marasini/ShantaMarasini
refs/heads/main
/contact/models.py
from django.db import models # Create your models here. class Contact(models.Model): name = models.CharField(max_length=300) email_address = models.EmailField(max_length=150) message = models.TextField()
{"/blog/urls.py": ["/blog/views.py"], "/github/urls.py": ["/github/views.py"], "/github/views.py": ["/github/models.py"]}