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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,700 | srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/srs.py | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print srs
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORI... | 11,717 | Python | .py | 289 | 32.342561 | 96 | 0.62654 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,701 | test_ds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/tests/test_ds.py | import os, os.path, unittest
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS
# List of acceptable data sources.... | 10,504 | Python | .py | 185 | 43.140541 | 171 | 0.588733 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,702 | test_srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/tests/test_srs.py | import unittest
from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
class TestSRS:
def __init__(self, wkt, **kwargs):
self.wkt = wkt
for key, value in kwargs.items():
setattr(self, key, value)
# Some Spatial Reference examples
srlist = (Test... | 11,710 | Python | .py | 149 | 66.181208 | 824 | 0.63067 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,703 | test_envelope.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/tests/test_envelope.py | import unittest
from django.contrib.gis.gdal import Envelope, OGRException
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
"Testing Enve... | 3,767 | Python | .py | 80 | 38.6125 | 90 | 0.60955 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,704 | test_geom.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/tests/test_geom.py | import unittest
from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
OGRException, OGRIndexError, SpatialReference, CoordTransform, \
gdal_version
from django.contrib.gis.geometry.test_data import TestDataMixin
class OGRGeomTest(unittest.TestCase, TestDataMixin):
"This tests the OGR Geometry."
... | 21,045 | Python | .py | 430 | 37.830233 | 96 | 0.614303 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,705 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/tests/__init__.py | """
Module for executing all of the GDAL tests. None
of these tests require the use of the database.
"""
from unittest import TestSuite, TextTestRunner
# Importing the GDAL test modules.
import test_driver, test_ds, test_envelope, test_geom, test_srs
test_suites = [test_driver.suite(),
test_ds.suite()... | 672 | Python | .py | 21 | 26.095238 | 63 | 0.650696 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,706 | test_driver.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/tests/test_driver.py | import os, os.path, unittest
from django.contrib.gis.gdal import Driver, OGRException
valid_drivers = ('ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN',
'Memory', 'CSV', 'GML', 'KML')
invalid_drivers = ('Foo baz', 'clucka', 'ESRI Shp')
aliases = {'eSrI' : 'ESRI Shapefile',
'TigER/l... | 1,207 | Python | .py | 31 | 31.290323 | 73 | 0.625536 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,707 | ds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/prototypes/ds.py | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from djan... | 4,244 | Python | .py | 64 | 65.015625 | 139 | 0.74335 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,708 | errcheck.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/prototypes/errcheck.py | """
This module houses the error-checking routines used by the GDAL
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.gdal.error import check_err, OGRException, SRSException
from django.contrib.gis.gdal.libgdal import lgdal
# Helper routines for retrieving pointers and/or values f... | 4,207 | Python | .py | 113 | 32.318584 | 99 | 0.691422 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,709 | generation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/prototypes/generation.py | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.prototypes.errcheck import \
check_arg_errcode, check_errcode, check_geom, check_geom_offset, \
check_pointer, check_srs, check_str... | 3,766 | Python | .py | 103 | 30.757282 | 77 | 0.691399 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,710 | geom.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/prototypes/geom.py | import re
from datetime import date
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from... | 4,821 | Python | .py | 89 | 52.067416 | 137 | 0.745277 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,711 | srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/prototypes/srs.py | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import \
const_string_output, double_output, int_output, \
srs_output, string_output, void_output
## Shortcut generation for routines with known p... | 3,378 | Python | .py | 59 | 55.220339 | 112 | 0.752874 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,712 | options.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/admin/options.py | from django.conf import settings
from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographi... | 5,095 | Python | .py | 118 | 31.940678 | 117 | 0.580768 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,713 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/admin/__init__.py | # Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin
from django.contri... | 490 | Python | .py | 10 | 46.6 | 126 | 0.820084 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,714 | widgets.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/admin/widgets.py | from django.conf import settings
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Textarea
from django.template import loader, Context
from django.utils import translation
# Creating a template context that contains Django... | 4,430 | Python | .py | 93 | 35.075269 | 74 | 0.577839 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,715 | georss.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/sitemaps/georss.py | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
class GeoRSSSitemap(Sitemap):
"""
A minimal hook to produce sitemaps for GeoRSS feeds.
"""
def __init__(self, feed_dict, slug_dict=None):
"""
This sitemap object initializes on a feed dictionary (as would b... | 2,156 | Python | .py | 45 | 38.777778 | 89 | 0.639867 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,716 | kml.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/sitemaps/kml.py | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... | 2,481 | Python | .py | 56 | 30.785714 | 103 | 0.556017 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,717 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/sitemaps/__init__.py | # Geo-enabled Sitemap classes.
from django.contrib.gis.sitemaps.georss import GeoRSSSitemap
from django.contrib.gis.sitemaps.kml import KMLSitemap, KMZSitemap
| 160 | Python | .py | 3 | 52 | 66 | 0.858974 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,718 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/gis/sitemaps/views.py | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.contrib.gis.db.models.fields import GeometryField
from django.db import... | 4,353 | Python | .py | 99 | 36.747475 | 116 | 0.665252 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,719 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/webdesign/tests.py | # -*- coding: utf-8 -*-
import unittest
from django.contrib.webdesign.lorem_ipsum import *
from django.template import loader, Context
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), u'lorem ipsum dolor sit amet consectetur adipisicing')
def test_paragraphs... | 1,054 | Python | .py | 14 | 67.071429 | 476 | 0.724105 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,720 | lorem_ipsum.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/webdesign/lorem_ipsum.py | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... | 4,872 | Python | .py | 89 | 47.988764 | 459 | 0.622301 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,721 | webdesign.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/webdesign/templatetags/webdesign.py | from django.contrib.webdesign.lorem_ipsum import words, paragraphs
from django import template
register = template.Library()
class LoremNode(template.Node):
def __init__(self, count, method, common):
self.count, self.method, self.common = count, method, common
def render(self, context):
try:
... | 2,196 | Python | .py | 57 | 31.842105 | 83 | 0.616721 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,722 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/models.py | import datetime
import urllib
from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_str
from django.utils.h... | 18,711 | Python | .py | 391 | 38.560102 | 368 | 0.646881 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,723 | backends.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/backends.py | from django.db import connection
from django.contrib.auth.models import User, Permission
class ModelBackend(object):
"""
Authenticates against django.contrib.auth.models.User.
"""
supports_object_permissions = False
supports_anonymous_user = True
# TODO: Model, login attribute name and passwo... | 4,428 | Python | .py | 102 | 34.343137 | 143 | 0.635013 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,724 | tokens.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tokens.py | from datetime import date
from django.conf import settings
from django.utils.http import int_to_base36, base36_to_int
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check tokens for the password
reset mechanism.
"""
def make_token(self, user):
"""
... | 2,393 | Python | .py | 55 | 34.418182 | 94 | 0.62355 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,725 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/urls.py | # These URLs are normally mapped to /admin/urls.py. This URLs file is
# provided as a convenience to those who want to deploy these URLs elsewhere.
# This file is also used to provide a reliable view deployment for test purposes.
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^login/$', 'dj... | 949 | Python | .py | 14 | 64.285714 | 147 | 0.703863 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,726 | context_processors.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/context_processors.py | from django.core.context_processors import PermWrapper
from django.utils.functional import lazy, memoize, SimpleLazyObject
from django.contrib import messages
def auth(request):
"""
Returns context variables required by apps that use Django's authentication
system.
If there is no 'user' attribute in t... | 1,452 | Python | .py | 30 | 42.366667 | 79 | 0.715292 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,727 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/__init__.py | import datetime
from warnings import warn
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_backend'
REDIRECT_FIELD_NAME = 'next'
def load_backend(path):
i = path.rfind('.')
module, attr = pa... | 3,953 | Python | .py | 97 | 34.123711 | 140 | 0.68763 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,728 | admin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/admin.py | from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm
from django.contrib.auth.models import User, Group
from django.contrib import messages
from django.core.exceptions import Pe... | 6,609 | Python | .py | 139 | 38.791367 | 208 | 0.636927 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,729 | create_superuser.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/create_superuser.py | """
Create a superuser from the command line. Deprecated; use manage.py
createsuperuser instead.
"""
if __name__ == "__main__":
from django.core.management import call_command
call_command("createsuperuser")
| 217 | Python | .py | 7 | 28.714286 | 67 | 0.736842 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,730 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/middleware.py | from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
class LazyUser(object):
def __get__(self, request, obj_type=None):
if not hasattr(request, '_cached_user'):
from django.contrib.auth import get_user
request._cached_user = get_user(request)
... | 3,552 | Python | .py | 70 | 41.642857 | 230 | 0.678767 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,731 | decorators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/decorators.py | try:
from functools import update_wrapper, wraps
except ImportError:
from django.utils.functional import update_wrapper, wraps # Python 2.4 fallback.
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponseRedirect
from django.utils.decorators import available_attrs
from django... | 1,940 | Python | .py | 44 | 38.090909 | 89 | 0.714513 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,732 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/forms.py | from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.models import get_current_site
from django.template import Context, loader
from django import forms
from django.utils.translation import ugett... | 8,781 | Python | .py | 185 | 38.821622 | 143 | 0.646667 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,733 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/views.py | import re
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
# Avoid shadowing the login() view below.
from django.contrib.auth import login as auth_login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.cont... | 8,288 | Python | .py | 165 | 42.284848 | 123 | 0.691235 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,734 | modpython.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/handlers/modpython.py | from mod_python import apache
import os
def authenhandler(req, **kwargs):
"""
Authentication handler that checks against Django's auth database.
"""
# mod_python fakes the environ, and thus doesn't process SetEnv. This fixes
# that so that the following import works
os.environ.update(req.subp... | 1,899 | Python | .py | 48 | 31.541667 | 85 | 0.644916 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,735 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/models.py | from django.conf import settings
from django.test import TestCase
from django.contrib.auth.models import User, SiteProfileNotAvailable
class ProfileTestCase(TestCase):
fixtures = ['authtestdata.json']
def setUp(self):
"""Backs up the AUTH_PROFILE_MODULE"""
self.old_AUTH_PROFILE_MODULE = getattr... | 1,493 | Python | .py | 29 | 41.862069 | 79 | 0.678326 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,736 | tokens.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/tokens.py | from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.test import TestCase
class TokenGeneratorTest(TestCase):
def test_make_token(self):
"""
... | 2,431 | Python | .py | 53 | 37.433962 | 88 | 0.657095 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,737 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/urls.py | from django.conf.urls.defaults import patterns
from django.contrib.auth.urls import urlpatterns
from django.http import HttpResponse
from django.template import Template, RequestContext
def remote_user_auth_view(request):
"Dummy view for remote user tests"
t = Template("Username is {{ user }}.")
c = Reques... | 709 | Python | .py | 15 | 44.2 | 104 | 0.736614 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,738 | remote_user.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/remote_user.py | from datetime import datetime
from django.conf import settings
from django.contrib.auth.backends import RemoteUserBackend
from django.contrib.auth.models import User
from django.test import TestCase
class RemoteUserTest(TestCase):
urls = 'django.contrib.auth.tests.urls'
middleware = 'django.contrib.auth.mid... | 6,410 | Python | .py | 138 | 38.84058 | 81 | 0.679167 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,739 | auth_backends.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/auth_backends.py | from django.conf import settings
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
class BackendTest(TestCase):
backend = 'django.contrib... | 11,124 | Python | .py | 218 | 42.899083 | 109 | 0.671276 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,740 | basic.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/basic.py | from django.test import TestCase
from django.contrib.auth.models import User, AnonymousUser
from django.core.management import call_command
from StringIO import StringIO
class BasicTestCase(TestCase):
def test_user(self):
"Check that users can be created and can set their password"
u = User.objects... | 3,575 | Python | .py | 82 | 34.52439 | 84 | 0.648292 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,741 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/__init__.py | from django.contrib.auth.tests.auth_backends import BackendTest, RowlevelBackendTest, AnonymousUserBackendTest, NoAnonymousUserBackendTest, NoBackendsTest
from django.contrib.auth.tests.basic import BasicTestCase
from django.contrib.auth.tests.decorators import LoginRequiredTestCase
from django.contrib.auth.tests.forms... | 879 | Python | .py | 11 | 77.363636 | 176 | 0.866205 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,742 | decorators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/decorators.py | from unittest import TestCase
from django.contrib.auth.decorators import login_required
class LoginRequiredTestCase(TestCase):
"""
Tests the login_required decorators
"""
def testCallable(self):
"""
Check that login_required is assignable to callable objects.
"""
class... | 660 | Python | .py | 21 | 23.238095 | 68 | 0.625796 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,743 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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... | 8,721 | Python | .py | 202 | 32.524752 | 147 | 0.591097 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,744 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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... | 12,315 | Python | .py | 254 | 38.574803 | 131 | 0.628702 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,745 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/auth/management/__init__.py | """
Creates permissions for all installed apps that need permissions.
"""
from django.db.models import get_models, signals
from django.contrib.auth import models as auth_app
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retur... | 2,238 | Python | .py | 44 | 43.545455 | 110 | 0.678245 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,746 | changepassword.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,747 | createsuperuser.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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,743 | Python | .py | 120 | 33.258333 | 120 | 0.536472 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,748 | ca_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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,397 | Python | .py | 55 | 20.836364 | 75 | 0.543689 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,749 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,750 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,751 | uy_departaments.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,752 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,753 | ch_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,754 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,755 | cz_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,756 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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,735 | Python | .py | 112 | 33.883929 | 100 | 0.602829 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,757 | es_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,758 | es_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,759 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,760 | no_municipalities.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,761 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,762 | nl_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,763 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,764 | pe_region.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,765 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,766 | in_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,767 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,768 | de_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,769 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,770 | ro_counties.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,771 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,772 | cl_regions.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,773 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,774 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,775 | pl_administrativeunits.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,776 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,777 | pl_voivodeships.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,778 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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
class USStateField(CharField):
description = _("U.S. state (two uppercase letters)")
def __init__(self, *arg... | 946 | Python | .py | 20 | 41.35 | 74 | 0.698585 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,779 | us_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/django/contrib/localflavor/us/us_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 = (
('AL', 'Alabama'),
('AK', 'Alaska'),
... | 4,958 | Python | .py | 231 | 16.623377 | 78 | 0.437553 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,780 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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,219 | Python | .py | 98 | 35.357143 | 112 | 0.623721 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
3,781 | za_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,782 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,783 | au_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,784 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,785 | br_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,786 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,787 | se_counties.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,788 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,789 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,790 | fi_municipalities.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,791 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,792 | util.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,793 | it_region.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,794 | it_province.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,795 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,796 | mx_states.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,797 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,798 | ar_provinces.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |
3,799 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.2.5/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) |