text
stringlengths
0
1.05M
meta
dict
from django.shortcuts import render from enfermeriaapp.models import Cola_Consulta, Cola_Enfermeria from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.utils import timezone import time from django.contrib import messages from django.contrib.auth.decorators import login_requir...
{ "repo_name": "anderson7ru/bienestarues", "path": "enfermeriaapp/views.py", "copies": "1", "size": "4242", "license": "mit", "hash": 3516968017546638300, "line_mean": 48.3255813953, "line_max": 280, "alpha_frac": 0.7043847242, "autogenerated": false, "ratio": 3.0739130434782607, "config_test": ...
from django.shortcuts import render from episodes.models import Episode from django.views.decorators.clickjacking import xframe_options_exempt def homepage(request, template="home.html"): context = {} context['episodes'] = Episode.objects.all() context['episode'] = None # ghetto way of handing per epis...
{ "repo_name": "jinpark/something-sunshine-django", "path": "episodes/views.py", "copies": "1", "size": "1388", "license": "mit", "hash": 3952127078845725700, "line_mean": 32.8780487805, "line_max": 77, "alpha_frac": 0.6685878963, "autogenerated": false, "ratio": 3.9431818181818183, "config_test...
from django.shortcuts import render from equipments.models import Equipment, AvailableEquipment, BorrowedEquipment from equipments.models import BrokenEquipment, EquipmentState from users.models import Employee, Donor, Secretary, Administrator from django.http import HttpResponseRedirect from django.core.urlresolvers ...
{ "repo_name": "amigos-do-gesiel/iespv-administrativo", "path": "equipments/views.py", "copies": "1", "size": "3448", "license": "mit", "hash": -8861891476092988000, "line_mean": 30.3454545455, "line_max": 88, "alpha_frac": 0.7047563805, "autogenerated": false, "ratio": 3.695605573419078, "confi...
from django.shortcuts import render from expo.models import Tag, Booth from django.core.paginator import Paginator # Create your views here. def index(request): return tag_filter(request) def booth_detail(request, booth_id=None): context = {} booth = Booth.objects.get(pk=booth_id) booth_tags = booth...
{ "repo_name": "jffifa/kotoribuy", "path": "expo/views.py", "copies": "1", "size": "1417", "license": "mit", "hash": 4213339455968127500, "line_mean": 23.4310344828, "line_max": 66, "alpha_frac": 0.6033874382, "autogenerated": false, "ratio": 3.1211453744493394, "config_test": false, "has_no_k...
from django.shortcuts import render from fa import api from fa.forms import SearchForm from datetime import datetime import re import logging logger = logging.getLogger(__name__) def index(request): return render(request, 'fa/index.html', {}) def user(request, name): context = api.get_profile_context(name) ...
{ "repo_name": "Watteo/faview", "path": "fa/views.py", "copies": "1", "size": "1552", "license": "mit", "hash": -1456175218760738000, "line_mean": 27.2181818182, "line_max": 59, "alpha_frac": 0.6765463918, "autogenerated": false, "ratio": 3.448888888888889, "config_test": false, "has_no_keywor...
from django.shortcuts import render from farmer.models import DeviceSettings from farmer.serializers import DeviceSettingsSerializer from rest_framework.response import Response from django.shortcuts import get_object_or_404 import time from rest_framework import viewsets # Create your views here. class DeviceSetti...
{ "repo_name": "seadsystem/ShR2", "path": "Web Stack/farmer/views.py", "copies": "2", "size": "1116", "license": "mit", "hash": -7633090716362158000, "line_mean": 31.8529411765, "line_max": 66, "alpha_frac": 0.7311827957, "autogenerated": false, "ratio": 4.259541984732825, "config_test": false, ...
from django.shortcuts import render from farm.models import Node, Package, PackageCheck def index(request, typeslug, nodeslug=''): context = '' try: packagetype = PackageType.objects.get(slug=typeslug) if nodeslug: nodeslugs = nodeslug.split(";") node_list = Node.objec...
{ "repo_name": "Duologic/ranchy", "path": "ranchy/farm/views/matrix.py", "copies": "1", "size": "1316", "license": "mit", "hash": -7679923943168611000, "line_mean": 32.7435897436, "line_max": 154, "alpha_frac": 0.579787234, "autogenerated": false, "ratio": 3.928358208955224, "config_test": false...
from django.shortcuts import render from fhir.models import SupportedResourceType from collections import OrderedDict from django.http import HttpResponse import json from django.views.decorators.csrf import csrf_exempt from fhir.utils import (kickout_403, kickout_404) from fhir.views.utils import check_access_inter...
{ "repo_name": "ekivemark/BlueButtonFHIR_API", "path": "fhir/views/delete.py", "copies": "1", "size": "1420", "license": "apache-2.0", "hash": 1223343883394153200, "line_mean": 34.525, "line_max": 121, "alpha_frac": 0.7070422535, "autogenerated": false, "ratio": 3.736842105263158, "config_test":...
from django.shortcuts import render from find.services import * def index_page(request): return render(request, 'find/index.html') def get_food(request, location): coordinates = location.split(',') latitude = coordinates[0] longitude = coordinates[1] restaurants_list = get_restaurants(latitude, ...
{ "repo_name": "vjFaLk/BWDIE", "path": "find/views.py", "copies": "1", "size": "1530", "license": "mit", "hash": -1526434037221658600, "line_mean": 35.4285714286, "line_max": 90, "alpha_frac": 0.5588235294, "autogenerated": false, "ratio": 4.273743016759776, "config_test": false, "has_no_keywo...
from django.shortcuts import render from fishbook.forms import UserForm, WebUserForm from django.contrib.auth import authenticate, login, logout from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.decorators import login_required def index(request): if request.user.is_authenticate...
{ "repo_name": "gustavovaliati/GRVFishbook", "path": "GRVFishbook/fishbook/views.py", "copies": "1", "size": "5012", "license": "bsd-3-clause", "hash": 4068665627117660000, "line_mean": 40.775, "line_max": 103, "alpha_frac": 0.6458499601, "autogenerated": false, "ratio": 4.455111111111111, "conf...
from django.shortcuts import render from .forms import ConsumerForm, StoreForm, LoginForm from django.http import HttpResponseRedirect def register(request): return render(request, 'sign_up/register.html') def login(request): if request.method == 'POST': aForm = LoginForm(request.POST) redirec...
{ "repo_name": "rayhu-osu/vcube", "path": "sign_up/views.py", "copies": "1", "size": "1917", "license": "mit", "hash": 1837007214807763700, "line_mean": 30.9666666667, "line_max": 99, "alpha_frac": 0.6244131455, "autogenerated": false, "ratio": 3.904276985743381, "config_test": false, "has_no_...
from django.shortcuts import render from .forms import ContactForm from django.core.mail import EmailMessage from django.shortcuts import redirect from django.template.loader import get_template def main(request): '''Главная страница сайта''' context = {} return render(request, 'index.html', context) de...
{ "repo_name": "DarkenNav/UnionFreeArts", "path": "WebApp/WebSiteUnionFreeArts/main/views.py", "copies": "1", "size": "3052", "license": "mit", "hash": -2436385868816060000, "line_mean": 29.9381443299, "line_max": 89, "alpha_frac": 0.5608130623, "autogenerated": false, "ratio": 4.094133697135061, ...
from django.shortcuts import render from .forms import DateFilterForm from core.models import * from messaging.models import * from prescriptions.models import * from testResults.models import * from transfer.models import * from django.contrib.auth.decorators import login_required, user_passes_test from core.views i...
{ "repo_name": "jimga150/HealthNet", "path": "HealthNet/sysstats/views.py", "copies": "1", "size": "5223", "license": "mit", "hash": -5974760815067972000, "line_mean": 41.1209677419, "line_max": 120, "alpha_frac": 0.6341183228, "autogenerated": false, "ratio": 3.64480111653873, "config_test": tr...
from django.shortcuts import render from .forms import DeviceForm, CreateDeviceForm from django.http import HttpResponse, JsonResponse from django_iot.apps.interactions.tasks import * from .models import * from django.contrib.auth.decorators import login_required LOCATION_CHOICES = { '1': 'room', '2': 'livin...
{ "repo_name": "pmaxit/DJANGO_IOT", "path": "django_iot/apps/devices/views.py", "copies": "1", "size": "2626", "license": "mit", "hash": -3214221692317018000, "line_mean": 26.9468085106, "line_max": 111, "alpha_frac": 0.6092916984, "autogenerated": false, "ratio": 3.7301136363636362, "config_tes...
from django.shortcuts import render from .forms import DoorForm from apps.doors.models import * from apps.cameras.models import * from apps.projects.models import * from django.db.models import Q, Prefetch from django.forms import formset_factory, modelform_factory from django import forms # Create your views here. d...
{ "repo_name": "theSoloBrewer/Project_Management", "path": "apps/reports/views.py", "copies": "1", "size": "1431", "license": "apache-2.0", "hash": 5549462355151238000, "line_mean": 46.7, "line_max": 240, "alpha_frac": 0.7582110412, "autogenerated": false, "ratio": 3.431654676258993, "config_tes...
from django.shortcuts import render from forms import ImageUploadForm from reconloc.models import ImgReferencia from reconloc.models import ImgBusqueda from django.http import HttpResponse from django.http import HttpResponseForbidden import cv2 from django.views.decorators.csrf import csrf_exempt from reconpath import...
{ "repo_name": "roviol/recog", "path": "reconpath/reconloc/views.py", "copies": "1", "size": "2484", "license": "apache-2.0", "hash": 6749954790821606000, "line_mean": 33.5, "line_max": 64, "alpha_frac": 0.6107085346, "autogenerated": false, "ratio": 3.430939226519337, "config_test": false, "h...
from django.shortcuts import render from .forms import LocationForm, MidpointForm from django.forms.formsets import formset_factory from django.views import View import json import os # Create your views here. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) MAPS_KEY = json.loads(open(BASE_DIR +...
{ "repo_name": "andrewwong97/path-hero", "path": "pathhero/main/views.py", "copies": "1", "size": "1180", "license": "apache-2.0", "hash": 4004109698411944400, "line_mean": 29.2820512821, "line_max": 95, "alpha_frac": 0.6923728814, "autogenerated": false, "ratio": 3.0025445292620865, "config_tes...
from django.shortcuts import render from .forms import LoginForm, PasswordChangeForm, UserRegisterForm from django.contrib.auth import authenticate, login, update_session_auth_hash from ui.tools import success, error from django.contrib.auth.decorators import login_required from django.contrib.auth.models import Group ...
{ "repo_name": "liyao001/BioQueue", "path": "accounts/views.py", "copies": "1", "size": "3147", "license": "apache-2.0", "hash": 6149710557225046000, "line_mean": 37.3780487805, "line_max": 97, "alpha_frac": 0.5608516047, "autogenerated": false, "ratio": 4.508595988538682, "config_test": false, ...
from django.shortcuts import render from .forms import LoginPairForm import subprocess from .models import LoginPair import shlex import StringIO def home(request): ############################## # user already login and save its login info. if request.method == "POST": form = LoginPairForm(re...
{ "repo_name": "chungyan5/MigrateEmailServer", "path": "getlogin/views.py", "copies": "1", "size": "3840", "license": "apache-2.0", "hash": 5402004576862583000, "line_mean": 42.6363636364, "line_max": 135, "alpha_frac": 0.4088541667, "autogenerated": false, "ratio": 5.267489711934156, "config_te...
from django.shortcuts import render from .forms import MembersSearchForm, MembersBankDetailForm, MembersAdminForm, MembersResultForm from .models import readmember, writemember, searchmember # get the UniVerse imports import os os.chdir("C:\\U2\\XDEMO\\pythonbetarocket") import u2py # Create your views here. def get_...
{ "repo_name": "RocketSoftware/PythonBetaProject", "path": "Django/src/members/views.py", "copies": "2", "size": "3468", "license": "mit", "hash": -2590444780820408000, "line_mean": 35.125, "line_max": 96, "alpha_frac": 0.4806805075, "autogenerated": false, "ratio": 4.763736263736264, "config_te...
from django.shortcuts import render from .forms import * from django.contrib.auth.decorators import login_required, user_passes_test from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from base.models import Doctor, Patient, Person, testResults, Logger from django.shortcuts import...
{ "repo_name": "blackpan2/HealthNet", "path": "src/healthnet/testResults/views.py", "copies": "1", "size": "3429", "license": "mit", "hash": 1848662502595108000, "line_mean": 37.5393258427, "line_max": 84, "alpha_frac": 0.6914552348, "autogenerated": false, "ratio": 3.9825783972125435, "config_t...
from django.shortcuts import render from .forms import * from .models import Friend # Create your views here. def example_form(request, template="form.html"): form = ExampleForm(request.POST or None) if request.POST and form.is_valid(): pass # Do whatever return render(request, "form.html", { "form": form }...
{ "repo_name": "thetarkus/django-semanticui-forms", "path": "example/app/views.py", "copies": "1", "size": "1339", "license": "mit", "hash": -5340856171470192000, "line_mean": 19, "line_max": 60, "alpha_frac": 0.710978342, "autogenerated": false, "ratio": 3.128504672897196, "config_test": false,...
from django.shortcuts import render from forms import QueryForm from models import Query, GBIFResponse from api_utils import species_search, process_response def index(request): return render(request, 'base.html', {}) def query_form(request): form = QueryForm() if request.method == 'POST': form...
{ "repo_name": "chidg/django-triodia", "path": "triodia/views.py", "copies": "1", "size": "1510", "license": "mit", "hash": -2367087159835255300, "line_mean": 32.5555555556, "line_max": 111, "alpha_frac": 0.5721854305, "autogenerated": false, "ratio": 4.301994301994302, "config_test": false, "...
from django.shortcuts import render from .forms import RegistradoForm from .models import Registrado # Create your views here. def inicio(request): titulo = "Bienvenidos" form = RegistradoForm(request.POST or None, request.FILES or None) queryset = Registrado.objects.all() for obj in queryset: print obj.nom...
{ "repo_name": "probardjango/Probar-Django-1.9", "path": "src/boletin/views.py", "copies": "1", "size": "1092", "license": "mit", "hash": -5311485134565539000, "line_mean": 17.8275862069, "line_max": 67, "alpha_frac": 0.6694139194, "autogenerated": false, "ratio": 2.7786259541984735, "config_tes...
from django.shortcuts import render from .forms import SearchForm, ClassifyForm from whoosh.qparser import MultifieldParser, QueryParser from whoosh import index as i from whoosh import scoring import whoosh.query as QRY import time import pandas as pd from datetime import datetime from indexing.crawl import crawl_and_...
{ "repo_name": "BhavyaLight/information-retrival-search-engine", "path": "informationRetrival/frontend/views.py", "copies": "1", "size": "6155", "license": "mit", "hash": -2931876407219571000, "line_mean": 49.867768595, "line_max": 166, "alpha_frac": 0.580016247, "autogenerated": false, "ratio": 3...
from django.shortcuts import render from .forms import SignUpForm, UploadFileForm, PublicKeyForm from .models import PublicKey from django.http import HttpResponseRedirect from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA from Crypto.Cipher import DES3 from Crypto import Random import binascii import os ...
{ "repo_name": "jnayak1/cs3240-s16-team16", "path": "upload/views.py", "copies": "1", "size": "3292", "license": "mit", "hash": 8160576080366234000, "line_mean": 28.1327433628, "line_max": 86, "alpha_frac": 0.5859659781, "autogenerated": false, "ratio": 3.7494305239179955, "config_test": false, ...
from django.shortcuts import render from forms import UploadFileForm from django.http import HttpResponseRedirect from django.db.models import ImageField def upload_photo(request): if request.method == 'POST': photo_form = UploadFileForm(request.POST, request.FILES) if photo_form.is_valid(): ...
{ "repo_name": "vollov/ocbl.ca", "path": "django/content/views.py", "copies": "1", "size": "1310", "license": "mit", "hash": -6355740976450247000, "line_mean": 33.5, "line_max": 75, "alpha_frac": 0.6114503817, "autogenerated": false, "ratio": 3.6901408450704225, "config_test": false, "has_no_k...
from django.shortcuts import render from .forms import UserForm from .nodes import UserNode from django.http import HttpResponse,HttpResponseRedirect from django.contrib.auth import authenticate,login,logout from .models import UserProfile # Create your views here. def index(request): context={} if request.user...
{ "repo_name": "programmernoob1/MeeT", "path": "authentication/views.py", "copies": "1", "size": "1857", "license": "apache-2.0", "hash": -9210936924958108000, "line_mean": 35.4117647059, "line_max": 65, "alpha_frac": 0.6828217555, "autogenerated": false, "ratio": 4.3085846867749416, "config_tes...
from django.shortcuts import render from fristapp.models import People, Aritcle from django.http import HttpResponse from django.template import Context, Template # Create your views here. def first_try(request): person = People(name='Spork', job="officer") html_string = ''' <html lang="en"> <head> ...
{ "repo_name": "LTMana/code", "path": "Python/Django/fristsite/fristapp/views.py", "copies": "1", "size": "1123", "license": "mit", "hash": -1432739060636403500, "line_mean": 21.46, "line_max": 104, "alpha_frac": 0.6518254675, "autogenerated": false, "ratio": 3.2932551319648096, "config_test": f...
from django.shortcuts import render from game_info.models import Player def index(request): current_players = get_current_players() return render(request, 'l4d2/l4d2.html', {'current_players' : current_players}) def banner(request): return render(request, 'l4d2/banner.html') def get_current_player...
{ "repo_name": "aldenjenkins/foobargamingwebsite", "path": "l4d2/views.py", "copies": "1", "size": "1384", "license": "bsd-3-clause", "hash": -7762562720216327000, "line_mean": 32.7804878049, "line_max": 116, "alpha_frac": 0.5411849711, "autogenerated": false, "ratio": 3.898591549295775, "config...
from django.shortcuts import render from game.serializers import * from rest_framework import permissions, viewsets from rest_framework.response import Response # Create your views here. class ProblemsViewSet(viewsets.ModelViewSet): queryset = Problem.objects.all() serializer_class = ProblemSerializer # ...
{ "repo_name": "heinzehavinga/bethepresidenttoday", "path": "game/views.py", "copies": "1", "size": "1088", "license": "cc0-1.0", "hash": -5743001244966001000, "line_mean": 35.3, "line_max": 70, "alpha_frac": 0.7224264706, "autogenerated": false, "ratio": 4.283464566929134, "config_test": false,...
from django.shortcuts import render from getpage import * from fbapp.models import Search, Clap from django.http import Http404, HttpResponse import json # Create your views here. def clap(request): if request.is_ajax(): keyword = request.GET['keyword'] clap = Clap.objects.all() if(len(clap) == 0): clap = C...
{ "repo_name": "shashank-sharma/facebook-comments", "path": "fbapp/views.py", "copies": "1", "size": "2637", "license": "mit", "hash": -5740651330158150000, "line_mean": 26.46875, "line_max": 68, "alpha_frac": 0.6253318165, "autogenerated": false, "ratio": 3.4927152317880794, "config_test": fals...
from django.shortcuts import render from gindex.gindex_logic.gindex import GIndexCalculator, RepositoryService from gindex.forms import RepositoryRequestForm # Create your views here. def gindex_for(user, repo): service = RepositoryService() project = service.get_repo(user, repo) gindex_calc = GIndexCalc...
{ "repo_name": "javierj/kobudo-katas", "path": "Kata-RestConsumer/DjangoGIndexDemo/gindex/views.py", "copies": "1", "size": "1208", "license": "apache-2.0", "hash": 4111280796639281700, "line_mean": 38, "line_max": 101, "alpha_frac": 0.607615894, "autogenerated": false, "ratio": 4.298932384341637,...
from django.shortcuts import render from google.appengine.api import users from .models import * from django.http import HttpResponse, HttpResponseRedirect import logging from google.appengine.ext import blobstore def user_email(): return users.get_current_user().email() def index(request): return HttpRespo...
{ "repo_name": "Greennut/ostproject", "path": "blog/admin.py", "copies": "1", "size": "3017", "license": "bsd-3-clause", "hash": 5989644904359707000, "line_mean": 32.5222222222, "line_max": 110, "alpha_frac": 0.6042426251, "autogenerated": false, "ratio": 3.6393244873341377, "config_test": false...
from django.shortcuts import render from google.appengine.ext import ndb from django.http import HttpResponse, HttpResponseRedirect from .models import Post, Tag, Blog import re import logging post_per_page = 10 def index(request): return render_post_list(request, Post.query(), "/") def tag(request, tag): ...
{ "repo_name": "Greennut/ostproject", "path": "blog/views.py", "copies": "1", "size": "2781", "license": "bsd-3-clause", "hash": -2239282787794587100, "line_mean": 30.2471910112, "line_max": 91, "alpha_frac": 0.5426105717, "autogenerated": false, "ratio": 3.6305483028720626, "config_test": false...
from django.shortcuts import render from groove.models import Category, Page #from django.http import HttpResponse from groove.forms import CategoryForm, PageForm def add_category(request): # A HTTP POST? if request.method == 'POST': form = CategoryForm(request.POST) # Have we been provided w...
{ "repo_name": "bobbybabra/codeGuild", "path": "geneGroove_project/groove/views.py", "copies": "1", "size": "5037", "license": "bsd-2-clause", "hash": -3834470308800264000, "line_mean": 36.8721804511, "line_max": 96, "alpha_frac": 0.6561445305, "autogenerated": false, "ratio": 4.201000834028357, ...
from django.shortcuts import render from groupModule.forms import GroupCreateForm from groupModule.forms import GroupSettings from groupModule.forms import Groups from django.db import connection from userModule.security import * from django.http import HttpResponseRedirect from django.forms.util import ErrorList from ...
{ "repo_name": "dipkakwani/wee_app", "path": "src/groupModule/views.py", "copies": "1", "size": "9053", "license": "mit", "hash": -904559678023519500, "line_mean": 46.8994708995, "line_max": 162, "alpha_frac": 0.6503921352, "autogenerated": false, "ratio": 3.9550021843599827, "config_test": fals...
from django.shortcuts import render from haystack.query import SearchQuerySet from reviewInfo.models import product_name, sku_number from haystack.utils import Highlighter from django.utils.html import strip_tags class NoCropHighlighter(Highlighter): def highlight(self, text_block): self.text_block = str...
{ "repo_name": "riffschelder/reviewshub", "path": "reviewsHub/search/views.py", "copies": "1", "size": "1220", "license": "mit", "hash": -2608722567099610600, "line_mean": 31.1315789474, "line_max": 78, "alpha_frac": 0.6737704918, "autogenerated": false, "ratio": 3.588235294117647, "config_test"...
from django.shortcuts import render from home.models import projects # Create your views here. def index(request): obj = projects.objects.all() ret = {} for o in obj: ret[o.id] = o ret['objects'] = obj return render(request, "home/index.html",ret) def project(request, uid = -1): page = ...
{ "repo_name": "torablien/istarrt", "path": "home/views.py", "copies": "2", "size": "1131", "license": "apache-2.0", "hash": -2956968667662397000, "line_mean": 28.0256410256, "line_max": 75, "alpha_frac": 0.6145004421, "autogenerated": false, "ratio": 4.053763440860215, "config_test": false, "...
from django.shortcuts import render from imager_images.models import Photo, Album from imager_images.forms import AddPhotoForm, AddAlbumForm, EditPhotoForm, EditAlbumForm from django.views.generic import TemplateView, CreateView, ListView, UpdateView from django.urls import reverse_lazy from django.contrib.auth.mixins ...
{ "repo_name": "JSchatzman/django-imager", "path": "imagersite/imager_images/views.py", "copies": "1", "size": "5674", "license": "mit", "hash": 8666659432857069000, "line_mean": 31.7976878613, "line_max": 88, "alpha_frac": 0.644871343, "autogenerated": false, "ratio": 3.926643598615917, "config...
from django.shortcuts import render from imager_profile.models import UserForm, ProfileForm def edit_profile(request): """Edit the User and UserProfile objects connected to the user.""" if request.method == 'POST': user_form = UserForm(request.POST, instance=request.user) profile_form = Profil...
{ "repo_name": "jaredscarr/django-imager", "path": "imagersite/imager_profile/views.py", "copies": "1", "size": "1148", "license": "mit", "hash": 487550130291646140, "line_mean": 44.92, "line_max": 80, "alpha_frac": 0.5879790941, "autogenerated": false, "ratio": 4.398467432950191, "config_test":...
from django.shortcuts import render from imp import load_source # Create your views here. from pymongo import MongoClient#mongo db client from django.shortcuts import get_object_or_404, render from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from .models import Tweets,User,City...
{ "repo_name": "saurabhkumar1989/traffic_data_backend", "path": "trafficdata/views.py", "copies": "1", "size": "4073", "license": "apache-2.0", "hash": 1832087183110157300, "line_mean": 36.712962963, "line_max": 116, "alpha_frac": 0.7176528357, "autogenerated": false, "ratio": 3.1500386697602476, ...
from django.shortcuts import render from . import canvas_api def list_dumps(request): dumps = canvas_api.list_dumps() for d in dumps: d['megadump'] = d['numFiles'] == 1 context = {'dumps': dumps} return render(request, 'data_dashboard/dumps.html', context) def dump(request, dump_id): tabl...
{ "repo_name": "penzance/hdt_monitor", "path": "data_dashboard/canvas_views.py", "copies": "1", "size": "2289", "license": "mit", "hash": 3451347290330971600, "line_mean": 34.2153846154, "line_max": 78, "alpha_frac": 0.5928352993, "autogenerated": false, "ratio": 3.639109697933227, "config_test"...
from django.shortcuts import render from . import getlinks from mysite.login.models import Language, Rating from django.contrib.auth.decorators import login_required # Create your views here. @login_required def temple(request): return render(request, 'scrapper/temple.html', {}) @login_required def blog(request)...
{ "repo_name": "shashank-sharma/mythical-learning", "path": "scrapper/views.py", "copies": "1", "size": "1881", "license": "mit", "hash": -4496102566225262000, "line_mean": 27.5, "line_max": 105, "alpha_frac": 0.5497076023, "autogenerated": false, "ratio": 3.5896946564885495, "config_test": fals...
from django.shortcuts import render from . import meal_plan_gen from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from bitcampapp.models import Meal from . import banking # Create your views here. def index(request): contexts = {'curr_budget' : banking.getBa...
{ "repo_name": "jerrrytan/bitcamp", "path": "bitcamp/bitcampapp/views.py", "copies": "1", "size": "1759", "license": "mit", "hash": 3086132953979934000, "line_mean": 29.3275862069, "line_max": 78, "alpha_frac": 0.6714042069, "autogenerated": false, "ratio": 3.4089147286821704, "config_test": fal...
from django.shortcuts import render from . import pipeline_api from django.conf import settings import re STATUS_VALUES = [ 'ProvisioningPhase0', 'Phase0Running', 'CreatingPipeline', 'ProvisioningPipeline', 'PipelineRunning', 'Success', 'Failed' ] PHASE_0_CLOUD_INIT_OUTPUT_GROUP = 'Phase_0-/var/log/cloud-init...
{ "repo_name": "penzance/hdt_monitor", "path": "data_dashboard/pipeline_views.py", "copies": "1", "size": "6605", "license": "mit", "hash": 4105644487334086000, "line_mean": 32.8717948718, "line_max": 127, "alpha_frac": 0.5061317184, "autogenerated": false, "ratio": 3.7742857142857145, "config_t...
from django.shortcuts import render from infoscreen.models import URLSlide, HTMLSlide, Screen from django.core import serializers import json def display_screen(request, screen_id): #slides = Slide.objects.filter(screen=screen_id) url_slides = URLSlide.objects.filter(screen=screen_id).order_by('priority', 'id'...
{ "repo_name": "Socialsquare/Web-Based-Info-Screen", "path": "infoscreen/views.py", "copies": "1", "size": "1255", "license": "mit", "hash": 6249201608460153000, "line_mean": 35.9117647059, "line_max": 132, "alpha_frac": 0.6940239044, "autogenerated": false, "ratio": 3.293963254593176, "config_t...
from django.shortcuts import render #from judge.models import * from django import forms import problem_judge import random # Create your models here. CHOICES=(('select1','select 1'), ('select2','select 2'),) class SubmitForm(forms.Form): LANG_CHOICES = ( ('GCC', 'GCC'), ('G++', 'G++'), ) ...
{ "repo_name": "ISeaTeL/ISeaTeL_Cup_Site", "path": "oj_judge/views.py", "copies": "1", "size": "1668", "license": "mit", "hash": -2175602771549053200, "line_mean": 29.3272727273, "line_max": 107, "alpha_frac": 0.6247002398, "autogenerated": false, "ratio": 3.213872832369942, "config_test": false...
from django.shortcuts import render from kwue.DB_functions.consumption_history_db_functions import * from django.http import HttpResponse import json from django.views.decorators.csrf import csrf_exempt from kwue.DB_functions.food_db_functions import * def get_consumption_page(req): user_id = req.session['user_id...
{ "repo_name": "bounswe/bounswe2016group4", "path": "kwueBackend/kwue/controllers/consumption_history.py", "copies": "1", "size": "6886", "license": "apache-2.0", "hash": 3614696676080676400, "line_mean": 36.4239130435, "line_max": 128, "alpha_frac": 0.6015103108, "autogenerated": false, "ratio": ...
from django.shortcuts import render from kwue.DB_functions.food_db_functions import * from kwue.helper_functions.nutrition_helpers import request_nutrition import json from django.http import HttpResponse from kwue.DB_functions.tag_db_functions import * from django.views.decorators.csrf import csrf_exempt def get_foo...
{ "repo_name": "bounswe/bounswe2016group4", "path": "kwueBackend/kwue/controllers/food.py", "copies": "1", "size": "5649", "license": "apache-2.0", "hash": -9022853059607136000, "line_mean": 33.6564417178, "line_max": 143, "alpha_frac": 0.6176314392, "autogenerated": false, "ratio": 3.126175982291...
from django.shortcuts import render from landing.models import Data from django.db.models import Q from operator import __or__ as OR def dataset_preview(request, id): template = 'pages/data-preview.html' model = Data.objects.get(id=id) context = { 'dataset_id': model } return render(request...
{ "repo_name": "okfnepal/election-nepal", "path": "landing/views.py", "copies": "1", "size": "1315", "license": "mit", "hash": 3644022899990727700, "line_mean": 33.6315789474, "line_max": 84, "alpha_frac": 0.6669201521, "autogenerated": false, "ratio": 3.7464387464387463, "config_test": false, ...
from django.shortcuts import render from light_sensor.models import SensorData from datetime import datetime import urllib2 import json def index(request): query_set = SensorData.objects.all().last() response = urllib2.urlopen('http://184.106.153.149/channels/113321/feeds.json?results=1') data = json.load...
{ "repo_name": "ohmini/thaifoodapi", "path": "light_sensor/views.py", "copies": "1", "size": "1363", "license": "bsd-3-clause", "hash": 8962187910379792000, "line_mean": 34.8684210526, "line_max": 112, "alpha_frac": 0.6368305209, "autogenerated": false, "ratio": 3.2222222222222223, "config_test"...
from django.shortcuts import render from linda_app.models import DatasourceDescription, get_configuration from django.core.context_processors import csrf from django.http import HttpResponse from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt import requests, urllib,re ...
{ "repo_name": "LinDA-tools/LindaWorkbench", "path": "linda/visualisation/views.py", "copies": "1", "size": "2384", "license": "mit", "hash": -6998650048567328000, "line_mean": 35.1363636364, "line_max": 92, "alpha_frac": 0.6229026846, "autogenerated": false, "ratio": 3.5957767722473606, "config...
from django.shortcuts import render from liveview.models import LiveCode from django.http import HttpResponse, Http404 from django.views.decorators.csrf import csrf_exempt import html.parser def home(request): return render(request, 'index.html', {}) def oracle(request): if request.user.is_authenticated() and reque...
{ "repo_name": "kamyarinfinity/livecode", "path": "liveview/views.py", "copies": "1", "size": "1201", "license": "mit", "hash": 4752081955583701000, "line_mean": 25.1086956522, "line_max": 84, "alpha_frac": 0.7144046628, "autogenerated": false, "ratio": 3.0794871794871796, "config_test": false, ...
from django.shortcuts import render from local_core.views import ProtectedListView from django.views.generic.detail import SingleObjectMixin from django.views.generic.edit import CreateView, FormMixin from .models import Period, Job from .forms import PeriodForm import datetime from django.utils import timezone import ...
{ "repo_name": "jkoestinger/TimeCounter", "path": "dashboard/views.py", "copies": "1", "size": "1849", "license": "mit", "hash": 3050013172701736400, "line_mean": 29.3114754098, "line_max": 161, "alpha_frac": 0.6901027582, "autogenerated": false, "ratio": 3.698, "config_test": false, "has_no_k...
from django.shortcuts import render from location_booking.models import Location from datetime import datetime from dateutil.tz import tzlocal def display_location(request, location_id): location = Location.objects.get(pk=location_id) events_today = location.events_today() if len(events_today['allday_events']) > 0:...
{ "repo_name": "Socialsquare/Web-Based-Info-Screen", "path": "location_booking/views.py", "copies": "1", "size": "1295", "license": "mit", "hash": -5308792119314002000, "line_mean": 34.027027027, "line_max": 74, "alpha_frac": 0.6972972973, "autogenerated": false, "ratio": 3.1204819277108435, "co...
from django.shortcuts import render from login.forms import * from django.contrib.auth.decorators import login_required from django.contrib.auth import logout from django.views.decorators.csrf import csrf_protect from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.te...
{ "repo_name": "talhaobject90/framework.com", "path": "login/views.py", "copies": "1", "size": "1283", "license": "mit", "hash": -4566121899983999500, "line_mean": 25.7291666667, "line_max": 61, "alpha_frac": 0.6780982073, "autogenerated": false, "ratio": 4.31986531986532, "config_test": false, ...
from django.shortcuts import render #from madrona.raster_stats.models import RasterDataset, zonal_stats from settings import * from general.utils import default_value, sq_meters_to_sq_miles from scenarios.models import * ''' ''' def display_sdc_analysis(request, sdc, template='scenario/reports/sdc_report.html'): c...
{ "repo_name": "Ecotrust/COMPASS", "path": "mp/scenarios/sdc_analysis.py", "copies": "1", "size": "1609", "license": "apache-2.0", "hash": -8813759061771614000, "line_mean": 42.4864864865, "line_max": 120, "alpha_frac": 0.6861404599, "autogenerated": false, "ratio": 3.2971311475409837, "config_t...
from django.shortcuts import render from mailer.models import Person, MailTemplate from django.http import HttpResponse from django.core.mail import send_mail import csv from google_forms_mailer import settings # Create your views here. def home(request): ''' Home page view ''' template = "index.html" return rend...
{ "repo_name": "DESHRAJ/Google-Forms-Mailer", "path": "mailer/views.py", "copies": "1", "size": "1344", "license": "mit", "hash": -6284677828497300000, "line_mean": 34.3684210526, "line_max": 167, "alpha_frac": 0.6897321429, "autogenerated": false, "ratio": 3.2, "config_test": false, "has_no_k...
from django.shortcuts import render from main.models import * from django.http import Http404 # HttpResponse, HttpResponseRedirect from django.core.exceptions import ObjectDoesNotExist from django.template.loader import render_to_string # from django.core.context_processors import csrf # from django.views.decorators.cs...
{ "repo_name": "zooks/django-test", "path": "main/views.py", "copies": "1", "size": "1610", "license": "mit", "hash": 7543401077143524000, "line_mean": 26.0363636364, "line_max": 87, "alpha_frac": 0.6716016151, "autogenerated": false, "ratio": 3.2025862068965516, "config_test": false, "has_no_...
from django.shortcuts import render from mainsite.serializers import UserSerializer from mainsite.serializers import SessionTypeSerializer from mainsite.serializers import CustomerSerializer from mainsite.serializers import PhoneSerializer from mainsite.serializers import SessionSerializer from mainsite.serializers imp...
{ "repo_name": "srenner/photerva", "path": "mainsite/views.py", "copies": "1", "size": "1628", "license": "apache-2.0", "hash": -2773434553018482000, "line_mean": 34.3913043478, "line_max": 71, "alpha_frac": 0.7997542998, "autogenerated": false, "ratio": 4.306878306878307, "config_test": false, ...
from django.shortcuts import render from management.forms import * from api.models import UserProfile from django.contrib.auth import authenticate, login from django.core.urlresolvers import reverse from django.contrib import messages # Create your views here. def register(request): if request.method == "POST": ...
{ "repo_name": "genevag/InstagramClone", "path": "management/views.py", "copies": "1", "size": "1427", "license": "apache-2.0", "hash": -5782764071440436000, "line_mean": 36.5526315789, "line_max": 100, "alpha_frac": 0.6685353889, "autogenerated": false, "ratio": 4.390769230769231, "config_test"...
from django.shortcuts import render from management.models import Unit from django.http import HttpResponseRedirect # class UnitForm(ModelForm): # class Meta: # model = Unit # fields = ['name'] def management(request): unit = Unit.objects.all() return render(request, 'management/mana...
{ "repo_name": "katchengli/IntlWDHackathon", "path": "management/views.py", "copies": "1", "size": "1068", "license": "mit", "hash": 67887893800249096, "line_mean": 33.4838709677, "line_max": 73, "alpha_frac": 0.6329588015, "autogenerated": false, "ratio": 4.188235294117647, "config_test": false...
from django.shortcuts import render from manage.models import * from home.models import * from django.core.exceptions import ObjectDoesNotExist from django.utils.crypto import get_random_string # Views def index(request): return render(request, 'home/index.html', {}) def demo(request): return render(request, ...
{ "repo_name": "csdevsc/colcat_crowdsourcing_application", "path": "home/views.py", "copies": "2", "size": "1667", "license": "mit", "hash": 1123561198360158100, "line_mean": 38.6904761905, "line_max": 137, "alpha_frac": 0.6334733053, "autogenerated": false, "ratio": 3.42299794661191, "config_te...
from django.shortcuts import render from market.models import Category,Goods,UserProfile,Comment,InstationMessage,User from market.forms import UserForm,UserProfieldForm,GoodsForm,CommentForm from django.contrib.auth import authenticate,login,logout from django.http import HttpResponseRedirect,HttpResponse from django....
{ "repo_name": "starbt/flea_market", "path": "market/views.py", "copies": "1", "size": "7541", "license": "mit", "hash": 6906420256750078000, "line_mean": 33.8564814815, "line_max": 127, "alpha_frac": 0.6423163767, "autogenerated": false, "ratio": 3.8570696721311477, "config_test": false, "has...
from django.shortcuts import render from materials.models import Material from materials.forms import MaterialForm from management.models import Unit from django.http import HttpResponseRedirect # class UnitForm(ModelForm): # class Meta: # model = Unit # fields = ['name'] def index(request): # uni...
{ "repo_name": "katchengli/IntlWDHackathon", "path": "materials/views.py", "copies": "1", "size": "1209", "license": "mit", "hash": -5269402253404282000, "line_mean": 34.5588235294, "line_max": 78, "alpha_frac": 0.6633581472, "autogenerated": false, "ratio": 4.2272727272727275, "config_test": fa...
from django.shortcuts import render from metabotnik.models import Composite, Project from django.http import HttpResponseNotFound import requests import traceback def main(request): return render(request, 'composites.html', {'composites': Composite.objects.filter(user=request.user)}) def view(request, name): ...
{ "repo_name": "epoz/metabotnik", "path": "src/metabotnik/composites.py", "copies": "1", "size": "1058", "license": "mit", "hash": -1163043785245073200, "line_mean": 38.2222222222, "line_max": 106, "alpha_frac": 0.6077504726, "autogenerated": false, "ratio": 3.9477611940298507, "config_test": fa...
from django.shortcuts import render from metaci.api.pagination import RestrictedPagination from metaci.api.serializers.build import BuildSerializer from metaci.api.serializers.build import BuildFlowSerializer from metaci.api.serializers.build import RebuildSerializer from metaci.build.filters import BuildFilter from me...
{ "repo_name": "SalesforceFoundation/mrbelvedereci", "path": "metaci/api/views/build.py", "copies": "1", "size": "1285", "license": "bsd-3-clause", "hash": 3795116853658513000, "line_mean": 28.8837209302, "line_max": 60, "alpha_frac": 0.7813229572, "autogenerated": false, "ratio": 4.21311475409836...
from django.shortcuts import render from metaci.api.serializers.cumulusci import OrgSerializer from metaci.api.serializers.cumulusci import ScratchOrgInstanceSerializer from metaci.api.serializers.cumulusci import ServiceSerializer from metaci.cumulusci.filters import OrgFilter from metaci.cumulusci.filters import Scra...
{ "repo_name": "SalesforceFoundation/mrbelvedereci", "path": "metaci/api/views/cumulusci.py", "copies": "1", "size": "1190", "license": "bsd-3-clause", "hash": 2258321442437314300, "line_mean": 29.5128205128, "line_max": 73, "alpha_frac": 0.7899159664, "autogenerated": false, "ratio": 4.0067340067...
from django.shortcuts import render from metronus_app.forms.contactForm import ContactForm from metronus_app.common_utils import send_mail from metronus.settings import DEFAULT_FROM_EMAIL from django.contrib.auth.forms import PasswordResetForm from django.contrib.auth.tokens import default_token_generator from django.h...
{ "repo_name": "Metronus/metronus", "path": "Metronus-Project/metronus_app/controllers/appController.py", "copies": "1", "size": "4527", "license": "mpl-2.0", "hash": -1766086742104136200, "line_mean": 32.5333333333, "line_max": 95, "alpha_frac": 0.6114424564, "autogenerated": false, "ratio": 4.37...
from django.shortcuts import render from mezzanine.pages.page_processors import processor_for from .models import FlexiPage from .utils import get_flexi_template_location, get_flexi_forms from django.conf import settings try: FLEXI_PREFIX = settings.VARIABLE_PREFIX except AttributeError: VARIABLE_PREFIX = 'fl...
{ "repo_name": "eRestin/MezzGIS", "path": "flexipage/page_processors.py", "copies": "1", "size": "3707", "license": "bsd-2-clause", "hash": -7480908859478777000, "line_mean": 42.6117647059, "line_max": 91, "alpha_frac": 0.6681953062, "autogenerated": false, "ratio": 4.029347826086957, "config_te...
from django.shortcuts import render from .models import Adress, Publication, Ruta, SignUp from django.contrib.gis.geos import Point, LineString #para obtener las coordenadas from .forms import SignUpForm, RutaForm # Create your views here. def homepage(request): return render(request, "homepage.html") def content...
{ "repo_name": "Topo1993/mapdex", "path": "home/views.py", "copies": "1", "size": "3597", "license": "mit", "hash": 2729405011080178000, "line_mean": 26.4580152672, "line_max": 83, "alpha_frac": 0.676675007, "autogenerated": false, "ratio": 2.777606177606178, "config_test": false, "has_no_keyw...
from django.shortcuts import render from .models import Album, Photos def library_view(request): albums = Album.objects.filter(published='public').all() return render(request, 'library.html', context={'albums': albums}) def album_view(request, album_id=0): try: album = Album.objects.get(id=album...
{ "repo_name": "HeyIamJames/django-imager", "path": "imagersite/photo/views.py", "copies": "1", "size": "1028", "license": "mit", "hash": 6683818771647781000, "line_mean": 35.7142857143, "line_max": 78, "alpha_frac": 0.640077821, "autogenerated": false, "ratio": 3.6714285714285713, "config_test"...
from django.shortcuts import render from .models import App from user.models import User import time from django.http import HttpResponseRedirect from django.template import Context from threading import Thread from calculation.models import Weather from calculation.models import Calculation from django.utils import ti...
{ "repo_name": "CriminalProject/Project2", "path": "app/views.py", "copies": "1", "size": "4569", "license": "unlicense", "hash": 4005643713207746600, "line_mean": 36.1544715447, "line_max": 225, "alpha_frac": 0.6565988181, "autogenerated": false, "ratio": 4.050531914893617, "config_test": false...
from django.shortcuts import render from .models import Article, Category, BlogComment, Tag, Suggest from .forms import BlogCommentForm, SuggestForm from django.shortcuts import get_object_or_404, redirect, get_list_or_404 from django.views.generic.list import ListView from django.views.generic.detail import DetailView...
{ "repo_name": "tomming233/blog", "path": "app/views.py", "copies": "1", "size": "6636", "license": "mit", "hash": -8719870121326588000, "line_mean": 32.9251336898, "line_max": 109, "alpha_frac": 0.6084489281, "autogenerated": false, "ratio": 3.3798614810868406, "config_test": false, "has_no_k...
from django.shortcuts import render from .models import Article, Feed from .forms import FeedForm from django.shortcuts import redirect from django.contrib.auth.decorators import login_required import feedparser import datetime # Create your views here. def articles_list(request): articles = Article.objects.all()...
{ "repo_name": "khansrk/newsappsrk", "path": "newsapp/views.py", "copies": "1", "size": "1733", "license": "mit", "hash": -4576762118753813500, "line_mean": 31.0925925926, "line_max": 73, "alpha_frac": 0.590305828, "autogenerated": false, "ratio": 4.175903614457831, "config_test": false, "has_...
from django.shortcuts import render from .models import Article def special_case_2016(request): item = {'title':'Special Case 2016','topics':10} return render(request, "blog/special_case_2016.html", {'item':item}) def year_archive(request,yy): item = {'title':'Year Archive','content':yy} retur...
{ "repo_name": "janusnic/dj-21v", "path": "unit_04/mysite/blog/views.py", "copies": "1", "size": "1547", "license": "mit", "hash": 1106943980245187200, "line_mean": 34.976744186, "line_max": 72, "alpha_frac": 0.6709760827, "autogenerated": false, "ratio": 3.453125, "config_test": false, "has_n...
from django.shortcuts import render from .models import Associate def register(request): if request.method == 'POST': full_name = request.POST.get('full_name') email_address = request.POST.get('email_address') mobile_number = request.POST.get('mobile_number') registration_number = ...
{ "repo_name": "tumcu/associates", "path": "main/views.py", "copies": "1", "size": "1118", "license": "mit", "hash": -1125072538875537000, "line_mean": 43.72, "line_max": 112, "alpha_frac": 0.6359570662, "autogenerated": false, "ratio": 4.156133828996283, "config_test": false, "has_no_keywords...
from django.shortcuts import render from .models import Blog from django.conf import settings from django.views.generic import View # Create your views here. def getBlogList(page=None): Blogs = Blog.objects.filter(status='p', isShown=True).order_by("-createTime")[settings.SINGLE_PAGE_LIMIT*page: settings.SINGLE_P...
{ "repo_name": "wenxuan-xia/niv_blog", "path": "core/blog/views.py", "copies": "1", "size": "1179", "license": "mit", "hash": 1041719429520913300, "line_mean": 39.6551724138, "line_max": 151, "alpha_frac": 0.6878710772, "autogenerated": false, "ratio": 3.4473684210526314, "config_test": false, ...
from django.shortcuts import render from .models import Book, Author, BookInstance, Genre from django.views import generic from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.decorators import permission_requir...
{ "repo_name": "shaishap21/locallibary-MySql-production", "path": "catalog/views.py", "copies": "1", "size": "4654", "license": "unlicense", "hash": 8077197468737597000, "line_mean": 39.4782608696, "line_max": 155, "alpha_frac": 0.7026214009, "autogenerated": false, "ratio": 3.9274261603375527, ...
from django.shortcuts import render from .models import Book, Author, BookInstance, Genre from django.views import generic from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.auth.decorators import permission_required from django.s...
{ "repo_name": "KimMichaelJones/mdn_tutorial", "path": "catalog/views.py", "copies": "1", "size": "5976", "license": "mpl-2.0", "hash": 3143599196789872600, "line_mean": 33.9473684211, "line_max": 117, "alpha_frac": 0.6962851406, "autogenerated": false, "ratio": 3.8931596091205214, "config_test"...
from django.shortcuts import render from .models import Book, Author, BookInstance, Genre from django.views import generic from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.shortcuts import get_object_or_404 from django.http import HttpResponseRedirect from django.core.urlre...
{ "repo_name": "JayTechX/Local-Library", "path": "catalog/views.py", "copies": "1", "size": "7150", "license": "mit", "hash": -2066655973235891000, "line_mean": 31.9493087558, "line_max": 117, "alpha_frac": 0.6932867133, "autogenerated": false, "ratio": 3.763157894736842, "config_test": false, ...
from django.shortcuts import render from .models import Book, Author, BookInstance, Genre def index(request): """ View function for home page of site. """ # Generate counts of some of the main objects num_books=Book.objects.all().count() num_instances=BookInstance.objects.all().count() # Av...
{ "repo_name": "byronlin92/django_local_library", "path": "catalog/views.py", "copies": "1", "size": "5431", "license": "apache-2.0", "hash": 5559192884050991000, "line_mean": 31.9151515152, "line_max": 145, "alpha_frac": 0.7098140306, "autogenerated": false, "ratio": 3.779401530967293, "config_...
from django.shortcuts import render from .models import Book, Author, BookInstance, Genre def index(request): """ View function for home page of site """ # Generate counts of some of the main objects num_books = Book.objects.all().count() num_instances = BookInstance.objects.all().count() ...
{ "repo_name": "CaptainNoble/django_local_library", "path": "catalog/views.py", "copies": "1", "size": "5198", "license": "mit", "hash": 7475320742381029000, "line_mean": 32.7532467532, "line_max": 117, "alpha_frac": 0.6902654867, "autogenerated": false, "ratio": 3.85037037037037, "config_test":...
from django.shortcuts import render from .models import Book, Author, Genre, BookInstance from django.views import generic from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin # Create your views here. def index(request): num_books = Book.objects.all(...
{ "repo_name": "Konosh93/locallibrary", "path": "catalog/views.py", "copies": "1", "size": "3752", "license": "mit", "hash": 5801719947895859, "line_mean": 33.1090909091, "line_max": 158, "alpha_frac": 0.7723880597, "autogenerated": false, "ratio": 3.377137713771377, "config_test": false, "has...
from django.shortcuts import render from .models import Brand, Product from reviewapp.views import make_page_range from reviewapp.models import Review from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def brand_list(request): brand_list = Brand.objects.order_by('name') paginate = Paginator(b...
{ "repo_name": "bestgunman/Gitwaxingproduct", "path": "Projectreview/productapp/views.py", "copies": "1", "size": "2946", "license": "mit", "hash": -617309503676410900, "line_mean": 22.184, "line_max": 72, "alpha_frac": 0.7122153209, "autogenerated": false, "ratio": 2.746919431279621, "config_te...
from django.shortcuts import render from .models import Car, CarAddedInfo, Profile, Technician, FutureRepair, PhoneTimings, EmailTimings, Notifications, \ Repair, TechAddedInfo, Phone, Email, ProfileAddedInfo from django.contrib.auth.decorators import permission_required from django.http import HttpResponseNotFoun...
{ "repo_name": "itorres1994/Team-Noatpad", "path": "Noatpad/track_n_drive/views.py", "copies": "1", "size": "31921", "license": "mit", "hash": 8635398565710325000, "line_mean": 40.5097529259, "line_max": 132, "alpha_frac": 0.5610413208, "autogenerated": false, "ratio": 3.8767306290988586, "confi...
from django.shortcuts import render from .models import Card from .models import Deck from django.contrib.auth.models import User from .forms import CreateUserForm from django.http import HttpResponse from django.contrib.auth import authenticate, login from django.views.decorators.csrf import csrf_exempt from .forms im...
{ "repo_name": "introbig/srs", "path": "cards/views.py", "copies": "1", "size": "5466", "license": "mit", "hash": -669367734952359400, "line_mean": 42.380952381, "line_max": 156, "alpha_frac": 0.6655689718, "autogenerated": false, "ratio": 3.345165238678091, "config_test": false, "has_no_keywo...
from django.shortcuts import render from .models import Contest, Score from django.http import Http404 from problems.models import Problem from datetime import datetime from django.template.context_processors import csrf from django.contrib.auth.models import User from django.utils import timezone from core.models impo...
{ "repo_name": "cs251-eclipse/EclipseOJ", "path": "EclipseOJ/contests/views.py", "copies": "1", "size": "6017", "license": "mit", "hash": -2560114290949754400, "line_mean": 44.2406015038, "line_max": 281, "alpha_frac": 0.68622237, "autogenerated": false, "ratio": 3.7653316645807258, "config_test...
from django.shortcuts import render from models import DataCollector # Create your views here. def mainView(request): return render(request, "mainView.html") def submit(request): dataCollector = DataCollector() if request.method == "POST": dataCollector.Gender = request.POST.get('gender', '') ...
{ "repo_name": "wenxuan-xia/IE533_App", "path": "IE533/DataCollectApp/views.py", "copies": "1", "size": "1184", "license": "mit", "hash": 6844763380788680000, "line_mean": 39.8275862069, "line_max": 77, "alpha_frac": 0.660472973, "autogenerated": false, "ratio": 3.7115987460815045, "config_test"...
from django.shortcuts import render from .models import Document, Corpus from django.http import JsonResponse from django.conf import settings import json import os import re import nltk from nltk.corpus import * from nltk.collocations import * import string import logging logger = logging.getLogger('nltksite.nltkapp'...
{ "repo_name": "wtamu-cisresearch/nltksite", "path": "nltkapp/views.py", "copies": "1", "size": "8449", "license": "mit", "hash": -4314618179406118000, "line_mean": 32.137254902, "line_max": 145, "alpha_frac": 0.7009113505, "autogenerated": false, "ratio": 2.985512367491166, "config_test": false...
from django.shortcuts import render from .models import Event from rest_framework import viewsets from .serializer import EventSerializer from .serializer import EventDetailSerializer from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_fram...
{ "repo_name": "josip-milic/asc_qwerty_test", "path": "rest-framework-tutorial/services/views.py", "copies": "1", "size": "2186", "license": "apache-2.0", "hash": 3551065008512983000, "line_mean": 31.1617647059, "line_max": 78, "alpha_frac": 0.6733760293, "autogenerated": false, "ratio": 4.1167608...
from django.shortcuts import render from .models import Events # Create your views here. def get_events(request): all_events = Events.objects.all() events_by_type = Events.objects.only('event_type') # if filters applied then get parameter and filter # filter base on condition. Else return object if...
{ "repo_name": "stuttup/planning", "path": "src/rooms/views.py", "copies": "1", "size": "1204", "license": "mit", "hash": -6168332377730242000, "line_mean": 35.4848484848, "line_max": 94, "alpha_frac": 0.6013289037, "autogenerated": false, "ratio": 3.750778816199377, "config_test": false, "has...
from django.shortcuts import render from .models import Flight from .models import Passenger from .models import StartLane from .models import StartLaneScheduleField from .helpers import validate_password from .helpers import validate_user from .helpers import string_to_int_list from .helpers import update_personal_dat...
{ "repo_name": "edek437/Zastosowanie-informatyki-w-gospodarce-projekt", "path": "lotnisko/views.py", "copies": "1", "size": "17314", "license": "mit", "hash": 6800296734156526000, "line_mean": 35.6046511628, "line_max": 154, "alpha_frac": 0.6148781333, "autogenerated": false, "ratio": 3.4935431799...
from django.shortcuts import render from .models import Game, Scene, Path def index(request): boxes = Game.objects.all() return render(request, 'engine1/index.html', {'game_list' : boxes}) def game(request, game_name): if request.method == 'POST': current_room = request.POST.get('scene_n...
{ "repo_name": "geezhawk/django-adventure", "path": "engine1/views.py", "copies": "1", "size": "1309", "license": "mit", "hash": 2932769546974371300, "line_mean": 36.4, "line_max": 77, "alpha_frac": 0.5653170359, "autogenerated": false, "ratio": 3.9191616766467066, "config_test": false, "has_n...
from django.shortcuts import render from .models import Images, Document from .forms import DocumentForm import os, uuid from CompressorFactory.FileProcessor import FileProcessor from CompressorFactory.ImageCompressor import ImageCompressor BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) valid_t...
{ "repo_name": "calmhandtitan/Smush-It", "path": "smush/views.py", "copies": "1", "size": "2006", "license": "mit", "hash": 6159066416291488000, "line_mean": 31.3548387097, "line_max": 102, "alpha_frac": 0.7178464606, "autogenerated": false, "ratio": 3.2885245901639344, "config_test": false, "...
from django.shortcuts import render from models import Item, Bid from django.contrib.auth import authenticate, login, logout from django.shortcuts import redirect from django.shortcuts import render_to_response from django.template.context_processors import csrf from django.template import Template, RequestContext from...
{ "repo_name": "jatchili/everything-must-go", "path": "main/views.py", "copies": "1", "size": "5312", "license": "mit", "hash": -6471244609056918000, "line_mean": 31.5889570552, "line_max": 177, "alpha_frac": 0.7006777108, "autogenerated": false, "ratio": 3.058146229130685, "config_test": false,...
from django.shortcuts import render from .models import Link from django.http import HttpResponseRedirect from django.utils.crypto import get_random_string from django.shortcuts import get_object_or_404 from hitcount.models import HitCount from hitcount.views import HitCountMixin """ ori0n.xyz URL Shortener This file ...
{ "repo_name": "enisbt/urlkisalt", "path": "kisa/views.py", "copies": "1", "size": "2195", "license": "mit", "hash": 7210497626362363000, "line_mean": 29.4861111111, "line_max": 79, "alpha_frac": 0.6742596811, "autogenerated": false, "ratio": 3.8849557522123894, "config_test": false, "has_no_k...
from django.shortcuts import render from .models import Medicamento, Insumo, Laboratorio from django.core.urlresolvers import reverse_lazy from django.views.generic import ListView, CreateView, UpdateView, DeleteView from .forms import MedicamentoForm, InsumoForm, LaboratorioForm from django.db.models import Q import ...
{ "repo_name": "andresmauro17/mediapp", "path": "src/apps/medicamento/views.py", "copies": "1", "size": "5059", "license": "mit", "hash": -2591647018390030300, "line_mean": 31.8571428571, "line_max": 77, "alpha_frac": 0.7497529156, "autogenerated": false, "ratio": 2.793484262838211, "config_test...
from django.shortcuts import render from .models import Message from .forms import DeleteForm, searchSenderForm, searchTitleForm, MessageForm, decryptForm from django.shortcuts import render_to_response, render from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from dj...
{ "repo_name": "vsc-squared/FileShareHeroku", "path": "message/views.py", "copies": "1", "size": "7622", "license": "mit", "hash": 3329333597672212500, "line_mean": 37.11, "line_max": 145, "alpha_frac": 0.6494358436, "autogenerated": false, "ratio": 3.9864016736401675, "config_test": false, "h...