text
stringlengths
0
1.05M
meta
dict
from django.utils.translation import gettext_lazy as _ from django_filters.filters import ModelMultipleChoiceFilter import django_filters.rest_framework from django.db.models import Q from geotrek.authent.filters import StructureRelatedFilterSet from django import forms from django.utils.datetime_safe import datetime ...
{ "repo_name": "GeotrekCE/Geotrek-admin", "path": "geotrek/tourism/filters.py", "copies": "2", "size": "2977", "license": "bsd-2-clause", "hash": -6134883057525036000, "line_mean": 30.0104166667, "line_max": 98, "alpha_frac": 0.682566342, "autogenerated": false, "ratio": 4.044836956521739, "conf...
from django.utils.translation import gettext_lazy as _ from django_filters import RangeFilter, Filter, ModelMultipleChoiceFilter class OptionalRangeFilter(RangeFilter): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.field.fields[0].label = _('min %s') % self.field.lab...
{ "repo_name": "GeotrekCE/Geotrek-admin", "path": "geotrek/common/filters.py", "copies": "2", "size": "1294", "license": "bsd-2-clause", "hash": 3189558078612081000, "line_mean": 31.35, "line_max": 100, "alpha_frac": 0.6128284389, "autogenerated": false, "ratio": 3.8058823529411763, "config_test...
from django.utils.translation import gettext_lazy as _ from dynamic_preferences.types import BooleanPreference, StringPreference, Section from dynamic_preferences.registries import global_preferences_registry # we create some section objects to link related preferences together registration = Section('registration',...
{ "repo_name": "django-danceschool/django-danceschool", "path": "danceschool/banlist/dynamic_preferences_registry.py", "copies": "1", "size": "1654", "license": "bsd-3-clause", "hash": 8822983006422935000, "line_mean": 34.1914893617, "line_max": 90, "alpha_frac": 0.7170495768, "autogenerated": false...
from django.utils.translation import gettext_lazy as _ from mapentity.filters import MapEntityFilterSet from geotrek.common.models import Organism from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet from geotrek.infrastructure.filters import InfrastructureFilterSet from geotrek.signage.fil...
{ "repo_name": "makinacorpus/Geotrek", "path": "geotrek/land/filters.py", "copies": "1", "size": "3399", "license": "bsd-2-clause", "hash": -8253387954804864000, "line_mean": 29.6216216216, "line_max": 107, "alpha_frac": 0.7666960871, "autogenerated": false, "ratio": 3.7066521264994545, "config_...
from django.utils.translation import gettext_lazy as _ from .models import TouristicContent, TouristicEvent from geotrek.common.forms import CommonForm from crispy_forms.layout import Div class TouristicContentForm(CommonForm): geomfields = ['geom'] fieldslayout = [ Div( 'structure', ...
{ "repo_name": "makinacorpus/Geotrek", "path": "geotrek/tourism/forms.py", "copies": "1", "size": "3231", "license": "bsd-2-clause", "hash": -7045847816057210000, "line_mean": 30.9900990099, "line_max": 95, "alpha_frac": 0.49272671, "autogenerated": false, "ratio": 4.131713554987212, "config_tes...
from django.utils.translation import gettext_lazy as _ from .registries import model_templates_registry, ModelTemplateBase from .models import Series, PublicEvent @model_templates_registry.register class BaseEventTemplate(ModelTemplateBase): model = PublicEvent template_name = 'core/event_pages/individual_ev...
{ "repo_name": "django-danceschool/django-danceschool", "path": "danceschool/core/model_templates.py", "copies": "1", "size": "1055", "license": "bsd-3-clause", "hash": 956763240054904000, "line_mean": 31.96875, "line_max": 67, "alpha_frac": 0.7763033175, "autogenerated": false, "ratio": 4.2369477...
from django.utils.translation import gettext_lazy as _ from shop.conf import app_settings from shop.serializers.cart import ExtraCartRow from shop.modifiers.base import BaseCartModifier class CartIncludeTaxModifier(BaseCartModifier): """ This tax calculator presumes that unit prices are net prices, hence als...
{ "repo_name": "awesto/django-shop", "path": "shop/modifiers/taxes.py", "copies": "1", "size": "2034", "license": "bsd-3-clause", "hash": 4526814814057928700, "line_mean": 35.3214285714, "line_max": 92, "alpha_frac": 0.6386430678, "autogenerated": false, "ratio": 3.8233082706766917, "config_test...
from django.utils.translation import gettext_lazy as _ from shop.modifiers.base import BaseCartModifier from shop.payment.providers import PaymentProvider, ForwardFundPayment class PaymentModifier(BaseCartModifier): """ Base class for all payment modifiers. The purpose of a payment modifier is to calculate t...
{ "repo_name": "awesto/django-shop", "path": "shop/payment/modifiers.py", "copies": "1", "size": "3515", "license": "bsd-3-clause", "hash": -2753174086863108600, "line_mean": 40.8452380952, "line_max": 120, "alpha_frac": 0.6714082504, "autogenerated": false, "ratio": 4.724462365591398, "config_t...
from django.utils.translation import gettext_lazy as _ from wagtail.core import hooks class LogActionRegistry: """ A central store for log actions. The expected format for registered log actions: Namespaced action, Action label, Action message (or callable) """ def __init__(self, hook_name): ...
{ "repo_name": "wagtail/wagtail", "path": "wagtail/core/log_actions.py", "copies": "4", "size": "2713", "license": "bsd-3-clause", "hash": -5968425350108540000, "line_mean": 30.183908046, "line_max": 115, "alpha_frac": 0.6111315886, "autogenerated": false, "ratio": 4.141984732824428, "config_tes...
from django.utils.translation import gettext_lazy as _ # Built-in Licenses class _LicenseBase(object): """Base class for built-in licenses.""" icons = '' # CSS classes. See zamboni.css for a list. some_rights = True on_form = True creative_commons = True class LICENSE_COPYRIGHT(_LicenseBase): ...
{ "repo_name": "diox/olympia", "path": "src/olympia/constants/licenses.py", "copies": "4", "size": "2280", "license": "bsd-3-clause", "hash": 6024245146130984000, "line_mean": 24.0549450549, "line_max": 76, "alpha_frac": 0.6469298246, "autogenerated": false, "ratio": 3.011889035667107, "config_t...
from django.utils.translation import gettext_lazy as _ CUSTOMS = 1 WAT = 2 YARA = 3 MAD = 4 SCANNERS = {CUSTOMS: 'customs', WAT: 'wat', YARA: 'yara', MAD: 'mad'} # Action IDs are also used for severity (the higher, the more severe). # The field is a PositiveSmallIntegerField, it should go up to 65535. NO_ACTION = 1...
{ "repo_name": "mozilla/addons-server", "path": "src/olympia/constants/scanners.py", "copies": "2", "size": "1587", "license": "bsd-3-clause", "hash": 8801655140756568000, "line_mean": 24.5967741935, "line_max": 83, "alpha_frac": 0.6805293006, "autogenerated": false, "ratio": 2.8698010849909585, ...
from django.utils.translation import gettext_lazy as _ HOUSING_STATUS_RENT = "Rent" HOUSING_STATUS_OWN = "Own" HOUSING_STATUS_OTHER = "Other" HOUSING_STATUSES = ( (HOUSING_STATUS_RENT, _("Rent")), (HOUSING_STATUS_OWN, _("Own")), (HOUSING_STATUS_OTHER, _("Other")), ) ENGLISH, SPANISH = ("E", "S") LANGUAGE...
{ "repo_name": "thelabnyc/django-oscar-wfrs", "path": "src/wellsfargo/core/constants.py", "copies": "1", "size": "8087", "license": "isc", "hash": -3744120213076727300, "line_mean": 35.4279279279, "line_max": 136, "alpha_frac": 0.6765178682, "autogenerated": false, "ratio": 3.001855976243504, "c...
from django.utils.translation import gettext_lazy as _ # Reviewer Tools REVIEWER_VIEWING_INTERVAL = 8 # How often we ping for "who's watching?" REVIEWER_REVIEW_LOCK_LIMIT = 3 # How many pages can a reviewer "watch" # Default delayed rejection period in days REVIEWER_DELAYED_REJECTION_PERIOD_DAYS_DEFAULT = 14 # Ty...
{ "repo_name": "mozilla/olympia", "path": "src/olympia/constants/reviewers.py", "copies": "4", "size": "7217", "license": "bsd-3-clause", "hash": -1038456533006716500, "line_mean": 33.0424528302, "line_max": 79, "alpha_frac": 0.6860191215, "autogenerated": false, "ratio": 2.9077356970185333, "co...
from django.utils.translation import gettext_lazy as _, override from cms.menu_bases import CMSAttachMenu from menus.base import NavigationNode from menus.menu_pool import menu_pool class CatalogMenu(CMSAttachMenu): name = _("Catalog Menu") def get_nodes(self, request): try: if self.inst...
{ "repo_name": "awesto/django-shop", "path": "shop/cms_menus.py", "copies": "1", "size": "1114", "license": "bsd-3-clause", "hash": 2955149461151334400, "line_mean": 33.8125, "line_max": 80, "alpha_frac": 0.5978456014, "autogenerated": false, "ratio": 4.491935483870968, "config_test": false, "...
from django.utils.translation import gettext_lazy from cradmin_legacy.viewhelpers import listbuilder from cradmin_legacy.viewhelpers import listbuilderview from devilry.apps.core.models import RelatedExaminer from devilry.devilry_admin.cradminextensions.listfilter import listfilter_relateduser from devilry.apps.core.m...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_admin/cradminextensions/listbuilder/listbuilder_relatedexaminer.py", "copies": "1", "size": "3256", "license": "bsd-3-clause", "hash": -1787872873989724200, "line_mean": 36, "line_max": 110, "alpha_frac": 0.7306511057, "autogenerated"...
from django.utils.translation import gettext_lazy from cradmin_legacy.viewhelpers import listbuilder from cradmin_legacy.viewhelpers import multiselect2 from devilry.apps.core.models import Assignment class FullyAnonymousSubjectAdminItemValueMixin(object): valuealias = 'group' def __init__(self, *args, **kw...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_cradmin/devilry_listbuilder/assignmentgroup.py", "copies": "1", "size": "12047", "license": "bsd-3-clause", "hash": -6535461805271427000, "line_mean": 33.42, "line_max": 117, "alpha_frac": 0.7203453142, "autogenerated": false, "rati...
from django.utils.translation import gettext_lazy from cradmin_legacy.viewhelpers.listbuilder.itemvalue import TitleDescription from cradmin_legacy.viewhelpers.listbuilder.lists import RowList from cradmin_legacy.viewhelpers.listbuilder.itemframe import DefaultSpacingItemFrame class WithResultValueRenderable(TitleDes...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_cradmin/devilry_listfilter/utils.py", "copies": "1", "size": "2493", "license": "bsd-3-clause", "hash": 410069336727609340, "line_mean": 35.6617647059, "line_max": 111, "alpha_frac": 0.6618531889, "autogenerated": false, "ratio": 3....
from django.utils.translation import gettext_lazy from wagtail.admin import messages from wagtail.admin.views import generic from wagtail.admin.viewsets.model import ModelViewSet from wagtail.core.models import Locale from wagtail.core.permissions import locale_permission_policy from .forms import LocaleForm from .ut...
{ "repo_name": "FlipperPA/wagtail", "path": "wagtail/locales/views.py", "copies": "1", "size": "2697", "license": "bsd-3-clause", "hash": -92205716181313260, "line_mean": 33.1392405063, "line_max": 128, "alpha_frac": 0.6948461253, "autogenerated": false, "ratio": 3.931486880466472, "config_test"...
from django.utils.translation import gettext_lazy from wagtail.admin.views import generic from wagtail.admin.viewsets.model import ModelViewSet from wagtail.core.models import Site from wagtail.core.permissions import site_permission_policy from wagtail.sites.forms import SiteForm class IndexView(generic.IndexView):...
{ "repo_name": "torchbox/wagtail", "path": "wagtail/sites/views.py", "copies": "10", "size": "1529", "license": "bsd-3-clause", "hash": 1070777655897730800, "line_mean": 30.8541666667, "line_max": 85, "alpha_frac": 0.7220405494, "autogenerated": false, "ratio": 3.8034825870646767, "config_test":...
from django.utils.translation import gettext_lazy import django_rq from cradmin_legacy.crinstance import reverse_cradmin_url from devilry.devilry_message.models import Message from devilry.devilry_message.utils.subject_generator import SubjectTextGenerator from devilry.devilry_email.utils import get_student_users_in_...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_email/deadline_email/deadline_email.py", "copies": "1", "size": "6283", "license": "bsd-3-clause", "hash": 2152096861338754300, "line_mean": 40.3355263158, "line_max": 121, "alpha_frac": 0.6608308133, "autogenerated": false, "ratio"...
from django.utils.translation import gettext from olympia import amo from olympia.files.utils import RDFExtractor, SafeZip, get_file def insert_validation_message( results, type_='error', message='', msg_id='', compatibility_type=None, description=None, ): if description is None: ...
{ "repo_name": "diox/olympia", "path": "src/olympia/devhub/file_validation_annotations.py", "copies": "4", "size": "3758", "license": "bsd-3-clause", "hash": 1381520196538725600, "line_mean": 32.8558558559, "line_max": 79, "alpha_frac": 0.642362959, "autogenerated": false, "ratio": 3.8862461220268...
from django.utils.translation import gettext from rest_framework import serializers from olympia.activity.models import ActivityLog from olympia.api.utils import is_gate_active class ActivityLogSerializer(serializers.ModelSerializer): action = serializers.SerializerMethodField() action_label = serializers.S...
{ "repo_name": "mozilla/addons-server", "path": "src/olympia/activity/serializers.py", "copies": "4", "size": "2053", "license": "bsd-3-clause", "hash": 6924176985618512000, "line_mean": 32.6557377049, "line_max": 78, "alpha_frac": 0.6273745738, "autogenerated": false, "ratio": 4.313025210084033, ...
from django.utils.translation import LANGUAGE_SESSION_KEY, ugettext_lazy as _ from django.utils.six import iteritems from django.db import models from django.conf import settings from timezone_field import TimeZoneField # noinspection PyProtectedMember from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE import ...
{ "repo_name": "erigones/esdc-ce", "path": "gui/models/userprofile.py", "copies": "1", "size": "8193", "license": "apache-2.0", "hash": -3667443447117463000, "line_mean": 42.8128342246, "line_max": 120, "alpha_frac": 0.656414012, "autogenerated": false, "ratio": 3.9389423076923076, "config_test"...
from django.utils.translation import ngettext_lazy, gettext_lazy as _ from froide.helper.email_sending import mail_registry from .utils import send_request_user_email update_requester_email = mail_registry.register( 'foirequest/emails/request_update', ('count', 'user', 'request_list') ) classification_remin...
{ "repo_name": "stefanw/froide", "path": "froide/foirequest/notifications.py", "copies": "1", "size": "1744", "license": "mit", "hash": 2074675626446260700, "line_mean": 25.8307692308, "line_max": 69, "alpha_frac": 0.6072247706, "autogenerated": false, "ratio": 3.849889624724062, "config_test": ...
from django.utils.translation import ngettext from django.utils.translation import gettext_lazy as _ from django import template import re register = template.Library() def ordinal(value): """ Converts an integer to its ordinal as a string. 1 is '1st', 2 is '2nd', 3 is '3rd', etc. Works for any integer. ...
{ "repo_name": "illicitonion/givabit", "path": "lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_0_96/django/contrib/humanize/templatetags/humanize.py", "copies": "32", "size": "2363", "license": "apache-2.0", "hash": -1317504534999819500, "line_mean": 33.2463768116, "line_max": 119, "alpha...
from django.utils.translation import npgettext, pgettext_lazy from django_filters import CharFilter, OrderingFilter from ...core.filters import SortedFilterSet from ...page.models import Page SORT_BY_FIELDS = { 'title': pgettext_lazy('Page list sorting option', 'title'), 'url': pgettext_lazy('Page list sortin...
{ "repo_name": "UITools/saleor", "path": "saleor/dashboard/page/filters.py", "copies": "2", "size": "1172", "license": "bsd-3-clause", "hash": 8245816516055297000, "line_mean": 33.4705882353, "line_max": 73, "alpha_frac": 0.6450511945, "autogenerated": false, "ratio": 4.126760563380282, "config_...
from django.utils.translation import npgettext, pgettext_lazy from django_filters import CharFilter, OrderingFilter from ...core.filters import SortedFilterSet from ...product.models import Category SORT_BY_FIELDS = { 'name': pgettext_lazy('Category list sorting option', 'name'), 'description': pgettext_lazy(...
{ "repo_name": "UITools/saleor", "path": "saleor/dashboard/category/filters.py", "copies": "3", "size": "1112", "license": "bsd-3-clause", "hash": -2726041260542777000, "line_mean": 33.75, "line_max": 77, "alpha_frac": 0.660971223, "autogenerated": false, "ratio": 4.36078431372549, "config_test"...
from django.utils.translation import npgettext, pgettext_lazy from django_filters import ModelMultipleChoiceFilter, OrderingFilter from ...account.models import User from ...core.permissions import get_permissions from ..customer.filters import UserFilter from ..forms import PermissionMultipleChoiceField SORT_BY_FIEL...
{ "repo_name": "UITools/saleor", "path": "saleor/dashboard/staff/filters.py", "copies": "1", "size": "1662", "license": "bsd-3-clause", "hash": -8345431065177255000, "line_mean": 34.3617021277, "line_max": 77, "alpha_frac": 0.6823104693, "autogenerated": false, "ratio": 4.316883116883117, "confi...
from django.utils.translation import npgettext, pgettext_lazy from django_filters import ( CharFilter, ChoiceFilter, OrderingFilter, RangeFilter) from ...core.filters import SortedFilterSet from ...core.i18n import COUNTRY_CODE_CHOICES from ...shipping.models import ShippingZone SORT_BY_FIELDS = { 'name': pge...
{ "repo_name": "UITools/saleor", "path": "saleor/dashboard/shipping/filters.py", "copies": "1", "size": "1529", "license": "bsd-3-clause", "hash": -7609283221091026000, "line_mean": 35.4047619048, "line_max": 76, "alpha_frac": 0.6533682145, "autogenerated": false, "ratio": 4.166212534059945, "co...
from django.utils.translation import pgettext as pgettext_real, npgettext as npgettext_real from jinja2.ext import InternationalizationExtension from jinja2.utils import contextfunction, Markup from puente.utils import collapse_whitespace @contextfunction def pgettext(__context, context, message, **variables): ...
{ "repo_name": "mozilla/puente", "path": "puente/ext.py", "copies": "1", "size": "1541", "license": "bsd-3-clause", "hash": 7283193825999417000, "line_mean": 32.5, "line_max": 91, "alpha_frac": 0.730045425, "autogenerated": false, "ratio": 4.221917808219178, "config_test": false, "has_no_keywo...
from django.utils.translation import pgettext_lazy from cradmin_legacy import crmenu from cradmin_legacy.crinstance import reverse_cradmin_url from django.template import defaultfilters from devilry.devilry_cradmin import devilry_crmenu from cradmin_legacy import crapp class Menu(devilry_crmenu.Menu): devilryrol...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_admin/cradminextensions/devilry_crmenu_admin.py", "copies": "1", "size": "2979", "license": "bsd-3-clause", "hash": 2452092047544413700, "line_mean": 36.2375, "line_max": 84, "alpha_frac": 0.5847599866, "autogenerated": false, "rati...
from django.utils.translation import pgettext_lazy from django_prices_vatlayer.utils import get_tax_for_rate, get_tax_rates_for_country from prices import Money, MoneyRange, TaxedMoney, TaxedMoneyRange from ....core.taxes import charge_taxes_on_shipping, include_taxes_in_prices class TaxRateType: ACCOMMODATION =...
{ "repo_name": "maferelo/saleor", "path": "saleor/extensions/plugins/vatlayer/__init__.py", "copies": "2", "size": "5612", "license": "bsd-3-clause", "hash": -4384300642797669400, "line_mean": 36.4133333333, "line_max": 87, "alpha_frac": 0.6309693514, "autogenerated": false, "ratio": 3.31678486997...
from django.utils.translation import pgettext_lazy from ..core.permissions import AccountPermissions, OrderPermissions, ProductPermissions class WebhookEventType: ANY = "any_events" ORDER_CREATED = "order_created" ORDER_FULLY_PAID = "order_fully_paid" ORDER_UPDATED = "order_updated" ORDER_CANCELL...
{ "repo_name": "maferelo/saleor", "path": "saleor/webhook/event_types.py", "copies": "1", "size": "2358", "license": "bsd-3-clause", "hash": -5054309025793046000, "line_mean": 31.301369863, "line_max": 87, "alpha_frac": 0.6005089059, "autogenerated": false, "ratio": 3.897520661157025, "config_te...
from django.utils.translation import pgettext_lazy from ...core.utils.text import strip_html_and_truncate from ..widgets import CharsLeftWidget MIN_TITLE_LENGTH = 25 MIN_DESCRIPTION_LENGTH = 120 SEO_HELP_TEXTS = { 'seo_description': pgettext_lazy( 'Form field help text', ( 'If empty, t...
{ "repo_name": "UITools/saleor", "path": "saleor/dashboard/seo/utils.py", "copies": "1", "size": "1413", "license": "bsd-3-clause", "hash": 6637149813589673000, "line_mean": 33.4634146341, "line_max": 75, "alpha_frac": 0.6426043878, "autogenerated": false, "ratio": 3.957983193277311, "config_tes...
from django.utils.translation import pgettext_lazy from devilry.devilry_admin.cradminextensions.listfilter.listfilter_tags import AbstractTagSelectFilter class AssignmentGroupRelatedStudentTagSelectFilter(AbstractTagSelectFilter): """ Tag select filter for ``RelatedStudent``s in ``AssignmentGroup``s. """...
{ "repo_name": "devilry/devilry-django", "path": "devilry/devilry_admin/cradminextensions/listfilter/listfilter_assignmentgroup.py", "copies": "1", "size": "1517", "license": "bsd-3-clause", "hash": 7617113115420936000, "line_mean": 34.2790697674, "line_max": 102, "alpha_frac": 0.6730388926, "autoge...
from django.utils.translation import pgettext_lazy class CustomerEvents: """The different customer event types.""" # Account related events ACCOUNT_CREATED = "account_created" PASSWORD_RESET_LINK_SENT = "password_reset_link_sent" PASSWORD_RESET = "password_reset" PASSWORD_CHANGED = "password_...
{ "repo_name": "maferelo/saleor", "path": "saleor/account/__init__.py", "copies": "2", "size": "3146", "license": "bsd-3-clause", "hash": -2381829149492818400, "line_mean": 32.4680851064, "line_max": 88, "alpha_frac": 0.5301970757, "autogenerated": false, "ratio": 4.7025411061285505, "config_tes...
from django.utils.translation import pgettext_lazy class OrderStatus: DRAFT = "draft" UNFULFILLED = "unfulfilled" PARTIALLY_FULFILLED = "partially fulfilled" FULFILLED = "fulfilled" CANCELED = "canceled" CHOICES = [ ( DRAFT, pgettext_lazy( "Stat...
{ "repo_name": "maferelo/saleor", "path": "saleor/order/__init__.py", "copies": "2", "size": "9154", "license": "bsd-3-clause", "hash": -4166727464712203000, "line_mean": 28.2460063898, "line_max": 87, "alpha_frac": 0.4884203627, "autogenerated": false, "ratio": 4.567864271457085, "config_test":...
from django.utils.translation import pgettext_lazy class ProductAvailabilityStatus: NOT_PUBLISHED = 'not-published' VARIANTS_MISSSING = 'variants-missing' OUT_OF_STOCK = 'out-of-stock' LOW_STOCK = 'low-stock' NOT_YET_AVAILABLE = 'not-yet-available' READY_FOR_PURCHASE = 'ready-for-purchase' ...
{ "repo_name": "UITools/saleor", "path": "saleor/product/__init__.py", "copies": "1", "size": "1741", "license": "bsd-3-clause", "hash": -9213210127060952000, "line_mean": 41.4634146341, "line_max": 72, "alpha_frac": 0.6748994831, "autogenerated": false, "ratio": 4.298765432098765, "config_test"...
from django.utils.translation import ugettext as _ from casexml.apps.case.xml import V2 from casexml.apps.phone.restore import RestoreConfig, RestoreParams from corehq.apps.domain.models import Domain from dimagi.utils.logging import notify_exception from corehq.apps.users.models import CommCareUser, WebUser from .mo...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/ota/utils.py", "copies": "1", "size": "7749", "license": "bsd-3-clause", "hash": 1996268628480528100, "line_mean": 38.7384615385, "line_max": 115, "alpha_frac": 0.6495031617, "autogenerated": false, "ratio": 3.925531914893617, "confi...
from django.utils.translation import ugettext as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.pagemodel import Page from django import forms from .models import * class AMenuPlugin(CMSPluginBase): module = "Menu" class MenuBelowThisPlugin(AMenuPlugin): ""...
{ "repo_name": "ludbek/amenu", "path": "amenu/cms_plugins.py", "copies": "1", "size": "2115", "license": "mit", "hash": -5213092936412505000, "line_mean": 27.9726027397, "line_max": 173, "alpha_frac": 0.6940898345, "autogenerated": false, "ratio": 3.8807339449541285, "config_test": false, "has...
from django.utils.translation import ugettext as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from models import CheckoutPlugin, ProductPlugin class CheckoutPlugin(CMSPluginBase): model = CheckoutPlugin module = _('stripe shop') name = _("Checkout") render_templ...
{ "repo_name": "Lionardo/aldryn-stripe-shop", "path": "aldryn_stripe_shop/cms_plugins.py", "copies": "1", "size": "1157", "license": "bsd-3-clause", "hash": 2211576083783510500, "line_mean": 27.2195121951, "line_max": 56, "alpha_frac": 0.6568712187, "autogenerated": false, "ratio": 4.3660377358490...
from django.utils.translation import ugettext as _ from corehq.apps.app_manager import id_strings from corehq.apps.app_manager.const import CAREPLAN_GOAL, CAREPLAN_TASK from corehq.apps.app_manager.suite_xml.contributors import SuiteContributorByModule from corehq.apps.app_manager.suite_xml.xml_models import Menu, Comm...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/app_manager/suite_xml/features/careplan.py", "copies": "1", "size": "2076", "license": "bsd-3-clause", "hash": -2017843124511074000, "line_mean": 44.1304347826, "line_max": 109, "alpha_frac": 0.616088632, "autogenerated": false, "ratio...
from django.utils.translation import ugettext as _ from corehq.apps.fixtures.exceptions import FixtureUploadError from corehq.apps.fixtures.models import FixtureTypeField from corehq.apps.fixtures.upload.const import DELETE_HEADER from corehq.apps.fixtures.upload.failure_messages import FAILURE_MESSAGES from corehq.uti...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/fixtures/upload/workbook.py", "copies": "1", "size": "4775", "license": "bsd-3-clause", "hash": 5059316297043860000, "line_mean": 36.5984251969, "line_max": 108, "alpha_frac": 0.5935078534, "autogenerated": false, "ratio": 4.3212669683...
from django.utils.translation import ugettext as _ from corehq.apps.fixtures.exceptions import FixtureUploadError from corehq.apps.fixtures.upload.failure_messages import FAILURE_MESSAGES from corehq.apps.fixtures.upload.workbook import get_workbook from corehq.apps.fixtures.utils import get_fields_without_attributes f...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/fixtures/upload/validation.py", "copies": "1", "size": "5368", "license": "bsd-3-clause", "hash": -8093913758069172000, "line_mean": 46.9285714286, "line_max": 109, "alpha_frac": 0.5666915052, "autogenerated": false, "ratio": 4.3151125...
from django.utils.translation import ugettext as _ from corehq.apps.groups.models import Group from corehq.apps.reports.standard.cases.basic import CaseListReport from corehq.apps.api.es import CaseES from corehq.apps.reports.standard import CustomProjectReport from corehq.apps.reports.datatables import DataTablesHead...
{ "repo_name": "puttarajubr/commcare-hq", "path": "custom/bihar/reports/mch_reports.py", "copies": "2", "size": "21125", "license": "bsd-3-clause", "hash": 6432444312967181000, "line_mean": 49.538277512, "line_max": 146, "alpha_frac": 0.4524497041, "autogenerated": false, "ratio": 5.05503709021297...
from django.utils.translation import ugettext as _ from corehq.apps.locations.models import Location from corehq.apps.users.models import CommCareUser def validate_report_parameters(parameters, config): for parameter in parameters: if not parameter in config: raise KeyError(_("Parameter '%s' i...
{ "repo_name": "benrudolph/commcare-hq", "path": "custom/m4change/reports/__init__.py", "copies": "3", "size": "1116", "license": "bsd-3-clause", "hash": -824374034504605200, "line_mean": 43.64, "line_max": 125, "alpha_frac": 0.7123655914, "autogenerated": false, "ratio": 3.795918367346939, "con...
from django.utils.translation import ugettext as _ from corehq.apps.locations.models import Location def validate_report_parameters(parameters, config): for parameter in parameters: if not parameter in config: raise KeyError(_("Parameter '%s' is missing" % parameter)) def _is_location_CCT(lo...
{ "repo_name": "qedsoftware/commcare-hq", "path": "custom/m4change/reports/__init__.py", "copies": "1", "size": "2022", "license": "bsd-3-clause", "hash": 3140834297337029000, "line_mean": 43.9333333333, "line_max": 125, "alpha_frac": 0.7235410485, "autogenerated": false, "ratio": 3.51652173913043...
from django.utils.translation import ugettext as _ from corehq.apps.reports.filters.base import BaseSingleOptionFilter from custom.fri.models import PROFILE_A, PROFILE_B, PROFILE_C, PROFILE_D, PROFILE_E, PROFILE_F, PROFILE_G, PROFILE_H, PROFILE_DESC from custom.fri.api import get_interactive_participants class Interac...
{ "repo_name": "gmimano/commcaretest", "path": "custom/fri/reports/filters.py", "copies": "1", "size": "1177", "license": "bsd-3-clause", "hash": -1678044682023287800, "line_mean": 35.78125, "line_max": 130, "alpha_frac": 0.6533559898, "autogenerated": false, "ratio": 3.5558912386706947, "config...
from django.utils.translation import ugettext as _ from couchdbkit import ResourceNotFound from casexml.apps.case.models import CommCareCaseGroup from corehq.apps.hqcase.utils import get_case_by_identifier from couchforms.models import XFormInstance from dimagi.utils.couch.database import iter_docs def add_cases_to_c...
{ "repo_name": "benrudolph/commcare-hq", "path": "corehq/apps/data_interfaces/utils.py", "copies": "1", "size": "2814", "license": "bsd-3-clause", "hash": 4862742629088159000, "line_mean": 36.52, "line_max": 113, "alpha_frac": 0.618336887, "autogenerated": false, "ratio": 4.014265335235378, "con...
from django.utils.translation import ugettext as _ from couchdbkit import ResourceNotFound from corehq.apps.casegroups.models import CommCareCaseGroup from corehq.apps.hqcase.utils import get_case_by_identifier from corehq.form_processor.interfaces.dbaccessors import FormAccessors from soil import DownloadBase def a...
{ "repo_name": "qedsoftware/commcare-hq", "path": "corehq/apps/data_interfaces/utils.py", "copies": "1", "size": "3833", "license": "bsd-3-clause", "hash": 975836312438852900, "line_mean": 36.9504950495, "line_max": 115, "alpha_frac": 0.6295330029, "autogenerated": false, "ratio": 3.92725409836065...
from django.utils.translation import ugettext as _ from datetime import datetime, timedelta import uuid from celery.schedules import crontab from celery.task import periodic_task from corehq.apps.reports.scheduled import get_scheduled_reports from couchexport.files import Temp from couchexport.groupexports import expo...
{ "repo_name": "SEL-Columbia/commcare-hq", "path": "corehq/apps/reports/tasks.py", "copies": "1", "size": "9124", "license": "bsd-3-clause", "hash": -4324185367228961300, "line_mean": 40.8532110092, "line_max": 194, "alpha_frac": 0.6599079351, "autogenerated": false, "ratio": 3.3717664449371765, ...
from django.utils.translation import ugettext as _ from django.conf import settings from django.forms.models import inlineformset_factory import floppyforms as forms from crispy_forms.helper import FormHelper from crispy_forms.bootstrap import FormActions from crispy_forms.layout import Layout, Submit, HTML, Div, Fiel...
{ "repo_name": "camillemonchicourt/Geotrek", "path": "geotrek/trekking/forms.py", "copies": "1", "size": "8647", "license": "bsd-2-clause", "hash": 2095961271618027500, "line_mean": 37.6026785714, "line_max": 135, "alpha_frac": 0.5515207586, "autogenerated": false, "ratio": 4.109790874524715, "c...
from django.utils.translation import ugettext as _ from django.contrib.auth import REDIRECT_FIELD_NAME from django.views.decorators.cache import never_cache from django.contrib.auth.views import login from django.contrib.auth.views import logout from django.http import HttpResponse from base import BaseAdminView, filt...
{ "repo_name": "A425/django-nadmin", "path": "nadmin/views/website.py", "copies": "1", "size": "2707", "license": "mit", "hash": -4192539242130311000, "line_mean": 27.1979166667, "line_max": 84, "alpha_frac": 0.6331732545, "autogenerated": false, "ratio": 3.969208211143695, "config_test": false,...
from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from django.test import TestCase from registration import forms class RegistrationFormTests(TestCase): """ Test the default registration forms. """ def test_registration_form(self): """ Tes...
{ "repo_name": "liberation/django-registration", "path": "registration/tests/forms.py", "copies": "1", "size": "5380", "license": "bsd-3-clause", "hash": -4224308592621733400, "line_mean": 43.8333333333, "line_max": 133, "alpha_frac": 0.4795539033, "autogenerated": false, "ratio": 5.02334267040149...
from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from abstract_is_admin import AbstractIsAdmin from save_interface import SaveInterface class BaseNode(AbstractIsAdmin, SaveInterface): """ The base class of the Devilry hierarchy. Implements basic functionality ...
{ "repo_name": "vegarang/devilry-django", "path": "devilry/apps/core/models/basenode.py", "copies": "1", "size": "2777", "license": "bsd-3-clause", "hash": 464184478783847000, "line_mean": 33.2839506173, "line_max": 87, "alpha_frac": 0.6164926179, "autogenerated": false, "ratio": 4.175939849624060...
from django.utils.translation import ugettext as _ from django.contrib.contenttypes.models import ContentType from listable.views import BaseListableView, SELECT, SELECT_MULTI, DATE, DATE_RANGE from listable.views import TODAY, YESTERDAY, TOMORROW, LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS, LAST_365_DAYS, THIS_WEEK, THIS...
{ "repo_name": "randlet/django-listable", "path": "listable-demo/staff/views.py", "copies": "1", "size": "2943", "license": "bsd-3-clause", "hash": -5599632502581343000, "line_mean": 32.8275862069, "line_max": 313, "alpha_frac": 0.6017669045, "autogenerated": false, "ratio": 3.5457831325301203, ...
from django.utils.translation import ugettext as _ from django.contrib.gis.db import models from django.template.defaultfilters import slugify class Program(models.Model): title = models.CharField(max_length=100) description = models.TextField(_('Program Description'), blan...
{ "repo_name": "MAPC/masshealth", "path": "programs/models.py", "copies": "1", "size": "2042", "license": "bsd-3-clause", "hash": 2426053357988456400, "line_mean": 35.4642857143, "line_max": 92, "alpha_frac": 0.5479921645, "autogenerated": false, "ratio": 4.429501084598699, "config_test": false,...
from django.utils.translation import ugettext as _ from django.contrib.gis.db import models REGION_TYPE_CHOICES = ( ('cities-and-towns', 'Cities and Towns'), ) class Place(models.Model): name = models.CharField(max_length=100) slug = models.SlugField() unitid = models.CharField(max_length=20) regi...
{ "repo_name": "MAPC/masshealth", "path": "places/models.py", "copies": "1", "size": "1345", "license": "bsd-3-clause", "hash": 1885320041507728600, "line_mean": 31.8048780488, "line_max": 83, "alpha_frac": 0.6096654275, "autogenerated": false, "ratio": 3.8649425287356323, "config_test": false, ...
from django.utils.translation import ugettext as _ from django.contrib import admin from django.core.urlresolvers import reverse from models import * adminsite = admin.site class SubjectAdmin(admin.ModelAdmin): search_fields = ['surname', 'givenname', 'email'] list_display = ['surname', 'givenname', 'email']...
{ "repo_name": "affan2/ed-questionnaire", "path": "questionnaire/admin.py", "copies": "1", "size": "3006", "license": "bsd-3-clause", "hash": -3682639818037439000, "line_mean": 33.1590909091, "line_max": 136, "alpha_frac": 0.6823020625, "autogenerated": false, "ratio": 3.724907063197026, "config...
from django.utils.translation import ugettext as _ from django.contrib import admin from models import * adminsite = admin.site class SubjectAdmin(admin.ModelAdmin): exclude = ('next_run', 'formtype', 'language', 'state', 'gender') search_fields = ['surname', 'givenname', 'email'] list_display = ['surnam...
{ "repo_name": "mpetyx/psymbiosys-questionnaire", "path": "questionnaire/admin.py", "copies": "1", "size": "2801", "license": "mit", "hash": -3423215496184963600, "line_mean": 32.7590361446, "line_max": 103, "alpha_frac": 0.6783291682, "autogenerated": false, "ratio": 3.6758530183727034, "config...
from django.utils.translation import ugettext as _ from django.contrib import admin from models import * adminsite = admin.site class SubjectAdmin(admin.ModelAdmin): search_fields = ['surname', 'givenname', 'email'] list_display = ['surname', 'givenname', 'email'] class ChoiceAdmin(admin.ModelAdmin): l...
{ "repo_name": "JanOosting/ed-questionnaire", "path": "questionnaire/admin.py", "copies": "3", "size": "2584", "license": "bsd-3-clause", "hash": -4500052577531502600, "line_mean": 30.9135802469, "line_max": 95, "alpha_frac": 0.6834365325, "autogenerated": false, "ratio": 3.7126436781609193, "co...
from django.utils.translation import ugettext as _ from django.contrib import messages from django.core.exceptions import ImproperlyConfigured from django.shortcuts import redirect from .models import Account, Site class HasAccountMiddleware(object): """Force new users to set up account information""" def proc...
{ "repo_name": "ulope/guardhouse", "path": "guardhouse/main/middleware.py", "copies": "1", "size": "2671", "license": "bsd-3-clause", "hash": 1748105209874385200, "line_mean": 42.0806451613, "line_max": 86, "alpha_frac": 0.5361287907, "autogenerated": false, "ratio": 5.176356589147287, "config_t...
from django.utils.translation import ugettext as _ from django.contrib import messages from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from competition.models import Competition, CompetitionPreferences from competition.forms import CompetitionBaseEntryForm,...
{ "repo_name": "praekelt/jmbo-competition", "path": "competition/views.py", "copies": "1", "size": "2000", "license": "bsd-3-clause", "hash": 7152703567147468000, "line_mean": 40.6666666667, "line_max": 75, "alpha_frac": 0.713, "autogenerated": false, "ratio": 3.9761431411530817, "config_test": ...
from django.utils.translation import ugettext as _ from django.contrib import messages from rest_framework.response import Response from rest_framework.status import (HTTP_304_NOT_MODIFIED, HTTP_400_BAD_REQUEST, HTTP_204_NO_CONTENT, HTTP_404_NOT_FOUND, HTTP_403_FORBIDDEN, HTTP_200_OK...
{ "repo_name": "jannon/django-allauth-api", "path": "src/allauth_api/account/rest_framework/views.py", "copies": "1", "size": "11690", "license": "bsd-2-clause", "hash": -3744141914938031600, "line_mean": 34.5319148936, "line_max": 122, "alpha_frac": 0.6410607357, "autogenerated": false, "ratio": ...
from django.utils.translation import ugettext as _ from django.contrib.sites.models import Site from django.contrib.syndication.feeds import Feed from job_board.models import Job class JobFeed(Feed): description_template = 'job_board/feed.html' def title(self): if not hasattr(self, '_site'): ...
{ "repo_name": "jpartogi/django-job-board", "path": "job_board/feeds.py", "copies": "1", "size": "1267", "license": "bsd-3-clause", "hash": -7663538049736764000, "line_mean": 30.7, "line_max": 90, "alpha_frac": 0.6077348066, "autogenerated": false, "ratio": 3.9347826086956523, "config_test": fal...
from django.utils.translation import ugettext as _ from django.contrib.syndication.views import Feed from django.contrib.comments.models import Comment from django.shortcuts import get_object_or_404 from annotatetext.models import Annotation from laws.models import Vote, Bill from knesset.utils import main_actions cla...
{ "repo_name": "Shrulik/Open-Knesset", "path": "knesset/feeds.py", "copies": "14", "size": "3156", "license": "bsd-3-clause", "hash": 4290890870571361300, "line_mean": 28.7735849057, "line_max": 96, "alpha_frac": 0.6039290241, "autogenerated": false, "ratio": 3.708578143360752, "config_test": fa...
from django.utils.translation import ugettext as _ from django.contrib.syndication.views import Feed from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from models import Vote, Bill class Votes(Feed): title = _("Knesset Votes feed") author_name = _("Open Knesset") #...
{ "repo_name": "antin/Open-Knesset", "path": "laws/feeds.py", "copies": "14", "size": "1425", "license": "bsd-3-clause", "hash": 557851372272557950, "line_mean": 29.9782608696, "line_max": 75, "alpha_frac": 0.6371929825, "autogenerated": false, "ratio": 3.925619834710744, "config_test": false, ...
from django.utils.translation import ugettext as _ from django.core.exceptions import ValidationError from django.db import models import re class ShortNameField(models.SlugField): """ Short name field used by several of the core models. We have a hierarchy of objects with a short name, but they are not ...
{ "repo_name": "vegarang/devilry-django", "path": "devilry/apps/core/models/custom_db_fields.py", "copies": "1", "size": "1540", "license": "bsd-3-clause", "hash": -7307767853490057000, "line_mean": 35.6666666667, "line_max": 79, "alpha_frac": 0.5785714286, "autogenerated": false, "ratio": 4.16216...
from django.utils.translation import ugettext as _ from django.core.exceptions import ValidationError from django.db.models import Q from django.contrib.auth.models import User from django.db import models from basenode import BaseNode from custom_db_fields import ShortNameField, LongNameField from model_utils import ...
{ "repo_name": "vegarang/devilry-django", "path": "devilry/apps/core/models/node.py", "copies": "1", "size": "4530", "license": "bsd-3-clause", "hash": 7119983613671574000, "line_mean": 34.390625, "line_max": 101, "alpha_frac": 0.6002207506, "autogenerated": false, "ratio": 4.261523988711195, "c...
from django.utils.translation import ugettext as _ from django.core.exceptions import ValidationError, PermissionDenied from django.db import models from django.db.models import Q from datetime import datetime from abstract_is_examiner import AbstractIsExaminer from abstract_is_candidate import AbstractIsCandidate fr...
{ "repo_name": "vegarang/devilry-django", "path": "devilry/apps/core/models/deadline.py", "copies": "1", "size": "5039", "license": "bsd-3-clause", "hash": 399567887026867400, "line_mean": 39.6370967742, "line_max": 147, "alpha_frac": 0.6300853344, "autogenerated": false, "ratio": 4.42794376098418...
from django.utils.translation import ugettext as _ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth import get_user_model from pages.plugins.jsonexport.utils import (json_to_pages, monkeypatch_remove_pages_site_restrictions) import sys class Command(BaseCommand): arg...
{ "repo_name": "remik/django-page-cms", "path": "pages/plugins/jsonexport/management/commands/pages_import_json.py", "copies": "2", "size": "1531", "license": "bsd-3-clause", "hash": -7805285768597688000, "line_mean": 36.3414634146, "line_max": 80, "alpha_frac": 0.5852384063, "autogenerated": false,...
from django.utils.translation import ugettext as _ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from pages.plugins.jsonexport.utils import (pages_to_json, monkeypatch_remove_pages_site_restrictions) from pages.models import Page import sys class Com...
{ "repo_name": "akaihola/django-page-cms", "path": "pages/plugins/jsonexport/management/commands/pages_import_json.py", "copies": "2", "size": "1507", "license": "bsd-3-clause", "hash": -5872600771358542000, "line_mean": 35.756097561, "line_max": 80, "alpha_frac": 0.5892501659, "autogenerated": fals...
from django.utils.translation import ugettext as _ from django.core.management.base import BaseCommand, CommandError from pages.plugins.jsonexport.utils import (pages_to_json, monkeypatch_remove_pages_site_restrictions) from pages.models import Page from optparse import make_option import sys class Command(BaseCo...
{ "repo_name": "remik/django-page-cms", "path": "pages/plugins/jsonexport/management/commands/pages_export_json.py", "copies": "4", "size": "1387", "license": "bsd-3-clause", "hash": -4935844717922266000, "line_mean": 32.8292682927, "line_max": 82, "alpha_frac": 0.5767844268, "autogenerated": false,...
from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django.utils.timezone import now from blog.models import Article MONTH_NAMES = [ _('January'), _('February'), _('March'), _('April'), _('May'), _('June'), _('July'), _('August'), _('September'), _('October')...
{ "repo_name": "Cotidia/cotidia-blog", "path": "blog/utils.py", "copies": "1", "size": "1986", "license": "mit", "hash": 5734991397351097000, "line_mean": 24.8051948052, "line_max": 144, "alpha_frac": 0.6792547835, "autogenerated": false, "ratio": 3.1226415094339623, "config_test": false, "has...
from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from category.models import Category from jmbo.view_modifiers import ViewModifier from jmbo.view_modifiers.items import URLPatternItem from show.models import Show from show.view_modifiers.items import CategoryRelatedItem ...
{ "repo_name": "praekelt/jmbo-show", "path": "show/view_modifiers/__init__.py", "copies": "1", "size": "4562", "license": "bsd-3-clause", "hash": 5407052100127971000, "line_mean": 33.0447761194, "line_max": 84, "alpha_frac": 0.4989039895, "autogenerated": false, "ratio": 4.921251348435814, "conf...
from django.utils.translation import ugettext as _ from django.core.validators import MaxLengthValidator from django.contrib.auth import forms as auth_forms from longerusernameandemail import MAX_USERNAME_LENGTH def update_field_length(field, length): field.widget.attrs['maxlength'] = length field.max_lengt...
{ "repo_name": "madssj/django-longer-username-and-email", "path": "longerusernameandemail/forms.py", "copies": "1", "size": "1545", "license": "bsd-3-clause", "hash": 8484477208210151000, "line_mean": 36.7073170732, "line_max": 75, "alpha_frac": 0.6705501618, "autogenerated": false, "ratio": 4.055...
from django.utils.translation import ugettext as _ from django.db import connection from tenant_extras.utils import TenantLanguage from bluebottle.clients.utils import tenant_url from bluebottle.utils.email_backend import send_mail from bluebottle.utils.utils import StatusDefinition from bluebottle.payments.models im...
{ "repo_name": "jfterpstra/bluebottle", "path": "bluebottle/bb_donations/donationmail.py", "copies": "1", "size": "4502", "license": "bsd-3-clause", "hash": 7171791650938541000, "line_mean": 31.3884892086, "line_max": 97, "alpha_frac": 0.6314971124, "autogenerated": false, "ratio": 4.0852994555353...
from django.utils.translation import ugettext as _ from django.db import models from django.conf import settings from django.contrib.auth.models import User from djangoedu.ldap.fields import LdapObjectField try: import mptt except ImportError: raise ImproperlyConfigured, "You're missing django-mptt, go get it...
{ "repo_name": "tjnapster555/django-edu", "path": "djangoedu/core/models.py", "copies": "1", "size": "8493", "license": "mit", "hash": 3583587607742142000, "line_mean": 34.244813278, "line_max": 115, "alpha_frac": 0.6121511833, "autogenerated": false, "ratio": 4.028937381404175, "config_test": f...
from django.utils.translation import ugettext as _ from django.db import models from django.contrib.auth.models import User from visualizations.models import Visualization class Page(models.Model): """A Story page Pages always have text, whether you think of it as an abstract or a caption. Page...
{ "repo_name": "MAPC/masshealth", "path": "datastories/models.py", "copies": "1", "size": "3579", "license": "bsd-3-clause", "hash": 6465747023647058000, "line_mean": 37.902173913, "line_max": 70, "alpha_frac": 0.6135792121, "autogenerated": false, "ratio": 4.4962311557788945, "config_test": fal...
from django.utils.translation import ugettext as _ from django.db import models from django.utils.text import Truncator from django.urls import reverse from tinymce.models import HTMLField from dashboard.mixins import DashboardMixin from employee.models import Employee class Rule(models.Model, DashboardMixin): t...
{ "repo_name": "Rom4eg/myCompany", "path": "myCompany/rules/models/rule.py", "copies": "1", "size": "1187", "license": "mit", "hash": 3267805700904194000, "line_mean": 32.9142857143, "line_max": 130, "alpha_frac": 0.699241786, "autogenerated": false, "ratio": 3.8790849673202614, "config_test": f...
from django.utils.translation import ugettext as _ from django.db import models from django.utils.safestring import mark_safe from django.core.files.storage import FileSystemStorage from django.conf import settings import os # Visualization XML templates: # # These files are designed and uploaded by an administrator...
{ "repo_name": "MAPC/masshealth", "path": "visualizations/models.py", "copies": "1", "size": "6211", "license": "bsd-3-clause", "hash": -4050141717003570700, "line_mean": 38.0628930818, "line_max": 73, "alpha_frac": 0.6472387699, "autogenerated": false, "ratio": 3.9359949302915083, "config_test"...
from django.utils.translation import ugettext as _ from django.db.models import Count from django.contrib import admin from products.models import ProductType, Product from products.forms import ProducttypeAdminForm class ProductInline(admin.TabularInline): """ Inline for editing products on the product type...
{ "repo_name": "westphahl/verleihsystem", "path": "verleihsystem/products/admin.py", "copies": "1", "size": "1505", "license": "isc", "hash": 7209678432393930000, "line_mean": 27.9423076923, "line_max": 76, "alpha_frac": 0.6724252492, "autogenerated": false, "ratio": 4.413489736070381, "config_t...
from django.utils.translation import ugettext as _ from django.db.models import SmallIntegerField DAY_OF_THE_WEEK = { 1: _('Monday'), 2: _('Tuesday'), 3: _('Wednesday'), 4: _('Thursday'), 5: _('Friday'), 6: _('Saturday'), 7: _('Sunday'), } class DayOfTheWeek: def __init__(self, day_of_...
{ "repo_name": "Bart-Jellema/shark", "path": "shark/extensions/day_of_the_week.py", "copies": "1", "size": "1314", "license": "bsd-3-clause", "hash": -3541439239668280000, "line_mean": 28.8636363636, "line_max": 120, "alpha_frac": 0.5837138508, "autogenerated": false, "ratio": 3.360613810741688, ...
from django.utils.translation import ugettext as _ from django_digest import HttpDigestAuthenticator from rest_framework.authentication import get_authorization_header from rest_framework.authentication import BaseAuthentication from rest_framework.authentication import TokenAuthentication from rest_framework.exception...
{ "repo_name": "sounay/flaminggo-test", "path": "onadata/libs/authentication.py", "copies": "8", "size": "2833", "license": "bsd-2-clause", "hash": -2830075401119703600, "line_mean": 33.5487804878, "line_max": 79, "alpha_frac": 0.6967878574, "autogenerated": false, "ratio": 4.659539473684211, "c...
from django.utils.translation import ugettext as _ from django_digest import HttpDigestAuthenticator from rest_framework.authentication import ( BaseAuthentication, get_authorization_header, BasicAuthentication) from rest_framework.exceptions import AuthenticationFailed class DigestAuthentication(BaseAuthenti...
{ "repo_name": "awemulya/fieldsight-kobocat", "path": "onadata/libs/authentication.py", "copies": "1", "size": "1754", "license": "bsd-2-clause", "hash": -2729462731491159600, "line_mean": 37.9777777778, "line_max": 76, "alpha_frac": 0.6744583808, "autogenerated": false, "ratio": 5.040229885057471...
from django.utils.translation import ugettext as _ from django.forms import ModelForm, Textarea, TextInput, EmailInput, CheckboxInput from django import forms from .models import LettingContact class LettingContactForm(ModelForm): class Meta: model = LettingContact fields = [ 'more_de...
{ "repo_name": "signalfire/django-property", "path": "homes_to_let/forms.py", "copies": "1", "size": "1948", "license": "mit", "hash": 5885800867780345000, "line_mean": 36.4615384615, "line_max": 83, "alpha_frac": 0.5246406571, "autogenerated": false, "ratio": 4.540792540792541, "config_test": f...
from django.utils.translation import ugettext as _ from django.http import Http404 from django.views.generic import ListView, DetailView from persons.models import Person from committees.models import CommitteeMeeting class PersonListView(ListView): model = Person def get_context(self): context = supe...
{ "repo_name": "navotsil/Open-Knesset", "path": "persons/views.py", "copies": "14", "size": "1158", "license": "bsd-3-clause", "hash": 3930422901060622300, "line_mean": 37.6, "line_max": 144, "alpha_frac": 0.6804835924, "autogenerated": false, "ratio": 4.034843205574913, "config_test": false, ...
from django.utils.translation import ugettext as _ from django.http import Http404 from knesset.hashnav import ListView, DetailView from knesset.persons.models import Person from knesset.committees.models import CommitteeMeeting class PersonListView(ListView): def get_context(self): context = super(Person...
{ "repo_name": "livni/old-OK", "path": "src/knesset/persons/views.py", "copies": "1", "size": "1054", "license": "bsd-3-clause", "hash": -5739928343986981000, "line_mean": 41.2, "line_max": 144, "alpha_frac": 0.6888045541, "autogenerated": false, "ratio": 4.007604562737643, "config_test": false,...
from django.utils.translation import ugettext as _ from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_stream_message, create_stream_if_needed from zerver.lib.response import json_success, json_error from zerver.lib.validator imp...
{ "repo_name": "amanharitsh123/zulip", "path": "zerver/webhooks/slack/view.py", "copies": "3", "size": "1571", "license": "apache-2.0", "hash": 5210072715381069000, "line_mean": 45.2058823529, "line_max": 89, "alpha_frac": 0.6785486951, "autogenerated": false, "ratio": 3.7494033412887826, "confi...
from django.utils.translation import ugettext as _ from django.http import HttpRequest, HttpResponse from typing import Any, Dict, List from zerver.lib.actions import check_send_stream_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only...
{ "repo_name": "Galexrt/zulip", "path": "zerver/webhooks/greenhouse/view.py", "copies": "3", "size": "2326", "license": "apache-2.0", "hash": -7617397183028667000, "line_mean": 39.1034482759, "line_max": 86, "alpha_frac": 0.6298366294, "autogenerated": false, "ratio": 3.8896321070234112, "config...
from django.utils.translation import ugettext as _ from django.http import HttpResponseForbidden, HttpResponseRedirect from django.core.urlresolvers import reverse from django.shortcuts import render, get_object_or_404 from django.template.context import RequestContext from django.contrib.auth.models import User from d...
{ "repo_name": "hasadna/open-shot", "path": "polyorg/views.py", "copies": "1", "size": "4852", "license": "bsd-3-clause", "hash": 1291349606567011000, "line_mean": 38.7704918033, "line_max": 113, "alpha_frac": 0.6537510305, "autogenerated": false, "ratio": 4.363309352517986, "config_test": false...
from django.utils.translation import ugettext as _ from django.http import HttpResponse from darkoob.migration.forms import StartNewMigrationForm from darkoob.book.models import Book from darkoob.migration.models import Migration import random import string def generate_private_key(len=10): return ''.join(random....
{ "repo_name": "s1na/darkoob", "path": "darkoob/migration/views.py", "copies": "1", "size": "1419", "license": "mit", "hash": -3345610797296683500, "line_mean": 39.5428571429, "line_max": 97, "alpha_frac": 0.6384778013, "autogenerated": false, "ratio": 4.274096385542169, "config_test": false, ...
from django.utils.translation import ugettext as _ from django.http import HttpResponse from django.conf import settings from django.contrib.auth import authenticate, login def simple_basic_auth_callback(request, user, *args, **kwargs): """ Simple callback to automatically login the given user after a succes...
{ "repo_name": "guilleCoro/django-notification", "path": "notification/decorators.py", "copies": "17", "size": "2758", "license": "mit", "hash": 4418888750565341700, "line_mean": 41.4307692308, "line_max": 88, "alpha_frac": 0.6207396664, "autogenerated": false, "ratio": 4.7965217391304344, "conf...
from django.utils.translation import ugettext as _ from django.http import HttpResponse from django.contrib.auth import authenticate, login from django.conf import settings def simple_basic_auth_callback(request, user, *args, **kwargs): """ Simple callback to automatically login the given user after a successf...
{ "repo_name": "bhaugen/foodnetwork", "path": "notification/decorators.py", "copies": "15", "size": "2734", "license": "mit", "hash": -3044455129669385000, "line_mean": 43.0967741935, "line_max": 88, "alpha_frac": 0.6261887345, "autogenerated": false, "ratio": 4.7630662020905925, "config_test": ...
from django.utils.translation import ugettext as _ from django.http import HttpResponse from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse from django.contrib import messages from django.conf import settings from django.contrib.auth import authenticate, login from django.c...
{ "repo_name": "SPARLab/BikeMaps", "path": "userApp/views.py", "copies": "1", "size": "2939", "license": "mit", "hash": 1881730869192649500, "line_mean": 33.5764705882, "line_max": 114, "alpha_frac": 0.6617897244, "autogenerated": false, "ratio": 4.127808988764045, "config_test": false, "has_n...
from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404,render_to_response from django.contrib.auth.decorators import login_required from django.template import RequestContext import logging from django.contrib.contenttypes...
{ "repo_name": "livni/old-OK", "path": "src/knesset/committees/views.py", "copies": "1", "size": "6696", "license": "bsd-3-clause", "hash": -749252806140157200, "line_mean": 43.9395973154, "line_max": 122, "alpha_frac": 0.6176821983, "autogenerated": false, "ratio": 3.5980655561526063, "config_t...
from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, HttpResponse, JsonResponse from django.urls import reverse from django.shortcuts import get_object_or_404 from django.contrib.gis.geos import GEOSGeometry from djgeojson.serializers import Serializer as GeoJSONSerializer ...
{ "repo_name": "SPARLab/BikeMaps", "path": "mapApp/views/alerts.py", "copies": "1", "size": "2986", "license": "mit", "hash": -2067084093354409000, "line_mean": 40.4722222222, "line_max": 121, "alpha_frac": 0.7478231748, "autogenerated": false, "ratio": 3.4761350407450524, "config_test": false, ...
from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, JsonResponse from django.urls import reverse from django.shortcuts import get_object_or_404, render from django.contrib import messages from django.contrib.gis.geos import GEOSGeometry # Decorators from django.views.decor...
{ "repo_name": "SPARLab/BikeMaps", "path": "mapApp/views/edit.py", "copies": "1", "size": "2926", "license": "mit", "hash": 3481240651878759000, "line_mean": 31.1538461538, "line_max": 140, "alpha_frac": 0.7453861928, "autogenerated": false, "ratio": 3.1908396946564888, "config_test": false, "...
from django.utils.translation import ugettext as _ from django import forms from django.contrib.auth.hashers import make_password from random import choice from string import digits, ascii_lowercase from djing.lib import LogicError from ip_pool.models import NetworkModel from gw_app.models import NASModel from abonapp...
{ "repo_name": "bashmak/djing", "path": "abonapp/forms.py", "copies": "2", "size": "8240", "license": "unlicense", "hash": 5728610827369623000, "line_mean": 32.3603238866, "line_max": 85, "alpha_frac": 0.5366504854, "autogenerated": false, "ratio": 4.240864642305713, "config_test": false, "has...
from django.utils.translation import ugettext as _ from django import forms from django.core.exceptions import ObjectDoesNotExist from rsvp.models import ATTENDING_CHOICES, Guest VISIBLE_ATTENDING_CHOICES = [choice for choice in ATTENDING_CHOICES if choice[0] != 'no_rsvp'] class RSVPForm(forms.Form): email = fo...
{ "repo_name": "toastdriven/django-rsvp", "path": "rsvp/forms.py", "copies": "1", "size": "2175", "license": "mit", "hash": -5296163761754604000, "line_mean": 41.6470588235, "line_max": 127, "alpha_frac": 0.6487356322, "autogenerated": false, "ratio": 3.918918918918919, "config_test": false, "...