text
stringlengths
0
1.05M
meta
dict
from django import http from django.conf import settings from django.contrib.comments.views.utils import next_redirect, confirmation_view from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response from django.template import Reques...
{ "repo_name": "wd5/jangr", "path": "mycomments/views.py", "copies": "1", "size": "3291", "license": "bsd-3-clause", "hash": 8247852139685382000, "line_mean": 34.0212765957, "line_max": 80, "alpha_frac": 0.742935278, "autogenerated": false, "ratio": 3.63646408839779, "config_test": false, "has...
from django import http from django.conf import settings from django.contrib.comments.views.utils import next_redirect from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response from django.template import RequestContext from djang...
{ "repo_name": "shockflash/reviews", "path": "reviews/views.py", "copies": "1", "size": "5577", "license": "bsd-3-clause", "hash": 417322966315681600, "line_mean": 36.4295302013, "line_max": 105, "alpha_frac": 0.6417428725, "autogenerated": false, "ratio": 4.212235649546828, "config_test": false...
from django import http from django.conf import settings from django.contrib import auth from django.utils.http import is_safe_url import commonware.log from django_browserid import BrowserIDBackend, get_audience from django.utils.translation import ugettext as _ import mkt from lib.metrics import record_action from ...
{ "repo_name": "ddurst/zamboni", "path": "mkt/users/views.py", "copies": "6", "size": "4741", "license": "bsd-3-clause", "hash": -1175119422648981000, "line_mean": 30.6066666667, "line_max": 77, "alpha_frac": 0.6460662308, "autogenerated": false, "ratio": 3.8264729620661826, "config_test": false...
from django import http from django.conf import settings from django.contrib import comments from django.contrib.comments import signals from django.contrib.comments.views.utils import next_redirect, confirmation_view from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models fr...
{ "repo_name": "ericholscher/django", "path": "django/contrib/comments/views/comments.py", "copies": "11", "size": "5320", "license": "bsd-3-clause", "hash": -3343662883269195300, "line_mean": 38.4074074074, "line_max": 92, "alpha_frac": 0.6471804511, "autogenerated": false, "ratio": 4.27996781979...
from django import http from django.conf import settings from django.contrib import messages from django.contrib.auth import login as auth_login from django.contrib.auth import logout as auth_logout from django.contrib.auth import update_session_auth_hash from django.contrib.sites.shortcuts import get_current_site from...
{ "repo_name": "aarticianpc/greenpointtrees", "path": "src/oscar/apps/customer/views.py", "copies": "5", "size": "26047", "license": "mit", "hash": 1511127968558385200, "line_mean": 35.2771587744, "line_max": 79, "alpha_frac": 0.6199178408, "autogenerated": false, "ratio": 4.096084289982701, "co...
from django import http from django.conf import settings from django.contrib import messages from django.shortcuts import redirect from django.utils.translation import gettext as _ from django.views import generic from paypal.payflow import facade, models class TransactionListView(generic.ListView): model = mode...
{ "repo_name": "lpakula/django-oscar-paypal", "path": "paypal/payflow/dashboard/views.py", "copies": "3", "size": "3034", "license": "bsd-3-clause", "hash": 5833939159253317000, "line_mean": 40.5616438356, "line_max": 89, "alpha_frac": 0.6437046803, "autogenerated": false, "ratio": 3.9351491569390...
from django import http from django.conf import settings from django.contrib.redirects.middleware import RedirectFallbackMiddleware from django.contrib.redirects.models import Redirect from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, ...
{ "repo_name": "dfunckt/django", "path": "tests/redirects_tests/tests.py", "copies": "36", "size": "4059", "license": "bsd-3-clause", "hash": 3192495718907584500, "line_mean": 45.125, "line_max": 117, "alpha_frac": 0.7277654595, "autogenerated": false, "ratio": 3.983316977428852, "config_test": ...
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware ...
{ "repo_name": "rogerhu/django", "path": "django/contrib/redirects/tests.py", "copies": "6", "size": "3488", "license": "bsd-3-clause", "hash": 647531828317161600, "line_mean": 36.5053763441, "line_max": 78, "alpha_frac": 0.6788990826, "autogenerated": false, "ratio": 4.037037037037037, "config_...
from django import http from django.conf import settings from django.core.exceptions import MiddlewareNotUsed from crashstats.crashstats.models import BadStatusCodeError class SetRemoteAddrFromForwardedFor(object): """ Middleware that sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, if the latter is set. T...
{ "repo_name": "pcabido/socorro", "path": "webapp-django/crashstats/crashstats/middleware.py", "copies": "12", "size": "1753", "license": "mpl-2.0", "hash": 7789647860922911000, "line_mean": 39.7674418605, "line_max": 79, "alpha_frac": 0.679977182, "autogenerated": false, "ratio": 4.03917050691244...
from django import http from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.template.loader import render_to...
{ "repo_name": "wahaha02/myblog", "path": "comments/views.py", "copies": "1", "size": "5588", "license": "bsd-3-clause", "hash": 7092254846939222000, "line_mean": 33.7080745342, "line_max": 94, "alpha_frac": 0.6306370795, "autogenerated": false, "ratio": 4.198347107438017, "config_test": false, ...
from django import http from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response, redirect from django.template import RequestContext from django.template.loader import render_to_string from djang...
{ "repo_name": "boldprogressives/django-opendebates", "path": "opendebates/opendebates_comments/views.py", "copies": "1", "size": "4771", "license": "apache-2.0", "hash": -7622851163938600000, "line_mean": 35.7, "line_max": 92, "alpha_frac": 0.6640117376, "autogenerated": false, "ratio": 4.2789237...
from django import http from django.conf import settings from django.core.exceptions import PermissionDenied 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_tem...
{ "repo_name": "spasovski/zamboni", "path": "apps/reviews/views.py", "copies": "2", "size": "11659", "license": "bsd-3-clause", "hash": -1529293545177820000, "line_mean": 35.6635220126, "line_max": 79, "alpha_frac": 0.6157474912, "autogenerated": false, "ratio": 3.7476695596271297, "config_test"...
from django import http from django.conf import settings from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404, redirect, render from django.template import Context, loader from django.utils.http import urlquote import commonware.log from tower import ugettext as _ from mob...
{ "repo_name": "anaran/olympia", "path": "apps/reviews/views.py", "copies": "1", "size": "11368", "license": "bsd-3-clause", "hash": -6438951672673324000, "line_mean": 35.9090909091, "line_max": 79, "alpha_frac": 0.6154116819, "autogenerated": false, "ratio": 3.7419354838709675, "config_test": f...
from django import http from django.conf import settings from django.core import paginator class Paginator(paginator.Paginator): def page(self, number) -> paginator.Page: """Raise Http404 instead of InvalidPage.""" try: return super().page(number) except paginator.InvalidPage:...
{ "repo_name": "fidals/refarm-site", "path": "refarm_pagination/pagination.py", "copies": "1", "size": "1662", "license": "mit", "hash": 5555584885033052000, "line_mean": 27.1694915254, "line_max": 81, "alpha_frac": 0.6052948255, "autogenerated": false, "ratio": 4.103703703703704, "config_test":...
from django import http from django.conf import settings from django.core.urlresolvers import translate_url from django.utils.http import is_safe_url from django.utils.translation import LANGUAGE_SESSION_KEY, check_for_language from django.views.i18n import LANGUAGE_QUERY_PARAMETER # Modified from django.views.i18n d...
{ "repo_name": "jonboiser/kolibri", "path": "kolibri/core/views.py", "copies": "3", "size": "1842", "license": "mit", "hash": -8642292308218321000, "line_mean": 46.2307692308, "line_max": 79, "alpha_frac": 0.6585233442, "autogenerated": false, "ratio": 4.195899772209567, "config_test": false, ...
from django import http from django.conf import settings from django.core.urlresolvers import translate_url from django.utils.http import is_safe_url from django.utils.translation import ( LANGUAGE_SESSION_KEY, check_for_language, ) LANGUAGE_QUERY_PARAMETER = 'language' def set_language(request): """ Red...
{ "repo_name": "aodarc/bysines_blog", "path": "htdocs/views.py", "copies": "1", "size": "1781", "license": "apache-2.0", "hash": -6855102879299975000, "line_mean": 41.4047619048, "line_max": 79, "alpha_frac": 0.6389668725, "autogenerated": false, "ratio": 4.250596658711217, "config_test": false,...
from django import http from django.conf import settings from django.db.models import Avg from django.shortcuts import get_list_or_404 from django.views.decorators.cache import cache_control import jingo import redisutils import amo from addons.models import Addon from .models import Performance, PerformanceOSVersio...
{ "repo_name": "jbalogh/zamboni", "path": "apps/perf/views.py", "copies": "1", "size": "1110", "license": "bsd-3-clause", "hash": -2790409279994076700, "line_mean": 33.6875, "line_max": 75, "alpha_frac": 0.7009009009, "autogenerated": false, "ratio": 3.479623824451411, "config_test": false, "h...
from django import http from django.conf import settings from django.db.models import Avg from django.shortcuts import get_list_or_404, render from django.views.decorators.cache import cache_control import redisutils import amo from addons.models import Addon from .models import Performance, PerformanceOSVersion #...
{ "repo_name": "clouserw/olympia", "path": "apps/perf/views.py", "copies": "3", "size": "1370", "license": "bsd-3-clause", "hash": -4453461218339063000, "line_mean": 32.4146341463, "line_max": 80, "alpha_frac": 0.6554744526, "autogenerated": false, "ratio": 3.6729222520107236, "config_test": fal...
from django import http from django.conf import settings 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.views.decorators.vary import vary_on_headers imp...
{ "repo_name": "jpetto/olympia", "path": "src/olympia/search/views.py", "copies": "1", "size": "23435", "license": "bsd-3-clause", "hash": -126834142312399060, "line_mean": 35.1093990755, "line_max": 79, "alpha_frac": 0.568721997, "autogenerated": false, "ratio": 3.7251629311715146, "config_test...
from django import http from django.conf import settings from django.db.models import Q from django.shortcuts import render from django.utils import translation from django.utils.encoding import smart_str from django.views.decorators.vary import vary_on_headers import commonware.log from mobility.decorators import mob...
{ "repo_name": "beni55/olympia", "path": "apps/search/views.py", "copies": "13", "size": "23178", "license": "bsd-3-clause", "hash": 639967960610519600, "line_mean": 34.9348837209, "line_max": 79, "alpha_frac": 0.5657520062, "autogenerated": false, "ratio": 3.7408005164622335, "config_test": fal...
from django import http from django.conf import settings from django.db.models import Q from django.utils import translation from django.utils.encoding import smart_str from django.views.decorators.vary import vary_on_headers import commonware.log import jingo from mobility.decorators import mobile_template from tower...
{ "repo_name": "spasovski/zamboni", "path": "apps/search/views.py", "copies": "2", "size": "24208", "license": "bsd-3-clause", "hash": -2747257013665178600, "line_mean": 35.4578313253, "line_max": 79, "alpha_frac": 0.5643588896, "autogenerated": false, "ratio": 3.7415765069551776, "config_test":...
from django import http from django.conf import settings from django.db.models.signals import post_save, post_delete from django.template.response import TemplateResponse from pytx.release import update_data_version ROBOTS = """User-agent: * Disallow: /static/$ Disallow: /static-2020/$ Disallow: /static-2019/$ """ ...
{ "repo_name": "pytexas/PyTexasBackend", "path": "pytx/views.py", "copies": "1", "size": "1454", "license": "mit", "hash": 4064766986420937700, "line_mean": 24.9642857143, "line_max": 79, "alpha_frac": 0.6987620358, "autogenerated": false, "ratio": 3.486810551558753, "config_test": false, "has...
from django import http from django.conf import settings from django.http import HttpResponse from django.shortcuts import get_object_or_404, render_to_response from django.template import loader, Context, RequestContext from django.views.generic import list_detail from basic.blog.models import Post, Category from con...
{ "repo_name": "mikl/amalgam", "path": "amalgam/alloy/views.py", "copies": "1", "size": "3083", "license": "bsd-3-clause", "hash": -3657050382170276400, "line_mean": 33.6404494382, "line_max": 89, "alpha_frac": 0.6639636717, "autogenerated": false, "ratio": 4.094289508632138, "config_test": fals...
from django import http from django.conf import settings from django.shortcuts import get_object_or_404 from django.views.generic import ListView from oscar.core.loading import get_model ConditionalOffer = get_model('offer', 'ConditionalOffer') Range = get_model('offer', 'Range') Product = get_model('catalogue', 'Pro...
{ "repo_name": "vicky2135/lucious", "path": "src/oscar/apps/offer/views.py", "copies": "9", "size": "2050", "license": "bsd-3-clause", "hash": -2805114905567389000, "line_mean": 31.03125, "line_max": 73, "alpha_frac": 0.66, "autogenerated": false, "ratio": 3.882575757575758, "config_test": false...
from django import http from django.conf import settings from django.shortcuts import redirect, render from django.contrib.auth.decorators import login_required from jsonview.decorators import json_view from airmozilla.base import mozillians def debugger__(request): # pragma: no cover r = http.HttpResponse() ...
{ "repo_name": "blossomica/airmozilla", "path": "airmozilla/main/views/misc.py", "copies": "1", "size": "2506", "license": "bsd-3-clause", "hash": 4451861083590762000, "line_mean": 29.5609756098, "line_max": 74, "alpha_frac": 0.6245011971, "autogenerated": false, "ratio": 3.5295774647887326, "co...
from django import http from django.conf import settings from django.shortcuts import redirect, render def debugger__(request): # pragma: no cover r = http.HttpResponse() r.write('BROWSERID_AUDIENCES=%r\n' % settings.BROWSERID_AUDIENCES) r.write('Todays date: 2014-05-21 14:02 PST\n') r.write('Request...
{ "repo_name": "kenrick95/airmozilla", "path": "airmozilla/main/views/misc.py", "copies": "3", "size": "1664", "license": "bsd-3-clause", "hash": -4779413408040715000, "line_mean": 31, "line_max": 70, "alpha_frac": 0.6460336538, "autogenerated": false, "ratio": 3.570815450643777, "config_test": ...
from django import http from django.conf import settings from django.shortcuts import render from django.utils.translation import check_for_language from django.utils.http import is_safe_url def index(request): return _render('index.html', request) def api(request): return _render('api.html', request) def...
{ "repo_name": "opennorth/represent-canada", "path": "finder/views.py", "copies": "1", "size": "1291", "license": "mit", "hash": 5250243773117238000, "line_mean": 24.82, "line_max": 73, "alpha_frac": 0.6824167312, "autogenerated": false, "ratio": 3.636619718309859, "config_test": false, "has_n...
from django import http from django.conf import settings from django.shortcuts import render from django.views.generic.base import RedirectView from crashstats.crashstats.decorators import pass_default_context from crashstats.crashstats import models from . import forms @pass_default_context def home(request, produc...
{ "repo_name": "KaiRo-at/socorro", "path": "webapp-django/crashstats/home/views.py", "copies": "2", "size": "1790", "license": "mpl-2.0", "hash": 1348281323952837400, "line_mean": 27.8709677419, "line_max": 77, "alpha_frac": 0.6279329609, "autogenerated": false, "ratio": 4.172494172494172, "conf...
from django import http from django.conf import settings 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 outpu...
{ "repo_name": "luser/socorro", "path": "webapp-django/crashstats/base/views.py", "copies": "2", "size": "1228", "license": "mpl-2.0", "hash": 6973485664503263000, "line_mean": 38.6129032258, "line_max": 67, "alpha_frac": 0.6351791531, "autogenerated": false, "ratio": 4.107023411371237, "config_...
from django import http from django.conf import settings from django.utils.cache import patch_cache_control from elasticsearch import exceptions from elasticsearch_dsl import Q, query, Search from redo import retrying from kuma.api.v1.decorators import allow_CORS_GET from .forms import SearchForm # This is the numbe...
{ "repo_name": "escattone/kuma", "path": "kuma/api/v1/search/__init__.py", "copies": "1", "size": "11478", "license": "mpl-2.0", "hash": -7571904243309446000, "line_mean": 36.7565789474, "line_max": 113, "alpha_frac": 0.5929604461, "autogenerated": false, "ratio": 4.127292340884574, "config_test...
from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote import os import gettext as gettext_module def set_language(request): """ Redirec...
{ "repo_name": "CollabQ/CollabQ", "path": "vendor/django/views/i18n.py", "copies": "7", "size": "6621", "license": "apache-2.0", "hash": 8372277557359782000, "line_mean": 33.1288659794, "line_max": 124, "alpha_frac": 0.6085183507, "autogenerated": false, "ratio": 3.7597955706984667, "config_test...
from django import http from django.conf import settings from django.utils.text import compress_string from django.utils.cache import patch_vary_headers class CrossDomainSharingMiddleware(object): """ Middleware to allow cross-domain XHR requests in django Access-Control-Allow-Origin: http://domain.examp...
{ "repo_name": "jlauron/django-xdomainsharing", "path": "xdomainsharing.py", "copies": "1", "size": "1584", "license": "mit", "hash": 8020387833897248000, "line_mean": 30.68, "line_max": 65, "alpha_frac": 0.6180555556, "autogenerated": false, "ratio": 4.4, "config_test": false, "has_no_keyword...
from django import http from django.conf import settings from django.views.decorators.cache import never_cache from django.views.decorators.http import condition import commonware.log import jingo import waffle from access import acl from amo.decorators import json_view from amo.urlresolvers import reverse from amo.u...
{ "repo_name": "jbalogh/zamboni", "path": "apps/files/views.py", "copies": "1", "size": "4837", "license": "bsd-3-clause", "hash": 3857399897609196500, "line_mean": 31.0331125828, "line_max": 78, "alpha_frac": 0.5780442423, "autogenerated": false, "ratio": 3.761275272161742, "config_test": false...
from django import http from django.conf import settings from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from django_statsd.clients import statsd boomerang = { 'window.performance.navigation.redirectCount': 'nt_red_cnt', 'window.performance.navigati...
{ "repo_name": "AdrianGaudebert/socorro-crashstats", "path": "vendor-local/lib/python/django_statsd/views.py", "copies": "1", "size": "5934", "license": "mpl-2.0", "hash": 2737832701486140400, "line_mean": 34.3214285714, "line_max": 79, "alpha_frac": 0.6776204921, "autogenerated": false, "ratio": ...
from django import http from django.conf import settings from django.views.decorators.http import require_http_methods import json import requests import re def get_google_user_id(profile_url): m = re.match('.*plus.google.com.*/(?P<user_id>[\d]+).*', profile_url) try: user_id = m.group('user_id') ...
{ "repo_name": "p2pu/mechanical-mooc", "path": "gplus/views.py", "copies": "1", "size": "1375", "license": "mit", "hash": -8327728244224055000, "line_mean": 33.375, "line_max": 101, "alpha_frac": 0.6276363636, "autogenerated": false, "ratio": 3.5438144329896906, "config_test": false, "has_no_k...
from django import http from django.conf import settings from djpcms.contrib import messages from django.contrib.auth import authenticate, login from socialauth import views from oauth import oauth from socialauth.lib import oauthtwitter2 as oauthtwitter from djpcms.views.appview import AppView def del_dict_key(src...
{ "repo_name": "strogo/djpcms", "path": "examples/djpcms-site/sitedjpcms/views.py", "copies": "1", "size": "4121", "license": "bsd-3-clause", "hash": -3988979734993182000, "line_mean": 40.22, "line_max": 118, "alpha_frac": 0.6384372725, "autogenerated": false, "ratio": 4.129258517034068, "config...
from django import http from django.conf import settings from utils import next_redirect, confirmation_view 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 ren...
{ "repo_name": "AloneRoad/Inforlearn", "path": "vendor/django/contrib/comments/views/comments.py", "copies": "1", "size": "4526", "license": "apache-2.0", "hash": 5789339359891286000, "line_mean": 35.5, "line_max": 92, "alpha_frac": 0.637207247, "autogenerated": false, "ratio": 4.318702290076335, ...
from django import http from django.conf import settings from utils import next_redirect, confirmation_view from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.shortcuts import render_to_response from django.template import RequestContext from django.template....
{ "repo_name": "asedunov/intellij-community", "path": "python/lib/Lib/site-packages/django/contrib/comments/views/comments.py", "copies": "306", "size": "5359", "license": "apache-2.0", "hash": 2428770956406947000, "line_mean": 38.4044117647, "line_max": 93, "alpha_frac": 0.64433663, "autogenerated"...
from django import http from django.conf import settings # based on http://code.djangoproject.com/ticket/3777#comment:4 class FilterPersistMiddleware(object): def process_request(self, request): if '/admin/' not in request.path: return None if 'HTTP_REFERER' not in request.META: ...
{ "repo_name": "sharifelguindi/qatrackplus", "path": "qatrack/middleware/maintain_filters.py", "copies": "1", "size": "1762", "license": "mit", "hash": 1369177650895528000, "line_mean": 32.8846153846, "line_max": 84, "alpha_frac": 0.5686719637, "autogenerated": false, "ratio": 4.308068459657702, ...
from django import http from django.conf import settings """Django middleware module for handling CORS HTTP headers. Values specified in the Django settings module are used to set appropriate headers in HTTP responses. These headers are added to all responses. Pre-flight requests, i.e., OPTIONS requests that have th...
{ "repo_name": "prasanthn/django-dcors", "path": "dcors/dcorsmiddleware.py", "copies": "1", "size": "5237", "license": "mit", "hash": 7431794055884280000, "line_mean": 47.4907407407, "line_max": 96, "alpha_frac": 0.7105212908, "autogenerated": false, "ratio": 4.113904163393559, "config_test": fa...
from django import http from django.conf import settings from google.appengine.api import users from .exceptions import ParameterRequired, ApiException class User (object): def __init__ (self): self._email = None self._is_super = None self._is_auth = None self._userid = None self.user = No...
{ "repo_name": "pizzapanther/GAE-Bulk-Mailer", "path": "bulkmail/middleware.py", "copies": "1", "size": "2043", "license": "bsd-2-clause", "hash": 1798054601652313000, "line_mean": 22.7674418605, "line_max": 87, "alpha_frac": 0.5829662261, "autogenerated": false, "ratio": 4.045544554455446, "con...
from django import http from django.conf import settings from redirects.models import Redirect class RedirectFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a redirect for non-404 responses. ...
{ "repo_name": "peplin/django-redirects", "path": "redirects/middleware.py", "copies": "1", "size": "1091", "license": "bsd-3-clause", "hash": -8386060033117954000, "line_mean": 37.9642857143, "line_max": 85, "alpha_frac": 0.6040329973, "autogenerated": false, "ratio": 4.471311475409836, "config...
from django import http from django.conf import settings from url_tracker.models import URLChangeRecord class URLChangePermanentRedirectMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for non-404 responses....
{ "repo_name": "elbaschid/django-url-tracker", "path": "url_tracker/middleware.py", "copies": "1", "size": "1148", "license": "bsd-3-clause", "hash": 9178686669846118000, "line_mean": 36.0322580645, "line_max": 84, "alpha_frac": 0.6332752613, "autogenerated": false, "ratio": 4.743801652892562, "...
from django import http from django.conf import settings import commonware.log import jingo from product_details import product_details from access.models import Group from amo.decorators import json_view, login_required, post_required, write from amo.urlresolvers import reverse from .helpers import _permission_to_e...
{ "repo_name": "jbalogh/zamboni", "path": "apps/localizers/views.py", "copies": "1", "size": "3855", "license": "bsd-3-clause", "hash": 731160106504994300, "line_mean": 29.3543307087, "line_max": 77, "alpha_frac": 0.6617380026, "autogenerated": false, "ratio": 3.7609756097560973, "config_test": ...
from django import http from django.conf import settings class CORSMiddleware(object): """ ALLOW CORS """ CORS_ALLOWED_ORIGINS = settings.CLIENT_ORIGIN CORS_ALLOWED_METHODS = ['POST', 'GET', 'OPTIONS', 'PUT', 'DELETE', 'PATCH'] CORS_ALLOWED_HEADERS = ['Content-Type', 'X-CSRFToken'] def...
{ "repo_name": "liyocee/job_hunt", "path": "backend/config/middleware.py", "copies": "1", "size": "1552", "license": "mit", "hash": 3160455660201540600, "line_mean": 39.8421052632, "line_max": 79, "alpha_frac": 0.6494845361, "autogenerated": false, "ratio": 4.094986807387863, "config_test": fals...
from django import http from django.conf import settings """ Provides means for allowing Cross-site XmlHttpRequests. ``XS_XHR_ORIGINS``: domains allowed to access via cross-site XHR ``XS_XHR_METHODS``: methods that may be executed via XHR ``XS_XHR_ALLOWCT``: allow the specification of the Content-Type via XHR """ XS...
{ "repo_name": "keithio/django-xsxhr", "path": "xsxhr/middleware.py", "copies": "1", "size": "1783", "license": "bsd-3-clause", "hash": -2281969625288027400, "line_mean": 36.1666666667, "line_max": 83, "alpha_frac": 0.6472237801, "autogenerated": false, "ratio": 3.5588822355289422, "config_test"...
from django import http from django.conf import settings XS_SHARING_ALLOWED_ORIGINS = getattr( settings, 'XS_SHARING_ALLOWED_ORIGINS', '*') XS_SHARING_ALLOWED_HEADERS = getattr( settings, 'XS_SHARING_ALLOWED_HEADERS', ['Content-type']) XS_SHARING_ALLOWED_METHODS = getattr( settings, 'XS_SHARING_AL...
{ "repo_name": "haystack/eyebrowse-server", "path": "common/middleware/crossdomainxhr.py", "copies": "1", "size": "1568", "license": "mit", "hash": 1771517872023793700, "line_mean": 29.1538461538, "line_max": 80, "alpha_frac": 0.6511479592, "autogenerated": false, "ratio": 3.6894117647058824, "c...
from django import http from django.conf import settings # TODO werkt dit?from django.utils import simplejson as json import json from django.utils.encoding import force_unicode from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext_lazy as _ from .utils import get_page_m...
{ "repo_name": "socradev/django-fancypages", "path": "fancypages/mixins.py", "copies": "1", "size": "8596", "license": "bsd-3-clause", "hash": -9178848612745496000, "line_mean": 35.735042735, "line_max": 79, "alpha_frac": 0.6329688227, "autogenerated": false, "ratio": 4.263888888888889, "config_...
from django import http from django.conf.urls import include, patterns, url from django.core.urlresolvers import reverse from rest_framework.routers import SimpleRouter import amo from amo.decorators import write from lib.misc.urlconf_decorator import decorate from mkt.api.base import SubRouter from mkt.developers.ap...
{ "repo_name": "jinankjain/zamboni", "path": "mkt/developers/urls.py", "copies": "1", "size": "8980", "license": "bsd-3-clause", "hash": 2948822695623280000, "line_mean": 41.358490566, "line_max": 78, "alpha_frac": 0.6554565702, "autogenerated": false, "ratio": 3.571996817820207, "config_test": ...
from django import http from django.conf.urls import include, patterns, url from django.core.urlresolvers import reverse from rest_framework.routers import SimpleRouter import amo from lib.misc.urlconf_decorator import decorate from mkt.api.base import SubRouter from mkt.developers.api_payments import ( AddonPaym...
{ "repo_name": "ngokevin/zamboni", "path": "mkt/developers/urls.py", "copies": "1", "size": "9231", "license": "bsd-3-clause", "hash": -1151364604651598600, "line_mean": 41.9348837209, "line_max": 78, "alpha_frac": 0.6551836204, "autogenerated": false, "ratio": 3.5613425925925926, "config_test":...
from django import http from django.conf.urls import include, patterns, url from django.core.urlresolvers import reverse from rest_framework.routers import SimpleRouter import mkt from lib.misc.urlconf_decorator import decorate from mkt.api.base import SubRouter from mkt.developers.api_payments import ( AddonPaym...
{ "repo_name": "ddurst/zamboni", "path": "mkt/developers/urls.py", "copies": "3", "size": "9385", "license": "bsd-3-clause", "hash": 4671352873943099000, "line_mean": 41.6590909091, "line_max": 78, "alpha_frac": 0.652424081, "autogenerated": false, "ratio": 3.553578190079515, "config_test": true...
from django import http from django.conf.urls import include, url from rest_framework.compat import is_authenticated from rest_framework.renderers import CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer from rest_framework.schemas import SchemaGenerator, SchemaView class AuthorizedSchemaView(SchemaView): ...
{ "repo_name": "City-of-Turku/living-environment", "path": "living_environment/schemas.py", "copies": "1", "size": "2305", "license": "mit", "hash": -6717650857151452000, "line_mean": 31.0138888889, "line_max": 111, "alpha_frac": 0.6837310195, "autogenerated": false, "ratio": 3.9741379310344827, ...
from django import http from django.conf.urls import patterns from django.contrib import admin from django.db import models from django.forms.models import modelform_factory from django.shortcuts import get_object_or_404 from django.template import loader, Context from django.views.generic import View def get_printab...
{ "repo_name": "VersioningGoat/nasa-bears-in-space", "path": "ajax_changelist/admin.py", "copies": "3", "size": "4495", "license": "mit", "hash": -3885179174722448400, "line_mean": 33.5769230769, "line_max": 89, "alpha_frac": 0.6077864294, "autogenerated": false, "ratio": 4.139042357274401, "con...
from django import http from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured from django.shortcuts import get_object_or_404 from django.template.loader import render_to_string from django.urls import reverse from django.utils import timezone from django.utils.translation import ugett...
{ "repo_name": "matthiask/django-mooch", "path": "mooch/stripe.py", "copies": "1", "size": "2590", "license": "mit", "hash": 6594904243088985000, "line_mean": 34, "line_max": 83, "alpha_frac": 0.5972972973, "autogenerated": false, "ratio": 3.99075500770416, "config_test": false, "has_no_keywor...
from django import http from django.conf.urls import url from django.shortcuts import get_object_or_404 from django.template.loader import render_to_string from django.urls import reverse from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from mooch.base import BaseMoocher, requi...
{ "repo_name": "matthiask/django-mooch", "path": "mooch/banktransfer.py", "copies": "1", "size": "1581", "license": "mit", "hash": 8390021103785320000, "line_mean": 30, "line_max": 82, "alpha_frac": 0.6179633144, "autogenerated": false, "ratio": 4.0852713178294575, "config_test": false, "has_n...
from django import http from django.contrib.auth.context_processors import PermWrapper from django.contrib.auth.decorators import login_required, permission_required from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.template.loader import render_to_string fr...
{ "repo_name": "vosi/django-xcomments", "path": "comments/views/commenting.py", "copies": "1", "size": "5937", "license": "bsd-3-clause", "hash": 6048485781473509000, "line_mean": 35.2012195122, "line_max": 117, "alpha_frac": 0.548762001, "autogenerated": false, "ratio": 4.333576642335767, "conf...
from django import http from django.contrib.auth.decorators import login_required, permission_required from django.utils import simplejson from django.utils.decorators import method_decorator from django.views.generic.base import View from comments import signals import comments class RatingRate(View): rate = None...
{ "repo_name": "vosi/django-xcomments", "path": "comments/views/rating.py", "copies": "1", "size": "1659", "license": "bsd-3-clause", "hash": 6870790428753030000, "line_mean": 33.5625, "line_max": 92, "alpha_frac": 0.5804701627, "autogenerated": false, "ratio": 4.621169916434541, "config_test": ...
from django import http from django.contrib.auth import get_user_model from django.core.serializers.json import DjangoJSONEncoder from django.db.models import Model, ForeignKey from django.utils.cache import patch_vary_headers from django.utils.text import capfirst from urllib import urlencode from urlparse import urlu...
{ "repo_name": "mozilla/mozilla-badges", "path": "mozbadges/views/generic/base.py", "copies": "1", "size": "4508", "license": "bsd-3-clause", "hash": 3181737313585229000, "line_mean": 34.21875, "line_max": 96, "alpha_frac": 0.6084738243, "autogenerated": false, "ratio": 4.13198900091659, "config...
from django import http from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import login_required from django.contrib import messages from django.core import urlresolvers from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext fro...
{ "repo_name": "mitchellzen/pops", "path": "satchmo/apps/satchmo_store/contact/views.py", "copies": "7", "size": "8132", "license": "bsd-3-clause", "hash": -2416683256409729500, "line_mean": 38.4757281553, "line_max": 134, "alpha_frac": 0.6506394491, "autogenerated": false, "ratio": 4.109146033350...
from django import http from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import login_required from django.core import urlresolvers from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ fr...
{ "repo_name": "sankroh/satchmo", "path": "satchmo/contact/views.py", "copies": "2", "size": "3571", "license": "bsd-3-clause", "hash": -9191919348322303000, "line_mean": 36.1979166667, "line_max": 101, "alpha_frac": 0.654158499, "autogenerated": false, "ratio": 4.067198177676538, "config_test":...
from django import http from django.contrib.auth.models import Permission from django.contrib.auth.decorators import login_required from django.contrib.sites.models import RequestSite from django.shortcuts import render, get_object_or_404, redirect from django.db import transaction from . import models from . import f...
{ "repo_name": "Serg09/socorro", "path": "webapp-django/crashstats/tokens/views.py", "copies": "7", "size": "2797", "license": "mpl-2.0", "hash": 5960993435350556000, "line_mean": 32.6987951807, "line_max": 72, "alpha_frac": 0.608151591, "autogenerated": false, "ratio": 4.468051118210862, "confi...
from django import http from django.contrib.auth.models import Permission from django.contrib.auth.decorators import login_required from django.contrib.sites.requests import RequestSite from django.shortcuts import render, get_object_or_404, redirect from django.db import transaction from . import models from . import...
{ "repo_name": "luser/socorro", "path": "webapp-django/crashstats/tokens/views.py", "copies": "2", "size": "2432", "license": "mpl-2.0", "hash": -5490690055781086000, "line_mean": 31, "line_max": 70, "alpha_frac": 0.6097861842, "autogenerated": false, "ratio": 4.421818181818182, "config_test": f...
from django import http from django.contrib.auth.models import Permission from django.contrib.sites.requests import RequestSite from django.shortcuts import render, get_object_or_404, redirect from django.db import transaction from crashstats.crashstats.decorators import login_required from . import models from . impo...
{ "repo_name": "AdrianGaudebert/socorro", "path": "webapp-django/crashstats/tokens/views.py", "copies": "2", "size": "2434", "license": "mpl-2.0", "hash": 2422789962434069500, "line_mean": 31.0263157895, "line_max": 70, "alpha_frac": 0.6105176664, "autogenerated": false, "ratio": 4.425454545454546...
from django import http from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.shortcuts import render, get_object_or_404 from django.views.decorators.csrf import csrf_exempt import bleach import commonware import ...
{ "repo_name": "tgavankar/unifolio", "path": "apps/portfolio/views.py", "copies": "1", "size": "4747", "license": "bsd-3-clause", "hash": 3035084187715215000, "line_mean": 28.4844720497, "line_max": 90, "alpha_frac": 0.6214451232, "autogenerated": false, "ratio": 3.5799396681749625, "config_test...
from django import http from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site, get_current_site from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def shortcut(request, content_type_id, object_id): """ Redir...
{ "repo_name": "riklaunim/django-custom-multisite", "path": "django/contrib/contenttypes/views.py", "copies": "86", "size": "3343", "license": "bsd-3-clause", "hash": 9184280368694926000, "line_mean": 40.7875, "line_max": 92, "alpha_frac": 0.5916841161, "autogenerated": false, "ratio": 4.302445302...
from django import http from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core.exceptions import ObjectDoesNotExist def shortcut(request, content_type_id, object_id): "Redirect to an object's page based on a content-type ID and an object ID." # ...
{ "repo_name": "weigj/django-multidb", "path": "django/contrib/contenttypes/views.py", "copies": "10", "size": "2734", "license": "bsd-3-clause", "hash": -7031566692269134000, "line_mean": 39.8059701493, "line_max": 100, "alpha_frac": 0.6335040234, "autogenerated": false, "ratio": 4.18683001531393...
from django import http from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from google.appengine.ext import db def shortcut(request, content_type_id, object_id): "Redirect to an object's page based on a content-type ID and an object ID." # Look up the object...
{ "repo_name": "isaac-philip/loolu", "path": "common/django/contrib/contenttypes/views.py", "copies": "1", "size": "2816", "license": "mit", "hash": 8451865336441142000, "line_mean": 41.0298507463, "line_max": 100, "alpha_frac": 0.6313920455, "autogenerated": false, "ratio": 4.081159420289855, "...
from django import http from django.contrib import admin, auth, contenttypes, messages from django.core.exceptions import PermissionDenied from django.forms.fields import ChoiceField from django.forms.widgets import HiddenInput from django.shortcuts import get_object_or_404, redirect from django.template.loader import ...
{ "repo_name": "eviljeff/olympia", "path": "src/olympia/blocklist/admin.py", "copies": "1", "size": "29812", "license": "bsd-3-clause", "hash": -8815272983794060000, "line_mean": 39.4504748982, "line_max": 79, "alpha_frac": 0.5705085201, "autogenerated": false, "ratio": 4.1142699420369855, "conf...
from django import http from django.contrib import auth from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_str from turbion.bit...
{ "repo_name": "strogo/turbion", "path": "turbion/bits/openid/views/auth.py", "copies": "1", "size": "1752", "license": "bsd-3-clause", "hash": -3626447343459649000, "line_mean": 30.8545454545, "line_max": 81, "alpha_frac": 0.6969178082, "autogenerated": false, "ratio": 3.859030837004405, "confi...
from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import FormView, View from formtools.wizard.views import NamedUrlCookieWizardView from . import...
{ "repo_name": "lm-tools/situational", "path": "situational/apps/sectors/views.py", "copies": "1", "size": "3650", "license": "bsd-3-clause", "hash": 4719305774715772000, "line_mean": 32.1818181818, "line_max": 78, "alpha_frac": 0.6191780822, "autogenerated": false, "ratio": 3.8380651945320716, ...
from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.views.generic import FormView, View from formto...
{ "repo_name": "lm-tools/sectors", "path": "web/prototype/apps/sectors/views.py", "copies": "1", "size": "4385", "license": "bsd-3-clause", "hash": 9213305157857759000, "line_mean": 33.2578125, "line_max": 78, "alpha_frac": 0.6114025086, "autogenerated": false, "ratio": 3.74466268146883, "config...
from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django_openstack import api from django_openstack.tests.view_tests import base from mox import IsA import openstackx.api.exceptions as api_exceptions class KeyPairViewTests(base.BaseViewTests): def setUp(...
{ "repo_name": "tylesmit/openstack-dashboard", "path": "django-openstack/django_openstack/tests/view_tests/dash/keypair_tests.py", "copies": "3", "size": "5128", "license": "apache-2.0", "hash": -7298725056758185000, "line_mean": 34.3655172414, "line_max": 80, "alpha_frac": 0.5612324493, "autogenera...
from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.views.generic import FormView from django.views.generic import View from . import forms from . import models from home_page import forms as shared_forms ...
{ "repo_name": "lm-tools/situational", "path": "situational/apps/travel_report/views.py", "copies": "1", "size": "2888", "license": "bsd-3-clause", "hash": 1542399197955411700, "line_mean": 30.7362637363, "line_max": 76, "alpha_frac": 0.6288088643, "autogenerated": false, "ratio": 4.04481792717086...
from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.views.generic import FormView, View from . import forms, models, pdf from home_page import forms as shared_forms from .adzuna import Adzuna class StartVi...
{ "repo_name": "lm-tools/situational", "path": "situational/apps/job_discovery/views.py", "copies": "1", "size": "3552", "license": "bsd-3-clause", "hash": 2908660153612002000, "line_mean": 34.8787878788, "line_max": 79, "alpha_frac": 0.6483671171, "autogenerated": false, "ratio": 3.86086956521739...
from django import http from django.contrib import messages from django.core.urlresolvers import reverse from django.views.generic.detail import DetailView from django.views.generic.list import ListView from quiz.models import Quiz, Question, UserAnswer from quiz.forms import AnswerForm class QuizList(ListView): ...
{ "repo_name": "pbx/django-quiz", "path": "quiz/views.py", "copies": "1", "size": "1828", "license": "mit", "hash": 7476936962013946000, "line_mean": 34.1538461538, "line_max": 106, "alpha_frac": 0.6996717724, "autogenerated": false, "ratio": 3.982570806100218, "config_test": false, "has_no_ke...
from django import http from django.contrib import messages from django.db import transaction from django.db.models.functions import Lower from django.views import generic from django.urls import reverse from django.shortcuts import redirect from editor.models import CustomPartType, CUSTOM_PART_TYPE_PUBLIC_CHOICES, CU...
{ "repo_name": "numbas/editor", "path": "editor/views/custom_part_type.py", "copies": "1", "size": "7264", "license": "apache-2.0", "hash": -4357314871737789400, "line_mean": 36.0612244898, "line_max": 129, "alpha_frac": 0.6530837004, "autogenerated": false, "ratio": 3.8720682302771854, "config_...
from django import http from django.contrib import messages from django.http import Http404 from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext_lazy as _ from django.views import generic from oscar.apps.customer.alerts import utils from oscar.apps.customer.mixins import PageTit...
{ "repo_name": "vicky2135/lucious", "path": "src/oscar/apps/customer/alerts/views.py", "copies": "5", "size": "5045", "license": "bsd-3-clause", "hash": 6085891475825260000, "line_mean": 36.6492537313, "line_max": 79, "alpha_frac": 0.6103072349, "autogenerated": false, "ratio": 4.286321155480034, ...
from django import http from django.contrib import messages from django.shortcuts import render, redirect, get_object_or_404 from django.views.decorators.http import require_POST from django.db import transaction from airmozilla.main.models import ( Approval, Event, SuggestedEvent ) from airmozilla.manage ...
{ "repo_name": "bugzPDX/airmozilla", "path": "airmozilla/manage/views/approvals.py", "copies": "1", "size": "3137", "license": "bsd-3-clause", "hash": -2787406767498607000, "line_mean": 31.0102040816, "line_max": 77, "alpha_frac": 0.6684730634, "autogenerated": false, "ratio": 3.940954773869347, ...
from django import http from django.contrib import messages from django.utils.functional import cached_property from django.shortcuts import get_object_or_404, get_list_or_404 from django.contrib.auth.mixins import UserPassesTestMixin from .. import forms from ..models import Game, GameSetPicks from .base import Picke...
{ "repo_name": "dakrauth/picker", "path": "picker/views/manage.py", "copies": "1", "size": "2894", "license": "mit", "hash": -4363765282660516000, "line_mean": 28.8350515464, "line_max": 86, "alpha_frac": 0.6710435384, "autogenerated": false, "ratio": 3.6725888324873095, "config_test": false, ...
from django import http from django.contrib import messages from django.views import generic from django.urls import reverse from django.utils.translation import ngettext from django.shortcuts import redirect from django.template.loader import render_to_string import editor.forms from editor.models import Folder, Proj...
{ "repo_name": "numbas/editor", "path": "editor/views/folder.py", "copies": "1", "size": "4645", "license": "apache-2.0", "hash": 2782752434982721500, "line_mean": 33.9248120301, "line_max": 102, "alpha_frac": 0.615285253, "autogenerated": false, "ratio": 4.011226252158894, "config_test": false,...
from django import http from django.contrib.messages import constants, get_level, set_level, utils from django.contrib.messages.api import MessageFailure from django.contrib.messages.constants import DEFAULT_LEVELS from django.contrib.messages.storage import base, default_storage from django.contrib.messages.storage.ba...
{ "repo_name": "kawamon/hue", "path": "desktop/core/ext-py/Django-1.11.29/tests/messages_tests/base.py", "copies": "5", "size": "13908", "license": "apache-2.0", "hash": 3503588154463232000, "line_mean": 36.1871657754, "line_max": 99, "alpha_frac": 0.6134598792, "autogenerated": false, "ratio": 4....
from django import http from django.contrib.sites.models import Site from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from forms import GiftCertCodeForm, GiftCertPayShipForm from models import GiftCertificate, GIFTCODE_KEY...
{ "repo_name": "mitchellzen/pops", "path": "satchmo/apps/payment/modules/giftcertificate/views.py", "copies": "6", "size": "3802", "license": "bsd-3-clause", "hash": -5200473763823998000, "line_mean": 36.6435643564, "line_max": 95, "alpha_frac": 0.6283534982, "autogenerated": false, "ratio": 4.191...
from django import http from django.contrib.syndication.views import Feed from tower import ugettext as _ from amo.helpers import absolutify, page_name from amo.urlresolvers import reverse from access import acl from addons.models import Addon from browse.feeds import AddonFeedMixin from . import views class Collec...
{ "repo_name": "muffinresearch/addons-server", "path": "apps/bandwagon/feeds.py", "copies": "22", "size": "2250", "license": "bsd-3-clause", "hash": -2282730444720962600, "line_mean": 27.125, "line_max": 77, "alpha_frac": 0.6364444444, "autogenerated": false, "ratio": 3.762541806020067, "config_...
from django import http from django.core.cache import cache from django.conf import settings from django.views.decorators.cache import add_never_cache_headers from django.views.generic import View from restthumbnails import defaults from restthumbnails.exceptions import ThumbnailError from restthumbnails.helpers impor...
{ "repo_name": "hcarvalhoalves/django-rest-thumbnails", "path": "restthumbnails/views.py", "copies": "1", "size": "1671", "license": "bsd-3-clause", "hash": 5389262142093844000, "line_mean": 38.7857142857, "line_max": 74, "alpha_frac": 0.6660682226, "autogenerated": false, "ratio": 4.5531335149863...
from django import http from django.core.exceptions import ImproperlyConfigured from django.template import RequestContext, loader from django.template.response import TemplateResponse from django.utils.functional import update_wrapper from django.utils.log import getLogger from django.utils.decorators import classonly...
{ "repo_name": "FHannes/intellij-community", "path": "python/lib/Lib/site-packages/django/views/generic/base.py", "copies": "73", "size": "5447", "license": "apache-2.0", "hash": 4951417165671378000, "line_mean": 33.04375, "line_max": 89, "alpha_frac": 0.5805030292, "autogenerated": false, "ratio"...
from django import http from django.core.exceptions import ImproperlyConfigured from django.template import RequestContext, loader from django.utils.functional import update_wrapper class classonlymethod(classmethod): def __get__(self, instance, owner): if instance is not None: raise Attribute...
{ "repo_name": "chrischambers/django-calendartools", "path": "calendartools/views/generic/base.py", "copies": "1", "size": "6518", "license": "bsd-3-clause", "hash": -5265140423402644000, "line_mean": 32.7720207254, "line_max": 89, "alpha_frac": 0.5782448604, "autogenerated": false, "ratio": 4.567...
from django import http from django.core.exceptions import ObjectDoesNotExist, PermissionDenied from django.test import RequestFactory import pytest from unittest.mock import Mock, patch from olympia import amo from olympia.access import acl from olympia.amo.tests import TestCase from olympia.files.decorators import...
{ "repo_name": "bqbn/addons-server", "path": "src/olympia/files/tests/test_decorators.py", "copies": "2", "size": "4107", "license": "bsd-3-clause", "hash": 1445932017359992000, "line_mean": 40.07, "line_max": 78, "alpha_frac": 0.683467251, "autogenerated": false, "ratio": 3.6474245115452932, "c...
from django import http from django.core.exceptions import ObjectDoesNotExist, PermissionDenied import olympia.core.logger from olympia import amo from olympia.access import acl from olympia.addons.decorators import owner_or_unlisted_reviewer log = olympia.core.logger.getLogger('z.addons') def allowed(request, fi...
{ "repo_name": "bqbn/addons-server", "path": "src/olympia/files/decorators.py", "copies": "2", "size": "1185", "license": "bsd-3-clause", "hash": 998791544433451100, "line_mean": 33.8529411765, "line_max": 74, "alpha_frac": 0.6902953586, "autogenerated": false, "ratio": 3.8225806451612905, "conf...
from django import http from django.core.exceptions import PermissionDenied as DjangoPermissionDenied from django.db.models import Prefetch, Q from django.db.transaction import non_atomic_requests from django.shortcuts import get_object_or_404, redirect from django.utils.encoding import force_text from django.utils.tra...
{ "repo_name": "aviarypl/mozilla-l10n-addons-server", "path": "src/olympia/ratings/views.py", "copies": "2", "size": "24603", "license": "bsd-3-clause", "hash": -3055164169174480400, "line_mean": 42.0122377622, "line_max": 79, "alpha_frac": 0.6185424542, "autogenerated": false, "ratio": 4.22006861...
from django import http from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404, render from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST import commonware.log from rest_fram...
{ "repo_name": "mudithkr/zamboni", "path": "mkt/receipts/views.py", "copies": "8", "size": "11501", "license": "bsd-3-clause", "hash": 5720778842557651000, "line_mean": 34.0640243902, "line_max": 79, "alpha_frac": 0.648030606, "autogenerated": false, "ratio": 3.856807511737089, "config_test": tr...
from django import http from django.core.exceptions import PermissionDenied from django.db.models import Prefetch, Q from django.db.transaction import non_atomic_requests from django.shortcuts import get_object_or_404, redirect from django.utils.encoding import force_text from django.utils.translation import ugettext ...
{ "repo_name": "harry-7/addons-server", "path": "src/olympia/ratings/views.py", "copies": "1", "size": "19941", "license": "bsd-3-clause", "hash": -7091861053149114000, "line_mean": 41.3375796178, "line_max": 79, "alpha_frac": 0.6334687328, "autogenerated": false, "ratio": 4.102242336967702, "co...
from django import http from django.core.exceptions import PermissionDenied from django.db.models import Q, Prefetch from django.db.transaction import non_atomic_requests from django.shortcuts import get_object_or_404, redirect from django.utils.encoding import force_text from django.utils.translation import ugettext ...
{ "repo_name": "tsl143/addons-server", "path": "src/olympia/ratings/views.py", "copies": "1", "size": "19862", "license": "bsd-3-clause", "hash": 1869354186247762200, "line_mean": 41.4401709402, "line_max": 79, "alpha_frac": 0.6330681704, "autogenerated": false, "ratio": 4.107113316790736, "conf...
from django import http from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from django.views.decorators.csrf import csrf_exempt import commonware.log import jingo from session_csrf import anonymous_csrf_exempt from tower import ugettext as _ from access import acl from ...
{ "repo_name": "Joergen/zamboni", "path": "mkt/receipts/views.py", "copies": "1", "size": "7834", "license": "bsd-3-clause", "hash": 3527236236003318300, "line_mean": 31.9159663866, "line_max": 79, "alpha_frac": 0.6668368649, "autogenerated": false, "ratio": 3.8121654501216544, "config_test": tr...
from django import http from django.core.exceptions import PermissionDenied from django.test.client import RequestFactory import mock from nose.tools import eq_ import mkt from mkt.site.tests import app_factory, TestCase from mkt.webapps import decorators as dec from mkt.webapps.models import Webapp class TestWebap...
{ "repo_name": "shahbaz17/zamboni", "path": "mkt/webapps/tests/test_decorators.py", "copies": "1", "size": "3540", "license": "bsd-3-clause", "hash": 4447339000279564000, "line_mean": 33.7058823529, "line_max": 74, "alpha_frac": 0.6338983051, "autogenerated": false, "ratio": 3.377862595419847, "...
from django import http from django.core.exceptions import PermissionDenied import mock from nose.tools import eq_ from test_utils import RequestFactory import amo.tests from addons import decorators as dec from addons.models import Addon class TestAddonView(amo.tests.TestCase): def setUp(self): self.a...
{ "repo_name": "wagnerand/zamboni", "path": "apps/addons/tests/test_decorators.py", "copies": "4", "size": "4907", "license": "bsd-3-clause", "hash": 939953623106218200, "line_mean": 36.1742424242, "line_max": 78, "alpha_frac": 0.6291012839, "autogenerated": false, "ratio": 3.2669773635153128, "...
from django import http from django.core.exceptions import PermissionDenied, ObjectDoesNotExist from django.test import RequestFactory import pytest from mock import Mock, patch from olympia import amo from olympia.amo.tests import TestCase from olympia.access import acl from olympia.files.decorators import allowed ...
{ "repo_name": "harikishen/addons-server", "path": "src/olympia/files/tests/test_decorators.py", "copies": "2", "size": "4061", "license": "bsd-3-clause", "hash": 632335412146296600, "line_mean": 40.0202020202, "line_max": 78, "alpha_frac": 0.6828367397, "autogenerated": false, "ratio": 3.63563115...
from django import http from django.core.exceptions import PermissionDenied, ObjectDoesNotExist import pytest from mock import Mock, patch from olympia import amo from olympia.amo.tests import TestCase from olympia.access import acl from olympia.files.decorators import allowed class AllowedTest(TestCase): def ...
{ "repo_name": "jpetto/olympia", "path": "src/olympia/files/tests/test_decorators.py", "copies": "1", "size": "3185", "license": "bsd-3-clause", "hash": 4280231620115009500, "line_mean": 40.9078947368, "line_max": 78, "alpha_frac": 0.6832025118, "autogenerated": false, "ratio": 3.558659217877095, ...
from django import http from django.core.exceptions import PermissionDenied, ObjectDoesNotExist import pytest from mock import Mock, patch import amo.tests from access import acl from files.decorators import allowed class AllowedTest(amo.tests.TestCase): def setUp(self): super(AllowedTest, self).setUp(...
{ "repo_name": "mrrrgn/olympia", "path": "apps/files/tests/test_decorators.py", "copies": "14", "size": "3133", "license": "bsd-3-clause", "hash": -7117806298954993000, "line_mean": 40.7733333333, "line_max": 78, "alpha_frac": 0.6801787424, "autogenerated": false, "ratio": 3.5846681922196795, "c...
from django import http from django.core.paginator import Paginator, InvalidPage from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from livesettings import config_value from product.models import Product from product.queries import bestsellers import logging ...
{ "repo_name": "grengojbo/satchmo", "path": "satchmo/apps/product/views/filters.py", "copies": "12", "size": "1481", "license": "bsd-3-clause", "hash": -3688759221161913000, "line_mean": 32.6590909091, "line_max": 85, "alpha_frac": 0.6657663741, "autogenerated": false, "ratio": 4.024456521739131, ...
from django import http from django.core.paginator import Paginator, InvalidPage from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from satchmo.configuration import config_value from satchmo.product.models import Product from satchmo.productratings.queries imp...
{ "repo_name": "roadhead/satchmo", "path": "satchmo/product/filterviews.py", "copies": "2", "size": "1885", "license": "bsd-3-clause", "hash": 4093148191626000000, "line_mean": 33.2727272727, "line_max": 85, "alpha_frac": 0.6673740053, "autogenerated": false, "ratio": 3.894628099173554, "config_...