index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
49,513 | nanhua97/python_code | refs/heads/master | /tornado/tornado基础/opt.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.httpserver as t_http
import tornado.options as t_opt
'''
from tornado.options import options,parse_command_line
options.logging = None
parse_command_line()
'''
t_opt.define("port",default=8000,type=int,help="this is the port")
t_opt.d... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,514 | nanhua97/python_code | refs/heads/master | /tornado/tornado模板/static1.py | #coding:utf8
import json
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.options as t_opt
import tornado.httpserver as t_http
from tornado.web import RequestHandler,url,StaticFileHandler
from tornado.options import options,define
import os
define("port",default="8000",type=int,help="this is po... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,515 | nanhua97/python_code | refs/heads/master | /tornado/tornado异步/同步.py | #coding:utf8
def req_a():
print("start_A")
print("A_end")
def req_b():
print("start_B")
print("B_end")
def main():
#模拟tornado框架
req_a()
req_b()
if __name__ == "__main__":
main()
| {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,516 | nanhua97/python_code | refs/heads/master | /django/test2/booktest/views.py | #-*-coding:utf8-*-
from django.shortcuts import render
from .models import *
from django.db.models import Max,F,Q
def index(request):
# list = BookInfo.books2.filter(heroinfo__hcontent__contains='六')
#list = BookInfo.books2.aggregate(Max('pk'))
#list = BookInfo.books2.filter(bread__gt = F('bcommet'))
l... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,517 | nanhua97/python_code | refs/heads/master | /tornado/tornado基础/uri.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.httpserver as t_http
import tornado.options as t_opt
from tornado.web import RequestHandler,url
from tornado.options import options,define
define("port",default=8000,type=int,help="this is the port")
class IndexHandler(RequestHandle... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,518 | nanhua97/python_code | refs/heads/master | /django/test4/booktest/views.py | #-*-coding:utf8-*-
from django.shortcuts import render,redirect
from .models import *
from django.http import HttpResponse
def index(request):
hero = HeroInfo.objects.get(pk=3)
list = HeroInfo.objects.all()
context = {'hero':hero,'list':list}
return render(request,'booktest/index.html',context)
def sh... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,519 | nanhua97/python_code | refs/heads/master | /tornado/tornado基础/defaultHeaderError.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.httpserver as t_http
import tornado.options as t_opt
from tornado.web import RequestHandler,url
from tornado.options import options,define
import json
define("port",default=8000,type=int,help="this is the port")
class IndexHandler(Re... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,520 | nanhua97/python_code | refs/heads/master | /django/test5/booktest/views.py | import os
from django.shortcuts import render
from django.http import HttpResponse,JsonResponse
from django.conf import settings
from .models import *
from django.core.paginator import *
def index(request):
return render(request,'booktest/index.html')
# Create your views here.
def MyExp(request):
a=int('abc')
... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,521 | nanhua97/python_code | refs/heads/master | /django/image/image1.py | from PIL import Image,ImageFilter
im = Image.open('test.jpg')
im2 = im.filter(ImageFilter.BLUR)
im2.save('vlur.jpg','jpeg')
| {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,522 | nanhua97/python_code | refs/heads/master | /learPy/game/heros.py | #! usr/bin/env python3
# -*-coding:utf-8-*-
'heros-1.0'
__author__='nanhua'
import random
class Hero(object):
def __init__(self,usr,pwd):
self.name = usr
self.pwd = pwd
self.hp = 100
def change_Pwd(self):
while True:
old_Pwd = input('please input old password:')
... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,523 | nanhua97/python_code | refs/heads/master | /tornado/安全应用/XSRF.py | #coding:utf8
import tornado.web
import tornado.ioloop
import tornado.httpserver
import tornado.options
from tornado.web import RequestHandler,url
from tornado.options import options,define
define("port",default=8000,type=int,help="this is port")
'''
#127.0.0.1:8000
class IndexHandler(RequestHandler):
def get(self... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,524 | nanhua97/python_code | refs/heads/master | /tornado/tornado基础/application.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.httpserver as t_http
from tornado.options import options,define
from tornado.web import url,RequestHandler
define("port",default=8000,type=int,help="run server on the given port")
class IndexHandler(RequestHandler):
def get(self... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,525 | nanhua97/python_code | refs/heads/master | /tornado/安全应用/XSRF2.py | #coding:utf8
import tornado.web
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.web import RequestHandler,StaticFileHandler,url
from tornado.options import options,define
import os
define("port",default="8000",type=int,help="this is the port")
class XSRFTokenHandler(RequestHandler)... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,526 | nanhua97/python_code | refs/heads/master | /django/test3/booktest/urls.py | from django.conf.urls import url
from . import views
urlpatterns=[
url(r'^$',views.index,name='index'),
url(r'^\(\d+\)$',views.test),
#url(r'^(\d+)$',views.detail),
url(r'^abc/(?P<num>\d+)/$',views.detail),
url(r'^(\d+)/(\d+)/(\d+)$',views.arg),
url(r'^(?P<p2>\d+)/(?P<p1>\d+)$',views.kwarg),
... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,527 | nanhua97/python_code | refs/heads/master | /tornado/exercise/application.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.options as t_opt
import tornado.httpserver as t_http
from tornado.web import RequestHandler,url
from tornado.options import options,define
import json
define("port",default=8000,type=int,help="this is port")
class BaseHandler(Request... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,528 | nanhua97/python_code | refs/heads/master | /tornado/安全应用/XSRF1.py | #coding:utf8
import tornado.web
import tornado.httpserver
import tornado.options
import tornado.ioloop
import os
from tornado.web import RequestHandler,url,StaticFileHandler
class IndexHandler(RequestHandler):
def get(self):
self.render("index2.html")
def post(self):
print(self.request.headers[... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,529 | nanhua97/python_code | refs/heads/master | /django/image/paint.py | from PIL import Image,ImageDraw,ImageFont,ImageFilter
import random
def rndChar():
return chr(random.randint(65,90))
def rndColor():
return (random.randint(64,255),random.randint(64,255),random.randint(64,255))
def rndColor2():
return (random.randint(37,127),random.randint(37,127),random.randint(37,127))
wi... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,530 | nanhua97/python_code | refs/heads/master | /tiantian/df_user/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from models import *
from django.http import JsonResponse,HttpResponse,HttpResponseRedirect
from django.shortcuts import render,redirect
from hashlib import sha1
# Create your views here.
def register(req):
return render(req,'df_user/regist... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,531 | nanhua97/python_code | refs/heads/master | /blog/app/urls.py | from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
# url(r'admin/',admin.site.urls),
url(r'base/',views.base),
url(r'toRegister/',views.toRegister),
url(r'toLogin/',views.toLogin),
url(r'login/',views.login),
]
| {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,532 | nanhua97/python_code | refs/heads/master | /learPy/zou/qd.py | #!/usr/bin/env/python3
# -*- coding:utf-8 -*-
import requests
from bs4 import BeautifulSoup
headers={
'UserAgent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'
}
total=[]
for i in range(1,11):
url='https://www.qidian.com/rank/yuepiao?... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,533 | nanhua97/python_code | refs/heads/master | /django/test4/booktest/models.py | from django.db import models
class BookInfo(models.Model):
btitle = models.CharField(max_length = 20)
bpub_date = models.DateTimeField(db_column = 'pub_date')
bread = models.IntegerField(default=0)
bcommet = models.IntegerField(default=0)
isDelete = models.BooleanField(default = False)
class Me... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,534 | nanhua97/python_code | refs/heads/master | /django/test5/booktest/urls.py | from django.conf.urls import url
from . import views
urlpatterns=[
url(r'^$',views.index),
url(r'^myexp$',views.MyExp),
url(r'^uploadpic$',views.uploadPic),
url(r'^uploadHandle$',views.uploadHandle),
url(r'^herolist(\d*)/$',views.herolist),
url(r'^area$',views.getArea),
url(r'^area1/$',view... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,535 | nanhua97/python_code | refs/heads/master | /tornado/tornado基础/argument.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.httpserver as t_http
import tornado.options as t_opt
from tornado.web import RequestHandler
from tornado.options import options,define
define("port",default=8000,type=int,help="this is the port")
class IndexHandler(RequestHandler):
... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,536 | nanhua97/python_code | refs/heads/master | /tornado/tornado模板/static2.py | #coding:utf8
import json
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.options as t_opt
import tornado.httpserver as t_http
from tornado.web import RequestHandler,url,StaticFileHandler
from tornado.options import options,define
import os
define("port",default="8000",type=int,help="this is po... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,537 | nanhua97/python_code | refs/heads/master | /tornado/tornado基础/prepare.py | #coding:utf8
import tornado.web as t_web
import tornado.ioloop as t_io
import tornado.httpserver as t_http
import tornado.options as t_opt
from tornado.web import RequestHandler,url
from tornado.options import options,define
import json
define("port",default=8000,type=int,help="this is the port")
class IndexHandler(Re... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,538 | nanhua97/python_code | refs/heads/master | /tornado/tornado异步/asyc.py | #coding:utf8
import tornado
import tornado.web
import tornado.ioloop as t_io
import tornado.options as t_opt
import tornado.httpserver as t_http
from tornado.web import RequestHandler,url
from tornado.options import options,define
import json
define("port",default=8000,type=int,help="this is port")
class IndexHandler(... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,539 | nanhua97/python_code | refs/heads/master | /tornado/安全应用/current_user.py | #coding:utf8
import tornado.web
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.web import RequestHandler,StaticFileHandler,url
from tornado.options import options,define
import os
define("port",default="8000",type=int,help="this is the port")
class ProfileHandler(RequestHandler):
... | {"/django/test5/booktest/search_indexes.py": ["/django/test5/booktest/models.py"], "/django/test4/booktest/views.py": ["/django/test4/booktest/models.py"], "/django/test5/booktest/views.py": ["/django/test5/booktest/models.py"]} |
49,548 | mericadil/TextureGeneration | refs/heads/master | /dataset/deprecated/chictopia_plus.py | import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from dataset.data_utils import ToTensor, Resize
class ChictopiaPlusDataset(Dataset):
def bbox(self, mask):
rows = np.any(mask, axis=0)
cols = np.any(mask, axis=1)
cmin, cmax = np.where(rows)[0][[0, -1]]
... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,549 | mericadil/TextureGeneration | refs/heads/master | /deprecated/texture_reid.py | # -*- coding:utf-8 -*-
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from dataset.depreciated.background import BackgroundDataset
from dataset.real_texture import RealTextureDataset
from torch.optim import Adam
from config import get_config
from tensorboard_logger import configure, log_va... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,550 | mericadil/TextureGeneration | refs/heads/master | /dataset/market1501_pose_split_test.py | from __future__ import print_function, absolute_import
import glob
import re
from os import path as osp
import numpy as np
import pdb
import cv2
from torch.utils.data import Dataset
import pickle
class Market1501Dataset(object):
"""
Market1501
Reference:
Zheng et al. Scalable Person Re-identification... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,551 | mericadil/TextureGeneration | refs/heads/master | /deprecated/create_uvmap_textured.py | import torch
import cv2
import argparse
import numpy as np
import os
import sys
import tqdm
import os
import torch.nn as nn
import time
import random
from torch.autograd import Function
import os
from dataset.market1501_pose_split_test import Market1501Dataset
class DifferentialTextureRenderer(Function):
@stat... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,552 | mericadil/TextureGeneration | refs/heads/master | /dataset/deprecated/background.py |
import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from dataset.data_utils import ToTensor, RandomCrop, RandomFlip, Resize
import tqdm
class BackgroundDataset(Dataset):
def __getitem__(self, index):
texture_img_path = self.data[index]
texture_img = cv2.imread(texture... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,553 | mericadil/TextureGeneration | refs/heads/master | /save_UVmaps.py | from NMR.neural_render_test import NrTextureRenderer
import torch
import cv2
import argparse
import numpy as np
import os.path as osp
import pickle
from tqdm import tqdm
class Saver:
def __init__(self, model_path, data_dir, output_path):
print(model_path)
self.model = torch.load(model_path, map_lo... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,554 | mericadil/TextureGeneration | refs/heads/master | /loss/color_var_loss.py | import torch.nn as nn
import torch
# 无用
class ClothesColorVarLoss(nn.Module):
def forward(self, image):
total_var = 0
for i, item in enumerate(image):
for j, channel in enumerate(item):
up_channel = channel[self.short_up_mask[i, j]]
trouser_channel = cha... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,555 | mericadil/TextureGeneration | refs/heads/master | /network_models/depreciated/vanilla_gan.py | import numpy as np
import torch
from torch import nn
from torchvision.models import resnet, vgg
def conv3x3(in_planes, out_planes, stride=1, padding=1, has_bias=False):
"3x3 convolution with padding"
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=padding, bi... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,556 | mericadil/TextureGeneration | refs/heads/master | /loss/PCB_softmax_loss.py | # -*- coding:utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torchvision.transforms.functional import normalize
import os
from .resnet_market1501 import resnet50
import sys
# ReID Loss
class ReIDLoss(nn.Module):
def __init__(self, model_path, num_... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,557 | mericadil/TextureGeneration | refs/heads/master | /loss/PCB_intern_loss.py | # -*- coding:utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torchvision.transforms.functional import normalize
import os
from .resnet_market1501 import resnet50
import sys
# ReID Loss
class ReIDLoss(nn.Module):
def __init__(self, model_path,... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,558 | mericadil/TextureGeneration | refs/heads/master | /dataset/real_texture.py | import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from .data_utils import ToTensor
import tqdm
class RealTextureDataset(Dataset):
def __getitem__(self, index):
texture_img_path = self.data[index]
texture_img = cv2.imread(texture_img_path)
texture_img = cv2.r... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,559 | mericadil/TextureGeneration | refs/heads/master | /utils/body_part_mask.py | import os
import torch
import cv2
import numpy as np
class TextureMask:
def __init__(self, size):
if isinstance(size, int):
self.size = (size, size)
else:
self.size = size
self.part = {
'face': 'models/face_mask.png',
'hand': 'models/hand_mas... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,560 | mericadil/TextureGeneration | refs/heads/master | /deprecated/get_render_matrix.py | import numpy as np
import pickle
import os
import cv2
import torch
from smpl.render_texture import Renderer
action_files = [
# '104/104_09.pkl', # run
'104/104_19.pkl', # walk
'39/39_14.pkl', # walk
# '36/36_32.pkl' # up stairs
]
result = []
rotate_total_div = 8
def sparse_mx_to_torch_sparse_t... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,561 | mericadil/TextureGeneration | refs/heads/master | /loss/PCB_MiddleFeature.py | # -*- coding:utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torchvision.transforms.functional import normalize
import os
from .resnet_market1501 import resnet50
import sys
# ReID Loss
class ReIDLoss(nn.Module):
def __init__(self, model_path,... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,562 | mericadil/TextureGeneration | refs/heads/master | /network_models/depreciated/lsgan.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class Generator_(nn.Module):
def __init__(self, nz, nChannels, ngf=64):
super(Generator_, self).__init__()
# input : z
# Generator will be consisted with a series of deconvolution netwo... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,563 | mericadil/TextureGeneration | refs/heads/master | /metrics/inception_score.py | import glob
import os
import pickle
import re
from os import path as osp
import numpy as np
import torch
import tqdm
from scipy.stats import entropy
from torch import nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torchvision.models.inception import inception_v3
from dataset.mark... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,564 | mericadil/TextureGeneration | refs/heads/master | /misc/background_index_generator.py | import os
import numpy
dir_list = [
'/unsullied/sharefs/wangjian02/isilon-home/datasets/PRW/frames',
'/unsullied/sharefs/wangjian02/isilon-home/datasets/CUHK-SYSU'
]
result = []
for dir_path in dir_list:
for root, dirs, files in os.walk(dir_path):
for name in files:
if name.endswith('.jp... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,565 | mericadil/TextureGeneration | refs/heads/master | /smpl/render_texture.py | # Create renderer
import chumpy as ch
import numpy as np
from opendr.renderer import TexturedRenderer, ColoredRenderer
# Assign attributes to renderer
from get_body_mesh import get_body_mesh
from opendr.camera import ProjectPoints
from smpl_webuser.serialization import load_model
import cv2
from scipy.sparse import csc... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,566 | mericadil/TextureGeneration | refs/heads/master | /models/baseline_model.py | # encoding: utf-8
"""
@author: liaoxingyu
@contact: xyliao1993@qq.com
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import itertools
import torch.nn.functional as F
from torch import nn
from .resnet import Re... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,567 | mericadil/TextureGeneration | refs/heads/master | /demo.py | from NMR.neural_render_test import NrTextureRenderer
import torch
import cv2
import argparse
import numpy as np
import os
import pickle
class Demo:
def __init__(self, model_path):
print(model_path)
self.model = torch.load(model_path, map_location='cpu')
self.model.eval()
def generate... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,568 | mericadil/TextureGeneration | refs/heads/master | /utils/data_loader.py | from __future__ import print_function, absolute_import
from dataset.data_utils import ToTensor, Resize
import cv2
from torch.utils.data import Dataset
import os
import numpy as np
def read_image(img_path):
"""Keep reading image until succeed.
This can avoid IOError incurred by heavy IO process."""
got_i... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,569 | mericadil/TextureGeneration | refs/heads/master | /loss/PCB_AllCat.py | # -*- coding:utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torchvision.transforms.functional import normalize
import os
from .resnet_market1501 import resnet50
import sys
# ReID Loss
class ReIDLoss(nn.Module):
def __init__(self, model_path,... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,570 | mericadil/TextureGeneration | refs/heads/master | /config.py | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from absl import flags
# ------------------------------modify this to your own data path--------------------------------------------
# path of pretrained re-id weight network
... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,571 | mericadil/TextureGeneration | refs/heads/master | /dataset/deprecated/market1501_filename.py | import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from dataset.data_utils import ToTensor, RandomCrop, RandomFlip, Resize
# 读图和读文件名(包含id)
class Market1501Dataset(Dataset):
def __getitem__(self, index):
texture_img_path = self.data[index]
texture_img = cv2.imread(textu... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,572 | mericadil/TextureGeneration | refs/heads/master | /misc/noface_after_process.py | import os
from utils.body_part_mask import TextureMask
import cv2
import numpy as np
texture_mask = TextureMask(size=64)
face_mask = texture_mask.get_numpy_mask('face')
hand_mask = texture_mask.get_numpy_mask('hand')
mask = face_mask + hand_mask
uv_map_path = '/home/wangjian02/Projects/TextureGAN/tmp/test_img/uv_no_f... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,573 | mericadil/TextureGeneration | refs/heads/master | /metrics/ssim_score.py | from PIL import Image
from torch.utils.data import Dataset
import glob
import re
from os import path as osp
import numpy as np
import pdb
import os
import cv2
from pytorch_ssim_master import pytorch_ssim
import torch
from torch.autograd import Variable
import tqdm
from multiprocessing import Pool
def process_dir(dir... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,574 | mericadil/TextureGeneration | refs/heads/master | /smpl/diff_renderer_setted.py | # import torch
import cv2
import numpy as np
import torch
import torch.nn as nn
import time
import random
from torch.autograd import Function
import os
import tqdm
class DifferentialTextureRenderer(Function):
@staticmethod
def forward(ctx, texture_img_flat, render_sparse_matrix):
result = torch.mm(ren... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,575 | mericadil/TextureGeneration | refs/heads/master | /dataset/deprecated/market1501.py | # -*- coding:utf-8 -*-
import os
import cv2
import numpy as np
from torch.utils.data import Dataset
import pickle
import nori2 as nori
from dataset.data_utils import ToTensor, RandomCrop, RandomFlip, Resize
from utils.imdecode import imdecode
from numpy.random import RandomState
# 读图
class Market1501Dataset(Dataset... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,576 | mericadil/TextureGeneration | refs/heads/master | /dataset/deprecated/prw.py | # -*- coding:utf-8 -*-
import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from scipy.io import loadmat
from dataset.data_utils import ToTensor, RandomCrop, RandomFlip, Resize
import pickle
import nori2 as nori
from utils.imdecode import imdecode
from numpy.random import RandomState
# 读图,把图中的... | {"/deprecated/texture_reid.py": ["/dataset/real_texture.py", "/config.py", "/utils/body_part_mask.py", "/utils/data_loader.py", "/loss/PCB_intern_loss.py", "/loss/PCB_MiddleFeature.py", "/loss/PCB_softmax_loss.py", "/loss/PCB_AllCat.py"], "/deprecated/create_uvmap_textured.py": ["/dataset/market1501_pose_split_test.py"... |
49,578 | yoongyo/bizchoolup | refs/heads/master | /ch1/blog/forms.py | from django import forms
from .models import Post
from froala_editor.widgets import FroalaEditor
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['category', 'title', 'content']
widgets = {
'content': FroalaEditor(),
'category': forms.Select(
... | {"/ch1/blog/forms.py": ["/ch1/blog/models.py"], "/ch1/blog/views.py": ["/ch1/blog/models.py", "/ch1/blog/forms.py"], "/ch1/mysite/config/settings/debug.py": ["/ch1/mysite/config/settings/base.py"]} |
49,579 | yoongyo/bizchoolup | refs/heads/master | /ch1/blog/views.py | import os
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic import TemplateView
from . models import Post,Category
from .forms import PostForm
def category_list(request):
qs1 = Category.objects.all()
return render(request, 'blog/category_list.html', {
'category... | {"/ch1/blog/forms.py": ["/ch1/blog/models.py"], "/ch1/blog/views.py": ["/ch1/blog/models.py", "/ch1/blog/forms.py"], "/ch1/mysite/config/settings/debug.py": ["/ch1/mysite/config/settings/base.py"]} |
49,580 | yoongyo/bizchoolup | refs/heads/master | /ch1/mysite/config/settings/base.py | import os
import uuid
from datetime import datetime
import json
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
BASE1_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(os.path.dirn... | {"/ch1/blog/forms.py": ["/ch1/blog/models.py"], "/ch1/blog/views.py": ["/ch1/blog/models.py", "/ch1/blog/forms.py"], "/ch1/mysite/config/settings/debug.py": ["/ch1/mysite/config/settings/base.py"]} |
49,581 | yoongyo/bizchoolup | refs/heads/master | /ch1/mysite/urls.py | from django.conf.urls import url,include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^froala_editor/', include('froala_editor.urls')),
url(r'^', include('blog.urls', namespace='blog')),
]
from django.conf import settings
from django.conf.urls.static import stat... | {"/ch1/blog/forms.py": ["/ch1/blog/models.py"], "/ch1/blog/views.py": ["/ch1/blog/models.py", "/ch1/blog/forms.py"], "/ch1/mysite/config/settings/debug.py": ["/ch1/mysite/config/settings/base.py"]} |
49,582 | yoongyo/bizchoolup | refs/heads/master | /ch1/blog/models.py | from django.db import models
from django.shortcuts import reverse
from froala_editor.fields import FroalaField
class Category(models.Model):
name = models.CharField(max_length=20)
def __str__(self):
return self.name
class Post(models.Model):
category = models.ForeignKey(Category)
title = mode... | {"/ch1/blog/forms.py": ["/ch1/blog/models.py"], "/ch1/blog/views.py": ["/ch1/blog/models.py", "/ch1/blog/forms.py"], "/ch1/mysite/config/settings/debug.py": ["/ch1/mysite/config/settings/base.py"]} |
49,583 | yoongyo/bizchoolup | refs/heads/master | /ch1/mysite/config/settings/debug.py | from .base import *
config_secret_debug = json.loads(open(CONFIG_SECRET_DEBUG_FILE).read())
DEBUG = True
ALLOWED_HOSTS = config_secret_debug['django']['allowed_hosts']
# WSGI application
WSGI_APPLICATION = 'mysite.config.wsgi.debug.application'
DATABASES = {
'default': {
'ENGINE': 'django.db... | {"/ch1/blog/forms.py": ["/ch1/blog/models.py"], "/ch1/blog/views.py": ["/ch1/blog/models.py", "/ch1/blog/forms.py"], "/ch1/mysite/config/settings/debug.py": ["/ch1/mysite/config/settings/base.py"]} |
49,584 | saurabhpatil/coursemate | refs/heads/master | /tests/test.py | import model
import unittest
import requests
class AppTestCases(unittest.TestCase):
def setUp(self):
self.con = model.connect_database()
def tearDown(self):
self.con.close()
###------------------ TEST CASES FOR MODEL -----------------------###
def test_get_courses(self):
curs... | {"/tests/test.py": ["/model.py"], "/routes.py": ["/model.py"]} |
49,585 | saurabhpatil/coursemate | refs/heads/master | /routes.py | from flask import Flask, request, json, render_template
from model import Model
# Create a flask app and configure it
app = Flask(__name__)
app.config.from_object('config')
@app.route('/', methods=['GET'])
def course_search():
'''Get the list of courses and their information '''
course_id = request.args.get(... | {"/tests/test.py": ["/model.py"], "/routes.py": ["/model.py"]} |
49,586 | saurabhpatil/coursemate | refs/heads/master | /model.py | from config import *
import MySQLdb as mdb
import json
def connect_database():
'''Returns a connection to database'''
try:
con = mdb.connect(os.environ.get('SQL_DATABASE_URI'), SQL_DATABASE_USER, \
SQL_DATABASE_PASS, SQL_DATABASE_SCHEMA, \
use_unicode... | {"/tests/test.py": ["/model.py"], "/routes.py": ["/model.py"]} |
49,608 | lukedeboer/FoodViolation-Python | refs/heads/master | /DbConnect.py | import sqlite3
class DbConnect:
def __init__(self):
self._db = sqlite3.connect("assignment2.db")
self._db.row_factory = sqlite3.Row
self._db.execute(
"create table if not exists "
"violations(ID integer primary key autoincrement,"
"points int,"... | {"/excel_food.py": ["/DbConnect.py"], "/sql_food.py": ["/DbConnect.py"], "/numpy_food.py": ["/DbConnect.py"], "/createdb_food.py": ["/DbConnect.py"]} |
49,609 | lukedeboer/FoodViolation-Python | refs/heads/master | /excel_food.py | from DbConnect import DbConnect
import xlsxwriter
class ExcelFood(DbConnect):
def __init__(self):
self.import_violations()
@staticmethod
def import_violations():
# Getting group by violation code
connect = DbConnect()
cursor = connect.group_by_violations()
... | {"/excel_food.py": ["/DbConnect.py"], "/sql_food.py": ["/DbConnect.py"], "/numpy_food.py": ["/DbConnect.py"], "/createdb_food.py": ["/DbConnect.py"]} |
49,610 | lukedeboer/FoodViolation-Python | refs/heads/master | /sql_food.py | from DbConnect import DbConnect
class SqlFood(DbConnect):
def __init__(self):
self.get_violations()
@staticmethod
def get_violations():
# Getting distinct violation
connect = DbConnect()
cursor = connect.distinct_violations()
for item in cursor:
... | {"/excel_food.py": ["/DbConnect.py"], "/sql_food.py": ["/DbConnect.py"], "/numpy_food.py": ["/DbConnect.py"], "/createdb_food.py": ["/DbConnect.py"]} |
49,611 | lukedeboer/FoodViolation-Python | refs/heads/master | /numpy_food.py | import matplotlib.pyplot as plt
from DbConnect import DbConnect
class NumpyFood(DbConnect):
def __init__(self):
self.generate_pivot()
@staticmethod
def generate_pivot():
connect = DbConnect()
all_violations = connect.violations_per_month()
# highest_violations ... | {"/excel_food.py": ["/DbConnect.py"], "/sql_food.py": ["/DbConnect.py"], "/numpy_food.py": ["/DbConnect.py"], "/createdb_food.py": ["/DbConnect.py"]} |
49,612 | lukedeboer/FoodViolation-Python | refs/heads/master | /createdb_food.py | import xlrd
from xlrd import xldate_as_tuple
from datetime import datetime
from DbConnect import DbConnect
class CreateDbFood(DbConnect):
def __init__(self):
self.import_violations()
self.import_inspections()
@staticmethod
def import_violations():
print("\n=========... | {"/excel_food.py": ["/DbConnect.py"], "/sql_food.py": ["/DbConnect.py"], "/numpy_food.py": ["/DbConnect.py"], "/createdb_food.py": ["/DbConnect.py"]} |
49,614 | kosciej16/jfh | refs/heads/master | /jfh.py | #!/usr/bin/python3
import argparse
from jf_parser import JenkinsFileParser
from helper import JenkinsFileHelper
def configure_argparse():
parser = argparse.ArgumentParser(description='Script to help manage JenkinsfIles')
parser.add_argument('-f', '--filename', dest='filename', default='Jenkinsfile')
# ... | {"/jfh.py": ["/jf_parser.py", "/helper.py"]} |
49,615 | kosciej16/jfh | refs/heads/master | /jf_parser.py | import fileinput
import json
from pyparsing import (
Forward,
Group,
Suppress,
Word,
alphanums,
delimitedList,
quotedString,
originalTextFor,
nestedExpr,
SkipTo,
Literal,
removeQuotes,
LineStart,
Optional,
)
class JenkinsFileParser:
STAGE_KEY = 'stage'
... | {"/jfh.py": ["/jf_parser.py", "/helper.py"]} |
49,616 | kosciej16/jfh | refs/heads/master | /stage_tracker.py | import attr
from jenkinsfile.jf_parser import JenkinsFileParser
@attr.s(hash=True)
class Stage:
name = attr.ib()
is_commented = attr.ib()
children = attr.ib(factory=list)
id = attr.ib(default='-1')
parent = attr.ib(default=None)
def add_child(self, stage):
stage.parent = self
... | {"/jfh.py": ["/jf_parser.py", "/helper.py"]} |
49,617 | kosciej16/jfh | refs/heads/master | /helper.py | from jenkinsfile.jf_parser import JenkinsFileParser
from jenkinsfile.stage_tracker import StageTracker
class JenkinsFileHelper:
def __init__(self, parser):
self.parser = parser
self.filename = parser.filename
self.stage_tracker = StageTracker(parser)
def process_stage_by_id(self, sta... | {"/jfh.py": ["/jf_parser.py", "/helper.py"]} |
49,619 | LaOriana/knit-along | refs/heads/main | /crud.py | """CRUD operations."""
from model import db, User, Event, EventOwner, EventAttended, Post, connect_to_db
# add images to static file
def create_user(username, email, password, image):
"""Create and return a new user."""
user = User(username=username, email=email, password=password, image=image)
db.sessi... | {"/crud.py": ["/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/model.py": ["/server.py"], "/seed_database.py": ["/crud.py", "/model.py", "/server.py"]} |
49,620 | LaOriana/knit-along | refs/heads/main | /server.py | """Server for knit-along app."""
from flask import (Flask, render_template, request, flash, session, redirect)
from model import connect_to_db
from crud import (get_user_by_email, create_user)
import model
import os
import crud
app = Flask(__name__)
# need to run source secrets.sh for this to work
app.secret_key = os... | {"/crud.py": ["/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/model.py": ["/server.py"], "/seed_database.py": ["/crud.py", "/model.py", "/server.py"]} |
49,621 | LaOriana/knit-along | refs/heads/main | /model.py | from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class User(db.Model):
"""A user."""
__tablename__ = 'users'
# Is nullable needed for primary key?
# No, bc it's already not nullable
# Should email character limit be 64 or 320?
# The [user] section can be a maximum of 64 ch... | {"/crud.py": ["/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/model.py": ["/server.py"], "/seed_database.py": ["/crud.py", "/model.py", "/server.py"]} |
49,622 | LaOriana/knit-along | refs/heads/main | /seed_database.py | """Script to seed database."""
import os
# don't need this now
# import json
import crud
import model
import server
os.system('dropdb knitalong')
os.system('createdb knitalong')
model.connect_to_db(server.app)
model.db.create_all()
| {"/crud.py": ["/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/model.py": ["/server.py"], "/seed_database.py": ["/crud.py", "/model.py", "/server.py"]} |
49,641 | apollinemeyss/Poulpe-Defender | refs/heads/master | /tirs_invaders.py | import pygame
from pygame.locals import*
#creation classe tirs des invaders
class Tir_Inv:
def __init__(self,pygame,x,y):
self.pygame = pygame
self.tir = self.pygame.image.load("tir_inv.png")
self.position = self.tir.get_rect()
self.position.center = x,y
def descendre(... | {"/main.py": ["/poulpe.py", "/invaders.py", "/tir.py", "/tirs_invaders.py"]} |
49,642 | apollinemeyss/Poulpe-Defender | refs/heads/master | /tir.py | import pygame
from pygame.locals import*
#creation classe tir
class Tir:
def __init__(self,pygame,x,y):
self.pygame = pygame
self.tir = self.pygame.image.load("tir.png")
self.position = self.tir.get_rect()
self.position.center = x,y
def monter(self):
self.positi... | {"/main.py": ["/poulpe.py", "/invaders.py", "/tir.py", "/tirs_invaders.py"]} |
49,643 | apollinemeyss/Poulpe-Defender | refs/heads/master | /main.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from poulpe import Poulpe
from invaders import Invaders
from tir import Tir
from tirs_invaders import Tir_Inv
#on a importé tous les objets/classes et leurs fonctions associées
import pygame
import random
from pygame.locals import *
# Initialisation de pygame et des variab... | {"/main.py": ["/poulpe.py", "/invaders.py", "/tir.py", "/tirs_invaders.py"]} |
49,644 | apollinemeyss/Poulpe-Defender | refs/heads/master | /poulpe.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
# Creation classe poulpe
class Poulpe:
# fonction d'initialisation, lancée lors de la création
def __init__(self,pygame,x,y):
self.pygame = pygame
self.poulpe = self.pygame.image.load("poulpe.png").convert_a... | {"/main.py": ["/poulpe.py", "/invaders.py", "/tir.py", "/tirs_invaders.py"]} |
49,645 | apollinemeyss/Poulpe-Defender | refs/heads/master | /invaders.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
# Creation classe invaders
class Invaders:
# fonction d'initialisation, lancé lors de la création
def __init__(self,pygame,x,y,couleur):
self.pygame = pygame
if couleur == "verts":
self.invaders ... | {"/main.py": ["/poulpe.py", "/invaders.py", "/tir.py", "/tirs_invaders.py"]} |
49,677 | elipugh/aa222_project | refs/heads/master | /optimizers/differential_evolution.py | from __future__ import division
import numpy as np
from copy import copy
import scipy.optimize as sp
class Differential_Evolution_Optimizer():
def __init__(self, f, bounds, n, reps=1, args=(), popsize=5):
self.args = args
self.reps = reps
self.f = f
self.bounds = bounds
self... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,678 | elipugh/aa222_project | refs/heads/master | /parameterizations/naca_parsec_mix.py | from __future__ import division
import numpy as np
import math
from parameterizations.naca import Airfoil as NacaAirfoil
from parameterizations.parsec import Airfoil as ParsecAirfoil
class Airfoil(object):
def __init__(self, params):
self.naca_params = params[0:1]
self.parsec_params = params[1:7]
... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,679 | elipugh/aa222_project | refs/heads/master | /parameterizations/helpers.py | from __future__ import division
import numpy as np
def fn_2_dat(filename, upper, lower):
# get a grid of points approximating
# the upper and lower edge of the foil
x = np.linspace(0.0, 1.0, 100)
foil_up = upper(x)
foil_lo = lower(x)
topmax = np.max(foil_up)
# to appease UCI regulation
... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,680 | elipugh/aa222_project | refs/heads/master | /xfoil/xfoil.py | import subprocess as subp
import psutil
import numpy as np
import os
import sys
import re
import time
import random
import sys
# Evaluate the different characteristics
# of an airfoil
# Hyperparams I chose ... maybe changed later:
# - Reynolds number set to 38k
# - Mach number set to 0.03
# - Max 10k iterations
... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,681 | elipugh/aa222_project | refs/heads/master | /parameterizations/naca.py | from __future__ import division
import numpy as np
import math
class Airfoil(object):
def __init__(self, params):
self.truncation = params[0]
self.thickness = 1
def Z_up(self, X):
X = X * self.truncation
t = self.thickness
foil = 5*t * (.2969*np.sqrt(X) - .1260*X - .351... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,682 | elipugh/aa222_project | refs/heads/master | /results/filter.py | import os
design_points = []
objectives = []
i = 0
with open("results3.txt", "r") as f:
for l in f:
if l is not None:
l = l.replace(",", " ")
l = l.replace("[", " ")
l = l.replace("]", " ")
l = l.replace(":", " ")
r = l.split()
if r[0]... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,683 | elipugh/aa222_project | refs/heads/master | /run.py | import numpy as np
from xfoil import xfoil
import os
import random
from datetime import datetime
from parameterizations.helpers import fn_2_dat
from parameterizations.naca import Airfoil as NacaAirfoil
from parameterizations.parsec import Airfoil as ParsecAirfoil
from parameterizations.naca_parsec_mix import Airfoil a... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,684 | elipugh/aa222_project | refs/heads/master | /optimizers/fib.py | from __future__ import division
import numpy as np
from copy import copy
class Fib_Optimizer():
def __init__(self, f, x0, n, a, b, reps=4, args=()):
self.args = args
self.reps = reps
self.f = f
self.x0 = x0
self.n = n
self.a = np.array([a])
self.b = np.array(... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,685 | elipugh/aa222_project | refs/heads/master | /optimizers/nelder_mead.py | from __future__ import division
import numpy as np
from copy import copy
import scipy.optimize as sp
class Nelder_Mead_Optimizer():
def __init__(self, f, x0, n, reps=1, args=()):
self.args = args
self.reps = reps
self.f = f
self.x0 = x0
self.nit = n
self.optimize()
... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,686 | elipugh/aa222_project | refs/heads/master | /parameterizations/inter.py | from __future__ import division
import numpy as np
import math
from scipy.interpolate import interp1d
class Airfoil(object):
def __init__(self, params):
params = np.array(params)
self.x = params[0]
self.y = np.zeros(params.shape[1])
for i in range(1,self.y.size):
... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,687 | elipugh/aa222_project | refs/heads/master | /parameterizations/parsec.py | from __future__ import division
import numpy as np
import math
class Parameters(object):
'''Parameters defining a PARSEC airfoil'''
def __init__(self, x):
if x.shape > (6,):
print("5 or 6d np array expected")
front_radius = x[0]
x_cross_section = x[1]
... | {"/parameterizations/naca_parsec_mix.py": ["/parameterizations/naca.py", "/parameterizations/parsec.py"], "/run.py": ["/parameterizations/helpers.py", "/parameterizations/naca.py", "/parameterizations/parsec.py", "/parameterizations/naca_parsec_mix.py", "/parameterizations/inter.py", "/optimizers/fib.py", "/optimizers/... |
49,688 | eightys3v3n/calculator | refs/heads/master | /calculator/__init__.py | from .main import *
from . import finance
| {"/calculator/__init__.py": ["/calculator/main.py"], "/calculator/main.py": ["/calculator/__init__.py", "/calculator/finance.py"]} |
49,689 | eightys3v3n/calculator | refs/heads/master | /calculator/finance.py | import unittest
import logging
import locale
# for number formatting
import sympy
# for equation rearranging
global FORMULAS
FORMULAS = {}
# contains all the cached function rearrangements
RESULT_PRECISION = 4 # How many decimals should we round results from formulas to
def num_format(num):
"""Format a number... | {"/calculator/__init__.py": ["/calculator/main.py"], "/calculator/main.py": ["/calculator/__init__.py", "/calculator/finance.py"]} |
49,690 | eightys3v3n/calculator | refs/heads/master | /calculator/main.py | import unittest
import logging
import math
from math import sqrt, pow
# sqrt()
# pow()
import locale
# for number formatting
import sympy
# for equation rearranging
import statistics
from statistics import stdev
# stdev(arr) for std deviation
from . import finance
from .finance import tmv,num_format
# a number of ... | {"/calculator/__init__.py": ["/calculator/main.py"], "/calculator/main.py": ["/calculator/__init__.py", "/calculator/finance.py"]} |
49,692 | bigdatasciencegroup/flightr-project | refs/heads/master | /Twitter/TwitterService.py | """Main twitter services"""
from Twitter.twitterAdapter import TwitterAdaptor
class TwitterService(object):
"""Methods used by service layer"""
@staticmethod
def send_notification(twitter_handle, message):
adapter = TwitterAdaptor()
message_to_send = twitter_handle + ' ' + message
... | {"/Twitter/TwitterService.py": ["/Twitter/twitterAdapter.py"], "/Flightaware/flightawareService.py": ["/Flightaware/models.py", "/Flightaware/restAdapter.py"], "/Presentation/views.py": ["/Presentation/forms.py", "/Presentation/watcherService.py"], "/Gmaps/tests.py": ["/Gmaps/googlemaps_service.py"], "/Presentation/wat... |
49,693 | bigdatasciencegroup/flightr-project | refs/heads/master | /Flightaware/flightawareService.py | from Flightaware.models import Flight
from Flightaware.restAdapter import RestAdapter
import requests
class FlightawareService(object):
@staticmethod
def find_flight(flight_number, response=None):
adapter = RestAdapter()
payload = {'ident': flight_number, 'howMany': 1}
# This is for ... | {"/Twitter/TwitterService.py": ["/Twitter/twitterAdapter.py"], "/Flightaware/flightawareService.py": ["/Flightaware/models.py", "/Flightaware/restAdapter.py"], "/Presentation/views.py": ["/Presentation/forms.py", "/Presentation/watcherService.py"], "/Gmaps/tests.py": ["/Gmaps/googlemaps_service.py"], "/Presentation/wat... |
49,694 | bigdatasciencegroup/flightr-project | refs/heads/master | /Presentation/models.py |
class FlightDetails:
def __init__(self,
flight_number,
flight_status,
current_flight_delay,
journey_time_to_airport,
suggested_time_to_start_journey,
time_till_leave_time):
self.flight_number = flight_num... | {"/Twitter/TwitterService.py": ["/Twitter/twitterAdapter.py"], "/Flightaware/flightawareService.py": ["/Flightaware/models.py", "/Flightaware/restAdapter.py"], "/Presentation/views.py": ["/Presentation/forms.py", "/Presentation/watcherService.py"], "/Gmaps/tests.py": ["/Gmaps/googlemaps_service.py"], "/Presentation/wat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.