text
stringlengths
0
1.05M
meta
dict
from django import template from django.conf import settings from django.core.urlresolvers import reverse, NoReverseMatch from radpress import settings as radpress_settings, get_version from radpress.compat import get_user_model from radpress.models import Article from radpress.readers import get_markup_choices, get_re...
{ "repo_name": "AakashRaina/radpress", "path": "radpress/templatetags/radpress_tags.py", "copies": "2", "size": "2295", "license": "mit", "hash": 718730108097464800, "line_mean": 23.4255319149, "line_max": 75, "alpha_frac": 0.6562091503, "autogenerated": false, "ratio": 3.8186356073211316, "conf...
from django import template from django.conf import settings from django.db import models from django.contrib.comments import Comment, CommentForm import re from datetime import datetime import urllib from django.utils.html import conditional_escape from django.utils.safestring import mark_safe Post = models.get_mo...
{ "repo_name": "HM2MC/Webfront", "path": "basic/blog/templatetags/blog.py", "copies": "2", "size": "5672", "license": "mit", "hash": 6069590325515253000, "line_mean": 29.3315508021, "line_max": 109, "alpha_frac": 0.5424894217, "autogenerated": false, "ratio": 3.9553695955369594, "config_test": t...
from django import template from django.conf import settings from django.db import models from django.contrib.sites.models import Site from django.template import Context, loader register = template.Library() Analytics = models.get_model('googleanalytics', 'analytics') def do_get_analytics(parser, token): conte...
{ "repo_name": "clintecker/django-google-analytics", "path": "google_analytics/templatetags/analytics.py", "copies": "3", "size": "2204", "license": "mit", "hash": -5618479040791165000, "line_mean": 32.3939393939, "line_max": 103, "alpha_frac": 0.5671506352, "autogenerated": false, "ratio": 4.1742...
from django import template from django.conf import settings from django.db import models from django.db.models.signals import post_save from django.utils.translation import ugettext as _ from stream.registry import actor_map, target_map, action_object_map from stream.signals import action DEFAULT_STREAM_VERBS = ( ...
{ "repo_name": "caffeinehit/django-stream", "path": "stream/models.py", "copies": "1", "size": "4681", "license": "mit", "hash": 681257856551270900, "line_mean": 33.9328358209, "line_max": 88, "alpha_frac": 0.6178167058, "autogenerated": false, "ratio": 3.868595041322314, "config_test": false, ...
from django import template from django.conf import settings from django.db import models from news.models import Article, Section import re register = template.Library() @register.inclusion_tag('news/tags/section_snippet.html') def render_section_list(): return {'section_list': Section.objects.all()} @regist...
{ "repo_name": "ilendl2/chrisdev-cookiecutter", "path": "{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/news/templatetags/news_tags.py", "copies": "1", "size": "2798", "license": "bsd-3-clause", "hash": -1878259803754671400, "line_mean": 23.7610619469, "line_max": 68, "alpha_frac": 0.6411722...
from django import template from django.conf import settings from django.db import models from basic.elsewhere.models import SocialNetworkProfile import re register = template.Library() class ElsewhereProfiles(template.Node): def __init__(self, var_name): self.var_name = var_name def render(self, c...
{ "repo_name": "thoas/django-basic-apps", "path": "basic/elsewhere/templatetags/elsewhere.py", "copies": "1", "size": "1090", "license": "bsd-3-clause", "hash": -4841199473068619000, "line_mean": 25.6097560976, "line_max": 99, "alpha_frac": 0.6614678899, "autogenerated": false, "ratio": 3.93501805...
from django import template from django.conf import settings from django.db.models.fields.files import ImageFieldFile register = template.Library() def do_dynamic_image_url(parser, token): tokens = token.split_contents() if len(tokens) < 2: raise template.TemplateSyntaxError( "%r tag req...
{ "repo_name": "jinnykoo/wuyisj", "path": "src/oscar/templatetags/image_tags.py", "copies": "57", "size": "2037", "license": "bsd-3-clause", "hash": 6004037383481482000, "line_mean": 27.6901408451, "line_max": 73, "alpha_frac": 0.4968090329, "autogenerated": false, "ratio": 4.428260869565217, "c...
from django import template from django.conf import settings from django.db.models import Count from anthill.utils import get_items_as_tag, chart_from_tags, _extract_chart_params, ChartNode from anthill.people.models import Profile register = template.Library() @register.tag def get_latest_user_profiles(parser, token...
{ "repo_name": "robbie/anthill", "path": "anthill/people/templatetags/people.py", "copies": "1", "size": "1776", "license": "bsd-3-clause", "hash": -1669272883337369000, "line_mean": 33.8235294118, "line_max": 140, "alpha_frac": 0.6683558559, "autogenerated": false, "ratio": 3.2888888888888888, ...
from django import template from django.conf import settings from django.db.models import get_model from django.template import defaultfilters, loader from .. import library from .. import renderers from ..dashboard import forms ContentType = get_model('contenttypes', 'ContentType') register = template.Library() @...
{ "repo_name": "tangentlabs/django-fancypages", "path": "fancypages/templatetags/fp_block_tags.py", "copies": "2", "size": "2534", "license": "bsd-3-clause", "hash": -1143586269046320400, "line_mean": 27.7954545455, "line_max": 77, "alpha_frac": 0.6902131018, "autogenerated": false, "ratio": 3.667...
from django import template from django.conf import settings from django.db.models import ( Count, Max, Min, ) register = template.Library() TAG_MAX = getattr(settings, 'TAGCLOUD_MAX', 5.0) TAG_MIN = getattr(settings, 'TAGCLOUD_MIN', 1.0) def get_weight_closure(tag_min, tag_max, count_min, count_max): ...
{ "repo_name": "makyo/honeycomb", "path": "tags/templatetags/tag_extras.py", "copies": "2", "size": "1999", "license": "mit", "hash": -7846668506608236000, "line_mean": 29.7538461538, "line_max": 76, "alpha_frac": 0.6378189095, "autogenerated": false, "ratio": 3.6746323529411766, "config_test": ...
from django import template from django.conf import settings from django.db.models import Q from django.db.models.query import QuerySet from django.template import NodeList, TemplateSyntaxError from django.template.loader import render_to_string from django.utils import simplejson from djblets.util.decorators import ba...
{ "repo_name": "asutherland/opc-reviewboard", "path": "reviewboard/reviews/templatetags/reviewtags.py", "copies": "1", "size": "17279", "license": "mit", "hash": -3274260871045028000, "line_mean": 31.9123809524, "line_max": 80, "alpha_frac": 0.5803576596, "autogenerated": false, "ratio": 4.2601084...
from django import template from django.conf import settings from django.db.models import Q from django.template import NodeList, TemplateSyntaxError from django.template.loader import render_to_string from django.utils import simplejson from django.utils.translation import ugettext_lazy as _ from djblets.util.decorato...
{ "repo_name": "chazy/reviewboard", "path": "reviewboard/reviews/templatetags/reviewtags.py", "copies": "1", "size": "20703", "license": "mit", "hash": 4136838567295285000, "line_mean": 32.6634146341, "line_max": 80, "alpha_frac": 0.5696758924, "autogenerated": false, "ratio": 4.316722268557131, ...
from django import template from django.conf import settings from django.db.models import signals from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from turbion.bits.blogs.models import Post, Comment, Tag from turbion.bits.utils.cache.tags import cached_inclusion_tag ...
{ "repo_name": "strogo/turbion", "path": "turbion/templatetags/blogs_pads.py", "copies": "1", "size": "3282", "license": "bsd-3-clause", "hash": 5162311991555918000, "line_mean": 31.495049505, "line_max": 94, "alpha_frac": 0.5676416819, "autogenerated": false, "ratio": 4.066914498141264, "config...
from django import template from django.conf import settings from django.forms import CheckboxInput, RadioSelect from kishore import settings as kishore_settings try: from less.templatetags.less import less as less_tag except ImportError: pass register = template.Library() @register.filter def kishore_curre...
{ "repo_name": "udbhav/kishore", "path": "kishore/templatetags/kishore_tags.py", "copies": "1", "size": "1538", "license": "mit", "hash": -2570587346545036000, "line_mean": 28.5769230769, "line_max": 105, "alpha_frac": 0.6651495449, "autogenerated": false, "ratio": 3.279317697228145, "config_tes...
from django import template from django.conf import settings from django.http import HttpRequest from feincms.module.page.models import Page, PageManager from feincms.utils.templatetags import * from feincms.utils.templatetags import _parse_args register = template.Library() class NavigationNode(SimpleAssignmentNode...
{ "repo_name": "amboycharlie/Child-Friendly-LCMS", "path": "leonardo/module/nav/templatetags/webcms_nav_tags.py", "copies": "2", "size": "11473", "license": "apache-2.0", "hash": -4284846923899336700, "line_mean": 36.1294498382, "line_max": 124, "alpha_frac": 0.5835439728, "autogenerated": false, ...
from django import template from django.conf import settings from django_jsx.template.backend import JsTemplate from django_jsx.template.loaders import JsLoader register = template.Library() loader = JsLoader(engine=None) class JsMissingTemplateDirException(Exception): pass def _get_template_dirs(): for t ...
{ "repo_name": "OmegaDroid/django-jsx", "path": "django_jsx/templatetags/djangojs.py", "copies": "1", "size": "1190", "license": "bsd-3-clause", "hash": 5431327853873583000, "line_mean": 29.5128205128, "line_max": 87, "alpha_frac": 0.7285714286, "autogenerated": false, "ratio": 3.8636363636363638,...
from django import template from django.conf import settings from djangopress.forum.models import Thread, Post from djangopress.core.util import has_permission from django.urls import reverse from djangopress.core.format.library import Library import djangopress.core.format.nodes as nodes register = template.Library()...
{ "repo_name": "codefisher/djangopress", "path": "djangopress/forum/templatetags/forum_tags.py", "copies": "1", "size": "7092", "license": "mit", "hash": 602799347472832800, "line_mean": 47.9172413793, "line_max": 281, "alpha_frac": 0.6340947547, "autogenerated": false, "ratio": 3.7169811320754715...
from django import template from django.conf import settings from django.shortcuts import get_object_or_404 register = template.Library() from cmsbase.models import Page, PageLink # Truncate chars but leaving last word complete @register.filter("smart_truncate_chars") def smart_truncate_chars(value, max_length): ...
{ "repo_name": "Cotidia/cotidia-cms-base", "path": "cmsbase/templatetags/cms_tags.py", "copies": "1", "size": "2948", "license": "mit", "hash": 6638576529056005000, "line_mean": 32.5, "line_max": 159, "alpha_frac": 0.6434871099, "autogenerated": false, "ratio": 3.712846347607053, "config_test": ...
from django import template from django.conf import settings from django.shortcuts import get_object_or_404, render_to_response from django.contrib.auth.decorators import login_required, permission_required from utils import next_redirect, confirmation_view from django.contrib import comments from django.contrib.commen...
{ "repo_name": "suncycheng/intellij-community", "path": "python/lib/Lib/site-packages/django/contrib/comments/views/moderation.py", "copies": "307", "size": "5037", "license": "apache-2.0", "hash": 7732639032318813000, "line_mean": 30.679245283, "line_max": 95, "alpha_frac": 0.6547548144, "autogener...
from django import template from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext from wagtail.wagtailcore import models from wagtail.wagtailcore.models import Page from wagtail.wagtailimages.models import Image from wagtail.wagtailsearch.index impo...
{ "repo_name": "MidAtlanticPortal/marco-portal2", "path": "marco/portal/base/views.py", "copies": "1", "size": "2505", "license": "isc", "hash": -6561825789654349000, "line_mean": 37.5384615385, "line_max": 136, "alpha_frac": 0.6738522954, "autogenerated": false, "ratio": 4.154228855721393, "con...
from django import template from django.conf import settings from django.shortcuts import render_to_response import os import subprocess register = template.Library() djurls = getattr(settings, 'DJSCRIPT_PATHS') prettify = getattr(settings, 'DJSCRIPT_PRETTIFY', False) logger_name = getattr(settings, 'DJSCRIPT_LOGGER...
{ "repo_name": "pztrick/DjScript", "path": "djscript/templatetags/djscript.py", "copies": "1", "size": "1903", "license": "mit", "hash": -5431451841470631000, "line_mean": 33.6181818182, "line_max": 106, "alpha_frac": 0.6100893326, "autogenerated": false, "ratio": 3.724070450097847, "config_test...
from django import template from django.conf import settings from django.template.base import Library from django.utils.translation import ugettext, ungettext from datetime import datetime register = Library() def timesince(d, now=datetime.now(), timedelta=False): """ Takes two datetime objects and returns ...
{ "repo_name": "benoitbar/projectcounter", "path": "projectcounter/core/templatetags/timedelta.py", "copies": "1", "size": "3300", "license": "mit", "hash": 307166756705002940, "line_mean": 35.2637362637, "line_max": 107, "alpha_frac": 0.6318181818, "autogenerated": false, "ratio": 3.6504424778761...
from django import template from django.conf import settings from django.template.base import Template from django.template.loader import get_template from django.template.loader_tags import do_include, BlockNode import six from copy import copy register = template.Library() @register.tag(name='includeblock') def d...
{ "repo_name": "sinnwerkstatt/django-bettertemplates", "path": "bettertemplates/templatetags/bettertemplates_tags.py", "copies": "1", "size": "4728", "license": "bsd-3-clause", "hash": -6023133469957142000, "line_mean": 43.1869158879, "line_max": 117, "alpha_frac": 0.6256345178, "autogenerated": fal...
from django import template from django.conf import settings from django.template.defaultfilters import pluralize, filesizeformat from django.contrib.humanize.templatetags.humanize import naturalday from tardis.tardis_portal.util import get_local_time from tardis.tardis_portal.util import render_mustache register = t...
{ "repo_name": "iiman/mytardis", "path": "tardis/tardis_portal/templatetags/experiment_tags.py", "copies": "1", "size": "3222", "license": "bsd-3-clause", "hash": 8388702949612172000, "line_mean": 34.8, "line_max": 84, "alpha_frac": 0.6315952824, "autogenerated": false, "ratio": 4.078481012658228,...
from django import template from django.conf import settings from django.template.defaultfilters import stringfilter from django.template.loader import render_to_string from failwhale.models import Summize import re register = template.Library() AT_RE = re.compile(r'@(?P<screen_name>[\w_]+)') HASH_RE = re.compile(r'#...
{ "repo_name": "pombredanne/django-failwhale", "path": "failwhale/templatetags/failtags.py", "copies": "1", "size": "1241", "license": "bsd-3-clause", "hash": -3883864945456180700, "line_mean": 30.8461538462, "line_max": 93, "alpha_frac": 0.6333601934, "autogenerated": false, "ratio": 3.1497461928...
from django import template from django.conf import settings from django.template.defaultfilters import stringfilter from django.utils.encoding import smart_str from django.utils.safestring import mark_safe from django.utils.hashcompat import md5_constructor import urllib GRAVATAR_MAX_RATING = getattr(settings, 'GRAVA...
{ "repo_name": "FrankBian/kuma", "path": "vendor/packages/django-threadedcomments/threadedcomments/templatetags/gravatar.py", "copies": "5", "size": "4600", "license": "mpl-2.0", "hash": -1878622825158654000, "line_mean": 37.9830508475, "line_max": 202, "alpha_frac": 0.647173913, "autogenerated": fa...
from django import template from django.conf import settings from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe from django.utils.translation import get_language from django.utils.translation import get_language_info from django.utils.translation import ugettext_lazy a...
{ "repo_name": "DXCanas/content-curation", "path": "contentcuration/contentcuration/templatetags/translation_tags.py", "copies": "1", "size": "2796", "license": "mit", "hash": 1511307915220418300, "line_mean": 33.95, "line_max": 109, "alpha_frac": 0.6273247496, "autogenerated": false, "ratio": 3.4...
from django import template from django.conf import settings from django.template.defaultfilters import stringfilter from djtools.utils.encryption import do_crypt from djtools.utils.date import calculate_age from datetime import date register = template.Library() @register.filter def keyvalue(dict, key): """ ...
{ "repo_name": "carthagecollege/django-djtools", "path": "djtools/templatetags/filters.py", "copies": "1", "size": "1810", "license": "unlicense", "hash": -7672551295839958000, "line_mean": 23.4594594595, "line_max": 75, "alpha_frac": 0.644198895, "autogenerated": false, "ratio": 3.634538152610441...
from django import template from django.conf import settings from django.template.engine import Engine builtins = Engine.get_default().template_builtins class NULL: pass class SettingsOverride: # pragma: no cover """ Overrides Django settings within a context and resets them to their inital value...
{ "repo_name": "ojii/django-classy-tags", "path": "tests/context_managers.py", "copies": "1", "size": "1297", "license": "bsd-3-clause", "hash": 4496946369136881000, "line_mean": 24.431372549, "line_max": 78, "alpha_frac": 0.5936777178, "autogenerated": false, "ratio": 4.157051282051282, "config...
from django import template from django.conf import settings from django.template import defaultfilters from django.utils.translation import pgettext, ugettext as _, ungettext register = template.Library() # A tuple of standard large number to their converters intword_converters = ( (3, lambda number: ( u...
{ "repo_name": "ROGUE-JCTD/vida", "path": "vida/firestation/templatetags/vida.py", "copies": "3", "size": "3225", "license": "mit", "hash": -2873263589480491500, "line_mean": 25.652892562, "line_max": 102, "alpha_frac": 0.5959689922, "autogenerated": false, "ratio": 3.7807737397420866, "config_t...
from django import template from django.conf import settings from django.template import defaultfilters from django.utils.translation import pgettext, ugettext as _, ungettext # noqa import phonenumbers register = template.Library() # A tuple of standard large number to their converters intword_converters = ( (3...
{ "repo_name": "HunterConnelly/firecares", "path": "firecares/firestation/templatetags/firecares.py", "copies": "1", "size": "3812", "license": "mit", "hash": -9003166931096093000, "line_mean": 27.0294117647, "line_max": 102, "alpha_frac": 0.611227702, "autogenerated": false, "ratio": 3.8081918081...
from django import template from django.conf import settings from django.template import Node, TemplateSyntaxError from django.utils.safestring import mark_safe from django.utils.datastructures import SortedDict from itertools import ifilter, takewhile import re register = template.Library() SETTINGS_PREFIX = 'SEARCH...
{ "repo_name": "rvanlaar/easy-transifex", "path": "src/transifex/transifex/txcommon/templatetags/search_filters.py", "copies": "2", "size": "7600", "license": "bsd-2-clause", "hash": 8794855843754008000, "line_mean": 31.0675105485, "line_max": 96, "alpha_frac": 0.6144736842, "autogenerated": false, ...
from django import template from django.conf import settings from django.template import resolve_variable, NodeList # Python standard import math register = template.Library() @register.simple_tag def sqchange( prevsq, sq ): """ Usage: {% sqchange sq prevsq %} Returns up down nochange """ ...
{ "repo_name": "mfitzp/smrtr", "path": "apps/sq/templatetags/sq_tags.py", "copies": "1", "size": "2616", "license": "bsd-3-clause", "hash": -3265911366766097000, "line_mean": 23.9142857143, "line_max": 77, "alpha_frac": 0.5531345566, "autogenerated": false, "ratio": 3.535135135135135, "config_te...
from django import template from django.conf import settings from django.template import Template, Context from huntserver.models import Hunt from datetime import datetime register = template.Library() @register.simple_tag(takes_context=True) def hunt_static(context): return settings.MEDIA_URL + "hunt/" + str(con...
{ "repo_name": "dlareau/puzzlehunt_server", "path": "huntserver/templatetags/hunt_tags.py", "copies": "1", "size": "2473", "license": "mit", "hash": 8770052795202009000, "line_mean": 27.1022727273, "line_max": 98, "alpha_frac": 0.6655883542, "autogenerated": false, "ratio": 3.319463087248322, "c...
from django import template from django.conf import settings from django.template import Template from django.template.loader import render_to_string from django.template.defaultfilters import truncatewords_html from django.template import Library from django.utils.safestring import mark_safe from hydeengine.file_syste...
{ "repo_name": "tvon/hyde", "path": "hydeengine/templatetags/hydetags.py", "copies": "1", "size": "9519", "license": "mit", "hash": -5656998307423349000, "line_mean": 31.1587837838, "line_max": 96, "alpha_frac": 0.5912385755, "autogenerated": false, "ratio": 3.7684085510688834, "config_test": tr...
from django import template from django.conf import settings from django.template import TemplateSyntaxError from django.utils.encoding import smart_str from django.template.defaulttags import kwarg_re from ..reverse import reverse_crossdomain register = template.Library() @register.tag def domain_url(parser, token,...
{ "repo_name": "playfire/django-dynamic-subdomains", "path": "dynamic_subdomains/templatetags/dynamic_subdomains.py", "copies": "1", "size": "2931", "license": "bsd-3-clause", "hash": -401362472987478100, "line_mean": 30.1808510638, "line_max": 106, "alpha_frac": 0.6240191061, "autogenerated": false...
from django import template from django.conf import settings from django.template.loader import get_template from contact.models import ContactPage from blog.models import BlogPage from events.models import EventPage from pages.models import Testimonial register = template.Library() @register.assignment_tag(takes_co...
{ "repo_name": "niceguydave/wagtail-cookiecutter-foundation", "path": "{{cookiecutter.repo_name}}/utils/templatetags/{{cookiecutter.repo_name}}_utils.py", "copies": "1", "size": "2295", "license": "mit", "hash": -4927297901544539000, "line_mean": 26.0117647059, "line_max": 82, "alpha_frac": 0.63660130...
from django import template from django.conf import settings from django.template.loader import render_to_string, get_template from django.core.urlresolvers import reverse from django.core.cache import cache from django.contrib.sites.models import get_current_site from django.shortcuts import get_object_or_404 from dja...
{ "repo_name": "tigeli/futurice-ldap-user-manager", "path": "fum/common/templatetags/tags.py", "copies": "2", "size": "3562", "license": "bsd-3-clause", "hash": 2203026782312636200, "line_mean": 28.9327731092, "line_max": 95, "alpha_frac": 0.6805165637, "autogenerated": false, "ratio": 3.830107526...
from django import template from django.conf import settings from django.template.loader import render_to_string from django.contrib.contenttypes.models import ContentType from django.utils.encoding import smart_unicode from django.utils.html import linebreaks from myblog.comments.models import Comment from myblog.com...
{ "repo_name": "wahaha02/myblog", "path": "comments/templatetags/comment.py", "copies": "1", "size": "17664", "license": "bsd-3-clause", "hash": 8157933166410986000, "line_mean": 37.0689655172, "line_max": 212, "alpha_frac": 0.5577445652, "autogenerated": false, "ratio": 4.020027309968138, "conf...
from django import template from django.conf import settings from django.template.loader import render_to_string from djblets.util.decorators import basictag from reviewboard.extensions.hooks import DiffViewerActionHook, \ NavigationBarHook, \ ...
{ "repo_name": "Khan/reviewboard", "path": "reviewboard/extensions/templatetags/rb_extensions.py", "copies": "2", "size": "2221", "license": "mit", "hash": -8139597652453907000, "line_mean": 30.2816901408, "line_max": 78, "alpha_frac": 0.6240432238, "autogenerated": false, "ratio": 4.4155069582504...
from django import template from django.conf import settings from django.template.loader import render_to_string from freemix.exhibit import models register = template.Library() @register.inclusion_tag("exhibit/exhibit_list_item.html", takes_context=True) def exhibit_list_item(context, exhibit): request = contex...
{ "repo_name": "zepheira/freemix", "path": "freemix/exhibit/templatetags/exhibit_tags.py", "copies": "1", "size": "1719", "license": "apache-2.0", "hash": 1441129419379388000, "line_mean": 34.8125, "line_max": 105, "alpha_frac": 0.6829552065, "autogenerated": false, "ratio": 3.3121387283236996, ...
from django import template from django.conf import settings from django.template.loader import render_to_string register = template.Library() @register.simple_tag def tag_autocomplete_js(format_string=None): """format_string should be ``app_label model counts`` renders 'tagging_ext/tag_autocomplete_js....
{ "repo_name": "pydanny/django-tagging-ext", "path": "tagging_ext/templatetags/tagging_ext_tags.py", "copies": "1", "size": "1100", "license": "mit", "hash": -3520320304383598600, "line_mean": 26.525, "line_max": 89, "alpha_frac": 0.6572727273, "autogenerated": false, "ratio": 3.6303630363036303, ...
from django import template from django.conf import settings from django.template.loader import render_to_string try: from urlparse import urljoin except ImportError: from urllib.parse import urljoin register = template.Library() def get_settings(): """Utility function to retrieve settings.py values with...
{ "repo_name": "luiscarlosgph/nas", "path": "env/lib/python2.7/site-packages/django_wysiwyg/templatetags/wysiwyg.py", "copies": "1", "size": "2412", "license": "mit", "hash": -2138155341727762000, "line_mean": 29.15, "line_max": 126, "alpha_frac": 0.675787728, "autogenerated": false, "ratio": 3.56...
from django import template from django.conf import settings from django.template.loaders.app_directories import get_app_template_dirs from django.template import Context from django.template.library import SimpleNode from django.template.loader import get_template import os from page.models import models # from .model...
{ "repo_name": "Zex0n/django-simple-cms", "path": "smallcms/templatetags/cms_tags.py", "copies": "1", "size": "4144", "license": "mit", "hash": 7613354186325220000, "line_mean": 32.5409836066, "line_max": 104, "alpha_frac": 0.6314760508, "autogenerated": false, "ratio": 3.506426735218509, "confi...
from django import template from django.conf import settings from django.templatetags.static import static from django.utils import formats from django.utils.translation import get_language register = template.Library() # For reasons unkown, the el (greek) locale in django/conf/locale/el/formats.py # *did not* conta...
{ "repo_name": "mattcaldwell/wagtail", "path": "wagtail/wagtailadmin/templatetags/localize.py", "copies": "3", "size": "2971", "license": "bsd-3-clause", "hash": 9179782662936594000, "line_mean": 46.935483871, "line_max": 111, "alpha_frac": 0.607539549, "autogenerated": false, "ratio": 3.229347826...
from django import template from django.conf import settings from django.urls import resolve register = template.Library() @register.inclusion_tag('show_sense.html', takes_context=True) def show_up_sense(context, sense=''): """Show AdSense for SENSE_UP""" request = context['request'] if sense == 'user': ...
{ "repo_name": "genonfire/bbgo", "path": "core/templatetags/sense.py", "copies": "1", "size": "5661", "license": "mit", "hash": -751887975764681000, "line_mean": 30.2762430939, "line_max": 65, "alpha_frac": 0.6170287935, "autogenerated": false, "ratio": 3.812121212121212, "config_test": false, ...
from django import template from django.conf import settings from django.utils.datastructures import SortedDict register = template.Library() # from http://www.djangosnippets.org/snippets/1937/ def register_render_tag(renderer): """ Decorator that creates a template tag using the given renderer as the r...
{ "repo_name": "osmfj/sotmjp-website", "path": "sotmjp/templatetags/admin_reorder_tag.py", "copies": "1", "size": "1927", "license": "bsd-3-clause", "hash": 7805491006708692000, "line_mean": 40, "line_max": 119, "alpha_frac": 0.6056045667, "autogenerated": false, "ratio": 4.126338329764454, "con...
from django import template from django.conf import settings from django.utils.encoding import force_bytes, force_text from django.utils.safestring import mark_safe register = template.Library() @register.filter(is_safe=True) def restructuredtext(value): import warnings warnings.warn( 'The restructu...
{ "repo_name": "tony/django-docutils", "path": "django_docutils/templatetags/django_docutils.py", "copies": "1", "size": "1036", "license": "mit", "hash": 2426953183377001500, "line_mean": 31.375, "line_max": 86, "alpha_frac": 0.6621621622, "autogenerated": false, "ratio": 4.604444444444445, "co...
from django import template from django.conf import settings from django.utils.encoding import force_text from django.utils.safestring import mark_safe register = template.Library() @register.filter(is_safe=True) def markdown(value, arg=''): """ Runs Markdown over a given value, optionally using various ...
{ "repo_name": "morgan-county/site", "path": "morgan/apps/cms/templatetags/markup.py", "copies": "1", "size": "1885", "license": "mit", "hash": -8629458128532983000, "line_mean": 35.25, "line_max": 122, "alpha_frac": 0.6403183024, "autogenerated": false, "ratio": 4.784263959390863, "config_test"...
from django import template from django.conf import settings from django.utils.html import conditional_escape from 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) ...
{ "repo_name": "fgirault/smeuhsocial", "path": "apps/account/templatetags/account_tags.py", "copies": "2", "size": "1283", "license": "mit", "hash": 4519263438446853600, "line_mean": 24.1568627451, "line_max": 95, "alpha_frac": 0.5923616524, "autogenerated": false, "ratio": 3.9355828220858897, "...
from django import template from django.conf import settings from django.utils.html import conditional_escape from pinax.apps.account.utils import user_display register = template.Library() class UserDisplayNode(template.Node): def __init__(self, user, as_var=None): self.user_var = template.Variable(us...
{ "repo_name": "amarandon/pinax", "path": "pinax/apps/account/templatetags/account_tags.py", "copies": "1", "size": "1294", "license": "mit", "hash": 290834883288434940, "line_mean": 24.3725490196, "line_max": 95, "alpha_frac": 0.5942812983, "autogenerated": false, "ratio": 3.909365558912387, "c...
from django import template from django.conf import settings from django.utils.http import urlencode from django.templatetags.static import static register = template.Library() @register.assignment_tag(takes_context=True) def get_site_root(context): return context['request'].site.root_page @register.inclusion_...
{ "repo_name": "akatsoulas/coss", "path": "coss/base/templatetags/coss_tags.py", "copies": "1", "size": "2020", "license": "mpl-2.0", "hash": 6981288666642361000, "line_mean": 28.7058823529, "line_max": 71, "alpha_frac": 0.6861386139, "autogenerated": false, "ratio": 3.46483704974271, "config_te...
from django import template from django.conf import settings from django.utils import formats from django.utils.translation import get_language register = template.Library() # For reasons unkown, the el (greek) locale in django/conf/locale/el/formats.py # *did not* contain a DATE_INPUT_FORMATS -- so it fell back to ...
{ "repo_name": "suziesparkle/wagtail", "path": "wagtail/wagtailadmin/templatetags/localize.py", "copies": "3", "size": "1994", "license": "bsd-3-clause", "hash": 5455797831485821000, "line_mean": 40.5625, "line_max": 127, "alpha_frac": 0.6479438315, "autogenerated": false, "ratio": 3.5992779783393...
from django import template from django.conf import settings from django.utils import importlib from django.core.urlresolvers import reverse from django.template import RequestContext from splunkdj.utility import get_current_app_name import logging logger = logging.getLogger('spl.django.service') register = template....
{ "repo_name": "splunk/splunk-webframework", "path": "server/splunkdj/templatetags/tags.py", "copies": "1", "size": "2937", "license": "apache-2.0", "hash": 3778270188596847600, "line_mean": 27.25, "line_max": 79, "alpha_frac": 0.6172965611, "autogenerated": false, "ratio": 3.685069008782936, "c...
from django import template from django.conf import settings from django.utils import importlib from django.core.urlresolvers import reverse, resolve from django.template import RequestContext import json import logging from splunkdj.tokens import TokenSafeString from tagutils import component_context logger = logging...
{ "repo_name": "splunk/splunk-webframework", "path": "server/splunkdj/templatetags/splunkmvc.py", "copies": "1", "size": "9348", "license": "apache-2.0", "hash": 3631319274075839000, "line_mean": 50.3626373626, "line_max": 125, "alpha_frac": 0.7321352161, "autogenerated": false, "ratio": 3.4355016...
from django import template from django.conf import settings from django.utils import safestring from django.template import Node from django.utils.text import normalize_newlines import cStringIO as StringIO import re import hashlib register = template.Library() @register.tag(name="textile") def textileParser(parser,...
{ "repo_name": "russellhaering/hyde", "path": "hydeengine/templatetags/aym.py", "copies": "1", "size": "5088", "license": "mit", "hash": -560051689049667600, "line_mean": 29.8363636364, "line_max": 105, "alpha_frac": 0.6507468553, "autogenerated": false, "ratio": 4.1636661211129296, "config_test...
from django import template from django.conf import settings from django.utils import safestring import cStringIO as StringIO import hashlib register = template.Library() @register.tag(name="textile") def textileParser(parser, token): nodelist = parser.parse(('endtextile',)) parser.delete_first_token() r...
{ "repo_name": "tow/hyde", "path": "hydeengine/templatetags/aym.py", "copies": "1", "size": "4568", "license": "mit", "hash": -2543072463853386000, "line_mean": 29.6577181208, "line_max": 84, "alpha_frac": 0.646234676, "autogenerated": false, "ratio": 4.198529411764706, "config_test": false, "...
from django import template from django.conf import settings from django.utils.module_loading import import_string from template_shortcuts.nodes import CSSTag, JSTag PROVIDER = import_string(getattr(settings, "TEMPLATE_CDN_PROVIDER", None))() def parse_tag(parser, token): try: # split_contents() knows n...
{ "repo_name": "comandrei/django-template-shortcuts", "path": "template_shortcuts/templatetags/shortcuts.py", "copies": "1", "size": "1619", "license": "bsd-3-clause", "hash": 8043392027327934000, "line_mean": 32.0408163265, "line_max": 76, "alpha_frac": 0.6541074737, "autogenerated": false, "rati...
from django import template from django.conf import settings from django.utils.safestring import mark_safe from django.core import serializers import logging import json logger = logging.getLogger(__name__) register = template.Library() @register.filter def classname(obj): return obj.__class__.__name__ # setti...
{ "repo_name": "slohr/paperlims", "path": "paperlims/core/templatetags/filters.py", "copies": "1", "size": "1376", "license": "mit", "hash": 3262762303273457700, "line_mean": 21.1935483871, "line_max": 66, "alpha_frac": 0.6555232558, "autogenerated": false, "ratio": 3.5926892950391647, "config_t...
from django import template from django.conf import settings from django.utils.safestring import mark_safe from contactform.forms import ContactForm register = template.Library() @register.inclusion_tag('contactform/tags/contact_form.html', takes_context=True) def contact_form(context, form=None, *args, **kwargs): ...
{ "repo_name": "geelweb/geelweb-django-contactform", "path": "contactform/templatetags/contact_form.py", "copies": "1", "size": "1827", "license": "mit", "hash": -2025458652054064400, "line_mean": 34.8235294118, "line_max": 131, "alpha_frac": 0.6398467433, "autogenerated": false, "ratio": 3.561403...
from django import template from django.conf import settings from django.utils.safestring import mark_safe from django.contrib.gis.gdal import OGRGeomType from geoportal import utils import random register = template.Library() class SafeVariable(template.Variable): def resolve(self, context): try: ...
{ "repo_name": "brutasse/django-geoportail", "path": "geoportal/templatetags/geoportal_tags.py", "copies": "1", "size": "9892", "license": "bsd-3-clause", "hash": -94066361825979100, "line_mean": 34.4551971326, "line_max": 79, "alpha_frac": 0.5415487262, "autogenerated": false, "ratio": 4.14758909...
from django import template from django.conf import settings from django.utils.safestring import mark_safe from .. import activity register = template.Library() @register.simple_tag(takes_context=True) def analytics(context): content = "" for kind, codes in getattr(settings, "PINAX_WEBANALYTICS_SETTINGS", {...
{ "repo_name": "pinax/metron", "path": "pinax/webanalytics/templatetags/pinax_webanalytics_tags.py", "copies": "2", "size": "1368", "license": "mit", "hash": -1818624094240236800, "line_mean": 35.972972973, "line_max": 87, "alpha_frac": 0.6323099415, "autogenerated": false, "ratio": 3.779005524861...
from django import template from django.conf import settings from django.utils.safestring import mark_safe from widgy.utils import fancy_import, update_context register = template.Library() @register.simple_tag(takes_context=True) def render(context, node): return node.render(context) @register.filter def scs...
{ "repo_name": "j00bar/django-widgy", "path": "widgy/templatetags/widgy_tags.py", "copies": "1", "size": "2625", "license": "apache-2.0", "hash": -4564465472003466000, "line_mean": 24.9900990099, "line_max": 77, "alpha_frac": 0.6925714286, "autogenerated": false, "ratio": 3.666201117318436, "con...
from django import template from django.conf import settings from django.utils.safestring import mark_safe register = template.Library() # message to say on tag load load_message = '' # the static root of this app root = '/easy_rest/static' # if easy rest root specified in settings if hasattr(settings, 'EASY_REST_RO...
{ "repo_name": "jonatanSh/django-easy-rest", "path": "easy_rest/templatetags/easy_rest.py", "copies": "1", "size": "3634", "license": "mit", "hash": -2909938953124673000, "line_mean": 27.1705426357, "line_max": 109, "alpha_frac": 0.6078701156, "autogenerated": false, "ratio": 3.4642516682554816, ...
from django import template from django.conf import settings from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag() def google_analytics(google_analytics_id=None): """ Generate google analytics code ready for including to a template """ is_disabled = getattr(settin...
{ "repo_name": "Baguage/django-google-analytics-id", "path": "analytics/templatetags/analytics_tags.py", "copies": "1", "size": "1333", "license": "mit", "hash": 2092391962085716700, "line_mean": 40.65625, "line_max": 89, "alpha_frac": 0.6759189797, "autogenerated": false, "ratio": 3.3661616161616...
from django import template from django.conf import settings from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag def yamaps(raw_address, style="width: 480px; height: 320px;"): return mark_safe('<div class="django-yamaps" data-raw-address="{}" style="{}"></div>'.format...
{ "repo_name": "herald-it/django-yamaps", "path": "yamaps/templatetags/yamaps.py", "copies": "1", "size": "1547", "license": "mit", "hash": 5662672930120281000, "line_mean": 34.976744186, "line_max": 117, "alpha_frac": 0.5572074984, "autogenerated": false, "ratio": 3.85785536159601, "config_test...
from django import template from django.conf import settings from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag(takes_context=True) def get_setting(context, key, default_val="", as_key=None): """ get val form settings and set to context {% load lbutils %} ...
{ "repo_name": "vicalloy/lbutils", "path": "lbutils/templatetags/lbutils.py", "copies": "1", "size": "1290", "license": "mit", "hash": 5447802231633590000, "line_mean": 24.8, "line_max": 65, "alpha_frac": 0.6031007752, "autogenerated": false, "ratio": 3.5734072022160666, "config_test": false, ...
from django import template from django.conf import settings from django.utils.translation import get_language register = template.Library() ## ("short format", "long format") as strptime format DATEFORMAT_TRANSLATIONS_DEFAULT = { 'es': ("%d/%m/%Y", ), 'fr': ("%d/%m/%Y", ), 'en': ("%Y-%m-%d", ), 'de'...
{ "repo_name": "kaleidos/intranet", "path": "backend/cmsutils/templatetags/datefilters.py", "copies": "3", "size": "1555", "license": "apache-2.0", "hash": 5027624984903646000, "line_mean": 21.8676470588, "line_max": 95, "alpha_frac": 0.6379421222, "autogenerated": false, "ratio": 3.72901678657074...
from django import template from django.conf import settings from django.utils.translation import ugettext_lazy as _ from waldur_mastermind.marketplace import plugins from .. import models register = template.Library() @register.simple_tag def get_invoice_item_component_amount(item, component): available_limit...
{ "repo_name": "opennode/nodeconductor-assembly-waldur", "path": "src/waldur_mastermind/marketplace/templatetags/waldur_marketplace.py", "copies": "1", "size": "1973", "license": "mit", "hash": 7497291820961317000, "line_mean": 30.8225806452, "line_max": 87, "alpha_frac": 0.6599087684, "autogenerate...
from django import template from django.conf import settings from easy_thumbnails.files import get_thumbnailer from easy_thumbnails.exceptions import InvalidImageFormatError register = template.Library() VALID_OPTIONS = ('scale', 'width', 'height', 'max_size') @register.simple_tag(takes_context=True) def cropped_thu...
{ "repo_name": "winzard/django-image-cropping", "path": "image_cropping/templatetags/cropping.py", "copies": "1", "size": "3345", "license": "bsd-3-clause", "hash": 1882108546000266200, "line_mean": 32.7878787879, "line_max": 77, "alpha_frac": 0.5970104634, "autogenerated": false, "ratio": 3.93066...
from django import template from django.conf import settings from grapeshot_signal import \ SignalClient, rels, APIError, OverQuotaError from logging import getLogger from requests import ConnectionError logger = getLogger(__name__) register = template.Library() class WordCloudException(Exception): '''Class...
{ "repo_name": "grapeshot/django-wordcloud-demo", "path": "wordcloud_demo/templatetags/wordcloud.py", "copies": "1", "size": "4094", "license": "mit", "hash": -3932860581258108400, "line_mean": 33.6949152542, "line_max": 80, "alpha_frac": 0.6380068393, "autogenerated": false, "ratio": 3.9214559386...
from django import template from django.conf import settings from knesset.links.models import Link from knesset.agendas.models import Agenda, AgendaVote from knesset.agendas.forms import VoteLinkingForm, VoteLinkingFormSet register = template.Library() @register.inclusion_tag('agendas/agendasfor.html') def agendas_fo...
{ "repo_name": "livni/old-OK", "path": "src/knesset/agendas/templatetags/agendas.py", "copies": "1", "size": "1169", "license": "bsd-3-clause", "hash": 5044439915189916000, "line_mean": 36.7096774194, "line_max": 120, "alpha_frac": 0.621899059, "autogenerated": false, "ratio": 3.4791666666666665, ...
from django import template from django.conf import settings from knesset.links.models import Link register = template.Library() @register.simple_tag def mk(m, icons=''): ''' renders a member - m - using its name and displaing the following icon comibnations: 'w' - member is being watched 'x' ...
{ "repo_name": "livni/old-OK", "path": "src/knesset/mks/templatetags/mks.py", "copies": "1", "size": "2244", "license": "bsd-3-clause", "hash": 2337179284270776000, "line_mean": 33, "line_max": 99, "alpha_frac": 0.6234402852, "autogenerated": false, "ratio": 3.3, "config_test": false, "has_no_...
from django import template from django.conf import settings from lib.disqus import get_sso_auth from issue.models import Issue from org.models import Org from users.models import User ''' required context for template: # general disqus config forum_shortname (settings) dev...
{ "repo_name": "jumoconnect/openjumo", "path": "jumodjango/etc/templatetags/disqus_tags.py", "copies": "1", "size": "2602", "license": "mit", "hash": -8602632452757028000, "line_mean": 32.358974359, "line_max": 78, "alpha_frac": 0.6260568793, "autogenerated": false, "ratio": 3.717142857142857, "...
from django import template from django.conf import settings from links.models import Link register = template.Library() @register.simple_tag def mk(m, icons=''): ''' renders a member - m - using its name and displaing the following icon comibnations: 'w' - member is being watched 'x' - remov...
{ "repo_name": "daonb/Open-Knesset", "path": "mks/templatetags/mks_tags.py", "copies": "5", "size": "2289", "license": "bsd-3-clause", "hash": 3489087039842615300, "line_mean": 29.52, "line_max": 99, "alpha_frac": 0.629969419, "autogenerated": false, "ratio": 3.265335235378031, "config_test": fa...
from django import template from django.conf import settings from links.models import Link register = template.Library() @register.simple_tag def mk(m, icons=''): ''' renders a member - m - using its name and displaing the following icon comibnations: 'w' - member is being watched 'x' - remove...
{ "repo_name": "Shrulik/Open-Knesset", "path": "mks/templatetags/mks_tags.py", "copies": "9", "size": "2175", "license": "bsd-3-clause", "hash": -6332917276756417000, "line_mean": 33.5238095238, "line_max": 99, "alpha_frac": 0.6262068966, "autogenerated": false, "ratio": 3.2954545454545454, "con...
from django import template from django.conf import settings from massmedia.models import Image register = template.Library() class MassMediaNode(template.Node): def __init__(self, *args): assert len(args) self.args = list(args) def render(self, context): self.args[0] = context.ge...
{ "repo_name": "callowayproject/django-massmedia", "path": "massmedia/templatetags/media_widgets.py", "copies": "1", "size": "1521", "license": "apache-2.0", "hash": -8971092249985165000, "line_mean": 29.44, "line_max": 153, "alpha_frac": 0.6285338593, "autogenerated": false, "ratio": 3.7555555555...
from django import template from django.conf import settings from ..models import OrderedFlatPage from django.contrib.sites.shortcuts import get_current_site register = template.Library() class OrderedFlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.contex...
{ "repo_name": "CMU-Robotics-Club/roboticsclub.org", "path": "ordered_flatpages/templatetags/ordered_flatpages.py", "copies": "2", "size": "3693", "license": "mit", "hash": -452168217345327400, "line_mean": 35.2156862745, "line_max": 82, "alpha_frac": 0.621987544, "autogenerated": false, "ratio": ...
from django import template from django.conf import settings from ..models import SocialMedia from django.contrib.sites.shortcuts import get_current_site register = template.Library() # TODO: refactor this file so its not a condensed version of OrderedFlatPages class SocialMediaNode(template.Node): def __init__(...
{ "repo_name": "CMU-Robotics-Club/roboticsclub.org", "path": "social_media/templatetags/social_media.py", "copies": "2", "size": "1663", "license": "mit", "hash": 7540428590273731000, "line_mean": 32.28, "line_max": 77, "alpha_frac": 0.6133493686, "autogenerated": false, "ratio": 3.922169811320755...
from django import template from django.conf import settings from myflatpages.models import FlatPage from django.contrib.sites.models import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.context_name ...
{ "repo_name": "pandamasta/django-myflatpages", "path": "myflatpages/templatetags/flatpages.py", "copies": "1", "size": "3618", "license": "bsd-3-clause", "hash": -103632232960586560, "line_mean": 34.4705882353, "line_max": 74, "alpha_frac": 0.6158098397, "autogenerated": false, "ratio": 4.2464788...
from django import template from django.conf import settings from pCMS.fpg.models import Flatpage, Menu register = template.Library() class FpgNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.context_name = context_name if starts_with: self.sta...
{ "repo_name": "sv1jsb/pCMS", "path": "pCMS/fpg/templatetags/fpg_flatpages.py", "copies": "1", "size": "4553", "license": "bsd-3-clause", "hash": 6297357749122183000, "line_mean": 34.2945736434, "line_max": 126, "alpha_frac": 0.6202503844, "autogenerated": false, "ratio": 4.16941391941392, "conf...
from django import template from django.conf import settings from phonenumbers import NumberFormat import phonenumbers from django_phonenumbers.helper import PhoneNumber register = template.Library() @register.filter() def phone_number_format(number, region_code=None): if type(number) is str: if region_c...
{ "repo_name": "iraklikhitarishvili/django_phonenumbers", "path": "django_phonenumbers/templatetags/phone_numbers_extra.py", "copies": "1", "size": "3057", "license": "bsd-2-clause", "hash": 5070262515137497000, "line_mean": 35.8313253012, "line_max": 107, "alpha_frac": 0.616617599, "autogenerated":...
from django import template from django.conf import settings from pipetter import registry, NotRegistered from pipetter.utils import get_cache_or_new import datetime register = template.Library() class ConstantPipetteNode(template.Node): def __init__(self, tag_name, args, template_path=None): self.tag_name = tag...
{ "repo_name": "melinath/django-pipetter", "path": "pipetter/templatetags/pipettes.py", "copies": "1", "size": "2037", "license": "isc", "hash": -3108947653427994000, "line_mean": 24.7974683544, "line_max": 75, "alpha_frac": 0.6917034855, "autogenerated": false, "ratio": 2.9693877551020407, "con...
from django import template from django.conf import settings from populous.advertising.models import ClassifiedAd, ClassifiedSubCategory from populous.core.parts.templatetags import CachedContextUpdatingNode register = template.Library() class PlacementNode(template.Node): def __init__(self, id, height, width, te...
{ "repo_name": "caiges/populous", "path": "populous/advertising/templatetags/advertising.py", "copies": "1", "size": "7252", "license": "bsd-3-clause", "hash": 5206761010762878000, "line_mean": 42.9575757576, "line_max": 204, "alpha_frac": 0.6203805847, "autogenerated": false, "ratio": 3.681218274...
from django import template from django.conf import settings from populous.sports.models import Score from populous.core.templatetags import CachedNode from django.utils.translation import ugettext_lazy as _ register = template.Library() class RecentScoresNode(CachedNode): def __init__(self, num, sport, gender): ...
{ "repo_name": "caiges/populous", "path": "populous/sports/templatetags/sports.py", "copies": "1", "size": "2869", "license": "bsd-3-clause", "hash": -4895380630900900000, "line_mean": 38.8611111111, "line_max": 176, "alpha_frac": 0.5866155455, "autogenerated": false, "ratio": 3.6408629441624365, ...
from django import template from django.conf import settings from quotes.quotes.models import Quote, UserStar register = template.Library() from allauth.socialaccount.models import SocialApp @register.assignment_tag def get_latest_quote(): try: return Quote.objects.latest('published_on') except Quot...
{ "repo_name": "rollstudio/DjangoDash", "path": "quotes/quotes/templatetags/quotes_utils.py", "copies": "1", "size": "1568", "license": "mit", "hash": 1479426891970215000, "line_mean": 26.0344827586, "line_max": 78, "alpha_frac": 0.6664540816, "autogenerated": false, "ratio": 3.9496221662468516, ...
from django import template from django.conf import settings from ..template.backend import JsTemplate from ..template.loaders import JsLoader register = template.Library() loader = JsLoader(engine=None) class JsMissingTemplateDirException(Exception): pass def _get_template_dirs(): for t in settings.TEMPLA...
{ "repo_name": "wildfish/django-isomorphic", "path": "isomorphic/templatetags/djangojs.py", "copies": "1", "size": "1167", "license": "bsd-3-clause", "hash": 6062001581664780000, "line_mean": 28.9230769231, "line_max": 87, "alpha_frac": 0.7257926307, "autogenerated": false, "ratio": 3.942567567567...
from django import template from django.conf import settings from urlparse import urljoin from urllib import quote_plus register = template.Library() # Infrastructure Stuff @register.inclusion_tag("newsapps/_analytics_header.html") def analytics_header(): return { "settings": settings } @register.inclusion_tag(...
{ "repo_name": "newsapps/boundaryservice", "path": "newsapps/templatelib/templatetags/newsappstags.py", "copies": "2", "size": "1231", "license": "mit", "hash": 3880640770463749600, "line_mean": 31.3947368421, "line_max": 108, "alpha_frac": 0.6669374492, "autogenerated": false, "ratio": 3.82298136...
from django import template from django.conf import settings from web.utils import chibiimage as _chibiimage from api.models import LINK_IMAGES, LINK_URLS from api.raw import raw_information import os.path import string import re register = template.Library() def _imageurl(path, context={}): return u'{static_url}...
{ "repo_name": "rdsathene/SchoolIdolAPI", "path": "web/templatetags/imageurl.py", "copies": "2", "size": "6487", "license": "apache-2.0", "hash": -6343791788530588000, "line_mean": 39.2919254658, "line_max": 132, "alpha_frac": 0.6730383845, "autogenerated": false, "ratio": 3.4106203995793902, "c...
from django import template from django.conf import settings from web.utils import chibiimage from api.models import LINK_URLS import os.path import re register = template.Library() def imageurl(card, image): if hasattr(card, image): card_image = getattr(card, image) if card_image: #if...
{ "repo_name": "laurenor/SchoolIdolAPI", "path": "web/templatetags/imageurl.py", "copies": "1", "size": "2118", "license": "apache-2.0", "hash": 1805816036881116000, "line_mean": 32.09375, "line_max": 120, "alpha_frac": 0.6402266289, "autogenerated": false, "ratio": 3.2584615384615385, "config_t...
from django import template from django.conf import settings import bernoulli import re register = template.Library() @register.tag def experiment(parser, token): """ Setup the context and handle variant blocks """ try: args = token.split_contents() except ValueError: raise templat...
{ "repo_name": "bernoulli-metrics/bernoulli_django", "path": "bernoulli_django/templatetags/experiments.py", "copies": "1", "size": "3377", "license": "mit", "hash": 999084427840810500, "line_mean": 33.4591836735, "line_max": 111, "alpha_frac": 0.6082321587, "autogenerated": false, "ratio": 4.2424...
from django import template from django.conf import settings import datetime import pytz register = template.Library() @register.filter(name='dateToDatetimeWithoutYear') def dateToDatetimeWithoutYear(value): """Don't include the year - useful for timestamps and other situations where the year is implied.""" r...
{ "repo_name": "ruslux/Brownian", "path": "Brownian/view/templatetags/es_extras.py", "copies": "3", "size": "5082", "license": "bsd-2-clause", "hash": 8222586273559424000, "line_mean": 41.7142857143, "line_max": 507, "alpha_frac": 0.6027154664, "autogenerated": false, "ratio": 3.648241206030151, ...
from django import template from django.conf import settings import pystache import os register = template.Library() class View(pystache.View): template_path = settings.TEMPLATE_DIRS[0] def __init__(self, template_dir, template_name, context): self.template_path = template_dir self.template_n...
{ "repo_name": "wathsalav/xos", "path": "xos/core/xoslib/templatetags/mustache.py", "copies": "5", "size": "1573", "license": "apache-2.0", "hash": 8975985478098427000, "line_mean": 29.8431372549, "line_max": 143, "alpha_frac": 0.6433566434, "autogenerated": false, "ratio": 3.7995169082125604, "...
from django import template from django.conf import settings import pystache register = template.Library() class View(pystache.View): template_path = settings.TEMPLATE_DIRS[0] def __init__(self, template_name, context): self.template_name = template_name return super(View, self).__init__(cont...
{ "repo_name": "eschloss/openPDS-RegistryServer-for-Heroku", "path": "lib/templatetags/mustache.py", "copies": "6", "size": "1168", "license": "mit", "hash": -7435551105178732000, "line_mean": 26.8095238095, "line_max": 143, "alpha_frac": 0.6506849315, "autogenerated": false, "ratio": 3.7677419354...
from django import template from django.conf import settings import re import json import pdb register = template.Library() class InjectionMapNode(template.Node): def __init__(self, django_variables): self.django_variables = django_variables # set the name of the JS map from the user's settings f...
{ "repo_name": "steinbachr/django-js-variable-injector", "path": "injector/templatetags/js_injector.py", "copies": "1", "size": "4014", "license": "mit", "hash": -2611616185834381300, "line_mean": 31.6422764228, "line_max": 112, "alpha_frac": 0.5298953662, "autogenerated": false, "ratio": 4.159585...
from django import template from django.conf import settings from 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,...
{ "repo_name": "alex/pinax", "path": "pinax/apps/account/templatetags/account_tags.py", "copies": "1", "size": "1216", "license": "mit", "hash": 1958248045542267100, "line_mean": 22.3846153846, "line_max": 95, "alpha_frac": 0.5764802632, "autogenerated": false, "ratio": 3.92258064516129, "config...
from django import template from django.conf import settings 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 rend...
{ "repo_name": "sachingupta006/django-allauth", "path": "allauth/account/templatetags/account_tags.py", "copies": "7", "size": "1224", "license": "mit", "hash": -7939354583318468000, "line_mean": 22.5384615385, "line_max": 95, "alpha_frac": 0.5784313725, "autogenerated": false, "ratio": 3.89808917...
from django import template from django.conf import settings from apps.testapp.models import * #from torchbox.utils import * register = template.Library() @register.assignment_tag def get_popular_tags(model): return model.get_popular_tags() # settings value @register.assignment_tag def get_googe_maps_key(): ...
{ "repo_name": "Upande/MaMaSe", "path": "apps/testapp/templatetags/torchbox_tags.py", "copies": "1", "size": "8505", "license": "apache-2.0", "hash": -8382625633058644000, "line_mean": 29.4874551971, "line_max": 129, "alpha_frac": 0.6431510876, "autogenerated": false, "ratio": 3.7433978873239435, ...
from django import template from django.conf import settings from clarityv2.accounts.models import AdminUser register = template.Library() @register.inclusion_tag('invoices/tags/address.html') def company_details(client=None): if client is not None: return { 'client': client, 'co...
{ "repo_name": "Clarity-89/clarityv2", "path": "src/clarityv2/invoices/templatetags/invoices.py", "copies": "1", "size": "1621", "license": "mit", "hash": 2411929664061498400, "line_mean": 26.4745762712, "line_max": 118, "alpha_frac": 0.6138186305, "autogenerated": false, "ratio": 3.72643678160919...
from django import template from django.conf import settings from content_blocks.models import ContentBlock, ImageBlock register = template.Library() @register.inclusion_tag("content_blocks/content_block.html", takes_context=True) def show_content_block(context, name, editable=True, markup=True, amount='', method=...
{ "repo_name": "trapeze/django-content_blocks", "path": "content_blocks/templatetags/content_blocks_tags.py", "copies": "1", "size": "2859", "license": "bsd-3-clause", "hash": 5082628226687726000, "line_mean": 32.6352941176, "line_max": 113, "alpha_frac": 0.6243441763, "autogenerated": false, "rat...