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,500 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/oracle/base.py | from django.db.backends.oracle.base import *
from django.db.backends.oracle.base import DatabaseWrapper as OracleDatabaseWrapper
from django.contrib.gis.db.backends.oracle.creation import OracleCreation
from django.contrib.gis.db.backends.oracle.introspection import OracleIntrospection
from django.contrib.gis.db.backen... | 658 | Python | .py | 11 | 55.454545 | 83 | 0.794118 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,501 | operations.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/oracle/operations.py | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | 12,595 | Python | .py | 255 | 39.717647 | 115 | 0.617298 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,502 | adapter.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/oracle/adapter.py | from cx_Oracle import CLOB
from django.contrib.gis.db.backends.adapter import WKTAdapter
class OracleSpatialAdapter(WKTAdapter):
input_size = CLOB
| 152 | Python | .py | 4 | 35.75 | 61 | 0.836735 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,503 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/models.py | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
class GeometryColumns(models.Model):
"""
The 'geometry_columns' table from SpatiaLite.
"""
f_table_name = models.CharField(ma... | 1,847 | Python | .py | 52 | 29.134615 | 73 | 0.670957 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,504 | creation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/creation.py | import os
from django.conf import settings
from django.core.cache import get_cache
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.db.backends.sqlite3.creation import DatabaseCreation
class S... | 4,393 | Python | .py | 82 | 41.012195 | 102 | 0.612948 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,505 | introspection.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/introspection.py | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Sublcass that includes updates the `base_data_types_reverse` dict
for geometry field types.
... | 2,112 | Python | .py | 45 | 35.488889 | 99 | 0.606016 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,506 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/base.py | from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import *
from django.db.backends.sqlite3.base import DatabaseWrapper as SqliteDatabaseWrapper, \
_sqlite_extract, _sqlite_date_trunc, _sqlite_regexp
fro... | 4,347 | Python | .py | 70 | 47.885714 | 129 | 0.633958 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,507 | operations.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/operations.py | import re
from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from django.contrib.gis.geometry.backend import G... | 14,391 | Python | .py | 301 | 37.461794 | 112 | 0.61781 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,508 | adapter.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/spatialite/adapter.py | from django.db.backends.sqlite3.base import Database
from django.contrib.gis.db.backends.adapter import WKTAdapter
class SpatiaLiteAdapter(WKTAdapter):
"SQLite adaptor for geometry objects."
def __conform__(self, protocol):
if protocol is Database.PrepareProtocol:
return str(self)
| 311 | Python | .py | 7 | 39.285714 | 61 | 0.762376 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,509 | ogrinspect.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/ogrinspect.py | """
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
Author: Travis Pinney, Dane Springmeyer, & Justin Bronn
"""
from itertools import izip
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSourc... | 8,939 | Python | .py | 185 | 40.702703 | 132 | 0.652054 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,510 | ogrinfo.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/ogrinfo.py | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num_... | 1,973 | Python | .py | 47 | 32.425532 | 89 | 0.576042 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,511 | geoip.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/geoip.py | """
This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R)
C API (http://www.maxmind.com/app/c). This is an alternative to the GPL
licensed Python GeoIP interface provided by MaxMind.
GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.
For IP-based geolocation, t... | 14,811 | Python | .py | 319 | 38.37931 | 117 | 0.641038 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,512 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/__init__.py | """
This module contains useful utilities for GeoDjango.
"""
# Importing the utilities that depend on GDAL, if available.
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.utils.ogrinfo import ogrinfo, sample
from django.contrib.gis.utils.ogrinspect import mapping, ogrinspect
... | 853 | Python | .py | 22 | 34.454545 | 85 | 0.759709 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,513 | wkt.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/wkt.py | """
Utilities for manipulating Geometry WKT.
"""
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to that number:
>>> pnt =... | 1,846 | Python | .py | 47 | 31.808511 | 92 | 0.600782 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,514 | layermapping.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/layermapping.py | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | 27,315 | Python | .py | 533 | 37.744841 | 142 | 0.591508 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,515 | srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/utils/srs.py | from django.contrib.gis.gdal import SpatialReference
from django.db import connections, DEFAULT_DB_ALIAS
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=DEFAULT_DB_ALIAS):
"""
This function takes a GDAL SpatialReference system and adds its information
... | 3,157 | Python | .py | 65 | 40.892308 | 81 | 0.68474 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,516 | fields.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/forms/fields.py | from django import forms
from django.utils.translation import ugettext_lazy as _
# While this couples the geographic forms to the GEOS library,
# it decouples from database (by not importing SpatialBackend).
from django.contrib.gis.geos import GEOSGeometry
class GeometryField(forms.Field):
"""
This is the bas... | 2,746 | Python | .py | 58 | 37.396552 | 94 | 0.62374 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,517 | test_spatialrefsys.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/test_spatialrefsys.py | from django.db import connection
from django.contrib.gis.gdal import GDAL_VERSION
from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
from django.utils import unittest
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'auth_srid' : 4326,
... | 6,782 | Python | .py | 99 | 56.434343 | 737 | 0.625619 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,518 | test_geoforms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/test_geoforms.py | from django.forms import ValidationError
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
from django.utils import unittest
class GeometryFieldTest(unittest.TestCase):
def test00_init(self):
"Testing GeometryField initialization with defaults."
fld = forms.Geo... | 2,671 | Python | .py | 53 | 42.90566 | 104 | 0.679586 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,519 | utils.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/utils.py | from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
# function that will pass a test.
def pass_test(*args): return
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
... | 959 | Python | .py | 22 | 41.136364 | 81 | 0.732047 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,520 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/__init__.py | from django.conf import settings
from django.test.simple import build_suite, DjangoTestSuiteRunner
from django.utils import unittest
def run_tests(*args, **kwargs):
from django.test.simple import run_tests as base_run_tests
return base_run_tests(*args, **kwargs)
def run_gis_tests(test_labels, verbosity=1, in... | 4,968 | Python | .py | 106 | 39.424528 | 107 | 0.69414 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,521 | test_geoip.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/test_geoip.py | import os, unittest
from django.db import settings
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.utils import GeoIP, GeoIPException
# Note: Requires use of both the GeoIP country and city datasets.
# The GEOIP_DATA path should be the only setting set (the directory
# should contain links or ... | 4,204 | Python | .py | 88 | 37.625 | 89 | 0.610339 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,522 | test_measure.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/test_measure.py | """
Distance and Area objects to allow for sensible and convienient calculation
and conversions. Here are some tests.
"""
from django.contrib.gis.measure import Distance, Area, D, A
from django.utils import unittest
class DistanceTest(unittest.TestCase):
"Testing the Distance object"
def testInit(self):
... | 8,820 | Python | .py | 274 | 22.894161 | 105 | 0.543676 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,523 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geogapp/models.py | from django.contrib.gis.db import models
class City(models.Model):
name = models.CharField(max_length=30)
point = models.PointField(geography=True)
objects = models.GeoManager()
def __unicode__(self): return self.name
class Zipcode(models.Model):
code = models.CharField(max_length=10)
poly = m... | 712 | Python | .py | 17 | 37.647059 | 75 | 0.725434 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,524 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geogapp/tests.py | """
Tests for geography support in PostGIS 1.5+
"""
import os
from django.contrib.gis import gdal
from django.contrib.gis.measure import D
from django.test import TestCase
from models import City, County, Zipcode
class GeographyTest(TestCase):
def test01_fixture_load(self):
"Ensure geography features load... | 4,080 | Python | .py | 75 | 44.493333 | 105 | 0.642625 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,525 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/layermap/models.py | from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... | 2,241 | Python | .py | 56 | 33.053571 | 135 | 0.651753 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,526 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/layermap/tests.py | import os
from decimal import Decimal
from django.utils.copycompat import copy
from django.utils.unittest import TestCase
from django.contrib.gis.gdal import DataSource, OGRException
from django.contrib.gis.tests.utils import mysql
from django.contrib.gis.utils.layermapping import LayerMapping, LayerMapError, Invalid... | 12,640 | Python | .py | 228 | 45.403509 | 112 | 0.641107 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,527 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/distapp/models.py | from django.contrib.gis.db import models
class SouthTexasCity(models.Model):
"City model on projected coordinate system for South Texas."
name = models.CharField(max_length=30)
point = models.PointField(srid=32140)
objects = models.GeoManager()
def __unicode__(self): return self.name
class SouthTe... | 1,832 | Python | .py | 43 | 38.186047 | 71 | 0.727273 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,528 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/distapp/tests.py | import os
from decimal import Decimal
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import GEOSGeometry, Point, LineString
from django.contrib.gis.measure import D # alias for Distance
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_s... | 19,055 | Python | .py | 311 | 49.839228 | 196 | 0.64866 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,529 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/models.py | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
class Country(models.Model):
name = models.CharField(max_length=30)
mpoly = models.MultiPolygonField() # SRID, by default, is 4326
... | 1,546 | Python | .py | 37 | 37.108108 | 79 | 0.720187 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,530 | test_regress.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/test_regress.py | import os, unittest
from django.contrib.gis.tests.utils import no_mysql, no_oracle, no_postgis, no_spatialite
from django.contrib.gis.shortcuts import render_to_kmz
from models import City
class GeoRegressionTests(unittest.TestCase):
def test01_update(self):
"Testing GeoQuerySet.update(), see #10411."
... | 1,500 | Python | .py | 32 | 38.53125 | 89 | 0.630212 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,531 | feeds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/feeds.py | from django.contrib.gis import feeds
from django.contrib.gis.tests.utils import mysql
from models import City, Country
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/... | 1,856 | Python | .py | 49 | 32.591837 | 71 | 0.679866 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,532 | test_feeds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/test_feeds.py | from xml.dom import minidom
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase
from models import City
class GeoFeedTest(TestCase):
urls = 'django.contrib.gis.tests.geoapp.urls'
def setUp(self):
Site(id=settings.SITE_ID, domain="example.co... | 4,153 | Python | .py | 70 | 49.171429 | 103 | 0.651415 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,533 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/urls.py | from django.conf.urls.defaults import *
from feeds import feed_dict
urlpatterns = patterns('',
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feed_dict}),
)
from sitemaps import sitemaps
urlpatterns += patterns('django.contrib.gis.sitemaps.views',
(r'^sitemap.xml$', 'index', ... | 617 | Python | .py | 12 | 47.25 | 102 | 0.61194 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,534 | test_sitemaps.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/test_sitemaps.py | import cStringIO
from xml.dom import minidom
import zipfile
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase
from models import City, Country
class GeoSitemapTest(TestCase):
urls = 'django.contrib.gis.tests.geoapp.urls'
def setUp(self):
... | 4,389 | Python | .py | 77 | 45.519481 | 113 | 0.637782 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,535 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/tests.py | import re
from django.db import connection
from django.contrib.gis import gdal
from django.contrib.gis.geos import fromstr, GEOSGeometry, \
Point, LineString, LinearRing, Polygon, GeometryCollection
from django.contrib.gis.measure import Distance
from django.contrib.gis.tests.utils import \
no_mysql, no_oracle,... | 35,125 | Python | .py | 631 | 45.714739 | 227 | 0.63219 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,536 | sitemaps.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geoapp/sitemaps.py | from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap
from models import City, Country
from feeds import feed_dict
sitemaps = {'kml' : KMLSitemap([City, Country]),
'kmz' : KMZSitemap([City, Country]),
'georss' : GeoRSSSitemap(feed_dict),
}
| 301 | Python | .py | 7 | 36.714286 | 77 | 0.682594 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,537 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/relatedapp/models.py | from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... | 1,686 | Python | .py | 41 | 36.878049 | 71 | 0.742192 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,538 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/relatedapp/tests.py | from django.test import TestCase
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati... | 13,948 | Python | .py | 243 | 47.995885 | 155 | 0.652005 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,539 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geo3d/models.py | from django.contrib.gis.db import models
class City3D(models.Model):
name = models.CharField(max_length=30)
point = models.PointField(dim=3)
objects = models.GeoManager()
def __unicode__(self):
return self.name
class Interstate2D(models.Model):
name = models.CharField(max_length=30)
l... | 1,835 | Python | .py | 52 | 30.115385 | 52 | 0.70876 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,540 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/tests/geo3d/tests.py | import os
import re
from django.utils.unittest import TestCase
from django.contrib.gis.db.models import Union, Extent3D
from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
from django.contrib.gis.utils import LayerMapping, LayerMapError
from models import City3D, Interstate2D, Interstate3D, \
Intersta... | 11,305 | Python | .py | 201 | 46.562189 | 676 | 0.644149 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,541 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/management/base.py | from django.core.management.base import BaseCommand, CommandError
class ArgsCommand(BaseCommand):
"""
Command class for commands that take multiple arguments.
"""
args = '<arg arg ...>'
def handle(self, *args, **options):
if not args:
raise CommandError('Must provide the follow... | 484 | Python | .py | 12 | 34.083333 | 86 | 0.673774 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,542 | ogrinspect.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/management/commands/ogrinspect.py | import os, sys
from optparse import make_option
from django.contrib.gis import gdal
from django.contrib.gis.management.base import ArgsCommand, CommandError
def layer_option(option, opt, value, parser):
"""
Callback for `make_option` for the `ogrinspect` `layer_key`
keyword option which may be an integer o... | 6,252 | Python | .py | 109 | 45.330275 | 128 | 0.598562 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,543 | inspectdb.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/management/commands/inspectdb.py | from optparse import make_option
from django.core.management.base import CommandError
from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row... | 1,553 | Python | .py | 28 | 45.75 | 112 | 0.664694 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,544 | error.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/error.py | """
This module houses the OGR & SRS Exception objects, and the
check_err() routine which checks the status code returned by
OGR methods.
"""
#### OGR & SRS Exceptions ####
class GDALException(Exception): pass
class OGRException(Exception): pass
class SRSException(Exception): pass
class OGRIndexError(OGRException, K... | 1,517 | Python | .py | 38 | 33.263158 | 75 | 0.648538 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,545 | feature.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/feature.py | # The GDAL C library, OGR exception, and the Field object
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gi... | 3,998 | Python | .py | 93 | 35.333333 | 88 | 0.651915 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,546 | geometries.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/geometries.py | """
The OGRGeometry is a wrapper for using the OGR Geometry class
(see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry
may be instantiated when reading geometries from OGR Data Sources
(e.g. SHP files), or when given OGC WKT (a string).
While the 'full' API is not present yet, the API is "pythonic" u... | 26,357 | Python | .py | 625 | 33.4624 | 105 | 0.628025 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,547 | geomtype.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/geomtype.py | from django.contrib.gis.gdal.error import OGRException
#### OGRGeomType ####
class OGRGeomType(object):
"Encapulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0 : 'Unknown',
1 : 'Point',
2 ... | 2,967 | Python | .py | 75 | 29.066667 | 79 | 0.562978 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,548 | envelope.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/envelope.py | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | 7,044 | Python | .py | 157 | 33.522293 | 100 | 0.560887 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,549 | layer.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/layer.py | # Needed ctypes routines
from ctypes import c_double, byref
# Other GDAL imports.
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.feature... | 8,489 | Python | .py | 187 | 36.631016 | 105 | 0.64644 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,550 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/__init__.py | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-... | 2,173 | Python | .py | 43 | 47.534884 | 121 | 0.794048 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,551 | libgdal.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/libgdal.py | import os, re, sys
from ctypes import c_char_p, CDLL
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GDAL_LIBRARY_PATH
except (AttributeError, EnvironmentError, ImportError):
lib... | 3,390 | Python | .py | 88 | 34.465909 | 84 | 0.683954 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,552 | base.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/base.py | from ctypes import c_void_p
from types import NoneType
from django.contrib.gis.gdal.error import GDALException
class GDALBase(object):
"""
Base object for GDAL objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_ptr ... | 1,143 | Python | .py | 29 | 32.551724 | 95 | 0.648014 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,553 | datasource.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/datasource.py | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | 4,734 | Python | .py | 107 | 35.64486 | 92 | 0.635494 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,554 | driver.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/driver.py | # prerequisites imports
from ctypes import c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/ogr__api_8h.html
#
# ... | 2,411 | Python | .py | 55 | 34.309091 | 98 | 0.622944 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,555 | field.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/field.py | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException
from django.contrib.gis.gdal.prototypes import ds as capi
# For more information, see the OGR C API source code:
# http://www.gdal.org/ogr/... | 6,059 | Python | .py | 153 | 31.437908 | 101 | 0.625745 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,556 | srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,557 | test_ds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,558 | test_srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/tests/test_srs.py | from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
from django.utils import unittest
class TestSRS:
def __init__(self, wkt, **kwargs):
self.wkt = wkt
for key, value in kwargs.items():
setattr(self, key, value)
# Some Spatial Reference exam... | 11,199 | Python | .py | 145 | 65.006897 | 824 | 0.630143 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,559 | test_envelope.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/tests/test_envelope.py | from django.contrib.gis.gdal import Envelope, OGRException
from django.utils import unittest
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):
... | 3,742 | Python | .py | 80 | 38.8375 | 90 | 0.616671 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,560 | test_geom.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/gis/gdal/tests/test_geom.py | from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
OGRException, OGRIndexError, SpatialReference, CoordTransform, \
GDAL_VERSION
from django.utils import unittest
from django.contrib.gis.geometry.test_data import TestDataMixin
class OGRGeomTest(unittest.TestCase, TestDataMixin):
"This tests th... | 21,202 | Python | .py | 432 | 37.921296 | 96 | 0.614196 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,561 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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 django.utils.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(),
te... | 685 | Python | .py | 21 | 26.714286 | 63 | 0.654545 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,562 | test_driver.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,563 | ds.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,564 | errcheck.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,565 | generation.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,566 | geom.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,567 | srs.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,568 | options.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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,376 | Python | .py | 124 | 32.346774 | 117 | 0.587226 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,569 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,570 | widgets.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,571 | georss.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,572 | kml.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,573 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,574 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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,342 | Python | .py | 99 | 36.636364 | 116 | 0.665327 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,575 | tests.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,576 | lorem_ipsum.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,577 | webdesign.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,578 | signals.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/signals.py | from django.dispatch import Signal
user_logged_in = Signal(providing_args=['request', 'user'])
user_logged_out = Signal(providing_args=['request', 'user'])
| 157 | Python | .py | 3 | 51 | 60 | 0.751634 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,579 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/models.py | import datetime
import urllib
from django.contrib import auth
from django.contrib.auth.signals import user_logged_in
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 dja... | 19,247 | Python | .py | 401 | 38.850374 | 368 | 0.649576 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,580 | backends.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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
supports_inactive_user = True
# TODO: Mode... | 4,582 | Python | .py | 107 | 33.719626 | 143 | 0.633079 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,581 | tokens.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tokens.py | from datetime import date
from django.conf import settings
from django.utils.hashcompat import sha_constructor
from django.utils.http import int_to_base36, base36_to_int
from django.utils.crypto import constant_time_compare, salted_hmac
class PasswordResetTokenGenerator(object):
"""
Strategy object used to ge... | 3,206 | Python | .py | 69 | 37.246377 | 95 | 0.628681 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,582 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,583 | context_processors.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/context_processors.py | from django.utils.functional import lazy, memoize, SimpleLazyObject
from django.contrib import messages
# PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, module_name):
self.user, self... | 2,229 | Python | .py | 48 | 40.1875 | 79 | 0.693868 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,584 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/__init__.py | import datetime
from warnings import warn
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.contrib.auth.signals import user_logged_in, user_logged_out
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_backend'
REDIRECT_FIELD_NAME = 'next... | 4,560 | Python | .py | 103 | 37.631068 | 140 | 0.692152 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,585 | admin.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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,848 | Python | .py | 142 | 39.521127 | 208 | 0.639271 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,586 | create_superuser.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,587 | middleware.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,588 | decorators.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/decorators.py | import urlparse
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.decorators import available_attrs
def user_passes_test(test_func, login... | 2,388 | Python | .py | 51 | 38.686275 | 91 | 0.676685 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,589 | forms.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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,947 | Python | .py | 190 | 38.052632 | 138 | 0.638905 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,590 | views.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/views.py | import urlparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.http import base36_to_int
from django.utils.translation impo... | 10,288 | Python | .py | 227 | 35.629956 | 112 | 0.648096 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,591 | modpython.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,592 | signals.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/signals.py | from django.test import TestCase
from django.contrib.auth import signals
class SignalTestCase(TestCase):
urls = 'django.contrib.auth.tests.urls'
fixtures = ['authtestdata.json']
def listener_login(self, user, **kwargs):
self.logged_in.append(user)
def listener_logout(self, user, **kwargs):
... | 1,774 | Python | .py | 38 | 39.026316 | 78 | 0.678633 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,593 | models.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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) |
2,594 | tokens.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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):
"""
... | 3,416 | Python | .py | 72 | 37.791667 | 98 | 0.631342 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,595 | urls.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/urls.py | from django.conf.urls.defaults import patterns
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import Template, RequestContext
from django.views.decor... | 1,169 | Python | .py | 22 | 50.181818 | 126 | 0.749126 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,596 | remote_user.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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,422 | Python | .py | 138 | 38.927536 | 81 | 0.680422 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,597 | auth_backends.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/auth_backends.py | import warnings
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 ... | 13,877 | Python | .py | 275 | 42.418182 | 109 | 0.67569 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,598 | basic.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/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,632 | Python | .py | 83 | 34.662651 | 84 | 0.650551 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |
2,599 | __init__.py | gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/contrib/auth/tests/__init__.py | from django.contrib.auth.tests.auth_backends import (BackendTest,
RowlevelBackendTest, AnonymousUserBackendTest, NoAnonymousUserBackendTest,
NoBackendsTest, InActiveUserBackendTest, NoInActiveUserBackendTest)
from django.contrib.auth.tests.basic import BasicTestCase
from django.contrib.auth.tests.decorators imp... | 1,092 | Python | .py | 17 | 61.764706 | 78 | 0.865922 | gabrielfalcao/lettuce | 1,274 | 325 | 102 | GPL-3.0 | 9/5/2024, 5:08:58 PM (Europe/Amsterdam) |