text
stringlengths
0
1.05M
meta
dict
from django.shortcuts import render # Create your views here. # HTML views def index(request): return render(request, 'landing/index.html') def index_index(request): return render(request, 'coffice/index.html', {'title': 'index'}) def submit(request): return render(request, 'static_page/submit.html',...
{ "repo_name": "lsdlab/awesome_coffice", "path": "dangann/views.py", "copies": "1", "size": "1140", "license": "mit", "hash": 73575229560776940, "line_mean": 23.2553191489, "line_max": 88, "alpha_frac": 0.6263157895, "autogenerated": false, "ratio": 3.5849056603773586, "config_test": false, "h...
# from django.shortcuts import render # Create your views here. import os from django.conf import settings from django.shortcuts import get_object_or_404 from django.http import HttpResponse from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt from pycsw import server...
{ "repo_name": "cga-harvard/HHypermap", "path": "hypermap/search/views.py", "copies": "2", "size": "3031", "license": "mit", "hash": -6678670052800908000, "line_mean": 33.8390804598, "line_max": 102, "alpha_frac": 0.6756845925, "autogenerated": false, "ratio": 3.7235872235872236, "config_test": ...
from django.shortcuts import render # Create your views here. ''' from django.http import HttpResponse def index(req): return HttpResponse('<h1>hello world</h1>') ''' from django.shortcuts import render_to_response from subprocess import * from django.http import HttpResponse class App(object): def __init__(self)...
{ "repo_name": "vv1133/home_web", "path": "myweb/myapp/views.py", "copies": "1", "size": "3044", "license": "bsd-3-clause", "hash": 2363406744550288400, "line_mean": 23.1587301587, "line_max": 83, "alpha_frac": 0.6281208936, "autogenerated": false, "ratio": 2.6196213425129087, "config_test": fal...
#from django.shortcuts import render # Create your views here. #python imports import json # django imports from django.contrib.auth import authenticate, login, logout #from django.contrib.auth.views import authenticate, login, logout from django.shortcuts import render_to_response, RequestContext, HttpResponse, red...
{ "repo_name": "Bergurth/new-openid-server", "path": "openid_1_8/users/views.py", "copies": "1", "size": "4084", "license": "apache-2.0", "hash": 4789087965147650000, "line_mean": 38.2692307692, "line_max": 109, "alpha_frac": 0.5621939275, "autogenerated": false, "ratio": 4.7050691244239635, "co...
from django.shortcuts import render # Create your views here. #{ # "token":"", # "content":"record", # "formId":"build_BeMe-Observations_1466792215", # "formVersion":"", # "data":[ # {"*meta-instance-id*":"uuid:60754793-2619-4bba-8a33-49e66684a050", # "*meta-model-version*":null, # "*meta-ui-version*":null,...
{ "repo_name": "pankajlal/prabandh", "path": "books/views.py", "copies": "1", "size": "2305", "license": "apache-2.0", "hash": -597155229726508200, "line_mean": 31.0138888889, "line_max": 234, "alpha_frac": 0.5930585683, "autogenerated": false, "ratio": 3.0449141347424042, "config_test": false, ...
from django.shortcuts import render # Create your views here. ### Source material taken from: ### https://mayukhsaha.wordpress.com/2013/05/09/simple-login-and-user-registration-application-using-django/ ### March 2, 2015 ### No explicit license from login.forms import * from django.contrib.auth.decorators import log...
{ "repo_name": "CMPUT410W15/cmput410-project", "path": "login/views.py", "copies": "1", "size": "23407", "license": "apache-2.0", "hash": -8832679994472363000, "line_mean": 37.1221498371, "line_max": 146, "alpha_frac": 0.610971077, "autogenerated": false, "ratio": 4.082853654282226, "config_test...
from django.shortcuts import render # Create your views here. #the_weather/weather/views.py from django.shortcuts import render import requests from .models import City from .forms import CityForm def index(request): url = 'http://api.openweathermap.org/data/2.5/weather?q={}&units=metric&appid=42d08501f123860143...
{ "repo_name": "vdemir/vdemir.github.io", "path": "assets/the_weather/weather/views.py", "copies": "1", "size": "1300", "license": "mit", "hash": 2982828965153956400, "line_mean": 35.1388888889, "line_max": 124, "alpha_frac": 0.6684615385, "autogenerated": false, "ratio": 3.8461538461538463, "co...
from django.shortcuts import render def add_id(things): for i, thing in enumerate(things): thing['id'] = i + 1 return things def drinks(*names): return add_id([{'name': name} for name in names]) def user(first, last, nick=None): return { 'first_name': first, 'last_name': last,...
{ "repo_name": "teknologkoren/Strequelistan", "path": "strecklista/components.py", "copies": "1", "size": "1649", "license": "mpl-2.0", "hash": -8679425035975226000, "line_mean": 24.71875, "line_max": 79, "alpha_frac": 0.45018226, "autogenerated": false, "ratio": 3.2085769980506824, "config_test...
from django.shortcuts import render def graphs_display_summation(request,input_dict,output_dict,widget): if sum(input_dict['intList']) == input_dict['sum']: check = 'The calculation appears correct.' else: check = 'The calculation appears incorrect!' return render(request, 'visualizations/g...
{ "repo_name": "xflows/textflows", "path": "workflows/graphs/visualization_views.py", "copies": "4", "size": "2051", "license": "mit", "hash": 6492836846941862000, "line_mean": 31.046875, "line_max": 157, "alpha_frac": 0.5041443198, "autogenerated": false, "ratio": 3.9366602687140113, "config_te...
from django.shortcuts import render def index(request): return render(request, 'index.html') def demo(request): return render(request, 'demo.html') def result(request): import reactionroute import logging import os import re def parseActiveList(activeList): result = [] if...
{ "repo_name": "sxhexe/reaction-route-search", "path": "reactionroute_web/reaction/search/views.py", "copies": "1", "size": "3325", "license": "mit", "hash": 3622006977015587000, "line_mean": 36.7840909091, "line_max": 163, "alpha_frac": 0.6457142857, "autogenerated": false, "ratio": 3.66189427312...
from django.shortcuts import render # def init(request, api_url, api_settings, viewer_id, group_id, is_app_user): # return render(request, 'vk/index.html', context) # api_url=https://api.vk.com/api.php # &api_settings=0 # &viewer_id=123456 # &group_id=654321 # &is_app_user=0 \\ from django.views.decorators.clickj...
{ "repo_name": "ParuninPavel/lenta4_hack", "path": "vkapp/vk/views.py", "copies": "1", "size": "1772", "license": "mit", "hash": 6589896938603525000, "line_mean": 31.8333333333, "line_max": 96, "alpha_frac": 0.7065462754, "autogenerated": false, "ratio": 3.076388888888889, "config_test": false, ...
from django.shortcuts import render # def scikit_display_summation(request,input_dict,output_dict,widget): # if sum(input_dict['intList']) == input_dict['sum']: # check = 'The calculation appears correct.' # else: # check = 'The calculation appears incorrect!' # return render(request, 'visu...
{ "repo_name": "xflows/textflows", "path": "workflows/scikit/visualization_views.py", "copies": "1", "size": "2688", "license": "mit", "hash": 5027430794016515000, "line_mean": 42.3548387097, "line_max": 159, "alpha_frac": 0.646577381, "autogenerated": false, "ratio": 3.463917525773196, "config_...
from django.shortcuts import render from airmozilla.base.utils import paginate from airmozilla.uploads.models import Upload from .decorators import superuser_required @superuser_required def uploads(request): records = ( Upload.objects .select_related('event') .order_by('-created') )...
{ "repo_name": "a-buck/airmozilla", "path": "airmozilla/manage/views/uploads.py", "copies": "1", "size": "2282", "license": "bsd-3-clause", "hash": 9032256981060646000, "line_mean": 30.2602739726, "line_max": 73, "alpha_frac": 0.5661700263, "autogenerated": false, "ratio": 3.2140845070422537, "c...
from django.shortcuts import render from .apiai import call_api from .apiresponse import ApiResponse from .lastfm import call_last_fm def index(request): return render(request, 'music/index.html') def suggest(request): ai_response = call_api(request.INPUT_JSON['data']) if not ai_response: retur...
{ "repo_name": "tiholic/Musci", "path": "music/music/views.py", "copies": "1", "size": "1350", "license": "apache-2.0", "hash": -6112969265102034000, "line_mean": 26.5510204082, "line_max": 82, "alpha_frac": 0.6044444444, "autogenerated": false, "ratio": 3.638814016172507, "config_test": false, ...
from django.shortcuts import render from approver.constants import SESSION_VARS, SHIB_ENABLED from approver.models import AccessLog from approver import utils from approver import constants from approver.views import unsupported_browser def blacklist_user_agent(get_response): """ This is a decorator that will...
{ "repo_name": "PFWhite/qipr_approver", "path": "qipr_approver/approver/middleware/blacklist_user_agent.py", "copies": "3", "size": "1308", "license": "apache-2.0", "hash": 9116906953088371000, "line_mean": 27.4347826087, "line_max": 82, "alpha_frac": 0.6712538226, "autogenerated": false, "ratio":...
from django.shortcuts import render from basicviz.models import Experiment, MultiFileExperiment, SystemOptions from options.constants import AVAILABLE_OPTIONS from options.forms import SystemOptionsForm def get_option(key, experiment=None): # Retrieves an option, looking for an experiment specific one if it exis...
{ "repo_name": "sdrogers/ms2ldaviz", "path": "ms2ldaviz/options/views.py", "copies": "1", "size": "6660", "license": "mit", "hash": -3065565619310855000, "line_mean": 36.8409090909, "line_max": 99, "alpha_frac": 0.6717717718, "autogenerated": false, "ratio": 3.906158357771261, "config_test": fal...
from django.shortcuts import render from boto1.models import Image, Hit, Result from boto1.forms import FormAMT from django.views.generic.detail import DetailView from django.views.decorators.csrf import csrf_exempt from django.views.decorators.clickjacking import xframe_options_exempt from django.utils.decorators im...
{ "repo_name": "raffienficiaud/django_mturk_minimalistic", "path": "boto1/views.py", "copies": "1", "size": "1515", "license": "mit", "hash": -4089278447852220000, "line_mean": 31.9347826087, "line_max": 99, "alpha_frac": 0.699009901, "autogenerated": false, "ratio": 3.7223587223587224, "config_...
from django.shortcuts import render from cacheback.decorators import cacheback from common.utils import dump_queryset_to_static_csv from shapes.models import MaterialShape from normals.models import ShapeRectifiedNormalLabel from bsdfs.models import ShapeBsdfLabel_wd @cacheback(3600) def material_shape_csv_url(): ...
{ "repo_name": "seanbell/opensurfaces", "path": "server/analytics/views.py", "copies": "1", "size": "2077", "license": "mit", "hash": 8630832475000765000, "line_mean": 27.4520547945, "line_max": 64, "alpha_frac": 0.6509388541, "autogenerated": false, "ratio": 3.6059027777777777, "config_test": f...
from django.shortcuts import render from cacheback.jobs import QuerySetFilterJob from cacheback.jobs import FunctionJob from cacheback.decorators import cacheback from dummyapp import jobs from dummyapp import models def fetch(): return models.DummyModel.objects.filter(name__contains='1') def fetch_with_arg(q...
{ "repo_name": "codeinthehole/django-cacheback", "path": "sandbox/dummyapp/views.py", "copies": "1", "size": "1197", "license": "mit", "hash": 3774503326761636000, "line_mean": 26.8372093023, "line_max": 72, "alpha_frac": 0.6474519632, "autogenerated": false, "ratio": 3.6717791411042944, "config...
from django.shortcuts import render from cacheback.queryset import QuerySetFilterJob from cacheback.function import FunctionJob from cacheback.decorators import cacheback from dummyapp import jobs from dummyapp import models def fetch(): return models.DummyModel.objects.filter(name__contains='1') def fetch_wi...
{ "repo_name": "safarijv/django-cacheback", "path": "sandbox/dummyapp/views.py", "copies": "7", "size": "1205", "license": "mit", "hash": 2841984092895676000, "line_mean": 27.023255814, "line_max": 72, "alpha_frac": 0.6497925311, "autogenerated": false, "ratio": 3.696319018404908, "config_test":...
from django.shortcuts import render from cardano.base.models import Mozillian, Country def index(request): try: mozillians = Mozillian.objects.latest() except Mozillian.DoesNotExist: return render(request, 'home.html') countries = Country.objects.order_by('name', '-created').distinct('nam...
{ "repo_name": "mozilla/cardano", "path": "cardano/base/views.py", "copies": "1", "size": "1918", "license": "mpl-2.0", "hash": -6341117020751283000, "line_mean": 38.1428571429, "line_max": 77, "alpha_frac": 0.5703858186, "autogenerated": false, "ratio": 4.029411764705882, "config_test": false, ...
from django.shortcuts import render from cognitive.apps.atlas.query import Concept, Task, Disorder, Theory, Battery from cognitive.settings import DOMAIN Concept = Concept() Task = Task() Disorder = Disorder() Theory = Theory() Battery = Battery() def base(request): # We only need id and name for the home page...
{ "repo_name": "poldracklab/cogat", "path": "cognitive/apps/main/views.py", "copies": "1", "size": "1269", "license": "mit", "hash": -1962405087920466700, "line_mean": 26, "line_max": 79, "alpha_frac": 0.6532702916, "autogenerated": false, "ratio": 3.515235457063712, "config_test": false, "has...
from django.shortcuts import render from common.models import Injection, CRI from calc.forms import CalcInjForm, CRISimpleForm, CRIAdvancedForm, CRIInsulinForm, CRICPRForm, CRIMetoclopramideForm from collections import OrderedDict def calc_injection(request): """Calculates injection dosages based on weight. ...
{ "repo_name": "onnudilol/vetcalc", "path": "calc/views.py", "copies": "1", "size": "8644", "license": "mit", "hash": -8529278159513784000, "line_mean": 33.8548387097, "line_max": 126, "alpha_frac": 0.5230217492, "autogenerated": false, "ratio": 3.8417777777777777, "config_test": false, "has_n...
from django.shortcuts import render from common.models import Injection, CRI, Prescription def info(request): """Displays all medications in the db.""" inj = Injection.objects.all() cri = CRI.objects.all() pre = Prescription.objects.all() return render(request, 'info/info.html', {'navbar': 'info...
{ "repo_name": "onnudilol/vetcalc", "path": "info/views.py", "copies": "1", "size": "1168", "license": "mit", "hash": 8794269692952005000, "line_mean": 32.3714285714, "line_max": 95, "alpha_frac": 0.5136986301, "autogenerated": false, "ratio": 3.986348122866894, "config_test": false, "has_no_k...
from django.shortcuts import render from config import ALLOW_CHILD_REGISTRATION, ALLOW_PARENT_REGISTRATION from portal.forms import SignUpForm, PreferenceForm, PartnerForm from portal.models import Student from portal.utils import get_invalid_id_popup, get_student_does_not_exist_popup, get_on_save_wait_popup def ind...
{ "repo_name": "martinzlocha/mad", "path": "portal/views.py", "copies": "1", "size": "2787", "license": "mit", "hash": 5759729296374202000, "line_mean": 39.9852941176, "line_max": 142, "alpha_frac": 0.6465733764, "autogenerated": false, "ratio": 4.203619909502263, "config_test": false, "has_no...
from django.shortcuts import render from core.utils import get_context from public_interface.models import Genes from stats.models import VouchersPerGene def index(request): context = get_context(request) voucher_count = get_voucher_count() queryset = Genes.objects.all().values() result = [] for...
{ "repo_name": "carlosp420/VoSeq", "path": "voseq/view_genes/views.py", "copies": "1", "size": "1511", "license": "bsd-3-clause", "hash": -5250173393956513000, "line_mean": 26.4727272727, "line_max": 81, "alpha_frac": 0.5837193911, "autogenerated": false, "ratio": 3.67639902676399, "config_test"...
from django.shortcuts import render from costs.models import render_rate from costs.utils import get_resource_rate, get_rate_hook from extensions.views import tab_extension, TabExtensionDelegate from infrastructure.models import Server from utilities.logger import ThreadLogger logger = ThreadLogger(__name__) class ...
{ "repo_name": "CloudBoltSoftware/cloudbolt-forge", "path": "ui_extensions/server_cost_details/views.py", "copies": "1", "size": "6688", "license": "apache-2.0", "hash": -3490470344290559000, "line_mean": 28.8571428571, "line_max": 82, "alpha_frac": 0.5366327751, "autogenerated": false, "ratio": 3...
from django.shortcuts import render 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 # Create your views here. def mana...
{ "repo_name": "shayan72/Courseware", "path": "course_admin/views.py", "copies": "1", "size": "3627", "license": "mit", "hash": 8475711656316717000, "line_mean": 39.3111111111, "line_max": 117, "alpha_frac": 0.741384064, "autogenerated": false, "ratio": 3.494219653179191, "config_test": false, ...
from django.shortcuts import render from cv.models import Section def index(request): context = {} sections = Section.objects.all() context['sects'] = sections return render(request, 'cv_2014_2.html', context) try: # py2 import cStringIO as StringIO except: # py3k from io import StringI...
{ "repo_name": "gmorell/gabe-cv", "path": "cv/views.py", "copies": "1", "size": "3565", "license": "mit", "hash": -2309627440519281000, "line_mean": 32.0185185185, "line_max": 84, "alpha_frac": 0.6695652174, "autogenerated": false, "ratio": 3.7885228480340065, "config_test": false, "has_no_key...
from django.shortcuts import render from demo.forms.visadirect.fundstransfer import (PullFundsFormGet, PullFundsFormPost, PushFundsFormGet, PushFundsFormPost, ReverseFundsFormGet, ReverseFundsFormPost) from pyvdp.visadirect import CardAcceptorModel, OriginalDataElement...
{ "repo_name": "ppokrovsky/pyvdp", "path": "demo/demo/views/visadirect/fundstransfer.py", "copies": "1", "size": "9808", "license": "mit", "hash": 6614047028632229000, "line_mean": 38.8699186992, "line_max": 110, "alpha_frac": 0.5080546493, "autogenerated": false, "ratio": 4.492899679340358, "co...
from django.shortcuts import render from demo.forms.visadirect.mvisa import (CashinPushPaymentsFormPost, CashinPushPaymentsFormGet, CashoutPushPaymentsFormPost, CashoutPushPaymentsFormGet, MerchantPushPaymentsFormPost, MerchantPushPaymen...
{ "repo_name": "ppokrovsky/pyvdp", "path": "demo/demo/views/visadirect/mvisa.py", "copies": "1", "size": "7627", "license": "mit", "hash": 4212570057154684400, "line_mean": 40.4565217391, "line_max": 99, "alpha_frac": 0.5261570736, "autogenerated": false, "ratio": 4.385853939045428, "config_test...
from django.shortcuts import render from django.conf import settings from django.http import Http404 from django.db.models import Q, F, Sum, Avg from django.shortcuts import get_object_or_404 from django.contrib.auth.models import Group from django.core.exceptions import ObjectDoesNotExist from django.core.cache impor...
{ "repo_name": "ZhangDubhe/Tropical-Cyclone-Information-System", "path": "TyphoonApi/suncreative/views.py", "copies": "1", "size": "7801", "license": "mit", "hash": -4240678074135589400, "line_mean": 36.0913461538, "line_max": 122, "alpha_frac": 0.6806221646, "autogenerated": false, "ratio": 3.849...
from django.shortcuts import render from django.conf import settings from django.contrib.auth import login, logout from django.utils.decorators import method_decorator from django.views.decorators.debug import sensitive_post_parameters from django.views.generic import View, FormView, TemplateView from django.views.g...
{ "repo_name": "Treisy/Django-Angular-Demo", "path": "product_wiki/views.py", "copies": "1", "size": "1752", "license": "mit", "hash": -6641020609727045000, "line_mean": 30.8545454545, "line_max": 89, "alpha_frac": 0.727739726, "autogenerated": false, "ratio": 3.981818181818182, "config_test": f...
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.contrib.auth import login, authenticate from django.shortcuts import render, redirect from django.contrib.auth.models import User from app.core.forms import * @login_required def home(request): user = request...
{ "repo_name": "agustinhansen/SIDECO", "path": "app/core/views.py", "copies": "1", "size": "3226", "license": "mit", "hash": -4060727816527022000, "line_mean": 36.7647058824, "line_max": 80, "alpha_frac": 0.6881619938, "autogenerated": false, "ratio": 3.1750741839762613, "config_test": false, ...
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect,get_object_or_404 from django.http import HttpResponse,HttpResponseRedirect from django.contrib.auth import authenticate, login,logout from django.views.generic import View from ....
{ "repo_name": "micbuz/project2", "path": "boot/log_user/views.py", "copies": "1", "size": "2009", "license": "apache-2.0", "hash": -1855142724118412500, "line_mean": 31.4032258065, "line_max": 78, "alpha_frac": 0.6754604281, "autogenerated": false, "ratio": 4.009980039920159, "config_test": fal...
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic import TemplateView from django.db.models import Q from django.core.context_processors import csrf from django.core.urlresolvers import reverse f...
{ "repo_name": "warnes/irrigatorpro", "path": "irrigator_pro/notifications/notifications_setup_view.py", "copies": "1", "size": "8183", "license": "mit", "hash": 5551294558039440000, "line_mean": 30.7170542636, "line_max": 121, "alpha_frac": 0.6172552853, "autogenerated": false, "ratio": 3.9897610...
from django.shortcuts import render from django.contrib.auth import authenticate, login, logout as django_logout from django.contrib.auth.models import User from django.http import HttpResponse from django.http import HttpResponseRedirect # Pour la redirection from django.conf import settings # Go chopper les settings...
{ "repo_name": "Debetux/django-twython", "path": "twitter_connect/views.py", "copies": "1", "size": "3811", "license": "mit", "hash": -1674600056698582300, "line_mean": 41.3444444444, "line_max": 150, "alpha_frac": 0.7233595801, "autogenerated": false, "ratio": 4.010526315789473, "config_test": ...
from django.shortcuts import render from django.contrib.auth.mixins import LoginRequiredMixin from django.core.urlresolvers import reverse_lazy from django.shortcuts import render,get_object_or_404,redirect from django.http import Http404 from django.views import generic from django.contrib.auth.decorators import log...
{ "repo_name": "thecodinghub/news-for-good", "path": "news/views.py", "copies": "1", "size": "2942", "license": "bsd-3-clause", "hash": -6583596783120675000, "line_mean": 27.8431372549, "line_max": 72, "alpha_frac": 0.6713120326, "autogenerated": false, "ratio": 3.738246505717916, "config_test":...
from django.shortcuts import render from django.contrib import messages # Create your views here. from django.shortcuts import render, get_object_or_404, redirect from django.http import HttpResponseRedirect from ..models import Shop, User, Customer, FoodItem,Order def fooditems(request, shop_id): shops = Shop....
{ "repo_name": "Net-Mist/noq", "path": "main/Customer/views.py", "copies": "2", "size": "1613", "license": "mit", "hash": -8452800504105468000, "line_mean": 34.8444444444, "line_max": 114, "alpha_frac": 0.6862988221, "autogenerated": false, "ratio": 3.4989154013015185, "config_test": false, "h...
from django.shortcuts import render from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponse from blog.models import Post, Category, Tag, Comment def index(req): posts = Post.objects.all() paginator = Paginator(posts, 5) posts = paginator.page(1) ...
{ "repo_name": "isayme/django-blog", "path": "blog/views.py", "copies": "1", "size": "1867", "license": "mit", "hash": 3637709755465562600, "line_mean": 25.6857142857, "line_max": 80, "alpha_frac": 0.6486341725, "autogenerated": false, "ratio": 3.597302504816956, "config_test": true, "has_no_k...
from django.shortcuts import render from django.core.urlresolvers import reverse from django.http import HttpResponse from app0.models import Category from app0.models import Topic from app0.models import Source from app0.models import CollectionTopic from app0.models import CollectionBigTopic from app0.models import...
{ "repo_name": "meechanic/infsrcmanage", "path": "app0/views.py", "copies": "1", "size": "8688", "license": "mit", "hash": 8662169491384749000, "line_mean": 35.970212766, "line_max": 96, "alpha_frac": 0.677140884, "autogenerated": false, "ratio": 4.1194879089615934, "config_test": false, "has_...
from django.shortcuts import render from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework import renderers from rest_framework import parsers from app import serializers, models from rest_framework.a...
{ "repo_name": "iandd0824/ri-app", "path": "web/app/views.py", "copies": "1", "size": "7014", "license": "apache-2.0", "hash": -1553007343637464600, "line_mean": 27.06, "line_max": 125, "alpha_frac": 0.6676646707, "autogenerated": false, "ratio": 4.4030131826742, "config_test": false, "has_no_...
from django.shortcuts import render from django.http import Http404 # Create your views here. from django.contrib.auth.models import User from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import filters from rest_framework import viewsets from rest_framework im...
{ "repo_name": "anistark/demo", "path": "drsftask/todo/views.py", "copies": "1", "size": "1427", "license": "mit", "hash": 8166338588293198000, "line_mean": 30.7333333333, "line_max": 75, "alpha_frac": 0.7077785564, "autogenerated": false, "ratio": 4.3373860182370825, "config_test": false, "ha...
from django.shortcuts import render from django.http import HttpRequest from django.template import RequestContext from datetime import datetime from django.http import HttpResponse from django.http import HttpResponseRedirect from DirtyDrive.models import DriveNowCarType, DriveNowCar, DriveNowChargingStation, DriveNo...
{ "repo_name": "Superchicken1/DirtyDrive", "path": "DirtyDrive/views.py", "copies": "1", "size": "2925", "license": "apache-2.0", "hash": 6449077035431439000, "line_mean": 25.1160714286, "line_max": 106, "alpha_frac": 0.6560683761, "autogenerated": false, "ratio": 3.4656398104265405, "config_tes...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseGone, HttpResponseServerError, HttpResponseRedirect from django.http import Http404 from django.conf import settings from django.urls import reverse import urllib.request, urllib.error import time import math from PIL import Image fr...
{ "repo_name": "sunshaoyan/ISeeNN", "path": "ISeeNN/search_web/views.py", "copies": "1", "size": "11970", "license": "apache-2.0", "hash": -4626017443026541000, "line_mean": 36.641509434, "line_max": 110, "alpha_frac": 0.6156223893, "autogenerated": false, "ratio": 3.6684033098375726, "config_te...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.template.response import TemplateResponse from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.views.defaults import page_not_found from django.shor...
{ "repo_name": "bpatyi/paulriedl", "path": "core/views.py", "copies": "1", "size": "1413", "license": "mit", "hash": 3713624970371468300, "line_mean": 29.7173913043, "line_max": 122, "alpha_frac": 0.6574663836, "autogenerated": false, "ratio": 4.923344947735192, "config_test": false, "has_no_k...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, JsonResponse #csrf things, to POST requests from django.views.decorators.csrf import csrf_protect from django.core.context_processors import csrf #Authentication from django.contrib import auth from django.contrib.auth.de...
{ "repo_name": "JJorgeDSIC/ML_PORTAL_CONCEPT", "path": "ml_portal/portal/views.py", "copies": "1", "size": "16374", "license": "apache-2.0", "hash": 1463081493842808600, "line_mean": 24.9508716323, "line_max": 123, "alpha_frac": 0.6187248076, "autogenerated": false, "ratio": 4.16323417238749, "c...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.template import Context, loader from django.views.generic import TemplateView from django.views.generic.base import TemplateResponseMixin, ContextMixin, View from django.urls import resolve from apps.users.models...
{ "repo_name": "Sirikam/Gravitas", "path": "apps/staticpages/views.py", "copies": "1", "size": "1107", "license": "mit", "hash": 6708546782236619000, "line_mean": 31.5882352941, "line_max": 79, "alpha_frac": 0.7091237579, "autogenerated": false, "ratio": 4.392857142857143, "config_test": false, ...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from iq_app.models import User, Solution, Registration from iq_app.forms import UserForm, RegistrationForm from django.shortcuts import render_to_response from django.core.context_processors import csrf from django.contr...
{ "repo_name": "donkripton/IQ-test", "path": "iq_project/iq_app/views.py", "copies": "1", "size": "7772", "license": "mit", "hash": -6187765820915086000, "line_mean": 35.3177570093, "line_max": 95, "alpha_frac": 0.6124549665, "autogenerated": false, "ratio": 4.064853556485356, "config_test": fal...
from django.shortcuts import render from django.http import HttpResponse, JsonResponse, HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from .models import * from .forms import * # ...
{ "repo_name": "CSUChico-CINS465/CINS465-Spring2017-Lecture-Examples", "path": "firstDjango/firstproject/firstapp/views.py", "copies": "1", "size": "2294", "license": "mit", "hash": -8912071224293655000, "line_mean": 29.5866666667, "line_max": 72, "alpha_frac": 0.5863121186, "autogenerated": false, ...
from django.shortcuts import render #from django.http import HttpResponse from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from rango.models import Category, Page from rango.forms import CategoryForm, PageForm #from rango.forms import UserForm, UserProfileForm #fr...
{ "repo_name": "comsaint/tango", "path": "rango/views.py", "copies": "1", "size": "11577", "license": "mit", "hash": -1876139646490967300, "line_mean": 42.5263157895, "line_max": 117, "alpha_frac": 0.6474907143, "autogenerated": false, "ratio": 4.405251141552512, "config_test": false, "has_no_...
from django.shortcuts import render from django.http import HttpResponse from django.template import RequestContext, loader from 文章.models import 何澤政文章 from 文章.文章表格 import 文章全部表格 from 文章.文章表格 import 加新文章表格, 改國語斷詞表格, 改閩南語翻譯表格 from django.contrib.auth import authenticate, login, logout from django.shortcuts import redir...
{ "repo_name": "sih4sing5hong5/icorpus", "path": "文章/views.py", "copies": "1", "size": "7085", "license": "mit", "hash": -1394422119850155300, "line_mean": 28.4642857143, "line_max": 69, "alpha_frac": 0.5887445887, "autogenerated": false, "ratio": 2.104591836734694, "config_test": false, "has_...
from django.shortcuts import render from django.http import HttpResponse from django.views.generic import TemplateView, ListView, DetailView from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage #from allauth.account.views import SignupView, LoginView, LogoutView from home.models import Post from h...
{ "repo_name": "yeongseon/django_beautifulseodang", "path": "home/views.py", "copies": "1", "size": "3022", "license": "mit", "hash": 5755125903498097000, "line_mean": 25.5175438596, "line_max": 74, "alpha_frac": 0.7356055592, "autogenerated": false, "ratio": 3.5848161328588373, "config_test": f...
from django.shortcuts import render from django.http import HttpResponse from models import Engines from forms import AddEngineForm from django.http import Http404, HttpResponseRedirect from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger import json import urllib3 http = urllib3.PoolManager(tim...
{ "repo_name": "gregorianzhang/octopus", "path": "engines/views.py", "copies": "1", "size": "3812", "license": "apache-2.0", "hash": 4480695856174751000, "line_mean": 25.8450704225, "line_max": 94, "alpha_frac": 0.5981112277, "autogenerated": false, "ratio": 3.5692883895131087, "config_test": fa...
from django.shortcuts import render from django.http import HttpResponse from rango.models import Category, Page from rango.forms import CategoryForm, PageForm, UserForm, UserProfileForm from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.de...
{ "repo_name": "clex25/rango-tango", "path": "tango_with_django_project/rango/views.py", "copies": "1", "size": "4373", "license": "unlicense", "hash": -2531000053040131000, "line_mean": 29.7957746479, "line_max": 89, "alpha_frac": 0.6258861194, "autogenerated": false, "ratio": 4.106103286384976, ...
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.template import loader from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404, render from django.views import generic from .models import Answer, Equation from django.utils i...
{ "repo_name": "okeefem2/django-calculatormo", "path": "calculator/views.py", "copies": "1", "size": "3252", "license": "bsd-2-clause", "hash": 3543181594864890400, "line_mean": 33.9677419355, "line_max": 99, "alpha_frac": 0.5344403444, "autogenerated": false, "ratio": 4.039751552795031, "config...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, logout from django.contrib.auth import login as auth_login def home(request): """ Displays the homepage. """ return render(request, 'home.html') def calendario(request): ...
{ "repo_name": "GDGMalaga/GDGWeb", "path": "www/views.py", "copies": "1", "size": "1413", "license": "mit", "hash": -2520536370356487000, "line_mean": 23.7894736842, "line_max": 70, "alpha_frac": 0.6602972399, "autogenerated": false, "ratio": 4.443396226415095, "config_test": false, "has_no_ke...
from django.shortcuts import render from django.http import HttpResponseRedirect # Create your views here. from udb.models import UserObject from udb.forms import CreateUserForm, EditUserForm from django.core.urlresolvers import reverse ## NOTE: I've chosen to leave a lot of commented code in here to reflect my l...
{ "repo_name": "defzzd/UserDataBase-Heroku", "path": "udb/views.py", "copies": "4", "size": "6775", "license": "mit", "hash": 7090205088160381000, "line_mean": 42.7161290323, "line_max": 191, "alpha_frac": 0.6562361624, "autogenerated": false, "ratio": 4.164105716041795, "config_test": false, ...
from django.shortcuts import render from django.http import JsonResponse, HttpResponse from django.views.decorators.csrf import csrf_exempt import json @csrf_exempt def maze(request): f = open("maze.json", "r") maze = json.load(f) f.close() if request.method == "POST": # Get data pla...
{ "repo_name": "MoonCheesez/stack", "path": "PiGame/pigame/maze/views.py", "copies": "1", "size": "1500", "license": "mit", "hash": -3591912221277613000, "line_mean": 24.8793103448, "line_max": 70, "alpha_frac": 0.496, "autogenerated": false, "ratio": 3.597122302158273, "config_test": false, "...
from django.shortcuts import render from django.shortcuts import get_object_or_404 from django.http import HttpResponseRedirect from .models import Book, Author, Review from django.urls import reverse from django.utils import timezone from django.contrib.auth.models import User from django.contrib.auth import au...
{ "repo_name": "louridas/djbr", "path": "djbr/views.py", "copies": "1", "size": "4172", "license": "bsd-2-clause", "hash": -64909370605017496, "line_mean": 34.0588235294, "line_max": 77, "alpha_frac": 0.5987535954, "autogenerated": false, "ratio": 3.899065420560748, "config_test": false, "has_...
from django.shortcuts import render from django.shortcuts import render, get_object_or_404, redirect from django.http import HttpResponseRedirect, HttpResponse from django.urls import reverse from django.views import generic from .models import * from django.contrib import messages from django.utils import timezone f...
{ "repo_name": "PrefPy/opra", "path": "compsocsite/groups/views.py", "copies": "1", "size": "6303", "license": "mit", "hash": -4105315303009255400, "line_mean": 40.2026143791, "line_max": 114, "alpha_frac": 0.653974298, "autogenerated": false, "ratio": 3.7969879518072287, "config_test": false, ...
from django.shortcuts import render from django.shortcuts import render, redirect, get_object_or_404 from django.forms import ModelForm from servers.models import Server class ServerForm(ModelForm): class Meta: model = Server fields = ['name', 'ip', 'order'] def server_list(request, template_nam...
{ "repo_name": "kinnevo/kic_alone", "path": "servers/views.py", "copies": "1", "size": "1363", "license": "mit", "hash": -2878539108169790500, "line_mean": 33.9743589744, "line_max": 83, "alpha_frac": 0.6837857667, "autogenerated": false, "ratio": 3.703804347826087, "config_test": false, "has_...
from django.shortcuts import render from django.shortcuts import render, render_to_response, HttpResponseRedirect, HttpResponse from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.forms.models import modelformset_factory from django.template import Reques...
{ "repo_name": "bb111189/CryptoKnocker", "path": "CryptoKnocker/management/views.py", "copies": "1", "size": "5206", "license": "mit", "hash": -7728087446094922000, "line_mean": 32.3717948718, "line_max": 200, "alpha_frac": 0.6911256243, "autogenerated": false, "ratio": 3.8821774794929156, "conf...
from django.shortcuts import render from django.shortcuts import render, render_to_response, HttpResponseRedirect, HttpResponse import json from models import LoginForm from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.forms.models import modelformset_f...
{ "repo_name": "bb111189/CryptoKnocker", "path": "CryptoKnocker/mainpage/views.py", "copies": "1", "size": "2896", "license": "mit", "hash": -3701104585033287700, "line_mean": 32.2988505747, "line_max": 99, "alpha_frac": 0.6912983425, "autogenerated": false, "ratio": 4.4829721362229105, "config_...
from django.shortcuts import render from django.shortcuts import render_to_response, get_object_or_404 # def blogs(request): # return render_to_response('blogs.html', { # 'page_title': 'blog', # 'categories': Category.objects.all(), # 'posts': Blog.objects.all()[:5] # }) # from picture...
{ "repo_name": "vollov/egallery", "path": "gallery/picture/views.py", "copies": "1", "size": "1121", "license": "mit", "hash": -816234863194979600, "line_mean": 27.05, "line_max": 66, "alpha_frac": 0.6190900981, "autogenerated": false, "ratio": 3.346268656716418, "config_test": false, "has_no_...
from django.shortcuts import render from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from preguntar.models import Pregunta from comentario.models import Comentario #Return with json from django.co...
{ "repo_name": "GonzaloAfa/Termometro", "path": "comentario/views.py", "copies": "1", "size": "2794", "license": "mit", "hash": -6607501802515103000, "line_mean": 27.8041237113, "line_max": 86, "alpha_frac": 0.7261989979, "autogenerated": false, "ratio": 2.7995991983967934, "config_test": false,...
from django.shortcuts import render from django.shortcuts import render_to_response from django.db.models import Q from microdata.models import Device, Event from django.http import HttpResponse import json # Create your views here. def landing(request): public_devices = Device.objects.filter(private=False) us...
{ "repo_name": "seadsystem/ShR2", "path": "Web Stack/webapp/static/rest_framework_swagger/webapp/views.py", "copies": "2", "size": "1978", "license": "mit", "hash": 6810636574799871000, "line_mean": 36.320754717, "line_max": 85, "alpha_frac": 0.6956521739, "autogenerated": false, "ratio": 3.656192...
#from django.shortcuts import render from django.shortcuts import render_to_response from django.views.decorators.cache import never_cache from django.http import HttpResponse, HttpResponseForbidden from django.utils import simplejson from gallery.mode.photo_manager import PhotoManager from gallery.common import getP...
{ "repo_name": "bob-chen/gallery", "path": "gallery/views/photo_view.py", "copies": "1", "size": "2223", "license": "mit", "hash": 1460316448782696000, "line_mean": 30.323943662, "line_max": 91, "alpha_frac": 0.6657669816, "autogenerated": false, "ratio": 3.6382978723404253, "config_test": false...
from django.shortcuts import render from django.template import Context, loader, Template from django.http import HttpResponse, HttpResponseRedirect, Http404 from .forms import SimpleAnalysis from .forms import AdvancedAnalysis from .economicimpact import simple_impact from .economicimpact import complex_impact impor...
{ "repo_name": "PMMora/compact", "path": "compact/compactapp/views.py", "copies": "2", "size": "7725", "license": "mit", "hash": -8723419208521286000, "line_mean": 40.9836956522, "line_max": 124, "alpha_frac": 0.6103559871, "autogenerated": false, "ratio": 4.335016835016835, "config_test": false...
from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status from . import models,serializers from django.db import transaction @csrf_exempt @api_view(['GET',]...
{ "repo_name": "koebbe/homeworks", "path": "qa/views.py", "copies": "1", "size": "2656", "license": "mit", "hash": -6675003132095175000, "line_mean": 33.4935064935, "line_max": 131, "alpha_frac": 0.6265060241, "autogenerated": false, "ratio": 4.1178294573643415, "config_test": false, "has_no_k...
from django.shortcuts import render from django.views.generic import ListView, DetailView from .models import Category, Product from django.shortcuts import get_object_or_404 from cart.forms import CartAddProductForm class ShopMixin(object): """Adds categories and current order to render context""" def get_co...
{ "repo_name": "janusnic/dj-21v", "path": "unit_13/mysite/shop/views.py", "copies": "1", "size": "1807", "license": "mit", "hash": 4442428448754620000, "line_mean": 29.6271186441, "line_max": 69, "alpha_frac": 0.6170448257, "autogenerated": false, "ratio": 4.281990521327014, "config_test": false...
from django.shortcuts import render from django.views.generic import ListView from django.views.generic import CreateView from django.views.generic import UpdateView from django.views.generic import DetailView from django.core.urlresolvers import reverse from contacts.models import Contact from contacts import forms...
{ "repo_name": "Devrhoid/DjangoApp2", "path": "contacts/views.py", "copies": "1", "size": "1288", "license": "mpl-2.0", "hash": -4503754514707416600, "line_mean": 25.2857142857, "line_max": 78, "alpha_frac": 0.7383540373, "autogenerated": false, "ratio": 3.891238670694864, "config_test": false, ...
from django.shortcuts import render from django.views.generic import TemplateView, ListView, DateDetailView, YearArchiveView, MonthArchiveView, DayArchiveView from eblog.models import * class ArchiveView(ListView): template_name = "eblog/entry_archive.html" model = Entry context_object_name = 'latest' ...
{ "repo_name": "pandamasta/django-eblog", "path": "eblog/views.py", "copies": "1", "size": "1704", "license": "bsd-3-clause", "hash": 8137389063970410000, "line_mean": 30.5555555556, "line_max": 122, "alpha_frac": 0.7012910798, "autogenerated": false, "ratio": 3.625531914893617, "config_test": f...
from django.shortcuts import render from drf_api_test.mixins import OptionsAllowedMethodsMixin from rest_framework import generics, status from rest_framework.response import Response from .serializers import FooSerializer from .models import Foo class FooList(OptionsAllowedMethodsMixin, generics.ListCreateAPIView): ...
{ "repo_name": "WorkHorseIndustries/drf-api-test", "path": "test/testproj/foo/views.py", "copies": "2", "size": "1519", "license": "mit", "hash": -3743041703408902700, "line_mean": 33.5227272727, "line_max": 99, "alpha_frac": 0.7406188282, "autogenerated": false, "ratio": 4.007915567282322, "con...
from django.shortcuts import render from elasticsearch_dsl import F from elasticsearch_dsl.filter import Bool import mkt from mkt.search.filters import (PublicContentFilter, PublicSearchFormFilter, RegionFilter, SearchQueryFilter) from mkt.search.views import ( SearchView as BaseSe...
{ "repo_name": "mozilla/zamboni", "path": "mkt/tvplace/views.py", "copies": "5", "size": "1859", "license": "bsd-3-clause", "hash": -7524494475729637000, "line_mean": 32.1964285714, "line_max": 78, "alpha_frac": 0.6525013448, "autogenerated": false, "ratio": 4.244292237442922, "config_test": fal...
from django.shortcuts import render from evoluirmais.core.forms import ContactForm, SubscriptionForm def home(request): context = {} # contact if request.method == 'POST': if request.POST['action'] == 'contact': contact_form = ContactForm(request.POST, prefix='Contact') s...
{ "repo_name": "klebercode/evoluirmais", "path": "evoluirmais/core/views.py", "copies": "1", "size": "2268", "license": "mit", "hash": 7857539791737825000, "line_mean": 43.4705882353, "line_max": 70, "alpha_frac": 0.5776014109, "autogenerated": false, "ratio": 4.7053941908713695, "config_test": ...
from django.shortcuts import render from extensions.views import tab_extension from infrastructure.models import Server, Environment from accounts.models import Group, UserProfile from resourcehandlers.models import ResourceHandler from resources.models import Resource from servicecatalog.models import ServiceBlueprin...
{ "repo_name": "CloudBoltSoftware/cloudbolt-forge", "path": "ui_extensions/extension_tabs/views.py", "copies": "1", "size": "1534", "license": "apache-2.0", "hash": -1369260894035184600, "line_mean": 34.6744186047, "line_max": 77, "alpha_frac": 0.7711864407, "autogenerated": false, "ratio": 3.8254...
from django.shortcuts import render from .forms import CustomerForm from .models import Customer from store.models import Store import logging logger = logging.getLogger(__name__) from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.shortcuts import render_...
{ "repo_name": "vollov/sm", "path": "django/sales/views.py", "copies": "1", "size": "2564", "license": "mit", "hash": -8635355449963511000, "line_mean": 32.3116883117, "line_max": 79, "alpha_frac": 0.5838533541, "autogenerated": false, "ratio": 4.570409982174688, "config_test": false, "has_no_...
from django.shortcuts import render from .forms import HomeDiceRollForm from .models import DiceRoll # def home(request): # return render(request, 'dice/home.html') def home(request): if request.method == 'POST': form = HomeDiceRollForm(request.POST) roll_output = '' if form.is_valid(...
{ "repo_name": "brmedeiros/dicey9000web", "path": "dice/views.py", "copies": "1", "size": "1150", "license": "mit", "hash": 2766150430826639000, "line_mean": 32.8235294118, "line_max": 70, "alpha_frac": 0.572173913, "autogenerated": false, "ratio": 3.7337662337662336, "config_test": false, "ha...
from django.shortcuts import render from forms import MemberForm from models import Member from django.shortcuts import get_object_or_404 def register(request): # A HTTP POST? if request.method == 'POST': form = MemberForm(request.POST) # Have we been provided with a valid form? if fo...
{ "repo_name": "vollovs/doonvalley", "path": "django/member/views.py", "copies": "1", "size": "1158", "license": "mit", "hash": -1507903415753780200, "line_mean": 29.4736842105, "line_max": 83, "alpha_frac": 0.5958549223, "autogenerated": false, "ratio": 4.091872791519434, "config_test": false, ...
from django.shortcuts import render from go.datasets.lga_suburb_list import process from go.datasets.attractions.process import selectrandom2attractions from go.datasets.events.process import selectrandom2events from go.datasets.red_light_camera_notices.process import getRedLightFinesBySuburb from go.datasets.crime.pr...
{ "repo_name": "deccico/gowest", "path": "gowestapp/go/views.py", "copies": "1", "size": "12569", "license": "mit", "hash": 913783316023948700, "line_mean": 48.09765625, "line_max": 208, "alpha_frac": 0.6431697032, "autogenerated": false, "ratio": 3.113450582115432, "config_test": false, "has_...
from django.shortcuts import render from io import BytesIO from django.http import HttpResponse from django.core import serializers from django.forms.models import model_to_dict from django.views.generic.list import ListView from django.views.generic import DetailView from django.utils import timezone from templated_...
{ "repo_name": "jejimenez/invetronic", "path": "inventario/views.py", "copies": "1", "size": "5298", "license": "mit", "hash": 2213702908165406000, "line_mean": 40.7165354331, "line_max": 133, "alpha_frac": 0.6909571456, "autogenerated": false, "ratio": 3.912112259970458, "config_test": false, ...
from django.shortcuts import render from kickstarter.utils import FilteredTableView from kickstarter.models import * from kickstarter.tables import * from kickstarter.filters import * class ProjectsView(FilteredTableView): """ Renders a table of all projects """ model = Kickstarter template_name ...
{ "repo_name": "pratyaymodi/kickstarter", "path": "kickstarter_django/kickstarter/views.py", "copies": "1", "size": "3565", "license": "mit", "hash": -4500332497069009400, "line_mean": 25.4074074074, "line_max": 54, "alpha_frac": 0.7051893408, "autogenerated": false, "ratio": 4.23396674584323, "...
from django.shortcuts import render from math import sqrt from fractions import Fraction import datetime def gcd(a, b): """Return greatest common divisor using Euclid's Algorithm.""" while b: a, b = b, a % b return a def lcm(a, b): """Return lowest common multiple.""" return a * b ...
{ "repo_name": "SlashRoot/WHAT", "path": "what_apps/donald/views.py", "copies": "1", "size": "3707", "license": "mit", "hash": 2507008613062923000, "line_mean": 24.9230769231, "line_max": 140, "alpha_frac": 0.6007553278, "autogenerated": false, "ratio": 3.8177136972193613, "config_test": false, ...
from django.shortcuts import render from mittab.apps.tab.forms import DebaterForm from mittab.apps.tab.helpers import redirect_and_flash_error, \ redirect_and_flash_success from mittab.apps.tab.models import * from mittab.libs import tab_logic, cache_logic from mittab.libs.tab_logic import rankings from mittab...
{ "repo_name": "jolynch/mit-tab", "path": "mittab/apps/tab/debater_views.py", "copies": "1", "size": "4328", "license": "mit", "hash": -3524750258523540000, "line_mean": 33.0787401575, "line_max": 87, "alpha_frac": 0.5609981516, "autogenerated": false, "ratio": 3.7150214592274677, "config_test":...
from django.shortcuts import render from ..model import SessionMaker, ManagementScenario from ..model import (LITTLE_DELL_VOLUME, LITTLE_DELL_RELEASE, LITTLE_DELL_SPILL, MOUNTAIN_DELL_VOLUME, MOUNTAIN_DELL_RELEASE, ...
{ "repo_name": "CI-WATER/tethysapp-parleys_creek_management", "path": "tethysapp/parleys_creek_management/controllers/results.py", "copies": "1", "size": "3413", "license": "bsd-2-clause", "hash": -2194349820419438300, "line_mean": 31.5142857143, "line_max": 91, "alpha_frac": 0.5098154117, "autogene...
from django.shortcuts import render from .models import Bargain from .forms import SearchForm def index(request): display_results = False bargains = [] supplier_id = None filter_text = None if request.method == 'POST': form = SearchForm(request.POST) if form.is_valid(): ...
{ "repo_name": "sebastian-code/jsonb-test", "path": "jsonb/emporium/views.py", "copies": "1", "size": "2948", "license": "mit", "hash": -7051137614975106000, "line_mean": 37.7894736842, "line_max": 78, "alpha_frac": 0.4657394844, "autogenerated": false, "ratio": 4.284883720930233, "config_test":...
from django.shortcuts import render from .models import Book, Author from django_easyfilters import FilterSet from django_easyfilters.filters import NumericRangeFilter class BookFilterSet(FilterSet): fields = [ 'binding', 'authors', ('authors__likes', {}, NumericRangeFilter), 'genr...
{ "repo_name": "ionelmc/django-easyfilters", "path": "tests/test_app/views.py", "copies": "1", "size": "1783", "license": "mit", "hash": -5540974774168205000, "line_mean": 33.2884615385, "line_max": 75, "alpha_frac": 0.5064498037, "autogenerated": false, "ratio": 4.8059299191374665, "config_test...
from django.shortcuts import render from .models import Comments from article.models import Articles from .forms import CommentsForm def add_comment(request, article_id, parent_comment_id=None): form = CommentsForm() dictionary = {'article': Articles.objects.get(id=article_id)} if parent_comment_id is no...
{ "repo_name": "rudikovrf/django_blog", "path": "comment/views.py", "copies": "1", "size": "1184", "license": "mit", "hash": 1945429624117809000, "line_mean": 31.8888888889, "line_max": 81, "alpha_frac": 0.6097972973, "autogenerated": false, "ratio": 4.054794520547945, "config_test": false, "h...
from django.shortcuts import render from .models import FormDemo from .forms import SimpleFormDemoForm, CrispyFormDemoModelForm def formDemoIndex(request): return render(request, 'form_demo/index.html', {'title':'Demo for Forms'}) def showSimpleFormDemoForm(request): msg="" if request.method == 'POST':...
{ "repo_name": "lerina/agileForms", "path": "apps/form_demo/views.py", "copies": "1", "size": "2167", "license": "mit", "hash": -1114806290625480800, "line_mean": 30.4057971014, "line_max": 132, "alpha_frac": 0.6377480388, "autogenerated": false, "ratio": 3.775261324041812, "config_test": false,...
from django.shortcuts import render from .models import MasterReference, SourceReference def mb(request): """ View function for home page of site. """ # Generate counts of some of the main objects num_master_reference=MasterReference.objects.all().count() num_source_reference=SourceReference.o...
{ "repo_name": "karilint/django_local_library", "path": "mb/views.py", "copies": "1", "size": "1230", "license": "mit", "hash": 7576579978965264000, "line_mean": 29.75, "line_max": 182, "alpha_frac": 0.7390243902, "autogenerated": false, "ratio": 4.300699300699301, "config_test": false, "has_n...
from django.shortcuts import render from models import * from rest_framework import viewsets from serializers import * class OrganizationsView(viewsets.ModelViewSet): queryset = Organization.objects.all() serializer_class = OrganizationSerializer class OrganizationServicesView(viewsets.ModelViewSet): ser...
{ "repo_name": "LomaxRx/service-seeker", "path": "api/views.py", "copies": "1", "size": "1987", "license": "mit", "hash": 7595008653545687000, "line_mean": 30.5396825397, "line_max": 68, "alpha_frac": 0.7684952189, "autogenerated": false, "ratio": 4.300865800865801, "config_test": false, "has_...
from django.shortcuts import render from models import * # importamos las vistas genericas de django, para crear, actualizar y eliminar from django.views.generic.edit import CreateView, UpdateView, DeleteView from forms import FormCrearContenido from django.core.urlresolvers import reverse_lazy from django.template im...
{ "repo_name": "vaaceves/repue-repositorio-universidad-empresa", "path": "home/views.py", "copies": "1", "size": "6666", "license": "unlicense", "hash": 232182079441578620, "line_mean": 34.6470588235, "line_max": 113, "alpha_frac": 0.6266126613, "autogenerated": false, "ratio": 3.572347266881029, ...
from django.shortcuts import render from .models import Reporte from rest_framework import viewsets from .serializers import ReporteSerializer, UserSerializer, SetPassword #restgramework from django.contrib.auth.models import User from rest_framework import permissions from rest_framework.response import Response from...
{ "repo_name": "jperezsoy/baches", "path": "reportes/views.py", "copies": "1", "size": "1709", "license": "apache-2.0", "hash": -1823223556897444900, "line_mean": 33.18, "line_max": 96, "alpha_frac": 0.6928028087, "autogenerated": false, "ratio": 4.088516746411483, "config_test": false, "has_n...
from django.shortcuts import render from .models import Sample, SampleGroup from files.models import File from tasks.models import Task import json from tasks.tasks import annotate_vcf, run_qc from django.shortcuts import render, redirect, get_object_or_404 from django.db.models import Q from django.contrib import me...
{ "repo_name": "raonyguimaraes/mendelmd", "path": "samples/views.py", "copies": "1", "size": "3269", "license": "bsd-3-clause", "hash": 8509050628675736000, "line_mean": 25.7950819672, "line_max": 110, "alpha_frac": 0.6996023249, "autogenerated": false, "ratio": 3.9433051869722555, "config_test"...
from django.shortcuts import render from .models import Stop, Agency from . import forms from traffic_stops import base_views class Home(base_views.Home): form_class = forms.AgencySearchForm template_name = 'md.html' success_url = 'md:agency-detail' def get_context_data(self, **kwargs): cont...
{ "repo_name": "OpenDataPolicingNC/Traffic-Stops", "path": "md/views.py", "copies": "1", "size": "1146", "license": "mit", "hash": 1481798761128167400, "line_mean": 23.3829787234, "line_max": 62, "alpha_frac": 0.6387434555, "autogenerated": false, "ratio": 3.5479876160990713, "config_test": fals...
from django.shortcuts import render from notes.models import Note def index(request): context = { # Get all of the notes in the database, in descending order. # Instead of SQL, this is how Django provides a cross-database # query engine. 'notes': Note.objects.all().order_by('-date'...
{ "repo_name": "jeremyosborne/python", "path": "third_party/django/bulletin/notes/views.py", "copies": "1", "size": "1393", "license": "mit", "hash": -7728961268240291000, "line_mean": 31.3953488372, "line_max": 75, "alpha_frac": 0.687724336, "autogenerated": false, "ratio": 4.195783132530121, "...
from django.shortcuts import render from ogra.charts import OgraPieChart, OgraLineChart, OgraColumnChart def index(request): backend = request.GET.get('backend', 'raphael') pie_chart = _create_pie(name='first', title='First Chart', backend=backend) column_chart = _create_column(name='second', title='Sec...
{ "repo_name": "shenek/django-ogra", "path": "examples/simple/simple/views.py", "copies": "1", "size": "1886", "license": "mit", "hash": -5073331613371816000, "line_mean": 30.4333333333, "line_max": 93, "alpha_frac": 0.5662778367, "autogenerated": false, "ratio": 3.3558718861209966, "config_test...
from django.shortcuts import render from os import path as Path from subprocess import Popen,PIPE import threading import sys import time import libtorrent as lt class Settings: ip = 'queenstream.com' lt_params= {'save_path' : '/opt/torrents/'} lt_ports = (6881, 6891) dl_log_dir = '' vlc_log_dir...
{ "repo_name": "Ododo/QueenStream", "path": "views.py", "copies": "1", "size": "5131", "license": "apache-2.0", "hash": -5331543123945580000, "line_mean": 34.1438356164, "line_max": 172, "alpha_frac": 0.5642175015, "autogenerated": false, "ratio": 3.6032303370786516, "config_test": false, "has...
from django.shortcuts import render from os import unlink from tempfile import NamedTemporaryFile from forms import ProfileFileForm from stats_parser import pstats_to_json def profile_from_file(request): if request.method == 'POST': form = ProfileFileForm(request.POST, request.FILES) if form.is_...
{ "repo_name": "mrfuxi/django_vis_profiling", "path": "views.py", "copies": "1", "size": "1118", "license": "mit", "hash": -8828624139262726000, "line_mean": 26.2682926829, "line_max": 59, "alpha_frac": 0.5867620751, "autogenerated": false, "ratio": 3.950530035335689, "config_test": false, "ha...