text stringlengths 0 1.05M | meta dict |
|---|---|
from django.utils.translation import ugettext_lazy as _
from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet
from geotrek.infrastructure.filters import InfrastructureFilterSet, SignageFilterSet
from geotrek.maintenance.filters import InterventionFilterSet, ProjectFilterSet
from geotrek.trekki... | {
"repo_name": "Anaethelion/Geotrek",
"path": "geotrek/zoning/filters.py",
"copies": "3",
"size": "2120",
"license": "bsd-2-clause",
"hash": -475461714004496300,
"line_mean": 30.1764705882,
"line_max": 86,
"alpha_frac": 0.7622641509,
"autogenerated": false,
"ratio": 3.587140439932318,
"config_te... |
from django.utils.translation import ugettext_lazy as _
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class IndexDashboard(Dashboard):
def init_with_context(self, context):
site_name = get_admin_site_name(context)
self.children.appen... | {
"repo_name": "HurtowniaPixeli/pixelcms-server",
"path": "cms/admin_addons/dashboard.py",
"copies": "1",
"size": "2258",
"license": "mit",
"hash": 3463246918555384000,
"line_mean": 28.7105263158,
"line_max": 57,
"alpha_frac": 0.4743135518,
"autogenerated": false,
"ratio": 4.6652892561983474,
"c... |
from django.utils.translation import ugettext_lazy as _
from grappelli.dashboard import modules, Dashboard
from grappelli.dashboard.utils import get_admin_site_name
class MgnifyDashboard(Dashboard):
"""
Mgnify index dashboard for www.
"""
def init_with_context(self, context):
site_name = get... | {
"repo_name": "EBI-Metagenomics/emgapi",
"path": "emgcli/dashboard.py",
"copies": "1",
"size": "3948",
"license": "apache-2.0",
"hash": -8579321150204477000,
"line_mean": 27.8175182482,
"line_max": 62,
"alpha_frac": 0.4858156028,
"autogenerated": false,
"ratio": 4.333699231613611,
"config_test"... |
from django.utils.translation import ugettext_lazy as _
from grappelli.dashboard import modules, Dashboard
from interim_cms.modules import ExampleModule, StaticModule
class LeftDashboard(Dashboard):
def init_with_context(self, context):
self.children = []
self.children.append(modules.AppList(
... | {
"repo_name": "praekelt/django-interim-cms",
"path": "interim_cms/dashboard.py",
"copies": "1",
"size": "1420",
"license": "bsd-3-clause",
"hash": -7652796866078500000,
"line_mean": 23.0677966102,
"line_max": 74,
"alpha_frac": 0.5647887324,
"autogenerated": false,
"ratio": 4.0922190201729105,
"... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard.dashboards.newtouch.models import Server,Service
def get_available_services():
services = Service.objects.all()
return ((service.name, servic... | {
"repo_name": "zouyapeng/horizon-newtouch",
"path": "openstack_dashboard/dashboards/newtouch/server/forms.py",
"copies": "1",
"size": "2881",
"license": "apache-2.0",
"hash": 5850093691570547000,
"line_mean": 38.4657534247,
"line_max": 88,
"alpha_frac": 0.5539743145,
"autogenerated": false,
"rati... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from horizon import messages
from openstack_dashboard.dashboards.monitor import monitor
from openstack_dashboard.dashboards.monitor.equipment_monitor import tables as project_tables
from horizon.utils impor... | {
"repo_name": "zouyapeng/horizon_change",
"path": "openstack_dashboard/dashboards/monitor/equipment_monitor/tags.py",
"copies": "2",
"size": "2013",
"license": "apache-2.0",
"hash": -8200537200733455000,
"line_mean": 33.1186440678,
"line_max": 93,
"alpha_frac": 0.6140089419,
"autogenerated": false,... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.congress.overview import tables
class InstanceTab(tabs.TableTab):
name = _("Instances Tab")
slug = "instances_tab"
table... | {
"repo_name": "aaronorosen/horizon-congress",
"path": "openstack_dashboard/dashboards/congress/overview/tabs.py",
"copies": "1",
"size": "1164",
"license": "apache-2.0",
"hash": -1607095182527791000,
"line_mean": 28.1,
"line_max": 75,
"alpha_frac": 0.6323024055,
"autogenerated": false,
"ratio": 4... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.nikolaboard.sregistries import tables
class RegistryTab(tabs.Tab):
name = _("Overview")
slug = "service_registry_tab"
te... | {
"repo_name": "AlexOugh/horizon",
"path": "openstack_dashboard/dashboards/nikolaboard/sregistries/tabs.py",
"copies": "1",
"size": "1063",
"license": "apache-2.0",
"hash": -4315213555868094000,
"line_mean": 26.2564102564,
"line_max": 81,
"alpha_frac": 0.7036688617,
"autogenerated": false,
"ratio"... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.vdc.infrastructure import tables
class InstanceTab(tabs.TableTab):
name = _("Instances Tab")
slug = "instances_tab"
tabl... | {
"repo_name": "endorphinl/horizon",
"path": "openstack_dashboard/dashboards/vdc/infrastructure_back/tabs.py",
"copies": "2",
"size": "1163",
"license": "apache-2.0",
"hash": -7594830264183776000,
"line_mean": 28.075,
"line_max": 75,
"alpha_frac": 0.6319862425,
"autogenerated": false,
"ratio": 4.2... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from openstack_dashboard.api import glance
def get_available_images(request, project_id=None, images_cache=None):
"""
Returns a list of images that are public or owned by the given
project_id. If project_id is not spe... | {
"repo_name": "rackerlabs/horizon",
"path": "openstack_dashboard/dashboards/project/images_and_snapshots/utils.py",
"copies": "3",
"size": "2266",
"license": "apache-2.0",
"hash": -6870121332522976000,
"line_mean": 34.9682539683,
"line_max": 70,
"alpha_frac": 0.5997352162,
"autogenerated": false,
... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.images_and_snapshots.views import IndexView as OldIndexView
from tukey.dashboards.project.images_and_snapshots.images.tables import ImagesTable
from ... | {
"repo_name": "LabAdvComp/tukey_portal",
"path": "tukey/dashboards/project/images_and_snapshots/views.py",
"copies": "1",
"size": "2322",
"license": "apache-2.0",
"hash": -2742144934364555000,
"line_mean": 48.4042553191,
"line_max": 116,
"alpha_frac": 0.5835486649,
"autogenerated": false,
"ratio"... |
from django.utils.translation import ugettext_lazy as _
from horizon import messages
from horizon import exceptions
from horizon import tabs
from thermal import api
from .tables import ThermalEventsTable
class OverviewTab(tabs.Tab):
name = _("Overview")
slug = "overview"
template_name = ("thermal/stack... | {
"repo_name": "hanney/heat-horizon",
"path": "thermal/stacks/tabs.py",
"copies": "1",
"size": "1256",
"license": "apache-2.0",
"hash": 6096181286009961000,
"line_mean": 27.5454545455,
"line_max": 75,
"alpha_frac": 0.6186305732,
"autogenerated": false,
"ratio": 3.9621451104100944,
"config_test":... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.api import cinder
from openstack_dashboard.dashboards.project.volumes.tables import \
DeleteVolume
from openstack_dashboard.dashboards.project.volumes.tables import \
UpdateRow
from openstack_das... | {
"repo_name": "tuskar/tuskar-ui",
"path": "openstack_dashboard/dashboards/admin/volumes/tables.py",
"copies": "3",
"size": "2260",
"license": "apache-2.0",
"hash": 7843114055227840000,
"line_mean": 31.7536231884,
"line_max": 77,
"alpha_frac": 0.6411504425,
"autogenerated": false,
"ratio": 4.11657... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.api import cinder
from openstack_dashboard.dashboards.project.volumes.tables import (UpdateRow,
VolumesTable as _VolumesTable, DeleteVolume)
class CreateVolumeType(tables.LinkAction):
name = "creat... | {
"repo_name": "fmyzjs/horizon-hacker",
"path": "openstack_dashboard/dashboards/admin/volumes/tables.py",
"copies": "9",
"size": "1807",
"license": "apache-2.0",
"hash": -3074779126213308400,
"line_mean": 31.2678571429,
"line_max": 77,
"alpha_frac": 0.6275594909,
"autogenerated": false,
"ratio": 4... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
import openstack_dashboard.models as fogbow_models
from horizon import messages
REQUEST_TERM = fogbow_models.FogbowConstants.REQUEST_TERM
class TerminateRequest(tables.BatchAction):
name = 'terminate'
action_present = _('Term... | {
"repo_name": "fogbow/fogbow-dashboard",
"path": "openstack_dashboard/dashboards/fogbow/request/tables.py",
"copies": "1",
"size": "2399",
"license": "apache-2.0",
"hash": 4952327003271544000,
"line_mean": 34.8208955224,
"line_max": 96,
"alpha_frac": 0.6327636515,
"autogenerated": false,
"ratio":... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
class EquipmentListFilterAction(tables.FilterAction):
name = "filter"
class NodeListTable(tables.DataTable):
id = tables.Column("id", verbose_name=_("ID"), hidden=True)
hostname = tables.Column("hostname",
... | {
"repo_name": "zouyapeng/horizon-newtouch",
"path": "openstack_dashboard/dashboards/monitor/equipment_monitor/tables.py",
"copies": "2",
"size": "2926",
"license": "apache-2.0",
"hash": -6894027313326349000,
"line_mean": 42.0294117647,
"line_max": 87,
"alpha_frac": 0.6209842789,
"autogenerated": fa... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
class MembersTable(tables.DataTable):
idMember = tables.Column("idMember", verbose_name=_("Member ID"))
cpuIdle = tables.Column("cpuIdle", verbose_name=_("Shared vCPU Quota"))
cpuInUse = tables.Column("cpuInUse", verbose_n... | {
"repo_name": "fogbow/fogbow-dashboard",
"path": "openstack_dashboard/dashboards/fogbow/members/tables.py",
"copies": "1",
"size": "1102",
"license": "apache-2.0",
"hash": -3276584395791887000,
"line_mean": 54.15,
"line_max": 98,
"alpha_frac": 0.7014519056,
"autogenerated": false,
"ratio": 3.9783... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.integra.actions import utils
class AddTableData(tables.LinkAction):
name = "add"
verbose_name = _("Add Action")
url = "horizon:integra:actions:create"
classes = ("btn-launch", "ajax... | {
"repo_name": "emitrom/integra-openstack-ui",
"path": "actions/tables.py",
"copies": "1",
"size": "1439",
"license": "apache-2.0",
"hash": -8661630363396803000,
"line_mean": 27.2156862745,
"line_max": 64,
"alpha_frac": 0.6122307158,
"autogenerated": false,
"ratio": 4.171014492753623,
"config_te... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.integra.jobs import utils
class DeleteTableData(tables.DeleteAction):
data_type_singular = _("Job")
data_type_plural = _("Jobs")
def delete(self, request, obj_id):
utils.deleteJ... | {
"repo_name": "emitrom/integra-openstack-ui",
"path": "jobs/tables.py",
"copies": "1",
"size": "1394",
"license": "apache-2.0",
"hash": 4613610858494726000,
"line_mean": 28.0416666667,
"line_max": 61,
"alpha_frac": 0.5954088953,
"autogenerated": false,
"ratio": 4.35625,
"config_test": false,
... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.integra.providers import utils
class AddTableData(tables.LinkAction):
name = "add"
verbose_name = _("Add Provider")
url = "horizon:integra:providers:add"
classes = ("btn-launch", "a... | {
"repo_name": "emitrom/integra-openstack-ui",
"path": "providers/tables.py",
"copies": "1",
"size": "1792",
"license": "apache-2.0",
"hash": 2426728011523833000,
"line_mean": 28.3770491803,
"line_max": 66,
"alpha_frac": 0.5904017857,
"autogenerated": false,
"ratio": 4.424691358024691,
"config_t... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.integra.workflows import utils
class AddTableData(tables.LinkAction):
name = "add"
verbose_name = _("Add Workflow")
url = "horizon:integra:workflows:create"
classes = ("btn-launch", ... | {
"repo_name": "emitrom/integra-openstack-ui",
"path": "workflows/tables.py",
"copies": "1",
"size": "1677",
"license": "apache-2.0",
"hash": 8880297826838098000,
"line_mean": 28.9464285714,
"line_max": 66,
"alpha_frac": 0.6285032797,
"autogenerated": false,
"ratio": 4.150990099009901,
"config_t... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
'''class LaunchCatalogLink(tables.LinkAction):
name = "create"
verbose_name = _("Launch Service Catalog")
url = "horizon:nikolaboard:catalogpanel:launch"
def allowed(self, request, iam_user):
return True'''
... | {
"repo_name": "AlexOugh/horizon",
"path": "openstack_dashboard/dashboards/nikolaboard/iams/tables.py",
"copies": "1",
"size": "1028",
"license": "apache-2.0",
"hash": -3826222900800986600,
"line_mean": 37.0740740741,
"line_max": 108,
"alpha_frac": 0.6819066148,
"autogenerated": false,
"ratio": 3.... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
class LaunchWorkflowLink(tables.LinkAction):
name = "create"
verbose_name = _("Launch Workflow")
url = "horizon:nikolaboard:workflowpanel:launch"
def allowed(self, request, user):
return True
class WorkflowT... | {
"repo_name": "AlexOugh/horizon",
"path": "openstack_dashboard/dashboards/nikolaboard/workflowpanel/tables.py",
"copies": "1",
"size": "1395",
"license": "apache-2.0",
"hash": 6910708342767788000,
"line_mean": 33.875,
"line_max": 105,
"alpha_frac": 0.6630824373,
"autogenerated": false,
"ratio": 3... |
from django.utils.translation import ugettext_lazy as _
from is_core.auth.permissions import PermissionsSet, SelfPermission, IsSuperuser
from is_core.main import UIRESTModelISCore, UIRESTISCore
from is_core.utils.decorators import short_description
from .models import ExportedFile
from .resource import CeleryRESTMode... | {
"repo_name": "matllubos/django-is-core",
"path": "is_core/contrib/background_export/cores.py",
"copies": "1",
"size": "2564",
"license": "bsd-3-clause",
"hash": -2415851257013886500,
"line_mean": 32.2987012987,
"line_max": 115,
"alpha_frac": 0.6797971919,
"autogenerated": false,
"ratio": 3.83832... |
from django.utils.translation import ugettext_lazy as _
from mapentity.filters import MapEntityFilterSet
from geotrek.common.models import Organism
from geotrek.common.filters import StructureRelatedFilterSet
from geotrek.core.filters import TopologyFilter, PathFilterSet, TrailFilterSet
from geotrek.infrastructure.f... | {
"repo_name": "mabhub/Geotrek",
"path": "geotrek/land/filters.py",
"copies": "3",
"size": "3208",
"license": "bsd-2-clause",
"hash": -2960268241986353000,
"line_mean": 27.9009009009,
"line_max": 102,
"alpha_frac": 0.7612219451,
"autogenerated": false,
"ratio": 3.674684994272623,
"config_test": ... |
from django.utils.translation import ugettext_lazy as _
from mapentity.filters import PolygonFilter, PythonPolygonFilter
from geotrek.core.models import Topology
from geotrek.common.filters import (
StructureRelatedFilterSet, YearFilter, YearBetweenFilter)
from geotrek.common.widgets import YearSelect
from .mode... | {
"repo_name": "johan--/Geotrek",
"path": "geotrek/maintenance/filters.py",
"copies": "3",
"size": "1944",
"license": "bsd-2-clause",
"hash": -163433641126583070,
"line_mean": 31.4,
"line_max": 75,
"alpha_frac": 0.6553497942,
"autogenerated": false,
"ratio": 4.10126582278481,
"config_test": fals... |
from django.utils.translation import ugettext_lazy as _
from mapentity.filters import YearFilter
from geotrek.common.filters import StructureRelatedFilterSet
from geotrek.maintenance.filters import InterventionYearSelect
from .models import INFRASTRUCTURE_TYPES, Infrastructure, Signage
class InfrastructureFilterSet... | {
"repo_name": "camillemonchicourt/Geotrek",
"path": "geotrek/infrastructure/filters.py",
"copies": "1",
"size": "1565",
"license": "bsd-2-clause",
"hash": -2552932811891729400,
"line_mean": 41.2972972973,
"line_max": 82,
"alpha_frac": 0.6722044728,
"autogenerated": false,
"ratio": 4.2527173913043... |
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import register_setting
register_setting(
name="SITE_FULL_TITLE",
label=_("Full Site Title"),
description="Expanded title",
editable=True,
default="People's Archive of Rural India",
)
register_setting(
name="SITE_ANNO... | {
"repo_name": "RuralIndia/pari",
"path": "pari/article/defaults.py",
"copies": "1",
"size": "3940",
"license": "bsd-3-clause",
"hash": 6733939052390864000,
"line_mean": 25.0927152318,
"line_max": 131,
"alpha_frac": 0.6692893401,
"autogenerated": false,
"ratio": 3.6279926335174952,
"config_test"... |
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import register_setting
register_setting(
name="TAX_SHOP_ADDRESS",
label=_("Shop Street Address"),
description=_("Street address of the originating shipping \
address."),
editable=True,
def... | {
"repo_name": "kenbolton/cartridge-tax",
"path": "cartridge_tax/defaults.py",
"copies": "1",
"size": "3378",
"license": "bsd-2-clause",
"hash": 1836663177279711200,
"line_mean": 26.6885245902,
"line_max": 91,
"alpha_frac": 0.5660153937,
"autogenerated": false,
"ratio": 4.353092783505154,
"confi... |
from django.utils.translation import ugettext_lazy as _
from .models import TouristicContent, TouristicEvent
from geotrek.common.forms import CommonForm
class TouristicContentForm(CommonForm):
geomfields = ['geom']
class Meta:
fields = ['name', 'category', 'type1', 'type2', 'review', 'published',
... | {
"repo_name": "johan--/Geotrek",
"path": "geotrek/tourism/forms.py",
"copies": "2",
"size": "1903",
"license": "bsd-2-clause",
"hash": 8965549099370207000,
"line_mean": 43.2558139535,
"line_max": 86,
"alpha_frac": 0.5848660011,
"autogenerated": false,
"ratio": 3.7387033398821217,
"config_test":... |
from django.utils.translation import ugettext_lazy as _
from multi_import.data import MultiExportResult, MultiImportResult
from multi_import.exceptions import InvalidDatasetError, InvalidFileError
from multi_import.formats import all_formats, supported_mimetypes
from multi_import.helpers import files as file_helper
fr... | {
"repo_name": "sdelements/django-multi-import",
"path": "multi_import/multi_importer.py",
"copies": "1",
"size": "6712",
"license": "mit",
"hash": -155448779736546850,
"line_mean": 33.0710659898,
"line_max": 84,
"alpha_frac": 0.5643623361,
"autogenerated": false,
"ratio": 4.726760563380282,
"co... |
from django.utils.translation import ugettext_lazy as _
from olympia.versions.compare import version_int as vint
from base import * # noqa
class App:
@classmethod
def matches_user_agent(cls, user_agent):
return cls.user_agent_string in user_agent
# Applications
class FIREFOX(App):
id = 1
... | {
"repo_name": "andymckay/olympia",
"path": "src/olympia/constants/applications.py",
"copies": "2",
"size": "5929",
"license": "bsd-3-clause",
"hash": -7121614773457815000,
"line_mean": 31.3989071038,
"line_max": 78,
"alpha_frac": 0.6350143363,
"autogenerated": false,
"ratio": 3.0752074688796682,
... |
from django.utils.translation import ugettext_lazy as _
from olympia.versions.compare import version_int as vint
from base import * # noqa
class App(object):
@classmethod
def matches_user_agent(cls, user_agent):
return cls.user_agent_string in user_agent
# Applications
class FIREFOX(App):
id ... | {
"repo_name": "Revanth47/addons-server",
"path": "src/olympia/constants/applications.py",
"copies": "4",
"size": "5937",
"license": "bsd-3-clause",
"hash": -5222436734940306000,
"line_mean": 31.4426229508,
"line_max": 78,
"alpha_frac": 0.6351692774,
"autogenerated": false,
"ratio": 3.076165803108... |
from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket import signals
from oscar.core.loading import get_model, get_class
from rest_framework import status, generics, exceptions
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.view... | {
"repo_name": "lijoantony/django-oscar-api",
"path": "oscarapi/views/basket.py",
"copies": "1",
"size": "8398",
"license": "bsd-3-clause",
"hash": 5560436238360525000,
"line_mean": 32.7269076305,
"line_max": 95,
"alpha_frac": 0.6259823768,
"autogenerated": false,
"ratio": 4.161546085232904,
"co... |
from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket import signals
from oscar.core.loading import get_model
from rest_framework import status, generics, exceptions
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import AP... | {
"repo_name": "KuwaitNET/django-oscar-api",
"path": "oscarapi/views/basket.py",
"copies": "1",
"size": "6657",
"license": "bsd-3-clause",
"hash": -7894701620197899000,
"line_mean": 33.4922279793,
"line_max": 135,
"alpha_frac": 0.6342196184,
"autogenerated": false,
"ratio": 4.06658521686011,
"co... |
from django.utils.translation import ugettext_lazy as _
from oscar.apps.payment.exceptions import UnableToTakePayment
from oscar.core.loading import get_model
from accounts import facade, exceptions, core, codes
Account = get_model('accounts', 'Account')
Transfer = get_model('accounts', 'Transfer')
def user_accoun... | {
"repo_name": "Jannes123/django-oscar-accounts",
"path": "accounts/checkout/gateway.py",
"copies": "1",
"size": "2007",
"license": "bsd-3-clause",
"hash": -1370558093529654000,
"line_mean": 32.45,
"line_max": 82,
"alpha_frac": 0.6641753861,
"autogenerated": false,
"ratio": 4.334773218142549,
"c... |
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class, get_model
ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
ReportCSVFormatter = get_class('dashboard.reports.reports',
'ReportCSVFormatter')
ReportHTMLFormatter =... | {
"repo_name": "akiyoko/oscar_project",
"path": "src/oscar/apps/basket/reports.py",
"copies": "25",
"size": "4505",
"license": "bsd-3-clause",
"hash": -1965994276184927200,
"line_mean": 35.3306451613,
"line_max": 76,
"alpha_frac": 0.5667036626,
"autogenerated": false,
"ratio": 4.4960079840319365,
... |
from django.utils.translation import ugettext_lazy as _
from poradnia.cases.models import Case
from poradnia.stats.utils import filter_month
def cases_count(*args, **kwargs):
return Case.objects.count()
cases_count.name = _("Cases count")
cases_count.description = _("Total cases registered")
def cases_status... | {
"repo_name": "watchdogpolska/poradnia",
"path": "poradnia/cases/metric.py",
"copies": "3",
"size": "1114",
"license": "mit",
"hash": 4233669166078055000,
"line_mean": 26.85,
"line_max": 68,
"alpha_frac": 0.7298025135,
"autogenerated": false,
"ratio": 3.5935483870967744,
"config_test": false,
... |
from django.utils.translation import ugettext_lazy as _
from pyston.utils import JsonObj
class Action(JsonObj):
def __init__(self, name, verbose_name, type, class_name=None):
super(Action, self).__init__()
self.name = name
self.verbose_name = verbose_name
self.type = type
... | {
"repo_name": "matllubos/django-is-core",
"path": "is_core/actions.py",
"copies": "1",
"size": "1629",
"license": "bsd-3-clause",
"hash": 1342247785284362500,
"line_mean": 31.58,
"line_max": 119,
"alpha_frac": 0.6132596685,
"autogenerated": false,
"ratio": 3.7534562211981566,
"config_test": fal... |
from django.utils.translation import ugettext_lazy as _
from rdmo.core.validators import (InstanceValidator, LockedValidator,
UniqueURIValidator)
from .models import Attribute
class AttributeUniqueURIValidator(UniqueURIValidator):
model = Attribute
def get_uri(self, data)... | {
"repo_name": "rdmorganiser/rdmo",
"path": "rdmo/domain/validators.py",
"copies": "1",
"size": "1747",
"license": "apache-2.0",
"hash": 2674498609862070000,
"line_mean": 36.170212766,
"line_max": 126,
"alpha_frac": 0.5781339439,
"autogenerated": false,
"ratio": 4.747282608695652,
"config_test":... |
from django.utils.translation import ugettext_lazy as _
from rdmo.core.validators import LockedValidator, UniqueURIValidator
from .models import Catalog, Question, QuestionSet, Section
class CatalogUniqueURIValidator(UniqueURIValidator):
model = Catalog
def get_uri(self, data):
if data.get('key') ... | {
"repo_name": "rdmorganiser/rdmo",
"path": "rdmo/questions/validators.py",
"copies": "1",
"size": "2457",
"license": "apache-2.0",
"hash": 1913965158865641500,
"line_mean": 28.9634146341,
"line_max": 90,
"alpha_frac": 0.6353276353,
"autogenerated": false,
"ratio": 4.0212765957446805,
"config_te... |
from django.utils.translation import ugettext_lazy as _
from rdmo.core.validators import LockedValidator, UniqueURIValidator
from .models import Option, OptionSet
class OptionSetUniqueURIValidator(UniqueURIValidator):
model = OptionSet
def get_uri(self, data):
if data.get('key') is None:
... | {
"repo_name": "rdmorganiser/rdmo",
"path": "rdmo/options/validators.py",
"copies": "1",
"size": "1187",
"license": "apache-2.0",
"hash": -2486302307371782000,
"line_mean": 27.2619047619,
"line_max": 88,
"alpha_frac": 0.649536647,
"autogenerated": false,
"ratio": 3.9698996655518393,
"config_test... |
from django.utils.translation import ugettext_lazy as _
from rest_framework.authentication import BaseAuthentication
from rest_framework.authentication import get_authorization_header
from rest_framework.exceptions import AuthenticationFailed
from msa.utils.ipware import get_ip
from .models import SToken
class ST... | {
"repo_name": "haoyutan/MSA-Framework",
"path": "modules/msa/msa/contrib/authstoken/authentication.py",
"copies": "1",
"size": "2361",
"license": "mit",
"hash": 7506102095201855000,
"line_mean": 30.0657894737,
"line_max": 96,
"alpha_frac": 0.6539601864,
"autogenerated": false,
"ratio": 4.60233918... |
from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from .serializers import AuthTokenFacebookSerializer
... | {
"repo_name": "jsmesami/naovoce",
"path": "src/user/api/token_auth/views.py",
"copies": "1",
"size": "1082",
"license": "bsd-3-clause",
"hash": -694308006023684900,
"line_mean": 30.8235294118,
"line_max": 70,
"alpha_frac": 0.7033271719,
"autogenerated": false,
"ratio": 4.243137254901961,
"confi... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import filters
from rest_framework import serializers
from rest_framework.permissions import IsAuthenticated
from rest_framework import viewsets
class MarketViewSet(viewsets.ModelViewSet):
"""
### *Urls*\n
query_params = ... | {
"repo_name": "we-inc/mms-snow-white-and-the-seven-pandas",
"path": "webserver/views.py",
"copies": "1",
"size": "1950",
"license": "mit",
"hash": 281260593860251520,
"line_mean": 41.3913043478,
"line_max": 102,
"alpha_frac": 0.6512820513,
"autogenerated": false,
"ratio": 3.8767395626242545,
"c... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import mixins, viewsets
from .serializers import ChoicesSerializer
from rest_framework.exceptions import ParseError
class ChoicesViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):
serializer_class = ChoicesSerializer
class RowV... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/core/viewsets.py",
"copies": "1",
"size": "2094",
"license": "apache-2.0",
"hash": -3422424750991433700,
"line_mean": 32.2380952381,
"line_max": 104,
"alpha_frac": 0.6122254059,
"autogenerated": false,
"ratio": 4.247464503042596,
"c... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import response, status
from rest_framework.decorators import action
from core import models as core
from core.api.mixins import (
CompanyReadOnlyViewSet, CompanyViewSet, NestedReadOnlyViewset
)
from core.constants import LEVEL_SUCCESS
fr... | {
"repo_name": "ikcam/django-skeleton",
"path": "panel/api/views.py",
"copies": "1",
"size": "2714",
"license": "bsd-3-clause",
"hash": -283128904025788960,
"line_mean": 30.1954022989,
"line_max": 75,
"alpha_frac": 0.6834929993,
"autogenerated": false,
"ratio": 4.1059001512859306,
"config_test":... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.compat import authenticate
class AuthTokenSerializer(serializers.Serializer):
username = serializers.CharField(label=_("Username"))
password = serializers.CharField(
label=_("Password"),... | {
"repo_name": "dmwyatt/django-rest-framework",
"path": "rest_framework/authtoken/serializers.py",
"copies": "1",
"size": "1467",
"license": "bsd-2-clause",
"hash": -8862147444452727000,
"line_mean": 37.6052631579,
"line_max": 80,
"alpha_frac": 0.6039536469,
"autogenerated": false,
"ratio": 5.2206... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from phonenumber_field.phonenumber import to_python
from .models import Profile
class PhoneNumberField(serializers.CharField):
default_error_messages = {
... | {
"repo_name": "jsbUSMC/django-edge-api",
"path": "apps/profiles/serializers.py",
"copies": "1",
"size": "1440",
"license": "mit",
"hash": -1041124523318009300,
"line_mean": 32.488372093,
"line_max": 89,
"alpha_frac": 0.6645833333,
"autogenerated": false,
"ratio": 4.126074498567335,
"config_test... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from mymoney.core.validators import MinMaxValidator
from mymoney.tags.models import Tag
from mymoney.tags.serializers import TagSerializer
class BaseRatioSerializer(serializers.Serializer):
SINGLE_CREDIT = 'single_cr... | {
"repo_name": "ychab/mymoney-server",
"path": "mymoney/analytics/serializers.py",
"copies": "1",
"size": "2442",
"license": "bsd-3-clause",
"hash": 5573669599195329000,
"line_mean": 27.3953488372,
"line_max": 73,
"alpha_frac": 0.6478296478,
"autogenerated": false,
"ratio": 4.023064250411862,
"c... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from olympia.users.serializers import BaseUserSerializer
from olympia.devhub.models import ActivityLog
class ActivityLogSerializer(serializers.ModelSerializer):
action = serializers.SerializerMethodField()
action_... | {
"repo_name": "Revanth47/addons-server",
"path": "src/olympia/activity/serializers.py",
"copies": "3",
"size": "1380",
"license": "bsd-3-clause",
"hash": -4984790227788345000,
"line_mean": 35.3157894737,
"line_max": 78,
"alpha_frac": 0.6739130435,
"autogenerated": false,
"ratio": 4.11940298507462... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rdmo.core.serializers import MarkdownSerializerMixin
from rdmo.conditions.models import Condition
from rdmo.domain.models import Attribute
from rdmo.options.models import OptionSet, Option
from rdmo.questions.models i... | {
"repo_name": "DMPwerkzeug/DMPwerkzeug",
"path": "rdmo/projects/serializers/v1/questionset.py",
"copies": "1",
"size": "4190",
"license": "apache-2.0",
"hash": -2055857169833144000,
"line_mean": 23.6470588235,
"line_max": 82,
"alpha_frac": 0.5844868735,
"autogenerated": false,
"ratio": 4.62472406... |
from django.utils.translation import ugettext_lazy as _
from summary.parsers.approaches_2015 import Approach2015Parser
from summary.renderers.summary import GlobalValuesMixin, SummaryRenderer
class Approaches2015FullSummaryRenderer(GlobalValuesMixin, SummaryRenderer):
"""
Configuration for 'full' approaches ... | {
"repo_name": "CDE-UNIBE/qcat",
"path": "apps/summary/renderers/approaches_2015.py",
"copies": "1",
"size": "15113",
"license": "apache-2.0",
"hash": -1407905143324866600,
"line_mean": 46.8259493671,
"line_max": 139,
"alpha_frac": 0.425726196,
"autogenerated": false,
"ratio": 4.979571663920923,
... |
from django.utils.translation import ugettext_lazy as _
from summary.parsers.technologies_2015 import Technology2015Parser
from summary.renderers.summary import GlobalValuesMixin, SummaryRenderer
class Technology2015FullSummaryRenderer(GlobalValuesMixin, SummaryRenderer):
"""
Configuration for 'full' technol... | {
"repo_name": "CDE-UNIBE/qcat",
"path": "apps/summary/renderers/technologies_2015.py",
"copies": "1",
"size": "24906",
"license": "apache-2.0",
"hash": -5924256264883014000,
"line_mean": 42.541958042,
"line_max": 141,
"alpha_frac": 0.4539468401,
"autogenerated": false,
"ratio": 4.606251155909007,... |
from django.utils.translation import ugettext_lazy as _
from tenant_extras.utils import TenantLanguage
from bluebottle.bb_tasks.models import BaseTask
from bluebottle.wallposts.notifiers import (WallpostObserver, ReactionObserver,
ObserversContainer)
from bluebottle.utils.e... | {
"repo_name": "jfterpstra/bluebottle",
"path": "bluebottle/bb_tasks/taskwallmails.py",
"copies": "1",
"size": "4261",
"license": "bsd-3-clause",
"hash": 5342490711531659000,
"line_mean": 36.052173913,
"line_max": 83,
"alpha_frac": 0.5367284675,
"autogenerated": false,
"ratio": 4.415544041450778,
... |
from django.utils.translation import ugettext_lazy as __
from wagtail.wagtailcore.models import Site
from wagtail.wagtailcore.permissions import site_permission_policy
from wagtail.wagtailsites.forms import SiteForm
from wagtail.wagtailadmin.views.generic import IndexView, CreateView, EditView, DeleteView
class Inde... | {
"repo_name": "gogobook/wagtail",
"path": "wagtail/wagtailsites/views.py",
"copies": "4",
"size": "1845",
"license": "bsd-3-clause",
"hash": 7286312792431881000,
"line_mean": 32.5454545455,
"line_max": 90,
"alpha_frac": 0.6861788618,
"autogenerated": false,
"ratio": 3.6752988047808763,
"config_... |
from django.utils.translation import ugettext_lazy as __
from wagtail.wagtailcore.models import Site
from wagtail.wagtailsites.forms import SiteForm
from wagtail.wagtailadmin.views.generic import IndexView, CreateView, EditView, DeleteView
class Index(IndexView):
any_permission_required = ['wagtailcore.add_site'... | {
"repo_name": "serzans/wagtail",
"path": "wagtail/wagtailsites/views.py",
"copies": "16",
"size": "1956",
"license": "bsd-3-clause",
"hash": 7380094499223824000,
"line_mean": 33.9285714286,
"line_max": 108,
"alpha_frac": 0.68200409,
"autogenerated": false,
"ratio": 3.6155268022181146,
"config_t... |
from django.utils.translation import ugettext_lazy as _
from waldur_mastermind.marketplace import processors, signals
from waldur_mastermind.marketplace.processors import get_order_item_post_data
from waldur_mastermind.marketplace_openstack import views
from waldur_openstack.openstack import models as openstack_models... | {
"repo_name": "opennode/waldur-mastermind",
"path": "src/waldur_mastermind/marketplace_openstack/processors.py",
"copies": "1",
"size": "2807",
"license": "mit",
"hash": -341451668115588160,
"line_mean": 28.2395833333,
"line_max": 83,
"alpha_frac": 0.672960456,
"autogenerated": false,
"ratio": 4.... |
from django.utils.translation import ugettext_lazy as _
GAME_MODES = (
('stunt', _('stunt race')),
('land', _('land race')),
)
ROUTE_TYPES = (
('l', _('laps')),
('p', _('point to point')),
)
PLATFORM_CHOICES = (
('pc', _('PC')),
('ps4', _('PS 4')),
('xb1', _('XBox One')),
)
SSR_ALGORITHM... | {
"repo_name": "abecede753/trax",
"path": "website/trax/choices.py",
"copies": "1",
"size": "1123",
"license": "mit",
"hash": 3385499804444892700,
"line_mean": 18.701754386,
"line_max": 55,
"alpha_frac": 0.4692787177,
"autogenerated": false,
"ratio": 3.302941176470588,
"config_test": false,
"h... |
from django.utils.translation import ugettext_lazy as _
HTTP_200 = 200
HTTP_201 = 201
HTTP_202 = 202
HTTP_203 = 203
HTTP_204 = 204
HTTP_205 = 205
HTTP_206 = 206
HTTP_301 = 301
HTTP_302 = 302
HTTP_303 = 303
HTTP_304 = 304
HTTP_305 = 305
HTTP_307 = 307
HTTP_400 = 400
HTTP_401 = 401
HTTP_403 = 403
HTTP_404 = 404
HTTP_405... | {
"repo_name": "theteam/django-scout",
"path": "scout/choices.py",
"copies": "1",
"size": "2782",
"license": "bsd-3-clause",
"hash": -1009835290565721100,
"line_mean": 33.775,
"line_max": 73,
"alpha_frac": 0.6153846154,
"autogenerated": false,
"ratio": 3.1506228765571915,
"config_test": false,
... |
from django.utils.translation import ugettext_lazy as _
import account.forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div
from crispy_forms.bootstrap import FormActions, StrictButton
class LoginForm(account.forms.LoginUsernameForm):
def __init__(self, *args, **kwargs):
... | {
"repo_name": "CodeCarrots/challenge-app",
"path": "app/accounts/forms.py",
"copies": "1",
"size": "1834",
"license": "mit",
"hash": 2973683033810313000,
"line_mean": 33.6037735849,
"line_max": 71,
"alpha_frac": 0.5474372955,
"autogenerated": false,
"ratio": 3.9188034188034186,
"config_test": f... |
from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionSlugFilter(django_filters.FilterSet):
class Meta:
model =... | {
"repo_name": "sils1297/readthedocs.org",
"path": "readthedocs/builds/filters.py",
"copies": "12",
"size": "1288",
"license": "mit",
"hash": 119207720603660540,
"line_mean": 27,
"line_max": 98,
"alpha_frac": 0.5923913043,
"autogenerated": false,
"ratio": 4.366101694915254,
"config_test": false,... |
from django.utils.translation import ugettext_lazy as _
import django_filters
from geotrek.common.filters import StructureRelatedFilterSet
from django.utils.datetime_safe import datetime
from .models import TouristicContent, TouristicEvent
class TouristicContentFilterSet(StructureRelatedFilterSet):
class Meta(... | {
"repo_name": "Anaethelion/Geotrek",
"path": "geotrek/tourism/filters.py",
"copies": "1",
"size": "1953",
"license": "bsd-2-clause",
"hash": 4509457427050751000,
"line_mean": 28.5909090909,
"line_max": 76,
"alpha_frac": 0.6891961086,
"autogenerated": false,
"ratio": 4.0102669404517455,
"config_... |
from django.utils.translation import ugettext_lazy as _
import django_filters
from geotrek.common.filters import StructureRelatedFilterSet
from .models import TouristicContent, TouristicEvent
class TouristicContentFilterSet(StructureRelatedFilterSet):
class Meta(StructureRelatedFilterSet.Meta):
model =... | {
"repo_name": "mabhub/Geotrek",
"path": "geotrek/tourism/filters.py",
"copies": "2",
"size": "1093",
"license": "bsd-2-clause",
"hash": -613663915640933200,
"line_mean": 31.1470588235,
"line_max": 76,
"alpha_frac": 0.7200365965,
"autogenerated": false,
"ratio": 3.9035714285714285,
"config_test"... |
from django.utils.translation import ugettext_lazy as _
import django_filters
from projects import constants
from projects.models import Project
ANY_REPO = (
('', _('Any')),
)
REPO_CHOICES = ANY_REPO + constants.REPO_CHOICES
def sort_slug(queryset, query):
queryset = queryset.filter(slug__icontains=query)
... | {
"repo_name": "1suming/readthedocs.org",
"path": "readthedocs/projects/filters.py",
"copies": "4",
"size": "1834",
"license": "mit",
"hash": -9055334642698708000,
"line_mean": 38.0212765957,
"line_max": 96,
"alpha_frac": 0.6281352236,
"autogenerated": false,
"ratio": 3.735234215885947,
"config_... |
from django.utils.translation import ugettext_lazy as _
import django_filters
from readthedocs.builds import constants
from readthedocs.builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionSlugFilter(django_filters.FilterSet):
cla... | {
"repo_name": "tddv/readthedocs.org",
"path": "readthedocs/builds/filters.py",
"copies": "1",
"size": "1312",
"license": "mit",
"hash": 6854014078385468000,
"line_mean": 27.5217391304,
"line_max": 98,
"alpha_frac": 0.5983231707,
"autogenerated": false,
"ratio": 4.358803986710964,
"config_test":... |
from django.utils.translation import ugettext_lazy as _
import django_filters
from readthedocs.projects import constants
from readthedocs.projects.models import Project
ANY_REPO = (
('', _('Any')),
)
REPO_CHOICES = ANY_REPO + constants.REPO_CHOICES
def sort_slug(queryset, query):
queryset = queryset.filte... | {
"repo_name": "hach-que/readthedocs.org",
"path": "readthedocs/projects/filters.py",
"copies": "8",
"size": "1896",
"license": "mit",
"hash": 4020920074123834000,
"line_mean": 37.693877551,
"line_max": 101,
"alpha_frac": 0.6271097046,
"autogenerated": false,
"ratio": 3.784431137724551,
"config_... |
from django.utils.translation import ugettext_lazy as _
import floppyforms as forms
from geotrek.common.forms import CommonForm
from geotrek.core.widgets import LineTopologyWidget
from geotrek.core.models import Path, Trail
from geotrek.core.helpers import PathHelper
from geotrek.core.fields import TopologyField, Sna... | {
"repo_name": "johan--/Geotrek",
"path": "geotrek/core/forms.py",
"copies": "3",
"size": "3485",
"license": "bsd-2-clause",
"hash": 6389689145565045000,
"line_mean": 32.8349514563,
"line_max": 90,
"alpha_frac": 0.6140602582,
"autogenerated": false,
"ratio": 4.158711217183771,
"config_test": fal... |
from django.utils.translation import ugettext_lazy as _
import horizon
from contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking.panel \
import Networking
from contrail_openstack_dashboard.openstack_dashboard.dashboards.admin.networking.panel \
import AdminNetworking
from contrail_op... | {
"repo_name": "Juniper/contrail-horizon",
"path": "overrides.py",
"copies": "1",
"size": "3033",
"license": "apache-2.0",
"hash": -5638475494470106000,
"line_mean": 31.6129032258,
"line_max": 105,
"alpha_frac": 0.7260138477,
"autogenerated": false,
"ratio": 3.9750982961992136,
"config_test": fa... |
from django.utils.translation import ugettext_lazy as _
import jsonfield
from datetime import datetime
from decimal import Decimal, InvalidOperation
from django.db import models
class EmergencyOrderStatusUpdate(models.Model):
STATUS_PENDING = 'pending'
STATUS_ERROR = 'error'
STATUS_RECEIVED = 'received'
... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "custom/zipline/models.py",
"copies": "1",
"size": "15652",
"license": "bsd-3-clause",
"hash": -7780640872227424000,
"line_mean": 39.6545454545,
"line_max": 100,
"alpha_frac": 0.6893048812,
"autogenerated": false,
"ratio": 4.344157646405773,
"con... |
from django.utils.translation import ugettext_lazy as _
import recurrence
FREQUENCY_CHOICES = (
(recurrence.SECONDLY, _('Secondly')),
(recurrence.MINUTELY, _('Minutely')),
(recurrence.HOURLY, _('Hourly')),
(recurrence.DAILY, _('Daily')),
(recurrence.WEEKLY, _('Weekly')),
(recurrence.MONTHLY, ... | {
"repo_name": "linux2400/django-recurrence",
"path": "recurrence/choices.py",
"copies": "5",
"size": "1282",
"license": "bsd-3-clause",
"hash": -3729050024375016000,
"line_mean": 26.8695652174,
"line_max": 55,
"alpha_frac": 0.6068642746,
"autogenerated": false,
"ratio": 2.9269406392694064,
"con... |
from django.utils.translation import ugettext_lazy as _
import reporting
from tms.models import *
from tms.forms import *
import datetime
class ProjectDetailsReport(reporting.Report):
# Related model class
model = Timesheet
# Form class
form_class = ProjectDetailsForm
# Relative path to report te... | {
"repo_name": "MVReddy/TMS",
"path": "adlibre_tms/apps/tms/reports.py",
"copies": "3",
"size": "10752",
"license": "bsd-3-clause",
"hash": 180571596481130660,
"line_mean": 41.4980237154,
"line_max": 132,
"alpha_frac": 0.5749627976,
"autogenerated": false,
"ratio": 4.406557377049181,
"config_tes... |
from django.utils.translation import ugettext_lazy as _
INCIDENTS = {
# General message to display when readonly mode is off
"default": {
"readonly": False,
"message": _("There was a problem with a third-party service. "
"This means certain operations might be blocked. "
... | {
"repo_name": "DXCanas/content-curation",
"path": "contentcuration/contentcuration/utils/incidents.py",
"copies": "3",
"size": "3535",
"license": "mit",
"hash": 2269805802975825000,
"line_mean": 48.0972222222,
"line_max": 85,
"alpha_frac": 0.5626591231,
"autogenerated": false,
"ratio": 4.82264665... |
from django.utils.translation import ugettext_lazy as _
INVALID_MESSAGE = _('Sorry, I could not understand your message.'
' Please contact your DHIO for help, or visit http://www.ewsghana.com')
INVALID_PRODUCT_CODE = _('%s is not a recognized commodity code. Please contact your DHIO or RHIO for he... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "custom/ewsghana/handlers/__init__.py",
"copies": "1",
"size": "1365",
"license": "bsd-3-clause",
"hash": -8469443590937582000,
"line_mean": 51.5,
"line_max": 111,
"alpha_frac": 0.6600732601,
"autogenerated": false,
"ratio": 3.877840909090909,
"c... |
from django.utils.translation import ugettext_lazy as _
LICENSE_CC0 = 'CC0'
LICENSE_PD = 'PD'
LICENSE_BY = 'BY'
LICENSE_BY_SA = 'BY_SA'
LICENSE_BY_ND = 'BY_ND'
LICENSE_BY_NC = 'BY_NC'
LICENSE_BY_NC_SA = 'BY_NC_SA'
LICENSE_BY_NC_ND = 'BY_NC_ND'
LICENSE_CHOICES = (
(LICENSE_CC0, _('CC0 1.0 Universal (CC0 1.0)')),
... | {
"repo_name": "aipescience/django-daiquiri",
"path": "daiquiri/core/constants.py",
"copies": "1",
"size": "3717",
"license": "apache-2.0",
"hash": -4590392305987821600,
"line_mean": 37.71875,
"line_max": 104,
"alpha_frac": 0.651062685,
"autogenerated": false,
"ratio": 2.9617529880478086,
"confi... |
from django.utils.translation import ugettext_lazy as _
LOOKUP_TABLES = 'lookup_tables'
API_ACCESS = 'api_access'
CLOUDCARE = 'cloudcare'
ACTIVE_DATA_MANAGEMENT = 'active_data_management'
CUSTOM_BRANDING = 'custom_branding'
CROSS_PROJECT_REPORTS = 'cross_project_reports'
CUSTOM_REPORTS = 'custom_reports'
ROLE_BASE... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "corehq/privileges.py",
"copies": "1",
"size": "2478",
"license": "bsd-3-clause",
"hash": -2246657856112431900,
"line_mean": 30.3670886076,
"line_max": 82,
"alpha_frac": 0.6767554479,
"autogenerated": false,
"ratio": 3.1687979539641944,
"config_... |
from django.utils.translation import ugettext_lazy as _
# Add-on and File statuses.
STATUS_NULL = 0
STATUS_PENDING = 2
STATUS_PUBLIC = 4
STATUS_DISABLED = 5
STATUS_OBSOLETE = STATUS_DISABLED
STATUS_DELETED = 11
STATUS_REJECTED = 12
STATUS_APPROVED = 13
STATUS_BLOCKED = 15
STATUS_UNLISTED = 16
# AMO-only statuses. Ke... | {
"repo_name": "mozilla/zamboni",
"path": "mkt/constants/base.py",
"copies": "6",
"size": "10582",
"license": "bsd-3-clause",
"hash": -6215911565473736000,
"line_mean": 31.56,
"line_max": 79,
"alpha_frac": 0.6924021924,
"autogenerated": false,
"ratio": 2.9199779249448126,
"config_test": false,
... |
from django.utils.translation import ugettext_lazy as _
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sitemaps',
... | {
"repo_name": "normanjaeckel/DreifaltigkeitHomepage",
"path": "dreifaltigkeithomepage/general_settings.py",
"copies": "1",
"size": "2616",
"license": "mit",
"hash": 5748407094133515000,
"line_mean": 23.2222222222,
"line_max": 79,
"alpha_frac": 0.6513761468,
"autogenerated": false,
"ratio": 3.7694... |
from django.utils.translation import ugettext_lazy as _
NATURAL_USER = "N"
BUSINESS = "B"
ORGANIZATION = "O"
USER_TYPE_CHOICES = (
(NATURAL_USER, _("Natural User")),
(BUSINESS, "BUSINESS"),
(ORGANIZATION, "ORGANIZATION"),
)
USER_TYPE_CHOICES_DICT = dict(USER_TYPE_CHOICES)
INCOME_RANGE_CHOICES = (
(1... | {
"repo_name": "webu/django-mangopay",
"path": "mangopay/constants.py",
"copies": "2",
"size": "16009",
"license": "mit",
"hash": -7916846486111064000,
"line_mean": 32.2827442827,
"line_max": 82,
"alpha_frac": 0.5015303892,
"autogenerated": false,
"ratio": 2.862839771101574,
"config_test": false... |
from django.utils.translation import ugettext_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
class LICENSE_COPYRIGHT(_LicenseBase):
id = 1
name = _(u'All Rights Reserved')... | {
"repo_name": "harikishen/addons-server",
"path": "src/olympia/constants/licenses.py",
"copies": "1",
"size": "1954",
"license": "bsd-3-clause",
"hash": 8183146739257372000,
"line_mean": 29.0615384615,
"line_max": 79,
"alpha_frac": 0.659160696,
"autogenerated": false,
"ratio": 2.8567251461988303,... |
from django.utils.translation import ugettext_lazy as _
class BackendBase:
backend_id = None
backend_verbose_name = ""
backend_display_name = ""
backend_enabled = False
backend_has_recurring = False
def __init__(self, settings):
pass
def new_payment(self, payment):
""" In... | {
"repo_name": "CCrypto/ccvpn3",
"path": "payments/backends/base.py",
"copies": "1",
"size": "1605",
"license": "mit",
"hash": 2105486550050382300,
"line_mean": 27.6607142857,
"line_max": 76,
"alpha_frac": 0.6386292835,
"autogenerated": false,
"ratio": 4.6521739130434785,
"config_test": false,
... |
from django.utils.translation import ugettext_lazy as _
class Base(object):
"""
Base availability policy.
"""
#: Availability code. This is used for HTML classes
code = ''
#: A description of the availability of a product. This is shown on the
#: product detail page. Eg "In stock", "O... | {
"repo_name": "DrOctogon/unwash_ecom",
"path": "oscar/apps/partner/availability.py",
"copies": "1",
"size": "4148",
"license": "bsd-3-clause",
"hash": -7666824965215043000,
"line_mean": 26.8389261745,
"line_max": 78,
"alpha_frac": 0.6299421408,
"autogenerated": false,
"ratio": 4.366315789473684,
... |
from django.utils.translation import ugettext_lazy as _
class DefaultRoles(object):
VIEWER = 'viewer'
OBSERVER = 'observer'
PARTICIPANT = 'participant'
PROPOSER = 'proposer'
CONTRIBUTOR = 'contributor'
EDITOR = 'editor'
OPERATOR = 'operator'
DECIDER = 'decider'
MANAGER = 'manager'
... | {
"repo_name": "nonZero/OpenCommunity",
"path": "src/acl/default_roles.py",
"copies": "1",
"size": "3234",
"license": "bsd-3-clause",
"hash": -163291565729515170,
"line_mean": 24.4645669291,
"line_max": 74,
"alpha_frac": 0.5686456401,
"autogenerated": false,
"ratio": 3.687571265678449,
"config_t... |
from django.utils.translation import ugettext_lazy as _
class DEVICE_DESKTOP(object):
id = 1
name = _(u'Desktop')
class_name = 'desktop'
api_name = 'desktop'
class DEVICE_MOBILE(object):
id = 2
name = _(u'Firefox Mobile')
class_name = 'android-mobile'
api_name = 'android-mobile'
cl... | {
"repo_name": "washort/zamboni",
"path": "mkt/constants/applications.py",
"copies": "1",
"size": "1730",
"license": "bsd-3-clause",
"hash": 646952858044165100,
"line_mean": 24.0724637681,
"line_max": 78,
"alpha_frac": 0.6323699422,
"autogenerated": false,
"ratio": 3.0034722222222223,
"config_te... |
from django.utils.translation import ugettext_lazy as _
class HealthCheckStatusType(object):
unavailable = 0
working = 1
unexpected_result = 2
HEALTH_CHECK_STATUS_TYPE_TRANSLATOR = {
0: _("unavailable"),
1: _("working"),
2: _("unexpected result"),
}
HEALTH_CHECK_JSON_STATUS_TYPE = {
0: "... | {
"repo_name": "clearclaw/django-health-check",
"path": "health_check/backends/base.py",
"copies": "1",
"size": "1326",
"license": "mit",
"hash": -7187022167806230000,
"line_mean": 21.4745762712,
"line_max": 78,
"alpha_frac": 0.6447963801,
"autogenerated": false,
"ratio": 3.7670454545454546,
"co... |
from django.utils.translation import ugettext_lazy as _
class SECTION_ADDONS:
short = 'addons'
pretty = _(u'Add-ons')
twitter = 'twitter-addons'
updates = 'updates-addons'
class SECTION_MOZILLA:
short = 'mozilla'
pretty = _(u'Mozilla')
twitter = 'twitter-mozilla'
updates = 'updates-m... | {
"repo_name": "anaran/kuma",
"path": "kuma/core/sections.py",
"copies": "9",
"size": "1177",
"license": "mpl-2.0",
"hash": 8740820586766961000,
"line_mean": 20.4,
"line_max": 55,
"alpha_frac": 0.6159728122,
"autogenerated": false,
"ratio": 3.4822485207100593,
"config_test": false,
"has_no_key... |
from django.utils.translation import ugettext_lazy as _
class StatusCode:
"""
Base class for representing a set of StatusCodes.
This is used to map a set of integer values to text.
"""
colors = {}
@classmethod
def render(cls, key, large=False):
"""
Render the value as a H... | {
"repo_name": "inventree/InvenTree",
"path": "InvenTree/InvenTree/status_codes.py",
"copies": "2",
"size": "7588",
"license": "mit",
"hash": 1298842470661785900,
"line_mean": 21.9939393939,
"line_max": 80,
"alpha_frac": 0.5600948867,
"autogenerated": false,
"ratio": 3.943866943866944,
"config_t... |
from django.utils.translation import ugettext_lazy as _
class UnsupportedMediaTypeException(Exception):
"""
Raised if the content_type has unsupported media type
"""
pass
class MimerDataException(Exception):
"""
Raised if the content_type and data don't match
"""
pass
class RESTExc... | {
"repo_name": "druids/django-pyston",
"path": "pyston/exception.py",
"copies": "1",
"size": "1325",
"license": "bsd-3-clause",
"hash": -8148731354446625000,
"line_mean": 20.3709677419,
"line_max": 90,
"alpha_frac": 0.6935849057,
"autogenerated": false,
"ratio": 4.553264604810996,
"config_test":... |
from django.utils.translation import ugettext_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 = ... | {
"repo_name": "eviljeff/olympia",
"path": "src/olympia/constants/scanners.py",
"copies": "2",
"size": "1180",
"license": "bsd-3-clause",
"hash": -7732649065818496000,
"line_mean": 20.8518518519,
"line_max": 76,
"alpha_frac": 0.6559322034,
"autogenerated": false,
"ratio": 2.857142857142857,
"con... |
from django.utils.translation import ugettext_lazy as _
def cfilter(choices, vlist):
"""
Returns whitelisted countries.
"""
v = lambda choices, whitelist: tuple((k) \
for k2 in whitelist for k in iter(choices) if k[0] == k2)
return v(choices, vlist)
# Nicely titled (and translatable) co... | {
"repo_name": "degenhard/django-countries",
"path": "django_countries/countries.py",
"copies": "1",
"size": "23211",
"license": "mit",
"hash": 8094508649491259000,
"line_mean": 28.8341902314,
"line_max": 77,
"alpha_frac": 0.4674507776,
"autogenerated": false,
"ratio": 2.3776889981561156,
"confi... |
from django.utils.translation import ugettext_lazy as _
def FREE_PLATFORMS():
platforms = (
('free-firefoxos', _('Firefox OS')),
('free-desktop', _('Firefox for Desktop')),
('free-android-mobile', _('Firefox Mobile')),
('free-android-tablet', _('Firefox Tablet')),
)
return... | {
"repo_name": "jasonthomas/zamboni",
"path": "mkt/constants/platforms.py",
"copies": "6",
"size": "1410",
"license": "bsd-3-clause",
"hash": -1235407033338473000,
"line_mean": 27.7755102041,
"line_max": 65,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.9275766016713094,
"config_test": f... |
from django.utils.translation import ugettext_lazy as _
"""
Django settings for this project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside... | {
"repo_name": "aldryn/aldryn-boilerplate-bootstrap3",
"path": "tools/server/src/settings.py",
"copies": "1",
"size": "5096",
"license": "bsd-3-clause",
"hash": -6440005315199636000,
"line_mean": 25.8210526316,
"line_max": 111,
"alpha_frac": 0.6554160126,
"autogenerated": false,
"ratio": 3.5120606... |
from django.utils.translation import ugettext_lazy as _
NEXMO_STATUSES = {
"delivered": _("Message arrived to handset."),
"expired": _("Message timed out after we waited 48h to receive status from mobile operator."),
"failed": _("Message failed to be delivered."),
"accepted": _("Message has been accep... | {
"repo_name": "japsu/django-nexmo",
"path": "nexmo/error_messages.py",
"copies": "2",
"size": "1756",
"license": "bsd-2-clause",
"hash": 4137402727940396000,
"line_mean": 27.7868852459,
"line_max": 98,
"alpha_frac": 0.5837129841,
"autogenerated": false,
"ratio": 3.809110629067245,
"config_test"... |
from django.utils.translation import ugettext_lazy as _
# returned via redirect, email notification, http notification
RESULT_SUCCESS = '0'
RESULT_AUTHORIZED_ONLY = '5'
# returned only via email notification, http notification
RESULT_ANNOUNCED = '2'
RESULT_AUTHORIZED = '3'
RESULT_PROCESSING = '4'
# returned only vi... | {
"repo_name": "PragmaticMates/django-trustpay",
"path": "trustpay/__init__.py",
"copies": "1",
"size": "2858",
"license": "bsd-3-clause",
"hash": 3549573717258491000,
"line_mean": 33.8536585366,
"line_max": 104,
"alpha_frac": 0.6906927922,
"autogenerated": false,
"ratio": 2.92827868852459,
"con... |
from django.utils.translation import ugettext_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
# T... | {
"repo_name": "bqbn/addons-server",
"path": "src/olympia/constants/reviewers.py",
"copies": "2",
"size": "7219",
"license": "bsd-3-clause",
"hash": 6358848556230638000,
"line_mean": 33.0518867925,
"line_max": 79,
"alpha_frac": 0.6859675855,
"autogenerated": false,
"ratio": 2.913236481033091,
"c... |
from django.utils.translation import ugettext_lazy as _
'''
This file is a place to store static, translatable lists (or tuples!). Choice
lists for registration fields were the original application.
'''
SECTORS = (
# (value, human-readable label)
("Public Administration", _("Public Administration")),
("Ar... | {
"repo_name": "awemulya/fieldsight-kobocat",
"path": "onadata/apps/fieldsight/static_lists.py",
"copies": "1",
"size": "11075",
"license": "bsd-2-clause",
"hash": -2965855537640058000,
"line_mean": 34.8414239482,
"line_max": 120,
"alpha_frac": 0.5119638826,
"autogenerated": false,
"ratio": 2.4018... |
from django.utils.translation import ugettext_lazy as _
# To add a note type:
# - assign it a incremented number (MY_NOTE_TYPE = 42)
# - give it a translation in NOTE_TYPES
# - if adding from mkt/site/log.py, add it to ACTION_MAP
# - add it to REVIEWERS_NOTE_TYPE if it should only be visible to reviewers
# - add the ... | {
"repo_name": "washort/zamboni",
"path": "mkt/constants/comm.py",
"copies": "1",
"size": "7110",
"license": "bsd-3-clause",
"hash": 2374926092349669400,
"line_mean": 35.6494845361,
"line_max": 79,
"alpha_frac": 0.7075949367,
"autogenerated": false,
"ratio": 3.0633347694959068,
"config_test": fa... |
from django.utils.translation import ugettext_lazy as _
VOLUME, WEIGHT, INDEFINITE = range(1, 4)
US_UNITS = {
'cup': {
'name': _('cup'),
'plural': _('cups'),
'abbreviation': 'c',
'type': VOLUME,
'aliases': ('c.',),
},
'us liquid pint': {
'name': _('pint'),... | {
"repo_name": "recipi/recipi",
"path": "src/recipi/recipes/constants.py",
"copies": "1",
"size": "6823",
"license": "isc",
"hash": -2926955617071408600,
"line_mean": 23.195035461,
"line_max": 79,
"alpha_frac": 0.4325076946,
"autogenerated": false,
"ratio": 3.2032863849765256,
"config_test": fal... |
from django.utils.translation import ugettext_lazy as _
OSCAR_SHOP_NAME = 'Oscar'
OSCAR_SHOP_TAGLINE = 'Domain-driven e-Commerce for Django'
# Basket settings
OSCAR_BASKET_COOKIE_LIFETIME = 7 * 24 * 60 * 60
OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket'
OSCAR_BASKET_COOKIE_SAVED = 'oscar_saved_basket'
OSCAR_MAX_BASKE... | {
"repo_name": "michaelBenin/django-oscar",
"path": "oscar/defaults.py",
"copies": "1",
"size": "6186",
"license": "bsd-3-clause",
"hash": 123941564887090690,
"line_mean": 27.2465753425,
"line_max": 76,
"alpha_frac": 0.5054962819,
"autogenerated": false,
"ratio": 3.737764350453172,
"config_test"... |
from django.utils.translation import ugettext_lazy as _
OSCAR_SHOP_NAME = 'Oscar'
OSCAR_SHOP_TAGLINE = ''
# Basket settings
OSCAR_BASKET_COOKIE_LIFETIME = 7 * 24 * 60 * 60
OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket'
OSCAR_BASKET_COOKIE_SAVED = 'oscar_saved_basket'
OSCAR_MAX_BASKET_QUANTITY_THRESHOLD = 10000
# Cur... | {
"repo_name": "Giftingnation/GN-Oscar-Custom",
"path": "oscar/defaults.py",
"copies": "3",
"size": "6217",
"license": "bsd-3-clause",
"hash": -7959434650494639000,
"line_mean": 27.0045045045,
"line_max": 76,
"alpha_frac": 0.5063535467,
"autogenerated": false,
"ratio": 3.7294541091781643,
"confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.