text
stringlengths
0
1.05M
meta
dict
from django.template.defaultfilters import register from django import template import os from citizengrid.models import ApplicationFile, ApplicationBasicInfo, ApplicationEC2Images, ApplicationOpenstackImages from django.template.loader import render_to_string register = template.Library() @register.inclusion_tag("...
{ "repo_name": "ImperialCollegeLondon/citizengrid", "path": "dashboard/citizengrid/templatetags/cg_myapp_template.py", "copies": "2", "size": "2597", "license": "bsd-3-clause", "hash": 2023464684024853000, "line_mean": 46.2363636364, "line_max": 135, "alpha_frac": 0.6607624182, "autogenerated": fals...
from django.template.defaultfilters import register from django.utils.safestring import mark_safe from django.conf import settings from nvd3.NVD3Chart import NVD3Chart from nvd3 import lineWithFocusChart, lineChart, \ multiBarChart, pieChart, stackedAreaChart, \ multiBarHorizontalChart, linePlusBarChart, \ ...
{ "repo_name": "chiu/django-nvd3", "path": "django_nvd3/templatetags/nvd3_tags.py", "copies": "1", "size": "5727", "license": "mit", "hash": 1345137197358983400, "line_mean": 33.0892857143, "line_max": 96, "alpha_frac": 0.6050288109, "autogenerated": false, "ratio": 3.3767688679245285, "config_t...
from django.template.defaultfilters import register @register.filter def mongo_id(value): """Retrieve _id value. @todo: it will be removed in future. """ if isinstance(value, dict): return value.get("_id", value) # Return value return unicode(value) @register.filter def is_dict(value)...
{ "repo_name": "mburakergenc/Malware-Detection-using-Machine-Learning", "path": "cuckoo/web/analysis/templatetags/analysis_tags.py", "copies": "1", "size": "2638", "license": "mit", "hash": 7273658030193516000, "line_mean": 23.2018348624, "line_max": 78, "alpha_frac": 0.5648218347, "autogenerated": ...
from django.template.defaultfilters import slugify from ckeditor.fields import RichTextField from django.db import models import uuid # Funciones: # funcion para almacenamiento de imagenes def content_file_name(instance, filename): return '/'.join(['portadas', instance.year.title_year, filename]) # Create your mod...
{ "repo_name": "moises1234/PlayPeliculas-Django-Backbone", "path": "apps/pelicula/models.py", "copies": "1", "size": "1955", "license": "bsd-2-clause", "hash": 6450581948993636000, "line_mean": 28.6363636364, "line_max": 95, "alpha_frac": 0.73657289, "autogenerated": false, "ratio": 3.133012820512...
from django.template.defaultfilters import slugify from django.conf import settings from django.core.mail import send_mail, BadHeaderError from django.core.paginator import Paginator, InvalidPage, EmptyPage from pygments import formatters, highlight, lexers import re, os, errno, logging logger = logging.getLogger('sc...
{ "repo_name": "oswalpalash/OctaveCodeShare", "path": "scipy_central/utils/__init__.py", "copies": "1", "size": "7241", "license": "bsd-3-clause", "hash": -8832628301860381000, "line_mean": 36.518134715, "line_max": 135, "alpha_frac": 0.6014362657, "autogenerated": false, "ratio": 3.80504466631634...
from django.template.defaultfilters import slugify from django.contrib.auth.models import User from django.core.validators import validate_email, ValidationError from django.db.models import EmailField from django.utils.http import urlencode from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils import i...
{ "repo_name": "1st/django-allauth", "path": "allauth/utils.py", "copies": "1", "size": "2424", "license": "mit", "hash": -2901003230318252000, "line_mean": 27.5176470588, "line_max": 69, "alpha_frac": 0.6377887789, "autogenerated": false, "ratio": 3.9543230016313213, "config_test": false, "ha...
from django.template.defaultfilters import slugify from django.db import models from django.db.models import Sum # Create your models here. class Councilman(models.Model): STATUS_CHOICES = ( (0, 'Inativo'), (1, 'Ativo') ) name = models.CharField('Name', max_length=150) page_link = mo...
{ "repo_name": "flaviodrt/atlas_site", "path": "atlas/councilman/models.py", "copies": "1", "size": "6159", "license": "mit", "hash": -1272615568872343600, "line_mean": 40.6013513514, "line_max": 91, "alpha_frac": 0.6972551567, "autogenerated": false, "ratio": 3.577571179546775, "config_test": f...
from django.template.defaultfilters import slugify from django.db.models import Q import re def SlugifyUniquely(value, model, slugfield="slug"): """Returns a slug on a name which is unique within a model's table This code suffers a race condition between when a unique slug is determined and wh...
{ "repo_name": "nicksergeant/snipt-old", "path": "snippet/utils.py", "copies": "1", "size": "2811", "license": "bsd-3-clause", "hash": 5752080623334365000, "line_mean": 39.7391304348, "line_max": 86, "alpha_frac": 0.5823550338, "autogenerated": false, "ratio": 4.3921875, "config_test": false, ...
from django.template.defaultfilters import slugify from django.shortcuts import render import dateutil.parser import datetime import json import os from config.settings.base import DJANGO_ROOT from .forms import CreateNewPost json_file_path = os.path.join(DJANGO_ROOT, 'starter_app/static/data/blogs.json') def read...
{ "repo_name": "pythonfun0/django", "path": "project/starter_app/views.py", "copies": "1", "size": "2877", "license": "mit", "hash": -1652816305338801000, "line_mean": 34.0853658537, "line_max": 101, "alpha_frac": 0.5192909281, "autogenerated": false, "ratio": 4.2, "config_test": false, "has_n...
from django.template.defaultfilters import slugify from django.template.loader import render_to_string from debug_toolbar.middleware import DebugToolbarMiddleware class DebugPanel(object): """ Base class for debug panels. """ # name = 'Base' # template = 'debug_toolbar/panels/base.html' has_co...
{ "repo_name": "sgml/popcorn_maker", "path": "vendor-local/lib/python/debug_toolbar/panels/__init__.py", "copies": "12", "size": "1933", "license": "bsd-3-clause", "hash": 7059517477365031000, "line_mean": 27.8507462687, "line_max": 80, "alpha_frac": 0.6352819452, "autogenerated": false, "ratio": ...
from django.template.defaultfilters import slugify from django.template.loader import render_to_string import Image import glob, os, commands from staples import handle_others, File import settings try: import json except ImportError: from django.utils import simplejson as json def handle_gallery(f, **kwar...
{ "repo_name": "3demax/Staples", "path": "sample_projects/gallery_project/processors.py", "copies": "1", "size": "3752", "license": "unlicense", "hash": -3008890806459446300, "line_mean": 31.3534482759, "line_max": 100, "alpha_frac": 0.5866204691, "autogenerated": false, "ratio": 3.607692307692307...
from django.template.defaultfilters import slugify from django.test import TestCase from sluggable.tests.models import SimpleSluggableModel, \ MultiFieldSluggableModel, UniqueTogetherSluggableModel class TestSimpleSlug(TestCase): def setUp(self): self.alpha_value = 'Lorem ipsum dolor sit amet.' ...
{ "repo_name": "jmagnusson/django-sluggable", "path": "src/sluggable/tests/tests.py", "copies": "2", "size": "3739", "license": "mit", "hash": 6458506777578031000, "line_mean": 39.652173913, "line_max": 84, "alpha_frac": 0.645627173, "autogenerated": false, "ratio": 3.878630705394191, "config_te...
from django.template.defaultfilters import slugify from django.test import TestCase from survey.forms.enumeration_area import LocationsFilterForm, get_leaf_locs from survey.models import EnumerationArea, Location, LocationType class LocationFormTest(TestCase): fixtures = ['enumeration_area', 'locations', 'locatio...
{ "repo_name": "unicefuganda/uSurvey", "path": "survey/tests/forms/test_location_form.py", "copies": "1", "size": "2126", "license": "bsd-3-clause", "hash": 2570610036674971600, "line_mean": 42.387755102, "line_max": 112, "alpha_frac": 0.6839134525, "autogenerated": false, "ratio": 3.9738317757009...
from django.template.defaultfilters import slugify from django.test import TestCase from package.models import Package, Version from pypi.slurper import Slurper TEST_PACKAGE_NAME = 'Django' TEST_PACKAGE_VERSION = '1.3.1' TEST_PACKAGE_REPO_NAME = 'django-uni-form' class SlurpAllTests(TestCase): def t...
{ "repo_name": "pythonchelle/opencomparison", "path": "apps/pypi/tests/test_slurper.py", "copies": "2", "size": "2027", "license": "mit", "hash": -5591442072837107000, "line_mean": 38.7647058824, "line_max": 89, "alpha_frac": 0.6748889985, "autogenerated": false, "ratio": 3.678765880217786, "con...
from django.template.defaultfilters import slugify from django.utils.datastructures import SortedDict import os import traceback import pickle from limbo.classes import Singleton import logging __author__ = 'gdoermann' logger = logging.getLogger(__file__) class Properties(dict): def __init__(self, filepath): ...
{ "repo_name": "gdoermann/django-limbo", "path": "limbo/conf/storage.py", "copies": "1", "size": "6334", "license": "mit", "hash": 2603314149331445000, "line_mean": 30.8341708543, "line_max": 104, "alpha_frac": 0.5573097569, "autogenerated": false, "ratio": 4.026700572155118, "config_test": fals...
from django.template.defaultfilters import slugify from django.utils import timezone from faker import Faker from .. import config, models def generate_initial_data(apps, schema_editor): # create permissions for this app config.create_fixtures(apps) # add service for all users User = apps.get_model...
{ "repo_name": "jdzero/foundation", "path": "sample/blogs/migrations/__init__.py", "copies": "2", "size": "1143", "license": "mit", "hash": 2363984013415182300, "line_mean": 32.6176470588, "line_max": 74, "alpha_frac": 0.5879265092, "autogenerated": false, "ratio": 3.617088607594937, "config_tes...
from django.template.defaultfilters import slugify from django.utils.safestring import mark_safe from django.contrib import admin from django import forms from models import * from ietf.person.models import * from ietf.doc.utils import get_state_types from ietf.utils.admin import admin_link class StateTypeAdmin(admin...
{ "repo_name": "mcr/ietfdb", "path": "ietf/doc/admin.py", "copies": "1", "size": "5604", "license": "bsd-3-clause", "hash": -3133458025939300400, "line_mean": 34.9230769231, "line_max": 118, "alpha_frac": 0.653461813, "autogenerated": false, "ratio": 3.6747540983606557, "config_test": false, "...
from django.template.defaultfilters import slugify from lingcod.straightline_spacing.models import * import lingcod.intersection.views as int_views import xlwt def spacing_workbook(in_dict, ws_title): wb = xlwt.Workbook(encoding='utf-8') ws = wb.add_sheet('spacing_matrix') ws = spacing_worksheet(in_dict, w...
{ "repo_name": "Alwnikrotikz/marinemap", "path": "lingcod/straightline_spacing/views.py", "copies": "3", "size": "1193", "license": "bsd-3-clause", "hash": -8730252021923785000, "line_mean": 33.1142857143, "line_max": 59, "alpha_frac": 0.6563285834, "autogenerated": false, "ratio": 3.4579710144927...
from django.template.defaultfilters import slugify from madrona.straightline_spacing.models import * import madrona.intersection.views as int_views import xlwt def spacing_workbook(in_dict, ws_title): wb = xlwt.Workbook(encoding='utf-8') ws = wb.add_sheet('spacing_matrix') ws = spacing_worksheet(in_dict, w...
{ "repo_name": "Ecotrust/madrona_addons", "path": "mlpa/straightline_spacing/views.py", "copies": "1", "size": "1185", "license": "bsd-3-clause", "hash": -4190052862569161000, "line_mean": 32.8571428571, "line_max": 59, "alpha_frac": 0.6607594937, "autogenerated": false, "ratio": 3.414985590778098...
from django.template.defaultfilters import slugify from orcamentos.crm.models import Employee, Occupation, PhoneEmployee from orcamentos.utils.gen_random_values import gen_phone from orcamentos.utils.lists import OCCUPATION_LIST ''' Definindo a senha padrão para todos os usuarios, como o django aceita apenas hash, cr...
{ "repo_name": "rg3915/orcamentos", "path": "shell/shell_employee.py", "copies": "1", "size": "7395", "license": "mit", "hash": 7249412489478893000, "line_mean": 28.6975806452, "line_max": 90, "alpha_frac": 0.5220638153, "autogenerated": false, "ratio": 3.088050314465409, "config_test": false, ...
from django.template.defaultfilters import slugify from rapidsms.contrib.locations.models import LocationType, Location from survey.models import LocationTypeDetails, LocationCode, UploadErrorLog from survey.services.csv_uploader import UploadService class UploadLocation(UploadService): MODEL = 'LOCATIONS' d...
{ "repo_name": "antsmc2/mics", "path": "survey/services/location_upload.py", "copies": "2", "size": "3147", "license": "bsd-3-clause", "hash": -1583410599826933800, "line_mean": 48.171875, "line_max": 136, "alpha_frac": 0.6339370829, "autogenerated": false, "ratio": 3.899628252788104, "config_te...
from django.template.defaultfilters import slugify from smartmin.models import SmartModel from django.db import models """ Full description of the landmark type """ class LandmarkType(models.Model): name = models.CharField(max_length=128, help_text="Name describing the landmark type e.g. Popular name") slug = ...
{ "repo_name": "nyaruka/motome", "path": "motome/landmarks/models.py", "copies": "1", "size": "1367", "license": "bsd-3-clause", "hash": 101025086758396110, "line_mean": 41.71875, "line_max": 131, "alpha_frac": 0.7190929042, "autogenerated": false, "ratio": 3.5231958762886597, "config_test": fal...
from django.template.defaultfilters import slugify from string import digits FORMATTED_COLUMN_EXTENSION = '_formatted' def get_formatted_column_name(colname): """When adding a new column to a tabular file, add a suffix to the end""" assert colname is not None, "colname cannot be None" return '%s%s' % (c...
{ "repo_name": "IQSS/geoconnect", "path": "gc_apps/geo_utils/tabular_util.py", "copies": "1", "size": "2427", "license": "apache-2.0", "hash": 3507507521906856000, "line_mean": 47.54, "line_max": 626, "alpha_frac": 0.7235269881, "autogenerated": false, "ratio": 4.03156146179402, "config_test": f...
from django.template.defaultfilters import slugify def SlugifyUniquely(value, model, slugfield="slug"): """ Returns a slug on a name which is unique within a model's table This code suffers a race condition between when a unique slug is determined and when the object with that slug is saved. It's ...
{ "repo_name": "rubeon/django-xblog", "path": "xblog/external/postutils.py", "copies": "1", "size": "1285", "license": "bsd-2-clause", "hash": -6170961841726911000, "line_mean": 36.7941176471, "line_max": 77, "alpha_frac": 0.6653696498, "autogenerated": false, "ratio": 4.254966887417218, "config...
from django.template.defaultfilters import slugify from experiments_manager.models import Experiment from pylint_manager.helper import return_result_summary_for_file class ContentFile(object): def __init__(self, name, path, type, slug): self.name = name self.path = path self.type = type ...
{ "repo_name": "MOOCworkbench/MOOCworkbench", "path": "git_manager/mixins/repo_file_list.py", "copies": "1", "size": "4172", "license": "mit", "hash": 388321379972042300, "line_mean": 40.3069306931, "line_max": 116, "alpha_frac": 0.6378235858, "autogenerated": false, "ratio": 4.078201368523949, ...
from django.template.defaultfilters import slugify from froide.publicbody.models import PublicBody, Category, Classification from froide.georegion.models import GeoRegion from ..models import InformationObject from .base import BaseProvider, first class PublicBodyProvider(BaseProvider): def get_queryset(self):...
{ "repo_name": "okfde/froide-campaign", "path": "froide_campaign/providers/publicbody.py", "copies": "1", "size": "3139", "license": "mit", "hash": 5032050394779338000, "line_mean": 27.2792792793, "line_max": 74, "alpha_frac": 0.5342465753, "autogenerated": false, "ratio": 4.124835742444152, "co...
from django.template.defaultfilters import slugify from ztree.models import Node #from ztree.signals import tree_content_created, tree_content_updated from ztree.utils import filter_and_clean_fields, dispatch_request_json from ztreecrud.component.slugutils import SlugUtil from akuna.component import get_component from...
{ "repo_name": "stana/django-ztree", "path": "ztreecrud/component/factories.py", "copies": "1", "size": "9111", "license": "mit", "hash": 8855682099826232000, "line_mean": 36.9625, "line_max": 133, "alpha_frac": 0.6550323784, "autogenerated": false, "ratio": 4.141363636363637, "config_test": fal...
from django.template.defaultfilters import stringfilter from django import template try: from django.utils.encoding import force_text as force_unicode except ImportError: from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe import markdown, re register = template.Libra...
{ "repo_name": "amitu/djangothis-jekyll", "path": "templatetags/markup.py", "copies": "1", "size": "1173", "license": "bsd-3-clause", "hash": 7377267359778109000, "line_mean": 29.0769230769, "line_max": 72, "alpha_frac": 0.6402387042, "autogenerated": false, "ratio": 3.598159509202454, "config_t...
from django.template.defaultfilters import striptags from django.utils.encoding import force_text, Promise from cla_common.constants import DIAGNOSIS_SCOPE def is_terminal(digraph, g_node_id): """ :param digraph: a networkx DiGraph or subclass (MultiDigraph) :param g_node_id: a node id :return: if no...
{ "repo_name": "ministryofjustice/cla_backend", "path": "cla_backend/apps/diagnosis/utils.py", "copies": "1", "size": "1084", "license": "mit", "hash": 7334550457068083000, "line_mean": 26.7948717949, "line_max": 81, "alpha_frac": 0.684501845, "autogenerated": false, "ratio": 3.2848484848484847, ...
from django.template.defaultfilters import timesince from djblets.webapi.core import WebAPIEncoder from reviewboard.diffviewer.models import FileDiff, DiffSet from reviewboard.reviews.models import ReviewRequest, Review, Group, Comment, \ ReviewRequestDraft, Screenshot, \ ...
{ "repo_name": "atagar/ReviewBoard", "path": "reviewboard/webapi/encoder.py", "copies": "3", "size": "5598", "license": "mit", "hash": -6569169936250671000, "line_mean": 33.5555555556, "line_max": 79, "alpha_frac": 0.4531975706, "autogenerated": false, "ratio": 4.28309104820199, "config_test": f...
from django.template.defaultfilters import title from django.template.loader import render_to_string from horizon.utils.filters import replace_underscores def stack_info(stack, stack_image): stack.stack_status_desc = title(replace_underscores(stack.stack_status)) if stack.stack_status_reason: stack.s...
{ "repo_name": "tuskar/tuskar-ui", "path": "openstack_dashboard/dashboards/project/stacks/sro.py", "copies": "2", "size": "1057", "license": "apache-2.0", "hash": 6164206560351300000, "line_mean": 33.0967741935, "line_max": 76, "alpha_frac": 0.6660359508, "autogenerated": false, "ratio": 4.1614173...
from django.template.defaultfilters import title from rest_framework import serializers from rest_framework.exceptions import ValidationError from rest_framework_friendly_errors.mixins import FriendlyErrorMessagesMixin from tests.models import LANGUAGE_CHOICES, Snippet def is_proper_title(value): if value and val...
{ "repo_name": "FutureMind/drf-friendly-errors", "path": "tests/serializers.py", "copies": "2", "size": "5294", "license": "mit", "hash": -5161138724460310000, "line_mean": 36.8142857143, "line_max": 78, "alpha_frac": 0.6346807707, "autogenerated": false, "ratio": 4.5520206362854685, "config_tes...
from django.template.defaultfilters import title # noqa from django.template.loader import render_to_string # noqa from horizon.utils import filters def stack_info(stack, stack_image): stack.stack_status_desc = title( filters.replace_underscores(stack.stack_status)) if stack.stack_status_reason: ...
{ "repo_name": "Havate/havate-openstack", "path": "proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/stacks/sro.py", "copies": "11", "size": "1094", "license": "apache-2.0", "hash": 134531295365792050, "line_mean": 33.1875, "line_max": 72, "alpha_frac": 0.6599634369, "autoge...
from django.template.defaultfilters import truncatechars from django.utils.html import format_html from django.contrib import admin from django.conf import settings from app import models def image_tag(url): return format_html( "<img src='{root}{url}' />".format( root=settings.MEDIA_URL or ''...
{ "repo_name": "hackerspace-silesia/jakniedojade", "path": "jakniedojade/app/admin.py", "copies": "1", "size": "1700", "license": "mit", "hash": 9006350597384760000, "line_mean": 25.9841269841, "line_max": 109, "alpha_frac": 0.6035294118, "autogenerated": false, "ratio": 3.6956521739130435, "con...
from django.template.defaultfilters import truncatechars from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ from mezzanine.twitter import get_auth_settings try: from twitter import Api except ImportError: Api = None FORMFIELD_HTML = """ <div class='send_twee...
{ "repo_name": "stephenmcd/mezzanine", "path": "mezzanine/twitter/admin.py", "copies": "2", "size": "2181", "license": "bsd-2-clause", "hash": 2301429467659813400, "line_mean": 34.7540983607, "line_max": 78, "alpha_frac": 0.6276937185, "autogenerated": false, "ratio": 4.107344632768362, "config_...
from django.template.defaultfilters import truncatewords_html from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_truncate_zero(self): self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0), '') def test_truncate(self): ...
{ "repo_name": "bak1an/django", "path": "tests/template_tests/filter_tests/test_truncatewords_html.py", "copies": "40", "size": "1542", "license": "bsd-3-clause", "hash": -1562899171618609200, "line_mean": 36.6097560976, "line_max": 107, "alpha_frac": 0.5525291829, "autogenerated": false, "ratio":...
from django.template.defaultfilters import truncatewords_html from aldryn_blog.models import Post from cmsplugin_filer_image.models import FilerImage from djangocms_text_ckeditor.models import Text def create_post(post_data, parts): try: first_part = parts[0] except IndexError: first_part = p...
{ "repo_name": "aldryn/aldryn-wordpress-import", "path": "aldryn_wordpress_import/factories.py", "copies": "1", "size": "1572", "license": "bsd-3-clause", "hash": 7011968533890108000, "line_mean": 28.6603773585, "line_max": 67, "alpha_frac": 0.6762086514, "autogenerated": false, "ratio": 3.6473317...
from django.template.defaultfilters import truncatewords_html, striptags from haystack import indexes from .models import Event, Calendar class CalendarIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) name = indexes.CharField(model_attr='name') de...
{ "repo_name": "demvher/pythondotorg", "path": "events/search_indexes.py", "copies": "14", "size": "2169", "license": "apache-2.0", "hash": 2199670482196221400, "line_mean": 28.3108108108, "line_max": 74, "alpha_frac": 0.6514522822, "autogenerated": false, "ratio": 3.9871323529411766, "config_te...
from django.template.defaultfilters import truncatewords from django.utils.html import strip_tags from docutils import nodes def extract_title(document): """Return the title of the document. :param document: :type document: :class:`docutils.nodes.document` """ for node in document.traverse(nodes...
{ "repo_name": "tony/django-docutils", "path": "django_docutils/lib/metadata/extract.py", "copies": "1", "size": "2217", "license": "mit", "hash": 5997273660571586000, "line_mean": 30.2253521127, "line_max": 78, "alpha_frac": 0.6454668471, "autogenerated": false, "ratio": 4.053016453382084, "con...
from django.template.defaultfilters import unordered_list from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe from ..utils import setup class U...
{ "repo_name": "hackerbot/DjangoDev", "path": "tests/template_tests/filter_tests/test_unordered_list.py", "copies": "41", "size": "7935", "license": "bsd-3-clause", "hash": -3042423766121700400, "line_mean": 40.7631578947, "line_max": 107, "alpha_frac": 0.5342155009, "autogenerated": false, "ratio...
from django.template.defaultfilters import unordered_list from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class UnorderedListTests(SimpleTestCase): @setup({'unordered_list01': '{{ a|unordered_list }}'}) def test_unordered_list01(self): o...
{ "repo_name": "dfdx2/django", "path": "tests/template_tests/filter_tests/test_unordered_list.py", "copies": "33", "size": "5194", "license": "bsd-3-clause", "hash": 7059953430595270000, "line_mean": 37.4740740741, "line_max": 102, "alpha_frac": 0.5152098575, "autogenerated": false, "ratio": 2.810...
from django.template.defaultfilters import urlencode ROOT = 'c:/Inetpub' DJANGO_ROOT = 'c:/Inetpub/django' TEMP_DIR = 'c:/cygwin/tmp' MPLAYER = 'c:/Progra~1/SMPlayer/mplayer/mplayer.exe' MIDENTIFY = '%s -vo null -ao null -frames 0 -identify' % MPLAYER IMAGEMAGICK_CONVERT = 'c:/Progra~1/ImageMagick-6.6.3-Q16/convert.e...
{ "repo_name": "dennisjlee/icenine", "path": "icenine/ice9/conf.py", "copies": "1", "size": "3682", "license": "bsd-3-clause", "hash": -5533697406351656000, "line_mean": 28.456, "line_max": 91, "alpha_frac": 0.5529603476, "autogenerated": false, "ratio": 3.130952380952381, "config_test": false, ...
from django.template.defaultfilters import urlize from django.test import SimpleTestCase from django.utils.functional import lazy from django.utils.safestring import mark_safe from ..utils import setup class UrlizeTests(SimpleTestCase): @setup({'urlize01': '{% autoescape off %}{{ a|urlize }} {{ b|urlize }}{% en...
{ "repo_name": "EmadMokhtar/Django", "path": "tests/template_tests/filter_tests/test_urlize.py", "copies": "20", "size": "16127", "license": "mit", "hash": -1799682715689927000, "line_mean": 40.179028133, "line_max": 119, "alpha_frac": 0.5469225514, "autogenerated": false, "ratio": 3.4337811900191...
from django.template.defaultfilters import urlizetrunc from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class UrlizetruncTests(SimpleTestCase): @setup({ 'urlizetrunc01': '{% autoescape off %}{{ a|urlizetrunc:"8" }} {{ b|urlizetrunc:"8" }}{% e...
{ "repo_name": "theo-l/django", "path": "tests/template_tests/filter_tests/test_urlizetrunc.py", "copies": "71", "size": "3367", "license": "bsd-3-clause", "hash": -1859687403157617700, "line_mean": 35.0322580645, "line_max": 119, "alpha_frac": 0.5398388541, "autogenerated": false, "ratio": 3.2597...
from django.template.defaulttags import kwarg_re from django import template from django.utils.encoding import smart_str register = template.Library() def parse_args(parser, bits): # see django.templatetags.future: url, line 80 args = [] kwargs = {} asvar = None if len(bits) >= 2 and bits[-2] == ...
{ "repo_name": "ddanier/django_internal_urls", "path": "django_internal_urls/templatetags/internal_urls.py", "copies": "1", "size": "2083", "license": "bsd-3-clause", "hash": -251631087346108540, "line_mean": 30.5606060606, "line_max": 94, "alpha_frac": 0.6039366299, "autogenerated": false, "ratio...
from django.template.defaulttags import kwarg_re from django.template import Library, TemplateSyntaxError, Node from django.utils.encoding import smart_str try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = get_user_model() regi...
{ "repo_name": "ff0000/scarlet", "path": "scarlet/cms/templatetags/cms.py", "copies": "1", "size": "6758", "license": "mit", "hash": 5174785547209034000, "line_mean": 27.5147679325, "line_max": 83, "alpha_frac": 0.5843444806, "autogenerated": false, "ratio": 4.123245881635143, "config_test": fal...
from django.template.defaulttags import register from django.db.models import * from django.utils import timezone from math import exp import json from .models import * # Custom classes class Notification(): success_class = 'alert-success' error_class = 'alert-danger' warning_class = 'alert-warning' i...
{ "repo_name": "rawenihcam/BER-SERKR", "path": "hamask/control.py", "copies": "1", "size": "3229", "license": "mit", "hash": -6554112146731436000, "line_mean": 30.359223301, "line_max": 108, "alpha_frac": 0.4707339734, "autogenerated": false, "ratio": 3.453475935828877, "config_test": false, "...
from django.template.defaulttags import register from django_gravatar.helpers import GRAVATAR_DEFAULT_SIZE, get_gravatar_url from django.utils.html import escape from django.conf import settings from django.utils import timezone from premises.models import FALLACY_TYPES @register.filter def humanize_fallacy_type(val...
{ "repo_name": "bahattincinic/arguman.org", "path": "web/premises/templatetags/premise_tags.py", "copies": "1", "size": "1495", "license": "mit", "hash": 2810958078620930000, "line_mean": 32.9772727273, "line_max": 116, "alpha_frac": 0.7056856187, "autogenerated": false, "ratio": 3.501170960187353...
#from django.template.defaulttags import register from django import template register = template.Library() @register.filter def get_item(dictionary, key): return dictionary.get(key) @register.filter def percent(value, arg): return round(value/arg*100,2) @register.filter def contains(string,keyword): if str...
{ "repo_name": "drexly/openhgsenti", "path": "templatetags/compute.py", "copies": "1", "size": "1568", "license": "apache-2.0", "hash": -7621507427077246000, "line_mean": 20.4931506849, "line_max": 49, "alpha_frac": 0.5739795918, "autogenerated": false, "ratio": 3.3504273504273505, "config_test"...
from django.template.defaulttags import register from portal.forms import PartnerForm, PreferenceForm from portal.models import Student, Family @register.inclusion_tag('portal/partner_preferences.html') def partner_preferences(student, partner_popup): offer = Student.objects.filter(partner=student) partner =...
{ "repo_name": "martinzlocha/mad", "path": "portal/templatetags/preferences.py", "copies": "1", "size": "1162", "license": "mit", "hash": -5689258647282490000, "line_mean": 34.2121212121, "line_max": 107, "alpha_frac": 0.756454389, "autogenerated": false, "ratio": 3.8223684210526314, "config_tes...
from django.template.defaulttags import register, Node, NodeList, TemplateSyntaxError from foundation.forms import models from django.db.models import Model def resolve_from_context(context, obj=None): """ Resolve view_controller and, if applicable, in-focus object. In the event an obj is not explicitly ...
{ "repo_name": "altio/foundation", "path": "foundation/templatetags/extratags.py", "copies": "2", "size": "4201", "license": "mit", "hash": -3219966975618134500, "line_mean": 38.6320754717, "line_max": 104, "alpha_frac": 0.6788859795, "autogenerated": false, "ratio": 3.966949952785647, "config_t...
from django.template.defaulttags import token_kwargs from django import template from django.core.urlresolvers import reverse from django.utils.http import urlencode register = template.Library() class OpenIDLoginURLNode(template.Node): def __init__(self, params): self.params = params def render(self...
{ "repo_name": "wd5/jangr", "path": "allauth/openid/templatetags/openid_tags.py", "copies": "6", "size": "1098", "license": "bsd-3-clause", "hash": -5509608580375071000, "line_mean": 29.5, "line_max": 65, "alpha_frac": 0.6111111111, "autogenerated": false, "ratio": 4.159090909090909, "config_tes...
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers from allauth.utils import get_request_param from allauth.compat import template_context_value register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, ...
{ "repo_name": "wli/django-allauth", "path": "allauth/socialaccount/templatetags/socialaccount.py", "copies": "2", "size": "3094", "license": "mit", "hash": -6410794516451236000, "line_mean": 31.5684210526, "line_max": 75, "alpha_frac": 0.636716225, "autogenerated": false, "ratio": 4.1198402130492...
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers from allauth.utils import get_request_param register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var ...
{ "repo_name": "sergiorb/askkit", "path": "allauth/socialaccount/templatetags/socialaccount.py", "copies": "17", "size": "2618", "license": "apache-2.0", "hash": -7867652469160657000, "line_mean": 31.725, "line_max": 75, "alpha_frac": 0.6172650879, "autogenerated": false, "ratio": 4.07788161993769...
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var = template.Variable(provider_id) self...
{ "repo_name": "1st/django-allauth", "path": "allauth/socialaccount/templatetags/socialaccount_tags.py", "copies": "1", "size": "1630", "license": "mit", "hash": 3126605393004173300, "line_mean": 32.2653061224, "line_max": 75, "alpha_frac": 0.6263803681, "autogenerated": false, "ratio": 3.92771084...
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var = template.Variable(provider_id) sel...
{ "repo_name": "HEG-Arc/Appagoo", "path": "appagoo/allauth/socialaccount/templatetags/socialaccount.py", "copies": "4", "size": "2567", "license": "bsd-3-clause", "hash": 4985865035375603000, "line_mean": 31.4936708861, "line_max": 75, "alpha_frac": 0.6131671212, "autogenerated": false, "ratio": 4...
from django.template.defaulttags import token_kwargs from django import template from .. import providers register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var = template.Variable(provider_id) self.params = params ...
{ "repo_name": "houssemFat/bloodOn", "path": "bloodon/accounts/social/templatetags/socialaccount.py", "copies": "1", "size": "2173", "license": "mit", "hash": 1831852976414987500, "line_mean": 31.4328358209, "line_max": 75, "alpha_frac": 0.6244822826, "autogenerated": false, "ratio": 4.03153988868...
from django.template.exceptions import TemplateDoesNotExist from django.template.base import Template, Context from django.template.engine import Engine from django.template.loader import render_to_string from django.core.mail import EmailMultiAlternatives from django.conf import settings import re from inlinestyler....
{ "repo_name": "if-then-fund/django-html-emailer", "path": "htmlemailer/__init__.py", "copies": "1", "size": "5854", "license": "mit", "hash": -1723150144037488000, "line_mean": 38.8231292517, "line_max": 150, "alpha_frac": 0.6744106594, "autogenerated": false, "ratio": 4.076601671309192, "confi...
from django.template import Context, Engine from django.template.base import TextNode, VariableNode from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango40Warning class NodelistTest(SimpleTestCase): @classmethod def setUpClass(cls): cls.engine = ...
{ "repo_name": "wkschwartz/django", "path": "tests/template_tests/test_nodelist.py", "copies": "10", "size": "3268", "license": "bsd-3-clause", "hash": -4913862984483742000, "line_mean": 37.4470588235, "line_max": 97, "alpha_frac": 0.5541615667, "autogenerated": false, "ratio": 4.271895424836601, ...
from django.template import Context, Engine from django.test import SimpleTestCase from ..utils import setup class IfChangedTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'ifchanged01': '{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}'})...
{ "repo_name": "evansd/django", "path": "tests/template_tests/syntax_tests/test_if_changed.py", "copies": "106", "size": "10962", "license": "bsd-3-clause", "hash": 2100069098789357300, "line_mean": 47.72, "line_max": 118, "alpha_frac": 0.5027367269, "autogenerated": false, "ratio": 3.892755681818...
from django.template import Context, Library from django.template.loader import get_template from model_nodes import ModelDetailNode, ModelTeaserNode, ModelListNode register = Library() @register.filter def as_detail_block(instance, title=None): """ Template filter that returns the given instance as a templa...
{ "repo_name": "mjumbewu/django-model-blocks", "path": "model_blocks/templatetags/model_filters.py", "copies": "1", "size": "1416", "license": "bsd-3-clause", "hash": -7657341604909415000, "line_mean": 31.9302325581, "line_max": 80, "alpha_frac": 0.686440678, "autogenerated": false, "ratio": 4.214...
from django.template import Context, Library, Node, TemplateSyntaxError, loader, Variable from django.db import models from django.contrib.admin.filterspecs import FilterSpec from cmsutils.adminfilters import QueryStringManager, MultipleRelatedFilterSpec, FieldAvailabilityValueFilterSpec register = Library() class M...
{ "repo_name": "kaleidos/intranet", "path": "backend/cmsutils/templatetags/modelfilters.py", "copies": "3", "size": "3746", "license": "apache-2.0", "hash": -2300636498390803200, "line_mean": 43.5952380952, "line_max": 125, "alpha_frac": 0.6513614522, "autogenerated": false, "ratio": 4.00641711229...
from django.template import Context, Library, TemplateSyntaxError from django.template.base import FilterExpression, Parser, Template, Token from django.test import SimpleTestCase from tag_parser import template_tag from tag_parser.basetags import BaseNode from tag_parser.tests.templatetags import tag_parser_test_tags...
{ "repo_name": "edoburu/django-tag-parser", "path": "tag_parser/tests/test_tags.py", "copies": "1", "size": "4714", "license": "apache-2.0", "hash": -2018094759637461200, "line_mean": 33.9185185185, "line_max": 90, "alpha_frac": 0.6190072126, "autogenerated": false, "ratio": 3.9447698744769872, ...
from django.template import Context, loader # Create your views here. from django.http import HttpResponse from Oar.models import Poll from django.http import HttpResponse def main(request): return HttpResponse('<html><body>Hello world!</body></html>') def index(request): latest_poll_list = Poll.objects.all(...
{ "repo_name": "DinoV/PTVS", "path": "Python/Tests/TestData/DjangoProject/Oar/views.py", "copies": "3", "size": "1035", "license": "apache-2.0", "hash": 3424858054021233000, "line_mean": 25.5384615385, "line_max": 67, "alpha_frac": 0.6338164251, "autogenerated": false, "ratio": 3.3823529411764706,...
from django.template import Context, loader from django.conf import settings from managers.models import Host, Hypervisor class PxeManager(object): """ Will create all pxelinux.cfg files for hosts that are in status "SCHEDULED" """ def __init__(self): super(PxeManager, self).__init__() d...
{ "repo_name": "vmworld-hackathon-2017/barcelona-team-3", "path": "h5pxe-app/managers/pxe.py", "copies": "1", "size": "1373", "license": "mit", "hash": 8801280818682550000, "line_mean": 30.9302325581, "line_max": 92, "alpha_frac": 0.5200291333, "autogenerated": false, "ratio": 4.038235294117647, ...
from django.template import Context, loader from django.conf import settings from managers.models import Host class DhcpManager(object): """ Will manage creation of dhcp server config file for hosts that are in status "SCHEDULED" """ configType = "PXE" def __init__(self): super(DhcpM...
{ "repo_name": "vmworld-hackathon-2017/barcelona-team-3", "path": "h5pxe-app/managers/dhcp.py", "copies": "1", "size": "1319", "license": "mit", "hash": 6004953152893654000, "line_mean": 22.5535714286, "line_max": 73, "alpha_frac": 0.553449583, "autogenerated": false, "ratio": 4.04601226993865, ...
from django.template import Context, loader from django.http import HttpResponse, Http404 from django.shortcuts import render_to_response from django.core.paginator import Paginator from django.core.mail import send_mail from storitell.stories.models import Story from django.template import RequestContext from storitel...
{ "repo_name": "esten/StoriTell", "path": "StoriTell/stories/ajax.py", "copies": "1", "size": "3696", "license": "bsd-3-clause", "hash": -4543015908551177700, "line_mean": 29.5454545455, "line_max": 73, "alpha_frac": 0.7094155844, "autogenerated": false, "ratio": 3.164383561643836, "config_test"...
from django.template import Context, loader from django.http import HttpResponse, Http404, QueryDict from django.core.exceptions import ObjectDoesNotExist from django.utils import simplejson as json from django.views.generic.detail import View, BaseDetailView, SingleObjectTemplateResponseMixin from django.views.generic...
{ "repo_name": "Bionetbook/bionetbook", "path": "bnbapp/bionetbook/api/views.py", "copies": "2", "size": "18932", "license": "mit", "hash": -467969125810548000, "line_mean": 34.6534839925, "line_max": 340, "alpha_frac": 0.5834565814, "autogenerated": false, "ratio": 3.772066148635186, "config_te...
from django.template import Context, loader from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render_to_response, redirect from django.core.paginator import Paginator from storitell.stories.models import Story from django.template import RequestContext from django.template...
{ "repo_name": "esten/StoriTell", "path": "StoriTell/stories/views.py", "copies": "1", "size": "2563", "license": "bsd-3-clause", "hash": -2383395805801943600, "line_mean": 43.1896551724, "line_max": 123, "alpha_frac": 0.6984003121, "autogenerated": false, "ratio": 3.671919770773639, "config_tes...
from django.template import Context, loader from django.http import HttpResponse, HttpResponseRedirect from django import forms from baseApp.models import * from django.contrib.auth import authenticate, login, logout from django.shortcuts import render_to_response from django.views.decorators.csrf import csrf_exempt fr...
{ "repo_name": "makacodewalker/etsgh", "path": "payment/views.py", "copies": "1", "size": "2649", "license": "bsd-3-clause", "hash": -729860396751727000, "line_mean": 36.8428571429, "line_max": 92, "alpha_frac": 0.6738391846, "autogenerated": false, "ratio": 3.704895104895105, "config_test": fal...
from django.template import Context, loader from django.http import HttpResponse, HttpResponseRedirect from django import forms #from django import oldforms as forms from django.contrib.auth import authenticate, login, logout from django.contrib.auth.forms import * from django.shortcuts import render_to_response, rende...
{ "repo_name": "makacodewalker/etsgh", "path": "reg/views.py", "copies": "1", "size": "2932", "license": "bsd-3-clause", "hash": 6722554713354711000, "line_mean": 44.1076923077, "line_max": 146, "alpha_frac": 0.7042974079, "autogenerated": false, "ratio": 3.847769028871391, "config_test": false,...
from django.template import Context, loader from django.http import HttpResponse from django.forms import ModelForm #LAB06 from models import Blog, Comment from django.views.decorators.csrf import csrf_exempt #LAB06 # For templates lab from django.shortcuts import * def blog_list(request): blog_list = ...
{ "repo_name": "theicfire/djangofun", "path": "blog/views.py", "copies": "1", "size": "2419", "license": "bsd-3-clause", "hash": 8796305368092143000, "line_mean": 33.0704225352, "line_max": 94, "alpha_frac": 0.6676312526, "autogenerated": false, "ratio": 3.6540785498489425, "config_test": false,...
from django.template import Context, loader from django.http import HttpResponse from django.shortcuts import render_to_response, get_object_or_404 from aquaticore.articles.models import Article from django.http import HttpResponseRedirect from django import forms import datetime def index(request): latest_article...
{ "repo_name": "rockerBOO/aquaticore", "path": "aquaticore/articles/views.py", "copies": "1", "size": "1336", "license": "mit", "hash": -2749063666439409000, "line_mean": 35.1351351351, "line_max": 115, "alpha_frac": 0.7208083832, "autogenerated": false, "ratio": 3.7633802816901407, "config_test...
from django.template import Context, loader from django.http import HttpResponse from models import Blog, Comment from django.template import Context, loader from django.forms import ModelForm from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponseRedirect def blog_list(request, limi...
{ "repo_name": "Agana/MyBlogAgain", "path": "blog/views.py", "copies": "1", "size": "2474", "license": "bsd-3-clause", "hash": 958194547145216800, "line_mean": 29.5432098765, "line_max": 97, "alpha_frac": 0.7332255457, "autogenerated": false, "ratio": 3.2088197146562907, "config_test": false, ...
from django.template import Context, loader from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.contrib.auth import login as auth from django.contrib.auth.models import User from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from dj...
{ "repo_name": "fardog/deej", "path": "app/deej/views.py", "copies": "1", "size": "1444", "license": "bsd-3-clause", "hash": 802337152634638700, "line_mean": 33.380952381, "line_max": 108, "alpha_frac": 0.7126038781, "autogenerated": false, "ratio": 4.044817927170868, "config_test": false, "ha...
from django.template import Context, loader from django.template.defaultfilters import striptags from six import iteritems from elasticsearch_dsl.analysis import Analyzer class AbstractField(object): ''' Represents an elasticsearch index field and values from given objects. Currently does not support bin...
{ "repo_name": "afrancis13/bungiesearch", "path": "bungiesearch/fields.py", "copies": "1", "size": "6069", "license": "bsd-3-clause", "hash": 7080116427761674000, "line_mean": 36.006097561, "line_max": 201, "alpha_frac": 0.6070192783, "autogenerated": false, "ratio": 4.282992237120678, "config_t...
from django.template import Context, loader from django.template.loader import render_to_string from django.core.urlresolvers import reverse NAVIGATIONBARS = {} class NavigationManager: _storage = {} def __init__(self, storage=None): if storage : self.storage = storage else : self.storage = NAVIGATIONBAR...
{ "repo_name": "airtonix/django-navigation-manager", "path": "django_navigation_manager/lib/manager.py", "copies": "1", "size": "1834", "license": "mit", "hash": -1133204619428941400, "line_mean": 19.3777777778, "line_max": 56, "alpha_frac": 0.6564885496, "autogenerated": false, "ratio": 2.9869706...
from django.template import Context, loader from django.utils.http import is_safe_url from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings from django.contrib.auth import authenticate, login, logout from django.core.context_processors import csrf from mobility.decorators import mo...
{ "repo_name": "uw-it-aca/spacescout_web", "path": "spacescout_web/views/auth.py", "copies": "1", "size": "1496", "license": "apache-2.0", "hash": 8445898055030108000, "line_mean": 28.92, "line_max": 74, "alpha_frac": 0.6945187166, "autogenerated": false, "ratio": 3.989333333333333, "config_test...
from django.template import Context, loader from orgchartapp.models import Employee, ReportingRelationship from django.http import HttpResponse from django.db.models import Q from django.contrib.auth.decorators import login_required # Create your views here. def homepage(request): t = loader.get_template('orgchart/h...
{ "repo_name": "rajivpant/employeeware", "path": "orgchartapp/views.py", "copies": "1", "size": "1522", "license": "mit", "hash": 1217147423447654000, "line_mean": 34.3953488372, "line_max": 170, "alpha_frac": 0.7601839685, "autogenerated": false, "ratio": 3.352422907488987, "config_test": false...
from django.template import Context, loader from post_office import mail from post_office.models import PRIORITY from seahub.utils import get_site_scheme_and_netloc from seahub.settings import SITE_NAME, MEDIA_URL, LOGO_PATH MAIL_PRIORITY = PRIORITY # 'low medium high now' def send_html_email_with_dj_template...
{ "repo_name": "saukrIppl/seahub", "path": "seahub/utils/mail.py", "copies": "1", "size": "1208", "license": "apache-2.0", "hash": -1137182457496161000, "line_mean": 31.6486486486, "line_max": 76, "alpha_frac": 0.5943708609, "autogenerated": false, "ratio": 3.9867986798679866, "config_test": fal...
from django.template import Context, loader from projects.models import Project from django.http import HttpResponse, Http404, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404, render from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.utils import...
{ "repo_name": "tomshen/penn-projects", "path": "projects/views.py", "copies": "1", "size": "2477", "license": "apache-2.0", "hash": 1922142375960460800, "line_mean": 37.1076923077, "line_max": 105, "alpha_frac": 0.6003229713, "autogenerated": false, "ratio": 3.9951612903225806, "config_test": f...
from django.template import Context, loader from django.http import HttpResponse from django.http.response import HttpResponseRedirect from articles.models import Article, ArticleEntity # Create your views here. def index(request): t = loader.get_template('index.html') article_list = Article.objects.all().o...
{ "repo_name": "ThetaTauMiami/ThetaTauMiami-old", "path": "marketing/views.py", "copies": "1", "size": "1315", "license": "apache-2.0", "hash": 5347773912266641000, "line_mean": 28.9090909091, "line_max": 112, "alpha_frac": 0.6828897338, "autogenerated": false, "ratio": 3.6225895316804406, "conf...
from django.template import Context, loader from endless_pagination import settings, utils # preload page templates PAGE_TEMPLATE = loader.get_template("endless/page_link.html") CURRENT_TEMPLATE = loader.get_template("endless/current_link.html") class EndlessPage(object): """ A page link representation. ...
{ "repo_name": "inactivist/django-endless-pagination", "path": "endless_pagination/models.py", "copies": "6", "size": "6222", "license": "mit", "hash": 1520327525233415700, "line_mean": 36.0357142857, "line_max": 96, "alpha_frac": 0.575056252, "autogenerated": false, "ratio": 4.4158977998580555, ...
from django.template import Context, loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect from aquaticore.fish.models import * from django.shortcuts import render_to_response, get_object_or_404 from datetime import datetime from math import * from flickrapi import FlickrAPI from django.core...
{ "repo_name": "rockerBOO/aquaticore", "path": "aquaticore/fish/views.py", "copies": "1", "size": "9620", "license": "mit", "hash": -1709559151400428000, "line_mean": 26.1779661017, "line_max": 145, "alpha_frac": 0.682016632, "autogenerated": false, "ratio": 2.8742157155661787, "config_test": fa...
from django.template import Context, loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from aquaticore.aquariums.models import Aquarium # from aquaticore.fish.models import FishOrigin from django.http import HttpResponseR...
{ "repo_name": "rockerBOO/aquaticore", "path": "aquaticore/aquariums/views.py", "copies": "1", "size": "1377", "license": "mit", "hash": 3585434313817535000, "line_mean": 35.2631578947, "line_max": 142, "alpha_frac": 0.7189542484, "autogenerated": false, "ratio": 3.0532150776053215, "config_test...
from django.template import Context, loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.core.mail ...
{ "repo_name": "godber/crunch.io-dashboard", "path": "cluster/views.py", "copies": "1", "size": "12506", "license": "mit", "hash": 8703665736769021000, "line_mean": 35.6744868035, "line_max": 149, "alpha_frac": 0.5518950904, "autogenerated": false, "ratio": 4.4284702549575075, "config_test": fal...
from django.template import Context, loader, RequestContext from pfam_maps.models import PfamMaps, ValidDomains from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect, StreamingHttpResponse from django.s...
{ "repo_name": "fak/pfam_maps", "path": "views.py", "copies": "1", "size": "25336", "license": "apache-2.0", "hash": 7001373237028260000, "line_mean": 35.1426533524, "line_max": 134, "alpha_frac": 0.6154483739, "autogenerated": false, "ratio": 3.491730981256891, "config_test": false, "has_no_k...
from django.template import Context, loader # Create your views here. from django.http import HttpResponse from Oar.models import Poll from django.http import HttpResponse def main(request): return HttpResponse('<html><body>Hello world!</body></html>') def index(request): latest_poll_list = Poll.o...
{ "repo_name": "fjxhkj/PTVS", "path": "Python/Tests/TestData/DjangoProject/Oar/views.py", "copies": "18", "size": "1074", "license": "apache-2.0", "hash": -6062201386366055000, "line_mean": 25.5384615385, "line_max": 67, "alpha_frac": 0.6108007449, "autogenerated": false, "ratio": 3.47572815533980...
from django.template import Context, loader, Template from django.http import HttpResponse from managers.models import Host, Kickstart, Script from managers.dhcp import DhcpManager from managers.pxe import PxeManager from managers.service import ServiceManager def hostname(request, hostname): print "Kickstart...
{ "repo_name": "vmworld-hackathon-2017/barcelona-team-3", "path": "h5pxe-app/web/kickstarts.py", "copies": "1", "size": "2006", "license": "mit", "hash": 8254189951123780000, "line_mean": 23.7654320988, "line_max": 77, "alpha_frac": 0.6031904287, "autogenerated": false, "ratio": 4.127572016460905,...
from django.template import Context from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from html2text import html2text from tardis.tardis_portal.models import ExperimentParameter, ExperimentParameterSet, ParameterName, Schema from tardis.tardis_portal.Parame...
{ "repo_name": "pansapiens/mytardis", "path": "tardis/tardis_portal/publish/provider/schemarifcsprovider.py", "copies": "3", "size": "8175", "license": "bsd-3-clause", "hash": 2435116371694636500, "line_mean": 41.3575129534, "line_max": 110, "alpha_frac": 0.6409785933, "autogenerated": false, "rat...
from django.template import Context from django.http import Http404, HttpResponse from core.models import Engine from core.decorators import json_response from django.core.mail import EmailMessage import simplejson @json_response def send_info(request): json_data = { 'success': False, 'error': ''...
{ "repo_name": "MattBlack85/dunning-cruncher", "path": "utils/dev_sendmail.py", "copies": "1", "size": "2638", "license": "bsd-3-clause", "hash": -1316118248184720100, "line_mean": 23.4259259259, "line_max": 89, "alpha_frac": 0.5727824109, "autogenerated": false, "ratio": 3.7631954350927246, "co...
from django.template import Context from django.http import Http404, HttpResponse from core.models import Engine, TrackingForm, StoredDocs, StoredForm, Vendor from reminders.models import RemindersTable from core.decorators import json_response from django.core.mail import EmailMessage from utils.sendmail import ne...
{ "repo_name": "MattBlack85/dunning-cruncher", "path": "utils/tracking_utils.py", "copies": "1", "size": "6669", "license": "bsd-3-clause", "hash": -9151813938450462000, "line_mean": 23.7918215613, "line_max": 76, "alpha_frac": 0.5940920678, "autogenerated": false, "ratio": 3.6244565217391305, "...
from django.template import Context from django.template.defaultfilters import slugify from django.template.loader import get_template from generate_scaffold.generators.base import BaseGenerator from generate_scaffold.utils.directories import get_templates_in_dir class UrlsGenerator(BaseGenerator): # FIXME - Ac...
{ "repo_name": "noslenfa/tdjangorest", "path": "uw/lib/python2.7/site-packages/generate_scaffold/generators/urls.py", "copies": "1", "size": "1743", "license": "apache-2.0", "hash": -890507893594481000, "line_mean": 35.3125, "line_max": 73, "alpha_frac": 0.6161790017, "autogenerated": false, "rati...
from django.template import Context from django.template import loader from django.http import Http404 from django.http import HttpResponse from django.shortcuts import render_to_response from django.conf import settings from django.core import serializers from django.http import HttpResponsePermanentRedirect from djan...
{ "repo_name": "ataka-team/django-r66", "path": "r66/helpers.py", "copies": "1", "size": "1499", "license": "mit", "hash": 7859742153652546000, "line_mean": 23.5737704918, "line_max": 56, "alpha_frac": 0.6704469646, "autogenerated": false, "ratio": 3.9867021276595747, "config_test": false, "ha...
from django.template import Context from django.template import RequestContext from django.template import loader from django.http import Http404 from django.http import HttpResponse from django.shortcuts import render_to_response from django.shortcuts import redirect from django.core import serializers from django.ht...
{ "repo_name": "ataka-team/django-r66", "path": "r66/views.py", "copies": "1", "size": "8677", "license": "mit", "hash": 3880095094050217000, "line_mean": 29.0242214533, "line_max": 100, "alpha_frac": 0.6363950674, "autogenerated": false, "ratio": 3.858159181858604, "config_test": false, "has_...
from django.template import Context from django.template import Template from django.template import TemplateDoesNotExist from django.test import TestCase from stream_django.enrich import EnrichedActivity from stream_django.exceptions import MissingDataException simple_template = """ {%% load activity_tags %%} {%% fo...
{ "repo_name": "GetStream/stream-django", "path": "stream_django/tests/test_app/tests/test_template_tag.py", "copies": "1", "size": "2945", "license": "bsd-3-clause", "hash": -132041242299652380, "line_mean": 40.4788732394, "line_max": 95, "alpha_frac": 0.666893039, "autogenerated": false, "ratio"...
from django.template import Context from django.template.loader import get_template_from_string from pretend import stub, call_recorder, call from static_precompiler.templatetags.compile_static import compile_tag def test_compile_tag(monkeypatch): monkeypatch.setattr("static_precompiler.templatetags.compile_stat...
{ "repo_name": "paera/django-static-precompiler", "path": "static_precompiler/tests/test_templatetags.py", "copies": "1", "size": "1579", "license": "mit", "hash": 1586931351443097300, "line_mean": 45.4411764706, "line_max": 116, "alpha_frac": 0.7314756175, "autogenerated": false, "ratio": 3.88916...
from django.template import Context from django.template.loader import get_template from django.core.mail import EmailMultiAlternatives from django.conf import settings class EmailInfo(object): def __init__(self, text_template=None, html_template=None, subject=None, to_address=None, from_addres...
{ "repo_name": "kave/collab", "path": "core/notifications/email.py", "copies": "5", "size": "1416", "license": "cc0-1.0", "hash": -4673355716066732000, "line_mean": 30.4666666667, "line_max": 96, "alpha_frac": 0.6765536723, "autogenerated": false, "ratio": 3.911602209944751, "config_test": false...
from django.template import Context from django.template.loader import get_template from django import template register = template.Library() @register.filter def bootstrap(element): element_type = element.__class__.__name__.lower() if element_type == 'boundfield': template = get_template("bootstrapf...
{ "repo_name": "imposeren/django-bootstrap-form", "path": "bootstrapform_too/templatetags/bootstrap_any.py", "copies": "1", "size": "1690", "license": "bsd-3-clause", "hash": 6235539843176089000, "line_mean": 32.137254902, "line_max": 79, "alpha_frac": 0.6520710059, "autogenerated": false, "ratio"...
from django.template import Context from django.template.loader import get_template from django import template register = template.Library() @register.filter def bootstrap(element): markup_classes = {'label': '', 'value': '', 'single_value': ''} return render(element, markup_classes) @register.filter def b...
{ "repo_name": "pistatium/houkago_app", "path": "server_appengine/app/libs/bootstrapform/templatetags/bootstrap.py", "copies": "2", "size": "3025", "license": "apache-2.0", "hash": 3880026672624853000, "line_mean": 30.8421052632, "line_max": 90, "alpha_frac": 0.6099173554, "autogenerated": false, ...