index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
27,065 | xiaoyanguoke/klb | refs/heads/master | /LYZ/urls.py | from django.conf.urls import patterns, include, url
import settings
import members.urls as member_urls
import klbapp.urls as app_urls
import web.urls as web_urls
import wechat.urls as wechat
import webadmin.urls as webadmin
import bxservice.urls as bx_urls
import ClientAdmin.urls as ClientAdmin_urls
import ebusiness.ur... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,066 | xiaoyanguoke/klb | refs/heads/master | /ebusiness/forms.py | # -*- coding:utf-8 -*-
from django import forms
from bxservice.models import bxcarvin
from LYZ.settings import STATIC_ROOT
import json, urllib2, urllib, random,re
from ebusiness.models import vin_as_car_yg
class initVehicleBaseInfoForm(forms.Form):
licenseNo = forms.RegexField(regex=u"^[\u4e00-\u9fa5]{1}[A-Z0-9]{6... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,067 | xiaoyanguoke/klb | refs/heads/master | /bxservice/ansheng.py | # -*- coding:utf-8 -*-
import datetime, random, urllib, urllib2, time, httplib
from LYZ.settings import *
import sys, xmltodict, re
from LYZ.common import makeNew
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import MD5
from common import GetCarInfo
from LYZ.common import *
... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,068 | xiaoyanguoke/klb | refs/heads/master | /members/templatetags/memberstag.py | # -*- coding:utf-8 -*-
from django import template
from members.models import recomcode,photo,wechat
from django.contrib.auth.models import User
import time,urllib,json,sys,httplib,urllib2,random
from LYZ.klb_class import *
from django.core.exceptions import ObjectDoesNotExist
register = template.Library()
'''
读取网站基本信... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,069 | xiaoyanguoke/klb | refs/heads/master | /bxservice/ZhongHuaAction.py | # -*- coding:utf-8 -*-
from django.shortcuts import *
from LYZ.common import makeNew
from common import *
import datetime, random, urllib, urllib2, time
from LYZ.settings import *
from suds.client import *
import sys, xmltodict
import json
import re
import dicttoxml
from BaseHTTPServer import HTTPServer, BaseHTTPReques... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,070 | xiaoyanguoke/klb | refs/heads/master | /wechat/views.py | # -*- coding:utf-8 -*-
from django.shortcuts import *
import time, urllib, re, json
from wechat_sdk import WechatBasic
from LYZ.settings import WECHAT_APPID, WECHAT_APPSECRET, WECHAT_TOKEN, WECHAT_URL
from bxservice.models import bxcarvin
from django.contrib.auth.models import User
from django.contrib.auth.hashers impo... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,071 | xiaoyanguoke/klb | refs/heads/master | /webadmin/forms.py | # -*- coding:utf-8 -*-
from webadmin.models import ebusiness_members
from django import forms
from django.contrib.auth.hashers import check_password, make_password
class UserForms(forms.Form):
username = forms.CharField(
required=True,
max_length=40,
error_messages={'invalid': '用户名必须输入', '... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,072 | xiaoyanguoke/klb | refs/heads/master | /klbapp/urls.py | # -*- coding:utf-8 -*-
from django.conf.urls import patterns,include,url
from klbapp.views import *
urlpatterns = patterns('',
url(r'^$',Index,name="index"),
url(r'^sendmsg/$',SendMsg,name="sendmsg"),
url(r'^register/$',Register,name="Register"),
... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,073 | xiaoyanguoke/klb | refs/heads/master | /LYZ/klb_class.py | # -*- coding:utf-8 -*-
import settings
from members.models import car, carinfo, recall, recall_log, wechat, recomcode
from django.contrib.auth import authenticate, login
import urllib, json, urllib2, re
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
import BeautifulSou... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,074 | xiaoyanguoke/klb | refs/heads/master | /bxservice/views.py | # -*- coding:utf-8 -*-
from django.shortcuts import *
from bxservice.zhonghua import *
from bxservice.ansheng import *
from bxservice.yangguang import *
from bxservice.common import *
from bxservice.common import BXDBAction
from bxservice.models import *
from LYZ.klb_class import *
from urllib import unquote
from bxser... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,075 | xiaoyanguoke/klb | refs/heads/master | /web/urls.py | # -*- coding:utf-8 -*-
from django.conf.urls import patterns,include,url
from web.views import *
urlpatterns = patterns('',
url(r'^$',WebIndex,name="WebIndex"),
url(r'pricing/$',Pricing,name="Pricing"),
url(r'pricing/(?P<a>\w+)/$',Pricing,name="Pric... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,076 | xiaoyanguoke/klb | refs/heads/master | /WebadminClient/Client.py | # -*- coding:utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import PyQt4.QtNetwork
import sys
try:
_fromUtf8 = QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
App,ClientUI=None,None
class ClientMain(QWebView):
def __init__(self,parent... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,077 | xiaoyanguoke/klb | refs/heads/master | /bxservice/yangguang.py | # -*- coding:utf-8 -*-
import datetime, random, urllib, urllib2, time,httplib,sys, xmltodict,re,base64
import urllib
from LYZ.settings import *
from suds.client import *
from Crypto.Hash import SHA
import datetime, random, urllib, urllib2, time, httplib
import sys, xmltodict, re
from Crypto.PublicKey import RSA
from C... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,078 | xiaoyanguoke/klb | refs/heads/master | /webadmin/admin.py | from django.contrib import admin
from webadmin.models import *
class EbusinessMembersAdmin(admin.ModelAdmin):
list_display = ('username','code')
admin.site.register(ebusiness_members,EbusinessMembersAdmin)
class FlowAnalyticsAdmin(admin.ModelAdmin):
list_display = ('ip','num')
admin.site.register(flow_anal... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,079 | xiaoyanguoke/klb | refs/heads/master | /web/views.py | # -*- coding:utf-8 -*-
from django.shortcuts import *
from LYZ.common import *
from LYZ.klb_class import *
from klbapp.appclass import *
from bxservice.models import *
from bxservice.common import *
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login, logout
fr... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,080 | xiaoyanguoke/klb | refs/heads/master | /ClientAdmin/urls.py | # -*- coding:utf-8 -*-
from django.conf.urls import patterns, include, url
from ClientAdmin.views import *
urlpatterns = patterns('',
url(r'^$', Index, name="index"),
url(r'^Index/$', Index, name="index"),
url(r'^AddUser/$', AddUser, name="AddUser")... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,081 | xiaoyanguoke/klb | refs/heads/master | /ebusiness/templatetags/EbusinessTag.py | # -*- coding:utf-8 -*-
from django import template
from LYZ.klb_class import KLBCode
from bxservice.models import *
from user_agents import parse
from webadmin.models import ebusiness_members, flow_analytics
from django.core.exceptions import ObjectDoesNotExist
register = template.Library()
host = "http://192.168.1.22... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,082 | xiaoyanguoke/klb | refs/heads/master | /members/models.py | # -*- coding:utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from LYZ.settings import SYS_APP
import datetime,os
from PIL import Image
from cStringIO import StringIO
from django.core.files.uploadedfile import SimpleUploadedFile
from bxse... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,083 | xiaoyanguoke/klb | refs/heads/master | /web/templatetags/webtag.py | # -*- coding:utf-8 -*-
from django import template
from LYZ.klb_class import *
register = template.Library()
'''
读取网站基本信息
'''
@register.tag(name="ENcode")
def ENcode(s, t=0):
K= KLBCode()
try:
if t==0:
return K.encode(s)
else:
return K.decode(s)
except:
retu... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,084 | xiaoyanguoke/klb | refs/heads/master | /WebadminClient/__init__.py | __author__ = 'fengchao'
| {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,085 | xiaoyanguoke/klb | refs/heads/master | /ClientAdmin/templatetags/ClientAdmintag.py | # -*- coding:utf-8 -*-
from django import template
register = template.Library()
'''
'''
@register.tag(name="ShowTitle")
def ShowTitle(str):
return "卡来宝系统管理-%s"%str
register.filter(ShowTitle)
@register.tag(name="NoAsterisk")
def NoAsterisk(str):
str = str.replace("*","")
return str
register.filter(NoAste... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,086 | xiaoyanguoke/klb | refs/heads/master | /klbapp/views.py | # -*- coding:utf-8 -*-
from django.shortcuts import *
from appclass import *
from members.models import *
from datetime import datetime
from LYZ.settings import *
import random
from django.contrib.auth.models import User
from django.contrib import auth
#token
from tokenapi.decorators import token_required
from tokenapi... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,087 | xiaoyanguoke/klb | refs/heads/master | /wechat/templatetags/wechattag.py | # -*- coding:utf-8 -*-
from django import template
from LYZ.klb_class import *
from bxservice.models import bxcarvin
from bxservice.models import bxcarinfo
import time
from LYZ.settings import WECHAT_APPID, WECHAT_APPSECRET, WECHAT_TOKEN,WECHAT_URL
from wechat_sdk import WechatBasic
import json
register = template.Libr... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,088 | xiaoyanguoke/klb | refs/heads/master | /webadmin/urls.py | # -*- coding:utf-8 -*-
from django.conf.urls import patterns, include, url
from webadmin.views import *
urlpatterns = patterns('',
url(r'^$', Index, name="index"),
url(r'^Login/$',Login,name="Login"),
url(r'^Logout/$',Logout,name="Logout"),
... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,089 | xiaoyanguoke/klb | refs/heads/master | /bxservice/models.py | # -*- coding:utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
#车辆表
class bxcarvin(models.Model):
user = models.ForeignKey(User,null=True,blank=True,verbose_name="用户ID")
licenseno = models.CharField(max_length=255,null=True,blank=True,default="",verbose_name="车牌号")
ownername... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,090 | xiaoyanguoke/klb | refs/heads/master | /LYZ/common.py | # -*- coding:utf-8 -*-
import time,urllib,json,sys,httplib,urllib2
from LYZ.settings import *
from members.models import *
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login,logout
from django.http import HttpResponse,HttpRequest
import re,random
def phonecheck(s):
msg ... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,091 | xiaoyanguoke/klb | refs/heads/master | /wechat/urls.py | # -*- coding:utf-8 -*-
from django.conf.urls import patterns, include, url
from wechat.views import *
urlpatterns = patterns('',
url(r'^$', Index, name="index"),
url(r'^pricing/$', Pricing, name="Pricing"),
url(r'^pricing/(?P<action>\w+)/$', Pricing... | {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,092 | xiaoyanguoke/klb | refs/heads/master | /members/admin.py | from django.contrib import admin
from members.models import *
admin.site.register(uscores)
admin.site.register(sendsms)
admin.site.register(recomcode)
admin.site.register(recomcoder_user)
admin.site.register(photo)
| {"/members/urls.py": ["/members/views.py"], "/ebusiness/urls.py": ["/ebusiness/views.py"], "/ClientAdmin/forms.py": ["/webadmin/models.py"], "/bxservice/ZhongHuaViews.py": ["/bxservice/zhonghua.py", "/bxservice/ansheng.py", "/bxservice/yangguang.py"], "/bxservice/urls.py": ["/bxservice/ZhongHuaViews.py", "/bxservice/vi... |
27,095 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/train/losses.py | import torch
import numpy as np
def loss_KLD(mean, log_var, cfg, batch_mean=True):
"""
Computes Kullback–Leibler divergence for Gaussian prior.
Optional: betta < 1 allows encoder distribution to diverge more form the prior (standard Gaussian).
"""
betta = cfg['cvae_cfg']['betta']
KLD... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,096 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/train/train_monitor.py | import numpy as np
import matplotlib.pyplot as plt
def cvae_training_monitor(mse_losses, vlb_losses, criterion):
fig, ax = plt.subplots(1, 3, figsize=(16, 6))
total_loss = np.array(mse_losses) + np.array(vlb_losses)
ax[0].plot(np.arange(0, len(mse_losses)), total_loss)
ax[1].plot(np.arange(0, len(vl... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,097 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/train/train_cvae.py | import torch
import numpy as np
from tqdm import tqdm
from IPython.display import clear_output
from lyft_motion_prediction.train.train_monitor import cvae_training_monitor
from lyft_motion_prediction.train.losses import loss_KLD, loss_MMD, compute_kernel, compute_mmd
def forward_cvae(data, model, device, cfg):
... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,098 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/utils/load_models.py | from typing import Dict
from collections import namedtuple
from torch.utils import model_zoo
from lyft_motion_prediction.models import CVAE, TrajectoriesExtractor
model = namedtuple("model", ["url", "model"])
models = {
"CVAE": model(
url="https://github.com/kumgleb/Lyft_motion_prediction/releases/downlo... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,099 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/train/train_utils.py | import torch
def sample_trajectories_batch(model, context, device, cfg):
"""
Samples trajectories form CVAE given context.
Returns:
samples (Tensor): batch of samples given context, shape: [bs, 1, n_samples, 2* n_time_steps].
"""
n_samples = cfg['extractor_cfg']['n_samples']
n_time_ste... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,100 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/models.py | from typing import Dict
import torch
from torch import nn, optim, Tensor
from torchvision.models.resnet import resnet50
class Embeddings(nn.Module):
"""
Creates representation of the frame and history as a single vector (context embedding).
"""
def __init__(self, cfg: Dict):
super().__init__(... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,101 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/utils/plot_utils.py | import numpy as np
import matplotlib.pyplot as plt
def plot_cvae_predictions(data_batch, train_dataset, trajectories,
transform_points,
n_samples_to_plot=10):
n_samples_to_plot = min(n_samples_to_plot, trajectories.shape[2])
samples_idx = iter(np.random.per... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,102 | neehasajja/Lyft_motion_prediction | refs/heads/main | /lyft_motion_prediction/train/train_extractor.py | import torch
import numpy as np
from tqdm import tqdm
from IPython.display import clear_output
from lyft_motion_prediction.train.train_monitor import extractor_training_monitor
from lyft_motion_prediction.train.train_utils import sample_trajectories_batch
from lyft_motion_prediction.train.losses import neg_multi_log_... | {"/lyft_motion_prediction/train/train_cvae.py": ["/lyft_motion_prediction/train/train_monitor.py", "/lyft_motion_prediction/train/losses.py"], "/lyft_motion_prediction/utils/load_models.py": ["/lyft_motion_prediction/models.py"], "/lyft_motion_prediction/train/train_extractor.py": ["/lyft_motion_prediction/train/train_... |
27,108 | robin-gdwl/compas | refs/heads/main | /src/compas_rhino/objects/modify/__init__.py | from __future__ import absolute_import
from .datastructures import * # noqa : F401 F403
__all__ = [name for name in dir() if not name.startswith('_')]
| {"/src/compas_rhino/objects/__init__.py": ["/src/compas_rhino/objects/modify/__init__.py"]} |
27,109 | robin-gdwl/compas | refs/heads/main | /src/compas_rhino/objects/__init__.py | """
********************************************************************************
objects
********************************************************************************
.. currentmodule:: compas_rhino.objects
.. .. rst-class:: lead
.. code-block:: python
import compas
from compas.datastructures import ... | {"/src/compas_rhino/objects/__init__.py": ["/src/compas_rhino/objects/modify/__init__.py"]} |
27,110 | robin-gdwl/compas | refs/heads/main | /src/compas/files/_xml/xml_shared.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import xml.etree.ElementTree as ET
def shared_xml_from_file(source, tree_parser, http_response_type):
target = TreeBuilderWithNamespaces()
# If the source is an http_response_type (`addinfou... | {"/src/compas_rhino/objects/__init__.py": ["/src/compas_rhino/objects/modify/__init__.py"]} |
27,111 | robin-gdwl/compas | refs/heads/main | /src/compas/files/_xml/xml_pre_38.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import xml.etree.ElementTree as ET
from xml.dom import NotSupportedErr
from compas.files._xml.xml_cpython import prettify_string # doesn't need special handling for pre-3.8 so we just import
__all__ = [
... | {"/src/compas_rhino/objects/__init__.py": ["/src/compas_rhino/objects/modify/__init__.py"]} |
27,112 | robin-gdwl/compas | refs/heads/main | /src/compas/_json.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import json
from compas.utilities import DataEncoder
from compas.utilities import DataDecoder
__all__ = [
'json_dump',
'json_dumps',
'json_load',
'json_loads'
]
def json_dump(data, fp):
... | {"/src/compas_rhino/objects/__init__.py": ["/src/compas_rhino/objects/modify/__init__.py"]} |
27,113 | robin-gdwl/compas | refs/heads/main | /src/compas/rpc/__init__.py | """
********************************************************************************
rpc
********************************************************************************
.. currentmodule:: compas.rpc
COMPAS runs in many different environments, but in some environments the availablity of libraries is limited.
For exam... | {"/src/compas_rhino/objects/__init__.py": ["/src/compas_rhino/objects/modify/__init__.py"]} |
27,256 | aaronshivers/iss_tracker | refs/heads/master | /iss.py | import turtle
import urllib.request
import json
class Iss:
def __init__(self, screen):
self.screen = screen
self.url = 'http://api.open-notify.org/iss-now.json'
response = urllib.request.urlopen(self.url)
result = json.loads(response.read())
location = result['iss_positio... | {"/main.py": ["/settings.py", "/location.py", "/people.py", "/iss.py"]} |
27,257 | aaronshivers/iss_tracker | refs/heads/master | /people.py | import urllib.request
import json
class People:
def __init__(self):
self.url = 'http://api.open-notify.org/astros.json'
self.response = urllib.request.urlopen(self.url)
self.result = json.loads(self.response.read())
self.people = self.result['people']
for p in self.people... | {"/main.py": ["/settings.py", "/location.py", "/people.py", "/iss.py"]} |
27,258 | aaronshivers/iss_tracker | refs/heads/master | /settings.py | class Settings:
def __init__(self):
# screen settings
self.screen_width = 720
self.screen_height = 360
self.screen_bgpic = 'map.gif'
self.screen_llx = self.screen_width / 4 * -1
self.screen_lly = self.screen_height / 4 * -1
self.screen_urx = self.screen_width ... | {"/main.py": ["/settings.py", "/location.py", "/people.py", "/iss.py"]} |
27,259 | aaronshivers/iss_tracker | refs/heads/master | /main.py | import turtle
from settings import Settings
from location import Location
from people import People
from iss import Iss
class IssTracker:
def __init__(self):
self.settings = Settings()
self.screen = turtle.Screen()
self.screen.setup(self.settings.screen_width, self.settings.screen_height... | {"/main.py": ["/settings.py", "/location.py", "/people.py", "/iss.py"]} |
27,260 | aaronshivers/iss_tracker | refs/heads/master | /location.py | import turtle
import time
import urllib.request
import json
class Location:
def __init__(self, latitude, longitude):
self.latitude = latitude
self.longitude = longitude
location = turtle.Turtle()
location.penup()
location.color('cyan')
location.goto(self.longitude,... | {"/main.py": ["/settings.py", "/location.py", "/people.py", "/iss.py"]} |
27,300 | nesterovichps/backend_blog | refs/heads/main | /main_blog/forms.py | from .models import BlogPost
from django.forms import ModelForm, Textarea
class AddPostForm(ModelForm):
class Meta:
model = BlogPost
fields = ['author', 'text_post', 'data_post']
widgets = {'text_post': Textarea(attrs={
"name": "new_post",
"cols": "150",
... | {"/main_blog/forms.py": ["/main_blog/models.py"], "/main_blog/views.py": ["/main_blog/models.py", "/main_blog/forms.py"], "/main_blog/admin.py": ["/main_blog/models.py"]} |
27,301 | nesterovichps/backend_blog | refs/heads/main | /main_blog/urls.py | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index, name='index'),
# path('user_auth', views.user_auth, name='user_auth'),
path('create_post', views.create_post, name='create_post'),
path('accounts/', include('django.contrib.auth.urls'), name='user_auth'),
]
| {"/main_blog/forms.py": ["/main_blog/models.py"], "/main_blog/views.py": ["/main_blog/models.py", "/main_blog/forms.py"], "/main_blog/admin.py": ["/main_blog/models.py"]} |
27,302 | nesterovichps/backend_blog | refs/heads/main | /main_blog/views.py | from django.shortcuts import render, redirect
from .models import BlogPost
from django.contrib import auth
from .forms import AddPostForm
from . import templates
# Create your views here.
def index(request):
post_list = BlogPost.objects.order_by('-data_post')
return render(request, 'main_blog/index.html',
... | {"/main_blog/forms.py": ["/main_blog/models.py"], "/main_blog/views.py": ["/main_blog/models.py", "/main_blog/forms.py"], "/main_blog/admin.py": ["/main_blog/models.py"]} |
27,303 | nesterovichps/backend_blog | refs/heads/main | /main_blog/migrations/0001_initial.py | # Generated by Django 3.1.3 on 2020-11-28 15:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blogger',
fields=[
... | {"/main_blog/forms.py": ["/main_blog/models.py"], "/main_blog/views.py": ["/main_blog/models.py", "/main_blog/forms.py"], "/main_blog/admin.py": ["/main_blog/models.py"]} |
27,304 | nesterovichps/backend_blog | refs/heads/main | /main_blog/admin.py | from django.contrib import admin
from .models import BlogPost, Blogger, Subscribe
# Register your models here.
admin.site.register(BlogPost)
admin.site.register(Blogger)
admin.site.register(Subscribe)
| {"/main_blog/forms.py": ["/main_blog/models.py"], "/main_blog/views.py": ["/main_blog/models.py", "/main_blog/forms.py"], "/main_blog/admin.py": ["/main_blog/models.py"]} |
27,305 | nesterovichps/backend_blog | refs/heads/main | /main_blog/models.py | from django.db import models
# Create your models here.
class Blogger(models.Model):
blogger_name = models.CharField('Автор', max_length=50) # TODO fixto dinamik
def __str__(self):
return (self.blogger_name)
class Meta:
verbose_name = 'Блогер'
verbose_name_plural = 'Блогеры'
c... | {"/main_blog/forms.py": ["/main_blog/models.py"], "/main_blog/views.py": ["/main_blog/models.py", "/main_blog/forms.py"], "/main_blog/admin.py": ["/main_blog/models.py"]} |
27,324 | cevmartinez/clld | refs/heads/master | /clld/tests/test_lib_imeji.py | from __future__ import unicode_literals
import unittest
from clld.tests.util import TESTS_DIR
class Tests(unittest.TestCase):
def test_Result(self):
from clld.lib.imeji import file_urls
res = list(file_urls(TESTS_DIR.joinpath('imeji_items.xml').as_posix()))
self.assertEqual(len(res), 6)
| {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,325 | cevmartinez/clld | refs/heads/master | /clld/tests/test_web_adapters_download.py | from __future__ import unicode_literals, print_function, division, absolute_import
import os
from tempfile import mktemp
import gzip
from contextlib import closing
from xml.etree import cElementTree as et
from mock import Mock, MagicMock, patch
from clldutils.misc import UnicodeMixin
from clld.db.models.common import... | {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,326 | cevmartinez/clld | refs/heads/master | /clld/web/adapters/cldf.py | from __future__ import unicode_literals
from zipfile import ZipFile, ZIP_DEFLATED
import json
from sqlalchemy import true
from sqlalchemy.orm import joinedload, joinedload_all
from clldutils.path import Path, remove, move
from clldutils.dsv import UnicodeWriter
from clld.web.adapters.download import Download, README
... | {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,327 | cevmartinez/clld | refs/heads/master | /clld/tests/test_lib_bibtex.py | # coding: utf8
from __future__ import unicode_literals, division, print_function, absolute_import
import unittest
from six import text_type, binary_type
from mock import Mock
from clld.tests.util import TESTS_DIR
class Tests(unittest.TestCase):
def test_unescape(self):
from clld.lib.bibtex import unesca... | {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,328 | cevmartinez/clld | refs/heads/master | /clld/tests/test_scripts_freeze.py | # coding: utf8
from __future__ import unicode_literals
import logging
from tempfile import mkdtemp
from sqlalchemy import create_engine, null
from sqlalchemy.orm import sessionmaker
from clldutils.path import Path, rmtree
from mock import Mock
from clld.tests.util import TestWithEnv
from clld.db.meta import Base, DBS... | {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,329 | cevmartinez/clld | refs/heads/master | /clld/lib/imeji.py | """
Utilities to manage multimedia files stored remotely in an imeji instance.
.. seealso:: http://imeji.org
"""
from __future__ import unicode_literals, print_function, absolute_import, division
from xml.etree import ElementTree
def qname(localname):
return '{http://imeji.org/terms}' + localname
def get(e, k)... | {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,330 | cevmartinez/clld | refs/heads/master | /clld/tests/test_util.py | # coding: utf8
from __future__ import unicode_literals
def test_summary():
from clld.util import summary
# text consisting of unique words
text = "This is a long text, which we want to summarize."
assert summary(text[:20]) == text[:20]
assert summary(text, len(text) - 1).endswith('...')
asse... | {"/clld/tests/test_lib_imeji.py": ["/clld/lib/imeji.py"], "/clld/tests/test_web_adapters_download.py": ["/clld/web/adapters/cldf.py"]} |
27,332 | Nootaku/simple_API_Swagger | refs/heads/main | /resources/hello.py | from flask_restful import Resource
from flask import request
from flasgger import swag_from
class HelloWorld(Resource):
@swag_from('hello.yml')
def post(self):
"""Create new User entry in the users table
"""
name = request.json.get('name')
return {
'message': f"Hel... | {"/api.py": ["/resources/hello.py", "/resources/records.py"]} |
27,333 | Nootaku/simple_API_Swagger | refs/heads/main | /resources/records.py | from flask_restful import Resource
from flask import request
from flasgger import swag_from
class Records(Resource):
@swag_from('records.yml')
def get(self):
name = request.args.get('name')
return {
'message': f"Get your name: {name}"
}, 200
@swag_from('records.yml')... | {"/api.py": ["/resources/hello.py", "/resources/records.py"]} |
27,334 | Nootaku/simple_API_Swagger | refs/heads/main | /config.py | import os
class Config(object):
TESTING = False
SECRET_KEY = os.urandom(16)
UPLOAD_FOLDER = os.path.join(os.getcwd(), "cdn")
class DevelopmentConfig(Config):
DEBUG = True
class ProductionConfig(Config):
DEBUG = False
| {"/api.py": ["/resources/hello.py", "/resources/records.py"]} |
27,335 | Nootaku/simple_API_Swagger | refs/heads/main | /api.py | from flask import Flask
from flask_cors import CORS
from flask_restful import Api
from flasgger import Swagger
# Internal imports
from resources.hello import HelloWorld
from resources.records import Records
def create_app():
"""Application Factory for our app.
"""
app = Flask(__name__, instance_relative_... | {"/api.py": ["/resources/hello.py", "/resources/records.py"]} |
27,363 | Stupeflix/zfs_backup | refs/heads/develop | /zfs_backup/validators.py | import click
from zfs_backup import utils
def zfs_snapshot(ctx, param, value):
p = utils.command(
'zfs list -t snapshot -o name | grep %s' % value,
check=True)
if p.returncode != 0:
raise click.BadParameter('zfs snapshot does not exist')
return value
| {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,364 | Stupeflix/zfs_backup | refs/heads/develop | /zfs_backup/bucket.py | from zfs_backup import utils
from zfs_backup import settings
from datetime import datetime, timedelta
from subprocess import PIPE
import os
import sys
import boto
import json
import cStringIO
import logging
logger = logging.getLogger(__name__)
class Bucket(object):
def __init__(self, settings):
self.set... | {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,365 | Stupeflix/zfs_backup | refs/heads/develop | /zfs_backup/snapshot.py | from zfs_backup import utils
from zfs_backup.bucket import SnapshotBucket
from datetime import datetime, timedelta
import MySQLdb
import logging
logger = logging.getLogger(__name__)
def create_snapshot_from_conf(conf):
snapshot = None
if conf['TYPE'] == 'postgres':
snapshot = PostgresSnapshot(conf)
... | {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,366 | Stupeflix/zfs_backup | refs/heads/develop | /setup.py | #!/usr/bin/env python
from setuptools import setup
import os.path as op
CURRENT_DIR = op.dirname(__file__)
version = open(op.join(CURRENT_DIR, 'zfs_backup', 'VERSION.txt')).read().strip()
requirements = open(op.join(CURRENT_DIR, 'requirements.txt')).read()
setup(
name='zfs_backup',
packages=['zfs_backup'],
... | {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,367 | Stupeflix/zfs_backup | refs/heads/develop | /fabfile.py | from stupeflix.deployment.ourpypi import UpdateToLatest, Rollback
from stupeflix.deployment.versioned import StupeflixPyPiUpload
update = UpdateToLatest()
rollback = Rollback()
upload = StupeflixPyPiUpload()
| {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,368 | Stupeflix/zfs_backup | refs/heads/develop | /zfs_backup/utils.py | from zfs_backup import settings
from subprocess import Popen, PIPE
from datetime import datetime
import math
def command(cmd, check=False, **usr_params):
# Set default params
params = dict({
'shell': True,
'stdout': PIPE,
'stderr': PIPE,
}, **usr_params)
p = Popen(
[... | {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,369 | Stupeflix/zfs_backup | refs/heads/develop | /zfs_backup/__init__.py | import zfs_backup
import logging.config
import logutils.dictconfig
import socket
import imp
import os
# -----------------------------------------------------------------------------
# Set app settings to zfs_backup.settings endpoint
SETTINGS_PATH = os.environ.get('SETTINGS_PATH', '/opt/zfs_backup/settings.py')
if not... | {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,370 | Stupeflix/zfs_backup | refs/heads/develop | /zfs_backup/cli.py | from zfs_backup.snapshot import create_snapshot_from_conf
from zfs_backup.bucket import Bucket
from zfs_backup import settings
from zfs_backup import validators
from zfs_backup import utils
from datetime import datetime
import psutil
import signal
import click
import time
import json
import sys
import os
import loggi... | {"/zfs_backup/validators.py": ["/zfs_backup/__init__.py"], "/zfs_backup/bucket.py": ["/zfs_backup/__init__.py"], "/zfs_backup/snapshot.py": ["/zfs_backup/__init__.py", "/zfs_backup/bucket.py"], "/zfs_backup/utils.py": ["/zfs_backup/__init__.py"], "/zfs_backup/cli.py": ["/zfs_backup/snapshot.py", "/zfs_backup/bucket.py"... |
27,387 | eyyupoglu/Bacteria-Growth-Data-Visualisation | refs/heads/master | /dataFilter.py | import numpy as np
import math
import decimal
import time
import matplotlib.pyplot as plt
from dataLoad import *
def filter(data):
if data == []:
print("ERROR: Data has not been loaded yet. You need to load a data first.")
filtered_data = []
else:
filtered_data = data
# Up t... | {"/dataFilter.py": ["/dataLoad.py"], "/dataFilter2.py": ["/dataLoad.py"], "/Project1(Bacteria).py": ["/dataPlot.py", "/dataStatistics.py", "/dataLoad.py", "/dataFilter2.py"], "/dataPlot.py": ["/dataLoad.py"]} |
27,388 | eyyupoglu/Bacteria-Growth-Data-Visualisation | refs/heads/master | /dataStatistics.py | import numpy as np
import math
import decimal
import time
import matplotlib.pyplot as plt
def dataStatistics(data, statistic):
result=0
if statistic == 'Mean Temperature':
a = np.mean(data,axis=0)
result= a[0]
elif statistic == 'Mean Growth rate':
a = np.mean(data, axis=0)
... | {"/dataFilter.py": ["/dataLoad.py"], "/dataFilter2.py": ["/dataLoad.py"], "/Project1(Bacteria).py": ["/dataPlot.py", "/dataStatistics.py", "/dataLoad.py", "/dataFilter2.py"], "/dataPlot.py": ["/dataLoad.py"]} |
27,389 | eyyupoglu/Bacteria-Growth-Data-Visualisation | refs/heads/master | /dataFilter2.py | import numpy as np
import math
import decimal
import time
import matplotlib.pyplot as plt
from dataLoad import *
def dataFilter2(data, bacteriaFilter, growthRatefilter):
GrowthRate = data[:,1]
Bacteria_type = data[:,2]
logical_vector=np.ones(len(data),dtype=bool)
if bacteriaFilter != None:
... | {"/dataFilter.py": ["/dataLoad.py"], "/dataFilter2.py": ["/dataLoad.py"], "/Project1(Bacteria).py": ["/dataPlot.py", "/dataStatistics.py", "/dataLoad.py", "/dataFilter2.py"], "/dataPlot.py": ["/dataLoad.py"]} |
27,390 | eyyupoglu/Bacteria-Growth-Data-Visualisation | refs/heads/master | /Project1(Bacteria).py |
import numpy as np
import math
import decimal
import time
import matplotlib.pyplot as plt
from dataPlot import *
from dataStatistics import *
from dataLoad import *
from dataFilter2 import *
def load():
data = []
filename = input("The name of the file name is necessary(with correct extension) :\n>>")
t... | {"/dataFilter.py": ["/dataLoad.py"], "/dataFilter2.py": ["/dataLoad.py"], "/Project1(Bacteria).py": ["/dataPlot.py", "/dataStatistics.py", "/dataLoad.py", "/dataFilter2.py"], "/dataPlot.py": ["/dataLoad.py"]} |
27,391 | eyyupoglu/Bacteria-Growth-Data-Visualisation | refs/heads/master | /dataLoad.py | import numpy as np
import math
import decimal
import time
import matplotlib.pyplot as plt
def dataLoad(filename):
with open(filename) as f:
new_data=np.array([0,0,0])
for a_line in f:
word = a_line.split(' ')
data = np.array([float(word[0]),float(word[1]),float(word[2]... | {"/dataFilter.py": ["/dataLoad.py"], "/dataFilter2.py": ["/dataLoad.py"], "/Project1(Bacteria).py": ["/dataPlot.py", "/dataStatistics.py", "/dataLoad.py", "/dataFilter2.py"], "/dataPlot.py": ["/dataLoad.py"]} |
27,392 | eyyupoglu/Bacteria-Growth-Data-Visualisation | refs/heads/master | /dataPlot.py | import numpy as np
import math
import decimal
import time
import matplotlib.pyplot as plt
from dataLoad import *
def dataPlot(data):
#---------------------------------first part-----bar plot- number of bacteri--------------------------------------------
counter = 0
counter2=0
counter3=0
counter4=0
... | {"/dataFilter.py": ["/dataLoad.py"], "/dataFilter2.py": ["/dataLoad.py"], "/Project1(Bacteria).py": ["/dataPlot.py", "/dataStatistics.py", "/dataLoad.py", "/dataFilter2.py"], "/dataPlot.py": ["/dataLoad.py"]} |
27,393 | jssosa10/GSIPN | refs/heads/master | /example.py | import gsipn as pn
import numpy as np
net = pn.GSIPN()
net.add_place('w',1)
net.add_place('d',0)
net.add_place('r',0)
net.add_place('A',1)
net.add_place('U',0)
net.add_transition('t0',t_class='exp',rate=0.0000022,assertion='c = not c')
net.add_transition('t1',predicate='r>0',assertion='r-=1')
net.add_transition('t2',t_... | {"/gsipn_simulator.py": ["/nets.py", "/params.py"], "/nets.py": ["/gsipn.py"]} |
27,394 | jssosa10/GSIPN | refs/heads/master | /params.py | default_params = {
'lambda_d': 0.000011,
'lambda_dd': 0.1,
'lambda_du': 0.1,
'lambda_sd': 0.1,
'lambda_su': 0.1,
'lambda_de': 1/8760.0,
'mu_dd': 0.1,
'mu_du': 0.1,
'mmu_sd': 0.1,
'mu_su': 0.1,
'mu_de': 0.1,
'tao': 8760,
'DC': 0.6,
'SFF': 0.61,
'beta': 0.1,
'mttr_du': 8,
'mttr_dd': 8,
'mdd': 0.0001
}
d... | {"/gsipn_simulator.py": ["/nets.py", "/params.py"], "/nets.py": ["/gsipn.py"]} |
27,395 | jssosa10/GSIPN | refs/heads/master | /res.py | import gsipn_simulator as sm
taos =[4380,8760,17520,87600]
lambdas=[1.0/x for x in taos]
mdd = [0.0001,0.001,0.01,0.1]
dc = [0.0,0.6,0.9,0.99]
beta = [0.01,0.05,0.1]
for x in ['1oo1','1oo2','2oo3']:
res = sm.generate_results(taos,'tao',x)
print x,'tao',res
res = sm.generate_results(lambdas,'lambda_de',x)
print x,'l... | {"/gsipn_simulator.py": ["/nets.py", "/params.py"], "/nets.py": ["/gsipn.py"]} |
27,396 | jssosa10/GSIPN | refs/heads/master | /gsipn_simulator.py | import numpy as np
import nets as nn
import params as pm
nets = {}
nets['1oo1'] = nn.create1oo1
nets['1oo2'] = nn.create1oo2
nets['2oo3'] = nn.create2oo3
nets['242'] = nn.create242
def simulate(net):
res = []
for x in range(100):
marks = net.simulate(1000)
z = 0
for mark in marks:
z+= mark['U']*1.0/len(m... | {"/gsipn_simulator.py": ["/nets.py", "/params.py"], "/nets.py": ["/gsipn.py"]} |
27,397 | jssosa10/GSIPN | refs/heads/master | /gsipn.py | import time
import numpy as np
import pandas as pd
class GSIPN(object):
"""docstring for GSIPN"""
def __init__(self):
self.places = {}
self.transitions = {}
self.inArcs = {}
self.outArcs = {}
self.global_varibles = {}
def add_place(self, name, tokens=0):
self.places[name] = tokens
def add_transition... | {"/gsipn_simulator.py": ["/nets.py", "/params.py"], "/nets.py": ["/gsipn.py"]} |
27,398 | jssosa10/GSIPN | refs/heads/master | /nets.py | import gsipn as pn
def createChannel(id,net,params):
net.add_place('w'+str(id),1)
net.add_place('d'+str(id),0)
net.add_place('r'+str(id),0)
net.add_place('u'+str(id),0)
net.add_place('ur'+str(id),0)
net.add_transition('t0_'+str(id),t_class='exp',rate=params['lambda_dd']*(1.0-params['beta']),assertion='c'+str(id)... | {"/gsipn_simulator.py": ["/nets.py", "/params.py"], "/nets.py": ["/gsipn.py"]} |
27,407 | Akataya/blogproject | refs/heads/master | /api/blogproject/posts/models.py | from django.db import models
from django.contrib.auth.models import User
class Category(models.Model):
name = models.CharField(max_length=50)
description = models.CharField(max_length=1000)
class Post(models.Model):
title = models.CharField(max_length=150)
body = models.TextField(max_length=5000)
... | {"/api/blogproject/users/admin.py": ["/api/blogproject/users/models.py"]} |
27,408 | Akataya/blogproject | refs/heads/master | /api/blogproject/users/models.py | from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
joined = models.DateTimeField(auto_now_add=True, null=True, blank=True)
is_author = models.BooleanField(default=False)
def __str__(self):
... | {"/api/blogproject/users/admin.py": ["/api/blogproject/users/models.py"]} |
27,409 | Akataya/blogproject | refs/heads/master | /api/blogproject/users/admin.py | from django.contrib import admin
from .models import Profile, SubscriptionPlan
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
class Meta:
model = Profile
list_display = ('user', 'joined', 'is_author')
@admin.register(SubscriptionPlan)
class SubscriptionPlanAdmin(admin.ModelAdmin)... | {"/api/blogproject/users/admin.py": ["/api/blogproject/users/models.py"]} |
27,419 | 285027200/myproject1 | refs/heads/master | /apps/verifications/urls.py | # 导入模块
from django.urls import path, re_path
from verifications import views
# 定义app名字
app_name = 'verifications'
urlpatterns = [
# 定义注册页面的路由
path('image_codes/<uuid:image_code_id>/', views.ImageCode.as_view(), name='image_code'),
# 使用正则,可以在url中多进行一次验证
re_path('usernames/(?P<username>\w{5,20})/', view... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,420 | 285027200/myproject1 | refs/heads/master | /apps/admin/views.py | # 导入模块
import json, logging
from urllib.parse import urlencode
from django.core.paginator import Paginator, EmptyPage
from django.shortcuts import render
from django.views import View
from news import models
from docs.models import Doc
from users.models import Users
from django.contrib.auth.models import Group, Permiss... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,421 | 285027200/myproject1 | refs/heads/master | /apps/news/constants.py | # 每页新闻数
PER_PAGE_NEWS_COUNT = 5
# 显示热门新闻条数
SHOW_HOTNEWS_COUNT = 3
# 显示轮播图条数
SHOW_BANNER_COUNT = 6 | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,422 | 285027200/myproject1 | refs/heads/master | /apps/users/views.py | # 导入模块
from django.shortcuts import render, redirect, reverse
from django.views import View
from utils.json_fun import to_json_data
from utils.res_code import Code, error_map
import json
# 导入自定义forms表单,使用RegisterForm方法,使用LoginForm方法
from .forms import RegisterForm, LoginForm
# 导入自定义的模型users方法
from .models import Users
... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,423 | 285027200/myproject1 | refs/heads/master | /utils/json_fun.py | # 导入状态码模块
from utils.res_code import Code
# 导入返回json到前端的模块JsonResponse
from django.http import JsonResponse
# 自定义方法
# 默认状态是errno=Code.OK,报错信息是errmsg='', 需要返回前端的内容data=None, 更多其他数据**kwargs
def to_json_data(errno=Code.OK, errmsg='', data=None, **kwargs):
# 因为我们用json返回到前端的数据是字典格式的
json_dict = {
... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,424 | 285027200/myproject1 | refs/heads/master | /apps/users/constants.py | # 用户session信息过期时间,单位秒,设置5天
USER_SESSION_EXPIRES = 5*24*60*60 | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,425 | 285027200/myproject1 | refs/heads/master | /apps/verifications/views.py | # 导入模块
from django.shortcuts import render # 基本的渲染模块
from django.http import HttpResponse, JsonResponse # 同上
from django.views import View # 继承模板类视图
from utils.captcha.captcha import captcha # 生成图片验证码的模块
# 导入redis数据库的模块
from django_redis import get_redis_connection
# 把常量单独保存,导入使用
from verifications import consta... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,426 | 285027200/myproject1 | refs/heads/master | /apps/docs/urls.py | # 导入路径模块和视图
from django.urls import path
from docs import views
app_name = 'doc'
urlpatterns = [
path('', views.doc_index, name='index'),
path('<int:doc_id>/', views.DocDownload.as_view(), name='doc_download'),
] | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,427 | 285027200/myproject1 | refs/heads/master | /apps/admin/constants.py | # 显示热门新闻条数
SHOW_HOTNEWS_COUNT = 3
# 每页新闻数
PER_PAGE_NEWS_COUNT = 8
# 轮播图数
SHOW_BANNER_COUNT = 6 | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,428 | 285027200/myproject1 | refs/heads/master | /apps/docs/views.py | from django.shortcuts import render
from django.views import View
from django.conf import settings
from django.http import FileResponse, Http404
from django.utils.encoding import escape_uri_path
import requests, logging
from .models import Doc
# Create your views here.
# 日志
logger = logging.getLogger('django')
# 函数视图... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,429 | 285027200/myproject1 | refs/heads/master | /apps/users/forms.py | # 导入模块
import re
from django import forms
from verifications.constants import SMS_CODE_NUMS
from django_redis import get_redis_connection
from .models import Users
# 导入django自带的Q方法(能把两个参数一起查询)
from django.db.models import Q
# 导入django自带的login方法
from django.contrib.auth import login
# 导入常量
from .import consta... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,430 | 285027200/myproject1 | refs/heads/master | /apps/verifications/forms.py | # 导入模块
# 导入form表单的基本
from django import forms
# 导入django内置的用于字段使用正则来校验的方法
from django.core.validators import RegexValidator
# 导入users这个app里的模型里的Users类
from users.models import Users
# 导入redis数据库,获取链接
from django_redis import get_redis_connection
# 创建手机号码的正则校验器
mobile_validator = RegexValidator(r"^1[345789]\... | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
27,431 | 285027200/myproject1 | refs/heads/master | /apps/verifications/constants.py | # 图片验证码redis有效期,单位秒
IMAGE_CODE_REDIS_EXPIRES = 5 * 60
# 短信验证码的位数
SMS_CODE_NUMS = 6
# 短信验证码的有效期,单位秒
SMS_CODE_REDIS_EXPIRES = 5 * 60
# 短信验证码的发送模板
SMS_CODE_TEMP_ID = 1
# 发送短信的间隔时间,单位秒
SEND_SMS_CODE_INTERVAL = 60 | {"/apps/admin/views.py": ["/utils/json_fun.py", "/myproject1/__init__.py"], "/apps/users/views.py": ["/utils/json_fun.py", "/apps/users/forms.py", "/apps/users/models.py"], "/apps/verifications/views.py": ["/utils/json_fun.py"], "/apps/users/forms.py": ["/apps/users/models.py"], "/apps/news/views.py": ["/myproject1/__i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.