index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
63,283
IwanVonNeumann/FinAutMin
refs/heads/master
/minimization.py
def new_states_map(C): Q_ = {} i = 1 for c in C: q_name = new_name(i) Q_[q_name] = c i += 1 return Q_ def new_name(i): return "q{}~".format(i) def new_output_rules(A, q_map, old_out): new_out = {} for q_new in q_map.keys(): q_old = list(q_map[q_new])[0] ...
{"/main.py": ["/equality.py", "/minimization.py"], "/solution.py": ["/equality.py", "/minimization.py", "/protocol.py"]}
63,292
ArJunGawali/Gym
refs/heads/master
/Gym/models.py
from django.db import models from io import BytesIO from PIL import Image from django.core.files import File def compress(image): im = Image.open(image) im_io = BytesIO() im.save(im_io, 'JPEG', quality=60) new_image = File(im_io, name=image.name) return new_image class img(models.Model): tit...
{"/Gym/forms.py": ["/Gym/models.py"], "/Gym/views.py": ["/Gym/forms.py", "/Gym/models.py"], "/Gym/admin.py": ["/Gym/models.py"]}
63,293
ArJunGawali/Gym
refs/heads/master
/Gym/forms.py
from .models import img from django import forms class imgform(forms.ModelForm): class Meta: model = img fields = ('title', 'cover',) labels = { 'title' : ('Security Code'), 'cover' : ('Photo') } widgets = { 'title': forms.PasswordInput( attrs={ 'class':...
{"/Gym/forms.py": ["/Gym/models.py"], "/Gym/views.py": ["/Gym/forms.py", "/Gym/models.py"], "/Gym/admin.py": ["/Gym/models.py"]}
63,294
ArJunGawali/Gym
refs/heads/master
/Gym/views.py
from django.shortcuts import render from .forms import imgform from django.shortcuts import redirect from .models import img from django.core.files.storage import FileSystemStorage from .settings import MEDIA_URL # Create your views here. URL = 'http://127.0.0.1:8000/' def index(request): return render(request,'bas...
{"/Gym/forms.py": ["/Gym/models.py"], "/Gym/views.py": ["/Gym/forms.py", "/Gym/models.py"], "/Gym/admin.py": ["/Gym/models.py"]}
63,295
ArJunGawali/Gym
refs/heads/master
/Gym/admin.py
from django.contrib import admin from .models import img admin.site.register(img)
{"/Gym/forms.py": ["/Gym/models.py"], "/Gym/views.py": ["/Gym/forms.py", "/Gym/models.py"], "/Gym/admin.py": ["/Gym/models.py"]}
63,363
PaulPruliere/fredflaskapi
refs/heads/master
/fetchingBis.py
import numpy as np import pandas as pd from collections import Counter from itertools import chain import json import requests def import_data(spreadsheet): """Import data spreadsheet as dataframe and reshape it.""" df = pd.read_csv(spreadsheet,header=1,index_col="Unnamed: 1") del df["Unnamed: 0"] df =...
{"/fredapp.py": ["/fetchingBis.py"]}
63,364
PaulPruliere/fredflaskapi
refs/heads/master
/fetching.py
import numpy as np import pandas as pd from collections import Counter import json import requests def import_data(spreadsheet): """Import data spreadsheet as dataframe and reshape it.""" df = pd.read_csv(spreadsheet,header=1,index_col="Unnamed: 1") del df["Unnamed: 0"] df = df.T return df def get...
{"/fredapp.py": ["/fetchingBis.py"]}
63,365
PaulPruliere/fredflaskapi
refs/heads/master
/fredapp.py
import os from flask import Flask, render_template from fetchingBis import fetcher app = Flask(__name__) app.debug = True @app.route('/probabilities/<path:path>') def probabilities(path): spreadsheet = "dataset-code-challenge - personalities_data.csv" data = fetcher(path,spreadsheet) return render_templa...
{"/fredapp.py": ["/fetchingBis.py"]}
63,367
MoAlrubaie/SentimentAnalysis
refs/heads/master
/helper.py
from nltk.corpus import stopwords from nltk.tokenize import TweetTokenizer from nltk.stem import PorterStemmer import string import re happy_emotion_icons_set = set([ ':-)', ':)', ';)', ':o)', ':]', ':3', ':c)', ':>', '=]', '8)', '=)', ':}', ':^)', ':-D', ':D', '8-D', '8D', 'x-D', 'xD', 'X-D', 'XD', '=-D', '=D...
{"/display.py": ["/twitterSentimentAnalysis.py", "/helper.py"], "/twitterSentimentAnalysis.py": ["/helper.py"]}
63,368
MoAlrubaie/SentimentAnalysis
refs/heads/master
/display.py
import tkinter as tk import twitterSentimentAnalysis from helper import helperClass classifier = twitterSentimentAnalysis.get_classifier() helper = helperClass() root= tk.Tk() canvas1 = tk.Canvas(root, width = 400, height = 400, relief = 'raised') canvas1.pack() lbl1 = tk.Label(root, text='Tweet Sentiment Analysis...
{"/display.py": ["/twitterSentimentAnalysis.py", "/helper.py"], "/twitterSentimentAnalysis.py": ["/helper.py"]}
63,369
MoAlrubaie/SentimentAnalysis
refs/heads/master
/twitterSentimentAnalysis.py
from nltk.corpus import twitter_samples from nltk import classify from nltk import NaiveBayesClassifier from random import shuffle from helper import helperClass helper = helperClass() #preview the data fields print (twitter_samples.fileids()) #Split the data in groups positive_tweets = twitter_samples.strings('posi...
{"/display.py": ["/twitterSentimentAnalysis.py", "/helper.py"], "/twitterSentimentAnalysis.py": ["/helper.py"]}
63,370
ahyeek78/ReaToyRobot
refs/heads/master
/test-rea-robot.py
#!/usr/bin/python # -*- coding: utf-8 -*- ##################################################################################################################################################################### ## Start Date: 19-Feb-2019 ## Last Modified: 23-Feb-2019 ## Version: 1.5 ## ## TDD - REA Robot Training Progra...
{"/test-rea-robot.py": ["/rea_robot.py"], "/rea_robot.py": ["/rea_robot_terminal.py"], "/rea_robot_terminal.py": ["/rea_robot.py"]}
63,371
ahyeek78/ReaToyRobot
refs/heads/master
/rea_robot.py
#!/usr/bin/python # -*- coding: utf-8 -*- ##################################################################################################################################################################### ## Start Date: 19-Feb-2019 ## Last Modified: 23-Feb-2019 ## Version: 1.5 ## ## REA Robot Training Program ## #...
{"/test-rea-robot.py": ["/rea_robot.py"], "/rea_robot.py": ["/rea_robot_terminal.py"], "/rea_robot_terminal.py": ["/rea_robot.py"]}
63,372
ahyeek78/ReaToyRobot
refs/heads/master
/rea_robot_terminal.py
#!/usr/bin/python # -*- coding: utf-8 -*- ##################################################################################################################################################################### ## Start Date: 22-Feb-2019 ## Last Modified: 23-Feb-2019 ## Version: 1.1 ## ## REA Robot Terminal Class ## 22-...
{"/test-rea-robot.py": ["/rea_robot.py"], "/rea_robot.py": ["/rea_robot_terminal.py"], "/rea_robot_terminal.py": ["/rea_robot.py"]}
63,373
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_dbn.py
import os import numpy as np from copper.ml.dbn.dbn import DBN from copper.tests.utils import eq_ def get_iris(): from sklearn import datasets iris = datasets.load_iris() X = iris.data Y = iris.target return X, Y def test_sklearn_api(): ''' sklearn API: not functionality ''' dbn = D...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,374
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/metrics.py
import numpy as np def rmsle(y_test, y_pred): ans = np.log1p(y_pred) - np.log1p(y_test) ans = np.power(ans, 2) return np.sqrt(ans.mean())
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,375
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/wrappers.py
# encoding: utf-8 import numpy as np from sklearn.base import BaseEstimator from sklearn.preprocessing import OneHotEncoder class FeatureMixer(BaseEstimator): def __init__(self, clfs, ignorefit=False): self.clfs = clfs self.ignorefit = ignorefit def fit_transform(self, X, y=None): if ...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,376
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/__init__.py
import copper.transform as t from copper.dataset import Dataset from copper.ml.compare import ModelComparison
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,377
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_transforms.py
from __future__ import division import math import random import copper import numpy as np import pandas as pd from nose.tools import raises from copper.tests.utils import eq_ def test_transform_int_regex(): eq_(copper.t.to_int('0.2'), 0) eq_(copper.t.to_int('.8753'), 8753) eq_(copper.t.to_int('3.2'), 3)...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,378
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/dbn/layers.py
# -*- coding: utf-8 -*- import numpy as np from utils import softmax, sigmoid class Layer(object): def __init__(self, n_in=None, n_out=None, W=None, b=None, random_state=None, activation=None): if random_state is None: self.rnd = np.random.RandomState() elif isinstance(random_state, in...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,379
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/utils/progress.py
# -*- coding: utf-8 -*- from __future__ import division, print_function import sys import uuid from IPython.display import HTML, Javascript, display class ProgressBar(object): ''' IPython Notebook ready text progressbar ''' def __init__(self, max, index=0, desc='', border='|', fill_char='#', width=50): ...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,380
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/compare.py
import copper import numpy as np import pandas as pd from sklearn import cross_validation # Metrics from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score from sklearn.metrics import roc_auc_score from sklearn.metrics import average_precision_score from sklearn.metrics import f1_score ...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,381
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/gdbn/__init__.py
from .gdbn import DBN as DBN
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,382
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/dbn/utils.py
# -*- coding: utf-8 -*- from __future__ import division import numpy as np def softmax(x): e = np.exp(x - np.max(x)) # prevent overflow if e.ndim == 1: return e / np.sum(e, axis=0) else: return e / np.array([np.sum(e, axis=1)]).T # ndim = 2 def sigmoid(x): return 1. / (1 + np.exp(-...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,383
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/utils/opti.py
# -*- coding: utf-8 -*- from __future__ import division, print_function import math import numpy as np from scipy import optimize def minibatches(X, y=None, batch_size=50, batches=-1, random_state=None): if random_state is None: rnd = np.random.RandomState() elif isinstance(random_state, int): ...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,384
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/transform.py
import re import numpy as np from sklearn.preprocessing import LabelEncoder intRE = re.compile('[-+]?[0-9]+') floatRE = re.compile('[-+]?[0-9]*\.?[0-9]+') def to_int(x): """ Convert from string to int. Usefull when used inside pandas.apply Regular expression: ``[-+]?[0-9]+`` Examples -------- >...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,385
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_compare_metrics_manual.py
from __future__ import division import copper import numpy as np import pandas as pd from copper.tests.utils import eq_ def get_train(): X = np.ones((12, 3)) y = ['b', 'z', 'b', 'g', 'g', 'z', 'b', 'z', 'g', 'b', 'g', 'z'] # [ 0, 2, 0, 1, 1, 2, 0, 2, 1, 0, 1, 0] df = pd.DataFr...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,386
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/data1.py
from bs4 import BeautifulSoup from urllib2 import urlopen BASE_URL = "http://espn.go.com/college-football/rankings" def get_team_links(section_url): html = urlopen(section_url).read() soup = make_soup(url) align_left_team = soup.find("tr", "") team_links = [BASE_URL + td.a["href"] for td in align_left_team.findAl...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,387
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_compare.py
from __future__ import division import math import random import copper import numpy as np import pandas as pd from sklearn import cross_validation from sklearn.linear_model import LogisticRegression from nose.tools import raises, ok_ from copper.tests.utils import eq_ def get_iris(): from sklearn import dataset...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,388
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_dataset.py
from __future__ import division import os import math import random import tempfile import copper import numpy as np import pandas as pd from nose.tools import raises from copper.tests.utils import eq_ # ----------------------------------------------------------------------------- # Pro...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,389
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/dbn/rbm.py
# -*- coding: utf-8 -*- from __future__ import division import numpy as np class RBM(object): ''' Note: this class was taken from yusugomori RBM https://github.com/yusugomori/DeepLearning/blob/master/python/RBM.py I modified the class to match my requirements but basicly is the same thing. ''' ...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,390
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/utils.py
import numpy as np import pandas as pd import numpy.testing as np_test import pandas.util.testing as pd_test from nose.tools import eq_ as nose_eq def eq_(ans, sol, digits=0): if type(ans) == np.ndarray and type(sol) == np.ndarray: array_eq(ans, sol, digits) elif type(ans) == pd.Series and type(sol) =...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,391
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_compare_metrics_iris.py
from __future__ import division import copper import pandas as pd from nose.tools import raises from copper.tests.utils import eq_ def get_iris(): from sklearn import datasets iris = datasets.load_iris() X = iris.data Y = iris.target return X, Y def get_iris_ds(): X, Y = get_iris() df ...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,392
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/tests/test_gdbn.py
from __future__ import division from copper.ml.gdbn.gdbn import DBN def get_iris(): from sklearn import datasets iris = datasets.load_iris() X = iris.data Y = iris.target return X, Y def test_basic(): ''' sklearn API: not functionality ''' dbn = DBN() X, y = get_iris() dbn....
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,393
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/dbn/__init__.py
from .dbn import DBN as DBN
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,394
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/data1infile.py
from bs4 import BeautifulSoup from urllib2 import urlopen import csv base_url = ("http://espn.go.com/college-football/rankings") soup = BeautifulSoup(urlopen(base_url).read()) teams = soup.find_all("td", "align-left team") team_urls = [td.a["href"] for td in teams] with open("data/src-ESPN_NCAAF_teams.tsv", "w") as...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,395
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/dataset.py
from __future__ import division import copper import pandas as pd class Dataset(dict): """ Wrapper around pandas.DataFrame introducing metadata to the different variables/columns making easier to interate in manual machine learning feature learning. Also provides access to basic data transformation such a...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,396
haiweiosu/WebScraping
refs/heads/master
/ESPNdata/copper/ml/dbn/dbn.py
from __future__ import division import math import json import numpy as np from sklearn.base import BaseEstimator from rbm import RBM from layers import SigmoidLayer from copper.utils import opti as MBOpti from utils import sigmoid from sklearn.neural_network import BernoulliRBM from copper.utils.progress import Prog...
{"/ESPNdata/copper/ml/dbn/__init__.py": ["/ESPNdata/copper/ml/dbn/dbn.py"]}
63,397
dani6666/TabuSearchSolvingTSP
refs/heads/master
/TSP.py
import random import time class TSP: @staticmethod def find_way(matrix, time_to_run): TSP.tabu_size = len(matrix) ** 2 deadline = time.time() + time_to_run n = len(matrix) permutation = [0] + random.sample(range(1, n), n - 1) best = permutation tabu_list = [per...
{"/main.py": ["/TSP.py"]}
63,398
dani6666/TabuSearchSolvingTSP
refs/heads/master
/main.py
import sys from TSP import TSP t_n_string = input().split(" ", 2) t = int(t_n_string[0]) n = int(t_n_string[1]) matrix = [] for i in range(n): matrix.append([int(mat) for mat in input().split(" ", n)]) result = TSP.find_way(matrix, t) print(result[1]) output = "" for i in range(n): output += str(result[0][i...
{"/main.py": ["/TSP.py"]}
63,399
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/migrations/0003_auto_20210502_0017.py
# Generated by Django 2.2.8 on 2021-05-01 18:47 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0002_student_trigger'), ] operations = [ migrations.RemoveField( model_name='student', name='regno', ), ...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,400
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/migrations/0005_question.py
# Generated by Django 3.2.1 on 2021-05-06 12:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0004_trigger_lang'), ] operations = [ migrations.CreateModel( name='Question', fields=[ ('id'...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,401
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/views.py
import xlwt from app.models import * from django.shortcuts import render from django.http import HttpResponse def export_users_xls(request): response = HttpResponse(content_type='application/ms-excel') response['Content-Disposition'] = 'attachment; filename="attendance.xls"' wb = xlwt.Workbook(encoding='...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,402
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/models.py
from django.db import models class Trigger(models.Model): name = models.CharField(blank=False,max_length=100) lang = models.CharField(blank=False,max_length=100) class Question(models.Model): course = models.CharField(blank=False,max_length=100) number = models.CharField(blank=False,max_length=100...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,403
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/migrations/0004_trigger_lang.py
# Generated by Django 2.2.8 on 2021-05-02 06:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0003_auto_20210502_0017'), ] operations = [ migrations.AddField( model_name='trigger', name='lang', ...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,404
ashvathnarayanan/Hocus-Focus
refs/heads/main
/HocusFocus/urls.py
from django.contrib import admin from django.urls import path from app import views from django.views.decorators.csrf import csrf_exempt urlpatterns = [ path('admin/', admin.site.urls), path('teacher', views.teacher), path('student', csrf_exempt(views.student)), path('start', csrf_exempt(views.startdn)...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,405
ashvathnarayanan/Hocus-Focus
refs/heads/main
/HocusFocus/routing.py
from channels.routing import ProtocolTypeRouter, URLRouter from django.core.asgi import get_asgi_application from app.consumer import StudentConsumer from django.urls import path application = ProtocolTypeRouter({ "http":get_asgi_application(), "websocket": URLRouter([ path("ws/", StudentConsumer.as_a...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,406
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/admin.py
from django.contrib import admin from app.models import * admin.site.register(Trigger) admin.site.register(Student) admin.site.register(Question)
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,407
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/consumer.py
import asyncio from app.models import * from app import prototype from asgiref.sync import sync_to_async from channels.generic.websocket import AsyncJsonWebsocketConsumer def save_question(event): try: total=len(list(Question.objects.filter(course=event["name"])))+1 except: total=1 question...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,408
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/migrations/0002_student_trigger.py
# Generated by Django 2.2.8 on 2021-05-01 06:49 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('app', '0001_initial'), ] operations = [ migrations.AddField( model_name='student', ...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,409
ashvathnarayanan/Hocus-Focus
refs/heads/main
/app/migrations/0006_student_regno.py
# Generated by Django 3.2.2 on 2021-05-07 10:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0005_question'), ] operations = [ migrations.AddField( model_name='student', name='regno', field=...
{"/app/views.py": ["/app/models.py"], "/HocusFocus/routing.py": ["/app/consumer.py"], "/app/admin.py": ["/app/models.py"], "/app/consumer.py": ["/app/models.py"]}
63,414
maniatikorn/nuevoblog
refs/heads/master
/nuevoBlog/apps.py
from __future__ import unicode_literals from django.apps import AppConfig class NuevoblogConfig(AppConfig): name = 'nuevoBlog'
{"/nuevoBlog/views.py": ["/nuevoBlog/models.py"]}
63,415
maniatikorn/nuevoblog
refs/heads/master
/nuevoBlog/views.py
from django.shortcuts import render from .models import Articulo from django.views.generic import ListView, DetailView # Create your views here. class IndexView(ListView): template_name = 'index.html' model = Articulo class ArticuloDetailView(DetailView): template_name = 'detalle.html' model = Articulo
{"/nuevoBlog/views.py": ["/nuevoBlog/models.py"]}
63,416
maniatikorn/nuevoblog
refs/heads/master
/nuevoBlog/models.py
from __future__ import unicode_literals from django.db import models from django.template.defaultfilters import slugify # Create your models here. class Articulo(models.Model): titulo = models.CharField(max_length=200) contenido = models.TextField() imagen = models.ImageField(upload_to="nuevoBlog/static/images-ar...
{"/nuevoBlog/views.py": ["/nuevoBlog/models.py"]}
63,417
maniatikorn/nuevoblog
refs/heads/master
/nuevoBlog/migrations/0004_auto_20160216_2057.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-16 20:57 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('nuevoBlog', '0003_auto_20160216_2052'), ] operations = [ migrations.AlterFie...
{"/nuevoBlog/views.py": ["/nuevoBlog/models.py"]}
63,423
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/bank/bradesco.py
# -*- coding: utf-8 from pyboleto.data import BoletoData, custom_property import os.path ### CAUTION - NÃO TESTADO ### class BoletoBradesco( BoletoData ): ''' Gera Dados necessários para criação de boleto para o banco Bradesco ''' def __init__(self, *args, **kwargs): super(BoletoBradesco ,...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,424
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/tests/test_banco_bradesco.py
# -*- coding: utf-8 -*- import unittest import datetime from pyboleto.bank.bradesco import BoletoBradesco class TestBancoBradesco(unittest.TestCase): def setUp(self): d = BoletoBradesco() d.carteira = '06' d.agencia_cedente = '278-0' d.conta_cedente = '039232-4' d.data_venc...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,425
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/__init__.py
VERSION = (0, 1, 10) __version__ = '.'.join(map(str, VERSION)) __all__ = [ 'data', 'pdf', 'bank', ]
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,426
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/scripts/print_sample_data.py
# -*- coding: utf-8 -*- from pyboleto.bank.real import BoletoReal from pyboleto.bank.bradesco import BoletoBradesco from pyboleto.bank.caixa import BoletoCaixa from pyboleto.bank.bancodobrasil import BoletoBB from pyboleto.pdf import BoletoPDF import datetime def print_bb(): listaDados = [] for i in range(2): ...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,427
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/tests/test_banco_real.py
# -*- coding: utf-8 -*- import unittest import datetime from pyboleto.bank.real import BoletoReal class TestBancoBradesco(unittest.TestCase): def setUp(self): d = BoletoReal() d.carteira = '06' d.agencia_cedente = '0531' d.conta_cedente = '5705853' d.data_vencimento = datet...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,428
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/tests/test_banco_caixa.py
# -*- coding: utf-8 -*- import unittest import datetime from pyboleto.bank.caixa import BoletoCaixa class TestBancoCaixa(unittest.TestCase): def setUp(self): d = BoletoCaixa() d.carteira = 'SR' d.inicio_nosso_numero = '24' d.agencia_cedente = '1565' d.conta_cedente = '414-3...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,429
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/bank/caixa.py
#-*- coding: utf-8 -*- from pyboleto.data import BoletoData, custom_property import os.path ### CAUTION - NÃO TESTADO ### class BoletoCaixa( BoletoData ): ''' Gera Dados necessários para criação de boleto para o banco Caixa Economica Federal ''' def __init__(self, *args, **kwargs): ...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,430
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/pdf.py
# -*- coding: utf-8 -*- from reportlab.pdfgen import canvas from reportlab.lib.units import mm, cm from reportlab.lib.colors import black, white from reportlab.graphics.barcode.common import I2of5 import reportlab.lib.pagesizes import datetime class BoletoPDF: def __init__(self, file_descr, landscape = False ): ...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,431
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/bank/real.py
from pyboleto.data import BoletoData import os.path class BoletoReal( BoletoData ): def __init__(self, *args, **kwargs): super(BoletoReal , self).__init__(*args, **kwargs) self.codigo_banco = "356" self.logo_image_path = os.path.dirname(__file__) + \ "/../media/logo_bancoreal....
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,432
arthurfurlan/pyboleto
refs/heads/master
/setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup( name = 'pyboleto', version = __import__('pyboleto').__version__, author = 'Eduardo Cereto Carvalho', author_email = 'eduardocereto@gmail.com', url = 'https://bitbucket.org/eduardo.cereto/pyboleto/', packages = find_packa...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,433
arthurfurlan/pyboleto
refs/heads/master
/pyboleto/data.py
# -*- coding: utf-8 -*- import datetime import re from decimal import Decimal class BoletoException(Exception): def __init__(self, message ): Exception.__init__(self, message) def custom_property(name, num_length): ''' Function to create properties on boleto It accepts a number with o...
{"/pyboleto/bank/bradesco.py": ["/pyboleto/data.py"], "/pyboleto/tests/test_banco_bradesco.py": ["/pyboleto/bank/bradesco.py"], "/pyboleto/tests/test_banco_real.py": ["/pyboleto/bank/real.py"], "/pyboleto/tests/test_banco_caixa.py": ["/pyboleto/bank/caixa.py"], "/pyboleto/bank/caixa.py": ["/pyboleto/data.py"], "/pybole...
63,446
xkapil/redis-flask-demo
refs/heads/master
/api/restaurant/restaurant.py
import uuid from flask_injector import inject from services.redis import Redis class Restaurant(object): @inject def post(self, restaurant: dict, lookup:Redis=None) -> dict: """ Store in Redis service """ # Generates a unique ID for the restaurant id_str = str(uuid.uuid4()) re...
{"/api/restaurant/restaurant.py": ["/services/redis.py"], "/app.py": ["/services/redis.py"]}
63,447
xkapil/redis-flask-demo
refs/heads/master
/app.py
import os import connexion from services.redis import Redis from injector import Binder from flask_injector import FlaskInjector from connexion.resolver import RestyResolver def configure(binder: Binder) -> Binder: binder.bind(Redis, Redis(os.environ['REDIS_HOST'], os.environ['REDIS_PORT'])) return binder ...
{"/api/restaurant/restaurant.py": ["/services/redis.py"], "/app.py": ["/services/redis.py"]}
63,448
xkapil/redis-flask-demo
refs/heads/master
/services/redis.py
import redis class Redis(object): def __init__(self, host: str, port: int): self.host = host self.port = port self.client = None def get_client(self) -> redis.StrictRedis: if self.client is None: self.client = redis.StrictRedis(self.host, self.port, db=0) re...
{"/api/restaurant/restaurant.py": ["/services/redis.py"], "/app.py": ["/services/redis.py"]}
63,449
luaroncrew/university_agenda_to_apple_calendar
refs/heads/main
/main.py
import logging import os from dotenv import load_dotenv from openpyxl import load_workbook from mail_exporter import send_calendar from settings import SETTINGS from extractor import read_agenda load_dotenv() # settings SENDER = os.getenv('EMAIL_LOGIN') DESTINATION = os.getenv('DESTINATION') PASSWORD = os.getenv('E...
{"/main.py": ["/mail_exporter.py", "/settings.py", "/extractor.py"], "/test_extractor.py": ["/extractor.py"], "/extractor.py": ["/settings.py"]}
63,450
luaroncrew/university_agenda_to_apple_calendar
refs/heads/main
/mail_exporter.py
import logging import smtplib from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication def send_calendar(sender, destination, password, filename): msg = MIMEMultipart('Here is your agenda for the next week') msg['Subject'] = 'agenda' msg['From'] = sender msg['T...
{"/main.py": ["/mail_exporter.py", "/settings.py", "/extractor.py"], "/test_extractor.py": ["/extractor.py"], "/extractor.py": ["/settings.py"]}
63,451
luaroncrew/university_agenda_to_apple_calendar
refs/heads/main
/test_extractor.py
from openpyxl import load_workbook from extractor import read_agenda # setting up testing files wb1 = load_workbook('test_example_1.xlsx', data_only=True) worksheet_1 = wb1.worksheets[0] wb2 = load_workbook('test_example_2.xlsx', data_only=True) worksheet_2 = wb2.worksheets[0] wb3 = load_workbook('test_example_3.x...
{"/main.py": ["/mail_exporter.py", "/settings.py", "/extractor.py"], "/test_extractor.py": ["/extractor.py"], "/extractor.py": ["/settings.py"]}
63,452
luaroncrew/university_agenda_to_apple_calendar
refs/heads/main
/extractor.py
import datetime from openpyxl import load_workbook import settings # settings weekday_letters = settings.WEEKDAY_LETTERS possible_cabinet_numbers = settings.POSSIBLE_CABINET_NUMBERS all_group_names = settings.ALL_GROUP_NAMES groups_to_exclude = settings.get_groups_to_exclude() START_TIME = 8 wb = load_workbook('te...
{"/main.py": ["/mail_exporter.py", "/settings.py", "/extractor.py"], "/test_extractor.py": ["/extractor.py"], "/extractor.py": ["/settings.py"]}
63,453
luaroncrew/university_agenda_to_apple_calendar
refs/heads/main
/settings.py
# settings SETTINGS = { 'EXTRACTING_FROM_FILE': True, 'DEBUG': True, } # this variable contains 5 lists of letters, each list for one weekday WEEKDAY_LETTERS = [ list('BCDEFGHI'), list('JKLMNOPQ'), list('RSTUVWXY'), ['Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG'], ['AH', 'AI', 'AJ', 'AK', ...
{"/main.py": ["/mail_exporter.py", "/settings.py", "/extractor.py"], "/test_extractor.py": ["/extractor.py"], "/extractor.py": ["/settings.py"]}
63,456
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/celery_tasks/sms/tasks.py
from celery_tasks.main import celery_app # from celery_tasks.sms.yuntongxun import constants # from celery_tasks.sms.yuntongxun.sms import CCP from meiduo_mall.libs.yuntongxun.sms import CCP from meiduo_mall.apps.verifications import constants @celery_app.task(name='ccp_send_sms_code') def ccp_send_sms_code(mobile, s...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,457
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/verifications/views.py
from django.shortcuts import render from django.views import View from django_redis import get_redis_connection from django import http from random import randint import logging from meiduo_mall.utils.response_code import RETCODE from meiduo_mall.libs.captcha.captcha import captcha # from meiduo_mall.libs.yuntongxun.s...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,458
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/contents/crons.py
import time import os from django.template import loader from django.conf import settings from .utils import get_category from .models import ContentCategory # from contents.crons import generate_static_index_html def generate_static_index_html(): """ 生成静态的主页html文件 """ print('%s: generate_static_ind...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,459
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/contents/utils.py
from goods.models import GoodsCategory, GoodsChannel def get_category(): """ { '组号': {'channels': [], 'sub_cats': []} '组号': {'channels': [], 'sub_cats': []} } """ # 商品类别字典 categories = {} # 按照group_id和sequence对频道进行排序 channel_qs = GoodsChannel.objects.order_by('group_id...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,460
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/goods/utils.py
def get_bread_crumb(category_model): """包装面包屑导航""" bread_crumb = {} # 获取三级类别模型并添加至字典 bread_crumb['cat3'] = category_model # 获取二级类别模型并添加至字典 bread_crumb['cat2'] = category_model.parent # 获取一级类别模型 cat1 = category_model.parent.parent # 将频道url存储值一级类别模型url属性中 cat1.url = cat1.goodscha...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,461
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/sina/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^sina/login/$', views.SinaLoginURLView.as_view()), # 新浪微博登录链接 url(r'^sina_callback/$', views.SinaOauthView.as_view()), # 新浪微博回调链接 ]
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,462
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/carts/views.py
from django.shortcuts import render from django.views import View from django.http import HttpResponseForbidden, JsonResponse import json, pickle, base64 from django_redis import get_redis_connection import logging from meiduo_mall.utils.response_code import RETCODE from goods.models import SKU logger = logging.getLo...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,463
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/payment/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^payment/(?P<order_id>\d+)/$', views.PaymentURLView.as_view()), # 订单支付路由 url(r'^payment/status/$', views.PaymentSuccessView.as_view()), # 支付成功路由 ]
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,464
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/oauth/urls.py
from django.conf.urls import url from . import views urlpatterns = [ # url(r'^qq/authorization/$', views.QQOAuthURLView.as_view()), # QQ登录路由 url(r'^qq/login/$', views.QQOAuthURLView.as_view()), # QQ登录路由 url(r'^oauth_callback$', views.QQOAuthUserView.as_view()), # QQ登录回调路由 ]
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,465
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/carts/utils.py
import pickle, base64 from django_redis import get_redis_connection def merge_cart_cookie_to_redis(request, response): # 获取cookie中的购物车数据 user = request.user cart_str = request.COOKIES.get('carts') # 如果cookie中没有购物车数据直接返回 if not cart_str: return # {sku_id: {'count':1, 'selected': True} ...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,466
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/payment/views.py
from django.shortcuts import render from django.http import HttpResponseForbidden, JsonResponse from alipay import AliPay from django.conf import settings import os from meiduo_mall.utils.views import LoginRequiredView from orders.models import OrderInfo from meiduo_mall.utils.response_code import RETCODE from .models...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,467
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/utils/fastdfs/fastdfs_storage.py
from django.core.files.storage import Storage class FastDFSStoreage(Storage): def _open(self): pass def _save(self): pass def url(self, name): return 'http://127.0.0.1:8888/' + name
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,468
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/verifications/constants.py
# 保存常量数据 IMAGE_CODE_REDIS_EXPIRES = 300 # 图形验证码有效期(单位:秒) SMS_CODE_REDIS_EXPIRES = 300 # 短信验证码有效期(单位:秒) SMS_CODE_FLAG_REDIS_EXPIRES = 300 # 短信验证码有效期(单位:秒) # 找回密码常量数据 VERIFY_CODE_ERROR = 400 # 验证码有误 USER_MOBILE_ERROR = 404 # 用户名或手机号有误 # SMS_CODE_EXPIRED = 410 # 验证码已过期 ACCESS_TOKEN__REDIS_EXPIRES = 600 # ac...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,469
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/oauth/utils.py
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadData from django.conf import settings def generate_openid_signature(raw_openid): """加密""" # 创建加密对象 serializer = Serializer(settings.SECRET_KEY, 600) # 加密并包装为字典格式 openid_dict = {'openid': raw_openid} openid = serializer....
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,470
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/oauth/views.py
from django.shortcuts import render, redirect from QQLoginTool.QQtool import OAuthQQ from django.views import View from django.http import JsonResponse, HttpResponseServerError, HttpResponseForbidden from django.conf import settings from django.contrib.auth import login from django_redis import get_redis_connection fro...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,471
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/sina/views.py
from django.shortcuts import render, redirect from django.http import JsonResponse, HttpResponseForbidden, HttpResponseServerError from django.views import View from django.conf import settings from carts.utils import merge_cart_cookie_to_redis from django.contrib.auth import login from django_redis import get_redis_co...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,472
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/libs/yuntongxun/constants.py
# 保存常量数据 IMAGE_CODE_REDIS_EXPIRES = 300 # 图形验证码有效期(单位:秒) SMS_CODE_REDIS_EXPIRES = 300 # 短信验证码有效期(单位:秒) SMS_CODE_FLAG_REDIS_EXPIRES = 300 # 短信验证码有效期(单位:秒)
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,473
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/goods/views.py
from django.shortcuts import render from django.views import View from django.http import HttpResponseForbidden, JsonResponse from django.core.paginator import Paginator, EmptyPage from django.utils import timezone from django_redis import get_redis_connection import json # Create your views here. from .utils import g...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,474
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/goods/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view()), # 商品列表路由 url(r'^hot/(?P<category_id>\d+)/$', views.HotGoodsView.as_view()), # 热销商品路由 url(r'^detail/(?P<sku_id>\d+)/$', views.DetailsGoodsView.as_view...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,475
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/users/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^register/$', views.RegisterView.as_view()), # 设置注册页面路由 url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UserNameCountView.as_view()), # 用户名重复检测 url(r'^mobiles/(?P<mobile>1[345789]\d{9})/count/$', views.Mobil...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,476
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/areas/views.py
from django.shortcuts import render from django.core.cache import cache from django.http import JsonResponse, HttpResponseForbidden from meiduo_mall.utils.views import LoginRequiredView from meiduo_mall.utils.response_code import RETCODE from .models import Area # Create your views here. class AreaView(LoginRequired...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,477
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/carts/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^carts/$', views.CartView.as_view()), # 购物车路由 url(r'^carts/selection/$', views.CartSelectedAllView.as_view()), # 购物车全选 url(r'^carts/simple/$', views.CartSimpleView.as_view()), # 简单版购物车 ]
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,478
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/orders/views.py
from django.shortcuts import render from decimal import Decimal from django_redis import get_redis_connection from django.http import JsonResponse, HttpResponseForbidden from django.db import transaction from django.core.paginator import Paginator,EmptyPage import json, logging from django.utils import timezone from m...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,479
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/celery_tasks/main.py
# celery 启动文件 from celery import Celery import os # 使用django配置环境模板 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meiduo_mall.settings.dev") # 实例化celery对象 celery_app = Celery('meiduo') # 指定任务仓库 celery_app.config_from_object('celery_tasks.config') # 执行哪些任务 celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,480
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/contents/views.py
from django.shortcuts import render from django.views import View from .utils import get_category from .models import ContentCategory # Create your views here. class IndexView(View): def get(self, request): """ { 'lb': [], 'kx':[], } """ contents = {} ...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...
63,481
silence-py/django_meiduo_shopping
refs/heads/master
/meiduo_mall/meiduo_mall/apps/users/views.py
from django.shortcuts import render, redirect from django.views import View from django.http import HttpResponse, HttpResponseForbidden, JsonResponse from django.contrib.auth import login, authenticate, logout from django.db.utils import DatabaseError from django_redis import get_redis_connection from django.conf impor...
{"/meiduo_mall/meiduo_mall/apps/contents/crons.py": ["/meiduo_mall/meiduo_mall/apps/contents/utils.py"], "/meiduo_mall/meiduo_mall/apps/oauth/views.py": ["/meiduo_mall/meiduo_mall/apps/oauth/utils.py"], "/meiduo_mall/meiduo_mall/apps/goods/views.py": ["/meiduo_mall/meiduo_mall/apps/goods/utils.py"], "/meiduo_mall/meidu...