text
stringlengths
0
1.05M
meta
dict
from djangorestframework.mixins import ModelMixin, CreateModelMixin, \ UpdateModelMixin from djangorestframework_extensions.utils import user_passes_test __all__ = ['RoleBasedExclusion', 'RestrictedModelMixin', 'RestrictedCreateModelMixin', 'RestrictedUpdateModelMixin'] class RoleBasedExclusion(object): ...
{ "repo_name": "bolster/djangorestframework_extensions", "path": "djangorestframework_extensions/mixins.py", "copies": "3", "size": "1649", "license": "bsd-2-clause", "hash": 3624105436947377000, "line_mean": 28.9818181818, "line_max": 73, "alpha_frac": 0.6337174045, "autogenerated": false, "ratio...
from djangorestframework.resources import ModelResource from djangorestframework.serializer import Serializer from django.core.urlresolvers import reverse from apps.users.resources import UserResource from models import Password, PasswordContact class PasswordContactResource(ModelResource): model = PasswordConta...
{ "repo_name": "vivek8943/pwlocker", "path": "pwlocker/apps/passwords/resources.py", "copies": "2", "size": "3016", "license": "mit", "hash": -7662483076871069000, "line_mean": 33.6666666667, "line_max": 86, "alpha_frac": 0.6452254642, "autogenerated": false, "ratio": 4.448377581120944, "config_...
from django_rest_model.db.query import RestQuerySet, PaginatedRestQuerySet class BaseManager: def __init__(self, model, **kwargs): self.model = model self.initial_filter_query = kwargs.get('initial_filter_query', {}) def order_by(self, *args, **kwargs): return self def using(sel...
{ "repo_name": "MarcoGlauser/django_rest_model", "path": "django_rest_model/db/managers.py", "copies": "1", "size": "1387", "license": "mit", "hash": -2669523391246870000, "line_mean": 24.7037037037, "line_max": 74, "alpha_frac": 0.6301369863, "autogenerated": false, "ratio": 3.940340909090909, ...
from djangorest.settings.base import * # NOQA (ignore all errors on this line) DEBUG = False TEMPLATE_DEBUG = DEBUG PAGE_CACHE_SECONDS = 60 # TODO: n a real production server this should have a proper url ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg...
{ "repo_name": "ruffers9/django-react-boilerplate", "path": "src/djangorest/djangorest/settings/prod.py", "copies": "1", "size": "2053", "license": "mit", "hash": 6104842562411867000, "line_mean": 23.1529411765, "line_max": 131, "alpha_frac": 0.524111057, "autogenerated": false, "ratio": 3.7669724...
from django_riak_engine import connection from django_riak_engine import client from djangotoolbox.db.base import NonrelDatabaseFeatures, \ NonrelDatabaseOperations, NonrelDatabaseWrapper, \ NonrelDatabaseValidation, NonrelDatabaseIntrospection, \ NonrelDatabaseCreation # TODO: You can either use the typ...
{ "repo_name": "oubiwann-unsupported/django-riak-engine", "path": "django_riak_engine/db.py", "copies": "1", "size": "1953", "license": "bsd-2-clause", "hash": -4895147369866877000, "line_mean": 33.2631578947, "line_max": 79, "alpha_frac": 0.6927803379, "autogenerated": false, "ratio": 4.254901960...
from django_riak_engine import meta from django_riak_engine.util import dist CLASSIFIERS = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Topic :: Internet', 'Topic :: Database', 'Topic :: Software Development :: Libraries :: P...
{ "repo_name": "oubiwann-unsupported/django-riak-engine", "path": "setup.py", "copies": "1", "size": "1194", "license": "bsd-2-clause", "hash": -1643081109097430000, "line_mean": 25.5333333333, "line_max": 73, "alpha_frac": 0.6206030151, "autogenerated": false, "ratio": 3.532544378698225, "confi...
from django_roa.remoteauth.models import User from django.contrib.auth.backends import ModelBackend class RemoteUserModelBackend(ModelBackend): """ Authenticates against django_roa.remoteauth.models.RemoteUser. """ def authenticate(self, username=None, password=None, **kwargs): try: ...
{ "repo_name": "bjarnoldus/django-roa", "path": "django_roa/remoteauth/backends.py", "copies": "1", "size": "1251", "license": "bsd-3-clause", "hash": -5886208254959944000, "line_mean": 35.7941176471, "line_max": 78, "alpha_frac": 0.5835331735, "autogenerated": false, "ratio": 4.389473684210526, ...
from django_roles.managers import DRUserManager __author__ = 'cenk' from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import Group from mptt.fields import TreeForeignKey from mptt.models import MPTTModel from django....
{ "repo_name": "cenkbircanoglu/django-roles", "path": "django_roles/models.py", "copies": "1", "size": "1711", "license": "mit", "hash": 965885574833852700, "line_mean": 28.0169491525, "line_max": 111, "alpha_frac": 0.6867329047, "autogenerated": false, "ratio": 4.083532219570405, "config_test":...
from djangorpc import RpcRouter, Error, Msg, RpcHttpResponse from djangorpc.decorators import add_request_to_kwargs, login_required from djangorpc.exceptions import RpcExceptionEvent class TricksApiClass(object): def func1(self, user, request): return Msg(u'func1') class TricksOneApiClass(object): ...
{ "repo_name": "Alerion/django-rpc", "path": "example/example/tricks/rpc.py", "copies": "1", "size": "1861", "license": "mit", "hash": 6537246442712208000, "line_mean": 21.421686747, "line_max": 70, "alpha_frac": 0.6206340677, "autogenerated": false, "ratio": 3.599613152804642, "config_test": fa...
from django_rq import get_worker, get_queue from avocado.conf import settings from avocado.query import utils def run_jobs(): """ Execute all the pending jobs. """ get_worker(settings.ASYNC_QUEUE).work(burst=True) def get_job(job_id): """ Return the job for the specified ID or None if it ca...
{ "repo_name": "murphyke/avocado", "path": "avocado/async/utils.py", "copies": "2", "size": "2070", "license": "bsd-2-clause", "hash": 7318538241850056000, "line_mean": 21.5, "line_max": 77, "alpha_frac": 0.6260869565, "autogenerated": false, "ratio": 3.75, "config_test": false, "has_no_keywor...
from django_rq import job from django.apps import apps import os import shutil import subprocess import re from pathlib import Path import dateutil.parser from interface.path_processor import PathProcessor @job def process_wiki(repo_id, file_change=None): file_change = file_change or {} Repo = apps.get_mo...
{ "repo_name": "ZeroCater/Eyrie", "path": "documents/tasks/wiki_processor.py", "copies": "1", "size": "4122", "license": "mit", "hash": -1124542079010551600, "line_mean": 27.4275862069, "line_max": 106, "alpha_frac": 0.6428918001, "autogenerated": false, "ratio": 3.5260906757912744, "config_test...
from django_rq import job from django.conf import settings from github3 import login from django.contrib.sites.shortcuts import get_current_site from django.core.urlresolvers import reverse from providers.services import HerokuProvider @job def handle_deployment_status(data): pass @job def handle_status(uuid, ...
{ "repo_name": "jpulec/purgatory", "path": "src/deployments/tasks.py", "copies": "1", "size": "1175", "license": "mit", "hash": -8400676303859682000, "line_mean": 21.1698113208, "line_max": 65, "alpha_frac": 0.6893617021, "autogenerated": false, "ratio": 3.7183544303797467, "config_test": false,...
from django_rq import job from fit4school.fitbit_api.slack import post import logging import datetime from constance import config LOGGER = logging.getLogger(__name__) def clean_value(value): if isinstance(value, datetime.datetime): return value.ctime() return value @job('notification') def notify_...
{ "repo_name": "goodes/fit4school", "path": "fit4school/core/notifications.py", "copies": "1", "size": "1196", "license": "apache-2.0", "hash": 535122452316463900, "line_mean": 26.8139534884, "line_max": 88, "alpha_frac": 0.6588628763, "autogenerated": false, "ratio": 3.6132930513595167, "config...
from django_rq import job import re import requests import uuid import analytics from lxml import html, etree from datetime import datetime from haystack import connection_router, connections from .models import Comic, Issue, Creator from .helpers import get_url, parse_name, parse_title analytics.write_key = '3jPlLT...
{ "repo_name": "ZucchiniZe/nightcrawler", "path": "listing/jobs.py", "copies": "1", "size": "4442", "license": "mit", "hash": 6241471332658097000, "line_mean": 29.6344827586, "line_max": 117, "alpha_frac": 0.5826204412, "autogenerated": false, "ratio": 3.3779467680608364, "config_test": false, ...
from django_rt.views import RTView, RTTemplateResponse, RTObservable, RTQueryProxy from models import Entry from django.contrib.auth import authenticate, login from django.db.models import Sum import datetime def update_total_hours(request): show_declared = request.session.get('declared', False) total_hours ...
{ "repo_name": "vistacan/django-rt", "path": "timesheet/views.py", "copies": "1", "size": "4937", "license": "mit", "hash": -132285382155819950, "line_mean": 28.2130177515, "line_max": 82, "alpha_frac": 0.5458780636, "autogenerated": false, "ratio": 4.392348754448399, "config_test": false, "ha...
from djangosaber.util import key import six import logging logging.basicConfig(level=logging.debug) # logger = logging.getLogger(__file__) # logger.setLevel(logging.debug) class OrmMixin(object): _memory = None def objects(self): return self def all(self): return self def first(sel...
{ "repo_name": "futurice/django-saber", "path": "djangosaber/django/impl.py", "copies": "1", "size": "1878", "license": "bsd-3-clause", "hash": 1529197823240864500, "line_mean": 27.8923076923, "line_max": 90, "alpha_frac": 0.5841320554, "autogenerated": false, "ratio": 3.266086956521739, "config...
from djangosanetesting.cases import DatabaseTestCase from django.conf import settings from django.contrib.auth.models import User, AnonymousUser from mypage.pages.models import Page from mypage.pages.views import get_page from unit_project.helpers import create_filled_default_page, SessionWrapper from unit_project i...
{ "repo_name": "ella/mypage", "path": "tests/unit_project/test_pages/test_page_retrieval.py", "copies": "1", "size": "5289", "license": "bsd-3-clause", "hash": -3303221232275898400, "line_mean": 40.9761904762, "line_max": 102, "alpha_frac": 0.6834940442, "autogenerated": false, "ratio": 3.57848443...
from djangosanetesting.cases import HttpTestCase, SeleniumTestCase from djangosanetesting.utils import get_live_server_path import os from mock import Mock from tempfile import mkdtemp from shutil import rmtree from subprocess import Popen, PIPE from django.contrib.auth.models import User from django.conf import sett...
{ "repo_name": "centrumholdings/cthulhubot", "path": "tests/example_project/tests/helpers.py", "copies": "1", "size": "11031", "license": "bsd-3-clause", "hash": -2599288026662462500, "line_mean": 32.2259036145, "line_max": 123, "alpha_frac": 0.6220650893, "autogenerated": false, "ratio": 3.640594...
from djangosanetesting.cases import * from members.models import BidPolicy from decimal import Decimal from payments_dumpster.signals import free_quotes_payment_signal from dumpster.models import MemberCompany, Region, MemberCompanyRegionBound, FreeQuotesRequest from mockito import * class TestSignalDispatchCase(...
{ "repo_name": "vshulyak/django-generic-payments", "path": "generic_payments/tests/payments_test.py", "copies": "1", "size": "1069", "license": "bsd-3-clause", "hash": -9143935834994619000, "line_mean": 31.4242424242, "line_max": 98, "alpha_frac": 0.7090739008, "autogenerated": false, "ratio": 3.7...
from djangosanetesting.cases import UnitTestCase from mock import Mock from django.http import QueryDict from django.forms import ValidationError from django.utils.simplejson import dumps, loads from django.forms import Form, ValidationError from cthulhubot.assignment import Assignment from cthulhubot.forms import ge...
{ "repo_name": "centrumholdings/cthulhubot", "path": "tests/unit_project/tests/test_schedulers.py", "copies": "1", "size": "8313", "license": "bsd-3-clause", "hash": -4199644015861792300, "line_mean": 34.678111588, "line_max": 144, "alpha_frac": 0.5258029592, "autogenerated": false, "ratio": 4.121...
from djangosanetesting import cases from django.contrib.auth.models import User,Permission from django.contrib.contenttypes.models import ContentType import denorm from denorm import denorms import models class TestSkip(cases.DestructiveDatabaseTestCase): """ Tests for the skip feature. """ def ...
{ "repo_name": "Eksmo/django-denorm", "path": "test_denorm_project/test_app/tests.py", "copies": "1", "size": "22517", "license": "bsd-3-clause", "hash": -7305282588593386000, "line_mean": 38.7125220459, "line_max": 111, "alpha_frac": 0.6435137896, "autogenerated": false, "ratio": 3.32550583370255...
from djangosanetesting import DatabaseTestCase from cthulhubot.models import Buildmaster, Project class TestBuildmaster(DatabaseTestCase): def setUp(self): super(TestBuildmaster, self).setUp() self.project = Project.objects.create(name='test', slug='test', tracker_uri='http://example.com', repos...
{ "repo_name": "centrumholdings/cthulhubot", "path": "tests/unit_project/tests/test_buildmaster.py", "copies": "1", "size": "1426", "license": "bsd-3-clause", "hash": -8545278320299398000, "line_mean": 45, "line_max": 142, "alpha_frac": 0.7005610098, "autogenerated": false, "ratio": 3.703896103896...
from djangosanetesting import DatabaseTestCase from django.conf import settings from django import forms from unit_project.helpers import create_filled_default_page, build_request from unit_project import template_loader from mypage.rsswidgets.models import RSSWidget from mypage.rsswidgets import forms as rss_forms ...
{ "repo_name": "ella/mypage", "path": "tests/unit_project/test_rsswidgets/test_view_add_rsswidget.py", "copies": "1", "size": "3400", "license": "bsd-3-clause", "hash": -2563574624880811500, "line_mean": 40.4634146341, "line_max": 115, "alpha_frac": 0.6814705882, "autogenerated": false, "ratio": 3...
from djangosanetesting import DestructiveDatabaseTestCase from django.conf import settings from unit_project.helpers import create_filled_default_page, build_request from unit_project import template_loader from unit_project.testwidgets.models import TestWidget from mypage.widgets.models import Widget from mypage.pa...
{ "repo_name": "ella/mypage", "path": "tests/unit_project/test_pages/test_view_add_widget.py", "copies": "1", "size": "4602", "license": "bsd-3-clause", "hash": -3505478796160172000, "line_mean": 38, "line_max": 102, "alpha_frac": 0.6568883094, "autogenerated": false, "ratio": 3.860738255033557, ...
from djangosanetesting import UnitTestCase, DatabaseTestCase from cthulhubot.commands import get_available_commands, get_command, get_undiscovered_commands from cthulhubot.models import Command from cthulhubot.err import UnconfiguredCommandError class TestCommandsDiscovery(UnitTestCase): def test_debian_package_...
{ "repo_name": "centrumholdings/cthulhubot", "path": "tests/unit_project/tests/test_commands.py", "copies": "1", "size": "3755", "license": "bsd-3-clause", "hash": -1787693601201052000, "line_mean": 40.2637362637, "line_max": 104, "alpha_frac": 0.696138482, "autogenerated": false, "ratio": 3.64917...
from djangosanetesting import UnitTestCase from django import forms from django.http import QueryDict from mypage.widgets.templatetags.widgets import choice_list class TestForm(forms.Form): choice_field = forms.ChoiceField(choices=tuple((i, i) for i in range(1, 5)), initial=3) multiple_choice_field = forms.M...
{ "repo_name": "ella/mypage", "path": "tests/unit_project/test_widgets/test_choice_list_template_filter.py", "copies": "1", "size": "2942", "license": "bsd-3-clause", "hash": 8687050749047533000, "line_mean": 44.96875, "line_max": 126, "alpha_frac": 0.6811692726, "autogenerated": false, "ratio": 3...
from django_scss.settings import SCSS_EXECUTABLE, SCSS_USE_COMPASS, SCSS_ROOT,\ SCSS_OUTPUT_DIR from django.conf import settings import logging import os import posixpath import re import subprocess logger = logging.getLogger("django_scss") STATIC_ROOT = getattr(settings, "STATIC_ROOT", getattr(settings, "MEDIA...
{ "repo_name": "andreyfedoseev/django-scss", "path": "django_scss/utils.py", "copies": "1", "size": "1918", "license": "mit", "hash": 8820395701090461000, "line_mean": 27.6268656716, "line_max": 95, "alpha_frac": 0.6459854015, "autogenerated": false, "ratio": 3.443447037701975, "config_test": fa...
from django_scss.settings import SCSS_MTIME_DELAY from django.core.cache import cache from django.utils.encoding import smart_str from hashlib import md5 import os.path import socket def get_hexdigest(plaintext, length=None): digest = md5(smart_str(plaintext)).hexdigest() if length: return digest[:len...
{ "repo_name": "andreyfedoseev/django-scss", "path": "django_scss/cache.py", "copies": "1", "size": "1067", "license": "mit", "hash": 4829054620701199000, "line_mean": 25.0243902439, "line_max": 62, "alpha_frac": 0.671977507, "autogenerated": false, "ratio": 3.5805369127516777, "config_test": fa...
from django_scss.utils import compile_scss, logger from django_scss.settings import SCSS_DEVMODE_WATCH_DIRS, SCSS_OUTPUT_DIR, SCSS_DEVMODE_EXCLUDE from .utils import STATIC_ROOT import os import re import sys import time import threading WATCHED_FILES = {} SCSS_IMPORT_RE = re.compile(r"""@import\s+['"](.+?\.scss)['"]...
{ "repo_name": "andreyfedoseev/django-scss", "path": "django_scss/devmode.py", "copies": "1", "size": "2604", "license": "mit", "hash": -6648477969288228000, "line_mean": 38.4545454545, "line_max": 122, "alpha_frac": 0.5384024578, "autogenerated": false, "ratio": 3.9157894736842107, "config_test...
from django_search_views.search import SearchCategory, Search from srd20.models import Spell, Feat, Monster # These are the fields searched by the full text search SEARCH_FIELDS = ( 'name', 'altname', 'short_description', 'description', 'school', 'subschool', 'descriptor', 'material_co...
{ "repo_name": "machinalis/django-srd20", "path": "search/search_site.py", "copies": "1", "size": "1086", "license": "bsd-3-clause", "hash": -7244903080688594000, "line_mean": 23.6818181818, "line_max": 72, "alpha_frac": 0.6813996317, "autogenerated": false, "ratio": 3.537459283387622, "config_t...
from django_select2.forms import ( Select2Widget as DS2_Select2Widget, Select2MultipleWidget as DS2_Select2MultipleWidget, ModelSelect2Widget as DS2_ModelSelect2Widget, ModelSelect2MultipleWidget as DS2_ModelSelect2MultipleWidget, Select2TagWidget as DS2_Select2TagWidget, ) from django.core.validato...
{ "repo_name": "swcarpentry/amy", "path": "amy/workshops/fields.py", "copies": "1", "size": "7264", "license": "mit", "hash": -4806560330305220000, "line_mean": 34.9603960396, "line_max": 116, "alpha_frac": 0.6631332599, "autogenerated": false, "ratio": 4.1795166858458, "config_test": false, "...
from django_select2.views import NO_ERR_RESP from django_select2.fields import AutoSelect2MultipleField, AutoModelSelect2Field, Select2ChoiceField from .models import Animal, Color, Breed class MultipleAnimalsField(AutoSelect2MultipleField): def get_results(self, request, term, page, context): # Fetch all...
{ "repo_name": "savioabuga/phoenix-template", "path": "phoenix/apps/animals/fields.py", "copies": "1", "size": "1290", "license": "bsd-3-clause", "hash": -818350524786413200, "line_mean": 31.25, "line_max": 101, "alpha_frac": 0.7031007752, "autogenerated": false, "ratio": 3.5933147632311977, "co...
from django_selenium.testcases import SeleniumTestCase from metashare import settings, test_utils from metashare.repository.seltests.test_utils import setup_screenshots_folder, \ import_dir, click_and_wait from metashare.settings import DJANGO_BASE, ROOT_PATH import time from django.core.management import cal...
{ "repo_name": "JuliBakagianni/CEF-ELRC", "path": "metashare/repository/seltests/test_filter.py", "copies": "1", "size": "62512", "license": "bsd-3-clause", "hash": 4678575710326271000, "line_mean": 65.7269772481, "line_max": 139, "alpha_frac": 0.6327905042, "autogenerated": false, "ratio": 3.5477...
from django_seo_js import settings from .base import SEOBackendBase, RequestsBasedBackend class PrerenderIO(SEOBackendBase, RequestsBasedBackend): """Implements the backend for prerender.io""" BASE_URL = "https://service.prerender.io/" RECACHE_URL = "https://api.prerender.io/recache" def __init__(sel...
{ "repo_name": "skoczen/django-seo-js", "path": "django_seo_js/backends/prerender.py", "copies": "1", "size": "3151", "license": "mit", "hash": 7472216702371686000, "line_mean": 33.25, "line_max": 82, "alpha_frac": 0.6090130117, "autogenerated": false, "ratio": 3.861519607843137, "config_test": ...
from django_seo_js import settings from django_seo_js.backends.base import SEOBackendBase from django_seo_js.backends.prerender import PrerenderIO from django.http import HttpResponse, Http404 import requests import resource class CustomPrerenderIO(PrerenderIO): """Implements the backend for an arbitrary prerende...
{ "repo_name": "EndyKaufman/django-postgres-angularjs-blog", "path": "app/manager/html_cache/prerender.py", "copies": "1", "size": "3254", "license": "mit", "hash": -2371201123276508000, "line_mean": 33.2526315789, "line_max": 87, "alpha_frac": 0.5808236017, "autogenerated": false, "ratio": 4.1085...
from django_services.api import DjangoServiceAPI, register from .models import Brand, Model, Car from .service import BrandService, CarService, ModelService from .serializers import BrandSerializer, CarSerializer, ModelSerializer class CarAPI(DjangoServiceAPI): serializer_class = CarSerializer service_class = ...
{ "repo_name": "snbuback/django_services", "path": "example/myapp/api.py", "copies": "1", "size": "1521", "license": "apache-2.0", "hash": 4814363861843140000, "line_mean": 26.6727272727, "line_max": 72, "alpha_frac": 0.6009204471, "autogenerated": false, "ratio": 4.056, "config_test": false, ...
from .django_settings import * from wooey.version import DJANGO_VERSION, DJ110 from django.utils.translation import ugettext_lazy as _ INSTALLED_APPS += ( # 'corsheaders', 'wooey', ) if DJANGO_VERSION < DJ110: MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) MIDDLEWARE_CLASSES.append('{{ project_name }}....
{ "repo_name": "wooey/Wooey", "path": "wooey/conf/project_template/settings/wooey_settings.py", "copies": "1", "size": "1333", "license": "bsd-3-clause", "hash": -3964541111412052500, "line_mean": 28.6222222222, "line_max": 89, "alpha_frac": 0.672168042, "autogenerated": false, "ratio": 3.54521276...
from django.shortcuts import get_list_or_404, get_object_or_404 from .utils import jsonify_schedule, EventCalendar, alert_requested, \ request_granted, is_admin from django.http import HttpResponse from django.contrib import messages from django.views.generic.detail import DetailView from django.contrib.auth.decorator...
{ "repo_name": "mutaku/bookit", "path": "bookit_django/scheduling/views.py", "copies": "1", "size": "5480", "license": "bsd-2-clause", "hash": -5426083245145660000, "line_mean": 31.426035503, "line_max": 78, "alpha_frac": 0.697080292, "autogenerated": false, "ratio": 3.199065966141273, "config_t...
from django.shortcuts import get_list_or_404, get_object_or_404, render from django.views.decorators.http import require_GET from ratelimit.decorators import ratelimit from kuma.core.decorators import ( block_user_agents, ensure_wiki_domain, shared_cache_control, ) from kuma.core.utils import paginate fro...
{ "repo_name": "Elchi3/kuma", "path": "kuma/wiki/views/list.py", "copies": "2", "size": "7952", "license": "mpl-2.0", "hash": -8445406509530739000, "line_mean": 31.4571428571, "line_max": 88, "alpha_frac": 0.6537977867, "autogenerated": false, "ratio": 3.5643209323173464, "config_test": false, ...
from django.shortcuts import get_list_or_404, get_object_or_404, render_to_response from quran.models import * def index(request, template_name='quran/index.html'): suras = get_list_or_404(Sura) return render_to_response(template_name, {'suras': suras}) def sura(request, sura_number, translation=1, template_n...
{ "repo_name": "idris/django-quran", "path": "quran/views.py", "copies": "1", "size": "2164", "license": "bsd-3-clause", "hash": -4858246269006051000, "line_mean": 48.2045454545, "line_max": 119, "alpha_frac": 0.6936229205, "autogenerated": false, "ratio": 2.785070785070785, "config_test": false...
from django.shortcuts import get_list_or_404 from rest_framework.authentication import SessionAuthentication, TokenAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from rest_framework import serializers from rest_...
{ "repo_name": "zatarus/drf-tracking", "path": "tests/views.py", "copies": "1", "size": "2011", "license": "isc", "hash": 4652832594558947000, "line_mean": 27.7285714286, "line_max": 84, "alpha_frac": 0.7359522626, "autogenerated": false, "ratio": 4.362255965292841, "config_test": false, "has_...
from django.shortcuts import get_list_or_404, render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views.generic.detail import DetailView from booking.models import Train, Ticket from booking.forms import TicketForm from booking.utils import class_name, update_co...
{ "repo_name": "vaibhavmule/reservation", "path": "booking/views.py", "copies": "1", "size": "1907", "license": "mit", "hash": -4993377621595800000, "line_mean": 32.4561403509, "line_max": 91, "alpha_frac": 0.6402726796, "autogenerated": false, "ratio": 3.915811088295688, "config_test": false, ...
from django.shortcuts import get_list_or_404, render from .models import (BandSawBlade, BandSawBladeIndicator, CircularSawBlade, CircularSawBladeIndicator, HackSawBlade, HoleSaw, HoleSawDiameter, JigSawBlade, ProductGroup, SableSawBlade, SawBlade) def in...
{ "repo_name": "n2o/guhema", "path": "products/views.py", "copies": "1", "size": "3287", "license": "mit", "hash": 6898695371412755000, "line_mean": 36.3522727273, "line_max": 120, "alpha_frac": 0.5902038333, "autogenerated": false, "ratio": 3.6685267857142856, "config_test": false, "has_no_ke...
from django.shortcuts import get_object_or_404, get_list_or_404 from rest_framework import authentication, status from rest_framework.permissions import IsAuthenticated from rest_framework.views import APIView from rest_framework.response import Response from notes.apps.writer.models import Note, Notebook from notes.ap...
{ "repo_name": "NTsystems/NoTes-API", "path": "notes/apps/writer/api.py", "copies": "1", "size": "6451", "license": "mit", "hash": -1961804505130603800, "line_mean": 33.1322751323, "line_max": 81, "alpha_frac": 0.6023872268, "autogenerated": false, "ratio": 4.611150822015725, "config_test": fals...
from django.shortcuts import get_object_or_404, Http404 from django.http import JsonResponse from django.contrib.auth.models import User from butir.models import ButirPerekayasa from utama.models import Personil from utiliti.models import Profil def cek_keanggotaan(user, pk_kegiatan): anggota_kegiatan = User.obj...
{ "repo_name": "akbarpn136/perek-dj", "path": "tugas/perekayasa.py", "copies": "1", "size": "5208", "license": "cc0-1.0", "hash": 4050748015918155300, "line_mean": 31.9620253165, "line_max": 111, "alpha_frac": 0.4921274962, "autogenerated": false, "ratio": 3.255, "config_test": false, "has_no_...
from django.shortcuts import get_object_or_404, Http404 from django.views.decorators.cache import cache_page from canvas.models import get_mapping_id_from_short_id, UserKV from canvas.shortcuts import r2r_jinja from canvas.view_guards import require_staff from drawquest.apps.drawquest_auth.details_models import UserDe...
{ "repo_name": "drawquest/drawquest-web", "path": "website/drawquest/apps/quest_comments/views.py", "copies": "1", "size": "1529", "license": "bsd-3-clause", "hash": -8540446470760630000, "line_mean": 35.4047619048, "line_max": 109, "alpha_frac": 0.715500327, "autogenerated": false, "ratio": 3.451...
from django.shortcuts import get_object_or_404, Http404 from canvas.cache_patterns import cache_page, CachedCall from canvas.shortcuts import r2r_jinja from canvas.view_guards import require_user from drawquest.apps.drawquest_auth.models import User from drawquest.apps.profiles import models from drawquest.apps.follow...
{ "repo_name": "drawquest/drawquest-web", "path": "website/drawquest/apps/profiles/views.py", "copies": "1", "size": "1428", "license": "bsd-3-clause", "hash": -3510781145453922300, "line_mean": 31.4545454545, "line_max": 89, "alpha_frac": 0.7289915966, "autogenerated": false, "ratio": 3.738219895...
from django.shortcuts import get_object_or_404, Http404 from canvas.models import get_mapping_id_from_short_id from drawquest.apps.quests.models import Quest, ScheduledQuest class QuestPreview(object): def __init__(self, quest): self.quest = quest self.curator = "" self.timestamp = None ...
{ "repo_name": "drawquest/drawquest-web", "path": "website/drawquest/apps/quest_scheduler/models.py", "copies": "1", "size": "1716", "license": "bsd-3-clause", "hash": 9221049198338401000, "line_mean": 32.6470588235, "line_max": 92, "alpha_frac": 0.6783216783, "autogenerated": false, "ratio": 3.48...
from django.shortcuts import get_object_or_404, Http404, redirect from django.urls import reverse from django.views.generic import DetailView, UpdateView from django.http import HttpResponse from django.contrib.auth.mixins import LoginRequiredMixin from django.utils.http import urlencode from froide.helper.utils impor...
{ "repo_name": "stefanw/froide", "path": "froide/letter/views.py", "copies": "1", "size": "5779", "license": "mit", "hash": -2326366963726193700, "line_mean": 31.6497175141, "line_max": 84, "alpha_frac": 0.595085655, "autogenerated": false, "ratio": 4.1014904187366925, "config_test": false, "h...
from django.shortcuts import get_object_or_404, HttpResponse, HttpResponseRedirect, redirect from django.template import RequestContext from django.utils import simplejson from django.utils.http import base36_to_int, int_to_base36 from django.template.defaultfilters import slugify from django.template.loader import ren...
{ "repo_name": "drx/archfinch", "path": "main/views.py", "copies": "1", "size": "14343", "license": "mit", "hash": -887505537149601800, "line_mean": 30.8733333333, "line_max": 164, "alpha_frac": 0.630621209, "autogenerated": false, "ratio": 3.852538275584206, "config_test": false, "has_no_keyw...
from django.shortcuts import get_object_or_404, HttpResponse from django.core import serializers from lobbyingph.models import Issue, Bill import json def issue(request, pk): issue = get_object_or_404(Issue, pk=pk) response = { 'nodes': [], 'links': [] } for exp in issue.exp_direct_co...
{ "repo_name": "AxisPhilly/lobbying.ph-django", "path": "api/views.py", "copies": "1", "size": "1351", "license": "mit", "hash": 7122985476116812000, "line_mean": 26.04, "line_max": 74, "alpha_frac": 0.4937083642, "autogenerated": false, "ratio": 4.131498470948012, "config_test": false, "has_n...
from django.shortcuts import get_object_or_404, HttpResponse from django.views.generic import ListView, View, CreateView from django.template.loader import render_to_string from chat.models import Channel from chat.forms import MessageForm, ChannelForm from common.mixins import AjaxRequiredMixin, LoginRedirectMixin ...
{ "repo_name": "Eugene-Dobrorodnov/prom_chat", "path": "prom_chat/chat/views.py", "copies": "1", "size": "1643", "license": "mit", "hash": -1660529228298001000, "line_mean": 31.86, "line_max": 75, "alpha_frac": 0.6676810712, "autogenerated": false, "ratio": 3.997566909975669, "config_test": fals...
from django.shortcuts import get_object_or_404 from ..core.models import Employee, Register, Company from rest_framework import serializers class CompanySerializer(serializers.HyperlinkedModelSerializer): '''Tells Django how to serialize a Company''' class Meta: model = Company fields = 'name'...
{ "repo_name": "HeaTSolutions/CatracaDigital", "path": "CatracaDigital/api/serializers.py", "copies": "1", "size": "1329", "license": "mit", "hash": -8815999680735063000, "line_mean": 34.9189189189, "line_max": 126, "alpha_frac": 0.690744921, "autogenerated": false, "ratio": 4.076687116564417, "...
from django.shortcuts import get_object_or_404 from django.conf import settings from django.http import StreamingHttpResponse, BadHeaderError from unidecode import unidecode from wsgiref.util import FileWrapper from wagtail.utils.sendfile import sendfile from wagtail.utils import sendfile_streaming_backend from wagt...
{ "repo_name": "serzans/wagtail", "path": "wagtail/wagtaildocs/views/serve.py", "copies": "1", "size": "2318", "license": "bsd-3-clause", "hash": -4995085683332257000, "line_mean": 36.3870967742, "line_max": 101, "alpha_frac": 0.6820534944, "autogenerated": false, "ratio": 4.440613026819923, "co...
from django.shortcuts import get_object_or_404 from django.conf import settings from canvas.forms import validate_and_clean_comment from canvas.models import Comment from canvas.templatetags.jinja_base import render_jinja_to_string from canvas.view_guards import require_staff, require_user from drawquest.api_decorator...
{ "repo_name": "drawquest/drawquest-web", "path": "website/drawquest/apps/submit_quest/api.py", "copies": "1", "size": "1131", "license": "bsd-3-clause", "hash": -1829864141610651600, "line_mean": 28, "line_max": 97, "alpha_frac": 0.6967285588, "autogenerated": false, "ratio": 3.782608695652174, ...
from django.shortcuts import get_object_or_404 from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import render from page.models import Page from page import forms @login_required def create(request): if not request.user.is_superuser: rais...
{ "repo_name": "F483/trainlessmagazine.com", "path": "page/views.py", "copies": "1", "size": "2475", "license": "mit", "hash": 8177713326611554000, "line_mean": 28.4642857143, "line_max": 67, "alpha_frac": 0.6602020202, "autogenerated": false, "ratio": 3.5714285714285716, "config_test": false, ...
from django.shortcuts import get_object_or_404 from django.contrib.auth.decorators import login_required from django.template.loader import render_to_string from django.core.exceptions import ObjectDoesNotExist from dajax.core import Dajax from views import get_pagination_page, get_filtered_queryset, \ parse_filte...
{ "repo_name": "Kami/munin_exchange", "path": "munin_exchange/apps/plugins/ajax.py", "copies": "1", "size": "3010", "license": "bsd-3-clause", "hash": 8041921146001016000, "line_mean": 26.1261261261, "line_max": 97, "alpha_frac": 0.680730897, "autogenerated": false, "ratio": 3.1452455590386625, ...
from django.shortcuts import get_object_or_404 from django.contrib.auth.decorators import login_required from django.views.decorators.gzip import gzip_page from annoying.decorators import ajax_request from parsr.models import Branch from parsr.views.author import parse_filters def get_branch(branch_id): return...
{ "repo_name": "frontendphil/analyzr", "path": "parsr/api/branch.py", "copies": "1", "size": "1261", "license": "mit", "hash": -8583463948248197000, "line_mean": 22.3518518519, "line_max": 82, "alpha_frac": 0.7438540841, "autogenerated": false, "ratio": 3.389784946236559, "config_test": false, ...
from django.shortcuts import get_object_or_404 from django.contrib.auth import authenticate, login as auth_login from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.template import RequestContext from django.utils...
{ "repo_name": "thoas/i386", "path": "src/milkshape/application/internals/account/views.py", "copies": "1", "size": "3866", "license": "mit", "hash": 5408017989302625000, "line_mean": 35.4716981132, "line_max": 91, "alpha_frac": 0.6880496637, "autogenerated": false, "ratio": 3.920892494929006, "...
from django.shortcuts import get_object_or_404 from django.contrib.auth import authenticate from rest_framework import generics, status from rest_framework.response import Response from rest_framework.authtoken.models import Token from rest_framework.authentication import TokenAuthentication from rest_framework.permis...
{ "repo_name": "pu6ki/tarina", "path": "users/views.py", "copies": "1", "size": "2694", "license": "mit", "hash": -1088259020305819300, "line_mean": 31.4578313253, "line_max": 83, "alpha_frac": 0.6844840386, "autogenerated": false, "ratio": 4.352180936995153, "config_test": false, "has_no_keyw...
from django.shortcuts import get_object_or_404 from django.contrib.auth.models import AnonymousUser from rest_framework.response import Response from rest_framework import generics, viewsets, mixins, exceptions, status from rest_framework.decorators import list_route from rest_framework.permissions import IsAuthenticat...
{ "repo_name": "CMPUT404/socialdistribution", "path": "api/views/content.py", "copies": "1", "size": "8103", "license": "apache-2.0", "hash": 7921371728116738000, "line_mean": 34.8539823009, "line_max": 125, "alpha_frac": 0.6511168703, "autogenerated": false, "ratio": 4.406199021207178, "config_...
from django.shortcuts import get_object_or_404 from django.contrib.auth.models import User from django.http import HttpResponse from adb.frontend.auth.decorators import (checks_permissions, require_permissions, permission_required) fro...
{ "repo_name": "AnimeDB/adb-browser-frontend", "path": "adb/frontend/collection/views.py", "copies": "1", "size": "3229", "license": "unlicense", "hash": -6263848059711889000, "line_mean": 30.6666666667, "line_max": 84, "alpha_frac": 0.5534221121, "autogenerated": false, "ratio": 4.265521796565389...
from django.shortcuts import get_object_or_404 from django.contrib.auth.models import User from rest_framework import generics from rest_framework.permissions import IsAuthenticated from restapi.permissions import IsOwnerOrReadOnly from .serializers import BucketlistSerializer, UserSerializer, \ BucketlistItemSeria...
{ "repo_name": "andela-ggikera/djangular-bucketlist-app", "path": "bucketlist/restapi/views.py", "copies": "1", "size": "2488", "license": "mit", "hash": -8178998961464969000, "line_mean": 36.1343283582, "line_max": 79, "alpha_frac": 0.7242765273, "autogenerated": false, "ratio": 4.297063903281519...
from django.shortcuts import get_object_or_404 from django.contrib.auth.models import User from rest_framework import generics, viewsets, status from rest_framework.response import Response from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated from .seria...
{ "repo_name": "pu6ki/tarina", "path": "stories/views.py", "copies": "1", "size": "8964", "license": "mit", "hash": -8296748781814777000, "line_mean": 29.698630137, "line_max": 94, "alpha_frac": 0.6415662651, "autogenerated": false, "ratio": 3.984, "config_test": false, "has_no_keywords": fals...
from django.shortcuts import get_object_or_404 from django.contrib.auth.models import User from rest_framework.permissions import IsAuthenticated from rest_framework.generics import RetrieveAPIView from rest_framework.permissions import IsAuthenticated, IsAdminUser from rest_framework.authentication import BasicAuthen...
{ "repo_name": "mwillmott/techbikers", "path": "server/api/views/auth.py", "copies": "1", "size": "1856", "license": "mit", "hash": 7179785620383917000, "line_mean": 31.5614035088, "line_max": 74, "alpha_frac": 0.7042025862, "autogenerated": false, "ratio": 4.346604215456675, "config_test": fals...
from django.shortcuts import get_object_or_404 from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.core.urlresolvers import reverse from news.models import Article, Section class NewsFeed(Feed): _site = Site.objects.get_current() title =...
{ "repo_name": "ilendl2/chrisdev-cookiecutter", "path": "{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/news/feeds.py", "copies": "1", "size": "1228", "license": "bsd-3-clause", "hash": -6607400483359016000, "line_mean": 26.9090909091, "line_max": 67, "alpha_frac": 0.6767100977, "autogener...
from django.shortcuts import get_object_or_404 from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.contrib.flatpages.views import flatpage from django.conf import settings from datetime import datetime from courant.core.utils import render from courant.core.news.models...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/news/views.py", "copies": "1", "size": "3113", "license": "bsd-3-clause", "hash": -7500520819070669000, "line_mean": 39.9605263158, "line_max": 248, "alpha_frac": 0.6559588821, "autogenerated": false, "ratio": 3.7642079806529627, "co...
from django.shortcuts import get_object_or_404 from django.core.cache import cache from rest_framework import viewsets, serializers from rest_framework.response import Response from rest_framework.routers import (Route, DynamicDetailRoute, DynamicListRoute, SimpleRouter) from rest_f...
{ "repo_name": "correctiv/django-yolodex", "path": "yolodex/api_views.py", "copies": "1", "size": "5289", "license": "mit", "hash": 7696110952814856000, "line_mean": 28.8813559322, "line_max": 80, "alpha_frac": 0.6004915863, "autogenerated": false, "ratio": 4.049770290964778, "config_test": fals...
from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.http import Http404 from datetime import datetime from courant.core.media.models import * from courant.core.utils import render from tagging.models import Tag def media_detai...
{ "repo_name": "maxcutler/Courant-News", "path": "courant/core/media/views.py", "copies": "1", "size": "1421", "license": "bsd-3-clause", "hash": -9206599385431354000, "line_mean": 38.5, "line_max": 117, "alpha_frac": 0.6284306826, "autogenerated": false, "ratio": 3.980392156862745, "config_test...
from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from django.template import RequestContext from django.http import HttpResponse, Http404 from django.template.loader import select_template from django.utils.translation import ugettext_lazy as _ try: from django.vi...
{ "repo_name": "lincolnloop/django-categories", "path": "categories/views.py", "copies": "12", "size": "5325", "license": "apache-2.0", "hash": 8571697981380216000, "line_mean": 35.724137931, "line_max": 96, "alpha_frac": 0.6001877934, "autogenerated": false, "ratio": 4.058689024390244, "config_...
from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from django.views.decorators.csrf import csrf_exempt from rest_framework.decorators import api_view from rest_framework import status from rest_framework.response import Response from .models import Deck, Flashcard fr...
{ "repo_name": "zserg/flashcard", "path": "api/views.py", "copies": "1", "size": "4392", "license": "mit", "hash": -6971715975994201000, "line_mean": 35.6, "line_max": 88, "alpha_frac": 0.6138433515, "autogenerated": false, "ratio": 3.8764342453662843, "config_test": false, "has_no_keywords": ...
from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from rest_framework.response import Response from rest_framework.views import APIView from rest_framework import status from rest_framework import viewsets from .serializers import BankAccountSerializer from .models i...
{ "repo_name": "we-inc/mms-snow-white-and-the-seven-pandas", "path": "webserver/apps/bank_accounts/views.py", "copies": "1", "size": "2176", "license": "mit", "hash": -3141931655907319300, "line_mean": 39.2962962963, "line_max": 78, "alpha_frac": 0.6939338235, "autogenerated": false, "ratio": 3.91...
from django.shortcuts import get_object_or_404 from django.core.exceptions import PermissionDenied from braces.views import LoginRequiredMixin from advertisements.models import Advertisement, AdvertisementPanel, Provider class ProviderAccessPermissionMixin(object): def __init__(self, *args, **kwargs): sup...
{ "repo_name": "OpenAds/OpenAds", "path": "advertisements/views/mixins.py", "copies": "1", "size": "2411", "license": "mit", "hash": -5774911120580208000, "line_mean": 33.4571428571, "line_max": 100, "alpha_frac": 0.6632102862, "autogenerated": false, "ratio": 3.9917218543046356, "config_test": ...
from django.shortcuts import get_object_or_404 from django.core.exceptions import PermissionDenied from Application.models import Feed from Application.service.section_services import get_section def create_feed(**dict_feed): return Feed.objects.get_or_create(**dict_feed) def delete_feed(section_id, feed_id, u...
{ "repo_name": "andjimrio/LTN", "path": "Application/service/feed_services.py", "copies": "1", "size": "1338", "license": "mit", "hash": 2585901398016540700, "line_mean": 25.2352941176, "line_max": 93, "alpha_frac": 0.6943198804, "autogenerated": false, "ratio": 3.1044083526682136, "config_test"...
from django.shortcuts import get_object_or_404 from django.core.exceptions import PermissionDenied from Application.models import UserProfile, Section from Application.service.profile_services import get_profile def create_section(title_section, user_id): return Section.objects.get_or_create(title=title_section,...
{ "repo_name": "andjimrio/LTN", "path": "Application/service/section_services.py", "copies": "1", "size": "1138", "license": "mit", "hash": 7224675412919742000, "line_mean": 30.6111111111, "line_max": 88, "alpha_frac": 0.7073813708, "autogenerated": false, "ratio": 3.4484848484848483, "config_te...
from django.shortcuts import get_object_or_404 from django.core.mail import send_mail from django.contrib.auth.models import User from rest_framework import status from rest_framework.decorators import detail_route from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from onad...
{ "repo_name": "awemulya/fieldsight-kobocat", "path": "onadata/apps/api/viewsets/project_viewset.py", "copies": "1", "size": "14146", "license": "bsd-2-clause", "hash": 4897874092218546000, "line_mean": 29.356223176, "line_max": 79, "alpha_frac": 0.5721051887, "autogenerated": false, "ratio": 3.26...
from django.shortcuts import get_object_or_404 from django.core.mail import send_mail from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from onadata.libs.filters import ( AnonUserProjectFilte...
{ "repo_name": "piqoni/onadata", "path": "onadata/apps/api/viewsets/project_viewset.py", "copies": "3", "size": "13772", "license": "bsd-2-clause", "hash": -1464535440113345800, "line_mean": 28.7451403888, "line_max": 79, "alpha_frac": 0.5719575951, "autogenerated": false, "ratio": 3.1864877371587...
from django.shortcuts import get_object_or_404 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from rest_framework import viewsets from rest_framework.permissions import AllowAny from rest_framework.response import Response from .models import Article from .serializers import ( ArticleLis...
{ "repo_name": "mevinbabuc/django-mango", "path": "articles/views.py", "copies": "1", "size": "4326", "license": "bsd-2-clause", "hash": -5606670683517524000, "line_mean": 32.2769230769, "line_max": 128, "alpha_frac": 0.6287563569, "autogenerated": false, "ratio": 4.45979381443299, "config_test"...
from django.shortcuts import get_object_or_404 from django.core.paginator import Paginator, InvalidPage from django.http import Http404, HttpResponseRedirect from models import News, Rubric, Photo from Compat.decorators import render_to from Compat.tagging.models import TaggedItem from Apps.news.forms import CommentFo...
{ "repo_name": "AlexStarov/site_news", "path": "Apps/news/sitemaps.py", "copies": "1", "size": "8983", "license": "bsd-3-clause", "hash": 224991358678527140, "line_mean": 32.0257352941, "line_max": 159, "alpha_frac": 0.6127129021, "autogenerated": false, "ratio": 3.5131012905748924, "config_test...
from django.shortcuts import get_object_or_404 from django.core.paginator import Paginator, InvalidPage from django.http import Http404, HttpResponseRedirect from models import Rubric, News, Photo from Compat.decorators import render_to from Compat.tagging.models import TaggedItem from Apps.news.forms import CommentFo...
{ "repo_name": "AlexStarov/site_news", "path": "Apps/news/views.py", "copies": "1", "size": "12638", "license": "bsd-3-clause", "hash": 6309791197281254000, "line_mean": 32.9758064516, "line_max": 159, "alpha_frac": 0.6061085615, "autogenerated": false, "ratio": 3.449235807860262, "config_test":...
from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from basic.groups.decorators import * from basic.groups.models import * from basic.groups.forms import * from basic.tools.shortcuts import render, redirect def group_l...
{ "repo_name": "OnlyInAmerica/django-basic-apps", "path": "basic/groups/views/groups.py", "copies": "9", "size": "4892", "license": "bsd-3-clause", "hash": -3139119987096302600, "line_mean": 27.9467455621, "line_max": 90, "alpha_frac": 0.6308258381, "autogenerated": false, "ratio": 3.9324758842443...
from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from src.basic.groups.decorators import * from src.basic.groups.models import * from src.basic.tools import render, redirect def group_list(request, username=None, ...
{ "repo_name": "hittu123/ruhive", "path": "src/basic/groups/views/groups.py", "copies": "1", "size": "4861", "license": "mit", "hash": 7203967837304658000, "line_mean": 27.9345238095, "line_max": 90, "alpha_frac": 0.6295001029, "autogenerated": false, "ratio": 3.923325262308313, "config_test": f...
from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.http import Http404, HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.conf import settings from django.template.loader import render_to_string from django.template import Tem...
{ "repo_name": "gregplaysguitar/glamkit", "path": "glamkit/incubated/favourites/views.py", "copies": "1", "size": "7793", "license": "bsd-3-clause", "hash": -2270677216078418400, "line_mean": 36.8349514563, "line_max": 140, "alpha_frac": 0.6577697934, "autogenerated": false, "ratio": 3.91214859437...
from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from readthedocs.projects.models import Project class ProjectOnboardMixin(object): """Add project onboard context data to project object views""" def get_context_data(self, **kwargs): """Add onboard context ...
{ "repo_name": "gjtorikian/readthedocs.org", "path": "readthedocs/projects/views/base.py", "copies": "2", "size": "2415", "license": "mit", "hash": 8971211462878928000, "line_mean": 32.0821917808, "line_max": 77, "alpha_frac": 0.635610766, "autogenerated": false, "ratio": 4.149484536082475, "con...
from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse, reverse_lazy from django.contrib import messages from django.http import HttpResponseRedirect, Http404 from django.views.generic import DetailView, RedirectView, TemplateView, ListView, UpdateView, CreateView, DeleteView from g...
{ "repo_name": "codesters/codesters", "path": "profiles/views.py", "copies": "7", "size": "6003", "license": "mit", "hash": -3968716497477993500, "line_mean": 36.51875, "line_max": 120, "alpha_frac": 0.7183075129, "autogenerated": false, "ratio": 4.034274193548387, "config_test": false, "has_n...
from django.shortcuts import get_object_or_404 from django.db import models from querybuilder.models import DataSelection, DataColumn import sys global_max_length = 200 global_max_length_small = 40 DASHBOARD_LAYOUT_CHOICES = ( ('two-column', 'Two column layout'), ('three-column', 'Three column layout') ) class Dash...
{ "repo_name": "alextreme/Django-Bingo", "path": "dashboard/models.py", "copies": "1", "size": "19617", "license": "bsd-3-clause", "hash": 4690203564569317000, "line_mean": 41.9256017505, "line_max": 276, "alpha_frac": 0.5637967069, "autogenerated": false, "ratio": 3.959830440048446, "config_tes...
from django.shortcuts import get_object_or_404 from django.db import transaction from django.db.models import Q from rest_framework import viewsets, status, exceptions from rest_framework.views import APIView from rest_framework.generics import GenericAPIView from rest_framework.response import Response from rest_frame...
{ "repo_name": "Harvard-ATG/media_management_api", "path": "media_management_api/media_service/views.py", "copies": "1", "size": "27511", "license": "bsd-3-clause", "hash": -2396503103552985600, "line_mean": 39.2796486091, "line_max": 164, "alpha_frac": 0.6592999164, "autogenerated": false, "ratio...
from django.shortcuts import get_object_or_404 from django.db import transaction from rest_framework import viewsets from rest_framework import status as RESTstatus from rest_framework.response import Response as RESTResponse from mediaviewer.api.serializers import (FileSerializer, ...
{ "repo_name": "kyokley/MediaViewer", "path": "mediaviewer/api/file_viewset.py", "copies": "1", "size": "4471", "license": "mit", "hash": -8604560381196916000, "line_mean": 35.6475409836, "line_max": 90, "alpha_frac": 0.616416909, "autogenerated": false, "ratio": 4.462075848303393, "config_test"...
from django.shortcuts import get_object_or_404 from django.db.models import Q from django.db.utils import IntegrityError from rest_framework import viewsets from api.serializers import * from rest_framework.views import APIView from rest_framework.decorators import api_view, renderer_classes from rest_framework.respons...
{ "repo_name": "Teknologforeningen/teknologr.io", "path": "teknologr/api/views.py", "copies": "1", "size": "22841", "license": "mit", "hash": -2124902235857918200, "line_mean": 32.1831395349, "line_max": 119, "alpha_frac": 0.6369689006, "autogenerated": false, "ratio": 3.924703455389376, "config...
from django.shortcuts import get_object_or_404 from django.db.models import Q from rest_framework import viewsets, filters from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAdminUser, IsAuthenticated from rest_framework.response import Response from rest_framework.authentication import TokenAuthentica...
{ "repo_name": "FMI-B20/Yarr", "path": "main/viewsets.py", "copies": "1", "size": "11250", "license": "mit", "hash": -6119672010714207000, "line_mean": 34.8280254777, "line_max": 174, "alpha_frac": 0.5980444444, "autogenerated": false, "ratio": 4.146701068927387, "config_test": false, "has_no_...
from django.shortcuts import get_object_or_404 from django.db.models import Q from canvas.exceptions import ServiceError from drawquest.api_decorators import api_decorator from drawquest import economy from canvas.templatetags.jinja_base import render_jinja_to_string from canvas.view_guards import require_staff, requi...
{ "repo_name": "drawquest/drawquest-web", "path": "website/drawquest/apps/staff/api.py", "copies": "1", "size": "2659", "license": "bsd-3-clause", "hash": 8525802329615917000, "line_mean": 29.2159090909, "line_max": 106, "alpha_frac": 0.7205716435, "autogenerated": false, "ratio": 3.36582278481012...
from django.shortcuts import get_object_or_404 from django.db.models import Q from rest_framework import viewsets, status from rest_framework.authentication import TokenAuthentication from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated , AllowAny from rest_framework.deco...
{ "repo_name": "azaleas/sentio", "path": "voting_app/polls/api/views.py", "copies": "1", "size": "4598", "license": "mit", "hash": -5858225523069516000, "line_mean": 36.0887096774, "line_max": 85, "alpha_frac": 0.5615484993, "autogenerated": false, "ratio": 4.970810810810811, "config_test": fals...
from django.shortcuts import get_object_or_404 from django_filters import OrderingFilter from django_filters.rest_framework import DjangoFilterBackend from rest_framework.filters import SearchFilter from rest_framework.response import Response from rest_framework import viewsets, authentication from rest_framework.perm...
{ "repo_name": "razens/vets4pet", "path": "server/core/restAPI/views/auth.py", "copies": "1", "size": "4245", "license": "mit", "hash": 8315429347795072000, "line_mean": 35.9130434783, "line_max": 114, "alpha_frac": 0.7182567727, "autogenerated": false, "ratio": 4.84036488027366, "config_test": ...
from django.shortcuts import get_object_or_404 from django.forms.models import modelform_factory from django.db.models import Count from django.http import Http404, HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.conf import settings from django.core.paginator import Paginator...
{ "repo_name": "wpjesus/codematch", "path": "ietf/codestand/requests/views.py", "copies": "1", "size": "27662", "license": "bsd-3-clause", "hash": -1452211696301990400, "line_mean": 40.4722638681, "line_max": 121, "alpha_frac": 0.6058130287, "autogenerated": false, "ratio": 4.230957479351484, "c...
from django.shortcuts import get_object_or_404 from django.http import Http404, HttpResponse from django.contrib import messages from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.core.exceptions import Permiss...
{ "repo_name": "ulule/pybbm", "path": "pybb/contrib/quotes/views.py", "copies": "2", "size": "4580", "license": "bsd-2-clause", "hash": -2530955020784846000, "line_mean": 31.2535211268, "line_max": 108, "alpha_frac": 0.5938864629, "autogenerated": false, "ratio": 4.071111111111111, "config_test"...
from django.shortcuts import get_object_or_404 from django.http import Http404, HttpResponsePermanentRedirect from django.conf import settings from ittybitty.models import IttyBittyURL class IttyBittyURLMiddleware(object): """ Handles redirecting users to the appropriate URL. If a response object with an ...
{ "repo_name": "halitalptekin/PyTr", "path": "src/ittybitty/middleware.py", "copies": "1", "size": "1207", "license": "bsd-3-clause", "hash": -1025065233715615400, "line_mean": 40.6206896552, "line_max": 82, "alpha_frac": 0.6354598177, "autogenerated": false, "ratio": 4.624521072796935, "config_...
from django.shortcuts import get_object_or_404 from django.http import Http404, HttpResponseRedirect, HttpResponseBadRequest, \ HttpResponseForbidden, HttpResponseNotAllowed from annotatetext.forms import NewAnnotationForm from annotatetext.models import Annotation def post_annotation(request): if request.met...
{ "repo_name": "stefanw/django-annotatetext", "path": "annotatetext/views.py", "copies": "1", "size": "1709", "license": "mit", "hash": -7135737215787010000, "line_mean": 41.75, "line_max": 83, "alpha_frac": 0.6612053833, "autogenerated": false, "ratio": 4.594086021505376, "config_test": false, ...
from django.shortcuts import get_object_or_404 from django.http import Http404 from django.core.urlresolvers import reverse from django.utils.feedgenerator import Atom1Feed from django.contrib.syndication.views import Feed from django.contrib.auth.models import User from django.contrib.contenttypes.models import Conten...
{ "repo_name": "netconstructor/django-activity-stream", "path": "actstream/feeds.py", "copies": "2", "size": "2872", "license": "bsd-3-clause", "hash": 3013037901834341000, "line_mean": 31.2696629213, "line_max": 95, "alpha_frac": 0.6340529248, "autogenerated": false, "ratio": 4.073758865248227, ...
from django.shortcuts import get_object_or_404 from django.http import Http404 from django.views.generic import ListView, DetailView from django.views.generic.detail import SingleObjectMixin from django.views.generic.base import RedirectView from django.views.generic.dates import DayArchiveView, MonthArchiveView, YearA...
{ "repo_name": "sunlightlabs/thezombies", "path": "thezombies/views.py", "copies": "1", "size": "3680", "license": "bsd-3-clause", "hash": -2003544453116637200, "line_mean": 30.724137931, "line_max": 103, "alpha_frac": 0.6706521739, "autogenerated": false, "ratio": 3.565891472868217, "config_tes...
from django.shortcuts import get_object_or_404 from django.http import Http404 import django.template.context from tagging.models import Tag, TaggedItem from models import Post, Series, Category def context_processor(target): """ Decorator that allows context processors with parameters to be assigned (an...
{ "repo_name": "davisd/django-blogyall", "path": "blog/context_processors.py", "copies": "1", "size": "5097", "license": "bsd-3-clause", "hash": -8090442684161106000, "line_mean": 29.8909090909, "line_max": 79, "alpha_frac": 0.6327251324, "autogenerated": false, "ratio": 3.9481022463206816, "con...