id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,600 | permissions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/permissions.py | try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.contrib.auth.management import create_permissions
from django.contrib.auth import models as auth_models
from django.contrib.contenttypes import models as contenttypes_models
from django.core.management import call... | 1,654 | Python | .py | 32 | 44.59375 | 73 | 0.720916 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,601 | decorators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/decorators.py | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.tests.views import AuthViewsTestCase
class LoginRequiredTestCase(AuthViewsTestCase):
"""
Tests the login_required decorators
"""
urls = 'django.contrib.auth.tests.urls'
def testCalla... | 1,562 | Python | .py | 41 | 30.04878 | 91 | 0.653034 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,602 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/forms.py | from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm
from django.test import TestCase
class UserCreationFormTest(TestCase):
fixtures = ['authtestdata.json']
def test_use... | 9,283 | Python | .py | 218 | 32.082569 | 147 | 0.591368 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,603 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/views.py | import os
import re
import urllib
from django.conf import settings
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.test import Test... | 17,770 | Python | .py | 356 | 38.724719 | 134 | 0.610244 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,604 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/management/__init__.py | """
Creates permissions for all installed apps that need permissions.
"""
from django.contrib.auth import models as auth_app
from django.db.models import get_models, signals
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retu... | 2,854 | Python | .py | 63 | 37.936508 | 110 | 0.661627 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,605 | changepassword.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/management/commands/changepassword.py | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
import getpass
class Command(BaseCommand):
help = "Change a user's password for django.contrib.auth."
requires_model_validation = False
def _get_pass(self, prompt="Password: "):
p = getpa... | 1,527 | Python | .py | 37 | 31.756757 | 110 | 0.601758 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,606 | createsuperuser.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/management/commands/createsuperuser.py | """
Management utility to create superusers.
"""
import getpass
import re
import sys
from optparse import make_option
from django.contrib.auth.models import User
from django.core import exceptions
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext as _
RE_V... | 5,814 | Python | .py | 121 | 33.495868 | 120 | 0.539017 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,607 | ca_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ca/ca_provinces.py | """
An alphabetical list of provinces and territories for use as `choices`
in a formfield., and a mapping of province misspellings/abbreviations to
normalized abbreviations
Source: http://www.canada.gc.ca/othergov/prov_e.html
This exists in this standalone file so that it's only imported into memory
when explici... | 1,603 | Python | .py | 63 | 21.047619 | 94 | 0.562134 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,608 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ca/forms.py | """
Canada-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re... | 4,523 | Python | .py | 112 | 32.714286 | 125 | 0.628845 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,609 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/uy/util.py | # -*- coding: utf-8 -*-
def get_validation_digit(number):
""" Calculates the validation digit for the given number. """
sum = 0
dvs = [4, 3, 6, 7, 8, 9, 2]
number = str(number)
for i in range(0, len(number)):
sum = (int(number[-1 - i]) * dvs[i] + sum) % 10
return (10-sum) % 10
| 313 | Python | .py | 9 | 29.888889 | 65 | 0.55814 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,610 | uy_departaments.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/uy/uy_departaments.py | # -*- coding: utf-8 -*-
"""A list of Urguayan departaments as `choices` in a formfield."""
DEPARTAMENT_CHOICES = (
('G', u'Artigas'),
('A', u'Canelones'),
('E', u'Cerro Largo'),
('L', u'Colonia'),
('Q', u'Durazno'),
('N', u'Flores'),
('O', u'Florida'),
('P', u'Lavalleja'),
('B', u'M... | 580 | Python | .py | 23 | 20.695652 | 66 | 0.476449 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,611 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/uy/forms.py | # -*- coding: utf-8 -*-
"""
UY-specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms.fields import Select, RegexField
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.localflavor.uy.util import get_vali... | 2,083 | Python | .py | 48 | 35.875 | 95 | 0.644093 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,612 | ch_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ch/ch_states.py | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('AG', _('Aargau')),
('AI', _('Appenzell Innerrhoden')),
('AR', _('Appenzell Ausserrhoden')),
('BS', _('Basel-Stadt')),
('BL', _('Basel-Land')),
('BE', _('Berne')),
('FR', _('Fribourg')),
('... | 808 | Python | .py | 30 | 22.433333 | 55 | 0.423423 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,613 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ch/forms.py | """
Swiss-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
id_re = re.compile(r"... | 3,951 | Python | .py | 95 | 33.842105 | 122 | 0.625 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,614 | cz_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/cz/cz_regions.py | """
Czech regions, translations get from http://www.crwflags.com/fotw/Flags/cz-re.html
"""
from django.utils.translation import ugettext_lazy as _
REGION_CHOICES = (
('PR', _('Prague')),
('CE', _('Central Bohemian Region')),
('SO', _('South Bohemian Region')),
('PI', _('Pilsen Region')),
('CA', _(... | 653 | Python | .py | 20 | 28.75 | 82 | 0.559429 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,615 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/cz/forms.py | """
Czech-specific form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Select, RegexField, Field
from django.utils.translation import ugettext_lazy as _
import re
birth_number = re.compile(r'^(?P<birth>\d{6})/?(?P<id>\d{3,4})$')
ic_... | 4,929 | Python | .py | 116 | 33.862069 | 100 | 0.602843 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,616 | es_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/es/es_provinces.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
PROVINCE_CHOICES = (
('01', _('Arava')),
('02', _('Albacete')),
('03', _('Alacant')),
('04', _('Almeria')),
('05', _('Avila')),
('06', _('Badajoz')),
('07', _('Illes Balears')),
('08', _('Barcelona')),
(... | 1,482 | Python | .py | 56 | 21.714286 | 55 | 0.390449 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,617 | es_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/es/es_regions.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
REGION_CHOICES = (
('AN', _('Andalusia')),
('AR', _('Aragon')),
('O', _('Principality of Asturias')),
('IB', _('Balearic Islands')),
('PV', _('Basque Country')),
('CN', _('Canary Islands')),
('S', _('Cantabria')... | 650 | Python | .py | 21 | 26.619048 | 55 | 0.496013 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,618 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/es/forms.py | # -*- coding: utf-8 -*-
"""
Spanish-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
import re
class ESPostalCodeField(RegexField):
"""
A... | 7,537 | Python | .py | 155 | 40.464516 | 160 | 0.627176 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,619 | no_municipalities.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/no/no_municipalities.py | # -*- coding: utf-8 -*-
"""
An alphabetical list of Norwegian municipalities (fylker) fro use as `choices`
in a formfield.
This exists in this standalone file so that it's on ly imported into memory
when explicitly needed.
"""
MUNICIPALITY_CHOICES = (
('akershus', u'Akershus'),
('austagder', u'Aust-Agder'),
... | 946 | Python | .py | 30 | 27.5 | 78 | 0.625963 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,620 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/no/forms.py | """
Norwegian-specific Form helpers
"""
import re, datetime
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class NOZipCodeField(RegexField):
default_error_mes... | 2,761 | Python | .py | 67 | 32.880597 | 87 | 0.606943 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,621 | nl_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/nl/nl_provinces.py | from django.utils.translation import ugettext_lazy as _
PROVINCE_CHOICES = (
('DR', _('Drenthe')),
('FL', _('Flevoland')),
('FR', _('Friesland')),
('GL', _('Gelderland')),
('GR', _('Groningen')),
('LB', _('Limburg')),
('NB', _('Noord-Brabant')),
('NH', _('Noord-Holland')),
('OV', _(... | 421 | Python | .py | 15 | 23.8 | 55 | 0.481481 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,622 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/nl/forms.py | """
NL-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
pc_re = re.compile('^\d{4}[A-Z]{2}$... | 2,796 | Python | .py | 78 | 28.820513 | 79 | 0.621521 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,623 | pe_region.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/pe/pe_region.py | # -*- coding: utf-8 -*-
"""
A list of Peru regions as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
REGION_CHOICES = (
('AMA', u'Amazonas'),
('ANC', u'Ancash'),
('APU', u'Apurímac'),
('ARE', u'Arequipa'),
('AYA', u'... | 839 | Python | .py | 33 | 21.212121 | 74 | 0.5225 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,624 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/pe/forms.py | # -*- coding: utf-8 -*-
"""
PE-specific Form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, CharField, Select
from django.utils.translation import ugettext_lazy as _
class PERegionSelect(Select):
"""
A Select wi... | 2,272 | Python | .py | 62 | 29.548387 | 78 | 0.626818 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,625 | be_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/be/be_provinces.py | from django.utils.translation import ugettext_lazy as _
# ISO codes
PROVINCE_CHOICES = (
('VAN', _('Antwerp')),
('BRU', _('Brussels')),
('VOV', _('East Flanders')),
('VBR', _('Flemish Brabant')),
('WHT', _('Hainaut')),
('WLG', _('Liege')),
('VLI', _('Limburg')),
('WLX', _('Luxembourg'))... | 416 | Python | .py | 15 | 23.733333 | 55 | 0.5075 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,626 | be_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/be/be_regions.py | from django.utils.translation import ugettext_lazy as _
# ISO codes
REGION_CHOICES = (
('BRU', _('Brussels Capital Region')),
('VLG', _('Flemish Region')),
('WAL', _('Wallonia'))
)
| 194 | Python | .py | 7 | 24.857143 | 55 | 0.634409 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,627 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/be/forms.py | """
Belgium-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class BEPostalCodeField(RegexField):
"""
A form field that validat... | 2,885 | Python | .py | 62 | 39.951613 | 180 | 0.650178 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,628 | in_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/in_/in_states.py | """
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('KA', 'Karnataka'),
('AP', 'Andhra Pr... | 1,859 | Python | .py | 79 | 18.974684 | 78 | 0.492958 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,629 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/in_/forms.py | """
India-specific Form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import gettext
import re
class INZipCodeField(RegexFiel... | 1,741 | Python | .py | 48 | 29.604167 | 78 | 0.668249 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,630 | de_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/de/de_states.py | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('BW', _('Baden-Wuerttemberg')),
('BY', _('Bavaria')),
('BE', _('Berlin')),
('BB', _('Brandenburg')),
('HB', _('Bremen')),
('HH', _('Hamburg')),
('HE', _('Hessen')),
('MV', _('Mecklenburg-We... | 602 | Python | .py | 20 | 25.85 | 55 | 0.497418 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,631 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/de/forms.py | """
DE-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
import re
id_re = re.compile(r"^(?P<residence>\d{10})(?P<origin>\w{1,3})[-\ ]?(?P<... | 3,163 | Python | .py | 68 | 38.455882 | 140 | 0.639169 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,632 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/il/forms.py | """
Israeli-specific form helpers
"""
import re
from django.core.exceptions import ValidationError
from django.core.validators import EMPTY_VALUES
from django.forms.fields import RegexField, Field, EMPTY_VALUES
from django.utils.checksums import luhn
from django.utils.translation import ugettext_lazy as _
# Israeli I... | 2,192 | Python | .py | 52 | 36.961538 | 122 | 0.686736 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,633 | ro_counties.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ro/ro_counties.py | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... | 1,231 | Python | .py | 50 | 19.68 | 76 | 0.476563 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,634 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ro/forms.py | # -*- coding: utf-8 -*-
"""
Romanian specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError, Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class ROCIFField(RegexField):
"""
A Romanian fiscal identity co... | 6,640 | Python | .py | 182 | 28.186813 | 83 | 0.587193 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,635 | cl_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/cl/cl_regions.py | # -*- coding: utf-8 -*-
"""
A list of Chilean regions as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
REGION_CHOICES = (
('RM', u'Región Metropolitana de Santiago'),
('I', u'Región de Tarapacá'),
('II', u'Región de Ant... | 884 | Python | .py | 23 | 33.652174 | 74 | 0.628297 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,636 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/cl/forms.py | """
Chile specific form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class CLRegionSelect(Select):
""... | 3,196 | Python | .py | 84 | 29.535714 | 88 | 0.575621 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,637 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/generic/forms.py | from django import forms
DEFAULT_DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y', ... | 2,160 | Python | .py | 43 | 44.255814 | 104 | 0.554451 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,638 | pl_administrativeunits.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/pl/pl_administrativeunits.py | # -*- coding: utf-8 -*-
"""
Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski
"""
ADMINISTRATIVE_UNIT_CHOICES = (
('wroclaw', u'Wrocław'),
('jeleniagora', u'Jelenia Góra'),
('legnica', u'Legnica'),
('boleslawiecki', u'bolesławiecki'),
('dzierzoniows... | 13,194 | Python | .py | 382 | 28.950262 | 98 | 0.604473 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,639 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/pl/forms.py | """
Polish-specific form helpers
"""
import re
from django.forms import ValidationError
from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
class PLProvinceSelect(Select):
"""
A select widget with list of P... | 5,444 | Python | .py | 134 | 33.014925 | 102 | 0.611279 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,640 | pl_voivodeships.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/pl/pl_voivodeships.py | """
Polish voivodeship as in http://en.wikipedia.org/wiki/Poland#Administrative_division
"""
from django.utils.translation import ugettext_lazy as _
VOIVODESHIP_CHOICES = (
('lower_silesia', _('Lower Silesia')),
('kuyavia-pomerania', _('Kuyavia-Pomerania')),
('lublin', _('Lublin')),
('lubusz', _('Lubu... | 773 | Python | .py | 22 | 31.136364 | 84 | 0.596796 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,641 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/us/models.py | from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.db.models.fields import CharField
from django.contrib.localflavor.us.us_states import STATE_CHOICES
from django.contrib.localflavor.us.us_states import USPS_CHOICES
class USStateField(CharField):
description = _("... | 1,294 | Python | .py | 27 | 41.962963 | 74 | 0.69292 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,642 | us_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/us/us_states.py | """
A mapping of state misspellings/abbreviations to normalized
abbreviations, and alphabetical lists of US states, territories,
military mail regions and non-US states to which the US provides
postal service.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
# The... | 7,655 | Python | .py | 315 | 19.711111 | 133 | 0.488607 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,643 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/us/forms.py | """
USA-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits... | 4,495 | Python | .py | 106 | 34.867925 | 112 | 0.625886 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,644 | za_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/za/za_provinces.py | from django.utils.translation import gettext_lazy as _
PROVINCE_CHOICES = (
('EC', _('Eastern Cape')),
('FS', _('Free State')),
('GP', _('Gauteng')),
('KN', _('KwaZulu-Natal')),
('LP', _('Limpopo')),
('MP', _('Mpumalanga')),
('NC', _('Northern Cape')),
('NW', _('North West')),
('WC'... | 344 | Python | .py | 12 | 24.583333 | 54 | 0.501511 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,645 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/za/forms.py | """
South Africa-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField
from django.utils.checksums import luhn
from django.utils.translation import gettext as _
import re
from datetime import date
id_re = re... | 1,908 | Python | .py | 46 | 34.521739 | 88 | 0.641775 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,646 | au_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/au/au_states.py | """
An alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('ACT', 'Australian Capital Territory'),
('NSW', 'New South Wales'),
('NT', 'Northern Territory'),
('QLD', 'Q... | 449 | Python | .py | 15 | 26.666667 | 74 | 0.645833 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,647 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/au/forms.py | """
Australian-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
PHONE_DIGITS_RE ... | 1,629 | Python | .py | 43 | 32.069767 | 76 | 0.663078 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,648 | br_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/br/br_states.py | # -*- coding: utf-8 -*-
"""
An alphabetical list of Brazilian states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('AC', 'Acre'),
('AL', 'Alagoas'),
('AP', u'Amapá'),
('AM', 'Amazonas'),
... | 939 | Python | .py | 35 | 22.371429 | 77 | 0.52413 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,649 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/br/forms.py | # -*- coding: utf-8 -*-
"""
BR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
... | 5,803 | Python | .py | 142 | 32.830986 | 104 | 0.596277 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,650 | se_counties.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/se/se_counties.py | # -*- coding: utf-8 -*-
"""
An alphabetical list of Swedish counties, sorted by codes.
http://en.wikipedia.org/wiki/Counties_of_Sweden
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from django.utils.translation import ugettext_lazy as _
COUNTY_CHOICES = (
... | 928 | Python | .py | 31 | 25.580645 | 74 | 0.537058 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,651 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/se/utils.py | import re
import datetime
def id_number_checksum(gd):
"""
Calculates a Swedish ID number checksum, using the
"Luhn"-algoritm
"""
n = s = 0
for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
tmp = ((n % 2) and 1 or 2) * int(c)
if tmp > 9:
tmp = sum([int(... | 2,398 | Python | .py | 62 | 31.83871 | 98 | 0.579084 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,652 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/se/forms.py | # -*- coding: utf-8 -*-
"""
Swedish specific Form helpers
"""
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
from django.contrib.localflavor.se.utils import (id_number_checksum,
validate_id_birthday, format_personal_id_numbe... | 5,623 | Python | .py | 117 | 40.452991 | 150 | 0.685772 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,653 | fi_municipalities.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/fi/fi_municipalities.py | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
MUNICIPALITY_CHOICES = (
('akaa', u"Akaa"),
('alajarvi', u"Alajärvi"),
('alavieska', u"Alav... | 10,822 | Python | .py | 351 | 25.547009 | 74 | 0.563522 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,654 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/fi/forms.py | """
FI-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class FIZipCodeField(RegexField):
default_error_messages = {
... | 1,803 | Python | .py | 45 | 32.888889 | 87 | 0.634703 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,655 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/it/util.py | from django.utils.encoding import smart_str, smart_unicode
def ssn_check_digit(value):
"Calculate Italian social security number check digit."
ssn_even_chars = {
'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
'9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': ... | 1,807 | Python | .py | 41 | 36.463415 | 79 | 0.465683 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,656 | it_region.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/it/it_region.py | # -*- coding: utf-8 -*
REGION_CHOICES = (
('ABR', 'Abruzzo'),
('BAS', 'Basilicata'),
('CAL', 'Calabria'),
('CAM', 'Campania'),
('EMR', 'Emilia-Romagna'),
('FVG', 'Friuli-Venezia Giulia'),
('LAZ', 'Lazio'),
('LIG', 'Liguria'),
('LOM', 'Lombardia'),
('MAR', 'Marche'),
('MOL', ... | 569 | Python | .py | 23 | 20.217391 | 37 | 0.475229 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,657 | it_province.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/it/it_province.py | # -*- coding: utf-8 -*
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
('BT', 'Barletta-Andria-Trani'), # active starting from 2009
... | 2,740 | Python | .py | 113 | 19.318584 | 64 | 0.433473 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,658 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/it/forms.py | """
IT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.contrib.localflavor.it.... | 3,027 | Python | .py | 75 | 33.8 | 93 | 0.663269 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,659 | mx_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/mx/mx_states.py | # -*- coding: utf-8 -*-
"""
A list of Mexican states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('AGU', _(u'Aguascalientes')),
('BCN', _(u... | 1,251 | Python | .py | 41 | 26.146341 | 74 | 0.511667 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,660 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/mx/forms.py | """
Mexican-specific form helpers.
"""
from django.forms.fields import Select
class MXStateSelect(Select):
"""
A Select widget that uses a list of Mexican states as its choices.
"""
def __init__(self, attrs=None):
from mx_states import STATE_CHOICES
super(MXStateSelect, self).__init__(... | 351 | Python | .py | 11 | 27.727273 | 73 | 0.700297 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,661 | ar_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ar/ar_provinces.py | # -*- coding: utf-8 -*-
"""
A list of Argentinean provinces and autonomous cities as `choices` in a
formfield. From
http://www.argentina.gov.ar/argentina/portal/paginas.dhtml?pagina=425
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
PROVINCE_CHOICES = (
('B'... | 973 | Python | .py | 34 | 24.5 | 74 | 0.565124 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,662 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ar/forms.py | # -*- coding: utf-8 -*-
"""
AR-specific Form helpers.
"""
from django.forms import ValidationError
from django.core.validators import EMPTY_VALUES
from django.forms.fields import RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
class... | 3,903 | Python | .py | 98 | 32.336735 | 92 | 0.604227 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,663 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/pt/forms.py | """
PT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | 1,561 | Python | .py | 40 | 32.675 | 84 | 0.643854 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,664 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/kw/forms.py | """
Kuwait-specific Form helpers
"""
import re
from datetime import date
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField
from django.utils.translation import gettext as _
id_re = re.compile(r'^(?P<initial>\d{1})(?P<yy>\d\d)(?P<... | 1,988 | Python | .py | 49 | 33.163265 | 111 | 0.637922 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,665 | ie_counties.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ie/ie_counties.py | """
Sources:
Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland
"""
from django.utils.translation import ugettext_lazy as _
IE_COUNTY_CHOICES = (
('antrim', _('Antrim')),
('armagh', _('Armagh')),
('carlow', _('Carlow')),
('cavan', _('Cavan')),
('clare', _('Clare')),
('cork... | 1,127 | Python | .py | 39 | 24.384615 | 72 | 0.48942 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,666 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/ie/forms.py | """
UK-specific Form helpers
"""
from django.forms.fields import Select
class IECountySelect(Select):
"""
A Select widget that uses a list of Irish Counties as its choices.
"""
def __init__(self, attrs=None):
from ie_counties import IE_COUNTY_CHOICES
super(IECountySelect, self).__init_... | 356 | Python | .py | 11 | 28.272727 | 78 | 0.702624 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,667 | at_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/at/at_states.py | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('BL', _('Burgenland')),
('KA', _('Carinthia')),
('NO', _('Lower Austria')),
('OO', _('Upper Austria')),
('SA', _('Salzburg')),
('ST', _('Styria')),
('TI', _('Tyrol')),
('VO', _('Vorarlberg'... | 350 | Python | .py | 13 | 23.153846 | 55 | 0.486647 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,668 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/at/forms.py | """
AT-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
re_ssn = re.compile(r'^\d{4} \d{6}')
class ATZipCodeField(RegexField)... | 2,446 | Python | .py | 57 | 36.508772 | 94 | 0.658393 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,669 | jp_prefectures.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/jp/jp_prefectures.py | from django.utils.translation import ugettext_lazy
JP_PREFECTURES = (
('hokkaido', ugettext_lazy('Hokkaido'),),
('aomori', ugettext_lazy('Aomori'),),
('iwate', ugettext_lazy('Iwate'),),
('miyagi', ugettext_lazy('Miyagi'),),
('akita', ugettext_lazy('Akita'),),
('yamagata', ugettext_lazy('Yamagat... | 2,089 | Python | .py | 50 | 37 | 50 | 0.602061 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,670 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/jp/forms.py | """
JP-specific Form helpers
"""
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
A form field that validates its input is a Japanese postcode.
Accepts 7 digits, wit... | 1,211 | Python | .py | 31 | 33.354839 | 79 | 0.668654 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,671 | is_postalcodes.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/is_/is_postalcodes.py | # -*- coding: utf-8 -*-
IS_POSTALCODES = (
('101', u'101 Reykjavík'),
('103', u'103 Reykjavík'),
('104', u'104 Reykjavík'),
('105', u'105 Reykjavík'),
('107', u'107 Reykjavík'),
('108', u'108 Reykjavík'),
('109', u'109 Reykjavík'),
('110', u'110 Reykjavík'),
('111', u'111 Reykjavík'... | 4,913 | Python | .py | 150 | 26.573333 | 43 | 0.544163 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,672 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/is_/forms.py | """
Iceland specific form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField
from django.forms.widgets import Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
cla... | 2,706 | Python | .py | 68 | 32.985294 | 98 | 0.632101 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,673 | id_choices.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/id/id_choices.py | import warnings
from django.utils.translation import ugettext_lazy as _
# Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia
# Indonesia does not have an official Province code standard.
# I decided to use unambiguous and consistent (some are common) 3-letter codes.
warnings.warn(
'There have been... | 3,217 | Python | .py | 102 | 26.921569 | 94 | 0.489711 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,674 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/id/forms.py | """
ID-specific Form helpers
"""
import re
import time
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
postcode_re = re.compil... | 6,834 | Python | .py | 160 | 33.96875 | 80 | 0.610297 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,675 | uk_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/uk/uk_regions.py | """
Sources:
English regions: http://www.statistics.gov.uk/geography/downloads/31_10_01_REGION_names_and_codes_12_00.xls
Northern Ireland regions: http://en.wikipedia.org/wiki/List_of_Irish_counties_by_area
Welsh regions: http://en.wikipedia.org/wiki/Preserved_counties_of_Wales
Scottish regions: http://... | 3,504 | Python | .py | 90 | 34.522222 | 125 | 0.603757 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,676 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/uk/forms.py | """
UK-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... | 1,943 | Python | .py | 45 | 37.466667 | 104 | 0.674074 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,677 | sk_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/sk/sk_regions.py | """
Slovak regions according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
REGION_CHOICES = (
('BB', _('Banska Bystrica region')),
('BA', _('Bratislava region')),
('KE', _('Kosice region')),
('NR', _('Nitra regi... | 458 | Python | .py | 14 | 29.285714 | 101 | 0.604072 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,678 | sk_districts.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/sk/sk_districts.py | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... | 2,453 | Python | .py | 85 | 24.117647 | 103 | 0.434066 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,679 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/sk/forms.py | """
Slovak-specific form helpers
"""
from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
class SKRegionSelect(Select):
"""
A select widget widget with list of Slovak regions as choices.
"""
def __init__(self, attrs=None):
from sk_regions i... | 1,439 | Python | .py | 37 | 33.081081 | 79 | 0.66404 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,680 | fr_department.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/fr/fr_department.py | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... | 3,326 | Python | .py | 109 | 25.614679 | 54 | 0.442475 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,681 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/fr/forms.py | """
FR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_re = re.com... | 1,747 | Python | .py | 43 | 35.069767 | 100 | 0.65566 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,682 | tr_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/tr/tr_provinces.py | # -*- coding: utf-8 -*-
"""
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
PROVINCE_CHOICES = (
('01', ('Adana')),
('02', ('Adıyaman')),
('03', ('Afyonkarahisar')),
('04', ('Ağrı')),
('68', ('Aksaray')),
('05', ('Amasya')),
('06', ('An... | 2,191 | Python | .py | 88 | 19.727273 | 74 | 0.390291 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,683 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/localflavor/tr/forms.py | """
TR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits_... | 3,430 | Python | .py | 78 | 36.333333 | 103 | 0.625936 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,684 | signals.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/signals.py | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... | 1,079 | Python | .py | 18 | 58.777778 | 86 | 0.769376 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,685 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/models.py | import datetime
from django.contrib.auth.models import User
from django.contrib.comments.managers import CommentManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.db import models
from django.core im... | 7,636 | Python | .py | 161 | 38.378882 | 97 | 0.619476 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,686 | feeds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/feeds.py | from django.conf import settings
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(sel... | 1,439 | Python | .py | 32 | 36.90625 | 97 | 0.635261 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,687 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('django.contrib.comments.views',
url(r'^post/$', 'comments.post_comment', name='comments-post-comment'),
url(r'^posted/$', 'comments.comment_done', name='comments-comment-done'),
url(r'^flag/(\d+)/$', 'moderation.... | 941 | Python | .py | 14 | 63.5 | 105 | 0.601081 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,688 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/__init__.py | from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import ImproperlyConfigured
from django.contrib.comments.models import Comment
from django.contrib.comments.forms import CommentForm
from django.utils.importlib import import_module
DEFAULT_COMMENTS_APP = 'django.contrib.... | 3,333 | Python | .py | 80 | 34.55 | 104 | 0.663171 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,689 | admin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/admin.py | from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... | 3,299 | Python | .py | 64 | 42.6875 | 112 | 0.636392 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,690 | moderation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/moderation.py | """
A generic comment-moderation system which allows configuration of
moderation options on a per-model basis.
To use, do two things:
1. Create or import a subclass of ``CommentModerator`` defining the
options you want.
2. Import ``moderator`` from this module and register one or more
models, passing the model... | 13,528 | Python | .py | 283 | 40.166078 | 141 | 0.682381 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,691 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/forms.py | import time
import datetime
from django import forms
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from models import Comment
from django.utils.crypto import salted_hmac, constant_time_compare
from django.utils.encoding import force_... | 8,730 | Python | .py | 182 | 38.384615 | 106 | 0.62412 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,692 | managers.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/managers.py | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_unicode
class CommentManager(models.Manager):
def in_moderation(self):
"""
QuerySet for all comments currently in the moderation queue.
"""
return self.ge... | 778 | Python | .py | 19 | 33.684211 | 79 | 0.67328 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,693 | comments.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/templatetags/comments.py | from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_unicode
register = template.Library()
class BaseCommentNode(template.N... | 11,845 | Python | .py | 270 | 35.57037 | 127 | 0.638377 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,694 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/views/utils.py | """
A few bits of helper functions for comment views.
"""
import urllib
import textwrap
from django.http import HttpResponseRedirect
from django.core import urlresolvers
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from... | 1,947 | Python | .py | 57 | 27.122807 | 79 | 0.628055 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,695 | comments.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/views/comments.py | from django import http
from django.conf import settings
from utils import next_redirect, confirmation_view
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.... | 5,359 | Python | .py | 120 | 37.158333 | 93 | 0.661114 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,696 | moderation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/comments/views/moderation.py | from django import template
from django.conf import settings
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required, permission_required
from utils import next_redirect, confirmation_view
from django.contrib import comments
from django.contrib.commen... | 5,037 | Python | .py | 138 | 30.507246 | 95 | 0.676097 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,697 | handlers.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/handlers.py | import urllib
from urlparse import urlparse
from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
class StaticFilesHandler(WSGIHandler):
"""
WSGI middleware that intercepts calls to th... | 2,359 | Python | .py | 57 | 32.877193 | 80 | 0.646725 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,698 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/urls.py | from django.conf import settings
from django.conf.urls.static import static
urlpatterns = []
def staticfiles_urlpatterns(prefix=None):
"""
Helper function to return a URL pattern for serving static files.
"""
if prefix is None:
prefix = settings.STATIC_URL
return static(prefix, view='djang... | 480 | Python | .py | 13 | 33.230769 | 72 | 0.760776 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,699 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/staticfiles/utils.py | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def is_ignored(path, ignore_patterns=[]):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
for patter... | 1,802 | Python | .py | 47 | 30.148936 | 73 | 0.645346 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |