text stringlengths 0 1.05M | meta dict |
|---|---|
from django import template
from cog.models.search import searchMappings
from cog.site_manager import siteManager
from string import replace
import json
from collections import OrderedDict
from django.conf import settings
register = template.Library()
# filter to access a dictionary value by key
@register.filter
def ... | {
"repo_name": "EarthSystemCoG/COG",
"path": "cog/templatetags/search_utils.py",
"copies": "2",
"size": "7843",
"license": "bsd-3-clause",
"hash": -4571319328060050000,
"line_mean": 33.550660793,
"line_max": 143,
"alpha_frac": 0.6191508351,
"autogenerated": false,
"ratio": 3.8635467980295566,
"c... |
from django import template
from collections import Iterable
from django.template.loader import render_to_string
register = template.Library()
@register.filter
def format_result(value):
if not isinstance(value, Iterable):
value = [value]
output = ""
for result in value:
if result.grade == "... | {
"repo_name": "tykling/tlsscout",
"path": "src/sitecheck/templatetags/format_result.py",
"copies": "1",
"size": "3674",
"license": "bsd-3-clause",
"hash": -1509365740961550000,
"line_mean": 35.0196078431,
"line_max": 77,
"alpha_frac": 0.4624387588,
"autogenerated": false,
"ratio": 4.5246305418719... |
from django import template
from ..constants import DJU_EMAIL_BLOCK_MARKERS
register = template.Library()
class EmailBlockNode(template.Node):
def __init__(self, nodelist, markers):
self.nodelist = nodelist
self.markers = markers
def render(self, context):
return u'{1}{0}{2}'.format... | {
"repo_name": "liminspace/dju-common",
"path": "dju_common/templatetags/dju_email.py",
"copies": "1",
"size": "1098",
"license": "mit",
"hash": 89382384933525630,
"line_mean": 30.3714285714,
"line_max": 84,
"alpha_frac": 0.7112932605,
"autogenerated": false,
"ratio": 3.2972972972972974,
"config... |
from django import template
from ..const import SEPARATOR, PREFIX, TITLE_SEPARATOR
register = template.Library()
@register.assignment_tag
def get_admin_log(limit, user=None, page=None):
from django.db.models import Q
from django_options import Option
from django.contrib.admin.models import LogEntry
... | {
"repo_name": "joke2k/django-options",
"path": "django_options/templatetags/options_admin.py",
"copies": "1",
"size": "1172",
"license": "bsd-3-clause",
"hash": 6781207270182206000,
"line_mean": 29.8421052632,
"line_max": 112,
"alpha_frac": 0.7150170648,
"autogenerated": false,
"ratio": 3.8051948... |
from django import template
from contacts_and_people.models import Membership, Entity
#import DoesNotExistError
register = template.Library()
@register.inclusion_tag('directory.html', takes_context=True)
def directory(context, entity = None):
entity = work_out_entity(context, entity)
# print entity.get_descen... | {
"repo_name": "evildmp/Arkestra",
"path": "contacts_and_people/templatetags/entity_tags.py",
"copies": "2",
"size": "2083",
"license": "bsd-2-clause",
"hash": 8839879004130866000,
"line_mean": 34.3050847458,
"line_max": 113,
"alpha_frac": 0.6519443111,
"autogenerated": false,
"ratio": 4.052529182... |
from django import template
from contacts_and_people.models import Membership, Entity
register = template.Library()
@register.inclusion_tag('entitytrees.html', takes_context=True)
def membership_tree_roots(context, person):
"""
Produces a list of tree roots. For each of these, uses
make_membership_tree to... | {
"repo_name": "bubenkoff/Arkestra",
"path": "contacts_and_people/templatetags/person_tags.py",
"copies": "2",
"size": "1457",
"license": "bsd-2-clause",
"hash": 6104717651517020000,
"line_mean": 32.1136363636,
"line_max": 79,
"alpha_frac": 0.6300617708,
"autogenerated": false,
"ratio": 4.36227544... |
from django import template
from copy import copy
from molo.yourwords.models import (YourWordsCompetition, ThankYou,
YourWordsCompetitionIndexPage)
from molo.core.templatetags.core_tags import get_pages
register = template.Library()
@register.inclusion_tag(
'yourwords/your_word... | {
"repo_name": "praekelt/molo.yourwords",
"path": "molo/yourwords/templatetags/competition_tag.py",
"copies": "1",
"size": "2033",
"license": "bsd-2-clause",
"hash": -4565185567832453000,
"line_mean": 28.4637681159,
"line_max": 78,
"alpha_frac": 0.6704377767,
"autogenerated": false,
"ratio": 3.643... |
from django import template
from datetime import date
from newswall.models import Source, Story
from django.utils.datastructures import SortedDict
import re
register = template.Library()
@register.assignment_tag
def newswall_sources():
return Source.objects.active()
@register.assignment_tag
def newswall_archiv... | {
"repo_name": "michaelkuty/django-newswall",
"path": "newswall/templatetags/newswall_tags.py",
"copies": "1",
"size": "1510",
"license": "bsd-3-clause",
"hash": -6801247468919207000,
"line_mean": 28.6274509804,
"line_max": 107,
"alpha_frac": 0.5966887417,
"autogenerated": false,
"ratio": 3.647342... |
from django import template
from datetime import datetime
from django.utils import simplejson
from ..models import comma_formatted
from django.conf import settings
from django.contrib.humanize.templatetags.humanize import intcomma
import pytz
register = template.Library()
@register.filter
def local_timezone(value, fo... | {
"repo_name": "nyaruka/motome",
"path": "motome/locales/templatetags/locales.py",
"copies": "1",
"size": "1055",
"license": "bsd-3-clause",
"hash": 2258427145517988600,
"line_mean": 22.9772727273,
"line_max": 66,
"alpha_frac": 0.6976303318,
"autogenerated": false,
"ratio": 3.8644688644688645,
"... |
from django import template
from datetime import datetime
from django.utils import simplejson
register = template.Library()
@register.simple_tag(takes_context=True)
def get_list_class(context, list):
"""
Returns the class to use for the passed in list. We just build something up
from the object type for ... | {
"repo_name": "k4ml/jazzpos",
"path": "vendor/smartmin/templatetags/smartmin.py",
"copies": "1",
"size": "3574",
"license": "mit",
"hash": -1655968851375622400,
"line_mean": 28.0569105691,
"line_max": 86,
"alpha_frac": 0.6782316732,
"autogenerated": false,
"ratio": 3.6769547325102883,
"config_t... |
from django import template
from datetime import datetime
import calendar
from metronus_app.model.projectDepartmentEmployeeRole import ProjectDepartmentEmployeeRole
register = template.Library()
def get_type(ob):
return ob.field.widget.__class__.__name__
def get_form_type(form_type):
return {
'Text... | {
"repo_name": "Metronus/metronus",
"path": "Metronus-Project/metronus_app/templatetags/custom_tags.py",
"copies": "1",
"size": "5592",
"license": "mpl-2.0",
"hash": -6952719549055530000,
"line_mean": 24.4136363636,
"line_max": 94,
"alpha_frac": 0.6553389376,
"autogenerated": false,
"ratio": 3.579... |
from django import template
from datetime import datetime
from geelweb.django.editos.models import Edito
register = template.Library()
class EditoNode(template.Node):
DEFAULT_TEMPLATE = 'editos/carousel.html'
def __init__(self, template_file=None):
if template_file:
self.template = temp... | {
"repo_name": "geelweb/django-editos",
"path": "src/geelweb/django/editos/templatetags/editos.py",
"copies": "1",
"size": "1429",
"license": "mit",
"hash": 741365098337502800,
"line_mean": 27.0196078431,
"line_max": 81,
"alpha_frac": 0.600419874,
"autogenerated": false,
"ratio": 3.841397849462365... |
from django import template
from datetime import timedelta
from django.utils import timezone
from django.contrib.humanize.templatetags import humanize
register = template.Library()
@register.filter(name='get_launch_displaytext')
def get_launch_displaytext(value):
return value.strftime('%A %B %e %y at %l:%M %p')
@re... | {
"repo_name": "leemac/rocketlaunches",
"path": "rocketlaunches/rocketapp/templatetags/app_filters.py",
"copies": "1",
"size": "1034",
"license": "mit",
"hash": 6174510518830316000,
"line_mean": 31.34375,
"line_max": 83,
"alpha_frac": 0.7001934236,
"autogenerated": false,
"ratio": 3.40131578947368... |
from django import template
from debugged.attachments.models import *
from debugged.core.templatetags import *
register = template.Library()
class FeaturedAttachmentsNode(template.Node):
def __init__(self, att_model, att_types=[], exclude=False, num=None):
self.att_model = att_model
self.att_types... | {
"repo_name": "bhrutledge/debugged-django",
"path": "debugged/attachments/templatetags/attachment_features.py",
"copies": "1",
"size": "2187",
"license": "mit",
"hash": 4946166391230595000,
"line_mean": 29.8028169014,
"line_max": 74,
"alpha_frac": 0.6195701875,
"autogenerated": false,
"ratio": 3.... |
from django import template
from debugged.core.templatetags import *
register = template.Library()
def get_attachment_set(context, att_list_var, att_types=[], exclude=False, num=None):
# TODO: Handle missing variables more cleanly
att_list = att_list_var.resolve(context)
qs = att_list.all()
if att_typ... | {
"repo_name": "bhrutledge/debugged-django",
"path": "debugged/attachments/templatetags/attachment_tags.py",
"copies": "1",
"size": "4487",
"license": "mit",
"hash": -4733042777287459000,
"line_mean": 32.4850746269,
"line_max": 108,
"alpha_frac": 0.6151103187,
"autogenerated": false,
"ratio": 3.44... |
from django import template
from debugged.discography.models import *
from debugged.core.templatetags import *
register = template.Library()
class FeaturedDiscographyNode(template.Node):
def __init__(self, disc_model, slug=None, artwork=None):
self.disc_model = disc_model
self.slug = slug
... | {
"repo_name": "bhrutledge/debugged-django",
"path": "debugged/discography/templatetags/discography_features.py",
"copies": "1",
"size": "1857",
"license": "mit",
"hash": 6051139458623920000,
"line_mean": 29.4426229508,
"line_max": 90,
"alpha_frac": 0.6284329564,
"autogenerated": false,
"ratio": 3... |
from django import template
from diogenis.local_settings import DEBUG as debug
from diogenis.local_settings import STATIC_URL as static_url
register = template.Library()
# Copyright 2009, EveryBlock
# This code is released under the GPL.
def raw(parser, token):
# Whatever is between {% raw %} and {% endraw %} wil... | {
"repo_name": "gtsiokos/diogenis",
"path": "common/templatetags/diogenis_extras.py",
"copies": "1",
"size": "2349",
"license": "bsd-3-clause",
"hash": 5794342290922953000,
"line_mean": 34.5909090909,
"line_max": 86,
"alpha_frac": 0.6245210728,
"autogenerated": false,
"ratio": 3.8890728476821192,
... |
from django import template
from django.apps import apps
from cms.utils.content import render
from cms.models import PageRelation
from cms.models import get_pages_for_group
import datetime
register = template.Library()
@register.tag(name="menu")
def do_menu(parser, token):
try:
bits = token.split_conten... | {
"repo_name": "eliasfernandez/django-simplecms",
"path": "cms/templatetags/menu.py",
"copies": "1",
"size": "4021",
"license": "bsd-2-clause",
"hash": -4784220996376887000,
"line_mean": 27.5177304965,
"line_max": 111,
"alpha_frac": 0.5630440189,
"autogenerated": false,
"ratio": 3.892545982575024,... |
from django import template
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.validators import EMPTY_VALUES
from django.urls import reverse_lazy
from django.utils.html import mark_safe
from django.utils.translation import ugettext_... | {
"repo_name": "ikcam/django-skeleton",
"path": "core/templatetags/djaneiro.py",
"copies": "1",
"size": "11728",
"license": "bsd-3-clause",
"hash": -130707064335831090,
"line_mean": 28.32,
"line_max": 78,
"alpha_frac": 0.5418656207,
"autogenerated": false,
"ratio": 4.051122625215889,
"config_tes... |
from django import template
from django.apps import apps
from django.contrib.auth import get_user_model
from django.db.models import Q
from ddm import defaults
Criterion = apps.get_model('ddm_core', 'Criterion')
Score = apps.get_model('ddm_core', 'Score')
register = template.Library()
@register.filter
def or_none(v... | {
"repo_name": "adamcharnock/django-decision-matrix",
"path": "ddm/ui_common/templatetags/ddm.py",
"copies": "1",
"size": "4256",
"license": "mit",
"hash": 1368264345262595000,
"line_mean": 24.3333333333,
"line_max": 108,
"alpha_frac": 0.6696428571,
"autogenerated": false,
"ratio": 3.5496246872393... |
from django import template
from django.apps import apps
from django.db.models.fields import DateField, DateTimeField
from django.db.models.query import QuerySet
register = template.Library()
@register.filter
def latest(model_or_obj, num=5):
# load up the model if we were given a string
if isinstance(model_o... | {
"repo_name": "django-de/djangosnippets.org",
"path": "cab/templatetags/core_tags.py",
"copies": "2",
"size": "1529",
"license": "bsd-3-clause",
"hash": 1822672471820498400,
"line_mean": 27.3148148148,
"line_max": 63,
"alpha_frac": 0.6533682145,
"autogenerated": false,
"ratio": 3.6666666666666665... |
from django import template
from django.apps import apps
from django.urls import reverse
from django.utils.html import format_html, format_html_join
from django.utils.text import capfirst
import dezede
register = template.Library()
@register.simple_tag
def dezede_version():
name = capfirst(apps.get_app_config('... | {
"repo_name": "dezede/dezede",
"path": "dezede/templatetags/dezede_extras.py",
"copies": "1",
"size": "1170",
"license": "bsd-3-clause",
"hash": 2809165888274555400,
"line_mean": 30.6216216216,
"line_max": 74,
"alpha_frac": 0.641025641,
"autogenerated": false,
"ratio": 3.4925373134328357,
"conf... |
from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.html import conditional_escape
from django.utils.six.moves.urllib.parse import quote, urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return ... | {
"repo_name": "BassantMorsi/finderApp",
"path": "lib/python2.7/site-packages/django/templatetags/static.py",
"copies": "45",
"size": "4527",
"license": "mit",
"hash": -7470149143758146000,
"line_mean": 26.2710843373,
"line_max": 116,
"alpha_frac": 0.5948751933,
"autogenerated": false,
"ratio": 4.... |
from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.html import conditional_escape
from django.utils.six.moves.urllib.parse import unquote, urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
retur... | {
"repo_name": "dfunckt/django",
"path": "django/templatetags/static.py",
"copies": "1",
"size": "4531",
"license": "bsd-3-clause",
"hash": 5473563285788458000,
"line_mean": 26.2951807229,
"line_max": 116,
"alpha_frac": 0.5952328404,
"autogenerated": false,
"ratio": 4.214883720930232,
"config_te... |
from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self... | {
"repo_name": "peterlauri/django",
"path": "django/templatetags/static.py",
"copies": "91",
"size": "4391",
"license": "bsd-3-clause",
"hash": 5384387752229967000,
"line_mean": 25.9386503067,
"line_max": 116,
"alpha_frac": 0.5918925074,
"autogenerated": false,
"ratio": 4.201913875598086,
"confi... |
from django import template
from django.apps import apps
from django.utils.safestring import mark_safe
###############################################################
### DJANGO template tag to include a Mako template
###
### This file is called "django_mako_plus.py" because it's
### the convention for creating Dj... | {
"repo_name": "doconix/django-mako-plus",
"path": "django_mako_plus/templatetags/django_mako_plus.py",
"copies": "1",
"size": "1247",
"license": "apache-2.0",
"hash": 2448260227060581400,
"line_mean": 30.9743589744,
"line_max": 65,
"alpha_frac": 0.6391339214,
"autogenerated": false,
"ratio": 3.90... |
from django import template
from django.apps import apps
get_model = apps.get_model
from django.db import models
from django.template import TemplateSyntaxError
from django.template.loader import get_template
from dojango.util import extract_nodelist_options
from dojango.util.dojo_collector import add_module
from doja... | {
"repo_name": "ofirr/dojango",
"path": "dojango/templatetags/dojango_grid.py",
"copies": "1",
"size": "6877",
"license": "bsd-3-clause",
"hash": -1631317610648915200,
"line_mean": 41.450617284,
"line_max": 158,
"alpha_frac": 0.6110222481,
"autogenerated": false,
"ratio": 4.062020082693444,
"con... |
from django import template
from djangobb_forum import settings as forum_settings
import hashlib
from django.utils.six.moves.urllib.parse import urlencode
register = template.Library()
@register.inclusion_tag("includes/pagination.html", takes_context=True)
def pagination_for(context, current_page, page_var="page", ex... | {
"repo_name": "aldenjenkins/foobargamingwebsite",
"path": "bans/templatetags/ban_tags.py",
"copies": "1",
"size": "1721",
"license": "bsd-3-clause",
"hash": -15222721892801132,
"line_mean": 36.4347826087,
"line_max": 77,
"alpha_frac": 0.6496223126,
"autogenerated": false,
"ratio": 3.9113636363636... |
from django import template
from django_bitcoin import currency
import json
from decimal import Decimal
import urllib
from django.core.urlresolvers import reverse, NoReverseMatch
register = template.Library()
# currency conversion functions
@register.filter
def bitcoinformat(value):
# print "bitcoinformat", ... | {
"repo_name": "texib/bitcoin-zoo",
"path": "django_bitcoin/templatetags/currency_conversions.py",
"copies": "4",
"size": "3466",
"license": "mit",
"hash": 9208430315672591000,
"line_mean": 31.6981132075,
"line_max": 133,
"alpha_frac": 0.6863819965,
"autogenerated": false,
"ratio": 3.7069518716577... |
from django import template
from django.conf import settings as base_set
from buysell.models import Category, Message
from django.utils.dateformat import format
import time
register = template.Library()
@register.simple_tag
def gmaps():
keys = base_set.GMAPS_KEY
return keys
@register.simple_tag
def get_cats(... | {
"repo_name": "timebigot/noritr",
"path": "buysell/templatetags/tags.py",
"copies": "1",
"size": "1494",
"license": "mit",
"hash": -3646884049761130000,
"line_mean": 21.2985074627,
"line_max": 97,
"alpha_frac": 0.6847389558,
"autogenerated": false,
"ratio": 3.247826086956522,
"config_test": fal... |
from django import template
from django.conf import settings as django_settings
from django.contrib import admin
from django.contrib.admin.util import unquote
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, models
from django.http import HttpResponseRedirect, HttpResponse, Http... | {
"repo_name": "indexofire/gravoicy",
"path": "gravoicy/apps/editor/splitpane_editor.py",
"copies": "1",
"size": "5958",
"license": "bsd-3-clause",
"hash": -2555351248930427000,
"line_mean": 41.8633093525,
"line_max": 111,
"alpha_frac": 0.6173212487,
"autogenerated": false,
"ratio": 4.183988764044... |
from django import template
from django.conf import settings as _settings
from django.http import QueryDict
from django.utils.dateparse import parse_datetime
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from json import dumps
from datetime import datetime, timedelta
im... | {
"repo_name": "erigones/esdc-ce",
"path": "gui/templatetags/gui_utils.py",
"copies": "1",
"size": "8006",
"license": "apache-2.0",
"hash": -6823364988942639000,
"line_mean": 21.4887640449,
"line_max": 104,
"alpha_frac": 0.6496377717,
"autogenerated": false,
"ratio": 3.465800865800866,
"config_t... |
from django import template
from django.conf import settings
from apps.social.models import MSocialProfile
register = template.Library()
@register.inclusion_tag('social/social_story.xhtml', takes_context=True)
def render_social_story(context, story, has_next_story=False):
user = context['user']
user_social_pr... | {
"repo_name": "dosiecki/NewsBlur",
"path": "apps/social/templatetags/social_tags.py",
"copies": "19",
"size": "1914",
"license": "mit",
"hash": -272165503935226700,
"line_mean": 28,
"line_max": 74,
"alpha_frac": 0.6478578892,
"autogenerated": false,
"ratio": 3.557620817843866,
"config_test": fa... |
from django import template
from django.conf import settings
from boar.uploads.models import Thumbnail
register = template.Library()
def do_thumbnail(parser, token):
try:
tag_name, image, name = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError, "%r tag requires two ... | {
"repo_name": "boar/boar",
"path": "boar/uploads/templatetags/uploads.py",
"copies": "1",
"size": "1053",
"license": "bsd-3-clause",
"hash": 7775564841635669000,
"line_mean": 31.90625,
"line_max": 103,
"alpha_frac": 0.6438746439,
"autogenerated": false,
"ratio": 3.843065693430657,
"config_test"... |
from django import template
from django.conf import settings
from ccstraps.models import Strap
register = template.Library()
@register.inclusion_tag('ccstraps/_css.html')
def strap_css():
return {
'STATIC_URL': settings.STATIC_URL}
@register.inclusion_tag('ccstraps/_js.html')
def strap_js():
return {... | {
"repo_name": "designcc/django-ccstraps",
"path": "ccstraps/templatetags/ccstrap_tags.py",
"copies": "1",
"size": "1100",
"license": "bsd-3-clause",
"hash": 7839188836251725000,
"line_mean": 22.9130434783,
"line_max": 53,
"alpha_frac": 0.6272727273,
"autogenerated": false,
"ratio": 3.459119496855... |
from django import template
from django.conf import settings
from cuddlybuddly.storage.s3.utils import CloudFrontURLs
register = template.Library()
class S3MediaURLNode(template.Node):
def __init__(self, static, path, as_var=None):
self.static = static
self.path = template.Variable(path)
... | {
"repo_name": "kylemacfarlane/django-cb-storage-s3",
"path": "src/cuddlybuddly/storage/s3/templatetags/s3_tags.py",
"copies": "1",
"size": "2316",
"license": "bsd-3-clause",
"hash": 3174561350528944000,
"line_mean": 26.2470588235,
"line_max": 80,
"alpha_frac": 0.5651986183,
"autogenerated": false,
... |
from django import template
from django.conf import settings
from datetime import timedelta
from cabot.cabotapp.models import StatusCheck, Instance, Service
from cabot.plugins.models import AlertPluginModel, StatusCheckPluginModel
register = template.Library()
@register.simple_tag
def jenkins_human_url(jobname):
... | {
"repo_name": "bonniejools/cabot",
"path": "cabot/cabotapp/templatetags/extra.py",
"copies": "1",
"size": "1052",
"license": "mit",
"hash": 5325524820989361000,
"line_mean": 32.935483871,
"line_max": 78,
"alpha_frac": 0.7442965779,
"autogenerated": false,
"ratio": 3.757142857142857,
"config_tes... |
from django import template
from django.conf import settings
from django.apps import apps
from django.db.models.aggregates import Count
from django.contrib.contenttypes.models import ContentType
from ..forms import CommentForm
from ..models import Comment
register = template.Library()
@register.simple_tag
def gener... | {
"repo_name": "r26zhao/django-easy-comment",
"path": "easy_comment/templatetags/comment_tags.py",
"copies": "1",
"size": "1396",
"license": "mit",
"hash": -7263267851467367000,
"line_mean": 26.3921568627,
"line_max": 88,
"alpha_frac": 0.6819484241,
"autogenerated": false,
"ratio": 3.8457300275482... |
from django import template
from django.conf import settings
from django.contrib.admin.views.main import (PAGE_VAR)
from django.utils.html import escape
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag
def bootstrap_page_number(cl,page_range):
default_template= u'<d... | {
"repo_name": "maxfolley/django-bootstrap-admin",
"path": "bootstrap/templatetags/admin_extras.py",
"copies": "1",
"size": "1514",
"license": "mit",
"hash": -9164706073103308000,
"line_mean": 38.8421052632,
"line_max": 176,
"alpha_frac": 0.6162483487,
"autogenerated": false,
"ratio": 3.3719376391... |
from django import template
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.cache import cache
from conf_site.reviews.models import ProposalVote, proposalvote_score_cache_key
register = template.Library()
@register.simple_tag
def user_score(proposal, user):
"""For... | {
"repo_name": "pydata/conf_site",
"path": "conf_site/reviews/templatetags/review_tags.py",
"copies": "1",
"size": "1225",
"license": "mit",
"hash": 6227649752810580000,
"line_mean": 32.1081081081,
"line_max": 79,
"alpha_frac": 0.7167346939,
"autogenerated": false,
"ratio": 3.864353312302839,
"c... |
from django import template
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.test import TestCase
from stream import signals
from stream.models import Action
from stream import utils
utils.register_actor([User, Group])
utils.register_target([User, Group])
utils.register_... | {
"repo_name": "caffeinehit/django-stream",
"path": "stream/tests.py",
"copies": "1",
"size": "5415",
"license": "mit",
"hash": 3172921745720823300,
"line_mean": 38.2391304348,
"line_max": 98,
"alpha_frac": 0.6378578024,
"autogenerated": false,
"ratio": 3.6587837837837838,
"config_test": true,
... |
from django import template
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.utils.http import int_to_base36
from inviter.models import OptOut
from inv... | {
"repo_name": "caffeinehit/django-inviter",
"path": "inviter/utils.py",
"copies": "1",
"size": "3989",
"license": "mit",
"hash": -7951280445744238000,
"line_mean": 32.8050847458,
"line_max": 91,
"alpha_frac": 0.6565555277,
"autogenerated": false,
"ratio": 3.72803738317757,
"config_test": false,... |
from django import template
from django.conf import settings
from django.contrib.auth.models import User
register = template.Library()
@register.filter(name='nickname')
def _nickname(user, is_authenticated=False):
name = user
if settings.ENABLE_NICKNAME and user.first_name:
name = user.first_name
... | {
"repo_name": "genonfire/bbgo",
"path": "core/templatetags/user.py",
"copies": "1",
"size": "1782",
"license": "mit",
"hash": -7022899382305035000,
"line_mean": 27.2857142857,
"line_max": 135,
"alpha_frac": 0.6543209877,
"autogenerated": false,
"ratio": 3.6,
"config_test": false,
"has_no_keyw... |
from django import template
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from ..models import Upload
register = template.Library()
@register.inclusion_tag('media_uploader/upload_js.html', takes_context=True)
def upload_js(context, obj):
app_label = obj._meta.app_la... | {
"repo_name": "jonatron/django_media_uploader",
"path": "media_uploader/templatetags/media_uploader.py",
"copies": "1",
"size": "1344",
"license": "mit",
"hash": -7400138209903246000,
"line_mean": 31.7804878049,
"line_max": 102,
"alpha_frac": 0.6755952381,
"autogenerated": false,
"ratio": 3.62264... |
from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
se... | {
"repo_name": "Jollytown/Garuda",
"path": "server/garuda/lib/python2.7/site-packages/django/contrib/flatpages/templatetags/flatpages.py",
"copies": "100",
"size": "3633",
"license": "mit",
"hash": -4412782181984789000,
"line_mean": 34.6176470588,
"line_max": 74,
"alpha_frac": 0.6171208368,
"autogen... |
from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
sel... | {
"repo_name": "taaviteska/django",
"path": "django/contrib/flatpages/templatetags/flatpages.py",
"copies": "24",
"size": "3577",
"license": "bsd-3-clause",
"hash": -5477159916779646000,
"line_mean": 34.77,
"line_max": 79,
"alpha_frac": 0.6164383562,
"autogenerated": false,
"ratio": 4.253269916765... |
from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = context_name
if starts_with:
... | {
"repo_name": "brunogamacatao/portalsaladeaula",
"path": "django/contrib/flatpages/templatetags/flatpages.py",
"copies": "1",
"size": "3470",
"license": "bsd-3-clause",
"hash": -5614981631912160000,
"line_mean": 34.4081632653,
"line_max": 74,
"alpha_frac": 0.6190201729,
"autogenerated": false,
"r... |
# from django import template
# from django.conf import settings
# from django.contrib.flatpages.models import FlatPage
#
#
# register = template.Library()
#
#
# class FlatpageNode(template.Node):
# def __init__(self, context_name, starts_with=None, user=None):
# self.context_name = context_name
# ... | {
"repo_name": "laborautonomo/django-flatpages-plus",
"path": "flatpages_plus/templatetags/flatpages_plus_tags.py",
"copies": "3",
"size": "8344",
"license": "mit",
"hash": 5390867766385541000,
"line_mean": 38.9234449761,
"line_max": 95,
"alpha_frac": 0.5451821668,
"autogenerated": false,
"ratio":... |
from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = context_name
if starts_with:
... | {
"repo_name": "aduric/crossfit",
"path": "nonrel/django/contrib/flatpages/templatetags/flatpages.py",
"copies": "246",
"size": "3467",
"license": "bsd-3-clause",
"hash": -2745057033748090000,
"line_mean": 34.3775510204,
"line_max": 74,
"alpha_frac": 0.6186905105,
"autogenerated": false,
"ratio": ... |
from django import template
from django.conf import settings
from django.contrib.gis.measure import D
from django.db import models
from django.db.models import Q
from geotagging.models import Geotag, HAS_GEOGRAPHY
register = template.Library()
class GetGeotagsNode(template.Node):
def __init__(self, geom, asvar=N... | {
"repo_name": "lincolnloop/django-geotagging",
"path": "geotagging/templatetags/geotagging_tags.py",
"copies": "1",
"size": "2814",
"license": "bsd-3-clause",
"hash": -1371935640847695400,
"line_mean": 35.5454545455,
"line_max": 139,
"alpha_frac": 0.5970149254,
"autogenerated": false,
"ratio": 4.... |
from django import template
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm
from django.contrib.auth.models import User, Group
from django.core.exceptions import PermissionDenied
from django.http import Htt... | {
"repo_name": "iguzu/gae-django",
"path": "django/contrib/auth/admin.py",
"copies": "8",
"size": "6046",
"license": "bsd-3-clause",
"hash": -5960346956688626000,
"line_mean": 45.5076923077,
"line_max": 208,
"alpha_frac": 0.5960965928,
"autogenerated": false,
"ratio": 4.198611111111111,
"config_... |
from django import template
from django.conf import settings
from django.contrib import admin
#from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm
#from django.contrib.auth.models import User, Group
from django.core.exceptions import PermissionDenied
from django.http import H... | {
"repo_name": "codepython/CollectorCity-Market-Place",
"path": "stores/apps/auth/admin.py",
"copies": "2",
"size": "6156",
"license": "apache-2.0",
"hash": -8125551027331010000,
"line_mean": 45.2857142857,
"line_max": 208,
"alpha_frac": 0.6005523067,
"autogenerated": false,
"ratio": 4.20491803278... |
from django import template
from django.conf import settings
from django.contrib import comments
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.comments import signals
from django.contrib.comments.views.utils import next_redirect, confirmation_view
from django.shortcu... | {
"repo_name": "BaichuanWu/Blog_on_django",
"path": "site-packages/django/contrib/comments/views/moderation.py",
"copies": "54",
"size": "5075",
"license": "mit",
"hash": -7644417970723887000,
"line_mean": 30.1349693252,
"line_max": 95,
"alpha_frac": 0.6658128079,
"autogenerated": false,
"ratio": ... |
from django import template
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render_to_response
from django_nova_syspanel.forms import DisableProject
from django_nova_syspanel.forms import DisableIpAddre... | {
"repo_name": "sleepsonthefloor/openstack-dashboard",
"path": "django-nova-syspanel/src/django_nova_syspanel/views/security.py",
"copies": "1",
"size": "4604",
"license": "apache-2.0",
"hash": 5099097845905872000,
"line_mean": 39.7433628319,
"line_max": 87,
"alpha_frac": 0.5651607298,
"autogenerate... |
from django import template
from django.conf import settings
from django.contrib.sites.models import get_current_site
from multilingual.mlflatpages.models import FlatPage
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self... | {
"repo_name": "ziima/django-multilingual-ds9",
"path": "multilingual/mlflatpages/templatetags/flatpages.py",
"copies": "2",
"size": "3632",
"license": "mit",
"hash": -6130373811684525000,
"line_mean": 34.2621359223,
"line_max": 74,
"alpha_frac": 0.6167400881,
"autogenerated": false,
"ratio": 4.22... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.db.models import signals
from django.template.base import Parser, Token
from ..models import Keycode
from ..settings import ON_DEBUG, CACHE_TIMEOUT
from ..utils impo... | {
"repo_name": "idlesign/django-sitemetrics",
"path": "sitemetrics/templatetags/sitemetrics.py",
"copies": "1",
"size": "3367",
"license": "bsd-3-clause",
"hash": 505341195436813630,
"line_mean": 34.8191489362,
"line_max": 101,
"alpha_frac": 0.6424116424,
"autogenerated": false,
"ratio": 4.0083333... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from urlparse import urlunsplit
from ..models import Appointment
register = template.Library()
site = Site.objects.get(pk=settings.SITE_ID)
scheme = 'https' if getat... | {
"repo_name": "marceloomens/appointments",
"path": "appointments/apps/common/templatetags/common_filters.py",
"copies": "1",
"size": "1611",
"license": "mit",
"hash": -5744420603504133000,
"line_mean": 34.8222222222,
"line_max": 115,
"alpha_frac": 0.6983240223,
"autogenerated": false,
"ratio": 3.... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.http import HttpRequest
from django.test import TestCase
class MockHttpRequest(HttpRequest):
def __init__(self, *args, **kwargs):
super(MockHttpRequest, self).__init__(*args, **kwargs)
... | {
"repo_name": "praekelt/django-socialregistration",
"path": "socialregistration/tests/templatetags.py",
"copies": "5",
"size": "1595",
"license": "mit",
"hash": -6496649607740346000,
"line_mean": 36.0930232558,
"line_max": 127,
"alpha_frac": 0.6457680251,
"autogenerated": false,
"ratio": 4.299191... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils import translation
from HavelCMS.models import Page, ResourceCollection, ResourceCollectionItem, Resource
register = template.Library()
@register.inclusion_tag('resources/menu.html', takes_con... | {
"repo_name": "uhuramedia/Havel",
"path": "HavelCMS/templatetags/resources_tags.py",
"copies": "1",
"size": "4827",
"license": "bsd-3-clause",
"hash": 4123358151674520000,
"line_mean": 35.0223880597,
"line_max": 104,
"alpha_frac": 0.5920861819,
"autogenerated": false,
"ratio": 3.985962014863749,
... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils.translation import get_language
register = template.Library()
@register.simple_tag
def site_url(site_id):
try:
site = Site.objects.get(id=site_id)
except Site.DoesNotExist:
site = Site.o... | {
"repo_name": "kimus/django-blocks",
"path": "blocks/templatetags/blocks.py",
"copies": "1",
"size": "2737",
"license": "mit",
"hash": 2256239238425765600,
"line_mean": 23.4464285714,
"line_max": 99,
"alpha_frac": 0.6803069054,
"autogenerated": false,
"ratio": 3.128,
"config_test": false,
"ha... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
import Image
import StringIO
import os
import base64
import json
BRAND = Site.objects.get_current().name
DOMAIN = Site.objects.get_current().domain
register = template.Library()
@register.simple_tag
def active_... | {
"repo_name": "frhumanes/consulting",
"path": "web/src/consulting/templatetags/consulting.py",
"copies": "1",
"size": "5110",
"license": "apache-2.0",
"hash": 6710866144876986000,
"line_mean": 27.2320441989,
"line_max": 99,
"alpha_frac": 0.6035225049,
"autogenerated": false,
"ratio": 3.3773959021... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from linkslist.models import LinksList
register = template.Library()
@register.inclusion_tag('linkslist/slider.html')
def slider(key):
current_site = Site.objects.get_current()
try:
slider = Link... | {
"repo_name": "MidwestCommunications/django-linkslist",
"path": "linkslist/templatetags/linkslist_tags.py",
"copies": "1",
"size": "1131",
"license": "mit",
"hash": 1414007629044704300,
"line_mean": 25.3255813953,
"line_max": 86,
"alpha_frac": 0.6198054819,
"autogenerated": false,
"ratio": 3.7450... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
from offer.models import Offer, OfferCode
from shoppleyuser.utils import pretty_date
from offer.utils import pretty_datetime
register = template.Library()
@register.inclusion_tag("offer/customer_offer_tag.html")... | {
"repo_name": "kwantopia/shoppley-migrate",
"path": "shoppley.com/shoppley/apps/offer/templatetags/offer_tags.py",
"copies": "1",
"size": "4507",
"license": "mit",
"hash": -541042561329681900,
"line_mean": 34.2109375,
"line_max": 73,
"alpha_frac": 0.6904814733,
"autogenerated": false,
"ratio": 3.... |
from django import template
from django.conf import settings
from django.contrib.sites.models import Site
register = template.Library()
def disqus_dev():
"""
Return the HTML/js code to enable DISQUS comments on a local
development server if settings.DEBUG is True.
"""
if settings.DEBUG:
re... | {
"repo_name": "frac/django-disqus",
"path": "disqus/templatetags/disqus_tags.py",
"copies": "1",
"size": "2267",
"license": "bsd-3-clause",
"hash": -4410285250993680000,
"line_mean": 38.7719298246,
"line_max": 153,
"alpha_frac": 0.6621085135,
"autogenerated": false,
"ratio": 3.419306184012066,
... |
from django import template
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from geelweb.django.customflatpages.models import CustomFlatPage
register = template.Library()
class CustomFlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=N... | {
"repo_name": "geelweb/django-customflatpages",
"path": "src/geelweb/django/customflatpages/templatetags/customflatpages.py",
"copies": "1",
"size": "5005",
"license": "mit",
"hash": 5618450148711490000,
"line_mean": 37.7984496124,
"line_max": 103,
"alpha_frac": 0.6211788212,
"autogenerated": false... |
from django import template
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from ..models import FlatPage
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = contex... | {
"repo_name": "carltongibson/flatpages",
"path": "flatpages/templatetags/flatpages.py",
"copies": "1",
"size": "3609",
"license": "mit",
"hash": 6462325472033237000,
"line_mean": 34.7326732673,
"line_max": 74,
"alpha_frac": 0.6151288446,
"autogenerated": false,
"ratio": 4.245882352941177,
"conf... |
from django import template
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from pages.models import Page
register = template.Library()
class PageNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = context_na... | {
"repo_name": "n2o/dpb",
"path": "pages/templatetags/pages.py",
"copies": "1",
"size": "3499",
"license": "mit",
"hash": -4976005047550803000,
"line_mean": 33.6435643564,
"line_max": 73,
"alpha_frac": 0.6044584167,
"autogenerated": false,
"ratio": 4.225845410628019,
"config_test": false,
"has... |
from django import template
from django.conf import settings
from django.contrib.staticfiles.finders import find
from django.templatetags.static import static
from django.template import Node
from dashing.settings import dashing_settings
import json
try:
import urllib.request as urllib2
except ImportError:
im... | {
"repo_name": "swiftstack/django-dashing",
"path": "dashing/templatetags/dashing_tags.py",
"copies": "3",
"size": "3302",
"license": "bsd-3-clause",
"hash": 422590464288200600,
"line_mean": 27.7130434783,
"line_max": 88,
"alpha_frac": 0.6193216233,
"autogenerated": false,
"ratio": 4.2171136653895... |
from django import template
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.template import Node
register = template.Library()
@register.simple_tag
def settings_value(name):
return getattr(settings, name, "")
@register.simple_tag
def javascript(fi... | {
"repo_name": "jonaqp/heroku",
"path": "core/templatetags/tags.py",
"copies": "1",
"size": "2657",
"license": "mit",
"hash": -7763591741043408000,
"line_mean": 27.8804347826,
"line_max": 91,
"alpha_frac": 0.6390666165,
"autogenerated": false,
"ratio": 3.7212885154061626,
"config_test": false,
... |
from django import template
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import format_html, mark_safe
register = template.Library()
@register.simple_tag
def fontawesome_icon(icon, title='', large=False, fixed=False, spin=False, li=Fals... | {
"repo_name": "scuerda/django-fontawesome",
"path": "fontawesome/templatetags/fontawesome.py",
"copies": "1",
"size": "1486",
"license": "bsd-2-clause",
"hash": -5055820468490524000,
"line_mean": 32.7954545455,
"line_max": 134,
"alpha_frac": 0.6621803499,
"autogenerated": false,
"ratio": 3.416091... |
from django import template
from django.conf import settings
from django.core.cache import cache
from cPickle import loads, dumps, HIGHEST_PROTOCOL
import datetime
import feedparser
import re
import time
def _getdefault(name, default=None):
try:
default = getattr(settings, name)
except: pass
return... | {
"repo_name": "indro/t2c",
"path": "apps/external_apps/feedutil/templatetags/feedutil.py",
"copies": "2",
"size": "6081",
"license": "mit",
"hash": -5276241325690053000,
"line_mean": 36.537037037,
"line_max": 141,
"alpha_frac": 0.5806610755,
"autogenerated": false,
"ratio": 3.885623003194888,
"... |
from django import template
from django.conf import settings
from django.core.cache import cache
from datetime import timedelta, datetime
from django.core.urlresolvers import reverse
from live_support.models import Chat
register = template.Library()
def chat_iframe(context, support_group_id=None):
request = cont... | {
"repo_name": "maximzxc/live_chat",
"path": "live_support/templatetags/live_support_tags.py",
"copies": "2",
"size": "1294",
"license": "bsd-3-clause",
"hash": -2260242483832922400,
"line_mean": 35.9714285714,
"line_max": 91,
"alpha_frac": 0.6731066461,
"autogenerated": false,
"ratio": 3.69714285... |
from django import template
from django.conf import settings
from django.core.cache import cache
from django.template.defaultfilters import stringfilter
from django.utils.html import urlize as urlize_impl
from django.utils.safestring import mark_safe
from links.models import Link
register = template.Library()
@regis... | {
"repo_name": "hasadna/open-shot",
"path": "links/templatetags/links_tags.py",
"copies": "1",
"size": "1397",
"license": "bsd-3-clause",
"hash": 3917478674536524000,
"line_mean": 37.8055555556,
"line_max": 75,
"alpha_frac": 0.6585540444,
"autogenerated": false,
"ratio": 3.600515463917526,
"conf... |
from django import template
from django.conf import settings
from django.core.cache import cache
from django.utils.encoding import smart_str
from os.path import abspath
from os.path import dirname as dn
from django.utils.version import get_svn_revision
from django.db.models.loading import get_app
register = template.Li... | {
"repo_name": "indro/t2c",
"path": "apps/local_apps/misc/templatetags/svn_app_version.py",
"copies": "9",
"size": "1680",
"license": "mit",
"hash": -463651732762696100,
"line_mean": 33.2857142857,
"line_max": 80,
"alpha_frac": 0.6130952381,
"autogenerated": false,
"ratio": 4,
"config_test": fal... |
from django import template
from django.conf import settings
from django.core.cache import cache
from django.utils.safestring import mark_safe
from sekizai.helpers import Watcher
from classytags.core import Options, Tag
from classytags.arguments import Argument, MultiValueArgument
from classytags.helpers import Inclusi... | {
"repo_name": "WnP/djangocms-placeholder-attr",
"path": "djangocms-placeholder-attr/templatetags/placeholder_attr.py",
"copies": "1",
"size": "6417",
"license": "mit",
"hash": 7890290312791933000,
"line_mean": 28.712962963,
"line_max": 75,
"alpha_frac": 0.600592177,
"autogenerated": false,
"ratio... |
from django import template
from django.conf import settings
from django.core.cache import cache
from django.utils.translation import ugettext_lazy as _
from portlets.models import Slot
import lfs.core.utils
from lfs.portlet.models.cart import CartPortlet
from lfs.portlet.models.categories import CategoriesPortlet
fr... | {
"repo_name": "diefenbach/django-lfs",
"path": "lfs/portlet/templatetags/lfs_portlets_tags.py",
"copies": "1",
"size": "5112",
"license": "bsd-3-clause",
"hash": -1990244954225760000,
"line_mean": 28.2114285714,
"line_max": 140,
"alpha_frac": 0.6510172144,
"autogenerated": false,
"ratio": 3.74780... |
from django import template
from django.conf import settings
from django.core.cache import cache
from links.models import Link
register = template.Library()
@register.inclusion_tag('links/_object_links.html')
def object_links(obj):
if hasattr(obj, 'cached_links'):
obj_links = obj.cached_links
else:
... | {
"repo_name": "OriHoch/Open-Knesset",
"path": "links/templatetags/links_tags.py",
"copies": "5",
"size": "1043",
"license": "bsd-3-clause",
"hash": 3343736866535482400,
"line_mean": 34.9655172414,
"line_max": 80,
"alpha_frac": 0.6644295302,
"autogenerated": false,
"ratio": 3.3754045307443366,
"... |
from django import template
from django.conf import settings
from django.core.cache import cache
import json
# python 2.7/3.6 compatibility
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
register = template.Library()
class GetContent(template.Node):
def __init_... | {
"repo_name": "carthagecollege/django-djtools",
"path": "djtools/templatetags/livewhale_api.py",
"copies": "1",
"size": "1681",
"license": "unlicense",
"hash": 2925524976570567700,
"line_mean": 26.1129032258,
"line_max": 105,
"alpha_frac": 0.5788221297,
"autogenerated": false,
"ratio": 3.91841491... |
from django import template
from django.conf import settings
from django.core.cache import cache
import json, sys
# python 2.7/3.6 compatibility
try:
import urllib2 as urllib
except ImportError:
import urllib
register = template.Library()
class GetProf(template.Node):
def __init__(self, bits):
... | {
"repo_name": "carthagecollege/django-djtools",
"path": "djtools/templatetags/get_prof.py",
"copies": "1",
"size": "3154",
"license": "unlicense",
"hash": 8231569899498339000,
"line_mean": 34.4382022472,
"line_max": 105,
"alpha_frac": 0.4755865568,
"autogenerated": false,
"ratio": 4.1391076115485... |
from django import template
from django.conf import settings
from django.core.cache import get_cache
if get_cache.__module__.startswith('debug_toolbar'):
from debug_toolbar.panels.cache import base_get_cache as get_cache
register = template.Library()
class CacheStats(template.Node):
"""
Reads the cache s... | {
"repo_name": "FrankSalad/django-memcache-status",
"path": "memcache_status/templatetags/memcache_status_tags.py",
"copies": "1",
"size": "3078",
"license": "bsd-3-clause",
"hash": 6272340018343315000,
"line_mean": 32.4565217391,
"line_max": 81,
"alpha_frac": 0.5958414555,
"autogenerated": false,
... |
from django import template
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist
from django.core.paginator import Page
from django.db.models.query import QuerySet
register = template.Library()
@register.tag
def model_field_verbose_name(parser, token):
"""Returns model field verb... | {
"repo_name": "idlesign/django-etc",
"path": "etc/templatetags/model_field.py",
"copies": "1",
"size": "4730",
"license": "bsd-3-clause",
"hash": 3618774681511950000,
"line_mean": 31.1768707483,
"line_max": 108,
"alpha_frac": 0.5714587738,
"autogenerated": false,
"ratio": 4.160070360598065,
"co... |
from django import template
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import EMPTY_VALUES
from ..models import FlatPage_i18n, MenuItem, Menu
register = template.Library()
class FlatpageNode(template.Node):
def __init__(self, context_name, ... | {
"repo_name": "PragmaticMates/django-flatpages-i18n",
"path": "flatpages_i18n/templatetags/flatpages_i18n.py",
"copies": "1",
"size": "5549",
"license": "bsd-3-clause",
"hash": -6087827404502341000,
"line_mean": 31.6411764706,
"line_max": 79,
"alpha_frac": 0.6015498288,
"autogenerated": false,
"r... |
from django import template
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
class NextPreviousNode(template.Node):
def __init__(self, direction, queryset, date_field, varname):
self.direction, self.date_field, self.varname = direction, date_field, varname
sel... | {
"repo_name": "akarambir/shadow",
"path": "blog/templatetags/next_previous.py",
"copies": "1",
"size": "2151",
"license": "mit",
"hash": -6871818965351904000,
"line_mean": 31.5909090909,
"line_max": 91,
"alpha_frac": 0.6490004649,
"autogenerated": false,
"ratio": 4.31062124248497,
"config_test"... |
from django import template
from django.conf import settings
from django.core import urlresolvers
from django.core.urlresolvers import RegexURLResolver, Resolver404
from django.template import Template
from django.utils.encoding import smart_str
register = template.Library()
@register.tag
def gizmos(parser, token):
... | {
"repo_name": "praekelt/django-gizmo",
"path": "gizmo/templatetags/gizmo_inclusion_tags.py",
"copies": "1",
"size": "4270",
"license": "bsd-3-clause",
"hash": 8950036735826547000,
"line_mean": 36.1304347826,
"line_max": 79,
"alpha_frac": 0.5093676815,
"autogenerated": false,
"ratio": 4.2361111111... |
from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.shop import get_satchmo_setting
register = te... | {
"repo_name": "sankroh/satchmo",
"path": "satchmo/product/templatetags/satchmo_product_admin.py",
"copies": "2",
"size": "4282",
"license": "bsd-3-clause",
"hash": 3531703201083097600,
"line_mean": 36.5614035088,
"line_max": 214,
"alpha_frac": 0.5719290051,
"autogenerated": false,
"ratio": 3.5832... |
from django import template
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from campaign.context import MailContext
class BaseBackend(object):
"""base backend for all campaign backends"""... | {
"repo_name": "hbielenia/django-campaign",
"path": "campaign/backends/base.py",
"copies": "1",
"size": "2332",
"license": "bsd-3-clause",
"hash": -2034867421604910000,
"line_mean": 48.6170212766,
"line_max": 126,
"alpha_frac": 0.6337907376,
"autogenerated": false,
"ratio": 4.711111111111111,
"c... |
from django import template
from django.conf import settings
from django.core.paginator import Paginator, EmptyPage
register = template.Library()
OBJECTS_PER_PAGE = getattr(settings, 'OBJECTS_PER_PAGE', 8)
def get_page_range(current, range):
if range[-1] < 8:
return xrange(1, range[-1] + 1)
if range... | {
"repo_name": "wahaha02/myblog",
"path": "pagination/templatetags/pagination.py",
"copies": "1",
"size": "2751",
"license": "bsd-3-clause",
"hash": -3068553502365111300,
"line_mean": 31.3647058824,
"line_max": 82,
"alpha_frac": 0.5914213013,
"autogenerated": false,
"ratio": 3.600785340314136,
"... |
from django import template
from django.conf import settings
from django.core.urlresolvers import RegexURLResolver, Resolver404
from django.template import RequestContext
from django.utils.encoding import smart_str
from preferences import preferences
register = template.Library()
def resolve_pattern_name(resolver, pa... | {
"repo_name": "praekelt/panya-banner",
"path": "banner/templatetags/banner_inclusion_tags.py",
"copies": "1",
"size": "3604",
"license": "bsd-3-clause",
"hash": -2163433423542389500,
"line_mean": 38.6043956044,
"line_max": 115,
"alpha_frac": 0.6190344062,
"autogenerated": false,
"ratio": 4.215204... |
from django import template
from django.conf import settings
from django.core.urlresolvers import resolve, reverse, NoReverseMatch
from gipsy.toolbar.models import GipsyToolbarMenu
from gipsy.toolbar.settings import LINK_CONTEXT_NAME, LINK_INCLUDED_MODELS, \
VERSION_INDICATOR, VERSION_INDICATOR_LOCATION
register... | {
"repo_name": "RevSquare/gipsy",
"path": "gipsy/toolbar/templatetags/gipsy_toolbar.py",
"copies": "1",
"size": "2721",
"license": "mit",
"hash": -3551169867432156700,
"line_mean": 31.0117647059,
"line_max": 93,
"alpha_frac": 0.6615214994,
"autogenerated": false,
"ratio": 3.8055944055944058,
"co... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.idrfc.idrfc_wrapper import IdRfcWrapper, IdWrapper
from ietf.ietfworkflows.utils import (get_workflow_for_draft,
get_state_for_draft)
from ietf.wgchair... | {
"repo_name": "mcr/ietfdb",
"path": "ietf/ietfworkflows/templatetags/ietf_streams.py",
"copies": "1",
"size": "3915",
"license": "bsd-3-clause",
"hash": 1196090842415381800,
"line_mean": 33.3421052632,
"line_max": 124,
"alpha_frac": 0.6362707535,
"autogenerated": false,
"ratio": 3.808365758754863... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.admin import site
from ..admin import AdminViews
register = template.Library()
@register.simple_tag
def get_admin_views(app_name, perms):
output = []
STATIC_URL = settings.STATIC_URL
... | {
"repo_name": "mikeumus/django-admin-views",
"path": "admin_views/templatetags/admin_views.py",
"copies": "1",
"size": "1392",
"license": "bsd-3-clause",
"hash": -3686512378316737500,
"line_mean": 32.1428571429,
"line_max": 73,
"alpha_frac": 0.4511494253,
"autogenerated": false,
"ratio": 4.419047... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms.models import model_to_dict
from django.template.defaultfilters import pluralize, filesizeformat
from django.contrib.humanize.templatetags.humanize import naturalday
from tardis.tardis_portal.uti... | {
"repo_name": "pansapiens/mytardis",
"path": "tardis/tardis_portal/templatetags/dataset_tags.py",
"copies": "3",
"size": "3322",
"license": "bsd-3-clause",
"hash": 187838488119241020,
"line_mean": 33.6041666667,
"line_max": 77,
"alpha_frac": 0.6393738712,
"autogenerated": false,
"ratio": 3.997593... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.defaulttags import token_kwargs
from allauth.facebook.models import FacebookApp
from allauth.socialaccount.app_settings import FACEBOOK_PERMS
register = template.Library()
def fbconnect(cont... | {
"repo_name": "john-bixly/django-allauth",
"path": "allauth/facebook/templatetags/facebook_tags.py",
"copies": "1",
"size": "1554",
"license": "mit",
"hash": 7788657541814586000,
"line_mean": 33.5333333333,
"line_max": 103,
"alpha_frac": 0.6589446589,
"autogenerated": false,
"ratio": 3.9441624365... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import Node, Library
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
import re
register = Library()
@register.inclusion_tag('layout/button.html'... | {
"repo_name": "hollow/nepal",
"path": "nepal/contrib/layout/templatetags/layout.py",
"copies": "1",
"size": "4323",
"license": "bsd-3-clause",
"hash": -2814882289375555600,
"line_mean": 31.75,
"line_max": 111,
"alpha_frac": 0.6599583622,
"autogenerated": false,
"ratio": 3.694871794871795,
"conf... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import get_language
from ..utils import get_offline_catalog_url, has_offline_catalog_file
register = template.Library()
@register.simple_tag
def hb_i18_script():
return """<scri... | {
"repo_name": "vegitron/django-handlebars-i18n",
"path": "handlebars_i18n/templatetags/handlebars_i18n.py",
"copies": "1",
"size": "1355",
"license": "apache-2.0",
"hash": 3585306901017981000,
"line_mean": 33.7435897436,
"line_max": 130,
"alpha_frac": 0.6878228782,
"autogenerated": false,
"ratio"... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from h1ds import version as h1ds_version
register = template.Library()
h1ds_installed_apps = []
for app in settings.INSTALLED_APPS:
if app.startswith('h1ds_'):
h1ds_installed_apps.append(app)
h1ds_i... | {
"repo_name": "h1ds/h1ds",
"path": "h1ds/h1ds/templatetags/h1ds_headfoot.py",
"copies": "1",
"size": "4154",
"license": "mit",
"hash": -821979416767168000,
"line_mean": 34.8103448276,
"line_max": 84,
"alpha_frac": 0.5842561387,
"autogenerated": false,
"ratio": 3.5965367965367965,
"config_test":... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from pages import logic
from pages.models import CustomPage, FlatPage, Page
register = template.Library()
def _base_breadcrumbs(page: Page, separator='', *, show_siblings=False, show_last_page_siblings=False):
... | {
"repo_name": "fidals/refarm-site",
"path": "pages/templatetags/pages_extras.py",
"copies": "1",
"size": "2447",
"license": "mit",
"hash": 533587196693213800,
"line_mean": 28.4819277108,
"line_max": 114,
"alpha_frac": 0.6636697998,
"autogenerated": false,
"ratio": 3.436797752808989,
"config_tes... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
register = template.Library()
class FacebookClientScriptNode(template.Node):
def render(self, context):
scope = getattr(settings, "FACEBOOK_SCOPE", "email")
redirect = getattr(setting... | {
"repo_name": "mvfsilva/django-facebook-connect",
"path": "facebook_connect/templatetags/facebook_connect.py",
"copies": "4",
"size": "3038",
"license": "mit",
"hash": 2406916290766970400,
"line_mean": 26.3693693694,
"line_max": 122,
"alpha_frac": 0.5625411455,
"autogenerated": false,
"ratio": 3.... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
register = template.Library()
class FacebookScriptNode(template.Node):
def render(self, context):
return """
<script src="http://static.ak.connect.facebook.com/js/api_lib/v... | {
"repo_name": "teebes/django-facebookconnect",
"path": "templatetags/facebookconnect.py",
"copies": "1",
"size": "2445",
"license": "mit",
"hash": 3993394599572220000,
"line_mean": 41.8947368421,
"line_max": 133,
"alpha_frac": 0.5394683027,
"autogenerated": false,
"ratio": 4.193825042881647,
"c... |
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
register = template.Library()
item_template = (
'<div class="mbox">'
'<h2>'
'<a href="%(url)s">%(name)s</a>'
'</h2>'
'<p>%(description)s</p>'
'</div>'
)
H1DS_APP_BLACKLIST = []
class H1... | {
"repo_name": "h1ds/h1ds",
"path": "h1ds/h1ds/templatetags/h1ds_homepage.py",
"copies": "1",
"size": "1962",
"license": "mit",
"hash": -5334136726071286000,
"line_mean": 33.4210526316,
"line_max": 76,
"alpha_frac": 0.5249745158,
"autogenerated": false,
"ratio": 3.979716024340771,
"config_test":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.