text stringlengths 0 1.05M | meta dict |
|---|---|
from django import template
import re
from django.conf.urls import url
from django.urls import reverse
from django.utils.safestring import mark_safe
class _Menu:
parents = []
childs = []
models_icon = {}
exclude = []
def clear(self):
self.parents = []
self.childs = []
def ad... | {
"repo_name": "dnaextrim/django_adminlte_x",
"path": "adminlte/templatetags/menu.py",
"copies": "1",
"size": "6049",
"license": "mit",
"hash": -5211033834889155000,
"line_mean": 32.9831460674,
"line_max": 228,
"alpha_frac": 0.460737312,
"autogenerated": false,
"ratio": 3.9613621480026193,
"conf... |
from django import template
import re
register = template.Library()
class TableMakerNode(template.Node):
def __init__(self, var_to_be_presented_as_table, table_params): #later add class name for the table, so it can be CSSed
self.target = template.Variable(var_to_be_presented_as_table)
self.table_... | {
"repo_name": "bobev18/reflective",
"path": "django2wrap/templatetags/extras.py",
"copies": "1",
"size": "5994",
"license": "bsd-3-clause",
"hash": -7737379457880327000,
"line_mean": 34.4674556213,
"line_max": 165,
"alpha_frac": 0.49332666,
"autogenerated": false,
"ratio": 3.852185089974293,
"c... |
from django import template
import re
register = template.Library()
def do_get_contest(parser, token):
"""
Gets the data for the election guide using the contest type to pull
contest_types include: 'proposition', 'local',
'congressional', 'presidential'
"""
try:
# Splitting by None ==... | {
"repo_name": "KPBS/open_elections",
"path": "templatetags/open_election_tags.py",
"copies": "1",
"size": "3588",
"license": "bsd-2-clause",
"hash": 5067148881188194000,
"line_mean": 42.756097561,
"line_max": 233,
"alpha_frac": 0.6563545151,
"autogenerated": false,
"ratio": 3.5808383233532934,
... |
from django import template
import re
register = template.Library()
def mostrar_resumen_capa(context, c, order_by):
# print context
to_return = {
'capa': c,
'order_by': order_by,
}
return to_return
@register.inclusion_tag('capas/lista_capas.html')
def mostrar_capas(lista_capas, ord... | {
"repo_name": "pcecconi/mapground",
"path": "layers/templatetags/capas_tags.py",
"copies": "1",
"size": "3724",
"license": "mit",
"hash": -1514201634482956000,
"line_mean": 27.427480916,
"line_max": 99,
"alpha_frac": 0.6487647691,
"autogenerated": false,
"ratio": 3.3916211293260474,
"config_tes... |
from django import template
import re
register = template.Library()
@register.filter
def get_tags_from_apps(apps):
tags_list = []
if len(apps.get('configured', [])) > 5:
for app in apps.get('configured'):
if isinstance(app, dict):
if not app.get('enabled', True) or not ap... | {
"repo_name": "CI-WATER/tethys",
"path": "tethys_apps/templatetags/tags.py",
"copies": "2",
"size": "1351",
"license": "bsd-2-clause",
"hash": 1071559170546689500,
"line_mean": 24.4905660377,
"line_max": 93,
"alpha_frac": 0.4848260548,
"autogenerated": false,
"ratio": 3.7013698630136984,
"confi... |
from django import template
import re
register = template.Library()
@register.filter(name='remove_str')
def remove_str(value, arg):
return value.replace(arg, '')
LINKS_TEXT = {
"Z": {
"link": "http://www.cityofchicago.org/city/en/depts/dcd/supp_info/plan_examination.html",
"text": "Zoning App... | {
"repo_name": "datamade/large-lots",
"path": "lots_client/templatetags/lots_filters.py",
"copies": "1",
"size": "2298",
"license": "mit",
"hash": -2166622461982658000,
"line_mean": 31.3661971831,
"line_max": 136,
"alpha_frac": 0.63794604,
"autogenerated": false,
"ratio": 3.152263374485597,
"con... |
from django import template
import re
try:
from django.utils.safestring import mark_safe
except ImportError:
mark_safe = lambda s:s
register = template.Library()
def rfc3339_date(date):
return date.strftime('%Y-%m-%dT%H:%M:%SZ')
register.filter('atom_date', rfc3339_date)
def atom_tag_uri(url, date=None)... | {
"repo_name": "thoreg/satchmo",
"path": "satchmo/apps/satchmo_ext/product_feeds/templatetags/satchmo_feed.py",
"copies": "15",
"size": "4527",
"license": "bsd-3-clause",
"hash": 818124593384666100,
"line_mean": 43.3921568627,
"line_max": 104,
"alpha_frac": 0.6167439806,
"autogenerated": false,
"r... |
from django import template
import settings
from django.template import Library
register = Library()
import os, sys
# Importing relpath from BN because our target
# is python2.5
# See http://jimmyg.org/work/code/barenecessities/index.html
from bn import relpath
def has_request_as_parent(d, name, url):
u = filter(... | {
"repo_name": "djangowebstudio/emma",
"path": "emma/gui/templatetags/menu.py",
"copies": "1",
"size": "5413",
"license": "bsd-3-clause",
"hash": 6397053315860424000,
"line_mean": 34.6184210526,
"line_max": 156,
"alpha_frac": 0.6068723444,
"autogenerated": false,
"ratio": 4.189628482972136,
"con... |
from django import template
import settings
from gwo.models import GwoExperiment, GwoSection
register = template.Library()
def resolve_or_literal(variable, context):
"""
Resolve the variable within the context, or return the literal value passed
"""
try:
var = variable.resolve(context)
exc... | {
"repo_name": "callowayproject/django-gwo",
"path": "gwo/templatetags/gwo_tags.py",
"copies": "1",
"size": "3134",
"license": "apache-2.0",
"hash": 2009167550973515300,
"line_mean": 32.3510638298,
"line_max": 116,
"alpha_frac": 0.6547543076,
"autogenerated": false,
"ratio": 3.9028642590286426,
... |
from django import template
# import sys
from core.models import DashboardView
from itertools import chain
from core.dashboard.views.home import DashboardDynamicView
register = template.Library()
@register.inclusion_tag('admin/tags/dashboard_list.html', takes_context=True)
def dashboard_list(context):
request = ... | {
"repo_name": "zdw/xos",
"path": "xos/core/templatetags/core_tags.py",
"copies": "1",
"size": "1162",
"license": "apache-2.0",
"hash": -8742879652503685000,
"line_mean": 33.1764705882,
"line_max": 99,
"alpha_frac": 0.7108433735,
"autogenerated": false,
"ratio": 3.9389830508474577,
"config_test"... |
from django import template
import sys
register = template.Library()
from django import template
#@register.tag(name="check_magic")
@register.simple_tag
def tag1():
return "tag1 no parameter"
@register.simple_tag
def tag2(p):
return "tag2 one parameter: %s" % p
@register.simple_tag
def check_magic(label... | {
"repo_name": "RichGibson/hir",
"path": "templatetags/extras.py",
"copies": "2",
"size": "2081",
"license": "mit",
"hash": 4962444185672835000,
"line_mean": 25.6794871795,
"line_max": 79,
"alpha_frac": 0.6141278232,
"autogenerated": false,
"ratio": 3.6003460207612457,
"config_test": false,
"h... |
from django import template
import types
from django.core.exceptions import FieldDoesNotExist
import datetime
register = template.Library()
@register.inclusion_tag('modelcrud/list_table.tag.html')
def render_list(obj, object_list):
"""
Renders the list view object list taking the passed object's
crudconf.... | {
"repo_name": "tonimichel/django-modelcrud",
"path": "modelcrud/templatetags/modelcrud_tags.py",
"copies": "1",
"size": "2680",
"license": "mit",
"hash": -406748165650293400,
"line_mean": 25.2843137255,
"line_max": 127,
"alpha_frac": 0.5705223881,
"autogenerated": false,
"ratio": 3.95280235988200... |
from django import template
import unicodedata
register = template.Library()
@register.filter("truncate")
def truncate(value, size):
if len(value) > size:
return value[0:size]
else:
return value
@register.filter("truncate_dot")
def truncate_dot(value, size):
if value:
if len(val... | {
"repo_name": "fretscha/django-postfix-admin",
"path": "postfixadmin/pfa/templatetags/filter.py",
"copies": "1",
"size": "1061",
"license": "mit",
"hash": 4038884569887078000,
"line_mean": 22.0652173913,
"line_max": 68,
"alpha_frac": 0.561734213,
"autogenerated": false,
"ratio": 3.775800711743772... |
from django import template
import urllib
register = template.Library()
@register.tag
def urlencode(parser, token):
tokens = list(reversed(token.split_contents()))
tag_name = tokens.pop()
try:
path_var = tokens.pop()
params_var = tokens.pop()
except:
raise template.TemplateSyn... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "corehq/apps/app_manager/templatetags/url_extras.py",
"copies": "1",
"size": "2330",
"license": "bsd-3-clause",
"hash": -962836232303698800,
"line_mean": 34.303030303,
"line_max": 120,
"alpha_frac": 0.574248927,
"autogenerated": false,
"ratio": 4.0... |
from django import template
import urllib
register = template.Library()
@register.tag
def urlencode(parser, token):
tokens = list(reversed(token.split_contents()))
tag_name = tokens.pop()
try:
path_var = tokens.pop()
params_var = tokens.pop()
except:
raise template.TemplateSynt... | {
"repo_name": "benrudolph/commcare-hq",
"path": "corehq/apps/app_manager/templatetags/url_extras.py",
"copies": "2",
"size": "2327",
"license": "bsd-3-clause",
"hash": 1524296924011597300,
"line_mean": 35.9365079365,
"line_max": 120,
"alpha_frac": 0.5749892566,
"autogenerated": false,
"ratio": 4.... |
from django import template
import urllib
register = template.Library()
@register.inclusion_tag('card.html')
def show_card(cell, input):
return {'cell': cell, 'input': input}
@register.tag(name='make_query')
def do_make_query(parser, token):
try:
tag_name, query = token.split_contents()
except Val... | {
"repo_name": "github4ry/sympy_gamma",
"path": "app/templatetags/extra_tags.py",
"copies": "5",
"size": "2650",
"license": "bsd-3-clause",
"hash": -2880092540785690600,
"line_mean": 29.4597701149,
"line_max": 76,
"alpha_frac": 0.598490566,
"autogenerated": false,
"ratio": 3.8294797687861273,
"c... |
from django import template
import urlparse
register = template.Library()
@register.simple_tag
def latlon360(latitude, longitude):
return '%0.2f°%s %0.2f°E' % (abs(latitude), 'NS'[latitude<0], longitude%360)
class BalloonUrlNode(template.Node):
def __init__(self, relative_url):
self.relativ... | {
"repo_name": "deleted/kml-layer-manager",
"path": "layermanager/templatetags/kml_util.py",
"copies": "1",
"size": "1284",
"license": "apache-2.0",
"hash": -7965405360624714000,
"line_mean": 34.6666666667,
"line_max": 107,
"alpha_frac": 0.6503115265,
"autogenerated": false,
"ratio": 3.71098265895... |
from django import template
import warnings
warnings.warn("To complex! Cleanup this f*** mess!", PendingDeprecationWarning)
register = template.Library()
MONDAY = "poniedziałek"
TUESDAY = "wtorek"
WEDNESDAY = "środa"
THURSDAY = "czwartek"
FRIDAY = "piątek"
SATURDAY = "sobota"
SUNDAY = "niedziela"
MONDAY = 1
TUESDAY... | {
"repo_name": "MattAgile/django-spa-crm",
"path": "crm/date/templatetags/events.py",
"copies": "1",
"size": "8165",
"license": "apache-2.0",
"hash": -6258229889589729000,
"line_mean": 25.141025641,
"line_max": 79,
"alpha_frac": 0.3518881805,
"autogenerated": false,
"ratio": 2.7989018531228553,
... |
from django import template
__author__ = "SmileyChris"
# Basestring no longer exists in Python 3
try:
basestring
except:
basestring = str
#==============================================================================
# Calculation objects
#====================================================================... | {
"repo_name": "artscoop/django-annoying",
"path": "annoying/templatetags/smart_if.py",
"copies": "2",
"size": "7370",
"license": "bsd-3-clause",
"hash": 1722299872811242200,
"line_mean": 28.9593495935,
"line_max": 79,
"alpha_frac": 0.5416553596,
"autogenerated": false,
"ratio": 4.071823204419889,... |
from django import template
__author__ = "SmileyChris"
# Basestring no longer exists in Python 3
try:
basestring
except:
basestring = str
#==============================================================================
# Calculation objects
#===================================================================... | {
"repo_name": "YPCrumble/django-annoying",
"path": "annoying/templatetags/smart_if.py",
"copies": "2",
"size": "7370",
"license": "bsd-3-clause",
"hash": 3805639349369240600,
"line_mean": 28.9593495935,
"line_max": 79,
"alpha_frac": 0.5416553596,
"autogenerated": false,
"ratio": 4.071823204419889... |
from django import template
__author__ = "SmileyChris"
#==============================================================================
# Calculation objects
#==============================================================================
class BaseCalc(object):
def __init__(self, var1, var2=None, negate=False):
... | {
"repo_name": "boooka/GeoPowerOff",
"path": "venv/lib/python2.7/site-packages/annoying/templatetags/smart_if.py",
"copies": "6",
"size": "7278",
"license": "apache-2.0",
"hash": 663218942266609800,
"line_mean": 29.325,
"line_max": 79,
"alpha_frac": 0.5395713108,
"autogenerated": false,
"ratio": 4... |
from django import template
def get_att_list_var(tag_name, tag_args):
att_list_var = tag_args.get('from')
if not att_list_var:
raise template.TemplateSyntaxError, "%r is missing 'from' parameter" % tag_name
return att_list_var
def get_context_var(tag_name, tag_args):
return tag_args.get('a... | {
"repo_name": "bhrutledge/debugged-django",
"path": "debugged/core/templatetags/__init__.py",
"copies": "1",
"size": "2264",
"license": "mit",
"hash": -3410428687400703000,
"line_mean": 30.8873239437,
"line_max": 104,
"alpha_frac": 0.5949646643,
"autogenerated": false,
"ratio": 3.5936507936507938... |
from django import template
from accounting.libs.checks import CheckingModelMixin
register = template.Library()
@register.filter
def check(obj, field_name=None):
"""
Can check an entire model or just a single model field
"""
if isinstance(obj, CheckingModelMixin):
if not field_name:
... | {
"repo_name": "kenjhim/django-accounting",
"path": "accounting/libs/templatetags/check_filters.py",
"copies": "3",
"size": "1275",
"license": "mit",
"hash": -3891945356593607700,
"line_mean": 23.0566037736,
"line_max": 61,
"alpha_frac": 0.6156862745,
"autogenerated": false,
"ratio": 3.97196261682... |
from django import template
from achievements.models import Category, Trophy
from achievements import settings
register = template.Library()
# call single_category.html with the given parameters
@register.inclusion_tag('achievements/single_category.html')
def render_category(category, user):
return {
'ca... | {
"repo_name": "kaduuuken/achievementsystem",
"path": "achievements/templatetags/achievement_tags.py",
"copies": "1",
"size": "1655",
"license": "bsd-2-clause",
"hash": -8466354096826834000,
"line_mean": 36.6363636364,
"line_max": 80,
"alpha_frac": 0.7444108761,
"autogenerated": false,
"ratio": 3.... |
from django import template
from adminfiles.parse import parse_options
from adminfiles import utils
register = template.Library()
@register.filter
def render_uploads(content,
template_path="adminfiles/render/"):
"""
Render uploaded file references in a content string
(i.e. translate "<... | {
"repo_name": "carljm/django-adminfiles",
"path": "adminfiles/templatetags/adminfiles_tags.py",
"copies": "1",
"size": "1175",
"license": "bsd-3-clause",
"hash": -3183567061980962000,
"line_mean": 30.7567567568,
"line_max": 70,
"alpha_frac": 0.6970212766,
"autogenerated": false,
"ratio": 3.969594... |
from django import template
from aggregator.models import Feed, Entry
register = template.Library()
class FeedListNode(template.Node):
def __init__(self, var_name):
self.var_name = var_name
def render(self, context):
context[self.var_name] = Feed.objects.filter(is_defunct=False)
re... | {
"repo_name": "brutasse/django-aggregator",
"path": "aggregator/templatetags/aggregator_tags.py",
"copies": "1",
"size": "1454",
"license": "bsd-3-clause",
"hash": 5801806651441428000,
"line_mean": 24.9642857143,
"line_max": 76,
"alpha_frac": 0.6011004127,
"autogenerated": false,
"ratio": 3.66246... |
from django import template
from allauth.account.utils import user_display
register = template.Library()
class UserDisplayNode(template.Node):
def __init__(self, user, as_var=None):
self.user_var = template.Variable(user)
self.as_var = as_var
def render(self, context):
user = self... | {
"repo_name": "DarkArtek/FFXIVITAFC",
"path": "allauth/account/templatetags/account.py",
"copies": "7",
"size": "1178",
"license": "unlicense",
"hash": -7310125960157496000,
"line_mean": 21.6538461538,
"line_max": 64,
"alpha_frac": 0.5772495756,
"autogenerated": false,
"ratio": 3.7756410256410255... |
from django import template
from allauth.account.utils import user_display
register = template.Library()
class UserDisplayNode(template.Node):
def __init__(self, user, as_var=None):
self.user_var = template.Variable(user)
self.as_var = as_var
def render(self, context):
user = se... | {
"repo_name": "julen/django-allauth",
"path": "allauth/account/templatetags/account.py",
"copies": "39",
"size": "1185",
"license": "mit",
"hash": -3029548250377362000,
"line_mean": 24.2127659574,
"line_max": 95,
"alpha_frac": 0.5738396624,
"autogenerated": false,
"ratio": 3.8599348534201954,
"... |
from django import template
from allauth.account.utils import user_display
register = template.Library()
class UserDisplayNode(template.Node):
def __init__(self, user, as_var=None):
self.user_var = template.Variable(user)
self.as_var = as_var
def render(self, context):
user = self.... | {
"repo_name": "agriffis/django-allauth",
"path": "allauth/account/templatetags/account.py",
"copies": "43",
"size": "1159",
"license": "mit",
"hash": -8027713296764767000,
"line_mean": 22.6530612245,
"line_max": 82,
"alpha_frac": 0.5867126833,
"autogenerated": false,
"ratio": 3.750809061488673,
... |
from django import template
from apps.carts.utils import get_cart
from apps.books.models import Book
register = template.Library()
@register.simple_tag(takes_context=True)
def get_quantity(context, item_id):
cart = get_cart(context['request'])
return cart[str(item_id)]
@register.simple_tag(takes_context=Tru... | {
"repo_name": "vuonghv/brs",
"path": "apps/carts/templatetags/carts.py",
"copies": "1",
"size": "1116",
"license": "mit",
"hash": -1852452036583190000,
"line_mean": 25.5714285714,
"line_max": 53,
"alpha_frac": 0.644265233,
"autogenerated": false,
"ratio": 3.4875,
"config_test": false,
"has_no... |
from django import template
from articles.modules.category.models import Category
from articles.utils import parse_tokens
register = template.Library()
class CategoriesNode(template.Node):
"""
Output a list of categories.
Usage:
{% categories %}
"""
def __init__(self, selecte... | {
"repo_name": "michaelkuty/feincms-articles",
"path": "articles/modules/category/templatetags/articlecategory.py",
"copies": "2",
"size": "1621",
"license": "bsd-2-clause",
"hash": 3557551074688628700,
"line_mean": 29.5849056604,
"line_max": 98,
"alpha_frac": 0.63726095,
"autogenerated": false,
"... |
from django import template
from betainvite.forms import WaitingListEntryForm
from betainvite.models import InvitationKey
register = template.Library()
@register.simple_tag(takes_context = True)
def remaining_invites(context):
"""
Get the remaning invites available for the current user
Syntax::
... | {
"repo_name": "euanlau/django-betainvite",
"path": "betainvite/templatetags/betainvite_tags.py",
"copies": "1",
"size": "1082",
"license": "bsd-3-clause",
"hash": -6200940983486937000,
"line_mean": 23.5909090909,
"line_max": 82,
"alpha_frac": 0.6987060998,
"autogenerated": false,
"ratio": 3.69283... |
from django import template
from biblion.models import Post
from biblion.settings import ALL_SECTION_NAME, SECTIONS
register = template.Library()
class LatestAnnouncementsNode(template.Node):
def __init__(self, context_var):
self.context_var = context_var
def render(self, context):
... | {
"repo_name": "tzangms/PyConTW",
"path": "pycon_project/biblion/templatetags/biblion_tags.py",
"copies": "1",
"size": "2937",
"license": "bsd-3-clause",
"hash": -2039205973473541000,
"line_mean": 25.4594594595,
"line_max": 77,
"alpha_frac": 0.6394279877,
"autogenerated": false,
"ratio": 3.8392156... |
from django import template
from blockcypher.utils import satoshis_to_btc, satoshis_to_btc_rounded
from blockcypher.api import get_websocket_url
from blockcypher.constants import COIN_SYMBOL_MAPPINGS
register = template.Library()
@register.filter(name='satoshis_to_btc_rounding')
def satoshis_to_btc_rounding(satosh... | {
"repo_name": "linuxmahara/blockcypher-explorer",
"path": "addresses/templatetags/btc_formats.py",
"copies": "1",
"size": "1152",
"license": "apache-2.0",
"hash": -81013684667006380,
"line_mean": 29.3157894737,
"line_max": 70,
"alpha_frac": 0.7734375,
"autogenerated": false,
"ratio": 2.8444444444... |
from django import template
from blockcypher.utils import satoshis_to_btc, satoshis_to_btc_rounded
from blockcypher.api import _get_websocket_url
from blockcypher.constants import COIN_SYMBOL_MAPPINGS
register = template.Library()
@register.filter(name='satoshis_to_btc_rounding')
def satoshis_to_btc_rounding(satos... | {
"repo_name": "ychaim/explorer",
"path": "addresses/templatetags/btc_formats.py",
"copies": "1",
"size": "1154",
"license": "apache-2.0",
"hash": -6309694911423406000,
"line_mean": 29.3684210526,
"line_max": 70,
"alpha_frac": 0.7720970537,
"autogenerated": false,
"ratio": 2.8353808353808354,
"c... |
from django import template
from bloodon.accounts.utils import user_display
register = template.Library()
class UserDisplayNode(template.Node):
def __init__(self, user, as_var=None):
self.user_var = template.Variable(user)
self.as_var = as_var
def render(self, context):
user = self.... | {
"repo_name": "houssemFat/bloodOn",
"path": "bloodon/accounts/templatetags/accounts.py",
"copies": "1",
"size": "1162",
"license": "mit",
"hash": -2907794783642454500,
"line_mean": 23.7234042553,
"line_max": 95,
"alpha_frac": 0.5860585198,
"autogenerated": false,
"ratio": 3.785016286644951,
"co... |
from django import template
from brabeion.models import BadgeAward
register = template.Library()
class BadgeCountNode(template.Node):
@classmethod
def handle_token(cls, parser, token):
bits = token.split_contents()
if len(bits) == 2:
return cls(bits[1])
elif len(bits) ==... | {
"repo_name": "kinsights/brabeion",
"path": "brabeion/templatetags/brabeion_tags.py",
"copies": "1",
"size": "2292",
"license": "bsd-3-clause",
"hash": 2538065367782939600,
"line_mean": 28.0126582278,
"line_max": 89,
"alpha_frac": 0.6007853403,
"autogenerated": false,
"ratio": 3.8391959798994977,... |
from django import template
from bs4 import BeautifulSoup
register = template.Library()
@register.tag(name='activehref')
def do_active_href(parser, token):
nodelist = parser.parse(('endactivehref',))
parser.delete_first_token()
return ActiveHref(nodelist)
class ActiveHref(template.Node):
"""
Thi... | {
"repo_name": "twaddington/django-olcc",
"path": "django_olcc/olcc/templatetags/olcc.py",
"copies": "1",
"size": "1317",
"license": "mit",
"hash": -522283787917619260,
"line_mean": 26.4375,
"line_max": 61,
"alpha_frac": 0.5337889142,
"autogenerated": false,
"ratio": 4.275974025974026,
"config_t... |
from django import template
from bvspca.animals.models import LocationSponsor
register = template.Library()
@register.filter
def to_years_and_months(months):
"""
Convert a integer value into a string of years and months e.g.
27 would be represented as '2 Years 3 Months'
"""
whole_years = months ... | {
"repo_name": "nfletton/bvspca",
"path": "bvspca/animals/templatetags/animal_tags.py",
"copies": "1",
"size": "1259",
"license": "mit",
"hash": -6708267313582470000,
"line_mean": 24.18,
"line_max": 75,
"alpha_frac": 0.6060365369,
"autogenerated": false,
"ratio": 3.713864306784661,
"config_test"... |
from django import template
from carousel.models import Carousel
register = template.Library()
@register.tag('carousel')
def show_carousel(parser, token):
try:
tag_name, function, carousel_slug = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError('%r tag requires th... | {
"repo_name": "omarestrella/django-carousel",
"path": "carousel/templatetags/carousel_tags.py",
"copies": "1",
"size": "1156",
"license": "mit",
"hash": 8147901346943601000,
"line_mean": 33,
"line_max": 98,
"alpha_frac": 0.6332179931,
"autogenerated": false,
"ratio": 3.717041800643087,
"config_... |
from django import template
from cars.search.builders import UrlBuilder, build_hidden_fields, name_by_id, \
key_by_id, SHORT_FACET_SIZE, LONG_FACET_SIZE
from cars.search.source import RANGED_PARAMS
register = template.Library()
@register.inclusion_tag('cars/search_bar.html')
def search_bar(source):
return {... | {
"repo_name": "resurtm/recarguide",
"path": "backend/cars/templatetags/cars_search.py",
"copies": "1",
"size": "2394",
"license": "mit",
"hash": -8515007199033799000,
"line_mean": 31.3243243243,
"line_max": 79,
"alpha_frac": 0.6024247492,
"autogenerated": false,
"ratio": 3.254421768707483,
"con... |
from django import template
from cms_saq.models import (
Question, Answer, Submission, aggregate_score_for_user_by_tags,
)
register = template.Library()
@register.simple_tag(takes_context=True)
def saq_percent_score(context, question_slug):
"""Get a percentage score for a single question."""
user = geta... | {
"repo_name": "Maplecroft/django-cms-saq",
"path": "cms_saq/templatetags/saq_tags.py",
"copies": "1",
"size": "1961",
"license": "mit",
"hash": 3536537691456875500,
"line_mean": 32.8103448276,
"line_max": 79,
"alpha_frac": 0.6766955635,
"autogenerated": false,
"ratio": 3.875494071146245,
"confi... |
from django import template
from cms.templatetags.cms_tags import Placeholder
from laterpay import ItemDefinition
register = template.Library()
class PaidContentPlaceholder(Placeholder):
name = 'lp_placeholder'
def render_tag(self, context, name, extra_bits, nodelist=None):
content = super(PaidCo... | {
"repo_name": "slafs/slafs-lp-blog",
"path": "paid_content/templatetags/paid_content_tags.py",
"copies": "1",
"size": "1517",
"license": "mit",
"hash": 4157678349442806300,
"line_mean": 32.7111111111,
"line_max": 116,
"alpha_frac": 0.5847066579,
"autogenerated": false,
"ratio": 4.249299719887955,... |
from django import template
from coderedcms.models import Footer
from website.models import CwNavbar, MiniSite
register = template.Library()
@register.simple_tag(takes_context=True)
def set_new_menu(context, state):
context["request"].session["new_menu"] = state
return ""
@register.filter
def card_hdr_cla... | {
"repo_name": "ianastewart/cwltc-admin",
"path": "website/templatetags/cw_tags.py",
"copies": "1",
"size": "2431",
"license": "mit",
"hash": 4871046746967228000,
"line_mean": 25.7142857143,
"line_max": 87,
"alpha_frac": 0.6018099548,
"autogenerated": false,
"ratio": 3.728527607361963,
"config_t... |
from django import template
from collections import OrderedDict
from sectors.models import Sector
from outcomes.models import PriorityOutcome
from indicators.models import Indicator
from measures.models import CoreMeasure
from home.models import HomePageTopStories
register = template.Library()
@register.inclusion_t... | {
"repo_name": "Ecotrust/F2S-MOI",
"path": "moi/moi/templatetags/moi_tags.py",
"copies": "1",
"size": "1072",
"license": "apache-2.0",
"hash": -107579242089557200,
"line_mean": 27.2368421053,
"line_max": 72,
"alpha_frac": 0.6707089552,
"autogenerated": false,
"ratio": 3.9267399267399266,
"config... |
from django import template
from ..conf import conf
from ..loading import find, ICanHazTemplateNotFound
register = template.Library()
class ICanHazNode(template.Node):
def __init__(self, name):
self.name = template.Variable(name)
def render(self, context):
name = self.name.resolve(conte... | {
"repo_name": "carljm/django-icanhaz",
"path": "icanhaz/templatetags/icanhaz.py",
"copies": "1",
"size": "1273",
"license": "bsd-3-clause",
"hash": -6050284648705963000,
"line_mean": 24.46,
"line_max": 78,
"alpha_frac": 0.5805184603,
"autogenerated": false,
"ratio": 4.0157728706624605,
"config_... |
from django import template
from contract import biz
register = template.Library()
@register.tag(name='year_month_filter')
def year_month_filter(parser, token):
try:
if len(token.split_contents()) == 3:
tag_name, context_year, context_month = token.split_contents()
label_text1 =... | {
"repo_name": "YangWanjun/areaparking",
"path": "contract/templatetags/contract_tags.py",
"copies": "1",
"size": "3365",
"license": "apache-2.0",
"hash": 6162652823584140000,
"line_mean": 47.5362318841,
"line_max": 157,
"alpha_frac": 0.581666169,
"autogenerated": false,
"ratio": 3.484911550468262... |
from django import template
from ..core import (get_country, get_country_name,
get_country_code, get_city, get_lat_lon)
register = template.Library()
@register.filter
def country_of_request(request):
return get_country(request)
@register.filter
def country_code_of_request(request):
ret... | {
"repo_name": "botify-labs/django-geoip-utils",
"path": "geoip_utils/templatetags/geoip_tags.py",
"copies": "1",
"size": "1548",
"license": "bsd-3-clause",
"hash": 1651592559811581000,
"line_mean": 17.8780487805,
"line_max": 60,
"alpha_frac": 0.6815245478,
"autogenerated": false,
"ratio": 3.43237... |
from django import template
from core.models import ArticlesIndexPage
register = template.Library()
@register.simple_tag(takes_context=True)
def get_site_root(context):
# NB this returns a core.Page, not the implementation-specific model used
# so object-comparison to self will return false as objects would... | {
"repo_name": "thepoly/Pipeline",
"path": "core/templatetags/core_menu.py",
"copies": "1",
"size": "1753",
"license": "mit",
"hash": 520794500564404700,
"line_mean": 37.9555555556,
"line_max": 82,
"alpha_frac": 0.67826583,
"autogenerated": false,
"ratio": 4.086247086247086,
"config_test": false... |
from django import template
from courses.utils import DAYS, ObjectJSONEncoder
from courses.encoder import default_encoder
register = template.Library()
def remove_zero_prefix(timestr):
if timestr[0] == '0':
return timestr[1:]
return timestr
@register.filter
def bold_topics_include(string):
re... | {
"repo_name": "jeffh/YACS",
"path": "courses/templatetags/course_tags.py",
"copies": "2",
"size": "3398",
"license": "mit",
"hash": -237052628316520670,
"line_mean": 23.2714285714,
"line_max": 78,
"alpha_frac": 0.6244849912,
"autogenerated": false,
"ratio": 3.4958847736625516,
"config_test": fa... |
from django import template
from datetime import datetime
from binascii import crc32
from browseNet.models import Path, Share
from search.models import File, Host
from search.templatetags.search_extras import makeLink
register = template.Library()
@register.filter
def linkit(object,directServe=False):
"""
S... | {
"repo_name": "HM2MC/Webfront",
"path": "m2m/browseNet/templatetags/browseNet_extras.py",
"copies": "2",
"size": "3792",
"license": "mit",
"hash": 5130683208702732000,
"line_mean": 25.7042253521,
"line_max": 110,
"alpha_frac": 0.6025843882,
"autogenerated": false,
"ratio": 3.7359605911330047,
"... |
from django import template
from datetime import datetime
register = template.Library()
# Thanks to Dan Jacob and Sean Vieira for making the following snippet
# available at http://flask.pocoo.org/snippets/33/
# minor changes by me: register filter, removing tzinfo and python 3 fix
@register.filter('humanize')
def... | {
"repo_name": "0xfoo/django-todolist",
"path": "lists/templatetags/lists_extras.py",
"copies": "2",
"size": "1473",
"license": "mit",
"hash": -3275423665158923000,
"line_mean": 25.3035714286,
"line_max": 75,
"alpha_frac": 0.5689069925,
"autogenerated": false,
"ratio": 3.691729323308271,
"config... |
from django import template
from datetime import datetime
register = template.Library()
@register.filter(expects_localtime=True)
def time_since(value):
if not value:
return ""
then = value.replace(tzinfo=None)
now = datetime.now()
dif = now - then
years = int(dif.days / 365)
if years:... | {
"repo_name": "JD-666/wwsc",
"path": "forum_app/templatetags/tag_filter_extra.py",
"copies": "1",
"size": "1643",
"license": "apache-2.0",
"hash": -7210670811364698000,
"line_mean": 25.9508196721,
"line_max": 75,
"alpha_frac": 0.5733414486,
"autogenerated": false,
"ratio": 3.987864077669903,
"c... |
from django import template
from decimal import Decimal, InvalidOperation
import fractions
from .. import get_fraction_parts, get_fraction_unicode_entity
register = template.Library()
@register.inclusion_tag('djfractions/display_fraction.html', name='display_fraction')
def display_fraction(value, limit_denominato... | {
"repo_name": "jmichalicek/django-fractions",
"path": "djfractions/templatetags/fractions.py",
"copies": "1",
"size": "2629",
"license": "bsd-3-clause",
"hash": -4138234207591785000,
"line_mean": 40.078125,
"line_max": 106,
"alpha_frac": 0.6987447699,
"autogenerated": false,
"ratio": 3.8833087149... |
from django import template
from decimal import Decimal
from utils.rounding import moneyfmt
register = template.Library()
def make_money(value):
if value == '' or value == None:
value = '0.00'
m = moneyfmt(Decimal(str(value)))
if m.split('.')[0] == '$':
m = '$0.%s' % m.split('.')[1]
r... | {
"repo_name": "katemsu/kate_website",
"path": "kate3/pages/templatetags/money.py",
"copies": "1",
"size": "2155",
"license": "mit",
"hash": 3563432834054011000,
"line_mean": 30.7058823529,
"line_max": 98,
"alpha_frac": 0.5164733179,
"autogenerated": false,
"ratio": 3.074179743223966,
"config_te... |
from django import template
from decisiontree.multitenancy.utils import tenancy_reverse
register = template.Library()
@register.filter
def mean(values):
try:
integers = [int(v) for v in values]
except (TypeError, ValueError):
return 'n/a'
return sum(integers)/len(integers)*1.0
@regist... | {
"repo_name": "caktus/rapidsms-decisiontree-app",
"path": "decisiontree/templatetags/tree_tags.py",
"copies": "1",
"size": "1580",
"license": "bsd-3-clause",
"hash": -2595475959699443700,
"line_mean": 24.0793650794,
"line_max": 73,
"alpha_frac": 0.6379746835,
"autogenerated": false,
"ratio": 3.60... |
from django import template
from delorean import parse
register = template.Library()
class VerbatimNode(template.Node):
def __init__(self, text):
self.text = text
def render(self, context):
return self.text
@register.tag
def verbatim(parser, token):
text = []
while 1:
token... | {
"repo_name": "myusuf3/courtside",
"path": "courtside/game/templatetags/time_tags.py",
"copies": "4",
"size": "1238",
"license": "mit",
"hash": -6619260769551039000,
"line_mean": 27.1590909091,
"line_max": 58,
"alpha_frac": 0.605815832,
"autogenerated": false,
"ratio": 3.762917933130699,
"confi... |
from django import template
from distutils2.version import NormalizedVersion
from projects.utils import mkversion
from builds.constants import LATEST
from builds.constants import STABLE
register = template.Library()
def make_version(version):
ver = mkversion(version)
if not ver:
if version.slug == L... | {
"repo_name": "agjohnson/readthedocs.org",
"path": "readthedocs/projects/templatetags/projects_tags.py",
"copies": "2",
"size": "1090",
"license": "mit",
"hash": -403764868376079300,
"line_mean": 26.9487179487,
"line_max": 79,
"alpha_frac": 0.6623853211,
"autogenerated": false,
"ratio": 4.0370370... |
from django import template
from django_conference import settings
register = template.Library()
@register.tag()
def display_form(parser, token):
"""
Wrapper that shows the given form wrapped in a <div> of class form-row
and each field inside a <p>.
"""
tag_name, form_name = token.split_contents... | {
"repo_name": "MasonM/hssonline-conference",
"path": "django_conference/templatetags/display_form.py",
"copies": "1",
"size": "1683",
"license": "bsd-3-clause",
"hash": 7491889777803049000,
"line_mean": 32.66,
"line_max": 77,
"alpha_frac": 0.5454545455,
"autogenerated": false,
"ratio": 3.92307692... |
from django import template
from django_conference.models import DonationType, RegistrationDonation
register = template.Library()
@register.tag()
def num_donated(registration, donate_type_name):
"""
Helper tag that returns the amount that the given registration donated
to a given cause. First argument m... | {
"repo_name": "MasonM/hssonline-conference",
"path": "django_conference/templatetags/num_donated.py",
"copies": "1",
"size": "1181",
"license": "bsd-3-clause",
"hash": 1761794556819060500,
"line_mean": 30.9189189189,
"line_max": 78,
"alpha_frac": 0.699407282,
"autogenerated": false,
"ratio": 3.97... |
from django import template
from django_conference.models import ExtraType, RegistrationExtra
register = template.Library()
@register.simple_tag
def num_extras(registration, extra_type_name):
"""
Helper tag that returns the number of extras that the given registration
contains. First argument must be th... | {
"repo_name": "MasonM/hssonline-conference",
"path": "django_conference/templatetags/num_extras.py",
"copies": "1",
"size": "1724",
"license": "bsd-3-clause",
"hash": 9018037661376819000,
"line_mean": 30.9259259259,
"line_max": 78,
"alpha_frac": 0.6647331787,
"autogenerated": false,
"ratio": 4.15... |
from django import template
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from whereabouts.models import SocialNetworkProfile
register = template.Library()
class Whereabouts(template.Node):
def __init__(self, content_object, var_name):
self.cont... | {
"repo_name": "gsiegman/django-whereabouts",
"path": "whereabouts/templatetags/whereabouts_tags.py",
"copies": "1",
"size": "2485",
"license": "mit",
"hash": 8877585440668432000,
"line_mean": 28.2352941176,
"line_max": 75,
"alpha_frac": 0.646277666,
"autogenerated": false,
"ratio": 3.938193343898... |
from django import template
from django.contrib.contenttypes.models import ContentType
from anafero.conf import settings
register = template.Library()
@register.inclusion_tag("anafero/_create_referral_form.html", takes_context=True)
def create_referral(context, url, obj=None):
if obj:
context.update(
... | {
"repo_name": "Mercy-Nekesa/sokoapp",
"path": "sokoapp/anafero/templatetags/anafero_tags.py",
"copies": "1",
"size": "1446",
"license": "mit",
"hash": 3183848946200907300,
"line_mean": 25.7777777778,
"line_max": 86,
"alpha_frac": 0.6286307054,
"autogenerated": false,
"ratio": 3.5441176470588234,
... |
from django import template
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.conf import settings
from tagging.models import Tag, TaggedItem
from tagging.utils import parse_tag_input
from tasks.models import Task
import re
register = template.Libr... | {
"repo_name": "ericholscher/pinax",
"path": "pinax/apps/tasks/templatetags/tasks_tags.py",
"copies": "1",
"size": "2890",
"license": "mit",
"hash": 7079243788555618000,
"line_mean": 27.91,
"line_max": 161,
"alpha_frac": 0.6235294118,
"autogenerated": false,
"ratio": 3.7338501291989665,
"config_... |
from django import template
from django.contrib.contenttypes.models import ContentType
from pinax.apps.topics.models import Topic
register = template.Library()
@register.inclusion_tag("topics/topic_item.html", takes_context=True)
def show_topic(context, topic):
return {
"topic": topic,
"grou... | {
"repo_name": "kevinr/750book-web",
"path": "750book-web-env/lib/python2.7/site-packages/pinax/apps/topics/templatetags/topics_tags.py",
"copies": "2",
"size": "1408",
"license": "mit",
"hash": 4781387806365455000,
"line_mean": 28.3333333333,
"line_max": 94,
"alpha_frac": 0.6590909091,
"autogenerat... |
from django import template
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
from types import ListType,TupleType
from xformmanager.models import *
import xformmanager.adapter.querytools as qtools
from hq.model... | {
"repo_name": "icomms/wqmanager",
"path": "apps/hq/templatetags/dashboard_tags.py",
"copies": "1",
"size": "7701",
"license": "bsd-3-clause",
"hash": 2784764895550516000,
"line_mean": 41.0819672131,
"line_max": 176,
"alpha_frac": 0.5799246851,
"autogenerated": false,
"ratio": 3.854354354354354,
... |
from django import template
from django.db.models import Count
from django.db.models.functions import TruncYear
from django.utils.html import format_html
from spectator.core.models import Creator
from spectator.core.utils import chartify
from spectator.core import app_settings
from ..models import Event, Work
regis... | {
"repo_name": "philgyford/django-spectator",
"path": "spectator/events/templatetags/spectator_events.py",
"copies": "1",
"size": "7698",
"license": "mit",
"hash": 3358138559340630000,
"line_mean": 27.6171003717,
"line_max": 87,
"alpha_frac": 0.640166277,
"autogenerated": false,
"ratio": 3.5102599... |
from django import template
from djangoedu.apps.news.models import Story, ImportantDate, Announcement
register = template.Library()
class LatestPublicationNode(template.Node):
"""
A template node that is meant to handle various publication models.
Model must have ``publish_date`` field and a ``publ... | {
"repo_name": "tjnapster555/django-edu",
"path": "djangoedu/apps/news/templatetags/edunews.py",
"copies": "1",
"size": "4393",
"license": "mit",
"hash": -7755766666249715000,
"line_mean": 29.9366197183,
"line_max": 90,
"alpha_frac": 0.5888914182,
"autogenerated": false,
"ratio": 4.105607476635514... |
from django import template
from django_featurette.utils import is_feature_enabled_for_user
register = template.Library()
@register.tag('feature')
def do_feature(parser, token):
"""
Outputs the contents of the block if the feature passed as argument is
enabled for the currently authenticated user.
E... | {
"repo_name": "GermanoGuerrini/django-featurette",
"path": "django_featurette/templatetags/featurette.py",
"copies": "1",
"size": "1296",
"license": "mit",
"hash": 6704763309030194000,
"line_mean": 27.8222222222,
"line_max": 74,
"alpha_frac": 0.6234567901,
"autogenerated": false,
"ratio": 4.37837... |
from django import template
from django.shortcuts import render_to_response, redirect, get_object_or_404
from article.models import Slide
register = template.Library()
@register.inclusion_tag('slides/slides.html')
def get_main_slides():
slides = Slide.objects.filter(published_main=1).order_by('ordering')
... | {
"repo_name": "skylifewww/pharmacognosy",
"path": "article/templatetags/category_tags.py",
"copies": "1",
"size": "2617",
"license": "mit",
"hash": 4090002862501847600,
"line_mean": 24.6568627451,
"line_max": 102,
"alpha_frac": 0.634696217,
"autogenerated": false,
"ratio": 3.2590286425902866,
"... |
from django import template
from django.shortcuts import render_to_response, redirect, get_object_or_404
# from product.models import Slide
register = template.Library()
# @register.inclusion_tag('slides/slides.html')
# def get_main_slides():
# slides = Slide.objects.filter(published_main=1).order_by('orde... | {
"repo_name": "skylifewww/pangolinland",
"path": "article/templatetags/category_tags.py",
"copies": "3",
"size": "2627",
"license": "mit",
"hash": 3895061493418457000,
"line_mean": 24.7549019608,
"line_max": 102,
"alpha_frac": 0.6322801675,
"autogenerated": false,
"ratio": 3.23921085080148,
"co... |
from django import template
# from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag
def bootstrap_tag_class(name):
name_low = name.lower()
class_ = "badge-secondary"
if name_low.startswith("swc"):
... | {
"repo_name": "pbanaszkiewicz/amy",
"path": "amy/workshops/templatetags/tags.py",
"copies": "1",
"size": "1091",
"license": "mit",
"hash": 4579325318052530000,
"line_mean": 27.7105263158,
"line_max": 74,
"alpha_frac": 0.664527956,
"autogenerated": false,
"ratio": 3.542207792207792,
"config_test... |
from django import template
from django.template.loader import render_to_string
from django.contrib.contenttypes.models import ContentType
from phileo.models import Like
from phileo.utils import _allowed, widget_context
from phileo.settings import LIKABLE_MODELS
register = template.Library()
@register.assignment_t... | {
"repo_name": "jacobwegner/phileo",
"path": "phileo/templatetags/phileo_tags.py",
"copies": "2",
"size": "4627",
"license": "mit",
"hash": -6530316512609152000,
"line_mean": 26.5416666667,
"line_max": 92,
"alpha_frac": 0.5943375837,
"autogenerated": false,
"ratio": 3.792622950819672,
"config_te... |
from django import template
from django.utils.safestring import mark_safe
from django.core.exceptions import ImproperlyConfigured
from django_bundles.conf.bundles_settings import bundles_settings
from django_bundles.core import get_bundles
register = template.Library()
def _render_file(file_type, file_url, attrs=N... | {
"repo_name": "sdcooke/django_bundles",
"path": "django_bundles/templatetags/django_bundles_tags.py",
"copies": "1",
"size": "1785",
"license": "mit",
"hash": 6702208696418586000,
"line_mean": 30.3157894737,
"line_max": 159,
"alpha_frac": 0.6778711485,
"autogenerated": false,
"ratio": 3.628048780... |
from django import template
from django.utils.safestring import mark_safe
from mezzanine.conf import settings
from mezzanine_developer_extension.utils import refactor_html
register = template.Library()
# Checking settings.TEMPLATE_STYLE.
# Possible values are:
# - mezzanine_developer_extension.styles.macos
# -... | {
"repo_name": "educalleja/mezzanine-developer-extension",
"path": "mezzanine_developer_extension/templatetags/devfilters.py",
"copies": "1",
"size": "1349",
"license": "bsd-3-clause",
"hash": -2264915017104008400,
"line_mean": 33.6153846154,
"line_max": 79,
"alpha_frac": 0.7146034099,
"autogenerate... |
from django import template
from djsilver.models import Department, FacultyHomePageDepartments
from djsilver.config import DATABASE_NAME
register = template.Library()
class GetFacultyList(template.Node):
def __init__(self, bits):
self.varname = bits[2]
department_name=bits[3:]
dept=''
... | {
"repo_name": "carthagecollege/django-djsilver",
"path": "djsilver/templatetags/get_faculty.py",
"copies": "1",
"size": "1421",
"license": "unlicense",
"hash": 6138512540566340000,
"line_mean": 30.5777777778,
"line_max": 176,
"alpha_frac": 0.6298381422,
"autogenerated": false,
"ratio": 3.69090909... |
from django import template
from djsilver.models import SitetreeLive,FacultyHomePageLive
from djsilver.config import DATABASE_NAME
register = template.Library()
from django.conf import settings
import logging
logging.basicConfig(filename=settings.LOG_FILENAME,level=logging.DEBUG,)
class GetExpertGuide(template.Node... | {
"repo_name": "carthagecollege/django-djsilver",
"path": "djsilver/templatetags/expert_guide.py",
"copies": "1",
"size": "1690",
"license": "unlicense",
"hash": -5499762882075770000,
"line_mean": 31.5,
"line_max": 140,
"alpha_frac": 0.6414201183,
"autogenerated": false,
"ratio": 3.706140350877193... |
from django import template
from ella.utils import get_model
from ella.core.models import Related
register = template.Library()
class RelatedNode(template.Node):
def __init__(self, obj_var, count, var_name, models, finder):
self.obj_var = obj_var
self.count = count
self.var_name = var_nam... | {
"repo_name": "petrlosa/ella",
"path": "ella/core/templatetags/related.py",
"copies": "1",
"size": "3660",
"license": "bsd-3-clause",
"hash": 6681946549418695000,
"line_mean": 35.2376237624,
"line_max": 107,
"alpha_frac": 0.493989071,
"autogenerated": false,
"ratio": 4.710424710424711,
"config_... |
from django import template
from ella.utils import get_model
from ella.core.models import Related
register = template.Library()
class RelatedNode(template.Node):
def __init__(self, obj_var, count, var_name, models, finder):
self.obj_var = obj_var
self.count = count
self.var_name = var_na... | {
"repo_name": "MichalMaM/ella",
"path": "ella/core/templatetags/related.py",
"copies": "1",
"size": "3642",
"license": "bsd-3-clause",
"hash": 330177996405116860,
"line_mean": 35.42,
"line_max": 107,
"alpha_frac": 0.4964305327,
"autogenerated": false,
"ratio": 4.705426356589148,
"config_test": ... |
from django import template
from eulexistdb.db import ExistDB
from eulexistdb.query import QuerySet
register = template.Library()
class DDBCPlaceNameNode(template.Node):
def __init__(self, place_name):
self.place_name = template.Variable(place_name)
def render(self, context):
from browser.... | {
"repo_name": "beijingren/roche-website",
"path": "djiki/templatetags/roche_tags.py",
"copies": "1",
"size": "1330",
"license": "mit",
"hash": -8344905949113553000,
"line_mean": 27.2978723404,
"line_max": 120,
"alpha_frac": 0.6090225564,
"autogenerated": false,
"ratio": 3.575268817204301,
"conf... |
from django import template
from famille import data
register = template.Library()
BADGE_FOLDER = "img/badges/%s.png"
FLAG_FOLDER = "/static/img/flag/%s.png"
@register.filter(name='badge_icon')
def get_badge_icon(user, name):
"""
Retrieve the badge icon url according to the value
of the parameter (Tr... | {
"repo_name": "huguesmayolle/famille",
"path": "famille/templatetags/users.py",
"copies": "1",
"size": "2740",
"license": "apache-2.0",
"hash": -3528632348394676700,
"line_mean": 21.8333333333,
"line_max": 56,
"alpha_frac": 0.6167883212,
"autogenerated": false,
"ratio": 3.535483870967742,
"conf... |
from django import template
from feincms_grid.settings import FEINCMS_GRID_FIELDS
register = template.Library()
@register.filter
def post_process_fieldsets(fieldset, remove=None, keep=None):
"""
Removes a few fields from FeinCMS admin inlines, those being
``id``, ``DELETE`` and ``ORDER`` currently.
... | {
"repo_name": "joshuajonah/feincms_grid",
"path": "feincms_grid/templatetags/feincms_grid_admin_tags.py",
"copies": "1",
"size": "2000",
"license": "bsd-3-clause",
"hash": -8096276581715212000,
"line_mean": 28.4117647059,
"line_max": 77,
"alpha_frac": 0.612,
"autogenerated": false,
"ratio": 3.891... |
from django import template
from feincms.module.medialibrary.models import MediaFile
from feincms_media_variations.models import MediaVariation
register = template.Library()
def tryint(v):
try:
return int(v)
except ValueError:
return 999999 # Arbitrarily big number
def get_options_from_arg(... | {
"repo_name": "schmidsi/feincms-media-variations",
"path": "feincms_media_variations/templatetags/mediavariation_thumbnail.py",
"copies": "1",
"size": "2062",
"license": "bsd-3-clause",
"hash": -5698727041349540000,
"line_mean": 27.6388888889,
"line_max": 85,
"alpha_frac": 0.6382153249,
"autogenera... |
from django import template
from feincms.templatetags.feincms_tags import _render_content
from feincms_grid.settings import FEINCMS_GRID_TOTAL_COLUMNS
register = template.Library()
class NoGridValuesException(Exception):
pass
class GridBuilder(object):
items = []
row_columns = 0
current_row = []
... | {
"repo_name": "joshuajonah/feincms_grid",
"path": "feincms_grid/templatetags/feincms_grid_tags.py",
"copies": "1",
"size": "3190",
"license": "bsd-3-clause",
"hash": 2887038022552795000,
"line_mean": 29.9708737864,
"line_max": 91,
"alpha_frac": 0.5501567398,
"autogenerated": false,
"ratio": 4.299... |
from django import template
from flatcontent.models import FlatContent
register = template.Library()
class FlatContentNode(template.Node):
errors = {
'arg-count': "The flatcontent tag requires 1 or 3+ arguments",
'bad-args': "Bad arguments supplied",
'for-site': {
'missing': "... | {
"repo_name": "orcasgit/django-flatcontent",
"path": "flatcontent/templatetags/flatcontent_tags.py",
"copies": "1",
"size": "3418",
"license": "bsd-3-clause",
"hash": 8676623221535965000,
"line_mean": 29.7927927928,
"line_max": 97,
"alpha_frac": 0.5374488005,
"autogenerated": false,
"ratio": 4.26... |
from django import template
from galeria.models import Picture
register = template.Library()
class RandomPictureListNode(template.Node):
def __init__(self, num, var_name):
self.num = int(num)
self.var_name = var_name
def render(self, context):
random_pictures = Picture.objects.publ... | {
"repo_name": "spanasik/django-galeria",
"path": "galeria/templatetags/galeria_tags.py",
"copies": "1",
"size": "1219",
"license": "bsd-3-clause",
"hash": -3920372476160200700,
"line_mean": 26.0888888889,
"line_max": 77,
"alpha_frac": 0.6275635767,
"autogenerated": false,
"ratio": 3.7164634146341... |
from django import template
from homes.models import Block, SEO, Branch, Banner
register = template.Library()
@register.inclusion_tag('templatetags/header.html')
def page_header(title):
return {
'title': title
}
@register.inclusion_tag('templatetags/block.html', takes_context=True)
def page_block(c... | {
"repo_name": "signalfire/django-property",
"path": "homes_theme_default/templatetags/inclusion_tags.py",
"copies": "1",
"size": "1420",
"license": "mit",
"hash": -6121002519259267000,
"line_mean": 25.3148148148,
"line_max": 89,
"alpha_frac": 0.6633802817,
"autogenerated": false,
"ratio": 3.56783... |
from django import template
from ietf.person.models import Person
register = template.Library()
@register.filter
def abbr_status(value):
"""
Converts RFC Status to a short abbreviation
"""
d = {'Proposed Standard':'PS',
'Draft Standard':'DS',
'Standard':'S',
'Historic':'H'... | {
"repo_name": "wpjesus/codematch",
"path": "ietf/secr/proceedings/templatetags/ams_filters.py",
"copies": "2",
"size": "1881",
"license": "bsd-3-clause",
"hash": -4442570527358658600,
"line_mean": 24.08,
"line_max": 83,
"alpha_frac": 0.5778841042,
"autogenerated": false,
"ratio": 3.63127413127413... |
from django import template
from .. import models
register = template.Library()
class ShowNewsToken(template.Node):
def __init__(self, num, tmpl):
self.tmpl = 'news/object_list.html'
self.num = 5
if num is not None:
try:
self.num = int(num)
excep... | {
"repo_name": "django-de/django-de-v3",
"path": "django_de/news/templatetags/news_tags.py",
"copies": "1",
"size": "2268",
"license": "bsd-3-clause",
"hash": 2992292357251465700,
"line_mean": 24.4831460674,
"line_max": 108,
"alpha_frac": 0.5683421517,
"autogenerated": false,
"ratio": 4.1311475409... |
from django import template
from jobs.models import Job, Field
register = template.Library()
@register.inclusion_tag('jobs/misc/fields_by_center.html')
def fields_by_center(job, center):
jobs = Job.objects.all().filter(jmojobid=job).filter(jmoworkcenterid=center)
counter = 0
fields_needed = []
for o... | {
"repo_name": "wltribble/frost",
"path": "frost/jobs/templatetags/job_filters.py",
"copies": "1",
"size": "2901",
"license": "mit",
"hash": -7734467650169630000,
"line_mean": 46.5573770492,
"line_max": 267,
"alpha_frac": 0.6756290934,
"autogenerated": false,
"ratio": 3.270574971815107,
"config_... |
from django import template
from journal.models import Issue
register = template.Library()
@register.simple_tag(takes_context=True)
def issues_menu(context):
if context.get('user') and context['user'].is_authenticated() and context['user'].is_staff:
qs = Issue.objects.all()
else:
qs = Issue... | {
"repo_name": "Nnonexistent/chemphys",
"path": "src/journal/templatetags/journal_tags.py",
"copies": "1",
"size": "1810",
"license": "mit",
"hash": -350374334587549700,
"line_mean": 29.6779661017,
"line_max": 95,
"alpha_frac": 0.6314917127,
"autogenerated": false,
"ratio": 3.7708333333333335,
"... |
from django import template
from kaleo.forms import InviteForm
from kaleo.models import InvitationStat
register = template.Library()
class RemainingInvitesNode(template.Node):
@classmethod
def handle_token(cls, parser, token):
bits = token.split_contents()
if len(bits) != 2:
... | {
"repo_name": "justhamade/kaleo",
"path": "kaleo/templatetags/kaleo_tags.py",
"copies": "2",
"size": "1516",
"license": "bsd-3-clause",
"hash": -230395623166919460,
"line_mean": 23.4516129032,
"line_max": 71,
"alpha_frac": 0.6418205805,
"autogenerated": false,
"ratio": 3.761786600496278,
"confi... |
from django import template
from laws.models import VoteAction, VOTE_ACTION_TYPE_CHOICES, MemberVotingStatistics
from mks.models import Knesset
from datetime import date, timedelta
from django.utils.translation import ugettext_lazy as _
import logging
logger = logging.getLogger("open-knesset.laws.templatetags")
reg... | {
"repo_name": "noamelf/Open-Knesset",
"path": "laws/templatetags/laws_tags.py",
"copies": "1",
"size": "6055",
"license": "bsd-3-clause",
"hash": -738034430885345000,
"line_mean": 39.3666666667,
"line_max": 108,
"alpha_frac": 0.5681255161,
"autogenerated": false,
"ratio": 3.3864653243847873,
"c... |
from django import template
from libya_elections.phone_numbers import formatted_phone_number_tag
register = template.Library()
@register.filter(name='format_phone_number')
def format_phone_number_tag(value):
"""
Format a phone number, wrapped in a class which will be manipulated to
display properly RTL... | {
"repo_name": "SmartElect/SmartElect",
"path": "libya_site/templatetags/libya_tags.py",
"copies": "1",
"size": "1232",
"license": "apache-2.0",
"hash": -4425038348198837000,
"line_mean": 31.4210526316,
"line_max": 77,
"alpha_frac": 0.6452922078,
"autogenerated": false,
"ratio": 3.8260869565217392... |
from django import template
from livesettings import config_get_group
from satchmo_utils.templatetags import get_filter_args
register = template.Library()
def order_details(context, order, default_view_tax=False):
"""Output a formatted block giving order details."""
return {'order' : order,
'default_... | {
"repo_name": "DrOctogon/Satchmo",
"path": "satchmo/apps/satchmo_store/shop/templatetags/satchmo_order.py",
"copies": "8",
"size": "1784",
"license": "bsd-3-clause",
"hash": 6274404056647849000,
"line_mean": 26.875,
"line_max": 107,
"alpha_frac": 0.6704035874,
"autogenerated": false,
"ratio": 3.6... |
from django import template
from mediagenerator import utils, settings
from mediagenerator.generators.bundles.utils import (_render_include_media,
render_media_block)
register = template.Library()
class MediaNode(template.Node):
def __init__(self, bundle, var... | {
"repo_name": "Carlangueitor/django-mediagenerator",
"path": "mediagenerator/templatetags/media.py",
"copies": "1",
"size": "2032",
"license": "bsd-3-clause",
"hash": -2127494302679586300,
"line_mean": 29.328358209,
"line_max": 79,
"alpha_frac": 0.6402559055,
"autogenerated": false,
"ratio": 4.25... |
from django import template
from metashare.repository.models import corpusInfoType_model, \
lexicalConceptualResourceInfoType_model, \
languageDescriptionInfoType_model
# toolServiceInfoType_model,
from metashare.settings import MEDIA_URL
register = template.Library()
class ResourceMediaTypes(template.No... | {
"repo_name": "MiltosD/CEFELRC",
"path": "metashare/repository/templatetags/resource_media_types.py",
"copies": "2",
"size": "5413",
"license": "bsd-3-clause",
"hash": 3838538569285724000,
"line_mean": 44.1083333333,
"line_max": 100,
"alpha_frac": 0.6092739701,
"autogenerated": false,
"ratio": 3.... |
from django import template
from metashare.repository.models import corpusInfoType_model, \
toolServiceInfoType_model, lexicalConceptualResourceInfoType_model, \
languageDescriptionInfoType_model
from metashare.settings import MEDIA_URL
register = template.Library()
class ResourceMediaTypes(template.Node):
... | {
"repo_name": "JuliBakagianni/CEF-ELRC",
"path": "metashare/repository/templatetags/resource_media_types.py",
"copies": "1",
"size": "5307",
"license": "bsd-3-clause",
"hash": 6420941198347384000,
"line_mean": 43.5966386555,
"line_max": 98,
"alpha_frac": 0.6214433767,
"autogenerated": false,
"rat... |
from django import template
from ..models import Album
register = template.Library()
@register.simple_tag
def get_mime_type(obj=None, field=None):
mime_types = {
'audio': {
'm4a': 'audio/mp4',
'mp3': 'audio/mpeg',
'ogg': 'audio/ogg',
},
'video': {
... | {
"repo_name": "VelocityWebworks/django-media-albums",
"path": "media_albums/templatetags/media_albums_tags.py",
"copies": "1",
"size": "2280",
"license": "mit",
"hash": 5996201537906586000,
"line_mean": 24.0549450549,
"line_max": 77,
"alpha_frac": 0.5421052632,
"autogenerated": false,
"ratio": 3.... |
from django import template
from ..models import Article
from ..utils import parse_tokens
register = template.Library()
class ArticlesNode(template.Node):
"""
Output a list of articles.
If as varname is specified then add the result to the context.
Usage:
{% articles %}
... | {
"repo_name": "michaelkuty/feincms-articles",
"path": "articles/templatetags/article.py",
"copies": "2",
"size": "1974",
"license": "bsd-2-clause",
"hash": 7329595284177233000,
"line_mean": 24.6363636364,
"line_max": 75,
"alpha_frac": 0.5521783181,
"autogenerated": false,
"ratio": 4.6229508196721... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.