text stringlengths 0 1.05M | meta dict |
|---|---|
from django.shortcuts import render_to_response
import numpy as np
def graph1(request):
x= [1,3,5,7,9,11,13]
y= [1,2,3,4,5,6,7]
p1=np.array([-21.13327,-22.21668,-23.18828,-24.17004,-25.17249,-26.1799,-27.18734,-28.1953,-29.20075,-29.7026,-30.20255,-30.39721,-30.59832,-30.79937,-30.90142,-31.00682... | {
"repo_name": "futami/measone",
"path": "meas/bokeh.py",
"copies": "1",
"size": "5261",
"license": "mit",
"hash": 4038535253560286700,
"line_mean": 40.4435483871,
"line_max": 239,
"alpha_frac": 0.6458848128,
"autogenerated": false,
"ratio": 2.770405476566614,
"config_test": false,
"has_no_key... |
from django.shortcuts import render # unused
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.decorators import api_view # unuse... | {
"repo_name": "jeremyphilemon/uniqna",
"path": "api/views.py",
"copies": "2",
"size": "4145",
"license": "bsd-3-clause",
"hash": 5121284626884686000,
"line_mean": 26.8187919463,
"line_max": 100,
"alpha_frac": 0.7254523522,
"autogenerated": false,
"ratio": 3.1884615384615387,
"config_test": fals... |
from django.shortcuts import resolve_url
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .models import Payment, Subscription
def subscr_mark_as_cancelled(modeladmin, request, queryset):
queryset.update(status='cancelled')
subscr_mark_as_cancelled.short_description = ... | {
"repo_name": "CCrypto/ccvpn3",
"path": "payments/admin.py",
"copies": "1",
"size": "4274",
"license": "mit",
"hash": 4113381433337117700,
"line_mean": 38.5740740741,
"line_max": 92,
"alpha_frac": 0.6116050538,
"autogenerated": false,
"ratio": 3.736013986013986,
"config_test": false,
"has_no_... |
from django.shortcuts import resolve_url
from django.test import SimpleTestCase, override_settings
from django.urls import NoReverseMatch, reverse_lazy
from .models import UnimportantThing
from .urls import some_view
@override_settings(ROOT_URLCONF='resolve_url.urls')
class ResolveUrlTests(SimpleTestCase):
"""
... | {
"repo_name": "twz915/django",
"path": "tests/resolve_url/tests.py",
"copies": "133",
"size": "2711",
"license": "bsd-3-clause",
"hash": 9114260172257159000,
"line_mean": 32.0609756098,
"line_max": 77,
"alpha_frac": 0.6067871634,
"autogenerated": false,
"ratio": 4.269291338582677,
"config_test"... |
from django.shortcuts import resolve_url
from django.test import TestCase
from InternetSemLimites.core.models import Provider, State
class TestGet(TestCase):
def setUp(self):
sc, *_ = State.objects.get_or_create(abbr='SC', name='Santa Catarina')
go, *_ = State.objects.get_or_create(abbr='GO', nam... | {
"repo_name": "InternetSemLimites/PublicAPI",
"path": "InternetSemLimites/api/tests/test_fame_by_state_view.py",
"copies": "1",
"size": "1502",
"license": "mit",
"hash": -3042693988244715000,
"line_mean": 39.5675675676,
"line_max": 78,
"alpha_frac": 0.580946036,
"autogenerated": false,
"ratio": 3... |
from django.shortcuts import resolve_url
from django.utils.translation import gettext_lazy as _
from django.db import models
from django.conf import settings
from django.core.validators import RegexValidator
from group_app.models import Group
class PotentialSubscriber(models.Model):
fio = models.CharField(_('fio... | {
"repo_name": "nerosketch/djing",
"path": "new_customers/models.py",
"copies": "2",
"size": "1736",
"license": "unlicense",
"hash": -7180876859547933000,
"line_mean": 28.9310344828,
"line_max": 81,
"alpha_frac": 0.6071428571,
"autogenerated": false,
"ratio": 3.901123595505618,
"config_test": fa... |
from django.shortcuts import resolve_url
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.tokens import default_token_generator
from django.contrib.auth.forms import PasswordResetForm
from django.db import connection
from django.core.... | {
"repo_name": "jfterpstra/bluebottle",
"path": "bluebottle/auth/views.py",
"copies": "1",
"size": "4457",
"license": "bsd-3-clause",
"hash": -5120101895721738000,
"line_mean": 37.4224137931,
"line_max": 92,
"alpha_frac": 0.6472963877,
"autogenerated": false,
"ratio": 4.3696078431372545,
"config... |
from django.shortcuts import resolve_url
from kombu.exceptions import OperationalError
from django.db import models
from django.utils.translation import gettext_lazy as _
from accounts_app.models import UserProfile
from djing.tasks import send_email_notify
class MessageError(Exception):
pass
class MessageStatu... | {
"repo_name": "bashmak/djing",
"path": "msg_app/models.py",
"copies": "2",
"size": "9715",
"license": "unlicense",
"hash": 211524178780739260,
"line_mean": 30.6449511401,
"line_max": 78,
"alpha_frac": 0.5926917138,
"autogenerated": false,
"ratio": 4.246066433566433,
"config_test": false,
"has... |
from django.shortcuts import reverse
from django.views.generic import TemplateView
from braces.views import LoginRequiredMixin
from club.views.mixin import ClubSiteMixin
from members.models import Settings, Fees
from members.services import person_from_user
class ClubSearchView(ClubSiteMixin, TemplateView):
""... | {
"repo_name": "ianastewart/cwltc-admin",
"path": "club/views/info_views.py",
"copies": "1",
"size": "1516",
"license": "mit",
"hash": -780399329105834200,
"line_mean": 28.1538461538,
"line_max": 61,
"alpha_frac": 0.6959102902,
"autogenerated": false,
"ratio": 3.761786600496278,
"config_test": f... |
from django.shortcuts import reverse
from cookiecutter_manager.models import CookieCutterTemplate
from experiments_manager.utils import send_exp_package_creation_status_update
from MOOCworkbench.celery import app
from .models import Experiment
from .utils import init_git_repo_for_experiment
@app.task
def initialize... | {
"repo_name": "MOOCworkbench/MOOCworkbench",
"path": "experiments_manager/tasks.py",
"copies": "1",
"size": "1502",
"license": "mit",
"hash": -8644636811423029000,
"line_mean": 50.7931034483,
"line_max": 117,
"alpha_frac": 0.7669773635,
"autogenerated": false,
"ratio": 3.8811369509043927,
"conf... |
from django.shortcuts import reverse, redirect, render
from django.utils.decorators import method_decorator
from django.urls import resolve, reverse_lazy
from django.http import Http404
from django.contrib.auth.views import password_change, login
from django.views import generic
from django.db import IntegrityError
fro... | {
"repo_name": "PrestonMonteWest/compmart",
"path": "account/views.py",
"copies": "1",
"size": "7188",
"license": "apache-2.0",
"hash": -8723392547062533000,
"line_mean": 25.9213483146,
"line_max": 77,
"alpha_frac": 0.6165831942,
"autogenerated": false,
"ratio": 4.061016949152543,
"config_test":... |
from django.shortcuts import reverse, render
from django.http import HttpResponseRedirect
from .forms import LoginForm,RegitserForm
from django.contrib.auth import authenticate, login, logout
from about.models import User
def user_login(request):
if request.method == 'POST':
login_form = LoginForm(request.... | {
"repo_name": "LoveKano/hs_django_blog",
"path": "account/views.py",
"copies": "1",
"size": "1432",
"license": "mit",
"hash": 3387391374094637000,
"line_mean": 33.0952380952,
"line_max": 103,
"alpha_frac": 0.6592178771,
"autogenerated": false,
"ratio": 4.379204892966361,
"config_test": false,
... |
from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
import datetime
import pandas as pd
# Create your views here.
def index(request):
df = pd.read_table("simpleview/data.csv", sep=",");
datas = pd.DataFrame(df)
head = pd.DataFrame(df, columns=[datas.co... | {
"repo_name": "rizalasrul/python-pandas-data-analysis",
"path": "data-analysis/views.py",
"copies": "1",
"size": "1177",
"license": "mit",
"hash": -2787649598419827000,
"line_mean": 31.7222222222,
"line_max": 80,
"alpha_frac": 0.6941376381,
"autogenerated": false,
"ratio": 3.155495978552279,
"c... |
from django_simplecontent.common import importClass
class Template(object):
def __init__(self, manager):
self.manager = manager
class TemplateManager(object):
def getFromString(self, string):
raise NotImplemented
def getFromEnv(self, path):
raise NotImplemented
def getFromFile(self, path):
return self.g... | {
"repo_name": "ShishKabab/django-simplecontent",
"path": "django_simplecontent/template.py",
"copies": "1",
"size": "3301",
"license": "bsd-3-clause",
"hash": 3717219743756472000,
"line_mean": 25.408,
"line_max": 97,
"alpha_frac": 0.7131172372,
"autogenerated": false,
"ratio": 3.344478216818642,
... |
from django_slack import slack_message
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import JsonResponse
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views i... | {
"repo_name": "banctilrobitaille/RockETS-Basestation",
"path": "slack/views.py",
"copies": "1",
"size": "1980",
"license": "mit",
"hash": -5223610853867032000,
"line_mean": 39.4081632653,
"line_max": 113,
"alpha_frac": 0.5671717172,
"autogenerated": false,
"ratio": 4.56221198156682,
"config_tes... |
from djangosolr.documents.options import Options
from djangosolr.documents.manager import ensure_default_manager
from djangosolr import solr
class DocumentBase(type):
def __new__(cls, name, bases, attrs):
super_new = super(DocumentBase, cls).__new__
new_class = super_new(cls, name, bas... | {
"repo_name": "sophilabs/django-solr",
"path": "djangosolr/documents/document.py",
"copies": "1",
"size": "2412",
"license": "bsd-3-clause",
"hash": 4945877183380637000,
"line_mean": 29.3246753247,
"line_max": 88,
"alpha_frac": 0.5331674959,
"autogenerated": false,
"ratio": 4.081218274111675,
"... |
from djangosolr.documents.query import Query, Q
from djangosolr import solr
class QuerySet(object):
def __init__(self, model, query=None):
self._model = model
self._query = query or Query()
self._responses = []
self._responses_more = True
self._result_cache = None
... | {
"repo_name": "sophilabs/django-solr",
"path": "djangosolr/documents/queryset.py",
"copies": "1",
"size": "5257",
"license": "bsd-3-clause",
"hash": 2610334498755893000,
"line_mean": 31.8625,
"line_max": 137,
"alpha_frac": 0.4995244436,
"autogenerated": false,
"ratio": 4.2774613506916195,
"conf... |
from djangosolr.documents.queryset import QuerySet
from djangosolr.documents.query import Q
from django.conf import settings
from djangosolr import solr
class ManagerDescriptor(object):
def __init__(self, manager):
self.manager = manager
def __get__(self, instance, type=None):
if instance... | {
"repo_name": "sophilabs/django-solr",
"path": "djangosolr/documents/manager.py",
"copies": "1",
"size": "2341",
"license": "bsd-3-clause",
"hash": -7742406659695325000,
"line_mean": 33.4411764706,
"line_max": 130,
"alpha_frac": 0.5967535241,
"autogenerated": false,
"ratio": 3.8314238952536823,
... |
from django_sorcery.db import meta
from rest_framework import routers
class DefaultRouter(routers.DefaultRouter):
def get_default_base_name(self, viewset):
model = getattr(viewset, "get_model", lambda: None)()
assert model is not None, (
"`base_name` argument not specified, and coul... | {
"repo_name": "shosca/django-rest-witchcraft",
"path": "rest_witchcraft/routers.py",
"copies": "1",
"size": "1852",
"license": "mit",
"hash": -1168492828513427700,
"line_mean": 35.3137254902,
"line_max": 115,
"alpha_frac": 0.6101511879,
"autogenerated": false,
"ratio": 4.026086956521739,
"confi... |
from django_sprinkler.models import Program, Context
from datetime import datetime
import pytz, logging
from django.conf import settings
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG if settings.DEBUG else logging.INFO)
logger_watering = logging.getLogger("watering")
logger_watering.setLevel(logg... | {
"repo_name": "jpardobl/django_sprinkler",
"path": "django_sprinkler/cicles.py",
"copies": "1",
"size": "1692",
"license": "bsd-3-clause",
"hash": -2631019024620633600,
"line_mean": 29.7636363636,
"line_max": 88,
"alpha_frac": 0.6329787234,
"autogenerated": false,
"ratio": 3.7268722466960353,
"... |
from django_statsd.clients import statsd
from commonware.log import getLogger
from rest_framework.response import Response
from apk_signer.base import APIView, log_cef, UnprotectedAPIView
from apk_signer.exceptions import ConflictError
from apk_signer.sign import signer
log = getLogger(__name__)
class AuthView(API... | {
"repo_name": "mozilla/apk-signer",
"path": "apk_signer/system/views.py",
"copies": "1",
"size": "2036",
"license": "mpl-2.0",
"hash": -980952342752534700,
"line_mean": 25.7894736842,
"line_max": 77,
"alpha_frac": 0.6331041257,
"autogenerated": false,
"ratio": 4.322717622080679,
"config_test": ... |
from django_statsd.clients import statsd
from rest_framework.mixins import ListModelMixin
from rest_framework.viewsets import GenericViewSet
from waffle import switch_is_active
from olympia.addons.models import Addon
from olympia.discovery.data import discopane_items
from olympia.discovery.serializers import Discovery... | {
"repo_name": "tsl143/addons-server",
"path": "src/olympia/discovery/views.py",
"copies": "1",
"size": "2403",
"license": "bsd-3-clause",
"hash": -173808995390942270,
"line_mean": 42.6909090909,
"line_max": 76,
"alpha_frac": 0.6337910945,
"autogenerated": false,
"ratio": 4.186411149825784,
"con... |
from django_statsd.clients import statsd
from rest_framework.mixins import ListModelMixin
from rest_framework.viewsets import GenericViewSet
from waffle import switch_is_active
from olympia import amo
from olympia.addons.models import Addon
from olympia.discovery.data import discopane_items
from olympia.discovery.seri... | {
"repo_name": "lavish205/olympia",
"path": "src/olympia/discovery/views.py",
"copies": "2",
"size": "2980",
"license": "bsd-3-clause",
"hash": -4427357444224097000,
"line_mean": 41.5714285714,
"line_max": 76,
"alpha_frac": 0.6134228188,
"autogenerated": false,
"ratio": 4.226950354609929,
"confi... |
from django_statsd.clients import statsd
from rest_framework.mixins import ListModelMixin
from rest_framework.viewsets import GenericViewSet
from olympia.addons.models import Addon
from olympia.discovery.data import discopane_items
from olympia.discovery.serializers import DiscoverySerializer
class DiscoveryViewSet(... | {
"repo_name": "harikishen/addons-server",
"path": "src/olympia/discovery/views.py",
"copies": "1",
"size": "1336",
"license": "bsd-3-clause",
"hash": 7387039557031073000,
"line_mean": 38.2941176471,
"line_max": 76,
"alpha_frac": 0.6549401198,
"autogenerated": false,
"ratio": 4.1880877742946705,
... |
from django_statsd.clients import statsd
import inspect
import time
class GraphiteMiddleware(object):
def process_response(self, request, response):
statsd.incr('response.%s' % response.status_code)
if hasattr(request, 'user') and request.user.is_authenticated():
statsd.incr('response... | {
"repo_name": "AdrianGaudebert/socorro-crashstats",
"path": "vendor-local/lib/python/django_statsd/middleware.py",
"copies": "1",
"size": "2158",
"license": "mpl-2.0",
"hash": -6359008897572521000,
"line_mean": 34.9666666667,
"line_max": 77,
"alpha_frac": 0.6195551437,
"autogenerated": false,
"ra... |
from django_statsd.clients import statsd
from cached import Resource
from lib.bango.constants import CANCEL, OK
from lib.bango.forms import EventForm, NotificationForm
from lib.transactions.constants import (STATUS_CANCELLED, STATUS_COMPLETED,
STATUS_FAILED)
from solitude.logge... | {
"repo_name": "muffinresearch/solitude",
"path": "lib/bango/resources/notification.py",
"copies": "1",
"size": "2992",
"license": "bsd-3-clause",
"hash": 2556616982754928600,
"line_mean": 35.9382716049,
"line_max": 77,
"alpha_frac": 0.6002673797,
"autogenerated": false,
"ratio": 4.190476190476191... |
from django_statsd.clients import statsd
import olympia.core.logger
from olympia.amo.celery import task
from olympia.amo.decorators import use_primary_db
from .models import GitExtractionEntry
from .utils import (
AddonGitRepository,
BrokenRefError,
MissingMasterBranchError,
extract_version_to_git,
)... | {
"repo_name": "diox/olympia",
"path": "src/olympia/git/tasks.py",
"copies": "4",
"size": "3368",
"license": "bsd-3-clause",
"hash": -4473008538304937500,
"line_mean": 32.0196078431,
"line_max": 83,
"alpha_frac": 0.6460807601,
"autogenerated": false,
"ratio": 3.7297895902547067,
"config_test": f... |
from django_superform import FormSetWidget as _FormSetWidget
from django_superform import InlineFormSetField as _InlineFormSetField
__all__ = (
'InlineFormSetWidget', 'CopyOnTranslateInlineFormSetFieldMixin',
'InlineFormSetField',)
class InlineFormSetWidget(_FormSetWidget):
template_name = 'django_backe... | {
"repo_name": "team23/django_backend",
"path": "django_backend/forms/fields.py",
"copies": "1",
"size": "1707",
"license": "bsd-3-clause",
"hash": -2121722925367682800,
"line_mean": 38.6976744186,
"line_max": 91,
"alpha_frac": 0.6971294669,
"autogenerated": false,
"ratio": 4.468586387434555,
"c... |
from django_sysadmin.postfix import models
from django.contrib import admin
### actions
def setactive(modeladmin, request, queryset):
queryset.update(active=True)
setactive.short_description = "Set selected entries as active"
def setinactive(modeladmin, request, queryset):
queryset.update(active=False)
setinac... | {
"repo_name": "papercapp/django-sysadmin",
"path": "django_sysadmin/postfix/admin.py",
"copies": "2",
"size": "1702",
"license": "mit",
"hash": 7397547536043566000,
"line_mean": 29.4107142857,
"line_max": 75,
"alpha_frac": 0.7420681551,
"autogenerated": false,
"ratio": 3.3503937007874014,
"conf... |
from django_sysadmin.proftpd import models
from django.contrib import admin
from django.contrib.auth.hashers import make_password
from django import forms
from django.conf import settings
from models import FTPUser
FTP_PASSWORD_HASHER = getattr(settings, "FTP_PASSWORD_HASHER", "sha1")
FTP_PASSWORD_SALT_FILE = getattr(... | {
"repo_name": "papercapp/django-sysadmin",
"path": "django_sysadmin/proftpd/admin.py",
"copies": "1",
"size": "1577",
"license": "mit",
"hash": -4165647521887832600,
"line_mean": 27.1607142857,
"line_max": 88,
"alpha_frac": 0.6892834496,
"autogenerated": false,
"ratio": 3.7369668246445498,
"con... |
from django_tables2 import RequestConfig
from .models import Operation
from .tables import OperationTable
from django.shortcuts import render
from django.http import HttpResponseBadRequest, HttpResponse
import django_excel as excel
from django.utils.translation import ugettext as _
import xlwt
from openpyxl import Work... | {
"repo_name": "datiti/django_compta",
"path": "compta/views.py",
"copies": "1",
"size": "5790",
"license": "apache-2.0",
"hash": -5881213887115400000,
"line_mean": 31.8977272727,
"line_max": 77,
"alpha_frac": 0.4416234888,
"autogenerated": false,
"ratio": 4.7890818858560795,
"config_test": fals... |
from django_tables2 import RequestConfig
import netaddr
from django.conf import settings
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db.models import Count, Q
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from dcim.models import Device
from utili... | {
"repo_name": "Alphalink/netbox",
"path": "netbox/ipam/views.py",
"copies": "1",
"size": "25664",
"license": "apache-2.0",
"hash": -3205184963298593000,
"line_mean": 33.5410497981,
"line_max": 126,
"alpha_frac": 0.6780704489,
"autogenerated": false,
"ratio": 3.740562600204052,
"config_test": fa... |
from django_tables2 import RequestConfig
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from djang... | {
"repo_name": "rfdrake/netbox",
"path": "netbox/utilities/views.py",
"copies": "1",
"size": "14596",
"license": "apache-2.0",
"hash": 8198872160156794000,
"line_mean": 36.3299232737,
"line_max": 117,
"alpha_frac": 0.5918059742,
"autogenerated": false,
"ratio": 4.1069217782779965,
"config_test":... |
from django_tables2 import SingleTableView, RequestConfig
from .filters import *
from .forms import GenericFilterFormHelper
from .tables import *
from entries.models import Eintrag, Band, Archiv, Institution, Person, Bearbeiter
class GenericListView(SingleTableView):
filter_class = None
formhelper_class = Non... | {
"repo_name": "acdh-oeaw/vhioe",
"path": "browsing/views.py",
"copies": "1",
"size": "2455",
"license": "mit",
"hash": 6584642971396334000,
"line_mean": 30.8831168831,
"line_max": 81,
"alpha_frac": 0.7266802444,
"autogenerated": false,
"ratio": 3.8540031397174253,
"config_test": false,
"has_n... |
from django_tables2 import Table, Column
from django.shortcuts import reverse
from cardless.services import format_currency
class PayoutTable(Table):
class Meta:
attrs = {"class": "table table-sm table-hover hover-link"}
row_attrs = {
"data-url": lambda record: reverse(
... | {
"repo_name": "ianastewart/cwltc-admin",
"path": "cardless/tables.py",
"copies": "1",
"size": "1487",
"license": "mit",
"hash": -2829743492393892000,
"line_mean": 26.537037037,
"line_max": 70,
"alpha_frac": 0.5763281775,
"autogenerated": false,
"ratio": 3.822622107969152,
"config_test": false,
... |
from django_tables2_reports.tables import TableReport
try:
from django_auto_filter.tag_column import RowInfoColumn, TagColumn
from tagging_app.tagging_app_utils import get_tag_str_from_tag_list
except:
pass
def render_tags(self, value):
return get_tag_str_from_tag_list(value)
class TableGenerator(ob... | {
"repo_name": "weijia/django-auto-filter",
"path": "django_auto_filter/table_generator.py",
"copies": "1",
"size": "3090",
"license": "bsd-3-clause",
"hash": 7894074255433140000,
"line_mean": 32.5869565217,
"line_max": 106,
"alpha_frac": 0.6003236246,
"autogenerated": false,
"ratio": 3.7637028014... |
from django_tables.base import BaseTable, Rows, TableOptions
__all__ = ('SQLTable',)
class SQLTableOptions(TableOptions):
def __init__(self, options=None):
super(SQLTableOptions, self).__init__(options)
self.columns = getattr(options, 'columns', None)
# Exclude is not currently supported... | {
"repo_name": "anaran/olympia",
"path": "apps/editors/sql_table.py",
"copies": "24",
"size": "1966",
"license": "bsd-3-clause",
"hash": -6266420020232933000,
"line_mean": 30.7096774194,
"line_max": 77,
"alpha_frac": 0.6073245168,
"autogenerated": false,
"ratio": 4.070393374741201,
"config_test"... |
from django.template.backends.base import BaseEngine
try:
from django.template.exceptions import TemplateDoesNotExist
except ImportError:
from django.template.base import TemplateDoesNotExist
from django.template.context import _builtin_context_processors
from django.utils.module_loading import import_string
fr... | {
"repo_name": "wq/django-mustache",
"path": "django_mustache/engine.py",
"copies": "1",
"size": "2861",
"license": "mit",
"hash": 7828775698259571000,
"line_mean": 27.61,
"line_max": 74,
"alpha_frac": 0.6315973436,
"autogenerated": false,
"ratio": 4.3813169984686064,
"config_test": false,
"ha... |
from django.template.backends.django import DjangoTemplates
from django.test import RequestFactory
from template_tests.test_response import test_processor_name
from .test_dummy import TemplateStringsTests
class DjangoTemplatesTests(TemplateStringsTests):
engine_class = DjangoTemplates
backend_name = 'djang... | {
"repo_name": "sephii/django",
"path": "tests/template_backends/test_django.py",
"copies": "2",
"size": "1059",
"license": "bsd-3-clause",
"hash": -4076760984455108600,
"line_mean": 30.1470588235,
"line_max": 73,
"alpha_frac": 0.6345609065,
"autogenerated": false,
"ratio": 4.727678571428571,
"c... |
from django.template.base import add_to_builtins, Template, Token, TOKEN_TEXT, Parser
from django.test import SimpleTestCase
from tag_parser.basetags import BaseNode
class TagParserTests(SimpleTestCase):
@classmethod
def setUpClass(cls):
# Make it easier to run tests without needing to change INSTALLE... | {
"repo_name": "dongguangming/django-tag-parser",
"path": "tag_parser/tests/test_tags.py",
"copies": "1",
"size": "1493",
"license": "apache-2.0",
"hash": -7906619539210512000,
"line_mean": 40.4722222222,
"line_max": 113,
"alpha_frac": 0.6349631614,
"autogenerated": false,
"ratio": 3.9186351706036... |
from django.template.base import Context, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SilentAttrClass, SilentGetItemClass, SomeClass, setup
basic_templates = {
'basic-syntax01': 'something cool',
'basic-syntax02': '{{ headline }}',
'basic-syntax03': '{{ first }} --- {{ s... | {
"repo_name": "ojake/django",
"path": "tests/template_tests/syntax_tests/test_basic.py",
"copies": "106",
"size": "11925",
"license": "bsd-3-clause",
"hash": 212378081265501760,
"line_mean": 35.6923076923,
"line_max": 105,
"alpha_frac": 0.5859958071,
"autogenerated": false,
"ratio": 3.88436482084... |
from django.template.base import (InvalidTemplateLibrary, libraries, Library,
get_templatetags_modules, import_library, TemplateSyntaxError)
from django.template.defaulttags import LoadNode
register = Library()
@register.tag(name="import")
def import_taglib(parser, token):
"""... | {
"repo_name": "splunk/splunk-webframework",
"path": "server/splunkdj/templatetags/defaulttags.py",
"copies": "1",
"size": "5836",
"license": "apache-2.0",
"hash": -5954372275550999000,
"line_mean": 39.8181818182,
"line_max": 103,
"alpha_frac": 0.546435915,
"autogenerated": false,
"ratio": 4.44817... |
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import conditional_escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone ... | {
"repo_name": "wgcv/SWW-Crashphone",
"path": "lib/python2.7/site-packages/django/template/debug.py",
"copies": "42",
"size": "3778",
"license": "apache-2.0",
"hash": 6561878878628990000,
"line_mean": 35.6796116505,
"line_max": 104,
"alpha_frac": 0.6368448915,
"autogenerated": false,
"ratio": 4.02... |
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone import templ... | {
"repo_name": "ericholscher/django",
"path": "django/template/debug.py",
"copies": "1",
"size": "3752",
"license": "bsd-3-clause",
"hash": -3795016421647183000,
"line_mean": 36.1485148515,
"line_max": 104,
"alpha_frac": 0.6353944563,
"autogenerated": false,
"ratio": 4.017130620985011,
"config_t... |
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone import lo... | {
"repo_name": "KellyChan/Python",
"path": "javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/template/debug.py",
"copies": "83",
"size": "3586",
"license": "mit",
"hash": 7171696350416475000,
"line_mean": 35.9690721649,
"line_max": 104,
"alpha_frac": ... |
from django.template.base import Library
from volunteers.models import (VolunteerApplication, Organization,
Project)
register = Library()
@register.assignment_tag(takes_context=True)
def application_status(context, opp, user):
try:
app = VolunteerApplication.objects.get(us... | {
"repo_name": "Code4Maine/volunteer-coordination",
"path": "volunteerhub/apps/volunteers/templatetags/volunteer_tags.py",
"copies": "2",
"size": "1049",
"license": "bsd-3-clause",
"hash": -1615689986291805200,
"line_mean": 23.3953488372,
"line_max": 77,
"alpha_frac": 0.6196377502,
"autogenerated": ... |
from django.template.base import Library, Node
from django.template import defaulttags
from django.templatetags import future
register = Library()
error_on_old_style_url_tag = False
new_style_url_tag = False
errors = []
def before_new_template(force_new_urls):
"""Reset state ready for new template"""
global ... | {
"repo_name": "ahmed-mahran/hue",
"path": "desktop/core/ext-py/django-extensions-1.5.0/django_extensions/utils/validatingtemplatetags.py",
"copies": "46",
"size": "2468",
"license": "apache-2.0",
"hash": 3891808454133148700,
"line_mean": 26.1208791209,
"line_max": 108,
"alpha_frac": 0.6349270665,
"... |
from django.template.base import Library, Node, TemplateDoesNotExist, TemplateSyntaxError
from django.template.defaulttags import token_kwargs
from django.template.loader import get_template
from django.template.loader_tags import BlockNode
register = Library()
class IncludeNode(Node):
def __init__(self, templa... | {
"repo_name": "prestontimmons/partial_include",
"path": "partial_include/templatetags/partial_include.py",
"copies": "1",
"size": "3621",
"license": "mit",
"hash": 8209416853797337000,
"line_mean": 31.6216216216,
"line_max": 123,
"alpha_frac": 0.578569456,
"autogenerated": false,
"ratio": 4.37318... |
from django.template.base import Library, Node, TemplateSyntaxError, TextNode
from relocation.engine import RelocationSerializer
register = Library()
class NodeBasedNodeList(Node):
def __init__(self, nodelist):
self.nodelist = nodelist
def render(self, context):
return self.nodelist.render(con... | {
"repo_name": "m0she/template-relocation",
"path": "relocation/djangoutils/templatetags.py",
"copies": "1",
"size": "1057",
"license": "bsd-3-clause",
"hash": -4217978633184890000,
"line_mean": 32.03125,
"line_max": 83,
"alpha_frac": 0.7218543046,
"autogenerated": false,
"ratio": 4.16141732283464... |
from django.template.base import (
Context,
Template,
TemplateDoesNotExist
)
from django.template.loader import make_origin
from django.template.loaders.app_directories import Loader as AppDirectoriesLoader
from markdown import markdown
import yaml
from BeautifulSoup import BeautifulSoup
from .base import B... | {
"repo_name": "alexlovelltroy/django-classy-mail",
"path": "classy_mail/mixins/md_template.py",
"copies": "1",
"size": "3344",
"license": "mit",
"hash": 1672669295185033700,
"line_mean": 35.347826087,
"line_max": 82,
"alpha_frac": 0.6157296651,
"autogenerated": false,
"ratio": 4.690042075736326,
... |
from django.template.base import *
from django.template.defaulttags import *
from django.templatetags.i18n import TranslateNode, BlockTranslateNode
from django.template.loader_tags import ExtendsNode,IncludeNode,ConstantIncludeNode,BlockNode
#l = Library()
#l.simple_tag(lambda x:x)
#SimpleNode = (l.tags['<lambda>'].fu... | {
"repo_name": "syrusakbary/Djinja",
"path": "djinja/template/utils.py",
"copies": "1",
"size": "9401",
"license": "bsd-3-clause",
"hash": -114934522639984400,
"line_mean": 43.7666666667,
"line_max": 206,
"alpha_frac": 0.6079140517,
"autogenerated": false,
"ratio": 3.7968497576736673,
"config_te... |
from django.template.base import (
Lexer, NodeList, Parser, TemplateSyntaxError, VariableNode, tag_re,
)
from django.utils.encoding import force_text
from django.utils.formats import localize
from django.utils.html import conditional_escape
from django.utils.safestring import EscapeData, SafeData
from django.utils.... | {
"repo_name": "devops2014/djangosite",
"path": "django/template/debug.py",
"copies": "2",
"size": "3787",
"license": "bsd-3-clause",
"hash": 9113057055121291000,
"line_mean": 35.0666666667,
"line_max": 104,
"alpha_frac": 0.6353313969,
"autogenerated": false,
"ratio": 4.015906680805939,
"config_... |
from django.template.base import *
BLOCK_TAG_START = '{{'
BLOCK_TAG_END = '}}'
VARIABLE_TAG_START = '{%'
VARIABLE_TAG_END = '%}'
class Lexer(object):
def __init__(self, template_string, origin):
self.template_string = template_string
self.origin = origin
self.lineno = 1
def tokenize(s... | {
"repo_name": "dmfrancisco/django-pystache",
"path": "management/commands/translation/lexer.py",
"copies": "1",
"size": "1742",
"license": "mit",
"hash": -485742602091040830,
"line_mean": 38.5909090909,
"line_max": 110,
"alpha_frac": 0.5918484501,
"autogenerated": false,
"ratio": 3.96810933940774... |
from django.template.base import Node
from django.utils.six.moves.urllib.parse import urljoin
from django.templatetags.static import PrefixNode
from django.conf import settings
from django import template
from django.utils.six.moves.urllib.parse import urlparse
register = template.Library()
class StaticNode(Node):
... | {
"repo_name": "bung87/django-cdn-finder",
"path": "cdn_finder/templatetags/cdn_finder_tags.py",
"copies": "1",
"size": "4997",
"license": "mit",
"hash": -2400975545242972700,
"line_mean": 32.3133333333,
"line_max": 122,
"alpha_frac": 0.5881528917,
"autogenerated": false,
"ratio": 4.04288025889967... |
from django.template.base import Node, NodeList, TemplateSyntaxError
from django import template
from django.conf import settings
register = template.Library()
class IfInstalledNode(Node):
child_nodelists = ('nodelist_true', 'nodelist_false')
def __init__(self, app, nodelist_true, nodelist_false, negate):
... | {
"repo_name": "m3brown/collab",
"path": "core/templatetags/ifinstalled.py",
"copies": "5",
"size": "2015",
"license": "cc0-1.0",
"hash": -8011448339589073000,
"line_mean": 28.2028985507,
"line_max": 79,
"alpha_frac": 0.635235732,
"autogenerated": false,
"ratio": 3.9822134387351777,
"config_test... |
from django.template.base import Node, TemplateSyntaxError
from mvtester.models import Treatment
from django import template
register = template.Library()
GOAL_KEY_TAG = '<input type="hidden" name="mvtester-goal-key" value="{0}:{1}:{2}"/>'
GOAL_VALUE_TAG = '<input type="hidden" name="{0}:{1}:{2}" value="{3}"/>'
clas... | {
"repo_name": "ubiquitousthey/django-mvtester",
"path": "mvtester/templatetags/mvtester_tags.py",
"copies": "1",
"size": "1334",
"license": "apache-2.0",
"hash": 1230453076291018500,
"line_mean": 37.1428571429,
"line_max": 119,
"alpha_frac": 0.6791604198,
"autogenerated": false,
"ratio": 3.510526... |
from django.template.base import Node, TemplateSyntaxError, NodeList, kwarg_re
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.template import Library
from is_core.utils import get_link_or_none
register = Library()
class Permissions:
permissions_val... | {
"repo_name": "matllubos/django-is-core",
"path": "is_core/templatetags/permissions.py",
"copies": "1",
"size": "4008",
"license": "bsd-3-clause",
"hash": -6118631415210774000,
"line_mean": 30.8095238095,
"line_max": 99,
"alpha_frac": 0.6374750499,
"autogenerated": false,
"ratio": 3.9294117647058... |
from django.template.base import Node, TextNode, VariableNode
from django.template.defaulttags import (
CycleNode, FilterNode, FirstOfNode, ForNode, IfNode, IfChangedNode,
IfEqualNode, LoadNode, NowNode, SpacelessNode, URLNode, WidthRatioNode,
WithNode)
from django.template.loader import get_template
from ... | {
"repo_name": "machinalis/django-template-previewer",
"path": "template_previewer/template_parser/context.py",
"copies": "1",
"size": "5940",
"license": "bsd-3-clause",
"hash": 3027546683700039000,
"line_mean": 35.8944099379,
"line_max": 78,
"alpha_frac": 0.6178451178,
"autogenerated": false,
"ra... |
from django.template.base import (
Lexer, NodeList, Parser, TemplateSyntaxError, VariableNode, tag_re,
)
from django.utils.encoding import force_text
from django.utils.formats import localize
from django.utils.html import conditional_escape
from django.utils.safestring import EscapeData, SafeData
from django... | {
"repo_name": "diego-d5000/MisValesMd",
"path": "env/lib/python2.7/site-packages/django/template/debug.py",
"copies": "1",
"size": "3773",
"license": "mit",
"hash": -8410453932599235000,
"line_mean": 34.9901960784,
"line_max": 104,
"alpha_frac": 0.6180758017,
"autogenerated": false,
"ratio": 4.10... |
from django.template.base import TemplateDoesNotExist
from django.template.loader import find_template_loader, make_origin
from .compiler import compile_template
class Loader(object):
is_usable = True
def __init__(self, loaders):
self._loaders = loaders
self._cached_loaders = []
@proper... | {
"repo_name": "jnovinger/django-compiling-loader",
"path": "compiling_loader/loader.py",
"copies": "2",
"size": "1285",
"license": "bsd-3-clause",
"hash": -4849383021671932000,
"line_mean": 26.9347826087,
"line_max": 70,
"alpha_frac": 0.5750972763,
"autogenerated": false,
"ratio": 4.9613899613899... |
from django.template.base import TemplateDoesNotExist
from django.template.loader import get_template_from_string, make_origin
class Loader(object):
is_usable = False
def __init__(self, *args, **kwargs):
# XXX dropping arguments silently may not be the best idea.
pass
def __call__(self, ... | {
"repo_name": "PolicyStat/django",
"path": "django/template/loaders/base.py",
"copies": "5",
"size": "1718",
"license": "bsd-3-clause",
"hash": -4265449230735873000,
"line_mean": 35.5531914894,
"line_max": 78,
"alpha_frac": 0.6367869616,
"autogenerated": false,
"ratio": 4.732782369146006,
"conf... |
from django.template.base import TemplateDoesNotExist
from django.template.loader import get_template_from_string
class Loader(object):
is_usable = False
# Only used to raise a deprecation warning. Remove in Django 2.0.
_accepts_engine_in_init = True
def __init__(self, engine):
self.engine = ... | {
"repo_name": "gdi2290/django",
"path": "django/template/loaders/base.py",
"copies": "5",
"size": "1761",
"license": "bsd-3-clause",
"hash": -3830488631508440600,
"line_mean": 35.6875,
"line_max": 78,
"alpha_frac": 0.6405451448,
"autogenerated": false,
"ratio": 4.6710875331564985,
"config_test"... |
from django.template.base import TemplateSyntaxError
from django.template.loader import get_template
from django.test import SimpleTestCase
from django.utils import six
from .utils import render, setup
class WidthRatioTagTests(SimpleTestCase):
@setup({'widthratio01': '{% widthratio a b 0 %}'})
def test_widt... | {
"repo_name": "andyzsf/django",
"path": "tests/template_tests/syntax_tests/test_width_ratio.py",
"copies": "1",
"size": "5592",
"license": "bsd-3-clause",
"hash": 2222177526412022800,
"line_mean": 37.301369863,
"line_max": 84,
"alpha_frac": 0.5879828326,
"autogenerated": false,
"ratio": 3.6813693... |
from django.template.base import TemplateSyntaxError
from django.template.loader import get_template
from django.test import SimpleTestCase
from .utils import render, setup
class VerbatimTagTests(SimpleTestCase):
@setup({'verbatim-tag01': '{% verbatim %}{{bare }}{% endverbatim %}'})
def test_verbatim_tag0... | {
"repo_name": "andyzsf/django",
"path": "tests/template_tests/syntax_tests/test_verbatim.py",
"copies": "1",
"size": "1596",
"license": "bsd-3-clause",
"hash": -6835244263822574000,
"line_mean": 39.9230769231,
"line_max": 96,
"alpha_frac": 0.6203007519,
"autogenerated": false,
"ratio": 3.88321167... |
from django.template.base import TemplateSyntaxError
from django.template.loader import get_template
from django.test import SimpleTestCase
from .utils import render, setup, TestObj
class IfTagTests(SimpleTestCase):
@setup({'if-tag01': '{% if foo %}yes{% else %}no{% endif %}'})
def test_if_tag01(self):
... | {
"repo_name": "andyzsf/django",
"path": "tests/template_tests/syntax_tests/test_if.py",
"copies": "1",
"size": "21410",
"license": "bsd-3-clause",
"hash": 4910054268912098000,
"line_mean": 39.858778626,
"line_max": 105,
"alpha_frac": 0.5512844465,
"autogenerated": false,
"ratio": 3.24099303663336... |
from django.template.base import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from .utils import render, setup, SafeClass, UnsafeClass
class AutoescapeTagTests(SimpleTestCase):
@setup({'autoescape-tag01': '{% autoescape off %}hello{% endautoescape %}'}... | {
"repo_name": "andyzsf/django",
"path": "tests/template_tests/syntax_tests/test_autoescape.py",
"copies": "1",
"size": "5213",
"license": "bsd-3-clause",
"hash": 1530270716657155300,
"line_mean": 42.0826446281,
"line_max": 100,
"alpha_frac": 0.6071360061,
"autogenerated": false,
"ratio": 3.958238... |
from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable
from django.template.base import Library, Node, TextNode
from django.template.context import Context
from django.template.defaulttags import token_kwargs
from django.template.loader import get_template
from django.conf import settings
... | {
"repo_name": "ryano144/intellij-community",
"path": "python/lib/Lib/site-packages/django/template/loader_tags.py",
"copies": "73",
"size": "10511",
"license": "apache-2.0",
"hash": 2295806075141566700,
"line_mean": 38.0743494424,
"line_max": 123,
"alpha_frac": 0.6105032823,
"autogenerated": false,... |
from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable
from django.template.base import Library, Node, TextNode
from django.template.context import Context
from django.template.defaulttags import token_kwargs
from django.template.loader import get_template
from django.conf import sett... | {
"repo_name": "rimbalinux/MSISDNArea",
"path": "django/template/loader_tags.py",
"copies": "3",
"size": "10780",
"license": "bsd-3-clause",
"hash": 3100250077100902400,
"line_mean": 38.0743494424,
"line_max": 123,
"alpha_frac": 0.5952690167,
"autogenerated": false,
"ratio": 4.257503949447077,
"... |
from django.template.base import Template, TemplateDoesNotExist
class Loader(object):
is_usable = False
# Only used to raise a deprecation warning. Remove in Django 1.10.
_accepts_engine_in_init = True
def __init__(self, engine):
self.engine = engine
def __call__(self, template_name, tem... | {
"repo_name": "zhanghenry/stocks",
"path": "django/template/loaders/base.py",
"copies": "44",
"size": "1709",
"license": "bsd-3-clause",
"hash": -7582754751252505000,
"line_mean": 35.3617021277,
"line_max": 77,
"alpha_frac": 0.6337039204,
"autogenerated": false,
"ratio": 4.720994475138122,
"con... |
from django.template.base import Template, TemplateDoesNotExist
class Loader(object):
# Only used to raise a deprecation warning. Remove in Django 2.0.
_accepts_engine_in_init = True
def __init__(self, engine):
self.engine = engine
def __call__(self, template_name, template_dirs=None):
... | {
"repo_name": "akaariai/django",
"path": "django/template/loaders/base.py",
"copies": "20",
"size": "1686",
"license": "bsd-3-clause",
"hash": 5727219576384692000,
"line_mean": 35.652173913,
"line_max": 77,
"alpha_frac": 0.6340450771,
"autogenerated": false,
"ratio": 4.735955056179775,
"config_... |
from django.template.base import Template, TemplateDoesNotExist
class Loader(object):
is_usable = False
# Only used to raise a deprecation warning. Remove in Django 2.0.
_accepts_engine_in_init = True
def __init__(self, engine):
self.engine = engine
def __call__(self, template... | {
"repo_name": "diego-d5000/MisValesMd",
"path": "env/lib/python2.7/site-packages/django/template/loaders/base.py",
"copies": "1",
"size": "1755",
"license": "mit",
"hash": 6255531852150654000,
"line_mean": 35.3404255319,
"line_max": 77,
"alpha_frac": 0.6165242165,
"autogenerated": false,
"ratio":... |
from django.template.context import RequestContext
from django.shortcuts import render as django_render
from primer.utils import get_request
from django.shortcuts import render as django_render
def render(args=None, use_request_context = True, request=None):
'''
Magic render... steal the request from the ca... | {
"repo_name": "jamesmfriedman/django-primer",
"path": "primer/template/loader.py",
"copies": "1",
"size": "1219",
"license": "apache-2.0",
"hash": -6237720181413363000,
"line_mean": 35.9696969697,
"line_max": 108,
"alpha_frac": 0.7161607875,
"autogenerated": false,
"ratio": 4.322695035460993,
"... |
from django.template.context import RequestContext
from django.shortcuts import render, render_to_response, redirect
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse, HttpResponseRedirect
from .forms import UploadImageForm
from app.models import *
import requests
import j... | {
"repo_name": "sayapapaya/Worldli",
"path": "app/views.py",
"copies": "1",
"size": "15048",
"license": "mit",
"hash": 4578555958172913000,
"line_mean": 40.8,
"line_max": 274,
"alpha_frac": 0.7363769272,
"autogenerated": false,
"ratio": 3.238915195867413,
"config_test": false,
"has_no_keywords... |
from django.template.context import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from sfpirgapp.models import Category
from django.core.paginator import Paginator
from django.core.paginator import PageNotAnInteger
from django.core.paginator import EmptyPage
from django.db.models imp... | {
"repo_name": "orlenko/sfpirg",
"path": "sfpirgapp/views/category.py",
"copies": "1",
"size": "3986",
"license": "bsd-2-clause",
"hash": 4510060716915562000,
"line_mean": 43.7865168539,
"line_max": 132,
"alpha_frac": 0.671098846,
"autogenerated": false,
"ratio": 3.771050141911069,
"config_test"... |
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from django_facebook.utils import get_registration_backend
from django_facebook.connect import CONNECT_ACTIONS
def register(request):
"""
A very simplistic register view
"""
backend = get_registration_ba... | {
"repo_name": "Fiedzia/Django-facebook",
"path": "django_facebook/registration_views.py",
"copies": "14",
"size": "1119",
"license": "bsd-3-clause",
"hash": 6207429826292321000,
"line_mean": 33.96875,
"line_max": 75,
"alpha_frac": 0.654155496,
"autogenerated": false,
"ratio": 4.476,
"config_tes... |
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpResponse
from piston.emitters import Emitter
from api.views import display_spatial_query, display_aoi_uploader
from util.ncconv.experimental import ocg_converter
from util.ncconv.experimental.o... | {
"repo_name": "netcon-source/OpenClimateGIS",
"path": "src/openclimategis/api/emitters.py",
"copies": "7",
"size": "10559",
"license": "bsd-3-clause",
"hash": -2698895970321821700,
"line_mean": 33.7368421053,
"line_max": 97,
"alpha_frac": 0.6129368311,
"autogenerated": false,
"ratio": 3.781876790... |
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from sfpirgapp.forms import OrganizationForm
from django.http.response import HttpResponseRedirect
import logging
from sfpirgapp.views.actiongroups import actiongroup
from mezzanine.utils.email import send_mail_template
f... | {
"repo_name": "orlenko/sfpirg",
"path": "sfpirgapp/views/organization.py",
"copies": "1",
"size": "1812",
"license": "bsd-2-clause",
"hash": 2508368439290333700,
"line_mean": 36.75,
"line_max": 94,
"alpha_frac": 0.6181015453,
"autogenerated": false,
"ratio": 4.541353383458647,
"config_test": fa... |
from django.template.context import RequestContext
from django.template.loader import render_to_string
def get_activity_html(request, activity):
"""Gets the html for a activity.
:param activity: activity document
"""
context = RequestContext(request)
context.update({
'activity': activity
... | {
"repo_name": "InfoAgeTech/django-activities",
"path": "activities/utils.py",
"copies": "1",
"size": "1566",
"license": "mit",
"hash": 1762242328752387000,
"line_mean": 32.3191489362,
"line_max": 77,
"alpha_frac": 0.6398467433,
"autogenerated": false,
"ratio": 3.9545454545454546,
"config_test":... |
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from django_facebook.utils import get_registration_backend
from django.shortcuts import redirect
def register(request):
"""
A very simplistic register view
"""
backend = get_registration_backen... | {
"repo_name": "fogcitymarathoner/djfb",
"path": "django_facebook/registration_views.py",
"copies": "2",
"size": "1026",
"license": "bsd-3-clause",
"hash": -9019099764433780000,
"line_mean": 32.2,
"line_max": 76,
"alpha_frac": 0.6734892788,
"autogenerated": false,
"ratio": 4.422413793103448,
"co... |
from django.template.context_processors import csrf
from django.core.urlresolvers import reverse
from django.template import Library, Context, loader
register = Library()
@register.simple_tag( takes_context = True )
def jfu(
context,
template_name = 'jfu/upload_form.html',
upload_handler_name ... | {
"repo_name": "dzhuang/django-jfu",
"path": "jfu/templatetags/jfutags.py",
"copies": "1",
"size": "1515",
"license": "bsd-3-clause",
"hash": -4927570087129416000,
"line_mean": 32.6666666667,
"line_max": 75,
"alpha_frac": 0.6514851485,
"autogenerated": false,
"ratio": 4.162087912087912,
"config_... |
from django.template.context_processors import csrf
from django.db import IntegrityError, transaction
from django.db.models import F
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from edurepo import settings
from resources.models import Resource, ResourceSubmiss... | {
"repo_name": "trawick/edurepo",
"path": "src/edurepo/resources/views.py",
"copies": "1",
"size": "3399",
"license": "apache-2.0",
"hash": 6447295441588702000,
"line_mean": 35.5483870968,
"line_max": 87,
"alpha_frac": 0.609296852,
"autogenerated": false,
"ratio": 4.472368421052631,
"config_test... |
from django.template.context_processors import csrf
from django.db.models import Count, Sum
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
from silk.auth import login_possibly_required, permissions_possibly_required
from silk.models import... | {
"repo_name": "crunchr/silk",
"path": "silk/views/profiling.py",
"copies": "4",
"size": "5330",
"license": "mit",
"hash": -987536538163589600,
"line_mean": 39.6870229008,
"line_max": 113,
"alpha_frac": 0.5810506567,
"autogenerated": false,
"ratio": 3.8345323741007196,
"config_test": false,
"h... |
from django.template.context_processors import csrf
from django.views.decorators.csrf import (csrf_protect, csrf_exempt)
from django.utils.decorators import method_decorator
from django.http import HttpResponse, JsonResponse
from base.apputil import *
from locus.forms import (AddressCreateForm, AddressUpdateForm, Addr... | {
"repo_name": "amitdhiman000/MyOffers",
"path": "locus/views.py",
"copies": "1",
"size": "4926",
"license": "apache-2.0",
"hash": -6789154591992244000,
"line_mean": 28.6746987952,
"line_max": 98,
"alpha_frac": 0.6059683313,
"autogenerated": false,
"ratio": 4.132550335570469,
"config_test": fals... |
from django.template.context_processors import csrf
from django.views.decorators.http import require_http_methods
from django.http import HttpResponse
from django.shortcuts import redirect
from flash.models import Collection, Users_Collections
from flash import queries
from flash.decorators import check_role
import j... | {
"repo_name": "Harvard-ATG/HarvardCards",
"path": "flash/api/collection.py",
"copies": "1",
"size": "1299",
"license": "bsd-3-clause",
"hash": -6945720781873010000,
"line_mean": 38.3636363636,
"line_max": 90,
"alpha_frac": 0.7359507313,
"autogenerated": false,
"ratio": 4.046728971962617,
"confi... |
from django.template.defaultfilters import cut
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import render, setup
class CutTests(SimpleTestCase):
@setup({'cut01': '{% autoescape off %}{{ a|cut:"x" }} {{ b|cut:"x" }}{% endautoescape %}'})
def test_cut01(sel... | {
"repo_name": "webostin/django-btc",
"path": "tests/template_tests/filter_tests/test_cut.py",
"copies": "2",
"size": "2145",
"license": "bsd-3-clause",
"hash": 4253875044475579000,
"line_mean": 38,
"line_max": 95,
"alpha_frac": 0.565967366,
"autogenerated": false,
"ratio": 3.126822157434402,
"c... |
from django.template.defaultfilters import date as date_format
from rest_framework import serializers
from mymoney.core.utils import (
get_default_account, localize_signed_amount,
localize_signed_amount_currency,
)
from mymoney.tags.serializers import TagSerializer
from .models import AbstractTransaction, Tr... | {
"repo_name": "ychab/mymoney-server",
"path": "mymoney/transactions/serializers.py",
"copies": "1",
"size": "3206",
"license": "bsd-3-clause",
"hash": 5638527109817106000,
"line_mean": 29.5333333333,
"line_max": 83,
"alpha_frac": 0.6759201497,
"autogenerated": false,
"ratio": 4.471408647140865,
... |
from django.template.defaultfilters import date
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from oscar.apps.dashboard.reports.csv_utils import CsvUnicodeWriter
class ReportGenerator(object):
"""
Top-level class that needs to be subclassed to provide a
repor... | {
"repo_name": "michaelBenin/django-oscar",
"path": "oscar/apps/dashboard/reports/reports.py",
"copies": "1",
"size": "2129",
"license": "bsd-3-clause",
"hash": -5819327420648390000,
"line_mean": 28.1643835616,
"line_max": 93,
"alpha_frac": 0.6392672616,
"autogenerated": false,
"ratio": 4.12596899... |
from django.template.defaultfilters import filesizeformat
from django.test import SimpleTestCase
from django.utils import translation
class FunctionTests(SimpleTestCase):
def test_formats(self):
tests = [
(0, '0\xa0bytes'),
(1, '1\xa0byte'),
(1023, '1023\xa0bytes'),
... | {
"repo_name": "elena/django",
"path": "tests/template_tests/filter_tests/test_filesizeformat.py",
"copies": "43",
"size": "2459",
"license": "bsd-3-clause",
"hash": 490877050811784800,
"line_mean": 38.0317460317,
"line_max": 70,
"alpha_frac": 0.4827165514,
"autogenerated": false,
"ratio": 3.35470... |
from django.template.defaultfilters import filesizeformat
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from easy_thumbnails.files import get_thumbnailer
from braces.views import (
JSONResponseMixin,
LoginRequiredMixin)
from ..forms import ImageForm, DocumentForm
f... | {
"repo_name": "zdot/django-attachments",
"path": "attachments/redactor/views.py",
"copies": "1",
"size": "3256",
"license": "bsd-3-clause",
"hash": -838601520251943400,
"line_mean": 26.6016949153,
"line_max": 80,
"alpha_frac": 0.5565110565,
"autogenerated": false,
"ratio": 4.491034482758621,
"c... |
from django.template.defaultfilters import filesizeformat
from mkt.webapps.serializers import SimpleAppSerializer, SimpleESAppSerializer
class BaseFireplaceAppSerializer(object):
def get_icons(self, app):
# Fireplace only requires 64px and 128px icons.
return {
64: app.get_icon_url(64... | {
"repo_name": "eviljeff/zamboni",
"path": "mkt/fireplace/serializers.py",
"copies": "2",
"size": "2176",
"license": "bsd-3-clause",
"hash": 4600856651088121000,
"line_mean": 37.8571428571,
"line_max": 78,
"alpha_frac": 0.6415441176,
"autogenerated": false,
"ratio": 4.300395256916996,
"config_te... |
from django.template.defaultfilters import filesizeformat
from rest_framework import serializers
from mkt.webapps.serializers import SimpleAppSerializer, SimpleESAppSerializer
from mkt.websites.serializers import ESWebsiteSerializer, WebsiteSerializer
class BaseFireplaceAppSerializer(object):
def get_icons(self... | {
"repo_name": "washort/zamboni",
"path": "mkt/fireplace/serializers.py",
"copies": "1",
"size": "3536",
"license": "bsd-3-clause",
"hash": -5777981367191264000,
"line_mean": 37.4347826087,
"line_max": 79,
"alpha_frac": 0.6411199095,
"autogenerated": false,
"ratio": 4.29126213592233,
"config_tes... |
from django.template.defaultfilters import floatformat
from django.core.mail import send_mail
from django.conf import settings
def money_display(value):
if value is None:
return str(None)
negative = False
if value < 0:
value *= -1
negative = True
# Make sure precision is 4 digi... | {
"repo_name": "TkkrLab/barsystem",
"path": "barsystem/src/barsystem/functions.py",
"copies": "1",
"size": "1564",
"license": "mit",
"hash": 7211412971550815000,
"line_mean": 30.8775510204,
"line_max": 118,
"alpha_frac": 0.6690140845,
"autogenerated": false,
"ratio": 3.4179431072210065,
"config_... |
from django.template.defaultfilters import force_escape
from django.test import SimpleTestCase
from django.utils.safestring import SafeData
from ..utils import setup
class ForceEscapeTests(SimpleTestCase):
"""
Force_escape is applied immediately. It can be used to provide
double-escaping, for example.
... | {
"repo_name": "twz915/django",
"path": "tests/template_tests/filter_tests/test_force_escape.py",
"copies": "133",
"size": "2860",
"license": "bsd-3-clause",
"hash": 134109941380950020,
"line_mean": 40.9852941176,
"line_max": 106,
"alpha_frac": 0.6332749562,
"autogenerated": false,
"ratio": 3.5334... |
from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import render, setup
class JoinTests(SimpleTestCase):
@setup({'join01': '{{ a|join:", " }}'})
def test_join01(self):
output = render('join01', {'a': ['alp... | {
"repo_name": "gdi2290/django",
"path": "tests/template_tests/filter_tests/test_join.py",
"copies": "2",
"size": "2163",
"license": "bsd-3-clause",
"hash": -5590172099708910000,
"line_mean": 37.625,
"line_max": 89,
"alpha_frac": 0.5617198336,
"autogenerated": false,
"ratio": 3.4224683544303796,
... |
from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class JoinTests(SimpleTestCase):
@setup({'join01': '{{ a|join:", " }}'})
def test_join01(self):
output = self.engine.render_to_string('join01... | {
"repo_name": "reinout/django",
"path": "tests/template_tests/filter_tests/test_join.py",
"copies": "93",
"size": "2936",
"license": "bsd-3-clause",
"hash": 541129369415536800,
"line_mean": 38.1466666667,
"line_max": 111,
"alpha_frac": 0.5613079019,
"autogenerated": false,
"ratio": 3.359267734553... |
from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class JoinTests(SimpleTestCase):
@setup({'join01': '{{ a|join:", " }}'})
def test_join01(self):
output = self.engine.render_to_str... | {
"repo_name": "yephper/django",
"path": "tests/template_tests/filter_tests/test_join.py",
"copies": "1",
"size": "2775",
"license": "bsd-3-clause",
"hash": -3906460450259085000,
"line_mean": 38.8088235294,
"line_max": 111,
"alpha_frac": 0.5445045045,
"autogenerated": false,
"ratio": 3.40909090909... |
from django.template.defaultfilters import linebreaksbr
import HTMLParser
import bleach
from bleach import ALLOWED_ATTRIBUTES
EXTRA_TAGS = [
'p',
'br',
'span',
'div',
'u',
]
TAGS = bleach.ALLOWED_TAGS + EXTRA_TAGS
BLOCK_TAGS = [
... | {
"repo_name": "hasadna/OpenCommunity",
"path": "src/ocd/validation.py",
"copies": "1",
"size": "1526",
"license": "bsd-3-clause",
"hash": -8774750574265420000,
"line_mean": 19.0789473684,
"line_max": 55,
"alpha_frac": 0.5373525557,
"autogenerated": false,
"ratio": 3.274678111587983,
"config_tes... |
from django.template.defaultfilters import linebreaksbr
import HTMLParser
import bleach
EXTRA_TAGS = [
'p',
'br',
'span',
'div',
'u',
]
TAGS = bleach.ALLOWED_TAGS + EXTRA_TAGS
BLOCK_TAGS = [
'p',
'br',
'blockquote',
'li',
'ol',
'ul',
'div',
]
DIV_CLASSES = [
'wys... | {
"repo_name": "yaniv14/OpenCommunity",
"path": "src/ocd/validation.py",
"copies": "2",
"size": "1378",
"license": "bsd-3-clause",
"hash": -5714095864256504000,
"line_mean": 16.8961038961,
"line_max": 55,
"alpha_frac": 0.5711175617,
"autogenerated": false,
"ratio": 3.015317286652079,
"config_tes... |
from django.template.defaultfilters import pluralize
from django_countries.fields import CountryField
from fluent_contents.plugins.oembeditem.fields import OEmbedUrlField
from glamkit_collections.contrib.work_creator.models import WorkBase
from django.db import models
from icekit.content_collections.abstract_models imp... | {
"repo_name": "ic-labs/glamkit-collections",
"path": "glamkit_collections/contrib/work_creator/plugins/moving_image/models.py",
"copies": "2",
"size": "1896",
"license": "mit",
"hash": 6502983100610552000,
"line_mean": 36.92,
"line_max": 172,
"alpha_frac": 0.7283755274,
"autogenerated": false,
"r... |
from django.template.defaultfilters import pluralize
def generate_question_revision_summary(old_revision, new_revision, wikified):
"""
Generates a summary message based on the differences between the given
QuestionRevision objects.
"""
summary = []
wikified_summary = _generate_wikified_summary(... | {
"repo_name": "shikhardb/soclone",
"path": "soclone/diff.py",
"copies": "5",
"size": "2202",
"license": "mit",
"hash": 5924433650161589000,
"line_mean": 36.3220338983,
"line_max": 77,
"alpha_frac": 0.6634877384,
"autogenerated": false,
"ratio": 3.989130434782609,
"config_test": false,
"has_no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.