text stringlengths 0 1.05M | meta dict |
|---|---|
from django.shortcuts import render
from django.core.urlresolvers import reverse, reverse_lazy
from django.views.generic import FormView
from django.contrib import messages
from django.core.mail import send_mail
from apps.core.views import BaseView
from . import forms
class ContactView(BaseView, FormView):
form_c... | {
"repo_name": "vuonghv/brs",
"path": "apps/contact/views.py",
"copies": "1",
"size": "1477",
"license": "mit",
"hash": 1776228037658249200,
"line_mean": 31.8444444444,
"line_max": 71,
"alpha_frac": 0.5991875423,
"autogenerated": false,
"ratio": 4.244252873563219,
"config_test": false,
"has_no... |
from django.shortcuts import render
from django.core.urlresolvers import reverse, reverse_lazy
from django.views.generic import (
ListView, DetailView, CreateView,
TemplateView
)
from django.conf import settings
from django.http import Http404
from apps.core.views import BaseView, LoginRequiredMixin
from apps.... | {
"repo_name": "tuanquanghpvn/bideox",
"path": "apps/posts/views.py",
"copies": "1",
"size": "5913",
"license": "mit",
"hash": -6804313136616217000,
"line_mean": 33.9018404908,
"line_max": 122,
"alpha_frac": 0.5338372297,
"autogenerated": false,
"ratio": 2.93853305785124,
"config_test": false,
... |
from django.shortcuts import render
from django.core.urlresolvers import reverse, reverse_lazy
from . import forms, models
from django.views.generic import FormView, DetailView, ListView
from django.contrib import messages
from braces import views
from django.http import HttpResponseRedirect
class UserFormView(views.L... | {
"repo_name": "RossLote/cloudplayer",
"path": "music/views.py",
"copies": "1",
"size": "5433",
"license": "mit",
"hash": -5482080855900101000,
"line_mean": 24.995215311,
"line_max": 70,
"alpha_frac": 0.559911651,
"autogenerated": false,
"ratio": 4.122154779969651,
"config_test": false,
"has_n... |
from django.shortcuts import render
from django.db import connection
from .batch_sql import BatchSql
from django.http import JsonResponse
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
@login_required()
def total_time_ran(request):
total_time_ran_result = __r... | {
"repo_name": "vishu-guntupalli/spring-batch-dashboard",
"path": "spring_batch_dashboard/dashboard/views.py",
"copies": "1",
"size": "5032",
"license": "mit",
"hash": -6094937489538494000,
"line_mean": 39.264,
"line_max": 110,
"alpha_frac": 0.6361287758,
"autogenerated": false,
"ratio": 3.6175413... |
from django.shortcuts import render
from django.db import connection, transaction
from django.contrib.auth import authenticate, login
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.template import Re... | {
"repo_name": "thebachchaoproject/bachchao-server",
"path": "pahera/views.py",
"copies": "1",
"size": "17848",
"license": "mit",
"hash": 538664950138526700,
"line_mean": 40.896713615,
"line_max": 247,
"alpha_frac": 0.6215822501,
"autogenerated": false,
"ratio": 4.1171856978085355,
"config_test"... |
from django.shortcuts import render
from django.db import connection, transaction
def index(request):
return render(request, 'dashboard/index.html')
def stats(request):
'''select count(*)
from cat_museumobject
where place_id in (select id from location_place
where australian_state != ''
and ... | {
"repo_name": "uq-eresearch/uqam",
"path": "dashboard/views.py",
"copies": "1",
"size": "1187",
"license": "bsd-3-clause",
"hash": 2712163931235833000,
"line_mean": 20.9814814815,
"line_max": 68,
"alpha_frac": 0.6082561078,
"autogenerated": false,
"ratio": 4.079037800687285,
"config_test": fals... |
from django.shortcuts import render
from django.db import models
from rest_framework.views import APIView
from rest_framework.response import Response
from users.models import Users, UserToken
# Create your views here.
class Signup(APIView):
def post(self, request):
username = request.data.get("username"... | {
"repo_name": "JetRunner/epictodo",
"path": "users/views.py",
"copies": "1",
"size": "1513",
"license": "mit",
"hash": -7393763757391840000,
"line_mean": 25.0862068966,
"line_max": 73,
"alpha_frac": 0.5591539987,
"autogenerated": false,
"ratio": 4.436950146627566,
"config_test": false,
"has_n... |
from django.shortcuts import render
from django.db import transaction
from django.core import serializers
from django.db.models import Sum, Q
import django_filters
from rest_framework import filters
from rest_framework import status
from rest_framework import viewsets
from rest_framework import generics
from rest_fram... | {
"repo_name": "gdi3d/my_wallet",
"path": "wallet/views.py",
"copies": "1",
"size": "10807",
"license": "mit",
"hash": 5693754598677712000,
"line_mean": 31.9481707317,
"line_max": 196,
"alpha_frac": 0.648746183,
"autogenerated": false,
"ratio": 4.224784988272088,
"config_test": false,
"has_no_... |
from django.shortcuts import render
#from django.db import transaction
from django.db.models import F
from django.http import HttpResponse, Http404
from django.core.urlresolvers import reverse
import json
from gazetteer.sources.abstractsource import AbstractSource, get_handler
from gazetteer.models import GazSource,Loc... | {
"repo_name": "rob-metalinkage/django-gazetteer",
"path": "gazetteer/harvest.py",
"copies": "1",
"size": "8540",
"license": "cc0-1.0",
"hash": -9177862739549503000,
"line_mean": 37.3004484305,
"line_max": 147,
"alpha_frac": 0.6108899297,
"autogenerated": false,
"ratio": 4.011272898074213,
"conf... |
from django.shortcuts import render
from django.db import transaction
from rest_framework.authtoken.models import Token
from sensors.models import SensorVerification, Sensor
from api.v1.mailer import TokenEmail
def verify(request):
code = request.GET.get('code')
print code
if code is None:
ret... | {
"repo_name": "codefornigeria/dustduino-server",
"path": "sensor_rest_api/sensors/views.py",
"copies": "2",
"size": "1968",
"license": "bsd-3-clause",
"hash": -1885947038137781200,
"line_mean": 34.1428571429,
"line_max": 110,
"alpha_frac": 0.4918699187,
"autogenerated": false,
"ratio": 5.49720670... |
from django.shortcuts import render
#from django.db.models.aggregates import Sum
from product.models import Customer, Product, Payment, Rep
from core.views import BaseActivityListView
def last_activity(request):
return render(request, 'reports/last_activity.html',
{'reps': Rep.objects.all()})
... | {
"repo_name": "boyombo/pharmrep",
"path": "pharmrep/reports/views.py",
"copies": "1",
"size": "1438",
"license": "mit",
"hash": 7373282386314732000,
"line_mean": 33.2380952381,
"line_max": 73,
"alpha_frac": 0.6731571627,
"autogenerated": false,
"ratio": 4.050704225352113,
"config_test": false,
... |
from django.shortcuts import render
from django.db.models import Avg
from rest_framework.views import APIView
from rest_framework.response import Response
from datetime import datetime
from housesales.models import HouseSales
def _filter_sales(request):
postcode = request.query_params.get('postcode', None)
... | {
"repo_name": "andreagrandi/sold-house-prices",
"path": "housemarket/api/views.py",
"copies": "1",
"size": "5178",
"license": "mit",
"hash": -5269608858459688000,
"line_mean": 43.6379310345,
"line_max": 151,
"alpha_frac": 0.6104673619,
"autogenerated": false,
"ratio": 3.7065139584824625,
"confi... |
from django.shortcuts import render
from django.db.models import Count
from django.core import serializers
from django.http import HttpResponse
from photo.models import Photo
def index(request):
categories = Photo.objects.raw('select id, category from swan_photo group by category')
subcategories = Photo.object... | {
"repo_name": "huaiping/pandora",
"path": "photo/views.py",
"copies": "1",
"size": "1348",
"license": "mit",
"hash": -2772196485739348500,
"line_mean": 48.9259259259,
"line_max": 135,
"alpha_frac": 0.7299703264,
"autogenerated": false,
"ratio": 3.8514285714285714,
"config_test": false,
"has_n... |
from django.shortcuts import render
from django.db.models import Count
from register.models import Patient
from reminder.models import Appointment_Response, Reminder
from call_engine.models import Call_Response
from services.models import Service
import arrow
def AppointmentReports(request):
query_set = Reminder... | {
"repo_name": "omwomotieno/tunza_v3",
"path": "reports/views.py",
"copies": "1",
"size": "1206",
"license": "mit",
"hash": 5367641408773597000,
"line_mean": 21.7547169811,
"line_max": 72,
"alpha_frac": 0.6973466003,
"autogenerated": false,
"ratio": 3.792452830188679,
"config_test": false,
"ha... |
from django.shortcuts import render
from django.db.models import Prefetch
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.exceptions import APIException
from covid.models import DailyDatum, County, State
from covid.serializers import DataSerializer, State... | {
"repo_name": "kenjones21/kenWeaver",
"path": "backend/covid/views.py",
"copies": "1",
"size": "1493",
"license": "mit",
"hash": 6058140519976612000,
"line_mean": 34.5476190476,
"line_max": 90,
"alpha_frac": 0.6979236437,
"autogenerated": false,
"ratio": 3.760705289672544,
"config_test": false,... |
from django.shortcuts import render
from django.db.models import Q, F, Prefetch, Avg, StdDev, IntegerField, Sum, Case, When, Min, Max
from django.db.models.functions import Concat
from django.views.decorators.cache import cache_page
from django.views.decorators.csrf import csrf_exempt
from django.core.cache import cach... | {
"repo_name": "protwis/protwis",
"path": "contactnetwork/views.py",
"copies": "1",
"size": "160324",
"license": "apache-2.0",
"hash": -8639296225269381000,
"line_mean": 45.3763378652,
"line_max": 282,
"alpha_frac": 0.5256451039,
"autogenerated": false,
"ratio": 3.649427511324577,
"config_test":... |
from django.shortcuts import render
from django.db.models import Q, F, Prefetch, Avg, StdDev
from django.db.models.functions import Concat
from django.views.decorators.cache import cache_page
from django.core.cache import cache
from django.db import connection
from collections import defaultdict
from django.conf impor... | {
"repo_name": "cmunk/protwis",
"path": "contactnetwork/views.py",
"copies": "1",
"size": "118910",
"license": "apache-2.0",
"hash": -7790321786559112000,
"line_mean": 43.2699180938,
"line_max": 420,
"alpha_frac": 0.5240309817,
"autogenerated": false,
"ratio": 3.6536795206636965,
"config_test": ... |
from django.shortcuts import render
from django.db.models import Q
from django.shortcuts import render_to_response
from search.engine.search import dosearch
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
import string
import sys
from search.engine.query_process import query_parser_no_stopwords... | {
"repo_name": "ryecao/a-simple-music-search-engine",
"path": "django/views.py",
"copies": "1",
"size": "5000",
"license": "mit",
"hash": 1785279433809987300,
"line_mean": 33.0136054422,
"line_max": 129,
"alpha_frac": 0.5196,
"autogenerated": false,
"ratio": 3.3090668431502315,
"config_test": fa... |
from django.shortcuts import render
from django.db.models import Q
from django.shortcuts import render_to_response,RequestContext
from models import Book
from form import ContactForm
from form import PublisherForm
from django.http import HttpResponseRedirect
# Create your views here.
def search(request):
query =... | {
"repo_name": "yqian1991/Django",
"path": "test1/book/views.py",
"copies": "2",
"size": "1654",
"license": "apache-2.0",
"hash": 6553427578575350000,
"line_mean": 30.2264150943,
"line_max": 91,
"alpha_frac": 0.6342200726,
"autogenerated": false,
"ratio": 3.8287037037037037,
"config_test": false... |
from django.shortcuts import render
from django.db.models import Q
from django.template import RequestContext
from django.contrib.auth.models import User
import datetime
from cog.models import UserProfile, Project
from cog.utils import getJson, str2bool
from cog.models.peer_site import getPeerSites
from django.contrib.... | {
"repo_name": "EarthSystemCoG/COG",
"path": "cog/views/utils.py",
"copies": "2",
"size": "8411",
"license": "bsd-3-clause",
"hash": -1279384678244559400,
"line_mean": 38.6745283019,
"line_max": 113,
"alpha_frac": 0.5625965997,
"autogenerated": false,
"ratio": 4.462068965517242,
"config_test": f... |
from django.shortcuts import render
from django.db.models import Q
from base.views import BaseListView, BaseDetailView, BaseCreateView
from base.views import BaseUpdateView, BaseDeleteView
from core.site.models import Site
from core.utils import to_a
import itertools
class CoreListView(BaseListView):
""" """
... | {
"repo_name": "rtucker-mozilla/inventory",
"path": "core/views.py",
"copies": "2",
"size": "2460",
"license": "bsd-3-clause",
"hash": -3321408792785592000,
"line_mean": 24.625,
"line_max": 79,
"alpha_frac": 0.5837398374,
"autogenerated": false,
"ratio": 3.6607142857142856,
"config_test": false,... |
from django.shortcuts import render
from django.db.models import Q
from collections import defaultdict
from django.conf import settings
import json
import functools
from contactnetwork.models import *
from structure.models import Structure
from protein.models import Protein, ProteinSegment
Alignment = getattr(__imp... | {
"repo_name": "fosfataza/protwis",
"path": "contactnetwork/views.py",
"copies": "1",
"size": "8937",
"license": "apache-2.0",
"hash": 8759066782853146000,
"line_mean": 32.5977443609,
"line_max": 129,
"alpha_frac": 0.5958375294,
"autogenerated": false,
"ratio": 3.557722929936306,
"config_test": ... |
from django.shortcuts import render
from django.db.models import Q, Sum, Avg
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
from ratechecker.models import Product, Region, Rate, Adjustment, Fee
from ratech... | {
"repo_name": "fna/owning-a-home-api",
"path": "ratechecker/views.py",
"copies": "2",
"size": "7358",
"license": "cc0-1.0",
"hash": 1972937374157746400,
"line_mean": 42.0292397661,
"line_max": 111,
"alpha_frac": 0.6261212286,
"autogenerated": false,
"ratio": 3.568380213385063,
"config_test": fa... |
from django.shortcuts import render
from django.db.models import Sum
from . import models
def analytics_compare_example(request, template="analytics_compare_example.html"):
'''
A simplistic view which demostraits how the analytic models can be used.
'''
month = 3
year = 2015
users = models.U... | {
"repo_name": "CIGIHub/tweet_cache",
"path": "twitter/views.py",
"copies": "2",
"size": "2388",
"license": "mit",
"hash": 273359831711975650,
"line_mean": 27.4285714286,
"line_max": 114,
"alpha_frac": 0.5598827471,
"autogenerated": false,
"ratio": 4.189473684210526,
"config_test": false,
"has... |
from django.shortcuts import render
from django.db.models import Sum
from pdl.models import Proyecto
from pdl.models import Seguimientos
from stats.models import ComisionCount
from stats.models import Dispensed
from stats.models import WithDictamenButNotVoted
LEGISLATURE = 2016
def dame_sin_tramitar(numero_de_proy... | {
"repo_name": "proyectosdeley/proyectos_de_ley",
"path": "proyectos_de_ley/stats/views.py",
"copies": "1",
"size": "5507",
"license": "mit",
"hash": 7157854135039750000,
"line_mean": 38.0354609929,
"line_max": 109,
"alpha_frac": 0.617369186,
"autogenerated": false,
"ratio": 3.14694110920526,
"c... |
from django.shortcuts import render
from django.db.models import Sum
import datetime
from sponsorship.models import Sponsorship
from challenges.models import Challenge
from runs.models import Run
def contact(request):
return render(request, 'pages/contact.html')
def generate_raised(start_date, end_date):
... | {
"repo_name": "Socialsquare/RunningCause",
"path": "pages/views.py",
"copies": "1",
"size": "2004",
"license": "mit",
"hash": 3116069150755960000,
"line_mean": 31.3225806452,
"line_max": 110,
"alpha_frac": 0.6956087824,
"autogenerated": false,
"ratio": 3.5157894736842104,
"config_test": false,
... |
from django.shortcuts import render
from django.forms import inlineformset_factory, ValidationError
from django.http import Http404,HttpResponseRedirect,HttpResponse
from django.contrib.auth.decorators import login_required,user_passes_test
from django.urls import reverse
from django.core.mail import send_mail
from dja... | {
"repo_name": "jalibras/coop",
"path": "coop/guide/views.py",
"copies": "1",
"size": "12894",
"license": "apache-2.0",
"hash": 7529635818638266000,
"line_mean": 33.384,
"line_max": 255,
"alpha_frac": 0.609430743,
"autogenerated": false,
"ratio": 4.145980707395498,
"config_test": false,
"has_n... |
from django.shortcuts import render
from django.forms import modelform_factory, modelformset_factory
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from django.urls import reverse
from django.views.generic import ListView, DetailView
from rest_framework import view... | {
"repo_name": "peterbarkley/SurfGeckos",
"path": "djangosite/snippets/views.py",
"copies": "1",
"size": "3253",
"license": "mit",
"hash": 2462219017774184000,
"line_mean": 36.8255813953,
"line_max": 105,
"alpha_frac": 0.6876729173,
"autogenerated": false,
"ratio": 4.046019900497512,
"config_tes... |
from django.shortcuts import render
from django.forms import modelform_factory
from django import forms
from .models import *
#from .forms import *
from apps.hardware.models import Hardware
from apps.devices.models import Device
# Create your views here.
def CameraSelectionView(request, id=None):
CamForm = modelform... | {
"repo_name": "theSoloBrewer/Project_Management",
"path": "apps/cameras/views.py",
"copies": "1",
"size": "2021",
"license": "apache-2.0",
"hash": 4423662329897653000,
"line_mean": 28.7352941176,
"line_max": 82,
"alpha_frac": 0.6749134092,
"autogenerated": false,
"ratio": 3.0996932515337425,
"c... |
from django.shortcuts import render
from django.forms import modelform_factory
from django.views.generic import CreateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.decorators import login_required
from metaci.notification.forms import AddNotificationForm
from metac... | {
"repo_name": "SalesforceFoundation/mrbelvedereci",
"path": "metaci/notification/views.py",
"copies": "1",
"size": "2846",
"license": "bsd-3-clause",
"hash": 6205288153712035000,
"line_mean": 31.3409090909,
"line_max": 79,
"alpha_frac": 0.7751229796,
"autogenerated": false,
"ratio": 4.60517799352... |
from django.shortcuts import render
from django.forms import ModelForm
from common.models import Audit, Comment, Location, NameDesc
from contact_info.models import Contact_Info
from phone_number import PhoneNumber
class Contact_InfoForm(ModelForm):
class Meta:
model=Contact_Info
fields = Loca... | {
"repo_name": "warnes/irrigatorpro",
"path": "irrigator_pro/contact_info/forms.py",
"copies": "1",
"size": "1062",
"license": "mit",
"hash": -2291050658722721300,
"line_mean": 26.9473684211,
"line_max": 93,
"alpha_frac": 0.6026365348,
"autogenerated": false,
"ratio": 4.248,
"config_test": false... |
from django.shortcuts import render
from django.http import Http404, HttpResponse
# Create your views here.
import json
from .models import UnicomRechargeGenOrder
import mysql_controller
from vpn_manage.models import VPN
def upload_genorder(request):
if request.method == 'POST':
data = json.loads(request.... | {
"repo_name": "wxmgcs/devops",
"path": "monitor/views.py",
"copies": "1",
"size": "2859",
"license": "mit",
"hash": 1962133968881904000,
"line_mean": 33.0357142857,
"line_max": 118,
"alpha_frac": 0.6075550892,
"autogenerated": false,
"ratio": 3.889795918367347,
"config_test": false,
"has_no_k... |
from django.shortcuts import render
from django.http import Http404,HttpResponse
from django.core.exceptions import ObjectDoesNotExist
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from blog.models import Article,Tag
# Create your views here.
def direct_to_template(requests,template_name,**k... | {
"repo_name": "keysona/mysite",
"path": "mysite/blog/views.py",
"copies": "1",
"size": "1868",
"license": "apache-2.0",
"hash": 7627547808179551000,
"line_mean": 33.4905660377,
"line_max": 87,
"alpha_frac": 0.6301969365,
"autogenerated": false,
"ratio": 3.7846790890269153,
"config_test": false,... |
from django.shortcuts import render
from django.http import Http404, HttpResponse
from django.shortcuts import redirect
from ToDoList.models import List
from ToDoList.models import Item
from ToDoList.models import ListAddForm
from ToDoList.models import ItemAddForm
from ToDoList.models import ItemEditForm
from ToDoLis... | {
"repo_name": "javaburger/comp204p",
"path": "app/ToDoList/views.py",
"copies": "1",
"size": "5944",
"license": "mit",
"hash": 3769679454541645300,
"line_mean": 26.7803738318,
"line_max": 110,
"alpha_frac": 0.7008748318,
"autogenerated": false,
"ratio": 3.0893970893970892,
"config_test": false,... |
from django.shortcuts import render
from django.http import Http404, HttpResponse
from django.utils.html import strip_tags
from django.conf import settings
from .lend_form import LendForm
from heatclient.common import template_utils
import json
from utils.nova_client_helper import NovaClientHelper
from utils.heat_tem... | {
"repo_name": "Ingesup-Lab-OS/OS-Lend-Frontend",
"path": "lend_frontend/lend_frontend/views.py",
"copies": "1",
"size": "3199",
"license": "apache-2.0",
"hash": -6309034352590259000,
"line_mean": 33.3978494624,
"line_max": 93,
"alpha_frac": 0.5886214442,
"autogenerated": false,
"ratio": 3.99875,
... |
from django.shortcuts import render
from django.http import Http404, HttpResponse
from django.views.generic import TemplateView
from django.conf import settings
import logging
import requests
import json
import urllib
from django.http import JsonResponse
from ancfinder_site.models import *
logger = logging.getLogger... | {
"repo_name": "codefordc/ancfinder",
"path": "ancfinder_site/views.py",
"copies": "1",
"size": "2858",
"license": "cc0-1.0",
"hash": 93765153043241470,
"line_mean": 30.0652173913,
"line_max": 138,
"alpha_frac": 0.7281315605,
"autogenerated": false,
"ratio": 3.0307529162248144,
"config_test": fa... |
from django.shortcuts import render
from django.http import Http404, HttpResponse
# Create your views here.
from blog.models import Post
from tagging.models import Tag
from django.template.context import RequestContext
from blog.utils import get_protect_data
def get_tag_cloud():
try:
return Tag.objects.cl... | {
"repo_name": "tedor/home-blog",
"path": "blog/views.py",
"copies": "1",
"size": "2185",
"license": "bsd-3-clause",
"hash": 6175290878794886000,
"line_mean": 33.15625,
"line_max": 174,
"alpha_frac": 0.6270022883,
"autogenerated": false,
"ratio": 3.7414383561643834,
"config_test": false,
"has_... |
from django.shortcuts import render
from django.http import Http404, JsonResponse, HttpResponse
from .models import Missile, MissileDesigns
from .forms import MissileForm
from django.core import serializers
import json
# Create your views here.
def index(request):
return render(request, 'starter/index.html')
def... | {
"repo_name": "as8709/point_defence",
"path": "starter/views.py",
"copies": "1",
"size": "2645",
"license": "mit",
"hash": -6187033388057292000,
"line_mean": 30.5,
"line_max": 153,
"alpha_frac": 0.6064272212,
"autogenerated": false,
"ratio": 3.59375,
"config_test": false,
"has_no_keywords": f... |
from django.shortcuts import render
from django.http import Http404
from clipboard.models import Clip
from clipboard.serializers import ClipSerializer, UserSerializer
from clipboard.permissions import IsOwnerOrReadOnly
from rest_framework import status
from rest_framework.response import Response
from rest_framework.vi... | {
"repo_name": "krsoninikhil/cloud-clipboard",
"path": "server/clipboard/views.py",
"copies": "1",
"size": "2588",
"license": "mit",
"hash": -4663127020176025000,
"line_mean": 32.1794871795,
"line_max": 88,
"alpha_frac": 0.6939721793,
"autogenerated": false,
"ratio": 4.256578947368421,
"config_t... |
from django.shortcuts import render
from django.http import Http404
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import mixins
from r... | {
"repo_name": "yoda-yoda/DRF",
"path": "snippets/views.py",
"copies": "2",
"size": "4153",
"license": "mit",
"hash": -9113226432243582000,
"line_mean": 30.4621212121,
"line_max": 83,
"alpha_frac": 0.7387430773,
"autogenerated": false,
"ratio": 3.955238095238095,
"config_test": false,
"has_no_... |
from django.shortcuts import render
from django.http import Http404
from django.db.models import Value, CharField, F
from itertools import chain
import re
from .models import Song
from .models import Folder
def index(request):
return render(request, 'index.html')
def songs_index(request):
folders = Folder.object... | {
"repo_name": "brycematsuda/top-the-charts",
"path": "ddr/views.py",
"copies": "1",
"size": "3769",
"license": "mit",
"hash": -4714806070025836000,
"line_mean": 51.3472222222,
"line_max": 183,
"alpha_frac": 0.7062881401,
"autogenerated": false,
"ratio": 3.2859633827375765,
"config_test": false,... |
from django.shortcuts import render
from django.http import Http404
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404, render_to_response
from django.template import RequestContext, loader
from django.core.urlresolvers import reverse
from django.views.deco... | {
"repo_name": "alexkyllo/school-manager",
"path": "school_manager/school_calendar/views.py",
"copies": "1",
"size": "5320",
"license": "apache-2.0",
"hash": -7699315729340310000,
"line_mean": 47.8073394495,
"line_max": 175,
"alpha_frac": 0.6526315789,
"autogenerated": false,
"ratio": 3.9553903345... |
from django.shortcuts import render
#from django.http import Http404
#from django.http import HttpResponse
# Create your views here.
from django.core.paginator import Paginator, InvalidPage
from .models import userMainTeble
from django.views import generic
from django.forms import formset_factory
from .forms import Art... | {
"repo_name": "Necromoshka/orderHistory",
"path": "journal/userMain/views.py",
"copies": "1",
"size": "1261",
"license": "mit",
"hash": 4914414090150073000,
"line_mean": 23.7254901961,
"line_max": 110,
"alpha_frac": 0.7057890563,
"autogenerated": false,
"ratio": 3.7529761904761907,
"config_test... |
from django.shortcuts import render
from django.http import Http404
from django.utils.decorators import method_decorator
from supra import views as supra
from django.views.decorators.csrf import csrf_exempt
import models
import forms
# Create your views here.
def index(request):
principal = models.MenuPrincipal.o... | {
"repo_name": "exildev/webpage",
"path": "exile/views.py",
"copies": "1",
"size": "1333",
"license": "mit",
"hash": -194978347499402800,
"line_mean": 32.325,
"line_max": 124,
"alpha_frac": 0.7074268567,
"autogenerated": false,
"ratio": 3.672176308539945,
"config_test": false,
"has_no_keywords... |
from django.shortcuts import render
from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
from models import Article, Training, Job, News, Newsletter
from datetime import datetime
from itertools import chain
from operator import attrgetter
# Create your views here.
def custom_404(request... | {
"repo_name": "sebastianlees/Conflict-Gateway",
"path": "conflictgateway/articles/views.py",
"copies": "1",
"size": "4797",
"license": "mit",
"hash": 6358233347887906000,
"line_mean": 36.4765625,
"line_max": 111,
"alpha_frac": 0.6314363144,
"autogenerated": false,
"ratio": 3.9743164871582435,
"... |
from django.shortcuts import render
from django.http import Http404
from django.views.generic import ListView
from django.views.generic.edit import FormMixin
from rest_framework.renderers import JSONRenderer
from real_estate.views import ApartmentFilterMixin
from .models import ResaleApartment, TransactionMixin
from... | {
"repo_name": "Dybov/real_estate_agency",
"path": "real_estate_agency/resale/views.py",
"copies": "1",
"size": "3058",
"license": "mit",
"hash": -2590172292974850600,
"line_mean": 32.6043956044,
"line_max": 74,
"alpha_frac": 0.6582733813,
"autogenerated": false,
"ratio": 3.9255455712451863,
"co... |
from django.shortcuts import render
from django.http import Http404
# Create your views here.
from jobs.models import Job, Location, Employer
from .models import PositionMatch, LocationMatch, EmployerMatch
def position_match_view(request, slug):
try:
instance = Job.objects.get(slug=slug)
except Job.MultipleObject... | {
"repo_name": "loafbaker/django_matchmaker",
"path": "matches/views.py",
"copies": "1",
"size": "1484",
"license": "mit",
"hash": -5937974250843305000,
"line_mean": 27.5384615385,
"line_max": 72,
"alpha_frac": 0.7547169811,
"autogenerated": false,
"ratio": 3.2190889370932756,
"config_test": fal... |
from django.shortcuts import render
from django.http import Http404
from course.models import CourseInstance
from course.models import Syllabus
from course.models import Calendar
from course.models import Assignment
from course.models import Grade
from course.models import Resource
from course.models import Topic
from... | {
"repo_name": "shayan72/Courseware",
"path": "course/views.py",
"copies": "1",
"size": "5066",
"license": "mit",
"hash": -5810818129053573000,
"line_mean": 38.5859375,
"line_max": 113,
"alpha_frac": 0.7141729175,
"autogenerated": false,
"ratio": 3.565095003518649,
"config_test": false,
"has_n... |
from django.shortcuts import render
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from . import queue
from SpearmintServer.app.models import MongoDB
import spearmint
import json
impo... | {
"repo_name": "acil-bwh/SpearmintServer",
"path": "SpearmintServer/api/views.py",
"copies": "1",
"size": "6292",
"license": "mit",
"hash": 8163848162478340000,
"line_mean": 30.3034825871,
"line_max": 105,
"alpha_frac": 0.6233312142,
"autogenerated": false,
"ratio": 3.7430101130279594,
"config_t... |
from django.shortcuts import render
from django.http import HttpRequest, HttpResponse
from grapher_admin.models import Variable
from typing import Dict
from openpyxl import Workbook
from openpyxl.writer.excel import save_virtual_workbook
from importer.models import AdditionalCountryInfo
def listunwppdatasets(request:... | {
"repo_name": "aaldaber/owid-grapher",
"path": "importer/views.py",
"copies": "1",
"size": "15577",
"license": "mit",
"hash": -8929090955899740000,
"line_mean": 46.4908536585,
"line_max": 117,
"alpha_frac": 0.6329203313,
"autogenerated": false,
"ratio": 3.769845111326234,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponseBadRequest, HttpResponse
from .models import Project, ExperienceItem
from django.core.mail import EmailMessage
constant_values = {
'about_text':"Hello, everyone! Thanks for taking the time to visit my website. My name is Sean Dooher and I’m a s... | {
"repo_name": "sean-dooher/website",
"path": "mainpages/views.py",
"copies": "1",
"size": "2350",
"license": "mit",
"hash": 1489696445286924000,
"line_mean": 52.3181818182,
"line_max": 846,
"alpha_frac": 0.7425404945,
"autogenerated": false,
"ratio": 3.688679245283019,
"config_test": false,
"... |
from django.shortcuts import render
from django.http import HttpResponseBadRequest, JsonResponse
from celery.result import AsyncResult
from celery import current_task, signals
from .tasks import async_apriori
from .models import Archivo
from datetime import datetime
def index(request):
return render(request, '... | {
"repo_name": "paslo22/AssociationRules",
"path": "web/views.py",
"copies": "1",
"size": "1737",
"license": "mit",
"hash": -5381364087623655000,
"line_mean": 24.9253731343,
"line_max": 60,
"alpha_frac": 0.6327000576,
"autogenerated": false,
"ratio": 3.626304801670146,
"config_test": false,
"h... |
from django.shortcuts import render
from django.http import HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.db.models.functions import Coalesce
from django.db.models import Sum, F
from django.views.decorators.http import require_GET
from orders.models import Order, OrderPro... | {
"repo_name": "juntatalor/qexx",
"path": "orders/views.py",
"copies": "1",
"size": "2291",
"license": "mit",
"hash": 4690627560861866000,
"line_mean": 34.2615384615,
"line_max": 102,
"alpha_frac": 0.6678306416,
"autogenerated": false,
"ratio": 4.040564373897707,
"config_test": false,
"has_no_... |
from django.shortcuts import render
from django.http import HttpResponseForbidden, HttpResponse
from django.core.exceptions import PermissionDenied
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST, require_safe
from django.http import Http404
from jsonview.decor... | {
"repo_name": "somethingnew2-0/CS739-ShareBox",
"path": "django-server/server/views.py",
"copies": "1",
"size": "22326",
"license": "mit",
"hash": -1038867687778786700,
"line_mean": 30.8034188034,
"line_max": 145,
"alpha_frac": 0.6005554063,
"autogenerated": false,
"ratio": 3.875368859572991,
"... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpRequest
from models import User, Device
from django.contrib.auth import authenticate, login, logout
def index(request):
if request.user.is_authenticated():
return render(request,'main.html',{'user':request.user})
els... | {
"repo_name": "banacer/parker.io",
"path": "parker/app/views.py",
"copies": "1",
"size": "2677",
"license": "mit",
"hash": -797122916332301000,
"line_mean": 36.7042253521,
"line_max": 114,
"alpha_frac": 0.6167351513,
"autogenerated": false,
"ratio": 4.255961844197138,
"config_test": false,
"h... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpResponseBadRequest
from django.contrib.gis.measure import Distance
from pprint import pformat;
from voxel_globe.world.models import WorldBorder
import voxel_globe.world.tasks as tasks
# Create your views here.
#def error400(requ... | {
"repo_name": "andyneff/voxel-globe",
"path": "voxel_globe/world/views.py",
"copies": "1",
"size": "3560",
"license": "mit",
"hash": 2989670869004246500,
"line_mean": 35.7010309278,
"line_max": 173,
"alpha_frac": 0.6539325843,
"autogenerated": false,
"ratio": 3.2188065099457503,
"config_test": ... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpResponseRedirect, HttpResponseNotFound
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.db.models import Q
import re
from manuscript.models import Author, Title, Chapter, Page, Par... | {
"repo_name": "adamsc64/django-manuscript",
"path": "manuscript/views.py",
"copies": "1",
"size": "5969",
"license": "mit",
"hash": -4975303967365320000,
"line_mean": 27.9757281553,
"line_max": 115,
"alpha_frac": 0.6992796113,
"autogenerated": false,
"ratio": 3.1333333333333333,
"config_test": ... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.core.paginator import Paginator, EmptyPage
from django.contrib.auth import authenticate, login
from .models import Question, Answer
from .forms import *
def test(request, *args, **kwargs):
return Ht... | {
"repo_name": "fantomius/WebTechonologies",
"path": "ask/qa/views.py",
"copies": "1",
"size": "3045",
"license": "mit",
"hash": 1804925958126336300,
"line_mean": 24.5882352941,
"line_max": 76,
"alpha_frac": 0.5878489327,
"autogenerated": false,
"ratio": 4.033112582781457,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.utils import timezone, dateparse
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import Reservat... | {
"repo_name": "kojdjak/django-reservations",
"path": "reservations/views.py",
"copies": "1",
"size": "4454",
"license": "mit",
"hash": -3766667278487909000,
"line_mean": 34.0708661417,
"line_max": 130,
"alpha_frac": 0.6748989672,
"autogenerated": false,
"ratio": 3.752316764953665,
"config_test"... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.template import RequestContext, loader, Context, Template
from .models import Text
import datetime
import time
import json
# Create your views here.
def hello(request):
return HttpResponse('<html>... | {
"repo_name": "alanjds/pastebong",
"path": "texts/views.py",
"copies": "1",
"size": "1034",
"license": "apache-2.0",
"hash": -4945790153057765000,
"line_mean": 23.0465116279,
"line_max": 69,
"alpha_frac": 0.665377176,
"autogenerated": false,
"ratio": 3.7875457875457874,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, JsonResponse
from datetime import datetime
import feedparser
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.renderers import JSONRenderer... | {
"repo_name": "abvrd/pythonapi",
"path": "api/views.py",
"copies": "1",
"size": "1256",
"license": "mit",
"hash": -2052330765094571500,
"line_mean": 28.2093023256,
"line_max": 95,
"alpha_frac": 0.6815286624,
"autogenerated": false,
"ratio": 3.7717717717717716,
"config_test": false,
"has_no_ke... |
from django.shortcuts import render
from django.http import HttpResponse, Http404, JsonResponse
from urllib import urlopen
import json
# Create your views here.
typeFormURL = "https://api.typeform.com/v0/form/Zh7TEH?key=1b508a88a1331cf2c182cb136f6da1ebd880a299&completed=true"
typeFormRSVP_URL = "https://api.typeform.c... | {
"repo_name": "bogdanpozderca/Spartahack-Analytics",
"path": "Visualization/views.py",
"copies": "1",
"size": "24504",
"license": "mit",
"hash": -7583150110146038000,
"line_mean": 37.049689441,
"line_max": 122,
"alpha_frac": 0.629489063,
"autogenerated": false,
"ratio": 2.6445067990502915,
"con... |
from django.shortcuts import render
from django.http import HttpResponse,Http404
from accounts.forms import UserProfileForm, UserForm
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
import logging
logger = logging.getLogger(__name__)
def register(request):
""... | {
"repo_name": "vollov/ocbl.ca",
"path": "django/accounts/views.py",
"copies": "1",
"size": "2901",
"license": "mit",
"hash": 5157928347603086000,
"line_mean": 34.3902439024,
"line_max": 93,
"alpha_frac": 0.6256463289,
"autogenerated": false,
"ratio": 4.663987138263666,
"config_test": false,
"... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.conf import settings
from dv_apps.quality_checks.util_filesize_zero import ZeroFilesizeStats
from dv_apps.quality_checks.util_no_checksum import NoChecksumStats
from dv_apps.quality_checks.util_notifications import Notificatio... | {
"repo_name": "IQSS/miniverse",
"path": "dv_apps/quality_checks/views.py",
"copies": "1",
"size": "6060",
"license": "mit",
"hash": 5012212673038753000,
"line_mean": 37.1132075472,
"line_max": 124,
"alpha_frac": 0.6405940594,
"autogenerated": false,
"ratio": 3.7780548628428927,
"config_test": f... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.conf import settings
from dv_apps.quality_checks.util_notifications import NotificationStats
from dv_apps.quality_checks.util_content_types import ContentTypeStats
from django.views.decorators.cache import cache_page
def vie... | {
"repo_name": "IQSS/miniverse",
"path": "dv_apps/quality_checks/views_notifications.py",
"copies": "1",
"size": "1988",
"license": "mit",
"hash": -4267171380212401700,
"line_mean": 37.9803921569,
"line_max": 77,
"alpha_frac": 0.6483903421,
"autogenerated": false,
"ratio": 4.528473804100228,
"co... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.core.exceptions import ObjectDoesNotExist
from .models import JobSession
from .forms import JobRequestForm
from .tasks import handleJob
from .config import CAPTCHA_TUPLES
import random
import json
def main(request):
for... | {
"repo_name": "jhanschoo/imprimo",
"path": "views.py",
"copies": "1",
"size": "2977",
"license": "mit",
"hash": -8698039777493838000,
"line_mean": 32.4494382022,
"line_max": 79,
"alpha_frac": 0.5817937521,
"autogenerated": false,
"ratio": 4.449925261584454,
"config_test": false,
"has_no_keywo... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.db.utils import DatabaseError
from django.core.exceptions import ValidationError
from mozdns.utils import get_zones
from core.search.compiler.django_compile import compile_to_django
from core.search.compiler.django_compile i... | {
"repo_name": "rtucker-mozilla/inventory",
"path": "core/search/views.py",
"copies": "1",
"size": "5893",
"license": "bsd-3-clause",
"hash": -9015923505742767000,
"line_mean": 31.9217877095,
"line_max": 79,
"alpha_frac": 0.6012217886,
"autogenerated": false,
"ratio": 3.9286666666666665,
"config... |
from django.shortcuts import render
from django.http import HttpResponse,Http404
from django import template
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models i... | {
"repo_name": "nshoemaker/OpenSpace",
"path": "room_reservation/room_reservation_app/views.py",
"copies": "1",
"size": "9176",
"license": "mit",
"hash": -4288162596808156000,
"line_mean": 38.0468085106,
"line_max": 189,
"alpha_frac": 0.7163251962,
"autogenerated": false,
"ratio": 3.51570881226053... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.shortcuts import render_to_response
import datetime as dt
# Create your views here.
def hello(request):
return HttpResponse('Hello world')
def currentDatetime(request):
now = dt.datetime.now()
return render_to_res... | {
"repo_name": "tiduszheng/mypysite",
"path": "myBlog/views.py",
"copies": "1",
"size": "1492",
"license": "mit",
"hash": 1509088640328723200,
"line_mean": 32.9318181818,
"line_max": 78,
"alpha_frac": 0.663538874,
"autogenerated": false,
"ratio": 3.4941451990632317,
"config_test": false,
"has_... |
from django.shortcuts import render
from django.http import HttpResponse,Http404
from django.template import Context
from django.contrib.auth.models import User
from django.template.loader import get_template
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.contri... | {
"repo_name": "tarunz/Django-Bookmarks",
"path": "bookmarks/views.py",
"copies": "1",
"size": "4521",
"license": "mit",
"hash": 3674934409482428000,
"line_mean": 26.9074074074,
"line_max": 60,
"alpha_frac": 0.7100199071,
"autogenerated": false,
"ratio": 3.206382978723404,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.template import RequestContext, loader
from rest_framework import generics
from rbac.models import Users, Roles, Resources, Actions, Role_Permission, User_Roles
from rbac.serializers import UserSerializer, RoleSerializer, Re... | {
"repo_name": "icgowtham/repos_python",
"path": "rule_based_access_control/sample_rbac/rbac/views.py",
"copies": "1",
"size": "3659",
"license": "unlicense",
"hash": 6821132770590907000,
"line_mean": 28.7479674797,
"line_max": 143,
"alpha_frac": 0.7135829462,
"autogenerated": false,
"ratio": 4.19... |
from django.shortcuts import render
# from django.http import HttpResponse, Http404
from django.template import RequestContext
from django.http import HttpResponseRedirect
from js1kg.user.forms import *
from js1kg.project.models import *
from js1kg.trip.models import *
# from django.contrib.auth.decorators import login... | {
"repo_name": "dazhaoniel/1kg-more",
"path": "js1kg/user/views.py",
"copies": "1",
"size": "2194",
"license": "apache-2.0",
"hash": -1713831018262718200,
"line_mean": 30.8115942029,
"line_max": 80,
"alpha_frac": 0.660437557,
"autogenerated": false,
"ratio": 3.903914590747331,
"config_test": fal... |
from django.shortcuts import render
from django.http import HttpResponse,Http404
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.clickjacking import xframe_options_exempt
from csp.decorators import csp_update
from datetime import timedelta
import secret,action
import json
#FlockOS
f... | {
"repo_name": "akhilraj95/xpense",
"path": "xpense2/flock/views.py",
"copies": "1",
"size": "15762",
"license": "mit",
"hash": -8720419081440351000,
"line_mean": 33.5657894737,
"line_max": 166,
"alpha_frac": 0.6350716914,
"autogenerated": false,
"ratio": 3.5904328018223235,
"config_test": false... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.views.decorators.csrf import csrf_protect
from approver.forms import AboutYouForm, ProjectForm
from django.contrib.auth.models import User
from approver.models import Person
from approver.models import Project
from approver.wo... | {
"repo_name": "amberlallen/qipr_approver",
"path": "qipr_approver/approver/views/dashboard.py",
"copies": "1",
"size": "3356",
"license": "apache-2.0",
"hash": -9049630395377543000,
"line_mean": 49.8484848485,
"line_max": 207,
"alpha_frac": 0.7193087008,
"autogenerated": false,
"ratio": 3.9904875... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.models import User
from approver.models import Project, Address
from approver.forms import AboutYouForm
from approver.workflows import user_crud
import json
... | {
"repo_name": "amberlallen/qipr_approver",
"path": "qipr_approver/approver/views/aboutyou.py",
"copies": "1",
"size": "1360",
"license": "apache-2.0",
"hash": -5990767266746089000,
"line_mean": 34.7894736842,
"line_max": 99,
"alpha_frac": 0.7213235294,
"autogenerated": false,
"ratio": 3.852691218... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from .forms import RecipeForm
from .models import Recipe
from django.contrib.auth.decorators import login_required
import json
from trigger.models import Trigger
from trigger import triggers
from action.models import Action
from action im... | {
"repo_name": "theju/dtwt",
"path": "recipe/views.py",
"copies": "1",
"size": "2567",
"license": "mit",
"hash": 4844821938813704000,
"line_mean": 37.8939393939,
"line_max": 96,
"alpha_frac": 0.6373198286,
"autogenerated": false,
"ratio": 4.314285714285714,
"config_test": false,
"has_no_keywor... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from main.models import *
from django.apps import apps
import os
# The common content
common_content = {
'applist':('Main', 'Inout')}
myapp = apps.get_app_config('main')
model_list = myapp.models
def get_model_by_label(model_label,... | {
"repo_name": "detialiaj/pro",
"path": "SYS/main/views.py",
"copies": "1",
"size": "1673",
"license": "mit",
"hash": -5639718679746569000,
"line_mean": 25.9838709677,
"line_max": 65,
"alpha_frac": 0.6706515242,
"autogenerated": false,
"ratio": 3.299802761341223,
"config_test": false,
"has_no_... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from .models import Beer, Manufacturer
def index(request, sort_by='-id'):
all_beers = Beer.objects.all().order_by(sort_by)
if sort_by == 'grade_total':
all_beers.order_by('grade_taste')
elif sort_by == '-grade_total':
all_beers.o... | {
"repo_name": "campovski/beernburger",
"path": "beer/views.py",
"copies": "1",
"size": "2117",
"license": "mit",
"hash": -1668243665332236500,
"line_mean": 35.5,
"line_max": 111,
"alpha_frac": 0.698630137,
"autogenerated": false,
"ratio": 2.896032831737346,
"config_test": false,
"has_no_keywo... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from .models import Book, BookCategories
from django.db.models import Q
def index(request):
if request.method == 'POST':
search = request.POST['search']
del_cata = BookCategories.objects.get(name='DeleteCat')
... | {
"repo_name": "DreamN/Smart-Library",
"path": "library/catalog_views.py",
"copies": "1",
"size": "1465",
"license": "mit",
"hash": -9147718092383028000,
"line_mean": 42.0882352941,
"line_max": 120,
"alpha_frac": 0.652559727,
"autogenerated": false,
"ratio": 3.5995085995085994,
"config_test": fa... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from .models import Burger
from beer.models import Manufacturer
def index(request, sort_by='-id'):
all_burgers = Burger.objects.all().order_by(sort_by)
if sort_by == 'grade_total':
all_burgers.order_by('grade_taste')
elif sort_by =... | {
"repo_name": "campovski/beernburger",
"path": "burger/views.py",
"copies": "1",
"size": "1742",
"license": "mit",
"hash": -1416529472481801000,
"line_mean": 36.8695652174,
"line_max": 116,
"alpha_frac": 0.7014925373,
"autogenerated": false,
"ratio": 3.034843205574913,
"config_test": false,
"... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from .models import Torc
from beer.models import Manufacturer
def index(request, sort_by='-id'):
all_torcs = Torc.objects.all().order_by(sort_by)
if sort_by == 'grade_total':
all_torcs.order_by('grade_taste')
elif sort_by == '-grad... | {
"repo_name": "campovski/beernburger",
"path": "teacoffee/views.py",
"copies": "1",
"size": "1705",
"license": "mit",
"hash": -3737419176876357600,
"line_mean": 36.8888888889,
"line_max": 116,
"alpha_frac": 0.695601173,
"autogenerated": false,
"ratio": 3.012367491166078,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
import datetime
import wei123.settings
import re
import base64
from django.template import Template, Context
from django.template.loader import get_template
from django.shortcuts import render_to_response
from weisite.models import weixin... | {
"repo_name": "cnwarden/wei123",
"path": "weisite/views.py",
"copies": "1",
"size": "8449",
"license": "mit",
"hash": -6449219852144390000,
"line_mean": 38.8537735849,
"line_max": 215,
"alpha_frac": 0.56006628,
"autogenerated": false,
"ratio": 3.5574736842105263,
"config_test": false,
"has_no... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
import sqlite3
import json
import arrow
# import hashlib
# import requests
# import random
# HttpResponseRedirect
# from django.urls import reverse
# from django.views import generic
def index(request):
stock_list = []
stock_jso... | {
"repo_name": "militiaonly/spark1707",
"path": "mysite/dashboard2/views.py",
"copies": "1",
"size": "3554",
"license": "mit",
"hash": -8701065477714258000,
"line_mean": 29.3076923077,
"line_max": 101,
"alpha_frac": 0.5908065426,
"autogenerated": false,
"ratio": 3.419479267116683,
"config_test":... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from datetime import date
from .models import Category, Page, StaticPage, ListPage, HomePage, StaffMember, BoardMember
from events.models import Event
from django.core.mail import EmailMessage
from django.shortcuts import redirect
from... | {
"repo_name": "samdowd/drumm-farm",
"path": "pages/views.py",
"copies": "1",
"size": "3768",
"license": "mit",
"hash": -7465545157672353000,
"line_mean": 31.4827586207,
"line_max": 101,
"alpha_frac": 0.7292993631,
"autogenerated": false,
"ratio": 3.21227621483376,
"config_test": false,
"has_n... |
from django.shortcuts import render
from django.http import HttpResponse, Http404
from datetime import date, timedelta
from .models import Event, Sponsor
from pages.models import Category, Page
def index(request):
past_events = Event.objects.filter(date__lt=date.today()).order_by('-date')
upcoming_events = Event.o... | {
"repo_name": "samdowd/drumm-farm",
"path": "events/views.py",
"copies": "1",
"size": "1584",
"license": "mit",
"hash": 4153990413543738400,
"line_mean": 32.0208333333,
"line_max": 116,
"alpha_frac": 0.7171717172,
"autogenerated": false,
"ratio": 3.099804305283757,
"config_test": false,
"has_... |
from django.shortcuts import render
from django.http import HttpResponse,HttpRequest
##from models import Personuser,Wishes,Friend
import hashlib
from models import Wishes,Friend
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login,logout
from django.contrib.auth.decorators im... | {
"repo_name": "y73isc00l/WishGift",
"path": "myproject/polls/dashboard.py",
"copies": "1",
"size": "7068",
"license": "apache-2.0",
"hash": -2516494888557629000,
"line_mean": 44.3076923077,
"line_max": 206,
"alpha_frac": 0.6977928693,
"autogenerated": false,
"ratio": 3.372137404580153,
"config_... |
from django.shortcuts import render
from django.http import HttpResponse,HttpRequest
##from models import Personuser,Wishes,Friend
import hashlib
from models import Wishes,Friend,Pool
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login,logout
from django.contrib.auth.decorato... | {
"repo_name": "y73isc00l/WishGift",
"path": "myproject/polls/pool.py",
"copies": "1",
"size": "1779",
"license": "apache-2.0",
"hash": -5049024872900430000,
"line_mean": 41.380952381,
"line_max": 194,
"alpha_frac": 0.7566048342,
"autogenerated": false,
"ratio": 3.474609375,
"config_test": false... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden
from django.conf import settings
from linebot import LineBotApi, WebhookParser
from linebot.exceptions import InvalidSignatureError, LineBotApiError
from linebot.models import (
MessageEvent,
... | {
"repo_name": "kagemiku/gpbot-line",
"path": "gpbot/bot/views.py",
"copies": "1",
"size": "2287",
"license": "mit",
"hash": -2782792944481911300,
"line_mean": 29.0921052632,
"line_max": 107,
"alpha_frac": 0.6445124617,
"autogenerated": false,
"ratio": 4.372848948374761,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods, require_POST
from django.core.exceptions import ObjectDoesNotExist
from django.conf im... | {
"repo_name": "sparcs-kaist/otlplus",
"path": "apps/main/views.py",
"copies": "1",
"size": "2264",
"license": "mit",
"hash": 8213524746225560000,
"line_mean": 42.5384615385,
"line_max": 161,
"alpha_frac": 0.7323321555,
"autogenerated": false,
"ratio": 3.7054009819967266,
"config_test": false,
... |
#from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import get_object_or_404
from django.db.models import Q
import json
import requests
from collections import Counter
from random import randrange
fr... | {
"repo_name": "boyombo/django-stations",
"path": "stations/api/views.py",
"copies": "1",
"size": "19770",
"license": "mit",
"hash": -3528314641289695000,
"line_mean": 34.5575539568,
"line_max": 78,
"alpha_frac": 0.6020232676,
"autogenerated": false,
"ratio": 3.653668453150989,
"config_test": fa... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest
from icalendar import Calendar, Event
from requests import get
from django.conf import settings
def set_or_is_equal(obj, key, value):
if key in obj.keys():
if str(obj[key]) == str(value):
return True
else:
retu... | {
"repo_name": "kraenhansen/Calendars-United",
"path": "calendars_united/calendar_unitor/views.py",
"copies": "1",
"size": "1897",
"license": "mit",
"hash": 833861585343369300,
"line_mean": 32.8928571429,
"line_max": 159,
"alpha_frac": 0.7190300474,
"autogenerated": false,
"ratio": 3.1669449081803... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseNotFound
from models import Device
from django.views.decorators.csrf import csrf_exempt
def home(request):
return render(request, 'index.html', {
'devices': Device.objects.all()
})
@csrf_exem... | {
"repo_name": "circuitar/WebLights",
"path": "WebLightsPanel/views.py",
"copies": "1",
"size": "1098",
"license": "mit",
"hash": 8927001544474117000,
"line_mean": 27.8947368421,
"line_max": 81,
"alpha_frac": 0.6438979964,
"autogenerated": false,
"ratio": 4.753246753246753,
"config_test": false,... |
from django.shortcuts import render
from django.http import HttpResponse,HttpResponseForbidden,HttpResponseRedirect,JsonResponse
from .models import *
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.conf import settings
from django.db import models
import random
import pymysql
from ... | {
"repo_name": "IAMBADCODER/Blog",
"path": "web/blog/views.py",
"copies": "1",
"size": "9491",
"license": "apache-2.0",
"hash": -517341414645170500,
"line_mean": 32.7117437722,
"line_max": 92,
"alpha_frac": 0.602026813,
"autogenerated": false,
"ratio": 4.162126537785589,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseForbidden
from django.views import View
from .forms import SubscriptionForm
from .models import Subscription, NewsletterSettings
class NewsletterView(View):
def get(self, request):
form = SubscriptionForm()
retu... | {
"repo_name": "thepoly/Pipeline",
"path": "newsletter/views.py",
"copies": "1",
"size": "1167",
"license": "mit",
"hash": 5081619068496708000,
"line_mean": 34.3636363636,
"line_max": 76,
"alpha_frac": 0.6529562982,
"autogenerated": false,
"ratio": 4.505791505791506,
"config_test": false,
"has... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseForbidden, \
HttpResponseRedirect, HttpResponseBadRequest, HttpResponseNotAllowed
import logging
log = logging.getLogger('client_app')
# Create your views here.
from .oauthclient import *
OAUTH_URL = 'http://192.168.243.5:3900... | {
"repo_name": "Boris-Barboris/rsoi",
"path": "lab01/client/client_app/views.py",
"copies": "1",
"size": "2533",
"license": "mit",
"hash": -206916471087151360,
"line_mean": 32.1447368421,
"line_max": 86,
"alpha_frac": 0.5575853852,
"autogenerated": false,
"ratio": 4.003179650238474,
"config_test... |
from django.shortcuts import render
from django.http import (HttpResponse, HttpResponseForbidden,
HttpResponseRedirect)
from algo.tools.vkloader import download_wall
import algo.tools.converters as conv
from django.conf import settings
from contextlib import contextmanager
from shutil import rm... | {
"repo_name": "bigartm/visartm",
"path": "tools/views.py",
"copies": "1",
"size": "4588",
"license": "bsd-3-clause",
"hash": -8734039155146946000,
"line_mean": 32.0071942446,
"line_max": 77,
"alpha_frac": 0.5575414124,
"autogenerated": false,
"ratio": 4.12219227313567,
"config_test": false,
"... |
# from django.shortcuts import render
from django.http import HttpResponse, HttpResponseGone, HttpResponseBadRequest, HttpResponseServerError
from django.http import Http404
from django.conf import settings
# Create your views here.
from .models import DBImage, ImageServer
def get_image(request, id):
try:
... | {
"repo_name": "sunshaoyan/ISeeNN",
"path": "ISeeNN/image_server/views.py",
"copies": "1",
"size": "1409",
"license": "apache-2.0",
"hash": 2413061099470700000,
"line_mean": 34.225,
"line_max": 103,
"alpha_frac": 0.682753726,
"autogenerated": false,
"ratio": 4.193452380952381,
"config_test": fal... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseNotAllowed, JsonResponse, HttpResponseRedirect, HttpResponseBadRequest
from django.core import serializers
from django.urls import reverse
from django.template import loader
from django.views.decorators.gzip import gzip_page
from ur... | {
"repo_name": "baby5/Django-httpbin",
"path": "httpbin/bin/views.py",
"copies": "1",
"size": "8604",
"license": "mit",
"hash": -7531623169253380000,
"line_mean": 32.609375,
"line_max": 136,
"alpha_frac": 0.6044862854,
"autogenerated": false,
"ratio": 3.758846657929227,
"config_test": false,
"... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseNotFound, Http404
from django.db import connections
from OctaHomeCore.views.base import *
#View Object
class handleDnsAdminView(viewRequestHandler):
def getTemplate(self):
return 'OctaHomeDnsAdmin/Settings'
def getViewParamete... | {
"repo_name": "Tomcuzz/OctaHomeAutomation",
"path": "OctaHomeDnsAdmin/views.py",
"copies": "1",
"size": "1228",
"license": "mit",
"hash": 7804274362895598000,
"line_mean": 24.0612244898,
"line_max": 115,
"alpha_frac": 0.6921824104,
"autogenerated": false,
"ratio": 3.3369565217391304,
"config_te... |
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseNotFound, JsonResponse
from django.conf import settings
from django_countries import countries
from timeSeries.models import Series, Value, Forecast, SatelliteData, Location, DataProvider, DataType, User
from .decoder import decode
#=... | {
"repo_name": "JosePedroMatos/Tethys",
"path": "timeSeries/views.py",
"copies": "1",
"size": "46619",
"license": "mit",
"hash": -3482688047362257000,
"line_mean": 45.1584158416,
"line_max": 198,
"alpha_frac": 0.5479954525,
"autogenerated": false,
"ratio": 4.185580894235949,
"config_test": false... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.