text stringlengths 0 1.05M | meta dict |
|---|---|
from django import http
from django.core.serializers.json import DjangoJSONEncoder
try:
# json module from python > 2.6
import json
except ImportError:
# use packaged django version of simplejson
from django.utils import simplejson as json
__all__ = ['JSONResponse', 'JSONErrorResponse', 'HttpError',
... | {
"repo_name": "davisein/jitsudone",
"path": "restless/http.py",
"copies": "1",
"size": "2705",
"license": "bsd-3-clause",
"hash": -9170167202619017000,
"line_mean": 26.6020408163,
"line_max": 78,
"alpha_frac": 0.649168207,
"autogenerated": false,
"ratio": 4.167950693374422,
"config_test": false... |
from django import http
from django.core.urlresolvers import reverse_lazy
from django.http.response import Http404
from django.shortcuts import get_object_or_404
from django.views.generic.list import ListView
from . import models
class ChannelMixin(object):
"""
View mixin used to identify the channel a view ... | {
"repo_name": "metabrainz/botbot-web",
"path": "botbot/apps/bots/views.py",
"copies": "2",
"size": "3910",
"license": "mit",
"hash": -3975575106101674500,
"line_mean": 31.5833333333,
"line_max": 105,
"alpha_frac": 0.5997442455,
"autogenerated": false,
"ratio": 4.25,
"config_test": false,
"has... |
from django import http
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.conf import settings
from django.utils.translation import ugettext as _
from django.views import generic
from django.forms.models import model_to_dict
from oscar.apps.checkout.views import PaymentDetail... | {
"repo_name": "django-oscar/django-oscar-amazon-payments",
"path": "sandbox/apps/checkout/views.py",
"copies": "1",
"size": "5178",
"license": "bsd-3-clause",
"hash": -4160088637875726000,
"line_mean": 43.2564102564,
"line_max": 125,
"alpha_frac": 0.6645422943,
"autogenerated": false,
"ratio": 4.... |
from django import http
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.conf import settings
from django.utils.translation import ugettext as _
from oscar.apps.checkout.views import PaymentDetailsView as OscarPaymentDetailsView
from oscar.apps.payment.forms import BankcardF... | {
"repo_name": "django-oscar/django-oscar-datacash",
"path": "sandbox/apps/checkout/views.py",
"copies": "1",
"size": "3613",
"license": "bsd-3-clause",
"hash": -2969509264331994000,
"line_mean": 40.0568181818,
"line_max": 83,
"alpha_frac": 0.653750346,
"autogenerated": false,
"ratio": 4.157652474... |
from django import http
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.utils.translation import ugettext as _
from oscar.apps.checkout.views import PaymentDetailsView as OscarPaymentDetailsView
from oscar.apps.payment.models import SourceType, Source
from oscar.apps.paymen... | {
"repo_name": "django-oscar/django-oscar-sagepay-direct",
"path": "sandbox/apps/checkout/views.py",
"copies": "1",
"size": "4288",
"license": "bsd-3-clause",
"hash": 149329269133453950,
"line_mean": 43.6666666667,
"line_max": 83,
"alpha_frac": 0.635261194,
"autogenerated": false,
"ratio": 4.31822... |
from django import http
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from utils import bad_or_missing
from django.con... | {
"repo_name": "howiworkdaily/scofield-project",
"path": "scofield/cart/views.py",
"copies": "1",
"size": "2954",
"license": "bsd-3-clause",
"hash": -7129667671191113000,
"line_mean": 33.7529411765,
"line_max": 110,
"alpha_frac": 0.6046039269,
"autogenerated": false,
"ratio": 4.178217821782178,
... |
from django import http
from django.core.urlresolvers import reverse
from django.utils.dates import MONTHS
from django.views.generic import FormView
from django.views.generic import TemplateView
from django.views.generic import View
from . import forms, helpers, session_helpers, tasks, pdf
def format_circumstance(ci... | {
"repo_name": "lm-tools/situational",
"path": "situational/apps/quick_history/views.py",
"copies": "1",
"size": "6149",
"license": "bsd-3-clause",
"hash": 6232284542002669000,
"line_mean": 33.7401129944,
"line_max": 79,
"alpha_frac": 0.6461213205,
"autogenerated": false,
"ratio": 3.94672657252888... |
from django import http
from django.core.urlresolvers import reverse
from django.utils import unittest
from django_openstack import api
from django_openstack.tests.view_tests import base
from openstackx.api import exceptions as api_exceptions
from mox import IsA
class AuthViewTests(base.BaseViewTests):
def setUp(... | {
"repo_name": "tylesmit/openstack-dashboard",
"path": "django-openstack/django_openstack/tests/view_tests/auth_tests.py",
"copies": "2",
"size": "5277",
"license": "apache-2.0",
"hash": -5311442244832136000,
"line_mean": 34.6554054054,
"line_max": 78,
"alpha_frac": 0.5993935948,
"autogenerated": fa... |
from django import http
from django.core.urlresolvers import reverse
from mox import IsA
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from novaclient.v1_1 import flavors
class FlavorsTests(test.BaseAdminViewTests):
@test.create_stubs({api.nova: ('flavor_list', 'flavor_... | {
"repo_name": "99cloud/keystone_register",
"path": "openstack_dashboard/dashboards/admin/flavors/tests.py",
"copies": "1",
"size": "7071",
"license": "apache-2.0",
"hash": -4787621801669874000,
"line_mean": 43.753164557,
"line_max": 79,
"alpha_frac": 0.4808372225,
"autogenerated": false,
"ratio":... |
from django import http
from django.core.urlresolvers import reverse, reverse_lazy
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from django.views.generic import View, TemplateView
import logging
from openstack_dashboard.dashboards.project.access_and_securi... | {
"repo_name": "occ-data/tukey-portal",
"path": "tukey/dashboards/project/access_and_security/keypairs/views.py",
"copies": "3",
"size": "1409",
"license": "apache-2.0",
"hash": -4051389812380422000,
"line_mean": 31.0227272727,
"line_max": 87,
"alpha_frac": 0.7068843151,
"autogenerated": false,
"r... |
from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel, EasyChoice
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
class AlreadyRegistered(Exception):
pass
class NotRegistered(Exception):
pass
class Dat... | {
"repo_name": "diofeher/django-nfa",
"path": "django/contrib/databrowse/sites.py",
"copies": "5",
"size": "5660",
"license": "bsd-3-clause",
"hash": 890484228823463400,
"line_mean": 36.9865771812,
"line_max": 130,
"alpha_frac": 0.6367491166,
"autogenerated": false,
"ratio": 4.06901509705248,
"c... |
from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel, EasyChoice
from django.shortcuts import render_to_response
class AlreadyRegistered(Exception):
pass
class NotRegistered(Exception):
pass
class DatabrowsePlugin(object):
def urls(self, plug... | {
"repo_name": "jonaustin/advisoryscan",
"path": "django/django/contrib/databrowse/sites.py",
"copies": "1",
"size": "5602",
"license": "mit",
"hash": -1145850832116491900,
"line_mean": 36.8513513514,
"line_max": 118,
"alpha_frac": 0.6347732953,
"autogenerated": false,
"ratio": 4.0771470160116445,... |
from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.text import capfirst
from django.utils.encoding import force_unicode
from dja... | {
"repo_name": "andim27/magiccamp",
"path": "build/lib/django/contrib/databrowse/plugins/calendars.py",
"copies": "62",
"size": "4338",
"license": "bsd-3-clause",
"hash": -7506421735322400000,
"line_mean": 49.4418604651,
"line_max": 151,
"alpha_frac": 0.6422314431,
"autogenerated": false,
"ratio":... |
from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
class AlreadyRegistered(Exception):
pass
class NotRegistered(Exception):
pass
class DatabrowsePlugi... | {
"repo_name": "fredkingham/blog-of-fred",
"path": "django/contrib/databrowse/sites.py",
"copies": "84",
"size": "5376",
"license": "bsd-3-clause",
"hash": -1600583807171875300,
"line_mean": 36.075862069,
"line_max": 130,
"alpha_frac": 0.634858631,
"autogenerated": false,
"ratio": 4.07581501137225... |
from django import http
from django.db import models
from django_databrowse.datastructures import EasyModel
from django_databrowse.sites import DatabrowsePlugin
from django.shortcuts import render
from django.template import RequestContext
from django.utils.text import capfirst
from django.utils.encoding import force_t... | {
"repo_name": "Alir3z4/django-databrowse",
"path": "django_databrowse/plugins/calendars.py",
"copies": "1",
"size": "6035",
"license": "bsd-3-clause",
"hash": -3356060545908135400,
"line_mean": 36.4844720497,
"line_max": 78,
"alpha_frac": 0.5257663629,
"autogenerated": false,
"ratio": 4.351117519... |
from django import http
from django.db.models import Q
from django.db.transaction import non_atomic_requests
from django.shortcuts import render
from django.utils import translation
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.decorators.vary import va... | {
"repo_name": "andymckay/addons-server",
"path": "src/olympia/search/views.py",
"copies": "2",
"size": "23283",
"license": "bsd-3-clause",
"hash": -2857277754113466400,
"line_mean": 35.2663551402,
"line_max": 79,
"alpha_frac": 0.5681827943,
"autogenerated": false,
"ratio": 3.728859705317104,
"c... |
from django import http
from django.db.models import Q
from django.db.transaction import non_atomic_requests
from django.utils.encoding import force_bytes
from django.utils.translation import ugettext
from django.views.decorators.vary import vary_on_headers
import olympia.core.logger
from olympia import amo
from olymp... | {
"repo_name": "tsl143/addons-server",
"path": "src/olympia/search/views.py",
"copies": "1",
"size": "21634",
"license": "bsd-3-clause",
"hash": -6578879715371612000,
"line_mean": 33.9499192246,
"line_max": 79,
"alpha_frac": 0.5808449663,
"autogenerated": false,
"ratio": 3.6993844049247606,
"con... |
from django import http
from django.db.models import Q
from django.db.transaction import non_atomic_requests
from django.utils import translation
from django.utils.encoding import force_bytes
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
import commonware.l... | {
"repo_name": "Prashant-Surya/addons-server",
"path": "src/olympia/search/views.py",
"copies": "1",
"size": "23532",
"license": "bsd-3-clause",
"hash": -5681841143055274000,
"line_mean": 35.5403726708,
"line_max": 79,
"alpha_frac": 0.5709246983,
"autogenerated": false,
"ratio": 3.745940783190067,... |
from django import http
from django.db.models import Q
from django.db.transaction import non_atomic_requests
from django.utils.translation import ugettext
from django.views.decorators.vary import vary_on_headers
import six
import olympia.core.logger
from olympia import amo
from olympia.addons.models import Addon, Ca... | {
"repo_name": "wagnerand/olympia",
"path": "src/olympia/search/views.py",
"copies": "1",
"size": "19677",
"license": "bsd-3-clause",
"hash": 3571522334028931000,
"line_mean": 33.4605954466,
"line_max": 79,
"alpha_frac": 0.5756975149,
"autogenerated": false,
"ratio": 3.675196115054165,
"config_t... |
from django import http
from django.db.transaction import non_atomic_requests
from django.shortcuts import get_list_or_404, get_object_or_404, redirect
from django.utils.translation import ugettext
from django.utils.cache import patch_cache_control
from django.views.decorators.cache import cache_control
from django.vie... | {
"repo_name": "tsl143/addons-server",
"path": "src/olympia/addons/views.py",
"copies": "1",
"size": "33122",
"license": "bsd-3-clause",
"hash": 8572994712954131000,
"line_mean": 39.1966019417,
"line_max": 79,
"alpha_frac": 0.6462472073,
"autogenerated": false,
"ratio": 4.136113886113886,
"confi... |
from django import http
from django.db.transaction import non_atomic_requests
from django.shortcuts import get_object_or_404
import commonware.log
import mkt
from mkt.access import acl
from mkt.files.models import File
from mkt.site.decorators import allow_cross_site_request
from mkt.site.utils import get_file_respon... | {
"repo_name": "diox/zamboni",
"path": "mkt/downloads/views.py",
"copies": "5",
"size": "1986",
"license": "bsd-3-clause",
"hash": -1256871214479424300,
"line_mean": 38.72,
"line_max": 76,
"alpha_frac": 0.6495468278,
"autogenerated": false,
"ratio": 3.94831013916501,
"config_test": false,
"has... |
from django import http
from django.forms import ModelForm
from django.core.urlresolvers import reverse
import bleach
import commonware
import jingo
from funfactory.log import log_cef
from mobility.decorators import mobile_template
from session_csrf import anonymous_csrf
from make_mozilla.base import models
from dj... | {
"repo_name": "mozilla/make.mozilla.org",
"path": "make_mozilla/base/views/event.py",
"copies": "1",
"size": "1344",
"license": "bsd-3-clause",
"hash": -7246343870646824000,
"line_mean": 30.2558139535,
"line_max": 94,
"alpha_frac": 0.6994047619,
"autogenerated": false,
"ratio": 3.8073654390934846... |
from django import http
from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateView
from openid.consumer import consumer
from openid.consumer.discover import DiscoveryFailure
from openid.extensions import ax, pape, sreg
from openid.yadis.constants import YADIS_HEADER_NAME, YADIS_CON... | {
"repo_name": "necaris/python3-openid",
"path": "examples/djopenid/consumer/views.py",
"copies": "1",
"size": "8177",
"license": "apache-2.0",
"hash": 6900246959148215000,
"line_mean": 35.5044642857,
"line_max": 78,
"alpha_frac": 0.6276140394,
"autogenerated": false,
"ratio": 4.429577464788732,
... |
from django import http
from django import forms
from django.views.generic.base import View
from django.shortcuts import get_object_or_404
from models import FlowFile, FlowFileChunk
class FlowFileForm(forms.Form):
file = forms.FileField()
class UploadView(View):
def dispatch(self, request, *args, **kwargs):... | {
"repo_name": "thesgc/django-flowjs",
"path": "flowjs/views.py",
"copies": "1",
"size": "2431",
"license": "mit",
"hash": -1948054155732514600,
"line_mean": 38.2258064516,
"line_max": 105,
"alpha_frac": 0.6573426573,
"autogenerated": false,
"ratio": 4.085714285714285,
"config_test": false,
"h... |
from django import http
from django import template
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render_to_response
from django_nova_syspanel.models import get_nova_admin_connection
@login_required
def index(request):
nova = get_... | {
"repo_name": "sleepsonthefloor/openstack-dashboard",
"path": "django-nova-syspanel/src/django_nova_syspanel/views/vpns.py",
"copies": "1",
"size": "2011",
"license": "apache-2.0",
"hash": -2345798977837882400,
"line_mean": 32.5166666667,
"line_max": 71,
"alpha_frac": 0.717553456,
"autogenerated": ... |
from django import http
from django import template
from django.conf import settings
from django.template.response import SimpleTemplateResponse
from django.views.generic.base import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
##
#
# Error Handler Views
#
##
class Error404(TemplateV... | {
"repo_name": "minism/seeds",
"path": "heroku/mainsite/views.py",
"copies": "1",
"size": "1302",
"license": "bsd-2-clause",
"hash": 7365084550380888000,
"line_mean": 31.55,
"line_max": 138,
"alpha_frac": 0.7196620584,
"autogenerated": false,
"ratio": 3.8982035928143715,
"config_test": false,
... |
from django import http
from django import template
from django.template import loader
from common import api
from common import display
from common import util
from common import views as common_views
def invite_email(request, code):
"""User has received the invite email, and has followed the link to accept or
... | {
"repo_name": "AloneRoad/Inforlearn",
"path": "invite/views.py",
"copies": "1",
"size": "2064",
"license": "apache-2.0",
"hash": 4704549767206939000,
"line_mean": 33.4,
"line_max": 79,
"alpha_frac": 0.6623062016,
"autogenerated": false,
"ratio": 3.8435754189944134,
"config_test": false,
"has_... |
from django import http
from django import template
from django.template import loader
from common import api
def badge_badge(request, format, nick):
view = api.actor_get(request.user, nick)
presence = api.presence_get(request.user, view.nick)
if not presence:
# look offline please
line = 'Offline'
... | {
"repo_name": "AloneRoad/Inforlearn",
"path": "badge/views.py",
"copies": "1",
"size": "1517",
"license": "apache-2.0",
"hash": 7880214703968010000,
"line_mean": 30.6041666667,
"line_max": 69,
"alpha_frac": 0.6486486486,
"autogenerated": false,
"ratio": 3.536130536130536,
"config_test": false,
... |
from django import http
from django import template
from django.template import loader
from common import api, util
from common.display import prep_entry_list, prep_stream_dict
from common.views import handle_view_action
from common.slimmer import html_slimmer
ENTRIES_PER_PAGE = 20
def explore_recent(request, format=... | {
"repo_name": "AloneRoad/Inforlearn",
"path": "explore/views.py",
"copies": "1",
"size": "2390",
"license": "apache-2.0",
"hash": 7929924714198761000,
"line_mean": 35.2121212121,
"line_max": 80,
"alpha_frac": 0.659832636,
"autogenerated": false,
"ratio": 3.621212121212121,
"config_test": false,... |
from django import http
from django import test
from django.apps import apps
from .forms import TestForm
from .models import TestModel
class LinkedDataFormTest(test.TestCase): # noqa
"""Linked data form test."""
def setUp(self):
super(LinkedDataFormTest, self).setUp()
User = apps.get_model(... | {
"repo_name": "luzfcb/django-autocomplete-light",
"path": "test_project/rename_forward/test_forms.py",
"copies": "2",
"size": "1706",
"license": "mit",
"hash": -625119596772516700,
"line_mean": 32.4509803922,
"line_max": 77,
"alpha_frac": 0.6166471278,
"autogenerated": false,
"ratio": 4.071599045... |
from django import http
from django.shortcuts import get_object_or_404
from django.utils.functional import cached_property
from django.core.exceptions import ImproperlyConfigured
from django.views.generic import ListView, CreateView, DetailView, UpdateView
from django.contrib.auth.mixins import UserPassesTestMixin
fro... | {
"repo_name": "dakrauth/django-markdown-page",
"path": "mdpage/views.py",
"copies": "1",
"size": "6495",
"license": "mit",
"hash": -1055613409489235700,
"line_mean": 27.3624454148,
"line_max": 93,
"alpha_frac": 0.6230946882,
"autogenerated": false,
"ratio": 3.941140776699029,
"config_test": fal... |
from django import http
from django.shortcuts import get_object_or_404
from rest_framework.renderers import JSONRenderer
from . import serializers, stats as statistics
from ..decorators import jsonp
from ..models import Name, Location
from ..utils import filter_names
class JSONResponse(http.HttpResponse):
"""HTT... | {
"repo_name": "damonkelley/django-name",
"path": "name/api/views.py",
"copies": "2",
"size": "2076",
"license": "bsd-3-clause",
"hash": -8932645096177113000,
"line_mean": 29.5294117647,
"line_max": 77,
"alpha_frac": 0.6979768786,
"autogenerated": false,
"ratio": 4.202429149797571,
"config_test"... |
from django import http
from django.shortcuts import get_object_or_404
import commonware.log
import amo
from access import acl
from amo.utils import HttpResponseSendFile
from files.models import File
from mkt.webapps.models import Webapp
log = commonware.log.getLogger('z.downloads')
def download_file(request, file... | {
"repo_name": "robhudson/zamboni",
"path": "mkt/downloads/views.py",
"copies": "5",
"size": "1342",
"license": "bsd-3-clause",
"hash": -865827683980715100,
"line_mean": 34.3157894737,
"line_max": 78,
"alpha_frac": 0.6535022355,
"autogenerated": false,
"ratio": 3.834285714285714,
"config_test": ... |
from django import http
from django.shortcuts import get_object_or_404
import commonware.log
import amo
from amo.decorators import allow_cross_site_request
from amo.utils import HttpResponseSendFile
from mkt.access import acl
from mkt.files.models import File
from mkt.webapps.models import Webapp
log = commonware.l... | {
"repo_name": "andymckay/zamboni",
"path": "mkt/downloads/views.py",
"copies": "1",
"size": "1429",
"license": "bsd-3-clause",
"hash": 6713953588271966000,
"line_mean": 33.8536585366,
"line_max": 78,
"alpha_frac": 0.6634009797,
"autogenerated": false,
"ratio": 3.800531914893617,
"config_test": ... |
from django import http
from django.shortcuts import get_object_or_404
import commonware.log
import amo
from amo.utils import HttpResponseSendFile
from mkt.access import acl
from mkt.files.models import File
from mkt.site.decorators import allow_cross_site_request
from mkt.webapps.models import Webapp
log = commonw... | {
"repo_name": "ngokevin/zamboni",
"path": "mkt/downloads/views.py",
"copies": "1",
"size": "1434",
"license": "bsd-3-clause",
"hash": -5565101115594177000,
"line_mean": 33.9756097561,
"line_max": 78,
"alpha_frac": 0.6638772664,
"autogenerated": false,
"ratio": 3.7936507936507935,
"config_test":... |
from django import http
from django.shortcuts import get_object_or_404
import commonware.log
import mkt
from mkt.access import acl
from mkt.files.models import File
from mkt.site.decorators import allow_cross_site_request
from mkt.site.utils import HttpResponseSendFile
from mkt.webapps.models import Webapp
log = co... | {
"repo_name": "kumar303/zamboni",
"path": "mkt/downloads/views.py",
"copies": "4",
"size": "1439",
"license": "bsd-3-clause",
"hash": -941051657158158300,
"line_mean": 34.0975609756,
"line_max": 78,
"alpha_frac": 0.6643502432,
"autogenerated": false,
"ratio": 3.7769028871391077,
"config_test": ... |
from django import http
from django.shortcuts import get_object_or_404, redirect
from django.template import Context, loader
import commonware.log
import jingo
from tower import ugettext as _
from mobility.decorators import mobile_template
from amo import messages
from amo.decorators import json_view, login_required,... | {
"repo_name": "jbalogh/zamboni",
"path": "apps/reviews/views.py",
"copies": "1",
"size": "9798",
"license": "bsd-3-clause",
"hash": -2671772398479286300,
"line_mean": 37.1245136187,
"line_max": 77,
"alpha_frac": 0.6068585426,
"autogenerated": false,
"ratio": 3.7169954476479514,
"config_test": f... |
from django import http
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.aut... | {
"repo_name": "artminster/artminster",
"path": "core/apps/profile/viewsold/main.py",
"copies": "1",
"size": "1718",
"license": "mit",
"hash": -4172228621421265400,
"line_mean": 30.2545454545,
"line_max": 106,
"alpha_frac": 0.7083818393,
"autogenerated": false,
"ratio": 3.931350114416476,
"confi... |
from django import http
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from utils import bad_or_missing
from product.models import *
def home(request, template_name="home_page.html"):
"""
Home page featured products
"""
product = Product.... | {
"repo_name": "howiworkdaily/scofield-project",
"path": "scofield/product/views.py",
"copies": "1",
"size": "1218",
"license": "bsd-3-clause",
"hash": -7766626481040639000,
"line_mean": 31.0526315789,
"line_max": 103,
"alpha_frac": 0.6912972085,
"autogenerated": false,
"ratio": 4.087248322147651,... |
from django import http
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib import messages
from django.core.urlresolvers import reverse
from airmozilla.base.utils import paginate, delete_s3_keys_by_urls
from airmozilla.main.models import Event
from airmozilla.uploads.models import Upl... | {
"repo_name": "mozilla/airmozilla",
"path": "airmozilla/manage/views/uploads.py",
"copies": "2",
"size": "1741",
"license": "bsd-3-clause",
"hash": 6731341450854326000,
"line_mean": 31.8490566038,
"line_max": 70,
"alpha_frac": 0.6191843768,
"autogenerated": false,
"ratio": 4.086854460093897,
"c... |
from django import http
from django.shortcuts import render
import bleach
import commonware
from mobility.decorators import mobile_template
from session_csrf import anonymous_csrf
from portfolio.models import Image
log = commonware.log.getLogger('playdoh')
@mobile_template('landings/{mobile/}home.html')
def home(r... | {
"repo_name": "tgavankar/unifolio",
"path": "apps/landings/views.py",
"copies": "1",
"size": "1084",
"license": "bsd-3-clause",
"hash": 1037404828523525200,
"line_mean": 26.7948717949,
"line_max": 93,
"alpha_frac": 0.6789667897,
"autogenerated": false,
"ratio": 3.601328903654485,
"config_test":... |
from django import http
from django.shortcuts import render
def handler500(request):
if getattr(request, '_json_view', False):
# Every view with the `utils.json_view` decorator sets,
# on the request object, that it wants to eventually return
# a JSON output. Let's re-use that fact here.
... | {
"repo_name": "m8ttyB/socorro",
"path": "webapp-django/crashstats/base/views.py",
"copies": "4",
"size": "1125",
"license": "mpl-2.0",
"hash": 52305471581486536,
"line_mean": 36.5,
"line_max": 67,
"alpha_frac": 0.6168888889,
"autogenerated": false,
"ratio": 4.076086956521739,
"config_test": fal... |
from django import http
from django.shortcuts import render, redirect
from django.template import (loader, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
from django.core.urlresolvers import reverse
from lib.templatetags.base_extras import set_notification
import smtplib
from datetim... | {
"repo_name": "tph-thuering/vnetsource",
"path": "lib/views/error_views.py",
"copies": "2",
"size": "3043",
"license": "mpl-2.0",
"hash": -9132602139009143000,
"line_mean": 35.2380952381,
"line_max": 189,
"alpha_frac": 0.6043378245,
"autogenerated": false,
"ratio": 3.8228643216080402,
"config_t... |
from django import http
from django.shortcuts import render_to_response
from django.conf import settings
import datetime, re
def cache_status(request):
try:
import memcache
except ImportError:
raise http.Http404
if not (request.user.is_authenticated() and
request.user.is_staff... | {
"repo_name": "django-de/django-de-v2",
"path": "django_de/utils.py",
"copies": "1",
"size": "1382",
"license": "bsd-3-clause",
"hash": 8647339335967105000,
"line_mean": 23.6785714286,
"line_max": 62,
"alpha_frac": 0.5600578871,
"autogenerated": false,
"ratio": 4.137724550898204,
"config_test":... |
from django import http
from django.shortcuts import render_to_response
from django.template import Context, RequestContext
from django.template.loader import get_template
from django.utils.translation import ugettext as _
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import cs... | {
"repo_name": "jordotech/sherri_satchmo",
"path": "satchmo/apps/payment/modules/google/views.py",
"copies": "6",
"size": "5325",
"license": "bsd-3-clause",
"hash": -5734240851375439000,
"line_mean": 32.7025316456,
"line_max": 122,
"alpha_frac": 0.676056338,
"autogenerated": false,
"ratio": 3.8447... |
from django import http
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.contrib import messages
from django.conf import settings
from django.contrib.auth.decorators impo... | {
"repo_name": "p2pu/mechanical-mooc",
"path": "mail/views.py",
"copies": "1",
"size": "5883",
"license": "mit",
"hash": -5569260705193793000,
"line_mean": 29.481865285,
"line_max": 151,
"alpha_frac": 0.6330103689,
"autogenerated": false,
"ratio": 3.6722846441947565,
"config_test": false,
"has... |
from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils.encoding import force_text
from django.views.decorators.csrf import requires_csrf_token
ERROR_404_TEMPLATE_NAME = '404.html'
ERROR_403_TEMPLATE_NAME = '403.html'
ERROR_400_TEMPLATE_NAME = '400.html'
ERRO... | {
"repo_name": "bak1an/django",
"path": "django/views/defaults.py",
"copies": "9",
"size": "4241",
"license": "bsd-3-clause",
"hash": -2853425006459455000,
"line_mean": 34.9406779661,
"line_max": 100,
"alpha_frac": 0.6687102099,
"autogenerated": false,
"ratio": 4.149706457925636,
"config_test": ... |
from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils import six
from django.utils.encoding import force_text
from django.utils.http import urlquote
from django.views.decorators.csrf import requires_csrf_token
ERROR_404_TEMPLATE_NAME = '404.html'
ERROR_403_... | {
"repo_name": "kawamon/hue",
"path": "desktop/core/ext-py/Django-1.11.29/django/views/defaults.py",
"copies": "4",
"size": "4379",
"license": "apache-2.0",
"hash": 1110758295506685800,
"line_mean": 35.1900826446,
"line_max": 100,
"alpha_frac": 0.6722996118,
"autogenerated": false,
"ratio": 4.1546... |
from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils import six
from django.utils.encoding import force_text
from django.views.decorators.csrf import requires_csrf_token
ERROR_404_TEMPLATE_NAME = '404.html'
ERROR_403_TEMPLATE_NAME = '403.html'
ERROR_400_TE... | {
"repo_name": "daniponi/django",
"path": "django/views/defaults.py",
"copies": "20",
"size": "4280",
"license": "bsd-3-clause",
"hash": -221396775577702430,
"line_mean": 34.9663865546,
"line_max": 100,
"alpha_frac": 0.6700934579,
"autogenerated": false,
"ratio": 4.143272023233301,
"config_test"... |
from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requires_csrf_token in case the template needs
# {% csrf_token %}.
@re... | {
"repo_name": "mattrobenolt/django",
"path": "django/views/defaults.py",
"copies": "106",
"size": "2752",
"license": "bsd-3-clause",
"hash": 3238553743147671000,
"line_mean": 32.975308642,
"line_max": 100,
"alpha_frac": 0.6842296512,
"autogenerated": false,
"ratio": 4.083086053412463,
"config_t... |
from django import http
from django.template import (Context, RequestContext,
loader, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requires_csrf_token in case the... | {
"repo_name": "adrianholovaty/django",
"path": "django/views/defaults.py",
"copies": "95",
"size": "2430",
"license": "bsd-3-clause",
"hash": 5991564114041314000,
"line_mean": 35.8181818182,
"line_max": 103,
"alpha_frac": 0.7086419753,
"autogenerated": false,
"ratio": 4.077181208053691,
"config... |
from django import http
from django.template import (Context, RequestContext,
loader, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requires_csrf_token in case the ... | {
"repo_name": "vsajip/django",
"path": "django/views/defaults.py",
"copies": "1",
"size": "2458",
"license": "bsd-3-clause",
"hash": -1387609389575522300,
"line_mean": 37.40625,
"line_max": 103,
"alpha_frac": 0.7103336046,
"autogenerated": false,
"ratio": 4.083056478405315,
"config_test": false... |
from django import http
from django.template import (Context, RequestContext,
loader, Template, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requires_csrf_token i... | {
"repo_name": "benjaminrigaud/django",
"path": "django/views/defaults.py",
"copies": "46",
"size": "2760",
"license": "bsd-3-clause",
"hash": 5232850896026589000,
"line_mean": 33.5,
"line_max": 100,
"alpha_frac": 0.6811594203,
"autogenerated": false,
"ratio": 4.137931034482759,
"config_test": f... |
from django import http
from django.template import loader, Context, Engine, TemplateDoesNotExist
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requires_csrf_token in case the template needs
# {% csrf_token %}.
@re... | {
"repo_name": "Sonicbids/django",
"path": "django/views/defaults.py",
"copies": "4",
"size": "2752",
"license": "bsd-3-clause",
"hash": -412832972707844160,
"line_mean": 32.975308642,
"line_max": 100,
"alpha_frac": 0.6842296512,
"autogenerated": false,
"ratio": 4.083086053412463,
"config_test":... |
from django import http
from django.template import loader
from django.template import RequestContext
from django.template import TemplateDoesNotExist
from django.views.decorators.csrf import requires_csrf_token
@requires_csrf_token
def server_error(request, template_name='500.html'):
"""
500 error handler.
... | {
"repo_name": "arthuralvim/django-project-template",
"path": "{{ cookiecutter.repo_name }}/{{ cookiecutter.repo_name }}/errors.py",
"copies": "1",
"size": "1175",
"license": "mit",
"hash": -2853958667036887000,
"line_mean": 30.7567567568,
"line_max": 74,
"alpha_frac": 0.6638297872,
"autogenerated":... |
from django import http
from django.template import loader
from regulations.generator import api_reader
from regulations.generator.sidebar.help import Help as HelpSidebar
from regulations.generator.layers.utils import convert_to_python
from regulations.views.sidebar import SideBarView
class MissingContentException(E... | {
"repo_name": "18F/regulations-site",
"path": "regulations/views/error_handling.py",
"copies": "2",
"size": "3153",
"license": "cc0-1.0",
"hash": -7686887370454232000,
"line_mean": 30.2178217822,
"line_max": 79,
"alpha_frac": 0.6774500476,
"autogenerated": false,
"ratio": 3.902227722772277,
"co... |
from django import http
from django.template import RequestContext, loader
from django.http import HttpResponse
from django.conf import settings
from django.http import Http404
from what_apps.meta.alerts import local_red_alert
class ServerErrorMiddleware(object):
def get_most_recent_line_in_traceback_from_what_co... | {
"repo_name": "SlashRoot/WHAT",
"path": "what_apps/meta/errors.py",
"copies": "1",
"size": "2616",
"license": "mit",
"hash": -1708390445757671000,
"line_mean": 45.7321428571,
"line_max": 154,
"alpha_frac": 0.6456422018,
"autogenerated": false,
"ratio": 4.093896713615023,
"config_test": false,
... |
from django import http
from django.template import RequestContext, loader
from regulations.generator import api_reader
from regulations.generator.layers.utils import convert_to_python
from regulations.views import utils
class MissingContentException(Exception):
""" This is essentially a generic 404. """
def... | {
"repo_name": "grapesmoker/regulations-site",
"path": "regulations/views/error_handling.py",
"copies": "2",
"size": "2765",
"license": "cc0-1.0",
"hash": 4600699923900803000,
"line_mean": 26.9292929293,
"line_max": 79,
"alpha_frac": 0.6661844485,
"autogenerated": false,
"ratio": 3.927556818181818... |
from django import http
from django.template import RequestContext, loader
from regulations.generator import api_reader
from regulations.generator.sidebar.help import Help as HelpSidebar
from regulations.generator.layers.utils import convert_to_python
from regulations.views.sidebar import SideBarView
class MissingCo... | {
"repo_name": "tadhg-ohiggins/regulations-site",
"path": "regulations/views/error_handling.py",
"copies": "2",
"size": "3244",
"license": "cc0-1.0",
"hash": 6950147853882333000,
"line_mean": 30.1923076923,
"line_max": 79,
"alpha_frac": 0.6757090012,
"autogenerated": false,
"ratio": 3.960927960927... |
from django import http
from django.template import RequestContext
from django.template import loader
from django.utils.translation import ugettext as _
ccInfo = (
# type, prefix, length
( 'VISA', '4', 16),
( 'VISA', '4', 13),
( 'UKE', '417500', 16),
( 'UKE', '4917', 16),
( 'UKE', '4913', 16),... | {
"repo_name": "Ryati/satchmo",
"path": "satchmo/apps/satchmo_utils/views.py",
"copies": "5",
"size": "3746",
"license": "bsd-3-clause",
"hash": 2809626896206854700,
"line_mean": 30.2166666667,
"line_max": 80,
"alpha_frac": 0.5090763481,
"autogenerated": false,
"ratio": 3.2320966350301985,
"conf... |
from django import http
from django.template.loader import get_template
from django.template import RequestContext
import ho.pisa as pisa
import cStringIO as StringIO
import cgi
import os
from os.path import dirname, abspath
MONTHS = {
1: 'Jan',
2: 'Feb',
3: 'Mac',
4: 'Apr',
5: 'Mei',
6: 'Jun'... | {
"repo_name": "k4ml/jazzpos",
"path": "xpos/utils.py",
"copies": "1",
"size": "1312",
"license": "mit",
"hash": 2179826224593671200,
"line_mean": 24.7254901961,
"line_max": 64,
"alpha_frac": 0.6326219512,
"autogenerated": false,
"ratio": 3.3989637305699483,
"config_test": false,
"has_no_keywo... |
from django import http
from django.template.response import TemplateResponse
from django.utils.functional import update_wrapper
from django.utils.decorators import classonlymethod
class BaseView(object):
""" Intentionally simple parent class for all views. Only implements
dispatch-by-method and simple sanity... | {
"repo_name": "caoimhghin/django-blobstore-images",
"path": "sample/extensions/views.py",
"copies": "1",
"size": "2677",
"license": "mit",
"hash": -8259458467751946000,
"line_mean": 40.1846153846,
"line_max": 104,
"alpha_frac": 0.6354127755,
"autogenerated": false,
"ratio": 4.374183006535947,
"... |
from django import http
from django.template.response import TemplateResponse
from functools import update_wrapper
from django.utils.decorators import classonlymethod
class BaseView(object):
""" Intentionally simple parent class for all views. Only implements
dispatch-by-method and simple sanity checking.
... | {
"repo_name": "drexly/tonginBlobStore",
"path": "dosirak/baseView.py",
"copies": "1",
"size": "2663",
"license": "bsd-3-clause",
"hash": 8428067486605549000,
"line_mean": 39.9692307692,
"line_max": 104,
"alpha_frac": 0.6342470897,
"autogenerated": false,
"ratio": 4.379934210526316,
"config_test... |
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import defau... | {
"repo_name": "Belgabor/django",
"path": "django/contrib/messages/tests/base.py",
"copies": "21",
"size": "16195",
"license": "bsd-3-clause",
"hash": 317732043325670600,
"line_mean": 39.2860696517,
"line_max": 79,
"alpha_frac": 0.6120407533,
"autogenerated": false,
"ratio": 4.402011416145692,
"... |
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from dja... | {
"repo_name": "disqus/django-old",
"path": "django/contrib/messages/tests/base.py",
"copies": "1",
"size": "15640",
"license": "bsd-3-clause",
"hash": 1500412073857644000,
"line_mean": 38.6954314721,
"line_max": 89,
"alpha_frac": 0.6117647059,
"autogenerated": false,
"ratio": 4.395727937043283,
... |
from django import http
from django.urls import reverse
from django.template import loader
from django.contrib import messages
from django.utils import timezone
from django.views.generic import TemplateView
from django.views.generic.edit import FormMixin
from django.shortcuts import get_object_or_404
from django.utils.... | {
"repo_name": "dakrauth/picker",
"path": "picker/views/base.py",
"copies": "1",
"size": "3316",
"license": "mit",
"hash": -1063654611977434000,
"line_mean": 31.1941747573,
"line_max": 84,
"alpha_frac": 0.6432448733,
"autogenerated": false,
"ratio": 4.181588902900378,
"config_test": false,
"ha... |
from django import http
from django.urls import reverse
from django.utils.http import unquote
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class AngularUrlMiddleware(MiddlewareMixin):
"""
If the request path is <ANGULAR_REVERSE> it should be re... | {
"repo_name": "jrief/django-angular",
"path": "djng/middleware.py",
"copies": "1",
"size": "3154",
"license": "mit",
"hash": -5021813628907892000,
"line_mean": 46.0746268657,
"line_max": 116,
"alpha_frac": 0.6420418516,
"autogenerated": false,
"ratio": 4.227882037533512,
"config_test": false,
... |
from django import http
from django.utils.deprecation import MiddlewareMixin
from wagtail.core.models import Site
try:
from django.conf import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS
XS_SHARING_ALLOWED_HE... | {
"repo_name": "ropable/oim-cms",
"path": "oim_cms/middleware.py",
"copies": "2",
"size": "2264",
"license": "apache-2.0",
"hash": -2664544130976958500,
"line_mean": 39.4285714286,
"line_max": 91,
"alpha_frac": 0.6903710247,
"autogenerated": false,
"ratio": 3.7733333333333334,
"config_test": fal... |
from django import http
from django.utils.http import is_safe_url
def set_theme(request):
"""
Redirect to a given url while setting the chosen theme in the session or cookie. The url and the theme identifier
need to be specified in the request parameters.
Since this view changes how the user will see... | {
"repo_name": "timorieber/django-bootstrap-ui",
"path": "bootstrap_ui/views.py",
"copies": "1",
"size": "1155",
"license": "isc",
"hash": 3457620245990193000,
"line_mean": 34,
"line_max": 118,
"alpha_frac": 0.6502164502,
"autogenerated": false,
"ratio": 4.010416666666667,
"config_test": false,
... |
from django import http
from django.utils.http import urlencode
class TransformError(Exception):
pass
def reverse_resolver(url, *args, **kwargs):
"""Treats given url as url-pattern name and tries to revese it"""
from django.core.urlresolvers import reverse, NoReverseMatch
try:
return reverse... | {
"repo_name": "daevaorn/django-legacy",
"path": "legacy/__init__.py",
"copies": "1",
"size": "3103",
"license": "bsd-3-clause",
"hash": -6426375651170664000,
"line_mean": 28.5523809524,
"line_max": 85,
"alpha_frac": 0.5562359007,
"autogenerated": false,
"ratio": 4.3765867418899855,
"config_test... |
from django import http
from django.utils.http import urlquote
from django.core import urlresolvers
from django.conf import settings
class AppendOrRemoveSlashMiddleware(object):
"""Like django's built in APPEND_SLASH functionality, but also works in reverse. Eg
will remove the slash if a slash-appended url wo... | {
"repo_name": "unt-libraries/catalog-api",
"path": "django/sierra/sierra/middleware.py",
"copies": "1",
"size": "3027",
"license": "bsd-3-clause",
"hash": -8335651055143515000,
"line_mean": 39.9189189189,
"line_max": 111,
"alpha_frac": 0.6257020152,
"autogenerated": false,
"ratio": 4.275423728813... |
from django import http
from django.utils import simplejson as json
from django.views.decorators.http import require_http_methods
from django.contrib.auth.decorators import login_required
from account.models import EmailAddress
from kaleo.forms import InviteForm
from kaleo.models import JoinInvitation
@login_requir... | {
"repo_name": "justhamade/kaleo",
"path": "kaleo/views.py",
"copies": "1",
"size": "1341",
"license": "bsd-3-clause",
"hash": 1222479303234237700,
"line_mean": 42.2580645161,
"line_max": 123,
"alpha_frac": 0.6592095451,
"autogenerated": false,
"ratio": 3.842406876790831,
"config_test": false,
... |
from django import http
from django.utils import simplejson as json
from django.views.decorators.http import require_http_methods
from django.contrib.auth.decorators import login_required
from emailconfirmation.models import EmailAddress
from kaleo.forms import InviteForm
from kaleo.models import JoinInvitation
@l... | {
"repo_name": "amitagrawal/kaleo",
"path": "kaleo/views.py",
"copies": "1",
"size": "1352",
"license": "bsd-3-clause",
"hash": -8518006643679009000,
"line_mean": 41.25,
"line_max": 123,
"alpha_frac": 0.6612426036,
"autogenerated": false,
"ratio": 3.8518518518518516,
"config_test": false,
"has... |
from django import http
from django.utils import simplejson
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import render_to_string
f... | {
"repo_name": "spreeker/democracygame",
"path": "thirdparty/ajax/views.py",
"copies": "1",
"size": "3241",
"license": "bsd-3-clause",
"hash": -5421248520366183000,
"line_mean": 33.4787234043,
"line_max": 101,
"alpha_frac": 0.6815797593,
"autogenerated": false,
"ratio": 4.139208173690933,
"confi... |
from django import http
from django.utils.six.moves.urllib.parse import urlparse
from wagtail.wagtailredirects import models
# Originally pinched from: https://github.com/django/django/blob/master/django/contrib/redirects/middleware.py
class RedirectMiddleware(object):
def process_response(self, request, respons... | {
"repo_name": "Klaudit/wagtail",
"path": "wagtail/wagtailredirects/middleware.py",
"copies": "10",
"size": "1356",
"license": "bsd-3-clause",
"hash": -3460590800778530000,
"line_mean": 36.6666666667,
"line_max": 110,
"alpha_frac": 0.657079646,
"autogenerated": false,
"ratio": 4.490066225165563,
... |
from django import http
from django.utils.translation import check_for_language, activate, to_locale, get_language
from django.utils.text import javascript_quote
from django.conf import settings
import os
import gettext as gettext_module
def set_language(request):
"""
Redirect to a given url while setting the ... | {
"repo_name": "jonaustin/advisoryscan",
"path": "django/django/views/i18n.py",
"copies": "1",
"size": "6029",
"license": "mit",
"hash": -3580559942172140000,
"line_mean": 34.0523255814,
"line_max": 124,
"alpha_frac": 0.6065682534,
"autogenerated": false,
"ratio": 3.728509585652443,
"config_test... |
from django import http
from django.utils.translation import ugettext as _
from olympia.amo.helpers import absolutify, page_name
from olympia.amo.urlresolvers import reverse
from olympia.amo.feeds import NonAtomicFeed
from olympia.access import acl
from olympia.addons.models import Addon
from olympia.browse.feeds impo... | {
"repo_name": "andymckay/olympia",
"path": "src/olympia/bandwagon/feeds.py",
"copies": "6",
"size": "2330",
"license": "bsd-3-clause",
"hash": 2638217459274651000,
"line_mean": 28.125,
"line_max": 77,
"alpha_frac": 0.6463519313,
"autogenerated": false,
"ratio": 3.6692913385826773,
"config_test"... |
from django import http
from django.utils.translation import ugettext
from olympia.access import acl
from olympia.addons.models import Addon
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.templatetags.jinja_helpers import absolutify, page_name
from olympia.amo.urlresolvers import reverse
from olympia.bro... | {
"repo_name": "harry-7/addons-server",
"path": "src/olympia/bandwagon/feeds.py",
"copies": "1",
"size": "2373",
"license": "bsd-3-clause",
"hash": -2738299908364471000,
"line_mean": 28.2962962963,
"line_max": 73,
"alpha_frac": 0.6510745891,
"autogenerated": false,
"ratio": 3.6905132192846035,
"... |
from django import http
from django.utils.translation import ugettext
from olympia.amo.helpers import absolutify, page_name
from olympia.amo.urlresolvers import reverse
from olympia.amo.feeds import NonAtomicFeed
from olympia.access import acl
from olympia.addons.models import Addon
from olympia.browse.feeds import Ad... | {
"repo_name": "harikishen/addons-server",
"path": "src/olympia/bandwagon/feeds.py",
"copies": "1",
"size": "2354",
"license": "bsd-3-clause",
"hash": 3803485850151679500,
"line_mean": 28.0617283951,
"line_max": 73,
"alpha_frac": 0.6491079014,
"autogenerated": false,
"ratio": 3.689655172413793,
... |
from django import http
from django.utils.translation import ugettext
from olympia.amo.templatetags.jinja_helpers import absolutify, page_name
from olympia.amo.urlresolvers import reverse
from olympia.amo.feeds import NonAtomicFeed
from olympia.access import acl
from olympia.addons.models import Addon
from olympia.bro... | {
"repo_name": "tsl143/addons-server",
"path": "src/olympia/bandwagon/feeds.py",
"copies": "1",
"size": "2373",
"license": "bsd-3-clause",
"hash": -6088551820915025000,
"line_mean": 28.2962962963,
"line_max": 73,
"alpha_frac": 0.6510745891,
"autogenerated": false,
"ratio": 3.6905132192846035,
"c... |
from django import http
from django.views.decorators.csrf import csrf_exempt
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
from django.core.urlresolvers import reverse
from mailgun import utils
from signup import models as signup_model
fr... | {
"repo_name": "p2pu/mechanical-mooc",
"path": "unsubscribe/views.py",
"copies": "1",
"size": "1671",
"license": "mit",
"hash": -2824000167195007000,
"line_mean": 37.8604651163,
"line_max": 114,
"alpha_frac": 0.7049670856,
"autogenerated": false,
"ratio": 4.306701030927835,
"config_test": false,... |
from django import http
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.utils.cache import add_never_cache_headers
from django.utils.translation import ugettext_lazy as _
from hyperadmin.links import Link
class ConditionalAccessMixin(object):
... | {
"repo_name": "webcube/django-hyperadmin",
"path": "hyperadmin/views.py",
"copies": "1",
"size": "5021",
"license": "bsd-3-clause",
"hash": 3808357048404985000,
"line_mean": 35.6496350365,
"line_max": 103,
"alpha_frac": 0.609639514,
"autogenerated": false,
"ratio": 4.467081850533808,
"config_te... |
from django import http
from django.views.decorators.http import etag
import commonware.log
import mkt
from mkt.constants import MANIFEST_CONTENT_TYPE
from mkt.site.decorators import allow_cross_site_request
from mkt.webapps.models import Webapp
log = commonware.log.getLogger('z.detail')
@allow_cross_site_request... | {
"repo_name": "luckylavish/zamboni",
"path": "mkt/detail/views.py",
"copies": "15",
"size": "1595",
"license": "bsd-3-clause",
"hash": -8747276809630969000,
"line_mean": 30.2745098039,
"line_max": 77,
"alpha_frac": 0.6476489028,
"autogenerated": false,
"ratio": 3.909313725490196,
"config_test":... |
from django import http
from django.views.generic.base import TemplateView
from django.core.exceptions import PermissionDenied
from common.pagination import KLPPaginationSerializer
from rest_framework import generics
from rest_framework import viewsets
from rest_framework.views import APIView
from rest_framework.respon... | {
"repo_name": "klpdotorg/dubdubdub",
"path": "apps/common/views.py",
"copies": "1",
"size": "2072",
"license": "mit",
"hash": -530994456930164540,
"line_mean": 28.6,
"line_max": 121,
"alpha_frac": 0.6742277992,
"autogenerated": false,
"ratio": 3.9391634980988592,
"config_test": false,
"has_no... |
from django import http
from django.views.generic.base import View
from skrill.models import PaymentRequest, StatusReport
class StatusReportView(View):
def post(self, request, *args, **kwargs):
payment_request = PaymentRequest.objects.get(pk=request.POST['transaction_id'])
report = StatusReport()... | {
"repo_name": "byteweaver/django-skrill",
"path": "skrill/views.py",
"copies": "1",
"size": "1731",
"license": "bsd-3-clause",
"hash": -1467092703406649300,
"line_mean": 45.7837837838,
"line_max": 87,
"alpha_frac": 0.6597342577,
"autogenerated": false,
"ratio": 3.6365546218487395,
"config_test"... |
from django import http
from django.views.generic.detail import SingleObjectMixin
from . import manager
class PreviewableObject(SingleObjectMixin):
"""
View that can get an unpublished version of an
object
"""
def get_object(self, queryset=None):
"""
Returns the object the view i... | {
"repo_name": "ff0000/scarlet",
"path": "scarlet/versioning/view_mixins.py",
"copies": "1",
"size": "2172",
"license": "mit",
"hash": -1816658331244237000,
"line_mean": 32.9375,
"line_max": 77,
"alpha_frac": 0.5253222836,
"autogenerated": false,
"ratio": 4.711496746203904,
"config_test": false,... |
from django import http
from django.views.generic.edit import ModelFormMixin
from django.views.generic.detail import SingleObjectMixin
from django import forms
from django.forms import models as model_forms
from django.contrib.admin.utils import flatten_fieldsets
from django.db.models.fields import FieldDoesNotExist
fr... | {
"repo_name": "ff0000/scarlet",
"path": "scarlet/cms/item.py",
"copies": "1",
"size": "25056",
"license": "mit",
"hash": 3152889456456453600,
"line_mean": 33.56,
"line_max": 112,
"alpha_frac": 0.5699632822,
"autogenerated": false,
"ratio": 4.423728813559322,
"config_test": false,
"has_no_keyw... |
from django import http
from django.views.generic import TemplateView
from django.views.generic.edit import FormView
from django.core.urlresolvers import reverse
from registration import forms
from registration import models
class Register(FormView):
template_name = 'registration/register.html'
form_class = ... | {
"repo_name": "madisona/django-registration",
"path": "registration/views.py",
"copies": "1",
"size": "1269",
"license": "bsd-3-clause",
"hash": -8676706655809962000,
"line_mean": 29.9512195122,
"line_max": 68,
"alpha_frac": 0.7171000788,
"autogenerated": false,
"ratio": 4.345890410958904,
"con... |
from django import http
from django.views.generic.list import MultipleObjectMixin
from django.views.generic.detail import SingleObjectMixin
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import ProtectedError
from django.utils.decorators import classonlym... | {
"repo_name": "ff0000/scarlet",
"path": "scarlet/cms/actions.py",
"copies": "1",
"size": "23277",
"license": "mit",
"hash": -1442058023141164000,
"line_mean": 35.9476190476,
"line_max": 104,
"alpha_frac": 0.5896378399,
"autogenerated": false,
"ratio": 4.374553655327946,
"config_test": false,
... |
from django import http
from django.views import generic
from django.shortcuts import get_object_or_404, render
from django.template import loader
from notifications.models import Notification
import notifications.views
class OpenNotification(generic.RedirectView):
def get_redirect_url(self, *args, **kwargs):
... | {
"repo_name": "numbas/editor",
"path": "editor/views/notification.py",
"copies": "1",
"size": "1139",
"license": "apache-2.0",
"hash": -7393488473419338000,
"line_mean": 39.6785714286,
"line_max": 84,
"alpha_frac": 0.6997366111,
"autogenerated": false,
"ratio": 4.067857142857143,
"config_test":... |
from django import http
from django.views import generic
from django.views.generic import base
import autocomplete_light
__all__ = ['AutocompleteView', 'RegistryView', 'CreateView']
class RegistryView(base.TemplateView):
template_name = 'autocomplete_light/registry.html'
def get(self, request, *args, **kwa... | {
"repo_name": "spookylukey/django-autocomplete-light",
"path": "autocomplete_light/views.py",
"copies": "1",
"size": "3273",
"license": "mit",
"hash": -1353515009572881700,
"line_mean": 32.7422680412,
"line_max": 79,
"alpha_frac": 0.6425297892,
"autogenerated": false,
"ratio": 4.422972972972973,
... |
from django import http
from django.views import generic
from horizon import exceptions
from horizon import tables
from .base import TableTab
class TabView(generic.TemplateView):
"""
A generic class-based view for displaying a :class:`horizon.tabs.TabGroup`.
This view handles selecting specific tabs and... | {
"repo_name": "fmyzjs/horizon-hacker",
"path": "horizon/tabs/views.py",
"copies": "16",
"size": "5747",
"license": "apache-2.0",
"hash": -8576714001957932000,
"line_mean": 39.7588652482,
"line_max": 79,
"alpha_frac": 0.6152775361,
"autogenerated": false,
"ratio": 4.194890510948905,
"config_test... |
from django import http
from django.views import generic
from horizon import exceptions
from horizon import tables
from horizon.tabs.base import TableTab
class TabView(generic.TemplateView):
"""
A generic class-based view for displaying a :class:`horizon.tabs.TabGroup`.
This view handles selecting speci... | {
"repo_name": "tuskar/tuskar-ui",
"path": "horizon/tabs/views.py",
"copies": "3",
"size": "5759",
"license": "apache-2.0",
"hash": 1596447115768005600,
"line_mean": 39.8439716312,
"line_max": 79,
"alpha_frac": 0.6159055392,
"autogenerated": false,
"ratio": 4.194464675892207,
"config_test": fals... |
from django import http
from django.views import generic
from horizon import exceptions
from horizon import tables
from horizon.tabs.base import TableTab # noqa
class TabView(generic.TemplateView):
"""
A generic class-based view for displaying a :class:`horizon.tabs.TabGroup`.
This view handles selecti... | {
"repo_name": "rickerc/horizon_audit",
"path": "horizon/tabs/views.py",
"copies": "10",
"size": "5777",
"license": "apache-2.0",
"hash": 4827632959284396000,
"line_mean": 39.9716312057,
"line_max": 79,
"alpha_frac": 0.6162368011,
"autogenerated": false,
"ratio": 4.195352214960058,
"config_test"... |
from django import http
from django.views import generic
from horizon import exceptions
class TileView(generic.TemplateView):
tile_class = None
_tile = None
def __init__(self):
if not self.tile_class:
raise AttributeError('You must specify one or more Tile'
... | {
"repo_name": "liuan/TilesView",
"path": "src/tiles/views.py",
"copies": "1",
"size": "1418",
"license": "apache-2.0",
"hash": 6291293171875433000,
"line_mean": 29.8260869565,
"line_max": 76,
"alpha_frac": 0.5669957687,
"autogenerated": false,
"ratio": 4.074712643678161,
"config_test": false,
... |
from django import http
from django.views import View
from django.urls import reverse, reverse_lazy
from django.utils import timezone
from django.utils.http import urlsafe_base64_decode
from django.utils.translation import ugettext as _
from django.utils.decorators import method_decorator
from django.views.decorators.d... | {
"repo_name": "p2pu/learning-circles",
"path": "custom_registration/views.py",
"copies": "1",
"size": "13136",
"license": "mit",
"hash": -5012556237324715000,
"line_mean": 41.3741935484,
"line_max": 193,
"alpha_frac": 0.6407582217,
"autogenerated": false,
"ratio": 4.179446388800509,
"config_tes... |
from django import http
from google.appengine.ext import blobstore
from google.appengine.api import images
from google.appengine.ext import ndb
from sample.wall.blobstore import get_uploads
from sample.extensions.views import BaseView
from sample.extensions.paging import Pager
class ImageInfo(ndb.Model):
servi... | {
"repo_name": "caoimhghin/django-blobstore-images",
"path": "sample/wall/views.py",
"copies": "1",
"size": "1784",
"license": "mit",
"hash": 4007889907695068000,
"line_mean": 27.3174603175,
"line_max": 87,
"alpha_frac": 0.6334080717,
"autogenerated": false,
"ratio": 3.9469026548672566,
"config_... |
from django import http
from ostinato.pages.views import PageView
from website.forms import ContactForm
class TopLevelListPageView(PageView):
def get_context_data(self, **kwargs):
c = super(TopLevelListPageView, self).get_context_data(**kwargs)
# We convert the queryset to a list so that we can ... | {
"repo_name": "andrewebdev/django-ostinato",
"path": "demo/website/views.py",
"copies": "1",
"size": "2320",
"license": "mit",
"hash": -7227785969068971000,
"line_mean": 32.6231884058,
"line_max": 76,
"alpha_frac": 0.5922413793,
"autogenerated": false,
"ratio": 3.9931153184165233,
"config_test"... |
from django import http
from rest_framework.exceptions import NotFound
from rest_framework import permissions as drf_permissions
from framework.guid.model import Guid
from framework.auth.oauth_scopes import CoreScopes, ComposedScopes
from api.base.exceptions import EndpointNotImplementedError
from api.base import perm... | {
"repo_name": "doublebits/osf.io",
"path": "api/guids/views.py",
"copies": "2",
"size": "1806",
"license": "apache-2.0",
"hash": 4455412025337777700,
"line_mean": 33.7307692308,
"line_max": 116,
"alpha_frac": 0.6932447398,
"autogenerated": false,
"ratio": 3.9518599562363237,
"config_test": fals... |
from django import http
ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control-Allow-Origin'
ACCESS_CONTROL_EXPOSE_HEADERS = 'Access-Control-Expose-Headers'
ACCESS_CONTROL_ALLOW_CREDENTIALS = 'Access-Control-Allow-Credentials'
ACCESS_CONTROL_ALLOW_HEADERS = 'Access-Control-Allow-Headers'
ACCESS_CONTROL_ALLOW_METHODS = 'Access-... | {
"repo_name": "msluis/stage-assistant",
"path": "server/src/main/middleware.py",
"copies": "1",
"size": "1525",
"license": "mit",
"hash": 8400830041562065000,
"line_mean": 37.15,
"line_max": 111,
"alpha_frac": 0.6019672131,
"autogenerated": false,
"ratio": 4.066666666666666,
"config_test": fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.