text
stringlengths
0
1.05M
meta
dict
from django.template.loader import get_template from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest from django.template import Context from teaching_data_structure import TeachingHierarchy, SchoolYear, TeachingClass from utils import get_header_navbar import json from djangoSRV.teacher i...
{ "repo_name": "varun-verma11/CodeDrill", "path": "djangoSRV/Views/teacher_view.py", "copies": "1", "size": "2783", "license": "bsd-2-clause", "hash": 6139498145393562000, "line_mean": 43.1746031746, "line_max": 185, "alpha_frac": 0.6773266259, "autogenerated": false, "ratio": 3.8652777777777776, ...
from django.template.loader import get_template from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest from django.template import Context, Template from django.core.context_processors import csrf from utils import get_header_navbar from exercise_data_structure import AssignmentsBook, Chapte...
{ "repo_name": "varun-verma11/CodeDrill", "path": "djangoSRV/Views/set_exercise.py", "copies": "1", "size": "2272", "license": "bsd-2-clause", "hash": 8393457423948551000, "line_mean": 48.3913043478, "line_max": 112, "alpha_frac": 0.7416373239, "autogenerated": false, "ratio": 3.365925925925926, ...
from django.template.loader import get_template from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest from Forms import SubmitCodeForm from django.template import Context from django.core.context_processors import csrf from djangoSRV.student import get_exercise, getStudentAssignments from u...
{ "repo_name": "varun-verma11/CodeDrill", "path": "djangoSRV/Views/settings.py", "copies": "1", "size": "5483", "license": "bsd-2-clause", "hash": 4450129870832509400, "line_mean": 40.5378787879, "line_max": 203, "alpha_frac": 0.6667882546, "autogenerated": false, "ratio": 3.6626586506346026, "c...
from django.template.loader import get_template from django.http import HttpResponse,HttpResponseRedirect from django.template import Context from django.core.context_processors import csrf from auth import auth_utils from exercise_data_structure import AssignmentsBook, Chapter, Assignment from utils import get_header_...
{ "repo_name": "varun-verma11/CodeDrill", "path": "djangoSRV/Views/view_spec.py", "copies": "1", "size": "1397", "license": "bsd-2-clause", "hash": 3978070351132005000, "line_mean": 40.1176470588, "line_max": 87, "alpha_frac": 0.7415891195, "autogenerated": false, "ratio": 3.4925, "config_test":...
from django.template.loader import get_template from django.http import HttpResponse, HttpResponseRedirect from django.template import Context from django.core.context_processors import csrf from exercise_data_structure import AssignmentsBook, Chapter, Assignment from djangoSRV.student import getStudentAssignments, get...
{ "repo_name": "varun-verma11/CodeDrill", "path": "djangoSRV/Views/student_grades.py", "copies": "1", "size": "1313", "license": "bsd-2-clause", "hash": -8162227254166606000, "line_mean": 45.8928571429, "line_max": 115, "alpha_frac": 0.7250571211, "autogenerated": false, "ratio": 3.587431693989071...
from django.template.loader import get_template from django.http import HttpResponse, HttpResponseRedirect from Forms import SubmitCodeForm from django.template import Context from django.core.context_processors import csrf from exercise_data_structure import AssignmentsBook, Chapter, Assignment from model.models impor...
{ "repo_name": "varun-verma11/CodeDrill", "path": "djangoSRV/Views/student_view.py", "copies": "1", "size": "1739", "license": "bsd-2-clause", "hash": 9087312437190606000, "line_mean": 46, "line_max": 142, "alpha_frac": 0.6624496837, "autogenerated": false, "ratio": 4.304455445544554, "config_te...
#from django.template.loader import get_template #from django.http import HttpResponse #from django.template import Context #import datetime # #def current_datetime(request): # now = datetime.datetime.now() # html = "<html><body>It is now %s.</body></html>" %now # return HttpResponse(html) # #def hours_ahead(r...
{ "repo_name": "lzw120/django", "path": "mysite/mysite/views.py", "copies": "1", "size": "2282", "license": "bsd-3-clause", "hash": -7959992494564225000, "line_mean": 34.65625, "line_max": 120, "alpha_frac": 0.6656441718, "autogenerated": false, "ratio": 3.307246376811594, "config_test": false, ...
from django.template.loader import get_template from django.shortcuts import render from django.template import Context from django.http import HttpResponse # from wordclips.wordclip import Wordclip from wordclips.models import Wordclip from wordclips.ventriloquy.ventriloquy import Ventriloquy from wordclips.utils.inpu...
{ "repo_name": "MuzammilKhan/Ventriloquy", "path": "mysite/wordclips/views.py", "copies": "1", "size": "1825", "license": "mit", "hash": 2737257604977757000, "line_mean": 25.0714285714, "line_max": 113, "alpha_frac": 0.6723287671, "autogenerated": false, "ratio": 3.5714285714285716, "config_test...
from django.template.loader import get_template from django.shortcuts import render from django.http import HttpResponse import json from webapp import query from webapp import api def book_info_by_barcode(request, book_id): # return: # -1: no barcode matches found. (default result) # -2: other errors ...
{ "repo_name": "Jarvie8176/renison-library", "path": "API_server/webapp/views.py", "copies": "1", "size": "1535", "license": "mit", "hash": 1936657413500176100, "line_mean": 20.6197183099, "line_max": 96, "alpha_frac": 0.6573289902, "autogenerated": false, "ratio": 3.96640826873385, "config_test...
from django.template.loader import get_template from django.template import Context from django.http import HttpResponse from django.shortcuts import render from store.models import post from store.models import comment from django import forms from django.core.mail import send_mail from django import forms from django...
{ "repo_name": "ebayohblr2014/eBay-Opportunity-Hack-Blr-2014", "path": "parishodh/rachana/server/server/views.py", "copies": "1", "size": "5036", "license": "mit", "hash": 8865827103006507000, "line_mean": 28.798816568, "line_max": 123, "alpha_frac": 0.6803018268, "autogenerated": false, "ratio": ...
from django.template.loader import get_template from django.template import Context from django.shortcuts import render_to_response from django.http import HttpResponse, Http404 import datetime def hello(request): return HttpResponse("Hello world<p>Welcome to the page at %s<p>Header info: %s" % (req...
{ "repo_name": "jizhouli/django-project-sample", "path": "mysite/views.py", "copies": "1", "size": "1541", "license": "mit", "hash": 584536771791945100, "line_mean": 32.5, "line_max": 91, "alpha_frac": 0.6761842959, "autogenerated": false, "ratio": 3.7222222222222223, "config_test": false, "ha...
from django.template.loader import get_template from django.template import Context, Template from django.shortcuts import render from django.views.generic.base import View from api.views import e_create_process, get_process_definition, get_feeds_list, get_clusters_list from api.views import get_workflows import xml.e...
{ "repo_name": "ajayyadav/falcon-dashboard", "path": "falcon/dashboard/entity_management.py", "copies": "1", "size": "3722", "license": "apache-2.0", "hash": -2156210651938815200, "line_mean": 38.5957446809, "line_max": 147, "alpha_frac": 0.6810854379, "autogenerated": false, "ratio": 4.2199546485...
from django.template.loader import get_template from django.template import Library from django.db import models from tag_parser.basetags import BaseNode from tag_parser import template_tag register = Library() @template_tag(register, 'coffee_table') class CoffeeTableNode(BaseNode): """Given a queryset and a goo...
{ "repo_name": "alixedi/django_coffee_table", "path": "coffee_table/templatetags/coffee_table.py", "copies": "1", "size": "2561", "license": "bsd-3-clause", "hash": -6992316224886767000, "line_mean": 37.803030303, "line_max": 79, "alpha_frac": 0.6239750098, "autogenerated": false, "ratio": 4.10416...
from django.template.loader import get_template from django.template import Template, Context from django.http import HttpResponse import datetime from django.contrib.auth import authenticate, login from django.contrib.auth.models import Permission, User from django.shortcuts import get_object_or_404, render from .form...
{ "repo_name": "c3pko/GovScrape", "path": "example_project/open_news/views.py", "copies": "1", "size": "5048", "license": "bsd-3-clause", "hash": -3145524592804362000, "line_mean": 26.4402173913, "line_max": 83, "alpha_frac": 0.7105784469, "autogenerated": false, "ratio": 3.422372881355932, "con...
from django.template.loader import get_template from django.template import Template, Context, RequestContext from django.http import HttpResponse from django import forms from django.contrib.auth.forms import UserCreationForm from django.http import HttpResponseRedirect from django.shortcuts import render from djang...
{ "repo_name": "chrissmall22/cassini", "path": "www/cassini/views.py", "copies": "1", "size": "7220", "license": "apache-2.0", "hash": 1820933164343146500, "line_mean": 25.7407407407, "line_max": 246, "alpha_frac": 0.6189750693, "autogenerated": false, "ratio": 3.530562347188264, "config_test": ...
from django.template.loader import get_template from django.template.loader_tags import BlockNode, ExtendsNode from django.template import Context from django.core import mail def _get_node(template, name, block_lookups={}): """ Get a named node from a template. Returns `None` if a node with the given nam...
{ "repo_name": "maximilianhurl/django-mail-templated", "path": "mail_templated/__init__.py", "copies": "1", "size": "5103", "license": "mit", "hash": 4077560330241167400, "line_mean": 35.1985815603, "line_max": 109, "alpha_frac": 0.6027826769, "autogenerated": false, "ratio": 4.281040268456376, ...
from django.template.loader import get_template from django.template.loader_tags import BlockNode from django.template import Context from django.conf import settings from django.core import mail class EmailMessage(mail.EmailMultiAlternatives): """Extends standard EmailMessage class with ability to use templates""...
{ "repo_name": "z0rr0/django-mail-templated", "path": "mail_templated/__init__.py", "copies": "1", "size": "4580", "license": "mit", "hash": -5205075099239141000, "line_mean": 39.1754385965, "line_max": 78, "alpha_frac": 0.6006550218, "autogenerated": false, "ratio": 4.5078740157480315, "config_...
from django.template.loader import get_template from django.utils.translation import gettext import jinja2 from django_jinja import library @library.filter def stars(num, large=False): # check for 0.0 incase None was cast to a float. Should # be safe since lowest rating you can give is 1.0 if num is Non...
{ "repo_name": "wagnerand/addons-server", "path": "src/olympia/ratings/templatetags/jinja_helpers.py", "copies": "4", "size": "1079", "license": "bsd-3-clause", "hash": 172306657440055170, "line_mean": 33.8064516129, "line_max": 88, "alpha_frac": 0.7062094532, "autogenerated": false, "ratio": 3.56...
from django.template.loader import get_template from django.utils.translation import ugettext import jinja2 from django_jinja import library from olympia import amo from olympia.access import acl from olympia.ratings.models import RatingFlag from .. import forms @library.filter def stars(num, large=False): # ...
{ "repo_name": "harry-7/addons-server", "path": "src/olympia/ratings/templatetags/jinja_helpers.py", "copies": "2", "size": "2881", "license": "bsd-3-clause", "hash": -6591205368346938000, "line_mean": 31.0111111111, "line_max": 76, "alpha_frac": 0.6883026727, "autogenerated": false, "ratio": 3.59...
from django.template.loader import get_template from django.utils.translation import ugettext import jinja2 from django_jinja import library from olympia.ratings.models import RatingFlag from olympia.ratings.permissions import user_can_delete_rating from .. import forms @library.filter def stars(num, large=False...
{ "repo_name": "wagnerand/olympia", "path": "src/olympia/ratings/templatetags/jinja_helpers.py", "copies": "3", "size": "1910", "license": "bsd-3-clause", "hash": -7329075947118902000, "line_mean": 29.3174603175, "line_max": 76, "alpha_frac": 0.7010471204, "autogenerated": false, "ratio": 3.590225...
from django.template.loader import get_template from django.utils.translation import ugettext import jinja2 from django_jinja import library @library.filter def stars(num, large=False): # check for 0.0 incase None was cast to a float. Should # be safe since lowest rating you can give is 1.0 if num is No...
{ "repo_name": "psiinon/addons-server", "path": "src/olympia/ratings/templatetags/jinja_helpers.py", "copies": "5", "size": "1151", "license": "bsd-3-clause", "hash": -4655515208437780000, "line_mean": 33.8787878788, "line_max": 76, "alpha_frac": 0.6637706342, "autogenerated": false, "ratio": 3.77...
from django.template.loader import get_template from tenant_extras.utils import TenantLanguage from bluebottle.clients.context import ClientContext from bluebottle.clients.mail import EmailMultiAlternatives from bluebottle.clients.utils import tenant_url from bluebottle.utils.email_backend import send_mail from djan...
{ "repo_name": "jfterpstra/bluebottle", "path": "bluebottle/projects/mails.py", "copies": "1", "size": "1990", "license": "bsd-3-clause", "hash": 5710952689170255000, "line_mean": 33.3103448276, "line_max": 81, "alpha_frac": 0.6793969849, "autogenerated": false, "ratio": 3.88671875, "config_test...
from django.template.loader import get_template from zerver.lib.exceptions import InvalidMarkdownIncludeStatement from zerver.lib.test_classes import ZulipTestCase class TemplateTestCase(ZulipTestCase): def test_markdown_in_template(self) -> None: template = get_template("tests/test_markdown.html") ...
{ "repo_name": "shubhamdhama/zulip", "path": "zerver/tests/test_templates.py", "copies": "3", "size": "4673", "license": "apache-2.0", "hash": -5858262450845711000, "line_mean": 36.685483871, "line_max": 107, "alpha_frac": 0.6163064413, "autogenerated": false, "ratio": 3.7146263910969792, "confi...
from django.template.loader import get_template from django.shortcuts import render from webapp import query from webapp import search from django.http import HttpResponse import json def get_book_search(request): field = request.GET.get('field', 'null') keyword = request.GET.get('keyword', 'null'...
{ "repo_name": "Jarvie8176/renison-library", "path": "API_server/webapp/api.py", "copies": "1", "size": "1961", "license": "mit", "hash": 3477150554842915000, "line_mean": 20.5402298851, "line_max": 98, "alpha_frac": 0.6206017338, "autogenerated": false, "ratio": 4.154661016949152, "config_test"...
from django.template.loader import get_template, select_template from wagtailmenus.conf import settings from wagtailmenus.utils.inspection import accepts_kwarg def get_item_by_index_or_last_item(items, index): if items is None: return try: return items[index] except IndexError: re...
{ "repo_name": "rkhleics/wagtailmenus", "path": "wagtailmenus/models/mixins.py", "copies": "2", "size": "4937", "license": "mit", "hash": 849191545158885100, "line_mean": 40.487394958, "line_max": 79, "alpha_frac": 0.6167713186, "autogenerated": false, "ratio": 4.21965811965812, "config_test": f...
from django.template.loader import make_origin from django.template import TemplateDoesNotExist from django.conf import settings from djinja2.models import Jinja2Template class Jinja2Loader(object): skip_dirs = getattr(settings, 'KEEP_DJANGO_TEMPLATES', ()) def load_template(self, template_name, template_di...
{ "repo_name": "comoga/django-djinja2", "path": "djinja2/loaders/__init__.py", "copies": "1", "size": "1429", "license": "bsd-3-clause", "hash": -4398663937583114000, "line_mean": 42.303030303, "line_max": 99, "alpha_frac": 0.6871938418, "autogenerated": false, "ratio": 4.507886435331231, "confi...
from django.template.loader import render_to_string as just_render from django.template import RequestContext from django.contrib.messages.storage.base import Message from django.contrib.messages import constants from django.http import QueryDict from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger ...
{ "repo_name": "erigones/esdc-ce", "path": "gui/utils.py", "copies": "1", "size": "6243", "license": "apache-2.0", "hash": -1127596195192423000, "line_mean": 26.7466666667, "line_max": 111, "alpha_frac": 0.6525708794, "autogenerated": false, "ratio": 3.8043875685557587, "config_test": false, "...
from django.template.loader import render_to_string from cradmin_legacy import crinstance from cradmin_legacy.viewhelpers import objecttable from django.utils.translation import gettext_lazy class DeliverySummaryColumn(objecttable.SingleActionColumn): modelfield = 'number' template_name = 'devilry_student/cra...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_student/cradminextensions/columntypes.py", "copies": "1", "size": "2554", "license": "bsd-3-clause", "hash": 2701391420033457700, "line_mean": 31.3291139241, "line_max": 110, "alpha_frac": 0.6601409554, "autogenerated": false, "rati...
from django.template.loader import render_to_string from datetime import datetime from lxml import etree import re import random import hashlib import requests SOAP_URL = 'https://payment.buckaroo.nl/soap/soap.asmx' def md5(to_hash): m = hashlib.md5() m.update(to_hash) return m.hexdigest() def signatu...
{ "repo_name": "quarkness/django-buckaroo", "path": "django-buckaroo/buckaroo.py", "copies": "1", "size": "6863", "license": "bsd-2-clause", "hash": -3658126460204394000, "line_mean": 32.3155339806, "line_max": 201, "alpha_frac": 0.5971149643, "autogenerated": false, "ratio": 3.838366890380313, ...
from django.template.loader import render_to_string from debug_toolbar.panels import DebugPanel class HeaderDebugPanel(DebugPanel): """ A panel to display HTTP headers. """ name = 'Header' has_content = True # List of headers we want to display header_filter = ( 'CONTENT_TYPE', ...
{ "repo_name": "LongMan/django-debug-toolbar", "path": "debug_toolbar/panels/headers.py", "copies": "2", "size": "1236", "license": "bsd-3-clause", "hash": -1059830871853369700, "line_mean": 24.2448979592, "line_max": 83, "alpha_frac": 0.5566343042, "autogenerated": false, "ratio": 3.9742765273311...
from django.template.loader import render_to_string from debug_toolbar.panels import DebugPanel class RequestVarsDebugPanel(DebugPanel): """ A panel to display request variables (POST/GET, session, cookies). """ name = 'RequestVars' has_content = True def nav_title(self): return 'Reque...
{ "repo_name": "none-da/zeshare", "path": "debug_toolbar/panels/request_vars.py", "copies": "1", "size": "1070", "license": "bsd-3-clause", "hash": 5909936760516610000, "line_mean": 32.4375, "line_max": 108, "alpha_frac": 0.6280373832, "autogenerated": false, "ratio": 3.807829181494662, "config_...
from django.template.loader import render_to_string from django.conf import settings from django.urls import reverse class MiddlewareHelper: request = None response = None html_types = ('text/html', 'application/xhtml+xml') template_url = 'djangosessionnotifier/notifier.html' def __init__(self, r...
{ "repo_name": "willandskill/django-session-notifier", "path": "djangosessionnotifier/helper.py", "copies": "1", "size": "1566", "license": "mit", "hash": 3798819646055253000, "line_mean": 34.6136363636, "line_max": 132, "alpha_frac": 0.6398467433, "autogenerated": false, "ratio": 4.078125, "con...
from django.template.loader import render_to_string from django.conf import settings from .utils import ArgsManager class Report(ArgsManager): args_config = { 'template_name': { 'required': False, }, 'title': {}, 'datasets': {}, } def get_key_verbose_name(self...
{ "repo_name": "EliotBerriot/django-modelstats", "path": "modelstats/reports.py", "copies": "1", "size": "1076", "license": "bsd-3-clause", "hash": 2007605391874150000, "line_mean": 28.8888888889, "line_max": 99, "alpha_frac": 0.5789962825, "autogenerated": false, "ratio": 3.9127272727272726, "c...
from django.template.loader import render_to_string from django.contrib.auth.decorators import login_required from django.core.mail import EmailMessage from django.conf import settings from django.contrib.sites.models import Site from src.basic.invitations import Invitation, InvitationAllotment from src.basic.invitati...
{ "repo_name": "hittu123/ruhive", "path": "src/basic/invitations/views.py", "copies": "1", "size": "3081", "license": "mit", "hash": 5845447338342090000, "line_mean": 32.1290322581, "line_max": 103, "alpha_frac": 0.6932814021, "autogenerated": false, "ratio": 3.9806201550387597, "config_test": f...
from django.template.loader import render_to_string from django.contrib.auth.models import User from django.core.mail import send_mail from django.conf import settings from .models import FailedLogin import datetime def email_user(username, password, **kwargs): try: user = User.objects.get(username=user...
{ "repo_name": "agiliq/django-secure-login", "path": "secure_login/on_fail.py", "copies": "1", "size": "1744", "license": "bsd-3-clause", "hash": 5357770549100663000, "line_mean": 29.5964912281, "line_max": 105, "alpha_frac": 0.6473623853, "autogenerated": false, "ratio": 3.671578947368421, "con...
from django.template.loader import render_to_string from django.contrib.contenttypes.models import ContentType from django.utils.safestring import mark_safe from django.utils.encoding import force_text from wagtail.wagtailadmin.edit_handlers import BaseChooserPanel class BaseSnippetChooserPanel(BaseChooserPanel): ...
{ "repo_name": "timheap/wagtail", "path": "wagtail/wagtailsnippets/edit_handlers.py", "copies": "12", "size": "1744", "license": "bsd-3-clause", "hash": 1108429650329354600, "line_mean": 35.3333333333, "line_max": 119, "alpha_frac": 0.6634174312, "autogenerated": false, "ratio": 3.816192560175055,...
from django.template.loader import render_to_string from django.core.exceptions import ImproperlyConfigured from customtags.core import Tag from customtags.arguments import Argument, Constant, NodeList, next_contained_argument class AsTag(Tag): """ Same as tag but allows for an optional 'as varname'. The 'as...
{ "repo_name": "rkumar-cognam/django-customtags-lib", "path": "customtags/helpers.py", "copies": "1", "size": "2678", "license": "bsd-3-clause", "hash": -5336181759055732000, "line_mean": 32.8987341772, "line_max": 89, "alpha_frac": 0.5914861837, "autogenerated": false, "ratio": 4.463333333333333,...
from django.template.loader import render_to_string from django.core import mail from django.conf import settings from emails.text_alt import render_as_text from emails.models import MailoutUser, MailoutCategory import logging UNSUBSCRIBE_EMAIL = 'unsubscribe@' + settings.EMAIL_DOMAIN def email(user, subj, template,...
{ "repo_name": "fmalina/emails", "path": "emails/send.py", "copies": "1", "size": "2031", "license": "bsd-3-clause", "hash": 2946458391235627000, "line_mean": 30.734375, "line_max": 71, "alpha_frac": 0.6184145741, "autogenerated": false, "ratio": 3.6594594594594594, "config_test": false, "has_...
from django.template.loader import render_to_string from django.core.mail import mail_managers, send_mail from django.conf import settings from instanotifier.notification.models import RssNotification from instanotifier.feedsource.models import FeedSource class RssNotificationEmailPublisher(object): """ Publishe...
{ "repo_name": "AlexanderKaluzhny/instanotifier", "path": "instanotifier/publisher/email/publisher.py", "copies": "1", "size": "2167", "license": "mit", "hash": 3880389509447486000, "line_mean": 36.3620689655, "line_max": 90, "alpha_frac": 0.6391324412, "autogenerated": false, "ratio": 4.562105263...
from django.template.loader import render_to_string from django.core.mail import send_mail as django_send_mail from django.conf import settings from django.contrib.auth import get_user_model from django.db.models import Q from modelcluster.fields import ParentalKey from wagtail.wagtailcore.models import Page, PageRev...
{ "repo_name": "marctc/wagtail", "path": "wagtail/wagtailadmin/utils.py", "copies": "11", "size": "4020", "license": "bsd-3-clause", "hash": 7486184557316863000, "line_mean": 36.2222222222, "line_max": 145, "alpha_frac": 0.6582089552, "autogenerated": false, "ratio": 4.157187176835574, "config_t...
from django.template.loader import render_to_string from django.core.mail import send_mail from django.conf import settings from django.contrib.auth import get_user_model from django.db.models import Q from wagtail.wagtailcore.models import PageRevision, GroupPagePermission from wagtail.wagtailusers.models import User...
{ "repo_name": "willcodefortea/wagtail", "path": "wagtail/wagtailadmin/tasks.py", "copies": "10", "size": "3770", "license": "bsd-3-clause", "hash": 4354103960090636000, "line_mean": 36.3267326733, "line_max": 145, "alpha_frac": 0.7074270557, "autogenerated": false, "ratio": 4.019189765458422, "...
from django.template.loader import render_to_string from django.core.urlresolvers import reverse from della.email_service import send_email from .models import UserProfile from . import activation_service def create_user_profile(user): UserProfile.objects.create(user=user, is_enabled_exchange=False) def activ...
{ "repo_name": "avinassh/della", "path": "della/user_manager/user_service.py", "copies": "1", "size": "1319", "license": "mit", "hash": 980576203229338600, "line_mean": 31.975, "line_max": 79, "alpha_frac": 0.73313116, "autogenerated": false, "ratio": 3.736543909348442, "config_test": false, "...
from django.template.loader import render_to_string from django.forms import widgets as django_widgets from leaflet.forms.widgets import LeafletWidget from django import forms from .settings import API_SRID from .helpers import wkt_to_geom class MapWidget(LeafletWidget): geometry_field_class = 'MapEntity.Geometr...
{ "repo_name": "makinacorpus/Geotrek", "path": "mapentity/widgets.py", "copies": "2", "size": "1538", "license": "bsd-2-clause", "hash": 658086832215441500, "line_mean": 32.4347826087, "line_max": 73, "alpha_frac": 0.6573472042, "autogenerated": false, "ratio": 3.8354114713216956, "config_test":...
from django.template.loader import render_to_string from django.forms import widgets as django_widgets from leaflet.forms.widgets import LeafletWidget import floppyforms as forms from .settings import API_SRID from .helpers import wkt_to_geom class MapWidget(LeafletWidget): geometry_field_class = 'MapEntity.Geo...
{ "repo_name": "Anaethelion/django-mapentity", "path": "mapentity/widgets.py", "copies": "1", "size": "1629", "license": "bsd-3-clause", "hash": -6696532037565158000, "line_mean": 33.6595744681, "line_max": 86, "alpha_frac": 0.6728054021, "autogenerated": false, "ratio": 3.8419811320754715, "con...
from django.template.loader import render_to_string from django.http import Http404 from projector.models import Membership, Watchable from vcs.utils.annotate import annotate_highlight from vcs.exceptions import VCSError from native_tags.decorators import function, filter def get_project_permissions(project=None, for...
{ "repo_name": "lukaszb/django-projector", "path": "projector/templatetags/native.py", "copies": "1", "size": "2853", "license": "bsd-3-clause", "hash": -3922377692835964400, "line_mean": 30.7, "line_max": 83, "alpha_frac": 0.6319663512, "autogenerated": false, "ratio": 4.064102564102564, "confi...
from django.template.loader import render_to_string from django.template import RequestContext from django import forms from akuna.component import get_component from ztreecrud.component.views import GenericCreateView from ztreeauth import get_user, get_all_groups from ztreeauth.models import LocalUser import logging...
{ "repo_name": "stana/django-ztree", "path": "ztreeauth/component/view.py", "copies": "1", "size": "2136", "license": "mit", "hash": 8398848460618601000, "line_mean": 34.6, "line_max": 120, "alpha_frac": 0.6779026217, "autogenerated": false, "ratio": 4.045454545454546, "config_test": false, "h...
from django.template.loader import render_to_string from django.template import RequestContext from django.utils import simplejson from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount, Provider class PersonaAccount(ProviderAccount): def __unicode__(self): ...
{ "repo_name": "GinnyN/towerofdimensions-django", "path": "django-allauth/build/lib/allauth/socialaccount/providers/persona/provider.py", "copies": "3", "size": "1028", "license": "bsd-3-clause", "hash": 2487564920668891600, "line_mean": 33.2666666667, "line_max": 76, "alpha_frac": 0.689688716, "aut...
from django.template.loader import render_to_string from django.template import Template, Context __all__ = ['Analytics','Metric','analytics'] class Analytics(object): ''' Encapsulate a set of registered metrics ''' def __init__(self): self._metrics = {} def register(self,name, metric): ''' Register a ne...
{ "repo_name": "laucia/django-analytics", "path": "analytics/analytic.py", "copies": "1", "size": "1209", "license": "mit", "hash": -2201778913737767000, "line_mean": 19.8448275862, "line_max": 83, "alpha_frac": 0.6873449132, "autogenerated": false, "ratio": 3.5558823529411763, "config_test": fa...
from django.template.loader import render_to_string from django.urls import reverse from rest_framework import serializers from rest_framework import status from talos.models import _tznow from talos.models import BasicIdentity, BasicCredential, OneTimePasswordCredential from talos.models import Principal, BasicIdentit...
{ "repo_name": "triflesoft/django-application-talos", "path": "applications/talos_rest/serializers.py", "copies": "1", "size": "44307", "license": "bsd-3-clause", "hash": 18897751189853332, "line_mean": 39.0252935863, "line_max": 130, "alpha_frac": 0.6320897375, "autogenerated": false, "ratio": 4....
from django.template.loader import render_to_string from django.utils.encoding import force_text from django.utils.safestring import mark_safe from wagtail.admin.edit_handlers import BaseChooserPanel from .widgets import AdminNewsChooser class NewsChooserPanel(BaseChooserPanel): """ An edit handler for edito...
{ "repo_name": "takeflight/wagtailnews", "path": "wagtailnews/edit_handlers.py", "copies": "1", "size": "1537", "license": "bsd-2-clause", "hash": 6317387033157349000, "line_mean": 28.5576923077, "line_max": 81, "alpha_frac": 0.6382563435, "autogenerated": false, "ratio": 3.891139240506329, "con...
from django.template.loader import render_to_string from django.utils.encoding import force_text from django.utils.safestring import mark_safe from wagtail.wagtailadmin.edit_handlers import BaseChooserPanel from .widgets import AdminPollChooser class BasePollChooserPanel(BaseChooserPanel): object_type_name = 'it...
{ "repo_name": "takeflight/wagtailpolls", "path": "wagtailpolls/edit_handlers.py", "copies": "1", "size": "1507", "license": "bsd-3-clause", "hash": 8165113634995998000, "line_mean": 30.3958333333, "line_max": 83, "alpha_frac": 0.6575978766, "autogenerated": false, "ratio": 3.78643216080402, "co...
from django.template.loader import render_to_string from django.utils.encoding import force_unicode from analytics import settings from analytics import models from analytics.views import dashboard from analytics.sites import gadgets class BaseGadget(object): def __init__(self, title, stats, display_type, frequen...
{ "repo_name": "praekelt/django-analytics", "path": "analytics/gadgets.py", "copies": "1", "size": "2599", "license": "bsd-3-clause", "hash": 8712000305620636000, "line_mean": 34.1216216216, "line_max": 177, "alpha_frac": 0.6421700654, "autogenerated": false, "ratio": 3.810850439882698, "config_...
from django.template.loader import render_to_string from django.utils import simplejson class BaseItem(object): def __init__(self, right=False): self.right = right def render(self): return render_to_string(self.template, self.get_context()) def get_context(self): return {} clas...
{ "repo_name": "foobacca/django-cms", "path": "cms/toolbar/items.py", "copies": "1", "size": "3319", "license": "bsd-3-clause", "hash": 3307341813896840700, "line_mean": 26.4297520661, "line_max": 112, "alpha_frac": 0.5815004519, "autogenerated": false, "ratio": 3.7758816837315132, "config_test"...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe, mark_for_escaping from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop, ugettext_lazy from corehq import toggles, privileges fr...
{ "repo_name": "SEL-Columbia/commcare-hq", "path": "corehq/apps/hqwebapp/models.py", "copies": "1", "size": "52603", "license": "bsd-3-clause", "hash": 2718277336113391600, "line_mean": 35.7083042568, "line_max": 124, "alpha_frac": 0.5317567439, "autogenerated": false, "ratio": 4.470383275261324, ...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from corehq.apps.indicators.admin.crud import BaseDynamicIndicatorCRUDManager, CouchIndicatorCRUDManager class MVPActiveCasesCRUDManager(CouchIndicatorCRUDManager): @property def properties_in_row(self): ...
{ "repo_name": "benrudolph/commcare-hq", "path": "custom/_legacy/mvp/indicator_admin/crud.py", "copies": "3", "size": "1576", "license": "bsd-3-clause", "hash": -6349841301639689000, "line_mean": 44.0285714286, "line_max": 104, "alpha_frac": 0.6757614213, "autogenerated": false, "ratio": 3.5022222...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from corehq.apps.indicators.admin.crud import CouchIndicatorCRUDManager class MVPActiveCasesCRUDManager(CouchIndicatorCRUDManager): @property def properties_in_row(self): original_props = super(MVPActive...
{ "repo_name": "qedsoftware/commcare-hq", "path": "custom/_legacy/mvp/indicator_admin/crud.py", "copies": "1", "size": "1557", "license": "bsd-3-clause", "hash": 1590219920457975000, "line_mean": 43.4857142857, "line_max": 100, "alpha_frac": 0.6718047527, "autogenerated": false, "ratio": 3.4910313...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from declry.util import get_value_from_accessor class TableField(object): header_levels = 1 def __init__(self, label = 'label', accessor = '', th = False ,value_styles = {}, header_styles = {}): self.label...
{ "repo_name": "jAlpedrinha/DeclRY", "path": "declry/tables.py", "copies": "1", "size": "4141", "license": "bsd-3-clause", "hash": 7545721484487611000, "line_mean": 33.8067226891, "line_max": 127, "alpha_frac": 0.6174836996, "autogenerated": false, "ratio": 3.658127208480565, "config_test": fals...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.forms.widgets import ClearableFileInput, CheckboxInput from django.utils.html import escape, conditional_escape try: from ..cms.widgets import APIChoiceWidget from ..cms.internal_tags.fields import Tag...
{ "repo_name": "ff0000/scarlet", "path": "scarlet/assets/widgets.py", "copies": "1", "size": "2759", "license": "mit", "hash": 1102017848240181500, "line_mean": 33.4875, "line_max": 186, "alpha_frac": 0.5882566147, "autogenerated": false, "ratio": 3.8859154929577464, "config_test": false, "has...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.translation import get_language_from_request from meta import settings as meta_settings def get_cache_key(page, language): """ Create the cache key for the current page and language """ ...
{ "repo_name": "nephila/djangocms-page-meta", "path": "djangocms_page_meta/utils.py", "copies": "1", "size": "6382", "license": "bsd-3-clause", "hash": -6411603879705610000, "line_mean": 41.2649006623, "line_max": 112, "alpha_frac": 0.6031024757, "autogenerated": false, "ratio": 4.163078930202218,...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from scholradmin.util import get_value_from_accessor class TableField(object): header_levels = 1 def __init__(self, label = 'label', accessor = '', th = False ,value_styles = {}, header_styles = {}): self....
{ "repo_name": "Scholr/scholr-admin", "path": "scholradmin/tables.py", "copies": "1", "size": "4146", "license": "bsd-3-clause", "hash": -4405243678813386000, "line_mean": 33.8487394958, "line_max": 127, "alpha_frac": 0.6179450072, "autogenerated": false, "ratio": 3.6560846560846563, "config_tes...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe from wagtail.admin.edit_handlers import BaseChooserPanel from .widgets import AdminModelChooser FILTERS = {} class ModelChooserPanel(BaseChooserPanel): model = None field_name = None filter_name = None ...
{ "repo_name": "takeflight/wagtailmodelchooser", "path": "wagtailmodelchooser/edit_handlers.py", "copies": "1", "size": "1375", "license": "bsd-2-clause", "hash": 7715658362818779000, "line_mean": 29.5555555556, "line_max": 77, "alpha_frac": 0.6334545455, "autogenerated": false, "ratio": 3.8951841...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe import logging import numpy from corehq.apps.indicators.models import DynamicIndicatorDefinition, CombinedCouchViewIndicatorDefinition from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn, DataTabl...
{ "repo_name": "SEL-Columbia/commcare-hq", "path": "custom/_legacy/mvp/reports/chw.py", "copies": "1", "size": "12991", "license": "bsd-3-clause", "hash": -7710580028258130000, "line_mean": 41.454248366, "line_max": 124, "alpha_frac": 0.5264413825, "autogenerated": false, "ratio": 4.19199741852210...
from django.template.loader import render_to_string from django.utils.safestring import mark_safe import logging import numpy import pytz from corehq.apps.indicators.models import DynamicIndicatorDefinition, CombinedCouchViewIndicatorDefinition from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColu...
{ "repo_name": "puttarajubr/commcare-hq", "path": "custom/_legacy/mvp/reports/chw.py", "copies": "2", "size": "13873", "license": "bsd-3-clause", "hash": -6845254917946553000, "line_mean": 40.5359281437, "line_max": 124, "alpha_frac": 0.5159662654, "autogenerated": false, "ratio": 4.22056586553087...
from django.template.loader import render_to_string from django.utils.translation import get_language from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.conf import settings from django.contrib.sites.models import Site from django.http import (HttpResponseBadRequest, HttpRes...
{ "repo_name": "illing2005/django-payments", "path": "payments/sofort/__init__.py", "copies": "2", "size": "5132", "license": "bsd-3-clause", "hash": -2686021311562589700, "line_mean": 46.5277777778, "line_max": 134, "alpha_frac": 0.5832034295, "autogenerated": false, "ratio": 4.375106564364876, ...
from django.template.loader import render_to_string from django.utils.translation import ( pgettext_lazy, ugettext, ugettext_lazy as _) import jinja2 import six from olympia import amo from olympia.amo.templatetags.jinja_helpers import urlparams from olympia.amo.urlresolvers import reverse @jinja2.contextfuncti...
{ "repo_name": "wagnerand/olympia", "path": "src/olympia/addons/buttons.py", "copies": "2", "size": "6998", "license": "bsd-3-clause", "hash": 2423770901851978000, "line_mean": 33.99, "line_max": 79, "alpha_frac": 0.61760503, "autogenerated": false, "ratio": 3.9007803790412487, "config_test": fa...
from django.template.loader import render_to_string from django.utils.translation import ( pgettext_lazy, ugettext, ugettext_lazy as _) import jinja2 from olympia import amo from olympia.amo.templatetags.jinja_helpers import urlparams from olympia.amo.urlresolvers import reverse @jinja2.contextfunction def inst...
{ "repo_name": "lavish205/olympia", "path": "src/olympia/addons/buttons.py", "copies": "2", "size": "6943", "license": "bsd-3-clause", "hash": 4013301069538755600, "line_mean": 35.1614583333, "line_max": 79, "alpha_frac": 0.6181765807, "autogenerated": false, "ratio": 3.9137542277339348, "config...
from django.template.loader import render_to_string from django.utils.translation import ugettext as _ from django.views.generic import DetailView, ListView from django.conf import settings from rest_framework.renderers import JSONRenderer from rest_framework import serializers from openbudgets.apps.accounts.serializer...
{ "repo_name": "openbudgets/openbudgets", "path": "openbudgets/apps/entities/views/ui.py", "copies": "2", "size": "6965", "license": "bsd-3-clause", "hash": -7918198232547134000, "line_mean": 36.8532608696, "line_max": 130, "alpha_frac": 0.5896625987, "autogenerated": false, "ratio": 4.32877563704...
from django.template.loader import render_to_string from django.utils.translation import ugettext as _ from django.views.generic import DetailView, ListView from rest_framework.renderers import JSONRenderer from rest_framework import serializers from openbudget.apps.accounts.serializers import AccountMin from openbudge...
{ "repo_name": "nborwankar/open-budgets", "path": "openbudget/apps/entities/views/ui.py", "copies": "1", "size": "6384", "license": "bsd-3-clause", "hash": 1932672129583267800, "line_mean": 36.5529411765, "line_max": 126, "alpha_frac": 0.5983709273, "autogenerated": false, "ratio": 4.1725490196078...
from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from debug_toolbar.panels import DebugPanel class RequestVarsDebugPanel(DebugPanel): """ A panel to display request variables (POST/GET, session, cookies). """ name = 'RequestVars' has_conten...
{ "repo_name": "canvasnetworks/canvas", "path": "website/debug_toolbar/panels/request_vars.py", "copies": "15", "size": "1537", "license": "bsd-3-clause", "hash": 1364329101057658400, "line_mean": 33.9318181818, "line_max": 102, "alpha_frac": 0.6057254392, "autogenerated": false, "ratio": 3.776412...
from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from debug_toolbar.panels import DebugPanel class RequestVarsDebugPanel(DebugPanel): """ A panel to display request variables (POST/GET, session, cookies). """ name = 'RequestVars' has_cont...
{ "repo_name": "alex/django-debug-toolbar", "path": "debug_toolbar/panels/request_vars.py", "copies": "1", "size": "1543", "license": "bsd-3-clause", "hash": -7841873144161025000, "line_mean": 32.5434782609, "line_max": 102, "alpha_frac": 0.6033700583, "autogenerated": false, "ratio": 3.7818627450...
from django.template.loader import render_to_string from django.utils.translation import ugettext_noop from corehq.apps.commtrack.models import StockState, CommtrackConfig from corehq.apps.locations.models import SQLLocation from corehq.apps.products.models import Product, SQLProduct from corehq.apps.reports.commtrack....
{ "repo_name": "puttarajubr/commcare-hq", "path": "custom/ewsghana/reports/maps.py", "copies": "1", "size": "8409", "license": "bsd-3-clause", "hash": -3498285707790022000, "line_mean": 40.4236453202, "line_max": 110, "alpha_frac": 0.5338327982, "autogenerated": false, "ratio": 4.120039196472318, ...
from django.template.loader import render_to_string from django.utils.translation import ugettext_noop from corehq import Domain from corehq.apps.commtrack.models import StockState, CommtrackConfig from corehq.apps.locations.models import Location, SQLLocation from corehq.apps.products.models import Product, SQLProduct...
{ "repo_name": "benrudolph/commcare-hq", "path": "custom/ewsghana/reports/maps.py", "copies": "1", "size": "7455", "license": "bsd-3-clause", "hash": 5889588450242704000, "line_mean": 39.9615384615, "line_max": 110, "alpha_frac": 0.5369550637, "autogenerated": false, "ratio": 4.296829971181556, ...
from django.template.loader import render_to_string from django.views.generic import CreateView from django.conf import settings from django.core.mail import EmailMessage from feedback.models import Feedback from feedback.forms import FeedbackForm from feedback.settings import ALERT_EMAIL, EMAIL_TEMPLATE def send_em...
{ "repo_name": "Natgeoed/django-feedback", "path": "feedback/views.py", "copies": "2", "size": "1882", "license": "mit", "hash": -9003148198626961000, "line_mean": 34.5094339623, "line_max": 72, "alpha_frac": 0.6137088204, "autogenerated": false, "ratio": 4.004255319148936, "config_test": false,...
from django.template.loader import render_to_string from email.MIMEImage import MIMEImage import mimetypes from django.core.mail import EmailMessage, EmailMultiAlternatives from django.template import loader, Context from django.template import RequestContext from django.utils.html import strip_tags def umail(request...
{ "repo_name": "20tab/upy", "path": "upy/mail.py", "copies": "1", "size": "3741", "license": "bsd-3-clause", "hash": -6659140587099550000, "line_mean": 38.7978723404, "line_max": 112, "alpha_frac": 0.6292435178, "autogenerated": false, "ratio": 3.8606811145510838, "config_test": false, "has_no...
from django.template.loader import render_to_string from email.mime.image import MIMEImage import mimetypes from django.core.mail import EmailMultiAlternatives def send_mail(subject, text_content, from_email, to, html_content=None, attachments=[], cc=[], bcc=[]): """ This function sends mail using EmailMultiA...
{ "repo_name": "20tab/twentytab-utils", "path": "twentytab/mail.py", "copies": "1", "size": "2048", "license": "mit", "hash": -2109252805311690800, "line_mean": 36.2363636364, "line_max": 110, "alpha_frac": 0.6240234375, "autogenerated": false, "ratio": 3.8568738229755177, "config_test": false, ...
from django.template.loader import render_to_string from feincms.content.medialibrary.models import MediaFileContent as BaseMediaFileContent class MediaFileContent(BaseMediaFileContent): """Add some region specific rendering options.""" class Meta(BaseMediaFileContent.Meta): abstract = True def r...
{ "repo_name": "incuna/incuna-feincms", "path": "incunafein/content/medialibrary/models.py", "copies": "1", "size": "1112", "license": "bsd-2-clause", "hash": -3234581439037903400, "line_mean": 43.48, "line_max": 94, "alpha_frac": 0.6429856115, "autogenerated": false, "ratio": 3.6221498371335503, ...
from django.template.loader import render_to_string from . import DTSortDirection, DTSortType class DataTablesColumn(object): rowspan = 1 def __init__(self, name, span=0, sort_type=None, sort_direction=None, help_text=None, sortable=True, rotate=False, expected=None, prop_na...
{ "repo_name": "gmimano/commcaretest", "path": "corehq/apps/reports/datatables/__init__.py", "copies": "1", "size": "6388", "license": "bsd-3-clause", "hash": 5337511887737794000, "line_mean": 29.419047619, "line_max": 119, "alpha_frac": 0.5662179086, "autogenerated": false, "ratio": 3.97510889856...
from django.template.loader import render_to_string from skins import get_skin class Bargraph(object): def __init__( self, percent, width, widthpercent, toppadding=6, bottompadding=4): # percent graph is filled. self.percent = percent # total width of the graph (in...
{ "repo_name": "Mause/pyalp", "path": "pyalp/common/cl_bargraph.py", "copies": "1", "size": "2117", "license": "mit", "hash": 1279147163692315400, "line_mean": 32.078125, "line_max": 72, "alpha_frac": 0.5635333018, "autogenerated": false, "ratio": 4.410416666666666, "config_test": false, "has_...
from django.template.loader import render_to_string from tasks.const import STATUS_SUCCESS from .base import library @library.register('coverage') def coverage_violation(data): """Coverage violation parser :param data: task data :type data: dict :returns: dict """ data['status'] = STATUS_SUCC...
{ "repo_name": "nvbn/coviolations_web", "path": "violations/coverage.py", "copies": "1", "size": "1087", "license": "mit", "hash": -6073555460406732000, "line_mean": 26.8717948718, "line_max": 78, "alpha_frac": 0.5777368905, "autogenerated": false, "ratio": 3.697278911564626, "config_test": fals...
from django.template.loader import render_to_string from tasks.const import STATUS_SUCCESS from .base import library @library.register('sloccount') def sloccount_violation(data): """PEP8 violation parser :param data: task data :type data: dict :returns: dict """ lines = data['raw'].split('\n'...
{ "repo_name": "nvbn/coviolations_web", "path": "violations/sloccount.py", "copies": "1", "size": "1844", "license": "mit", "hash": 2235845542687664000, "line_mean": 25.7246376812, "line_max": 79, "alpha_frac": 0.5249457701, "autogenerated": false, "ratio": 3.802061855670103, "config_test": fals...
from django.template.loader import render_to_string from tasks.const import STATUS_SUCCESS, STATUS_FAILED from .base import library def _prepare_source_line(line): """Prepare source line""" source, violation = line.split(': ') file_name, line, symbol = source.split(':') return file_name, line, symbol,...
{ "repo_name": "nvbn/coviolations_web", "path": "violations/pep8.py", "copies": "1", "size": "1435", "license": "mit", "hash": 8619658419008691000, "line_mean": 28.2857142857, "line_max": 77, "alpha_frac": 0.5763066202, "autogenerated": false, "ratio": 3.698453608247423, "config_test": false, ...
from django.template.loader import render_to_string from typing import Iterator, List, Tuple from cutepaste.files.forms import FilesEditForm from cutepaste.files.models import File def confirm_trash() -> str: return render_to_string( "files/components/confirm_trash.html", context={} ) def b...
{ "repo_name": "msurdi/cutepaste", "path": "cutepaste/files/components.py", "copies": "1", "size": "2304", "license": "apache-2.0", "hash": -304618810988988700, "line_mean": 31, "line_max": 105, "alpha_frac": 0.5950520833, "autogenerated": false, "ratio": 4.136445242369838, "config_test": false,...
from django.template.loader import render_to_string import mimetypes from wellknown.resources import HostMeta _cache = { } def get_hostmeta(): return get_resource('host-meta')[0] def get_resource(path): return _cache.get(path, (None, None)) def register(path, handler=None, template=None, content=None, cont...
{ "repo_name": "jcarbaugh/django-wellknown", "path": "wellknown/__init__.py", "copies": "1", "size": "1058", "license": "bsd-3-clause", "hash": 3563382878573522000, "line_mean": 29.2285714286, "line_max": 95, "alpha_frac": 0.6654064272, "autogenerated": false, "ratio": 3.6357388316151202, "confi...
from django.template.loader import render_to_string from blockexplorer.settings import POSTMARK_SENDER, EMAIL_DEV_PREFIX, BASE_URL, ADMINS from utils import split_email_header, cat_email_header, simple_pw_generator from postmark import PMMail import re def postmark_send(subject, html_body, to_info, from_info, cc_...
{ "repo_name": "linuxmahara/blockcypher-explorer", "path": "emails/trigger.py", "copies": "3", "size": "4644", "license": "apache-2.0", "hash": 2929007071111232000, "line_mean": 31.0275862069, "line_max": 92, "alpha_frac": 0.613910422, "autogenerated": false, "ratio": 3.5750577367205545, "config...
from django.template.loader import render_to_string from bs4 import BeautifulSoup def test_homepage_case_studies_cms(): context = { 'success_stories': [ { 'meta': {'slug': 'the-slug-one'}, 'hero_image_thumbnail': {'url': 'hero.png'}, 'title': 'T...
{ "repo_name": "uktrade/navigator", "path": "app/navigator/tests/test_templates.py", "copies": "1", "size": "1110", "license": "mit", "hash": 8306878032225292000, "line_mean": 29, "line_max": 76, "alpha_frac": 0.5351351351, "autogenerated": false, "ratio": 3.5806451612903225, "config_test": fals...
from django.template.loader import render_to_string from common.constants import EMPTY_SEARCH_MSG import urllib def history_renderer(user, history, hist_type, return_type, empty_search_msg, template, get_params=None, following=None)...
{ "repo_name": "haystack/eyebrowse-server", "path": "live_stream/renderers.py", "copies": "1", "size": "1624", "license": "mit", "hash": 9060595501182322000, "line_mean": 30.8431372549, "line_max": 77, "alpha_frac": 0.5073891626, "autogenerated": false, "ratio": 4.613636363636363, "config_test":...
from django.template.loader import render_to_string from core.emails import send_email def send_application_confirmation(event_application): subject = ( "Confirmation of application to organise Django Girls {} workshop" .format(event_application.city)) content = render_to_string( 'ema...
{ "repo_name": "patjouk/djangogirls", "path": "organize/emails.py", "copies": "2", "size": "2186", "license": "bsd-3-clause", "hash": -2525047888223190000, "line_mean": 36.6896551724, "line_max": 80, "alpha_frac": 0.6843549863, "autogenerated": false, "ratio": 4.003663003663004, "config_test": f...
from django.template.loader import render_to_string from debug_toolbar import settings as dt_settings from debug_toolbar.utils import get_name_from_obj class Panel: """ Base class for panels. """ def __init__(self, toolbar, get_response): self.toolbar = toolbar self.get_response = ge...
{ "repo_name": "django-debug-toolbar/django-debug-toolbar", "path": "debug_toolbar/panels/__init__.py", "copies": "1", "size": "6118", "license": "bsd-3-clause", "hash": 5489680000831072000, "line_mean": 30.0558375635, "line_max": 88, "alpha_frac": 0.6131088591, "autogenerated": false, "ratio": 4....
from django.template.loader import render_to_string from django.contrib.sites.models import Site from pinax.notifications.conf import settings from pinax.notifications.utils import notice_setting_for_user class BaseBackend(object): """ The base backend. """ def __init__(self, medium_id, spam_sensiti...
{ "repo_name": "psychok7/pinax-notifications-backends", "path": "pinax/notifications_backends/backends/base.py", "copies": "1", "size": "2078", "license": "mit", "hash": -268871764538265500, "line_mean": 34.8275862069, "line_max": 87, "alpha_frac": 0.6289701636, "autogenerated": false, "ratio": 4....
from django.template.loader import render_to_string from django_elasticsearch_dsl import Document, fields from django_elasticsearch_dsl.registries import registry from froide.helper.search import ( get_index, get_text_analyzer, get_search_analyzer, get_search_quote_analyzer ) from .models import FoiRequest ...
{ "repo_name": "stefanw/froide", "path": "froide/foirequest/documents.py", "copies": "1", "size": "2939", "license": "mit", "hash": -5156342566597873000, "line_mean": 29.2989690722, "line_max": 95, "alpha_frac": 0.6580469547, "autogenerated": false, "ratio": 4.05939226519337, "config_test": fals...
from django.template.loader import render_to_string from mezzanine.generic.models import Keyword from dajaxice.decorators import dajaxice_register from dajax.core import Dajax from pari.search.models import get_search_results from .models import (Category, Type, Location, Author, get_category_a...
{ "repo_name": "RuralIndia/pari", "path": "pari/article/ajax.py", "copies": "1", "size": "3598", "license": "bsd-3-clause", "hash": -7096609327437914000, "line_mean": 38.1086956522, "line_max": 109, "alpha_frac": 0.6164535853, "autogenerated": false, "ratio": 4.2680901542111505, "config_test": f...
from django.template.loader import render_to_string from wagtail.admin.auth import user_has_any_page_permission from wagtail.admin.navigation import get_site_for_user from wagtail.core import hooks from wagtail.core.models import Page, Site class SummaryItem: order = 100 def __init__(self, request): ...
{ "repo_name": "nimasmi/wagtail", "path": "wagtail/admin/site_summary.py", "copies": "6", "size": "2601", "license": "bsd-3-clause", "hash": 7627935491265535000, "line_mean": 29.9642857143, "line_max": 89, "alpha_frac": 0.6132256824, "autogenerated": false, "ratio": 4.038819875776397, "config_te...
from django.template.loader import render_to_string from wagtail.admin.utils import get_site_for_user, user_has_any_page_permission from wagtail.core import hooks from wagtail.core.models import Page, Site class SummaryItem: order = 100 def __init__(self, request): self.request = request def ge...
{ "repo_name": "nealtodd/wagtail", "path": "wagtail/admin/site_summary.py", "copies": "1", "size": "2566", "license": "bsd-3-clause", "hash": 8103530141963514000, "line_mean": 29.9156626506, "line_max": 89, "alpha_frac": 0.6095089634, "autogenerated": false, "ratio": 4.028257456828886, "config_t...
from django.template.loader import render_to_string from wagtail.wagtailcore import hooks from wagtail.wagtailcore.models import Page, Site class SummaryItem(object): order = 100 def __init__(self, request): self.request = request def get_context(self): return {} def render(self): ...
{ "repo_name": "davecranwell/wagtail", "path": "wagtail/wagtailadmin/site_summary.py", "copies": "4", "size": "1778", "license": "bsd-3-clause", "hash": 1659193478726403600, "line_mean": 28.6333333333, "line_max": 107, "alpha_frac": 0.6349831271, "autogenerated": false, "ratio": 4.050113895216401,...
from django.template.loader import render_to_string import settings from xformmanager.models import FormDefModel, Metadata from receiver.models import Submission, Attachment from hq.models import BlacklistedUser def domain_summary(request, domain=None, detail_view=True): '''Domain Admin Summary Data''' if n...
{ "repo_name": "icomms/wqmanager", "path": "apps/reports/custom/all/domain_summary.py", "copies": "3", "size": "3514", "license": "bsd-3-clause", "hash": 5737095601765858000, "line_mean": 42.3950617284, "line_max": 110, "alpha_frac": 0.5571997723, "autogenerated": false, "ratio": 4.129259694477086...
from django.template.loader import render_to_string import settings from xformmanager.models import Metadata from hq.utils import paginate, get_table_display_properties, get_query_set def metadata(request, domain=None): '''Submission Summary List for All Forms''' if not domain: domain = request.ext...
{ "repo_name": "commtrack/commtrack-old-to-del", "path": "apps/reports/custom/all/metadata.py", "copies": "1", "size": "1350", "license": "bsd-3-clause", "hash": -3376074134309163000, "line_mean": 39.9090909091, "line_max": 110, "alpha_frac": 0.5740740741, "autogenerated": false, "ratio": 4.326923...
from django.template.loader import render_to_string class BaseItem: template = 'wagtailadmin/userbar/item_base.html' def render(self, request): return render_to_string(self.template, dict(self=self, request=request), request=request) class AdminItem(BaseItem): template = 'wagtailadmin/userbar/i...
{ "repo_name": "timorieber/wagtail", "path": "wagtail/admin/userbar.py", "copies": "24", "size": "3632", "license": "bsd-3-clause", "hash": -8970005367275019000, "line_mean": 29.5210084034, "line_max": 99, "alpha_frac": 0.6459251101, "autogenerated": false, "ratio": 4.117913832199546, "config_te...
from django.template.loader import render_to_string class BaseItem(object): template = 'wagtailadmin/userbar/item_base.html' def render(self, request): return render_to_string(self.template, dict(self=self, request=request), request=request) class AddPageItem(BaseItem): template = 'wagtailadmin...
{ "repo_name": "inonit/wagtail", "path": "wagtail/wagtailadmin/userbar.py", "copies": "3", "size": "2529", "license": "bsd-3-clause", "hash": 769866374922390700, "line_mean": 29.4698795181, "line_max": 97, "alpha_frac": 0.652036378, "autogenerated": false, "ratio": 4.059390048154093, "config_tes...
from django.template.loader import render_to_string def render_notification(notification, render_target='', **extra): template_name = notification.nf_type template_dir = 'notifications/includes/' nf_ctx = {'notification': notification} nf_ctx.update(extra) suffix = '_{}'.format(render_target) if...
{ "repo_name": "v1k45/django-notify-x", "path": "notify/utils.py", "copies": "1", "size": "4540", "license": "mit", "hash": 2508262787241152500, "line_mean": 36.520661157, "line_max": 124, "alpha_frac": 0.6145374449, "autogenerated": false, "ratio": 4.007060900264784, "config_test": false, "ha...
from django.template.loader import render_to_string def test_some_success_some_failed(rf, extraction_order, exports): successful_exports = exports[::2] failed_exports = exports[1::2] view_context = dict( extraction_order=extraction_order, successful_exports=successful_exports, fai...
{ "repo_name": "geometalab/osmaxx", "path": "tests/excerptexport/templates/email/test_all_exports_of_extraction_order_done_subject.py", "copies": "2", "size": "4883", "license": "mit", "hash": 2782896143276699600, "line_mean": 34.9044117647, "line_max": 109, "alpha_frac": 0.5650215032, "autogenerate...