text
stringlengths
0
1.05M
meta
dict
from django.utils import encoding from pandas import DataFrame import pandas as pd import argparse import os from pandas import ExcelWriter parser = argparse.ArgumentParser(description='convert tweets text to excel format') parser.add_argument('-i', '--infile', type=str, help='input file (csv form...
{ "repo_name": "motazsaad/tweets-collector", "path": "text2xlsx.py", "copies": "1", "size": "2050", "license": "apache-2.0", "hash": -5933444532778249000, "line_mean": 35.625, "line_max": 85, "alpha_frac": 0.6409756098, "autogenerated": false, "ratio": 3.7683823529411766, "config_test": false, ...
from django.utils import formats def number_format(value, tsep=',', dsep='.'): s = str(value) cnt = 0 numchars = dsep + '0123456789' ls = len(s) while cnt < ls and s[cnt] not in numchars: cnt += 1 lhs = s[:cnt] s = s[cnt:] if not dsep: cnt = -1 else: cnt = s....
{ "repo_name": "bung87/moto-moe", "path": "moto/moe/utils/tools.py", "copies": "1", "size": "1568", "license": "mit", "hash": 6311365140467360000, "line_mean": 24.7213114754, "line_max": 96, "alpha_frac": 0.5140306122, "autogenerated": false, "ratio": 3.239669421487603, "config_test": false, "...
from django.utils import formats from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers from feder.cases.models import Case from feder.letters.logs.models import EmailLog class CaseSerializer(serializers.HyperlinkedModelSerializer): user = serializers.StringRelatedField() ...
{ "repo_name": "watchdogpolska/feder", "path": "feder/cases/serializers.py", "copies": "1", "size": "2594", "license": "mit", "hash": 6327601671879613000, "line_mean": 31.024691358, "line_max": 86, "alpha_frac": 0.6368542791, "autogenerated": false, "ratio": 4.511304347826087, "config_test": fal...
from django.utils import formats from rest_framework import serializers from .models import Speed, AverageQuality from .lib.pyspeedtest import pretty_speed from .models import Settings from .lib.helpers import is_not_first_run class DictSerializer(serializers.BaseSerializer): def to_representation(self, instance)...
{ "repo_name": "krstnschwpwr/speedcontrol", "path": "probe/serializers.py", "copies": "1", "size": "3085", "license": "mit", "hash": -6440577118128591000, "line_mean": 32.5326086957, "line_max": 102, "alpha_frac": 0.6213938412, "autogenerated": false, "ratio": 4.146505376344086, "config_test": f...
from django.utils import formats from wagtail.core.blocks import CharBlock, StructBlock, TextBlock, StreamBlock, PageChooserBlock, \ URLBlock, DateBlock, ListBlock, BooleanBlock from wagtail.documents.blocks import DocumentChooserBlock from wagtail.embeds.blocks import EmbedBlock from wagtail.images.blocks import I...
{ "repo_name": "bruecksen/isimip", "path": "isi_mip/pages/blocks.py", "copies": "1", "size": "16175", "license": "mit", "hash": -1154210173759001000, "line_mean": 33.6359743041, "line_max": 159, "alpha_frac": 0.6046367852, "autogenerated": false, "ratio": 3.7476830398517147, "config_test": false...
from django.utils import html from custom.succeed.reports.patient_task_list import PatientTaskListReport from custom.succeed.reports import CHW_APP_TASK_MODULE, CM_NEW_TASK, CM_APP_CREATE_TASK_MODULE from custom.succeed.reports.patient_details import PatientDetailsReport from custom.succeed.utils import is_cm, is_chw ...
{ "repo_name": "SEL-Columbia/commcare-hq", "path": "custom/succeed/reports/patient_tasks.py", "copies": "1", "size": "1268", "license": "bsd-3-clause", "hash": -5745706354289666000, "line_mean": 46, "line_max": 161, "alpha_frac": 0.6758675079, "autogenerated": false, "ratio": 3.185929648241206, ...
from django.utils import html import CommonMark from HTMLParser import HTMLParser def markdown_unescape(markdown): #pus proper markdown <code> tags instead of &gt, allowing #markdown to be applied, which translates and returns markdown #text temp_markdown=markdown #parse to decode markdown parse_markdown=HTMLPa...
{ "repo_name": "DaynaLacoursiere/cmput404-project", "path": "squirespace/blog/markdownfunctions.py", "copies": "1", "size": "1550", "license": "apache-2.0", "hash": 4272820295144882000, "line_mean": 30.6530612245, "line_max": 67, "alpha_frac": 0.7419354839, "autogenerated": false, "ratio": 3.54691...
from django.utils import http from django.utils import unittest from django.http import HttpResponse, utils from django.test import RequestFactory class TestUtilsHttp(unittest.TestCase): def test_same_origin_true(self): # Identical self.assertTrue(http.same_origin('http://foo.com/', 'http://foo.co...
{ "repo_name": "django-nonrel/django-nonrel", "path": "tests/regressiontests/utils/http.py", "copies": "1", "size": "2647", "license": "bsd-3-clause", "hash": 8814066974426833000, "line_mean": 36.2816901408, "line_max": 90, "alpha_frac": 0.615791462, "autogenerated": false, "ratio": 3.765291607396...
from django.utils import httpwrappers class BaseHandler: def __init__(self): self._request_middleware = self._view_middleware = self._response_middleware = self._exception_middleware = None def load_middleware(self): """ Populate middleware lists from settings.MIDDLEWARE_CLASSES. ...
{ "repo_name": "tungvx/deploy", "path": "Django-0.90/django/core/handlers/base.py", "copies": "1", "size": "6421", "license": "apache-2.0", "hash": -4854428943334480000, "line_mean": 44.5390070922, "line_max": 167, "alpha_frac": 0.5944556923, "autogenerated": false, "ratio": 4.749260355029586, "...
from django.utils import importlib from django.core.exceptions import ImproperlyConfigured # Name for use in settings file --> name of module in "backends" directory. # Any backend scheme that is not in this dictionary is treated as a Python # import path to a custom backend. BACKENDS = { 'email': 'email.EmailBac...
{ "repo_name": "theatlantic/django-notification", "path": "notification/backends/__init__.py", "copies": "1", "size": "1929", "license": "mit", "hash": 4730822144504346000, "line_mean": 31.15, "line_max": 136, "alpha_frac": 0.66562986, "autogenerated": false, "ratio": 4.157327586206897, "config_...
from django.utils import importlib from django.core.urlresolvers import get_callable from django.core.cache import cache from featureflags.conf import settings cache_timeout = settings.FEATUREFLAGS_CACHE_TIMEOUT def _cache_key(): site = getattr(settings, 'SITE_ID', '') return 'featureflags-%s-flags' % (site) ...
{ "repo_name": "gregbaker/django-featureflags", "path": "featureflags/flags.py", "copies": "1", "size": "1695", "license": "apache-2.0", "hash": 1917089824358092000, "line_mean": 26.7868852459, "line_max": 107, "alpha_frac": 0.6719764012, "autogenerated": false, "ratio": 4.195544554455446, "conf...
from django.utils import importlib from cacheback.base import Job class FunctionJob(Job): """ Job for executing a function and caching the result """ def __init__(self, lifetime=None, fetch_on_miss=None, task_options=None): if lifetime is not None: self.lifetime = int(lifetime) ...
{ "repo_name": "redsnapper8t8/django-cacheback", "path": "cacheback/function.py", "copies": "1", "size": "1402", "license": "mit", "hash": -1038473437007770100, "line_mean": 33.1951219512, "line_max": 80, "alpha_frac": 0.5991440799, "autogenerated": false, "ratio": 4.017191977077364, "config_tes...
from django.utils import importlib, timezone from . import settings from .models import ExecutionRecord class InvalidBackendAliasError(Exception): def __init__(self, backend): Exception.__init__(self, "There is no scheduler backend with alias '%s'" % backend) class InvalidBackendError(Exception): de...
{ "repo_name": "hzdg/django-periodically", "path": "periodically/utils.py", "copies": "1", "size": "1904", "license": "mit", "hash": -7853738797769027000, "line_mean": 31.8275862069, "line_max": 91, "alpha_frac": 0.6769957983, "autogenerated": false, "ratio": 4.112311015118791, "config_test": fa...
from django.utils.importlib import import_module from datetime import datetime, date, time #TODO Add content type cache from utils import ModelLazyObject from json import JSONDecoder, JSONEncoder import uuid class Decoder(JSONDecoder): """Extends the base simplejson JSONDecoder for Dejavu.""" def __init__(self...
{ "repo_name": "aparo/django-elasticsearch", "path": "django_elasticsearch/serializer.py", "copies": "1", "size": "5327", "license": "bsd-3-clause", "hash": 679607856122870900, "line_mean": 42.6639344262, "line_max": 107, "alpha_frac": 0.5383893373, "autogenerated": false, "ratio": 4.2581934452438...
from django.utils.importlib import import_module from django.conf import settings from django.conf.urls import patterns class IntegrationModuleNotFound(Exception): pass class IntegrationNotConfigured(Exception): pass integration_cache = {} class Integration(object): """Base Integration class that needs ...
{ "repo_name": "SimpleTax/merchant", "path": "billing/integration.py", "copies": "1", "size": "2219", "license": "bsd-3-clause", "hash": 3642815784618925600, "line_mean": 31.1594202899, "line_max": 113, "alpha_frac": 0.6511942316, "autogenerated": false, "ratio": 4.632567849686848, "config_test"...
from django.utils.importlib import import_module from django.conf import settings from django.conf.urls import patterns class IntegrationModuleNotFound(Exception): pass class IntegrationNotConfigured(Exception): pass integration_cache = {} class Integration(object): """Base Integration class that nee...
{ "repo_name": "yceruto/merchant", "path": "billing/integration.py", "copies": "1", "size": "2312", "license": "bsd-3-clause", "hash": -8925737967414075000, "line_mean": 29.4210526316, "line_max": 114, "alpha_frac": 0.6500865052, "autogenerated": false, "ratio": 4.605577689243028, "config_test":...
from django.utils.importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured class Settings(object): """ Simple wrapper around config. Read setting value from the projects' setting.py or from the given module. If you specify prefix, put sett...
{ "repo_name": "hamsavardhini09/AWSLearning", "path": "ella/utils/settings.py", "copies": "4", "size": "1051", "license": "bsd-3-clause", "hash": -3898675356848211000, "line_mean": 31.84375, "line_max": 131, "alpha_frac": 0.6317792578, "autogenerated": false, "ratio": 4.3429752066115705, "config...
from django.utils.importlib import import_module from django.conf import settings from django.core.exceptions import * from restclients.dao_implementation.pws import File as PWSFile from restclients.dao_implementation.sws import File as SWSFile from restclients.dao_implementation.gws import File as GWSFile from restcli...
{ "repo_name": "jeffFranklin/uw-restclients", "path": "restclients/dao.py", "copies": "1", "size": "10978", "license": "apache-2.0", "hash": -876056844777763100, "line_mean": 31.7701492537, "line_max": 81, "alpha_frac": 0.653579887, "autogenerated": false, "ratio": 3.5735677083333335, "config_te...
from django.utils.importlib import import_module from django.conf import settings from .utils.credit_card import CardNotSupported gateway_cache = {} class GatewayModuleNotFound(Exception): pass class GatewayNotConfigured(Exception): pass class InvalidData(Exception): pass class Gateway(object): ...
{ "repo_name": "digideskio/merchant", "path": "billing/gateway.py", "copies": "7", "size": "4769", "license": "bsd-3-clause", "hash": -3857388450266445300, "line_mean": 35.6846153846, "line_max": 102, "alpha_frac": 0.6605158314, "autogenerated": false, "ratio": 4.616650532429816, "config_test": ...
from django.utils.importlib import import_module from django.conf import settings gateway_cache = {} class GatewayModuleNotFound(Exception): pass class GatewayNotConfigured(Exception): pass class CardNotSupported(Exception): pass class InvalidData(Exception): pass class Gateway(object): """Sub...
{ "repo_name": "SimpleTax/merchant", "path": "billing/gateway.py", "copies": "1", "size": "4750", "license": "bsd-3-clause", "hash": 1457898415773610800, "line_mean": 36.4015748031, "line_max": 101, "alpha_frac": 0.66, "autogenerated": false, "ratio": 4.634146341463414, "config_test": false, "...
from django.utils.importlib import import_module from django.core.exceptions import ImproperlyConfigured from .settings import REQUEST_IP_RESOLVER def get_ip_of_request(request): """ This is the default way to get the IP from the request, Other resolvers can be hooked up using the settings """ tr...
{ "repo_name": "botify-labs/django-geoip-utils", "path": "geoip_utils/utils.py", "copies": "1", "size": "1786", "license": "bsd-3-clause", "hash": -878152371640346200, "line_mean": 30.8928571429, "line_max": 72, "alpha_frac": 0.6662933931, "autogenerated": false, "ratio": 3.8162393162393164, "co...
from django.utils.importlib import import_module from djangosolr.solr import escape from django.conf import settings class Options(object): def __init__(self, meta): self.meta = meta self.model = None self.type = None self.fields = [] self.pk = None def get...
{ "repo_name": "sophilabs/django-solr", "path": "djangosolr/documents/options.py", "copies": "1", "size": "2591", "license": "bsd-3-clause", "hash": 3763627338271204000, "line_mean": 35.5070422535, "line_max": 117, "alpha_frac": 0.5438054805, "autogenerated": false, "ratio": 3.907993966817496, "...
from django.utils.importlib import import_module from django.utils import simplejson from django.http import HttpResponse from django.conf import settings from sidebar.models import Sidebar, SidebarWidget from sidebar.forms import WidgetTitleForm, DefaultAdminForm def form_to_json(form): """ Convert form data...
{ "repo_name": "ekaputra07/django-sidebar", "path": "sidebar/utils.py", "copies": "1", "size": "6587", "license": "bsd-3-clause", "hash": -3182221595758790000, "line_mean": 26.3319502075, "line_max": 112, "alpha_frac": 0.5694549871, "autogenerated": false, "ratio": 4.1663504111321945, "config_te...
from django.utils.importlib import import_module from elfinder.conf import settings as ls def get_path_driver(hash_, optionset): """ Given an ``optionset`` and a path ``hash_`` this function returns a mounted volume driver for this path. This method assumes that the driver uses the default drive...
{ "repo_name": "yawd/yawd-elfinder", "path": "elfinder/utils/volumes.py", "copies": "1", "size": "1829", "license": "bsd-3-clause", "hash": 796791903034993400, "line_mean": 34.862745098, "line_max": 99, "alpha_frac": 0.6309458721, "autogenerated": false, "ratio": 4.156818181818182, "config_test"...
from django.utils.importlib import import_module from sitesngine.elfinder.conf import settings as ls def get_path_driver(hash_, optionset): """ Given an ``optionset`` and a path ``hash_`` this function returns a mounted volume driver for this path. This method assumes that the driver uses the def...
{ "repo_name": "eggforsale/django-sitesngine", "path": "sitesngine/elfinder/utils/volumes.py", "copies": "1", "size": "1838", "license": "mit", "hash": -1569696473715055000, "line_mean": 35.0392156863, "line_max": 99, "alpha_frac": 0.633297062, "autogenerated": false, "ratio": 4.158371040723982, ...
from django.utils.importlib import import_module from socketio.mixins import BroadcastMixin from socketio.namespace import BaseNamespace __all__ = ['autodiscover_socketios', 'BaseNamespace', 'Namespace', 'BroadcastMixin'] SOCKETIO_NS = {} LOADING_SOCKETIO = False def autodiscover_socketios(): """ ...
{ "repo_name": "Solution4Future/django-socketio", "path": "django_socketio/events.py", "copies": "1", "size": "1184", "license": "bsd-2-clause", "hash": -8308825477288039000, "line_mean": 21.7692307692, "line_max": 74, "alpha_frac": 0.6452702703, "autogenerated": false, "ratio": 4.082758620689655,...
from django.utils.importlib import import_module # A flag to tell us if autodiscover is running. autodiscover will set this to # True while running, and False when it finishes. LOADING = False def autodiscover(): """ Auto-discover INSTALLED_APPS devilry_plugin.py modules and fail silently when not presen...
{ "repo_name": "vegarang/devilry-django", "path": "devilry/apps/core/pluginloader.py", "copies": "1", "size": "1872", "license": "bsd-3-clause", "hash": -3313714596507011000, "line_mean": 37.2040816327, "line_max": 81, "alpha_frac": 0.639957265, "autogenerated": false, "ratio": 4.169265033407572, ...
from django.utils.importlib import import_module class AlreadyRegistered(Exception): pass class NotRegistered(Exception): pass # Global dict used by register. Maps custom reports to callback classes. registered_reports = {} def register(report): if report.name in registered_reports.keys(): raise...
{ "repo_name": "bkonkle/django-reporter", "path": "reporter/registration.py", "copies": "1", "size": "3208", "license": "bsd-3-clause", "hash": -3187635024762966000, "line_mean": 33.8695652174, "line_max": 79, "alpha_frac": 0.6624064838, "autogenerated": false, "ratio": 4.32345013477089, "config...
from django.utils.importlib import import_module from tastypie.authorization import Authorization from tastypie.exceptions import ImmediateHttpResponse from tastypie.resources import ModelResource from tastypie import fields from ..models import LogRecord from ..settings import PERSISTATION_PIPELINE from .authenticat...
{ "repo_name": "CodeScaleInc/log4django", "path": "log4django/api/resources.py", "copies": "1", "size": "1645", "license": "bsd-3-clause", "hash": -3803504852150956000, "line_mean": 34.7826086957, "line_max": 100, "alpha_frac": 0.6844984802, "autogenerated": false, "ratio": 4.31758530183727, "co...
from django.utils import regex_helper from django.utils import unittest class NormalizeTests(unittest.TestCase): def test_empty(self): pattern = r"" expected = [(u'', [])] result = regex_helper.normalize(pattern) self.assertEqual(result, expected) def test_escape(self): ...
{ "repo_name": "adrianholovaty/django", "path": "tests/regressiontests/utils/regex_helper.py", "copies": "33", "size": "1767", "license": "bsd-3-clause", "hash": -4948069754518265000, "line_mean": 35.8125, "line_max": 71, "alpha_frac": 0.571024335, "autogenerated": false, "ratio": 3.69665271966527...
from django.utils import safestring from django.utils import html from django.template import loader, Context, Template from django.template import context from .base import BaseTemplateHandler class TemplateHandler(BaseTemplateHandler): def setup(self): self.mark_safe = safestring.mark_safe ...
{ "repo_name": "strogo/djpcms", "path": "djpcms/template/_django.py", "copies": "1", "size": "1370", "license": "bsd-3-clause", "hash": 2508092642225643500, "line_mean": 36.027027027, "line_max": 86, "alpha_frac": 0.6795620438, "autogenerated": false, "ratio": 4.462540716612378, "config_test": f...
from django.utils import simplejson as json from dajaxice.core import dajaxice_functions from dajaxice.decorators import dajaxice_register from django.views.decorators.cache import cache_page from django.core import serializers from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 ...
{ "repo_name": "mcr/ietfdb", "path": "ietf/meeting/ajax.py", "copies": "1", "size": "18418", "license": "bsd-3-clause", "hash": 6240258585504100000, "line_mean": 35.3274161736, "line_max": 121, "alpha_frac": 0.6351395374, "autogenerated": false, "ratio": 3.8410844629822734, "config_test": false,...
from django.utils import simplejson as json from django.core.serializers.json import DjangoJSONEncoder from django.http import HttpResponse, HttpResponseBadRequest, Http404 from ajaxuploader.backends.local import LocalUploadBackend class AjaxFileUploader(object): def __init__(self, backend=None, **kwargs): ...
{ "repo_name": "OnlyInAmerica/django-ajax-uploader", "path": "ajaxuploader/views.py", "copies": "1", "size": "2633", "license": "bsd-3-clause", "hash": -8846372811025122000, "line_mean": 41.4677419355, "line_max": 77, "alpha_frac": 0.5666540068, "autogenerated": false, "ratio": 4.967924528301887, ...
from django.utils import simplejson as json from django.utils.encoding import smart_str from django.http import HttpResponse, HttpResponseNotFound, \ HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseServerError, \ HttpResponseBadRequest class AJAXError(Exception): RESPONSES = { 400: HttpR...
{ "repo_name": "ashchristopher/django-ajax-resources", "path": "ajax_resources/exceptions.py", "copies": "1", "size": "1125", "license": "mit", "hash": -7185591588467456000, "line_mean": 29.4324324324, "line_max": 77, "alpha_frac": 0.6551111111, "autogenerated": false, "ratio": 4.5, "config_test...
from django.utils import simplejson as json from django.utils.encoding import smart_unicode from django.db import models from django import forms from django.core.serializers.json import DjangoJSONEncoder import uuid class BetterJSONEncoder(DjangoJSONEncoder): def default(self, obj): if isinstance(obj, uu...
{ "repo_name": "dcramer/django-db-log", "path": "djangodblog/utils.py", "copies": "3", "size": "2382", "license": "bsd-3-clause", "hash": 1253768236346400500, "line_mean": 33.5362318841, "line_max": 93, "alpha_frac": 0.658270361, "autogenerated": false, "ratio": 4.030456852791878, "config_test":...
from django.utils import simplejson as json from google.appengine.ext import db, search from datetime import datetime from urllib2 import unquote import logging from utils import parse_timestamp, parse_vumi_timestamp, get_or_create, prefetch_refprops import color class User(db.Model): server = db.StringProperty(...
{ "repo_name": "smn/ircarchive", "path": "models.py", "copies": "1", "size": "4328", "license": "bsd-3-clause", "hash": 4851936946883231000, "line_mean": 34.1869918699, "line_max": 89, "alpha_frac": 0.6444085028, "autogenerated": false, "ratio": 3.959743824336688, "config_test": false, "has_no...
from django.utils import simplejson as json import rs.sqldb as sqldb import xml.etree.cElementTree as ET xml_header = '<?xml version=\"1.0\" encoding=\"UTF-8\">' def_version = '1.0' formats = ['json', 'xml'] def_format = 'json' def get_xml_header( version=def_version ): return "<?xml version=\"%s\" encoding=\"UT...
{ "repo_name": "CCLab/RS_ref", "path": "rawsalad/papi/rsdbapi.py", "copies": "1", "size": "7914", "license": "bsd-3-clause", "hash": -8166424881704822000, "line_mean": 29.7937743191, "line_max": 89, "alpha_frac": 0.5703816022, "autogenerated": false, "ratio": 3.477152899824253, "config_test": fa...
from django.utils import simplejson as json from ella.api import object_serializer, FULL from ella.articles.models import Article from test_ella.test_core.test_views import ViewsTestCase from nose import tools class TestCategoryDetail(ViewsTestCase): def test_category_is_properly_serialized(self): respo...
{ "repo_name": "hamsavardhini09/AWSLearning", "path": "test_ella/test_api/test_views.py", "copies": "2", "size": "1681", "license": "bsd-3-clause", "hash": -7778975792391433000, "line_mean": 38.0930232558, "line_max": 111, "alpha_frac": 0.6162998215, "autogenerated": false, "ratio": 3.983412322274...
from django.utils import simplejson as json import logging logger = logging.getLogger("gluten") def coerce_put_post(request): """ Django doesn't particularly understand REST. In case we send data over PUT, Django won't actually look at the data and load it. We need to twist its arm here. The...
{ "repo_name": "jbl2024/django-gluten", "path": "gluten/http.py", "copies": "1", "size": "2310", "license": "mit", "hash": 8719844316746269000, "line_mean": 33.4776119403, "line_max": 99, "alpha_frac": 0.6298701299, "autogenerated": false, "ratio": 4.254143646408839, "config_test": false, "has...
from django.utils import simplejson from dajaxice.core import dajaxice_functions from polls.models import Poll, Choice import serial, time def getVotes(request, poll_id): error = False try: arduino = serial.Serial( "/dev/ttyACM0", 115200, timeout = 1 ) text = arduino.readline().rstrip() except serial.Ser...
{ "repo_name": "silps/voteino", "path": "voteino_server/polls/ajax.py", "copies": "1", "size": "1039", "license": "mit", "hash": -8077598353922247000, "line_mean": 25.641025641, "line_max": 65, "alpha_frac": 0.656400385, "autogenerated": false, "ratio": 3.0469208211143695, "config_test": false, ...
from django.utils import simplejson from dajaxice.core import dajaxice_functions from scrapper.views import * def scrap_ajax(request, show_all = None): print 1 tf = TwitterInfo.objects.get(user = request.user) client = tf.initialise_oauth_client() request.session['tweets'] = [] # Delete the previ...
{ "repo_name": "tamizhgeek/tweetscrapper", "path": "scrapper/ajax.py", "copies": "1", "size": "3020", "license": "bsd-3-clause", "hash": -5719379363335810000, "line_mean": 44.0746268657, "line_max": 203, "alpha_frac": 0.6701986755, "autogenerated": false, "ratio": 3.842239185750636, "config_test...
from django.utils import simplejson from dajaxice.decorators import dajaxice_register from brew.tasks import init_mashing from brew.helpers import set_variable from brew.models import Batch, MashLog from django.utils.dateformat import format @dajaxice_register def start_mashing(request, batch_id): set_variable('a...
{ "repo_name": "StryKaizer/Brew", "path": "djangoproject/brew/ajax.py", "copies": "1", "size": "2177", "license": "isc", "hash": 5286614146641317000, "line_mean": 30.1142857143, "line_max": 118, "alpha_frac": 0.6766192007, "autogenerated": false, "ratio": 3.1827485380116958, "config_test": false...
from django.utils import simplejson from dajaxice.decorators import dajaxice_register from dajax.core import Dajax from punns.models import Punn from comments.models import Comment from votes.models import PunnVote, CommentVote from django.http import Http404 from django.contrib.auth.decorators import login_required fr...
{ "repo_name": "carquois/blobon", "path": "blobon/punns/ajax.py", "copies": "1", "size": "3969", "license": "mit", "hash": 5798377474624663000, "line_mean": 37.9117647059, "line_max": 87, "alpha_frac": 0.6578483245, "autogenerated": false, "ratio": 3.0274599542334095, "config_test": false, "ha...
from django.utils import simplejson from dajaxice.decorators import dajaxice_register from dajaxice.core import dajaxice_functions from dajax.core import Dajax import os, glob, zipfile from datetime import datetime from lighthouse.codeGen.templates import BTOGenerator dir_download = "./static/download/" @dajaxice_r...
{ "repo_name": "LighthouseHPC/lighthouse", "path": "src/Dlighthouse/lighthouse/ajax/btoscript.py", "copies": "1", "size": "2529", "license": "mit", "hash": -6862466301088616000, "line_mean": 25.0721649485, "line_max": 90, "alpha_frac": 0.665480427, "autogenerated": false, "ratio": 2.81939799331103...
from django.utils import simplejson from dajaxice.decorators import dajaxice_register from django.db.models import Q from django.contrib.auth.models import User @dajaxice_register def dajaxice_example(request): return simplejson.dumps({'message':'Hello from Python!'}) @dajaxice_register def args_example(request,...
{ "repo_name": "s1na/darkoob", "path": "darkoob/ajax.py", "copies": "1", "size": "1276", "license": "mit", "hash": 5424960584711663000, "line_mean": 27.3555555556, "line_max": 69, "alpha_frac": 0.6269592476, "autogenerated": false, "ratio": 3.439353099730458, "config_test": false, "has_no_keyw...
from django.utils import simplejson from dajaxice.decorators import dajaxice_register from django.utils.translation import ugettext as _ from django.db import transaction from darkoob.migration.models import Migration, Hop from darkoob.book.models import Book @dajaxice_register(method='POST') def submit_key(request, ...
{ "repo_name": "s1na/darkoob", "path": "darkoob/migration/ajax.py", "copies": "1", "size": "3655", "license": "mit", "hash": -649277559727721300, "line_mean": 30.2393162393, "line_max": 93, "alpha_frac": 0.5978112175, "autogenerated": false, "ratio": 4.029768467475193, "config_test": false, "h...
from django.utils import simplejson from dajaxice.decorators import dajaxice_register from django.utils.translation import ugettext as _ from django.template.loader import render_to_string from dajax.core import Dajax from django.db import transaction from darkoob.book.models import Book, Review @dajaxice_register(m...
{ "repo_name": "s1na/darkoob", "path": "darkoob/book/ajax.py", "copies": "1", "size": "2980", "license": "mit", "hash": 4892184562574104000, "line_mean": 29.4081632653, "line_max": 96, "alpha_frac": 0.5597315436, "autogenerated": false, "ratio": 3.973333333333333, "config_test": false, "has_no...
from django.utils import simplejson from decimal import Decimal import datetime class BetterJSONEncoder(simplejson.JSONEncoder): """JSON encoder which understands decimals, dates, and __json__""" def default(self, obj): '''Convert object to JSON encodable type.''' if hasattr(obj, '__json__'): ...
{ "repo_name": "freyley/django-viewmodels", "path": "djviewmodels/utils.py", "copies": "1", "size": "1556", "license": "bsd-3-clause", "hash": 6409417007790320000, "line_mean": 33.5777777778, "line_max": 85, "alpha_frac": 0.6433161954, "autogenerated": false, "ratio": 4.160427807486631, "config_...
from django.utils import simplejson from django.conf import settings from math import * import urllib def calc_bounding_box(lat, lon, radius, use_miles = True): """ retval -> lat_min, lat_max, lon_min, lon_max Calculates the max and min lat and lon for an area. It approximates a search area of rad...
{ "repo_name": "artminster/artminster", "path": "core/utils/geo.py", "copies": "1", "size": "1637", "license": "mit", "hash": -1851364067363357200, "line_mean": 28.7636363636, "line_max": 101, "alpha_frac": 0.6218692731, "autogenerated": false, "ratio": 3.2287968441814594, "config_test": false, ...
from django.utils import simplejson from django.contrib.auth.models import User from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthLoginView, ...
{ "repo_name": "1st/django-allauth", "path": "allauth/socialaccount/providers/twitter/views.py", "copies": "3", "size": "1791", "license": "mit", "hash": 8809131080684953000, "line_mean": 37.1063829787, "line_max": 75, "alpha_frac": 0.6370742602, "autogenerated": false, "ratio": 4.305288461538462,...
from django.utils import simplejson from django.core import serializers from dajaxice.decorators import dajaxice_register from django.conf import settings from django.db import transaction from dajaxice.core import dajaxice_functions import netutils import sambautils import models import helpers import forms import...
{ "repo_name": "ataka-team/django-r66", "path": "r66/ajax.py", "copies": "1", "size": "16286", "license": "mit", "hash": 8804091237750321000, "line_mean": 25.7861842105, "line_max": 89, "alpha_frac": 0.5982438905, "autogenerated": false, "ratio": 3.6007074950254254, "config_test": false, "has_...
from django.utils import simplejson from django.core.serializers.json import DjangoJSONEncoder from dockit.backends.base import BaseDocumentStorage, BaseIndexStorage from dockit.backends.queryset import BaseDocumentQuery from dockit.backends import get_index_router, dynamic_import from dockit.backends.djangodocument....
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/backends/djangodocument/backend.py", "copies": "1", "size": "8294", "license": "bsd-3-clause", "hash": 115337163427714900, "line_mean": 40.0594059406, "line_max": 147, "alpha_frac": 0.6303351821, "autogenerated": false, "ratio": 4.18466195761...
from django.utils import simplejson from django.db.models import get_model from django.shortcuts import get_object_or_404 from django.forms.models import modelform_factory from dajaxice.decorators import dajaxice_register from editlive.utils import get_adaptor, import_class @dajaxice_register(method='POST') def sav...
{ "repo_name": "h3/django-editlive", "path": "editlive/ajax.py", "copies": "1", "size": "3939", "license": "bsd-3-clause", "hash": -1762175883457733400, "line_mean": 31.5537190083, "line_max": 78, "alpha_frac": 0.5981213506, "autogenerated": false, "ratio": 3.4674295774647885, "config_test": fal...
from django.utils import simplejson from django.http import HttpResponse from django.shortcuts import get_object_or_404 from basic.blog.models import Post, Category from django.conf import settings from django import http from django.template import loader, Context from django_proxy.models import Proxy from basic.blog....
{ "repo_name": "emorozov/django-mingus", "path": "mingus/core/views.py", "copies": "1", "size": "8691", "license": "apache-2.0", "hash": -8283100857526494000, "line_mean": 40.5837320574, "line_max": 196, "alpha_frac": 0.6856518237, "autogenerated": false, "ratio": 3.4903614457831327, "config_tes...
from django.utils import simplejson from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.views.decorators.cache import cache_control from dolphin import flipper, settings, utils def _active_flags(request): """Returns the active...
{ "repo_name": "coxmediagroup/dolphin", "path": "dolphin/views.py", "copies": "1", "size": "1794", "license": "mit", "hash": -4713429987316046000, "line_mean": 39.7727272727, "line_max": 80, "alpha_frac": 0.6482720178, "autogenerated": false, "ratio": 4.077272727272727, "config_test": false, "...
from django.utils import simplejson from django.http import HttpResponse import types import pdb def wr(f): def ret(*args, **kwargs): rr = f(*args, **kwargs) rr.update({"jsonrpc": "2.0"}) return HttpResponse(simplejson.dumps(rr)) return ret def form_manager(f): def ret(*args, **kwa...
{ "repo_name": "spaceone/pyjs", "path": "pyjs/jsonrpc/django/jsonformprocessor.py", "copies": "6", "size": "9233", "license": "apache-2.0", "hash": -6828071272363552000, "line_mean": 35.6388888889, "line_max": 134, "alpha_frac": 0.622224629, "autogenerated": false, "ratio": 3.7335220380105136, "...
from django.utils import simplejson from django import http from django.conf.urls.defaults import patterns from django.conf import settings from django.core import urlresolvers import sys from gitology.config import settings as gsettings from gitology.d.views import show_post, show_wiki from gitology import utils c...
{ "repo_name": "amitu/gitology", "path": "src/gitology/d/middleware.py", "copies": "1", "size": "2831", "license": "bsd-3-clause", "hash": 8436059248106544000, "line_mean": 38.8732394366, "line_max": 81, "alpha_frac": 0.6156835041, "autogenerated": false, "ratio": 4.409657320872274, "config_test...
from django.utils import simplejson from django import http from django.template.loader import render_to_string from django.template import RequestContext from django.contrib.comments.views import comments from django.contrib.comments.models import Comment from django.shortcuts import render_to_response from django.con...
{ "repo_name": "jokey2k/ShockGsite", "path": "ajaxcomments/utils.py", "copies": "3", "size": "2333", "license": "bsd-3-clause", "hash": 7983153017639735000, "line_mean": 37.8833333333, "line_max": 98, "alpha_frac": 0.5872267467, "autogenerated": false, "ratio": 4.840248962655601, "config_test": ...
from django.utils import simplejson from django import template from django.conf import settings from ..models import DataLayer, TileLayer from ..views import _urls_for_js register = template.Library() @register.inclusion_tag('leaflet_storage/css2.html') def leaflet_storage_css(): return { "STATIC_URL":...
{ "repo_name": "daumann/chronas-application", "path": "umap/templates/leaflet_storage/leaflet_storage_tags.py", "copies": "1", "size": "2204", "license": "mit", "hash": -6636697367733984000, "line_mean": 28.3866666667, "line_max": 80, "alpha_frac": 0.636569873, "autogenerated": false, "ratio": 3.5...
from django.utils import simplejson from django.template import RequestContext from django.template.loader import render_to_string from dajaxice.decorators import dajaxice_register import os @dajaxice_register(name='content.load') def load(request,section_id): if len(section_id) <= 0: return html = render_to_strin...
{ "repo_name": "joeyuan19/flaming-bear", "path": "PersonalSite/content/ajax.py", "copies": "1", "size": "1359", "license": "apache-2.0", "hash": -124352942892655420, "line_mean": 23.2678571429, "line_max": 109, "alpha_frac": 0.6902133922, "autogenerated": false, "ratio": 2.867088607594937, "conf...
from django.utils import simplejson from django.utils.decorators import method_decorator from django.views.generic.base import View import comments from django import template, http from django.conf import settings from django.contrib.auth.decorators import permission_required, login_required from django.shortcuts impo...
{ "repo_name": "vosi/django-xcomments", "path": "comments/views/moderation.py", "copies": "1", "size": "1701", "license": "bsd-3-clause", "hash": 917165041386261800, "line_mean": 31.0943396226, "line_max": 92, "alpha_frac": 0.6525573192, "autogenerated": false, "ratio": 4.231343283582089, "confi...
from django.utils import simplejson from django.utils.encoding import smart_unicode from django.core.paginator import Paginator from utils import get_fields_and_servicemethods from exceptions import StoreException, ServiceException from services import JsonService, servicemethod __all__ = ('Store', 'ModelQueryStore')...
{ "repo_name": "tectronics/dojango", "path": "dojango/data/modelstore/stores.py", "copies": "3", "size": "15692", "license": "bsd-3-clause", "hash": -7656838611511072000, "line_mean": 33.563876652, "line_max": 112, "alpha_frac": 0.5665307163, "autogenerated": false, "ratio": 4.516983304548071, "...
from django.utils import simplejson from django.utils.html import escape from django.utils.functional import lazy from django import forms from django.core.urlresolvers import reverse as urlreverse import debug from ietf.person.models import * def json_emails(emails): if isinstance(emails, basestring): e...
{ "repo_name": "mcr/ietfdb", "path": "ietf/person/forms.py", "copies": "1", "size": "1820", "license": "bsd-3-clause", "hash": -1665494498039540200, "line_mean": 41.3255813953, "line_max": 139, "alpha_frac": 0.6714285714, "autogenerated": false, "ratio": 3.7837837837837838, "config_test": false,...
from django.utils import simplejson from django.utils.translation import ugettext as _ from django.template.loader import render_to_string from dajaxice.decorators import dajaxice_register from dajax.core import Dajax from django.db import transaction from django.contrib.auth.models import User from darkoob.social.mod...
{ "repo_name": "s1na/darkoob", "path": "darkoob/social/ajax.py", "copies": "1", "size": "9624", "license": "mit", "hash": -5130217521250139000, "line_mean": 30.348534202, "line_max": 130, "alpha_frac": 0.5680590191, "autogenerated": false, "ratio": 4.026778242677825, "config_test": false, "has...
from django.utils import simplejson from django.utils.translation import ugettext_lazy as _ from django import shortcuts from django.core import urlresolvers from django.views import generic from django import http from django.forms.models import inlineformset_factory from django.db.models.fields.related import Foreign...
{ "repo_name": "jpic/django-form-builder", "path": "form_builder/views.py", "copies": "1", "size": "5080", "license": "mit", "hash": -1079203986986645400, "line_mean": 30.75, "line_max": 77, "alpha_frac": 0.6318897638, "autogenerated": false, "ratio": 4.083601286173633, "config_test": false, "...
from django.utils import simplejson from failwhale.models import Account, Status, Summize, Timeline import datetime import rfc822 import failwhale import time import twitter import urllib, urllib2 SEARCH_URL = "http://search.twitter.com/search.json" def load_account(username): try: return Account.objects....
{ "repo_name": "pombredanne/django-failwhale", "path": "failwhale/util.py", "copies": "1", "size": "4094", "license": "bsd-3-clause", "hash": -78426067011766940, "line_mean": 30.2519083969, "line_max": 125, "alpha_frac": 0.6057645335, "autogenerated": false, "ratio": 3.925215723873442, "config_t...
from django.utils import simplejson from google.appengine.api import channel, memcache import models import stats import logging class OverQuotaError(Exception): def __str__(self): return "App is currently over quota. Please wait until tomorrow." class Channel(): token = None address = None ...
{ "repo_name": "2cloud/AppEngine", "path": "channels.py", "copies": "1", "size": "2157", "license": "mit", "hash": -6983334240479397000, "line_mean": 33.2380952381, "line_max": 78, "alpha_frac": 0.5479833102, "autogenerated": false, "ratio": 4.366396761133603, "config_test": false, "has_no_key...
from django.utils import simplejson from google.appengine.api import users from google.appengine.ext import db from google.appengine.ext import search from google.appengine.api import urlfetch from jinja2 import Environment, FileSystemLoader, TemplateNotFound import BeautifulSoup import os import re import time import ...
{ "repo_name": "pkeane/simplerepo", "path": "simplerepo.py", "copies": "1", "size": "5166", "license": "mit", "hash": 1709282009105566700, "line_mean": 30.3090909091, "line_max": 107, "alpha_frac": 0.6935733643, "autogenerated": false, "ratio": 3.5750865051903116, "config_test": false, "has_no...
from django.utils import simplejson from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app import fix_path import models import datetime class BaseHandler(webapp.RequestHandler): # def render_to_response(self, template_name, template_vals=None, theme=None): # if not t...
{ "repo_name": "html5rocks/updates.html5rocks.com", "path": "handler_json.py", "copies": "1", "size": "1759", "license": "apache-2.0", "hash": -2828075294492226600, "line_mean": 26.0615384615, "line_max": 80, "alpha_frac": 0.6367254122, "autogenerated": false, "ratio": 3.5463709677419355, "confi...
from django.utils import simplejson from social_auth.backends import BaseOAuth2, OAuthBackend from social_auth.utils import dsa_urlopen, backend_setting from urllib import urlencode DISQUS_SERVER = 'disqus.com' DISQUS_AUTHORIZATION_URL = 'https://disqus.com/api/oauth/2.0/authorize/' DISQUS_ACCESS_TOKEN_URL = 'https:/...
{ "repo_name": "gugu/django-social-auth-1", "path": "social_auth/backends/contrib/disqus.py", "copies": "5", "size": "2315", "license": "bsd-3-clause", "hash": 5639494412002028000, "line_mean": 30.7123287671, "line_max": 78, "alpha_frac": 0.5896328294, "autogenerated": false, "ratio": 3.6171875, ...
from django.utils import simplejson import cgi class JSONFilter(object): def __init__(self, app, mime_type='text/x-json'): self.app = app self.mime_type = mime_type def __call__(self, environ, start_response): # Read JSON POST input to jsonfilter.json if matching mime type resp...
{ "repo_name": "yencarnacion/jaikuengine", "path": ".google_appengine/lib/django-0.96/django/utils/simplejson/jsonfilter.py", "copies": "39", "size": "1680", "license": "apache-2.0", "hash": 3367198531606776300, "line_mean": 41, "line_max": 74, "alpha_frac": 0.568452381, "autogenerated": false, "r...
from django.utils import simplejson import datetime #import re from google.appengine.ext import db from google.appengine.api import users from lp.model import Entry # A solution from http://stackoverflow.com/questions/1531501/json-serialization-of-google-app-engine-models/3063649#3063649 # To decode date in javascrip...
{ "repo_name": "xinl/lifepadbox", "path": "lp/json.py", "copies": "1", "size": "2209", "license": "bsd-2-clause", "hash": 4173470993177672000, "line_mean": 39.9074074074, "line_max": 176, "alpha_frac": 0.6020823902, "autogenerated": false, "ratio": 3.5571658615136874, "config_test": false, "ha...
from django.utils import simplejson import feedparser import re from google.appengine.api import urlfetch from BeautifulSoup import BeautifulSoup import urllib,string,csv,sys,os from string import replace from main import Game game = Game.gql("WHERE match = :1", 23).get() url = "http://odds.football-data.co.uk/foo...
{ "repo_name": "hollerith/footypools", "path": "scrape.py", "copies": "1", "size": "3037", "license": "apache-2.0", "hash": -8194372409211682000, "line_mean": 30.3092783505, "line_max": 179, "alpha_frac": 0.7026671057, "autogenerated": false, "ratio": 2.9745347698334967, "config_test": false, ...
#from django.utils import simplejson import json from dajaxice.decorators import dajaxice_register from django.conf import settings from nltkapp.models import Document, Corpus import os import re import nltk from nltk.corpus import * from nltk.collocations import * import string import logging logger = logging.getLogg...
{ "repo_name": "wtamu-cisresearch/nltksite", "path": "old/nltksite/nltkapp/ajax.py", "copies": "1", "size": "7497", "license": "mit", "hash": -8989762181804489000, "line_mean": 30.3723849372, "line_max": 131, "alpha_frac": 0.7030812325, "autogenerated": false, "ratio": 2.9515748031496063, "confi...
from django.utils import simplejson import urllib from lib.httplib2 import Http import mimetypes class OAuth2AuthExchangeError(Exception): def __init__(self, description): self.description = description def __str__(self): return self.description class OAuth2API(object): host = None b...
{ "repo_name": "bashwork/sign-behind", "path": "instagram/instagram/oauth2.py", "copies": "1", "size": "8171", "license": "bsd-3-clause", "hash": 6864078588007241000, "line_mean": 38.2836538462, "line_max": 107, "alpha_frac": 0.5930730633, "autogenerated": false, "ratio": 3.8872502378686966, "co...
from django.utils import simplejson from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, OAuthLoginView, OAuthCallbackView, ...
{ "repo_name": "uroslates/django-allauth", "path": "allauth/socialaccount/providers/twitter/views.py", "copies": "1", "size": "1777", "license": "mit", "hash": 5476049024194157000, "line_mean": 38.4888888889, "line_max": 115, "alpha_frac": 0.6347777153, "autogenerated": false, "ratio": 4.191037735...
from django.utils import simplejson from google.appengine.api import memcache from google.appengine.ext import webapp from google.appengine.ext.webapp import template from mlabns.db import model from mlabns.util import constants from mlabns.util import util class AdminHandler(webapp.RequestHandler): def post(s...
{ "repo_name": "fernandalavalle/mlab-ns", "path": "server/mlabns/handlers/admin.py", "copies": "1", "size": "8084", "license": "apache-2.0", "hash": 433755560767804700, "line_mean": 40.0355329949, "line_max": 79, "alpha_frac": 0.5585106383, "autogenerated": false, "ratio": 3.704857928505958, "co...
from django.utils import simplejson from oembed.exceptions import OEmbedException class OEmbedResource(object): """ OEmbed resource, as well as a factory for creating resource instances from response json """ _data = {} content_object = None def __getattr__(self, name): return...
{ "repo_name": "worldcompany/djangoembed", "path": "oembed/resources.py", "copies": "1", "size": "1187", "license": "mit", "hash": -4614642915100159000, "line_mean": 25.9772727273, "line_max": 80, "alpha_frac": 0.5922493682, "autogenerated": false, "ratio": 4.209219858156028, "config_test": fals...
from django.utils import simplejson from tipfy import (RequestHandler, RequestRedirect, Response, abort, cached_property, redirect, url_for) from tipfy.ext.auth import MultiAuthMixin, login_required, user_required from tipfy.ext.auth.facebook import FacebookMixin from tipfy.ext.auth.google import GoogleMixin from ...
{ "repo_name": "macat/Piratetitler", "path": "app/apps/users/handlers.py", "copies": "1", "size": "9913", "license": "bsd-3-clause", "hash": -8690033932018182000, "line_mean": 31.6085526316, "line_max": 90, "alpha_frac": 0.6034500151, "autogenerated": false, "ratio": 4.166876839007987, "config_t...
from django.utils import simplejson import oembed from oembed.exceptions import AlreadyRegistered, NotRegistered, OEmbedMissingEndpoint from oembed.models import StoredProvider, StoredOEmbed from oembed.resources import OEmbedResource from oembed.tests.oembed_providers import BlogProvider from oembed.tests.tests.base ...
{ "repo_name": "0101/djangoembed", "path": "oembed/tests/tests/sites.py", "copies": "2", "size": "3326", "license": "mit", "hash": 2068682356849833500, "line_mean": 44.5616438356, "line_max": 100, "alpha_frac": 0.6782922429, "autogenerated": false, "ratio": 3.9548156956004754, "config_test": tru...
from django.utils import simplejson import urllib import StringIO from models import DiggLinkRecent, Link, Topic from django.contrib.auth.models import User import datetime import os import pickle from libs import redditstories from BeautifulSoup import BeautifulSoup digg_user_id = 1 digg_topic_id = 1 d...
{ "repo_name": "agiliq/django-socialnews", "path": "socialnews/news/scraping.py", "copies": "1", "size": "5858", "license": "bsd-3-clause", "hash": 2294837272536855300, "line_mean": 37.0666666667, "line_max": 183, "alpha_frac": 0.5926937521, "autogenerated": false, "ratio": 3.4724362774155306, "...
from django.utils import simplejson,timezone from dajaxice.decorators import dajaxice_register from dajax.core import Dajax from vertex.models import * from login.views import authDetail @dajaxice_register(method = 'POST' , name = 'sayhello') def sayhello(request,likes,do,flow_id=None,text=""): if do == 'like': flo...
{ "repo_name": "bardia-heydarinejad/Graph", "path": "vertex/ajax.py", "copies": "2", "size": "1935", "license": "mit", "hash": 6677558315701780000, "line_mean": 32.3620689655, "line_max": 106, "alpha_frac": 0.6956072351, "autogenerated": false, "ratio": 3, "config_test": false, "has_no_keyword...
from django.utils import simplejson, translation from django.http import HttpResponse from django.core.urlresolvers import reverse from django.utils.html import strip_tags import datetime import re from xml.etree.ElementTree import Element, SubElement, Comment, tostring from moocng.courses.models import Course, CourseT...
{ "repo_name": "GeographicaGS/moocng", "path": "moocng/eco_api/views.py", "copies": "1", "size": "11684", "license": "apache-2.0", "hash": -2377690287222111000, "line_mean": 38.606779661, "line_max": 321, "alpha_frac": 0.698390962, "autogenerated": false, "ratio": 3.0238095238095237, "config_tes...
from django.utils import six from collections import OrderedDict from django.core.urlresolvers import reverse from django.core.paginator import InvalidPage, Paginator as DjangoPaginator from django.db.models import QuerySet from rest_framework import pagination from rest_framework.exceptions import NotFound from rest_...
{ "repo_name": "acshi/osf.io", "path": "api/base/pagination.py", "copies": "1", "size": "14802", "license": "apache-2.0", "hash": 4732894424948370000, "line_mean": 38.472, "line_max": 110, "alpha_frac": 0.578502905, "autogenerated": false, "ratio": 4.190826727066818, "config_test": false, "has...
from django.utils import six from collections import OrderedDict from django.core.urlresolvers import reverse from django.core.paginator import InvalidPage, Paginator as DjangoPaginator from rest_framework import pagination from rest_framework.exceptions import NotFound from rest_framework.response import Response fro...
{ "repo_name": "rdhyee/osf.io", "path": "api/base/pagination.py", "copies": "1", "size": "14120", "license": "apache-2.0", "hash": -4285845589232012000, "line_mean": 37.7912087912, "line_max": 110, "alpha_frac": 0.5728753541, "autogenerated": false, "ratio": 4.1812259401835945, "config_test": fa...
from django.utils import six from collections import OrderedDict from django.urls import reverse from django.core.paginator import InvalidPage, Paginator as DjangoPaginator from django.db.models import QuerySet from rest_framework import pagination from rest_framework.exceptions import NotFound from rest_framework.res...
{ "repo_name": "felliott/osf.io", "path": "api/base/pagination.py", "copies": "6", "size": "16276", "license": "apache-2.0", "hash": -1787258122435931600, "line_mean": 37.7523809524, "line_max": 110, "alpha_frac": 0.558183829, "autogenerated": false, "ratio": 4.3183868400106125, "config_test": f...
from django.utils import six from django.apps.registry import Apps from django.db.backends.schema import BaseDatabaseSchemaEditor from django.db.models.fields.related import ManyToManyField class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_delete_table = "DROP TABLE %(table)s" sql_create_inline_fk = ...
{ "repo_name": "archen/django", "path": "django/db/backends/sqlite3/schema.py", "copies": "4", "size": "7750", "license": "bsd-3-clause", "hash": 3239899880302600000, "line_mean": 43.0340909091, "line_max": 193, "alpha_frac": 0.5918709677, "autogenerated": false, "ratio": 4.007238883143743, "con...
from django.utils import six from django.core.exceptions import ImproperlyConfigured from django_mongoengine.utils.wrappers import WrapDocument, copy_class from django_mongoengine.utils.monkey import get_patched_django_module from django_mongoengine.forms.documents import documentform_factory from .detail import Sing...
{ "repo_name": "iandd0824/ri-app", "path": "web/django_mongoengine/views/edit.py", "copies": "1", "size": "1890", "license": "apache-2.0", "hash": 4275567201865681000, "line_mean": 29.4838709677, "line_max": 76, "alpha_frac": 0.6804232804, "autogenerated": false, "ratio": 4.029850746268656, "con...
from django.utils import six from django.db.backends import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): compiler_module = __name__.rsplit('.', 1)[0] + '.compiler' def quote_name(self, name): return name def last_insert_id(self, cursor, table_name, pk_name): r...
{ "repo_name": "ikeikeikeike/django-impala-backend", "path": "impala/operations.py", "copies": "1", "size": "1087", "license": "mit", "hash": 8099722064397355000, "line_mean": 29.1944444444, "line_max": 78, "alpha_frac": 0.6320147194, "autogenerated": false, "ratio": 3.9671532846715327, "config_...
from django.utils import six from django.db import models from modelcluster.fields import ParentalKey from wagtail.core.models import Page, Orderable, PageBase from wagtail.core.fields import RichTextField from wagtail.admin.edit_handlers import FieldPanel, InlinePanel from wagtail.images.edit_handlers import ImageChoo...
{ "repo_name": "jeromecc/doctoctocbot", "path": "src/blog/models.py", "copies": "1", "size": "2775", "license": "mpl-2.0", "hash": 908908863515502700, "line_mean": 34.1265822785, "line_max": 89, "alpha_frac": 0.7023423423, "autogenerated": false, "ratio": 4.147982062780269, "config_test": false,...
from django.utils import six from django.db import models from oscar.models.fields import AutoSlugField from oscar.apps.offer.models import Benefit, Condition class SluggedTestModel(models.Model): title = models.CharField(max_length=42) slug = AutoSlugField(populate_from='title') class ChildSluggedTestModel...
{ "repo_name": "anandsimmy/ecommerce", "path": "tests/_site/model_tests_app/models.py", "copies": "1", "size": "1152", "license": "bsd-3-clause", "hash": 2896566647650422300, "line_mean": 21.5882352941, "line_max": 57, "alpha_frac": 0.6484375, "autogenerated": false, "ratio": 4.013937282229965, ...
from django.utils import six from django.db.models.base import ModelBase from django.db.models.options import DEFAULT_NAMES class OverridableMeta(ModelBase): def __new__(mcls, name, bases, attrs): Meta = attrs.get("Meta", None) extra_attributes = {} if Meta: for attr in dir(Me...
{ "repo_name": "lovasb/django-restify", "path": "restify/remote.py", "copies": "1", "size": "1024", "license": "mit", "hash": 9061690065815208000, "line_mean": 25.2564102564, "line_max": 76, "alpha_frac": 0.580078125, "autogenerated": false, "ratio": 4.266666666666667, "config_test": false, "h...
from django.utils import six from django.dispatch import Signal from django.utils.itercompat import is_iterable from django.conf import settings from django.utils.module_loading import module_has_submodule try: from importlib import import_module except ImportError: from django.utils.importlib import import_mo...
{ "repo_name": "MichalMaM/ella", "path": "ella/utils/installedapps.py", "copies": "1", "size": "1510", "license": "bsd-3-clause", "hash": 7157115391686713000, "line_mean": 28.0384615385, "line_max": 64, "alpha_frac": 0.6450331126, "autogenerated": false, "ratio": 4.114441416893733, "config_test"...
from django.utils import six from django.http import StreamingHttpResponse from taggit.utils import edit_string_for_tags def export_csv_response(generator, name='export.csv'): response = StreamingHttpResponse(generator, content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="%s"' % ...
{ "repo_name": "CodeforHawaii/froide", "path": "froide/helper/csv_utils.py", "copies": "5", "size": "1573", "license": "mit", "hash": 1035214595361798800, "line_mean": 24.3709677419, "line_max": 72, "alpha_frac": 0.5931341386, "autogenerated": false, "ratio": 3.827250608272506, "config_test": fa...
from django.utils import six from django.http import StreamingHttpResponse def export_csv_response(generator, name='export.csv'): response = StreamingHttpResponse(generator, content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="%s"' % name return response class FakeFile(objec...
{ "repo_name": "okfse/froide", "path": "froide/helper/csv_utils.py", "copies": "1", "size": "1260", "license": "mit", "hash": -2243951621380729900, "line_mean": 26.3913043478, "line_max": 72, "alpha_frac": 0.5880952381, "autogenerated": false, "ratio": 4.02555910543131, "config_test": false, "...
from django.utils import six from django import template from django.template import TemplateSyntaxError from ella.core.models import Category from ella.positions.models import Position register = template.Library() def _get_category_from_pars_var(template_var, context): ''' get category from template vari...
{ "repo_name": "MichalMaM/ella", "path": "ella/positions/templatetags/positions.py", "copies": "1", "size": "3943", "license": "bsd-3-clause", "hash": 1746307641117650700, "line_mean": 30.544, "line_max": 113, "alpha_frac": 0.6512807507, "autogenerated": false, "ratio": 3.9000989119683482, "conf...
from django.utils import six from django.template.loader import get_template_from_string from django.db import models from django.utils.translation import ugettext_lazy as _ from django.template import Template, TemplateSyntaxError, defaulttags, loader_tags from django.core.exceptions import ValidationError # these ta...
{ "repo_name": "jarcoal/django-templatefield", "path": "templatefield/fields.py", "copies": "1", "size": "2515", "license": "mit", "hash": 7857041364389172000, "line_mean": 30.4375, "line_max": 83, "alpha_frac": 0.6349900596, "autogenerated": false, "ratio": 4.396853146853147, "config_test": fal...
from django.utils import six from django.templatetags.tz import utc from django.utils.timezone import is_naive from django.http import Http404, HttpResponse from django.core.paginator import InvalidPage, Paginator from django.contrib.syndication.views import add_domain from django.contrib.sites.shortcuts import get_cur...
{ "repo_name": "pastpages/django-memento-framework", "path": "memento/timemap/__init__.py", "copies": "1", "size": "5651", "license": "mit", "hash": 8229654146963173000, "line_mean": 34.5408805031, "line_max": 78, "alpha_frac": 0.5629092196, "autogenerated": false, "ratio": 4.1551470588235295, "...
from django.utils import six from django.utils.deprecation import ( DeprecationInstanceCheck, RemovedInDjango20Warning, ) from . import engines from .base import Origin from .exceptions import TemplateDoesNotExist def get_template(template_name, using=None): """ Loads and returns a template for the given...
{ "repo_name": "ABaldwinHunter/django-clone-classic", "path": "django/template/loader.py", "copies": "39", "size": "2101", "license": "bsd-3-clause", "hash": -5934371945229810000, "line_mean": 29.0142857143, "line_max": 78, "alpha_frac": 0.6901475488, "autogenerated": false, "ratio": 4.39539748953...
from django.utils import six from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem from icekit.utils import implementation # Ensure django-brightcove dependency is installed. try: from django_brightcove....
{ "repo_name": "ic-labs/django-icekit", "path": "icekit/plugins/brightcove/abstract_models.py", "copies": "1", "size": "1383", "license": "mit", "hash": 5504989390380024000, "line_mean": 30.4318181818, "line_max": 91, "alpha_frac": 0.7288503254, "autogenerated": false, "ratio": 4.1656626506024095,...