index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
90,933 | meowmeowster/Heart | refs/heads/master | /patient/serializers/patien_serializer.py | from rest_framework import serializers
from patient.models import Patient
class PatientSerializer(serializers.Serializer):
ID = serializers.CharField()
name = serializers.CharField()
class Meta:
model = Patient
fields = '__all__' | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,934 | meowmeowster/Heart | refs/heads/master | /doctor/models.py | from django.db import models
from patient.models import Patient
class Doctor(models.Model):
ID = models.CharField(max_length=254, null = True)
name = models.CharField(max_length=254, null = True)
| {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,935 | meowmeowster/Heart | refs/heads/master | /patient/views/create_patient_view.py | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import authentication, permissions
from django.contrib.auth.models import User
from Heart.resources.value_parse import create_object
from patient.models import Patient, PatientCharacters, PatientImmutableCharacters... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,936 | meowmeowster/Heart | refs/heads/master | /patient/models.py | from django.db import models
import datetime
class Patient(models.Model):
ID = models.CharField(max_length=254, null = True)
name = models.CharField(max_length=254, null = True)
class PatientImmutableCharacters(models.Model):
date =models.DateTimeField(default=datetime.datetime.now)
ID_0_0 = models.Ch... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,937 | meowmeowster/Heart | refs/heads/master | /patient/serializers/patient_immutable_serializer.py | from patient.models import PatientImmutableCharacters
from rest_framework import serializers
class PatientImmutableSerializer(serializers.Serializer):
Pol_1_1 = serializers.CharField()
Etnos_3_1 = serializers.CharField()
Nacionalnost_4_1 = serializers.CharField()
class Meta:
model = PatientImm... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,938 | meowmeowster/Heart | refs/heads/master | /Heart/resources/value_parse.py | # coding: utf-8
import xlrd
from django.db import models
from patient.models import Patient, PatientCharacters, PatientImmutableCharacters, PatientDiet, PatienDietBase, PatientInternet
from russian_names import RussianNames
def modify_name(name, colnum, sheets):
number = ''
name = name.replace('…', '')
... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,939 | meowmeowster/Heart | refs/heads/master | /patient/helper/np_convert.py | import numpy as np
from PIL import Image
from patient.models import Patient, PatientCharacters, PatientImmutableCharacters, PatientDiet, PatienDietBase, PatientInternet
from ..serializers.patiencharacters_serializer import PatientCharactersSerializer
def fun(ID_0_0):
pc = PatientCharacters.objects.filter(ID_0_0=... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,940 | meowmeowster/Heart | refs/heads/master | /patient/serializers/patient_internet_serializer.py | from rest_framework import serializers
from patient.models import PatientInternet
class PatientInternetSerializer(serializers.Serializer):
Zamechaniya_kuryaschim_detyam20_166_10 = serializers.CharField()
Zamechaniya_kuryaschim_podrostkam20_167_10 = serializers.CharField()
Zamechaniya_nezdorovoi_edy_deti21_... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,941 | meowmeowster/Heart | refs/heads/master | /patient/views.py | from django.shortcuts import render
from .views.create_patient_view import CreatePatients
| {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,942 | meowmeowster/Heart | refs/heads/master | /Heart/urls.py | from django.urls import include, path
from rest_framework import routers
from auth import views
from patient.views.create_patient_view import CreatePatients
router = routers.DefaultRouter()
router.register(r'patient', CreatePatients, basename='CreatePatients')
# Wire up our API using automatic URL routing.
# Additio... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
90,943 | meowmeowster/Heart | refs/heads/master | /patient/serializers/patiencharacters_serializer.py | from rest_framework import serializers
from patient.models import PatientCharacters
class PatientCharactersSerializer(serializers.Serializer):
Semya_2_1 = serializers.CharField()
Religiya_5_1 = serializers.CharField()
Mesto_prozhivaniya_1gorod_2selo_1_0 = serializers.CharField()
Obrazovanie_6_1 = seri... | {"/patient/serializers/patien_serializer.py": ["/patient/models.py"], "/doctor/models.py": ["/patient/models.py"], "/patient/views/create_patient_view.py": ["/Heart/resources/value_parse.py", "/patient/models.py", "/patient/serializers/patiencharacters_serializer.py", "/patient/serializers/patien_serializer.py", "/pati... |
91,002 | sharpvik/pylite | refs/heads/master | /pylite/ms.py | # PyLite commands:
# CREATE tablename WITH col1 col2 col3
# ADD col1_val col2_val col3_val TO tablename
# CHANGE col TO val WHERE colname=val IN tablename
# GET colname1 colname2 WHERE colname=val FROM tablename
# REMOVE colname=val FROM tablename
# DISPLAY tablename
# DELETE tablename
# EXIT
# IMPOR... | {"/auth.py": ["/pylite/ms.py"]} |
91,003 | sharpvik/pylite | refs/heads/master | /auth.py | from Crypto.Hash import SHA256
import pylite.ms as ms
def create_login_table():
ms.exec('CREATE auth WITH username password')
def add_user(username, password):
password = SHA256.new( data=bytes(password, 'ascii') ).hexdigest()
ms.exec(f'ADD {username} {password} TO auth')
def check_creds(usern... | {"/auth.py": ["/pylite/ms.py"]} |
91,006 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/algo/train.py | # -*- coding:utf-8 -*-
import time
# from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool
import numpy as np
import ailab.algo.algorithm as ag
import ailab.algo.data_process as dp
import matplotlib.pyplot as plt
def accuracy(y_data, y_predict):
# calculate the accuracy between tru... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,007 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/PassageClassifier/annotate.py | import datetime
import pickle
## python script from annotating passages.
import os, json
from IPython.display import clear_output
biaozhufilepath = './datafiles/biaozhu/'
passage_path = './passage.txt'
try: os.mkdir(biaozhufilepath)
except: pass
def getContentLabelPairs():
def f(x, other=''):
return {'1' ... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,008 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/algo/data_process.py | # -*- coding:utf-8 -*-
from ailab.db.db import DB
import numpy as np
import jieba.analyse as ja
import progressbar
import time
import csv
import glob
def field_index_string(request_field):
# get the column index corresponding to the field
field_string_all = ['id', 'mediumType', 'link', 'title', 'summary',
... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,009 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/algo/classify.py | # -*- coding:utf-8 -*-
import numpy as np
import ailab.algo.data_process as dp
def predict(x_data, model, algorithm):
# predict the labels using trained models
if algorithm == 'libsvm':
return predict_libsvm(x_data, model)
# else: y = sign(xw + b)
# model
w = model[0]
b = model[1]
... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,010 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/exec/tasks/similarity/simhash_task.py | # -*- coding:utf-8 -*-
from ailab.similarity.simhash import Simhash
def main():
# class
a = Simhash(config='../../config/config.yaml')
#a.load_recent_simhash(5)
# a new article
id_str = 'myID'
article = u"wo我节日哦安乐的师傅看见啊手机费 i 哦挖掘饿啊李开复卡勒季斯的风景哦爱就违法礼卡就是快乐的卷发哦 is 的减肥了啊我看见俄方哦爱就啥都发生的快放假啦说的减肥啊哦 is 的家发... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,011 | PalmDrive/ainterest-pipeline | refs/heads/master | /ai_gateway/ai_gateway/settings/production.py | # for now fetch the development settings only
from dev import *
ALLOWED_HOSTS = ['ainterest-service-production.ailingual.cn']
| {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,012 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/similarity/simhash.py | # encoding=utf-8
from __future__ import absolute_import
from ailab.db.db import DB
from simhash import Simhash as sim
from simhash import SimhashIndex
import jieba
class Simhash(object):
def __init__(self, config):
self.config = config
self.db = DB(self.config)
self.index = SimhashIndex([... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,013 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/tasks/field/field_class.py | # -*- coding:utf-8 -*-
from ailab.tasks.multi_tasks import MultiClass
class FieldClass(MultiClass):
def __init__(self, model_dir="../../../output/field"):
MultiClass.__init__(self)
# not editable
self.__request = 'field'
self.__model_dir = model_dir
def classify(self, articl... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,014 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/db/db.py | # -*- coding:utf-8 -*-
import pymysql
import progressbar
import time
import yaml
import os
TEST_MODE = False
class DB:
def __init__(self, config=None):
self.__config = None
self.set_config(config)
def set_config(self, config=None):
# if empty or None: do nothing
if confi... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,015 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/tasks/content_type/content_type_train.py | # -*- coding:utf-8 -*-
from ailab.tasks.multi_tasks import MultiTrain
class ContentTypeTrain(MultiTrain):
def __init__(self, output_dir="../../../output/content_type"):
MultiTrain.__init__(self)
# not editable
self.__request = 'content_type'
self.__output_dir = output_dir
de... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,016 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/tasks/multi_tasks.py | # -*- coding:utf-8 -*-
import glob
import numpy as np
import ailab.algo.data_process as utils
from ailab.algo import train
from ailab.algo.classify import predict
from ailab.db.db import DB
# If save data
IF_SAVE = False
# If show results
IF_SHOW_RESULT = True
# If plot
IF_PLOT = False
class MultiClass:
def ... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,017 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/PassageClassifier/utils.py | import numpy as np
class DataGenerator(object):
def __init__(self, batch_size = 50, shuffle=True, filepath):
"""
initilization
"""
self.num = 450000
self.dim = 3000
self.y_dim = 5
self.datafile = filepath
self.batch_size=batch_size
self.shuff... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,018 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/exec/tasks/similarity/similar_task.py | # -*- coding:utf-8 -*-
from ailab.similarity.similarity import Similarity
def main():
# class
a = Similarity(model_dir='../../../output/similarity')
# connect
a.connect('../../config/config.yaml')
# load recent articles and train a new model
a.base(10)
# save this model
a.save()
... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,019 | PalmDrive/ainterest-pipeline | refs/heads/master | /ai_gateway/api/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
import sys
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from api import classifiers, similarity
reload(sys)
sys.setdefaultencoding('utf-8')
def classify(request):
data = json.loads(request.bo... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,020 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/PassageClassifier/wordEmCNN.py | from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras.layers import Dense, Input, Flatten, Dropout
from keras.layers import Conv1D, MaxPool1D, Embedding
from keras.models import Model
from keras import regularizers
MAX_SE... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,021 | PalmDrive/ainterest-pipeline | refs/heads/master | /ai_gateway/api/__init__.py | from ailab.similarity.similarity import Similarity
from ailab.tasks.content_type.content_type_class import ContentTypeClass
from ailab.tasks.field.field_class import FieldClass
from ailab.tasks.position.position_class import PositionClass
default_app_config = 'api.apps.ApiConfig'
classifiers = {
'field': FieldCla... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,022 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/setup.py | from setuptools import setup
from setuptools import find_packages
setup(name='ailab',
version='0.0.1',
description='ailab for ai gateway',
install_requires=['numpy', 'progressbar', 'pymysql',
'jieba', ],
extras_require={},
packages=find_packages())
| {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,023 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/similarity/similarity.py | # -*- coding:utf-8 -*-
import time
import os
import glob
from gensim.models.doc2vec import Doc2Vec
import ailab.similarity.similarity_utils as sim_util
class Similarity:
def __init__(self, model_dir=None, config=None):
# initial: no model nor id_list
self.__model = None
self.__id_list = ... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,024 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/exec/tasks/position/position_class_task.py | # -*- coding:utf-8 -*-
from ailab.tasks.position.position_class import PositionClass
def main():
# data
# articles_str = get_data_file()
articles_str_1 = '心理学, 诸如, 各位, 经典, 艺术'
articles_str_2 = ['This is a good classifier.', '也可以处理列表']
# class
a = PositionClass()
a.algorithm('l1dcd')
... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,025 | PalmDrive/ainterest-pipeline | refs/heads/master | /ai_gateway/api/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^classify', views.classify, name='classify'),
url(r'^similarity', views.duplicate, name='similarity'),
] | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,026 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/similarity/similarity_utils.py | # -*- coding:utf-8 -*-
import jieba
import jieba.analyse as jieba_analyse
import time
from ailab.db.db import DB
from multiprocessing import Pool as ThreadPool
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
def test_connect(config=None):
# database
db = DB(config)
# set
config = db.set_co... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,027 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/exec/tasks/position/position_train_task.py | # -*- coding:utf-8 -*-
from ailab.tasks.position.position_train import PositionTrain
def main():
# class
a = PositionTrain(output_dir="../../../output/position")
a.connect('../../config/config.yaml')
# algorithm
a.algorithm('l1dcd')
# thread
a.thread(4)
# train
a.train()
#... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,028 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/algo/algorithm.py | # -*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
# import numba as nb
# from numba import jit
# Primal:
# min 0.5||w||_2^2 + C sum(i: 1 - m) max(0, 1 - yi (w^T xi)) + D ||w||_1
#
# equivalent to: min 0.5||w||_2^2 + C/2 sum(i: 1 - m) [|1 - yi (w^T xi)| + (1 - yi (w^T xi))] + D||w||_1... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,029 | PalmDrive/ainterest-pipeline | refs/heads/master | /ailab/ailab/PassageClassifier/charCNN.py | MAX_SEQUENCE_LENGTH = 1000
VALIDATION_SPLIT = 0.2
import pandas as pd
import jieba
content_and_label_path = '../content_and_label'
data = pd.read_msgpack(content_and_label_path)
# load in stopwords and define passage segmentation function
stopwords = []
stop_words_path = '../stop_words.txt'
with open(stop_words_path,... | {"/ai_gateway/api/urls.py": ["/ai_gateway/api/__init__.py"]} |
91,031 | davifcs/parking_spot | refs/heads/master | /src/utils.py | import os
import torch
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from sklearn.cluster import KMeans
def k_means_clusters(xy, n_clusters):
kmeans = KMeans(n_clusters=n_clusters, random_state=0).fit(xy)
return kmeans.cluster_centers_
def detections(detected, target):
n_detections = [... | {"/src/main.py": ["/src/utils.py"]} |
91,032 | davifcs/parking_spot | refs/heads/master | /src/model.py | import torch
from pytorch_lightning import LightningModule
from sklearn.metrics import confusion_matrix, classification_report
class SlotOccupancyClassifier(LightningModule):
def __init__(self, model_repo, model_name, pretrained, learning_rate):
super().__init__()
self.criterion = torch.nn.CrossE... | {"/src/main.py": ["/src/utils.py"]} |
91,033 | davifcs/parking_spot | refs/heads/master | /src/main.py | import os
import argparse
import json
import numpy as np
import pandas as pd
import torch
from torch.utils.data import DataLoader
from torchvision import transforms
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from dataset import CNRExtDataloader, CNRExtPatchesDataset... | {"/src/main.py": ["/src/utils.py"]} |
91,034 | davifcs/parking_spot | refs/heads/master | /src/dataset.py | import os
import glob
import pandas as pd
import numpy as np
from torch.utils.data import Dataset
from PIL import Image
class CNRExtDataloader():
def __init__(self,
targets_dir: str = '',
images_dir: str = '',
weather: list = [],
camera_ids: lis... | {"/src/main.py": ["/src/utils.py"]} |
91,064 | OmarThinks/pymongo-project | refs/heads/master | /src/categories/apps.py | from django.apps import AppConfig
class CatgoriesConfig(AppConfig):
name = 'catgories'
| {"/src/products/views.py": ["/src/products/models.py"], "/src/categories/views.py": ["/src/categories/models.py"]} |
91,065 | OmarThinks/pymongo-project | refs/heads/master | /src/products/views.py | from rest_framework import viewsets
from .models import Product, ProductSerializer
# ViewSets define the view behavior.
class ProductViewSet(viewsets.ModelViewSet):
queryset = Product.objects.all()
serializer_class = ProductSerializer
| {"/src/products/views.py": ["/src/products/models.py"], "/src/categories/views.py": ["/src/categories/models.py"]} |
91,066 | OmarThinks/pymongo-project | refs/heads/master | /app.py | from pymongo import MongoClient
from pprint import pprint
client = MongoClient('localhost', 27017)
print(client.list_database_names())
db = client.test_database
import datetime
post = {"author": "Mike", "text": "My first blog post!",
"tags": ["mongodb", "python", "pymongo"],
"date": datetime.datetime... | {"/src/products/views.py": ["/src/products/models.py"], "/src/categories/views.py": ["/src/categories/models.py"]} |
91,067 | OmarThinks/pymongo-project | refs/heads/master | /src/categories/models.py | from django.db import models
from rest_framework import serializers
class Category(models.Model):
name = models.CharField(max_length=60)
parent = models.ForeignKey("self", null=True,
blank=True, on_delete = models.SET_NULL,
related_name='children')
# Serializers define the API representati... | {"/src/products/views.py": ["/src/products/models.py"], "/src/categories/views.py": ["/src/categories/models.py"]} |
91,068 | OmarThinks/pymongo-project | refs/heads/master | /src/products/models.py | from django.db import models
from rest_framework import serializers
from categories.models import Category
class Product(models.Model):
product_code = models.CharField(max_length=50)
name = models.CharField(max_length=200)
price = models.FloatField()
quantity = models.FloatField()
categories = models.ManyToMany... | {"/src/products/views.py": ["/src/products/models.py"], "/src/categories/views.py": ["/src/categories/models.py"]} |
91,069 | OmarThinks/pymongo-project | refs/heads/master | /src/categories/views.py | from rest_framework import viewsets
from .models import Category, CategorySerializer
from rest_framework.settings import api_settings
# ViewSets define the view behavior.
class CategoryViewSet(viewsets.ModelViewSet):
queryset = Category.objects.all()
serializer_class = CategorySerializer
#pagination_cla... | {"/src/products/views.py": ["/src/products/models.py"], "/src/categories/views.py": ["/src/categories/models.py"]} |
91,077 | CPrescher/ImagDI-backend | refs/heads/master | /imagdi/util/FileIteration.py | import os
import re
def get_next_file(path, step=1, pos=None):
return iterate_file_number(path, step, pos)
def get_previous_file(path, step=1, pos=None):
return iterate_file_number(path, -step, pos)
def iterate_file_number(path, step, pos=None):
directory, file_str = os.path.split(path)
pattern = ... | {"/tests/test_flask.py": ["/imagdi/__init__.py"], "/imagdi/__init__.py": ["/imagdi/util/FileIteration.py", "/imagdi/util/math.py"]} |
91,078 | CPrescher/ImagDI-backend | refs/heads/master | /tests/test_flask.py | import os
import shutil
import io
import unittest
import tempfile
from pathlib import Path
from PIL import Image
import numpy as np
from imagdi import create_app
def create_temp_tiff(img_data):
temp_file_dir = Path(tempfile.gettempdir(), "imagdi")
temp_file_dir.mkdir(exist_ok=True)
temp_file_path = Path... | {"/tests/test_flask.py": ["/imagdi/__init__.py"], "/imagdi/__init__.py": ["/imagdi/util/FileIteration.py", "/imagdi/util/math.py"]} |
91,079 | CPrescher/ImagDI-backend | refs/heads/master | /imagdi/__init__.py | import io
import time
from copy import deepcopy
import flask
from flask import request, jsonify, send_file
from flask_cors import CORS
import numpy as np
import fabio
from imagdi.util.FileIteration import get_next_file, get_previous_file
from imagdi.util.math import gaussian_2d
class ImgBrowser:
def __init__(s... | {"/tests/test_flask.py": ["/imagdi/__init__.py"], "/imagdi/__init__.py": ["/imagdi/util/FileIteration.py", "/imagdi/util/math.py"]} |
91,080 | CPrescher/ImagDI-backend | refs/heads/master | /imagdi/util/math.py | import numpy as np
def gaussian_2d(x_dim, y_dim, amplitude, center_x, center_y, fwhm_x, fwhm_y, theta):
x = np.arange(0, x_dim, 1)
y = np.arange(0, y_dim, 1)
x, y = np.meshgrid(x, y)
sigma_x = fwhm_x/2.35482
sigma_y = fwhm_y/2.35482
a = (np.cos(theta) ** 2) / (2 * sigma_x ** 2) + (np.sin(the... | {"/tests/test_flask.py": ["/imagdi/__init__.py"], "/imagdi/__init__.py": ["/imagdi/util/FileIteration.py", "/imagdi/util/math.py"]} |
91,081 | thet4mir/recruit | refs/heads/master | /application/migrations/0026_auto_20190228_1140.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-28 03:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0025_auto_20190228_1000'),
]
operations = [
migrations.AlterFi... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,082 | thet4mir/recruit | refs/heads/master | /application/migrations/0012_address1_address2.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-21 07:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0011_auto_20190220_1026'),
]
operatio... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,083 | thet4mir/recruit | refs/heads/master | /application/migrations/0017_abilityofsport_advantage_awardsandprize_maritalstatus.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-24 06:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0016_auto_20190224_1254'),
]
operatio... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,084 | thet4mir/recruit | refs/heads/master | /application/migrations/0010_auto_20190219_1446.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-19 06:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('application', '0009_auto_2019021... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,085 | thet4mir/recruit | refs/heads/master | /application/forms.py | from django import forms
from crispy_forms.helper import FormHelper
from .models import General, Experience, Education, Computerskills, Otherskills, City, Country, Languageknowledge, Advantage, Abilityofsport, Awardsandprize, Maritalstatus, Youraddress, Emergency_number, Discription, Driverskill
class GeneralForm(form... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,086 | thet4mir/recruit | refs/heads/master | /application/migrations/0021_auto_20190225_0905.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-25 01:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0020_auto_20190225_0902'),
]
operations = [
migrations.AlterFi... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,087 | thet4mir/recruit | refs/heads/master | /application/admin.py | from django.contrib import admin
from django.conf.urls import url
from django.utils.html import format_html
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.utils.html import format_html
from application import views
from django.http import HttpResponse
from... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,088 | thet4mir/recruit | refs/heads/master | /application/migrations/0014_language.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-24 04:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0013_auto_20190222_1706'),
]
operatio... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,089 | thet4mir/recruit | refs/heads/master | /application/models.py | from django.db import models
from django.utils import timezone
# Create your models here.
class Address_type(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Gender(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,090 | thet4mir/recruit | refs/heads/master | /application/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-22 02:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateMode... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,091 | thet4mir/recruit | refs/heads/master | /recruit/views.py | from django.views.generic import TemplateView
from django.shortcuts import redirect
from account import views
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
class HomePage(LoginRequiredMixin,TemplateView):
... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,092 | thet4mir/recruit | refs/heads/master | /application/migrations/0006_auto_20190125_1623.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-25 08:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('application', '0005_auto_20190125_1540'),
]
operations =... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,093 | thet4mir/recruit | refs/heads/master | /application/migrations/0009_auto_20190219_1128.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-19 03:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0008_auto_20190214_1133'),
]
operations = [
migrations.AlterFi... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,094 | thet4mir/recruit | refs/heads/master | /application/migrations/0024_auto_20190228_0949.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-28 01:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0023_auto_20190226_1008'),
]
operatio... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,095 | thet4mir/recruit | refs/heads/master | /application/migrations/0005_auto_20190125_1540.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-25 07:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0004_computerskills'),
]
operations = [
migrations.AlterField(... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,096 | thet4mir/recruit | refs/heads/master | /application/migrations/0004_computerskills.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-25 07:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0003_auto_20190125_1449'),
]
operatio... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,097 | thet4mir/recruit | refs/heads/master | /application/urls.py | from django.conf.urls import url
from application import views
from django.views.generic import TemplateView
app_name = "application"
urlpatterns = [
url(r'^cv/$', views.create, name="create"),
url(r'^endofpage/$', TemplateView.as_view(template_name='application/endofpage.html'), name="endofpage"),
]
| {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,098 | thet4mir/recruit | refs/heads/master | /application/migrations/0013_auto_20190222_1706.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-22 09:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0012_address1_address2'),
]
operations = [
migrations.RemoveFi... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,099 | thet4mir/recruit | refs/heads/master | /application/migrations/0003_auto_20190125_1449.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-25 06:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0002_education_experience'),
]
operat... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,100 | thet4mir/recruit | refs/heads/master | /application/migrations/0028_auto_20190305_1224.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-05 04:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('application', '0027_auto_20190228_1321'),
]
operatio... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,101 | thet4mir/recruit | refs/heads/master | /application/migrations/0025_auto_20190228_1000.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-28 02:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0024_auto_20190228_0949'),
]
operations = [
migrations.RemoveF... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,102 | thet4mir/recruit | refs/heads/master | /application/views.py | from django.shortcuts import render, redirect
from .models import General, Experience, Education, Computerskills, Otherskills, City, Country, Languageknowledge, Advantage, Abilityofsport, Awardsandprize, Maritalstatus, Youraddress, Discription, Driverskill, Emergency_number
from .forms import GeneralForm, ExperienceFor... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,103 | thet4mir/recruit | refs/heads/master | /application/migrations/0002_education_experience.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-22 08:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('application', '0001_initial'),
... | {"/application/forms.py": ["/application/models.py"], "/application/admin.py": ["/application/models.py"], "/application/views.py": ["/application/models.py", "/application/forms.py"]} |
91,104 | elizabethdinella/Let-s-play | refs/heads/master | /Game.py | import urllib2
def extract(source, criteria):
criteria = '"' + criteria + '":'
source = source[source.find(criteria) + len(criteria):]
source = source[:source.find(',"')]
return source
class Game(object):
def __init__(self, gameInfo):
self.name = extract(gameI... | {"/User.py": ["/Game.py", "/Friend.py"], "/Friend.py": ["/Game.py"]} |
91,105 | elizabethdinella/Let-s-play | refs/heads/master | /User.py | import urllib2
from Game import *
from Friend import *
class User(object):
def __init__(self, url, numberOfFriends, listOfFriends):
self.games = set()
page = urllib2.urlopen(url + "/games/?tab=all")
source = page.read()
source = source[source.find("var rg... | {"/User.py": ["/Game.py", "/Friend.py"], "/Friend.py": ["/Game.py"]} |
91,106 | elizabethdinella/Let-s-play | refs/heads/master | /Friend.py | import urllib2
from Game import *
class Friend(object):
def __init__(self, name, url):
self.name = name
self.games = set()
page = urllib2.urlopen(url + "/games/?tab=all")
source = page.read()
source = source[source.find("var rgGames = [{"):]
... | {"/User.py": ["/Game.py", "/Friend.py"], "/Friend.py": ["/Game.py"]} |
91,107 | elizabethdinella/Let-s-play | refs/heads/master | /letsPlay.py | import urllib2
import random
from Game import *
from Friend import *
from User import *
while(True):
userUrl = raw_input("enter your steam profile URL ")
numberOfFriends = raw_input("how many friends are you playing with? ")
while not numberOfFriends.isdigit():
numberOfFriends = raw... | {"/User.py": ["/Game.py", "/Friend.py"], "/Friend.py": ["/Game.py"]} |
91,110 | ketul14/Text-Analysis | refs/heads/master | /FlaskApps/testUpload.py | import flask
from flask import request, jsonify, render_template, sessions
import os
app = flask.Flask(__name__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET', 'POST'])
def hello():
if request.method == "POST":
file = request.files["file"]
file.save(os.path.json(app.config['UP... | {"/FlaskApps/SentimentAPI.py": ["/NLP.py"]} |
91,111 | ketul14/Text-Analysis | refs/heads/master | /NER.py | #########################################################################
# Title: Name Entity Recognize Using spaCy
#########################################################################
#########################################################################
# Loading packages
###################################... | {"/FlaskApps/SentimentAPI.py": ["/NLP.py"]} |
91,112 | ketul14/Text-Analysis | refs/heads/master | /NLP.py | ###############################################################
# Title: Natural Language Processing
###############################################################
###############################################################
# Loading packages
###############################################################
# Impor... | {"/FlaskApps/SentimentAPI.py": ["/NLP.py"]} |
91,113 | ketul14/Text-Analysis | refs/heads/master | /FlaskApps/SentimentAPI.py | ###############################################################
# Title: Flask App for Sentimental of Text
###############################################################
import flask
import os
import requests
from flask import request, jsonify, render_template, sessions, make_response
from nltk.corpus impor... | {"/FlaskApps/SentimentAPI.py": ["/NLP.py"]} |
91,114 | kylepamintuan/django-intro | refs/heads/master | /users/views.py | from django.shortcuts import render
from django.http.response import JsonResponse
from rest_framework.parsers import JSONParser
from rest_framework import status
from users.models import User
from users.serializers import UserSerializer
from rest_framework.decorators import api_view
from scripts.helloWorld import ge... | {"/users/views.py": ["/scripts/helloWorld.py"], "/scripts/helloWorld.py": ["/config.py"]} |
91,115 | kylepamintuan/django-intro | refs/heads/master | /users/urls.py | from django.conf.urls import url
from users import views
urlpatterns = [
url(r'^api/users$', views.user_list),
url(r'^api/users/(?P<pk>[0-9]+)$', views.user_detail),
url(r'^api/users/email$', views.user_list_email),
url(r'^api/ml_ai$', views.ml_ai),
] | {"/users/views.py": ["/scripts/helloWorld.py"], "/scripts/helloWorld.py": ["/config.py"]} |
91,116 | kylepamintuan/django-intro | refs/heads/master | /scripts/helloWorld.py | from config import MODE
def getStr():
print(MODE)
return 'hello world' | {"/users/views.py": ["/scripts/helloWorld.py"], "/scripts/helloWorld.py": ["/config.py"]} |
91,117 | kylepamintuan/django-intro | refs/heads/master | /config.py | import os
MODE = os.getenv('MODE')
# print(MODE) | {"/users/views.py": ["/scripts/helloWorld.py"], "/scripts/helloWorld.py": ["/config.py"]} |
91,132 | vishnusk12/CoffeeBot | refs/heads/master | /CoffeeBot/CoffeeBot/urls.py | from django.conf.urls import url, include
from django.contrib import admin
from .views import Bot
from rest_framework import routers
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'bot/Response', Bot, 'Bot')
urlpatterns = [url(r'^', include(router.urls)), ] | {"/CoffeeBot/CoffeeBot/urls.py": ["/CoffeeBot/CoffeeBot/views.py"]} |
91,133 | vishnusk12/CoffeeBot | refs/heads/master | /CoffeeBot/CoffeeBot/appos.py | appos = {
"aren't": "are not",
"can't": "cannot",
"couldn't": "could not",
"didn't": "did not",
"doesn't": "does not",
"don't": "do not",
"hadn't": "had not",
"hasn't": "has not",
"haven't": "have not",
"he'd": "he would",
... | {"/CoffeeBot/CoffeeBot/urls.py": ["/CoffeeBot/CoffeeBot/views.py"]} |
91,134 | vishnusk12/CoffeeBot | refs/heads/master | /CoffeeBot/CoffeeBot/config_updated.py | from nltk.stem.wordnet import WordNetLemmatizer
from sklearn.externals import joblib
from .models import RequestCache
import dill
import aiml
from appos import *
from nltk.tokenize import word_tokenize
import string
import re
from CoffeeBot.models import UserCache
exclude = set(string.punctuation)
lemma = WordNetLemma... | {"/CoffeeBot/CoffeeBot/urls.py": ["/CoffeeBot/CoffeeBot/views.py"]} |
91,135 | vishnusk12/CoffeeBot | refs/heads/master | /CoffeeBot/CoffeeBot/upfront_classifier.py | import pandas as pd
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import SGDClassifier
from sklearn.pipeline import Pipeline
from sklearn.externals import joblib
os.chdir('C:/Users/vishnu.sk/Desktop')
count_v... | {"/CoffeeBot/CoffeeBot/urls.py": ["/CoffeeBot/CoffeeBot/views.py"]} |
91,136 | vishnusk12/CoffeeBot | refs/heads/master | /CoffeeBot/CoffeeBot/views.py | from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.decorators import permission_classes
from rest_framework import permissions
from config_updated import create_cache
from model_building import build_model
from appos import welcome_note
from appos import price
import di... | {"/CoffeeBot/CoffeeBot/urls.py": ["/CoffeeBot/CoffeeBot/views.py"]} |
91,137 | vishnusk12/CoffeeBot | refs/heads/master | /CoffeeBot/CoffeeBot/model_building.py | from config_updated import preprocess
from config_updated import get_count
from config_updated import get_item
from config_updated import get_sugar
from config_updated import top_classifier
import random
from appos import *
def generate_reply_for_items(reply, Dia):
items = ['espresso', 'doppio', 'macchiato', 'ris... | {"/CoffeeBot/CoffeeBot/urls.py": ["/CoffeeBot/CoffeeBot/views.py"]} |
91,138 | Younghao1997/daily_fresh | refs/heads/master | /df_cart/models.py | # coding=utf-8
from django.db import models
# Create your models here.
# 当一对多关系时例如生鲜分类对生鲜具体商品, 将关系维护在多的那张表中,即在具体商品表中维护
# 当多对多关系,则新建一张表,在再第三张表中维护表关系
# 用户表与商品表则将关系维护在购物车表中
# 在购物车的逻辑删除与物理删除 选择物理删除,
# 购物车中的商品不属于重要的信息,可以直接删除
class CartInfo(models.Model):
user = models.ForeignKey('df_user.UserInfo', on_delete=models... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,139 | Younghao1997/daily_fresh | refs/heads/master | /df_goods/admin.py | # coding=utf-8
# superuser: root 123123...
from django.contrib import admin
from .models import TypeInfo,GoodsInfo
# Register your models here.
#注册模型类 普通方法
class TypeInfoAdmin(admin.ModelAdmin):
list_display = ['id', 'ttitle']
# class GoodsInfoAdmin(admin.ModelAdmin):
# list_per_page = 15
# list_display... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,140 | Younghao1997/daily_fresh | refs/heads/master | /df_order/models.py | # coding=utf-8
from django.db import models
# Create your models here.
class OrderInfo(models.Model): # 大订单
oid = models.CharField(max_length=20, primary_key=True) # 订单号
user = models.ForeignKey('df_user.UserInfo', on_delete=models.CASCADE) # 确定哪个用户的订单
odate = models.DateTimeField(auto_now=True)
oI... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,141 | Younghao1997/daily_fresh | refs/heads/master | /df_goods/urls.py | #!/user/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
from .views import *
app_name = 'df_goods'
urlpatterns = [
url('^$', views.index),
url('^list(\d+)_(\d+)_(\d+)/$', views.list),
url('^(\d+)/$', views.detail),
url(r'^search/', MySearchView()),#全文检索
... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,142 | Younghao1997/daily_fresh | refs/heads/master | /df_goods/models.py | # coding=utf-8
from django.db import models
from tinymce.models import HTMLField
# from tinymce.models import HTMLField#使用富文本编辑框要在settings文件中安装
# 将一对多的关系维护在GoodsInfo中维护,另外商品信息与分类信息都属于重要信息需要使用逻辑删除
# Create your models here.
class TypeInfo(models.Model): # 商品分类信息 水果 海鲜等
isDelete = models.BooleanField(default=Fals... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,143 | Younghao1997/daily_fresh | refs/heads/master | /df_user/user_decorator.py | # -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect
import re
#如果未登录则转到登陆页面
def login(func):
def login_fun(request, *args, **kwargs):
if 'user_id' in request.session:
return func(request, *args, **kwargs)
else:
red = HttpResponseRedirect('/user/login/')
... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,144 | Younghao1997/daily_fresh | refs/heads/master | /df_goods/views.py | # coding=utf-8
from django.shortcuts import render, HttpResponse
from .models import *
from django.core.paginator import Page, Paginator
from df_cart.models import CartInfo
from df_user.models import GoodsBrowser
from haystack.views import SearchView
# Create your views here.
def index(request):
# 查询各个分类的最新4条,最热4... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
91,145 | Younghao1997/daily_fresh | refs/heads/master | /df_user/views.py | # coding=utf-8
# coding=utf-8
from django.shortcuts import render, redirect, HttpResponseRedirect, HttpResponse
from django.http import JsonResponse
from .models import UserInfo
from df_goods.models import GoodsInfo
from df_user.models import GoodsBrowser
from df_order.models import *
from hashlib import sha1
from . im... | {"/df_goods/admin.py": ["/df_goods/models.py"], "/df_goods/urls.py": ["/df_goods/views.py"], "/df_goods/views.py": ["/df_goods/models.py", "/df_cart/models.py"], "/df_user/views.py": ["/df_goods/models.py", "/df_order/models.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.