text stringlengths 0 1.05M | meta dict |
|---|---|
from django.conf.urls import url, include
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
from xgds_sample import views
urlpatterns = [url(r'labels$', views.getSampleLabelsPage, {}, 'xgds_sample_labels'),
url(r'deleteLabel/(?P<labelNum>[\d]+)$', views.de... | {
"repo_name": "xgds/xgds_sample",
"path": "xgds_sample/urls.py",
"copies": "1",
"size": "2211",
"license": "apache-2.0",
"hash": 4832800949525973000,
"line_mean": 57.1842105263,
"line_max": 175,
"alpha_frac": 0.6770691995,
"autogenerated": false,
"ratio": 3.8186528497409324,
"config_test": fals... |
from django.conf.urls import url, include
from django.views.generic.base import TemplateView, RedirectView
from django.conf import settings
import xgds_core.views as views
urlpatterns = [url(r'^update_session', views.update_session, {}, 'update_session'),
url(r'^update_cookie', views.update_cookie, {}... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/urls.py",
"copies": "1",
"size": "3347",
"license": "apache-2.0",
"hash": 2866636842262435300,
"line_mean": 63.3653846154,
"line_max": 128,
"alpha_frac": 0.6420675232,
"autogenerated": false,
"ratio": 3.6301518438177873,
"config_test": false,
... |
from django.conf.urls import url, include
from xgds_planner2 import views
urlpatterns = [
url(r'^index/$', views.planIndex, {}, name='planner2_index'),
url(r'^edit/(?P<plan_id>[^/]+)$', views.plan_editor_app, {}, name='planner2_edit'),
url(r'^test/(?P<plan_id>[^/]+)$', views.plan_tests, {}, name='planner... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/urls.py",
"copies": "1",
"size": "2739",
"license": "apache-2.0",
"hash": -3001213401288363500,
"line_mean": 59.8666666667,
"line_max": 140,
"alpha_frac": 0.6849215042,
"autogenerated": false,
"ratio": 3.3159806295399514,
"config_test":... |
from django.conf.urls import url
from django.views.generic.base import TemplateView, RedirectView
from django.conf import settings
from dal.autocomplete import Select2QuerySetView
import xgds_core.views as views
import xgds_core.redisUtil as redisUtil
import xgds_core.typeahead as typeahead
from xgds_core.models imp... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/restUrls.py",
"copies": "1",
"size": "4217",
"license": "apache-2.0",
"hash": 5832995882837842000,
"line_mean": 68.131147541,
"line_max": 144,
"alpha_frac": 0.6668247569,
"autogenerated": false,
"ratio": 3.5556492411467118,
"config_test": false... |
from django.conf.urls import url
from xgds_planner2 import views
urlpatterns = [
url(r'^planIndex\.kml$', views.getPlanIndexKml, {}, name='planner2_planIndexKml'),
url(r'^planIndexJson$', views.getPlanIndexJson, {}, name='planner2_planIndexJson'),
url(r'^plan/(?P<plan_id>[^/]+)$', views.plan_save_from_re... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/restUrls.py",
"copies": "1",
"size": "2850",
"license": "apache-2.0",
"hash": -2244485822848067800,
"line_mean": 68.512195122,
"line_max": 153,
"alpha_frac": 0.6792982456,
"autogenerated": false,
"ratio": 3.125,
"config_test": false,
... |
from django.contrib import admin
from xgds_map_server import models
class KmlMapAdmin(admin.ModelAdmin):
list_display = ('uuid',
'name',
'parent',
'openable',
'visible',
'kmlFile',
'descriptio... | {
"repo_name": "xgds/xgds_map_server",
"path": "xgds_map_server/admin.py",
"copies": "1",
"size": "2724",
"license": "apache-2.0",
"hash": 6169773628485110000,
"line_mean": 32.2195121951,
"line_max": 83,
"alpha_frac": 0.6119676946,
"autogenerated": false,
"ratio": 4.197226502311248,
"config_test... |
from django.core.exceptions import ValidationError
ERROR_MESSAGE = 'Password must contain at least one of %s'
class SpecialCharsValidator(object):
def __init__(self, characters="~!@#$%^&*()_+-=`;:',.<>?/"):
self.special_characters = characters
def validate(self, password, user=None):
if an... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/password_validation.py",
"copies": "1",
"size": "1342",
"license": "apache-2.0",
"hash": 1658494508480241400,
"line_mean": 39.696969697,
"line_max": 95,
"alpha_frac": 0.7280178838,
"autogenerated": false,
"ratio": 4.042168674698795,
"config_tes... |
from django.db import connection
from geocamUtil.loader import getModelByName
from geocamUtil import TimeUtil
from django.conf import settings
# pylint: disable=W0231
def posixTimeMsToUtcDateTime(posixTimeMs):
return TimeUtil.posixToUtcDateTime(posixTimeMs / 1000.0)
class TimeSeriesQueryManager(object):
... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/query.py",
"copies": "1",
"size": "5493",
"license": "apache-2.0",
"hash": 1729268627346049800,
"line_mean": 34.2115384615,
"line_max": 93,
"alpha_frac": 0.6570180229,
"autogenerated": false,
"ratio": 4.108451757666417,
"config_test": false,
... |
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from geocamUtil.modelJson import modelToDict
from geocamUtil.UserUtil import getUserName
from xgds_core.couchDbStorage import CouchDbStorage
from xgds_core.models impor... | {
"repo_name": "xgds/xgds_instrument",
"path": "xgds_instrument/models.py",
"copies": "1",
"size": "7302",
"license": "apache-2.0",
"hash": -7868639870357757000,
"line_mean": 40.4886363636,
"line_max": 159,
"alpha_frac": 0.6706381813,
"autogenerated": false,
"ratio": 3.966322650733297,
"config_t... |
from django.db.models import Q
from xgds_notes2.models import HierarchichalTag
from xgds_map_server.models import Place
def buildQueryForTags(fieldname, field, value, hierarchy):
listval = [int(x) for x in value]
if not hierarchy:
return Q(**{fieldname + '__id__in': listval})
else:
result... | {
"repo_name": "xgds/xgds_notes2",
"path": "xgds_notes2/utils.py",
"copies": "1",
"size": "1467",
"license": "apache-2.0",
"hash": 9206726060874640000,
"line_mean": 34.7804878049,
"line_max": 83,
"alpha_frac": 0.6680299932,
"autogenerated": false,
"ratio": 3.975609756097561,
"config_test": false... |
from django import db
from django.contrib import auth
from rest_framework.authtoken.models import Token
UserModel = auth.get_user_model()
def check_password(environ, username, password):
""" ... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/tokenAuth.py",
"copies": "1",
"size": "2799",
"license": "apache-2.0",
"hash": -4386493950157666300,
"line_mean": 51.8113207547,
"line_max": 195,
"alpha_frac": 0.4619506967,
"autogenerated": false,
"ratio": 6.318284424379232,
"config_test": fal... |
from django import forms
from django.forms import ModelForm
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.forms import DateTimeField
from django.utils.functional import lazy
from dal import autocomplete
from geocamUtil.e... | {
"repo_name": "xgds/xgds_basalt",
"path": "apps/basaltApp/forms.py",
"copies": "1",
"size": "8326",
"license": "apache-2.0",
"hash": 483200545642833340,
"line_mean": 44.4972677596,
"line_max": 137,
"alpha_frac": 0.6918087917,
"autogenerated": false,
"ratio": 4.142288557213931,
"config_test": fa... |
from django import forms
from xgds_plot import models as plotModels
saveAsNewVersionField = forms.BooleanField(initial=True, label='Save as new version', required=False,
help_text='If true, save edited entry as a new record with an incremented version number (recommended du... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/forms.py",
"copies": "1",
"size": "1767",
"license": "apache-2.0",
"hash": -8983908093539178000,
"line_mean": 52.5454545455,
"line_max": 233,
"alpha_frac": 0.7357102434,
"autogenerated": false,
"ratio": 4.406483790523691,
"config_test": false,
... |
from django import template
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag(name='help_button')
def help_button(help_content_path, help_title):
try:
url = reverse('help_popup', kwargs={'help_content_path':help_c... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/templatetags/help_button.py",
"copies": "1",
"size": "1582",
"license": "apache-2.0",
"hash": 7990068104297984000,
"line_mean": 46.9393939394,
"line_max": 157,
"alpha_frac": 0.7048040455,
"autogenerated": false,
"ratio": 3.896551724137931,
"con... |
from django.test import TransactionTestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from unittest import skipIf
from xgds_planner2.models import Plan
import logging
@override_settings(PIPELINE_ENABLED=False)
class xgds_planner2Te... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/tests.py",
"copies": "1",
"size": "4485",
"license": "apache-2.0",
"hash": 6562411801953892000,
"line_mean": 44.303030303,
"line_max": 155,
"alpha_frac": 0.6604236343,
"autogenerated": false,
"ratio": 3.6582381729200653,
"config_test": ... |
from django.views.generic import TemplateView
from django.conf.urls import url
from django.conf import settings
from xgds_data import views
urlpatterns = [
url(r'^$', views.index, name='xgds_data_index'),
# url(r'^advancedSearch/$', 'searchIndex',
# name='xgds_data_searchIndex'),
# url(r'^advance... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/urls.py",
"copies": "1",
"size": "5913",
"license": "apache-2.0",
"hash": 3101365124413808600,
"line_mean": 47.4672131148,
"line_max": 119,
"alpha_frac": 0.5552173178,
"autogenerated": false,
"ratio": 4.080745341614906,
"config_test": false,
... |
from enum import Enum
import os
import logging
import sys
import six
import tempfile
import xml.dom.minidom
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.core.ur... | {
"repo_name": "xgds/xgds_image",
"path": "xgds_image/models.py",
"copies": "1",
"size": "35493",
"license": "apache-2.0",
"hash": -956218627624727400,
"line_mean": 40.7074030552,
"line_max": 218,
"alpha_frac": 0.6246865579,
"autogenerated": false,
"ratio": 4.113222853169544,
"config_test": fals... |
from geocamUtil import KmlUtil
from django.contrib.staticfiles.templatetags.staticfiles import static
from polycircles import polycircles
"""
Exports map layer as KML String
"""
def exportMapLayer(request, mapLayer):
resultString = ''
styleString = ''
features = mapLayer.getFeatureJson().features
sty... | {
"repo_name": "xgds/xgds_map_server",
"path": "xgds_map_server/kmlLayerExporter.py",
"copies": "1",
"size": "11099",
"license": "apache-2.0",
"hash": 5185838063796995000,
"line_mean": 29.0785907859,
"line_max": 110,
"alpha_frac": 0.5542841697,
"autogenerated": false,
"ratio": 4.141417910447761,
... |
from geocamUtil import KmlUtil
from xgds_core.util import insertIntoPath
from xml.sax.saxutils import escape
from xgds_planner2.planExporter import TreeWalkPlanExporter
from xgds_planner2 import xpjson
from django.contrib.staticfiles.templatetags.staticfiles import static
class KmlPlanExporter(TreeWalkPlanExporter):... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/kmlPlanExporter.py",
"copies": "1",
"size": "4733",
"license": "apache-2.0",
"hash": 3440663213359012000,
"line_mean": 35.9765625,
"line_max": 140,
"alpha_frac": 0.6473695331,
"autogenerated": false,
"ratio": 3.8731587561374794,
"config... |
from geocamUtil import KmlUtil
from xml.sax.saxutils import escape
from xgds_planner2.planExporter import TreeWalkPlanExporter
from xgds_planner2 import xpjson
from polycircles import polycircles
class KmlPlanExporter(TreeWalkPlanExporter):
"""
Exports plan as KML string.
"""
label = 'kml'
cont... | {
"repo_name": "xgds/xgds_basalt",
"path": "apps/basaltApp/kmlPlanExporter.py",
"copies": "1",
"size": "6000",
"license": "apache-2.0",
"hash": -3013223527519210500,
"line_mean": 36.037037037,
"line_max": 135,
"alpha_frac": 0.6,
"autogenerated": false,
"ratio": 3.992015968063872,
"config_test": ... |
from geocamUtil.loader import getClassByName
from django.conf import settings
def getModClass(name):
"""converts 'xgds_planner.forms.PlanMetaForm' to ['xgds_planner.forms', 'PlanMetaForm']"""
try:
dot = name.rindex('.')
except ValueError:
return name, ''
return name[:dot], name[dot +... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/choosePlanImporter.py",
"copies": "1",
"size": "2094",
"license": "apache-2.0",
"hash": 7113925281172577000,
"line_mean": 35.7368421053,
"line_max": 94,
"alpha_frac": 0.694364852,
"autogenerated": false,
"ratio": 3.914018691588785,
"con... |
from geocamUtil.SettingsUtil import getOrCreateArray, getOrCreateDict
"""
This app may define some new parameters that can be modified in the
Django settings module. Let's say one such parameter is XGDS_DATA_FOO.
The default value for XGDS_DATA_FOO is defined in this file, like this:
XGDS_DATA_FOO = 'my default v... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/defaultSettings.py",
"copies": "1",
"size": "3238",
"license": "apache-2.0",
"hash": 6641383409206900000,
"line_mean": 39.9873417722,
"line_max": 102,
"alpha_frac": 0.60284126,
"autogenerated": false,
"ratio": 4.072955974842768,
"config_test": ... |
from geocamUtil.SettingsUtil import getOrCreateDict, getOrCreateArray
"""
This app may define some new parameters that can be modified in the
Django settings module. Let's say one such parameter is FOO. The
default value for FOO is defined in this file, like this:
FOO = 'my default value'
If the admin for the s... | {
"repo_name": "xgds/xgds_notes2",
"path": "xgds_notes2/defaultSettings.py",
"copies": "1",
"size": "8196",
"license": "apache-2.0",
"hash": 3549964806302208500,
"line_mean": 55.524137931,
"line_max": 366,
"alpha_frac": 0.5457540264,
"autogenerated": false,
"ratio": 3.9047165316817534,
"config_t... |
from glob import glob
import time
import os
import m3u8
import pytz
import re
import json
from threading import Timer
from datetime import datetime
from glob import glob
import traceback
from django.conf import settings
from django.db import models
from geocamUtil.models import UuidField
from geocamUtil.datetimeJson... | {
"repo_name": "xgds/xgds_video",
"path": "xgds_video/models.py",
"copies": "1",
"size": "16639",
"license": "apache-2.0",
"hash": 3237642365490763000,
"line_mean": 40.1856435644,
"line_max": 249,
"alpha_frac": 0.6339924274,
"autogenerated": false,
"ratio": 4.057303096805657,
"config_test": fals... |
# from here: https://github.com/adamcharnock/swiftwind-heroku/blob/master/swiftwind_heroku/management/commands/create_superuser_with_password.py
from django.contrib.auth.management.commands import createsuperuser
from django.core.management import CommandError
class Command(createsuperuser.Command):
help = 'Cra... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/management/commands/createsuperuser.py",
"copies": "1",
"size": "2458",
"license": "apache-2.0",
"hash": -5505871027105024000,
"line_mean": 38.6612903226,
"line_max": 144,
"alpha_frac": 0.665174939,
"autogenerated": false,
"ratio": 4.312280701754... |
from requests import put, post
from requests.auth import HTTPBasicAuth
from django.conf import settings
from django.contrib.sites.models import Site
import time
import urllib
import string
def get_store_name(instance):
store_name = instance.name.replace(" ", "_")
acceptable_characters = string.ascii_letters... | {
"repo_name": "xgds/xgds_map_server",
"path": "xgds_map_server/uploadGeotiff.py",
"copies": "1",
"size": "7695",
"license": "apache-2.0",
"hash": -1114295612931006000,
"line_mean": 30.0282258065,
"line_max": 117,
"alpha_frac": 0.5291747888,
"autogenerated": false,
"ratio": 4.340101522842639,
"c... |
from xgds_planner2.planExporter import (TreeWalkPlanExporter,
JsonPlanExporter)
from xgds_planner2 import xpjson
# pylint: disable=W0223
def getCommandId(context):
return context.schema.commandIdFormat.format(
plan=context.plan,
parent=context.parent,
... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/fillIdsPlanExporter.py",
"copies": "1",
"size": "3760",
"license": "apache-2.0",
"hash": 8917916882904201000,
"line_mean": 31.9824561404,
"line_max": 140,
"alpha_frac": 0.7021276596,
"autogenerated": false,
"ratio": 4.038668098818475,
"... |
import cgi
import datetime
import pytz
# from haystack.query import SearchQuerySet
from django import forms
from django.conf import settings
from django.utils.functional import lazy
from django.db.models import Q
from dateutil.parser import parse as dateparser
from dal import autocomplete
from geocamUtil.extFileFie... | {
"repo_name": "xgds/xgds_notes2",
"path": "xgds_notes2/forms.py",
"copies": "1",
"size": "8676",
"license": "apache-2.0",
"hash": 2915500995132741600,
"line_mean": 41.1165048544,
"line_max": 129,
"alpha_frac": 0.6619409866,
"autogenerated": false,
"ratio": 4.169149447381066,
"config_test": fals... |
import csv
import traceback
import json
import datetime
import time
import pytz
import httplib
from django.conf import settings
from django.shortcuts import redirect, render, get_object_or_404
from django import forms
from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404, HttpResponse, JsonRes... | {
"repo_name": "xgds/xgds_basalt",
"path": "apps/basaltApp/views.py",
"copies": "1",
"size": "35298",
"license": "apache-2.0",
"hash": 6945528600650055000,
"line_mean": 40.871886121,
"line_max": 221,
"alpha_frac": 0.6128392543,
"autogenerated": false,
"ratio": 4.1625,
"config_test": false,
"ha... |
import csv
from xgds_planner2.planExporter import TreeWalkPlanExporter
from xgds_planner2 import xpjson
from xgds_planner2.statsPlanExporter import getDistanceMeters, norm2
def shortPos(latOrLon):
return float('%.6f' % latOrLon)
def timeHm(total):
hoursf = total / 3600.0
hours = int(hoursf)
minute... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/attic/csvPlanExporter.py",
"copies": "1",
"size": "5083",
"license": "apache-2.0",
"hash": 2371967929160828000,
"line_mean": 33.3445945946,
"line_max": 87,
"alpha_frac": 0.6043674995,
"autogenerated": false,
"ratio": 4.005516154452325,
... |
import csv
from xgds_planner2.planImporter import PlanImporter, planDocFromPlanDict
def planDictFromCoords(coords, meta, names=None, notes=None):
plan = meta.copy()
n = len(coords)
for i, lonLat in enumerate(coords):
seq_dict = {
'type': 'Station',
'geometry': {
... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/csvPlanImporter.py",
"copies": "1",
"size": "2378",
"license": "apache-2.0",
"hash": -4133788755717252600,
"line_mean": 32.9714285714,
"line_max": 83,
"alpha_frac": 0.6118587048,
"autogenerated": false,
"ratio": 4.135652173913043,
"conf... |
import datetime
import calendar
from django.conf import settings
try:
def total_seconds(delta):
return delta.total_seconds()
except AttributeError:
def total_seconds(delta):
return delta.days * 24 * 60 * 60 + delta.seconds + delta.microseconds * 1e-6
TIME_OFFSET0 = datetime.timedelta(hours=... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/csvutil.py",
"copies": "1",
"size": "1818",
"license": "apache-2.0",
"hash": -4656208822495506000,
"line_mean": 30.8947368421,
"line_max": 84,
"alpha_frac": 0.695269527,
"autogenerated": false,
"ratio": 3.7954070981210855,
"config_test": false,... |
import datetime
import json
import subprocess
import traceback
import socket
import shlex
from django.db import models
from django.conf import settings
from geocamUtil.modelJson import modelToDict
from xgds_core.models import Constant
from django.core.cache import caches
from xgds_video.util import getSegmentPath
f... | {
"repo_name": "xgds/xgds_status_board",
"path": "xgds_status_board/models.py",
"copies": "1",
"size": "10092",
"license": "apache-2.0",
"hash": 4057913914173193000,
"line_mean": 36.2398523985,
"line_max": 125,
"alpha_frac": 0.6210860087,
"autogenerated": false,
"ratio": 4.322055674518201,
"conf... |
import datetime
import pytz
from django import forms
from django.conf import settings
from django.utils.functional import lazy
from dal import autocomplete
from geocamUtil.extFileField import ExtFileField
from geocamUtil.loader import LazyGetModelByName
from django.forms import DateTimeField, ModelChoiceField
from g... | {
"repo_name": "xgds/xgds_instrument",
"path": "xgds_instrument/forms.py",
"copies": "1",
"size": "7778",
"license": "apache-2.0",
"hash": 2046823411105559800,
"line_mean": 46.4268292683,
"line_max": 127,
"alpha_frac": 0.6087683209,
"autogenerated": false,
"ratio": 4.586084905660377,
"config_tes... |
import datetime
import pytz
from django import forms
from django.conf import settings
from django.utils.functional import lazy
from django.db.models import Q
from dal import autocomplete
from models import SingleImage, ImageSet
from geocamUtil import TimeUtil
from geocamUtil.loader import LazyGetModelByName
from geo... | {
"repo_name": "xgds/xgds_image",
"path": "xgds_image/forms.py",
"copies": "1",
"size": "8307",
"license": "apache-2.0",
"hash": -6114011949237164000,
"line_mean": 47.2965116279,
"line_max": 168,
"alpha_frac": 0.6209221139,
"autogenerated": false,
"ratio": 4.544310722100657,
"config_test": false... |
import datetime
import pytz
from dal import autocomplete
from django.utils import timezone
from django.conf import settings
from django import forms
from django.utils.functional import lazy
from django.contrib.auth.models import User
from django.forms import ModelForm, CharField
from django.core.exceptions import V... | {
"repo_name": "xgds/xgds_sample",
"path": "xgds_sample/forms.py",
"copies": "1",
"size": "12247",
"license": "apache-2.0",
"hash": -5135704416520012000,
"line_mean": 46.6536964981,
"line_max": 142,
"alpha_frac": 0.6328896873,
"autogenerated": false,
"ratio": 4.333687190375088,
"config_test": fa... |
import datetime
def getDataFromRequest(request):
if request.method == "POST":
return request.POST
elif request.method == "GET":
return request.GET
else:
return {}
def total_seconds(timediff):
"""Get total seconds for a time delta"""
try:
return timediff.total_seco... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/utils.py",
"copies": "1",
"size": "1924",
"license": "apache-2.0",
"hash": 294776356323564600,
"line_mean": 31.0666666667,
"line_max": 103,
"alpha_frac": 0.6574844075,
"autogenerated": false,
"ratio": 3.9670103092783506,
"config_test": false,
... |
import json
import datetime
from dateutil.parser import parse as dateparser
from geocamUtil.datetimeJsonEncoder import DatetimeJsonEncoder
from django.conf import settings
from django.http import JsonResponse
if settings.XGDS_CORE_REDIS:
import redis
rs = redis.Redis(host=settings.XGDS_CORE_REDIS_HOST, por... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/redisUtil.py",
"copies": "1",
"size": "3043",
"license": "apache-2.0",
"hash": -4755167098256555000,
"line_mean": 38.5194805195,
"line_max": 109,
"alpha_frac": 0.6927374302,
"autogenerated": false,
"ratio": 3.8228643216080402,
"config_test": fa... |
import json
import logging
import traceback
from django.http import HttpResponse
from django.conf import settings
from geocamUtil.dotDict import convertToDotDictRecurse, DotDict
from geocamUtil import geomath
import models
import xpjson
# pylint: disable=W0223
class PlanExporter(object):
"""
Abstract cl... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/planExporter.py",
"copies": "1",
"size": "14729",
"license": "apache-2.0",
"hash": 1056773600609454000,
"line_mean": 35.3703703704,
"line_max": 127,
"alpha_frac": 0.6276054043,
"autogenerated": false,
"ratio": 4.419141914191419,
"config... |
import logging
import copy
import numpy as np
import pandas as pd
import pandas.io.sql as psql
import sqlalchemy
from django.conf import settings
try:
from matplotlib import pyplot as plt
except ImportError:
pass # non-plotting functions should still work
# pylint: disable=R0924,W0108,E1101
_djangoDbSettin... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/pandasUtil.py",
"copies": "1",
"size": "12685",
"license": "apache-2.0",
"hash": -3557569423961353000,
"line_mean": 30.9521410579,
"line_max": 114,
"alpha_frac": 0.6223098147,
"autogenerated": false,
"ratio": 4.042383683875079,
"config_test": f... |
import logging
import string
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.models import User
from django.core import mail
from django.conf import settings
from xgds_core.registerForms import U... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/register.py",
"copies": "1",
"size": "6851",
"license": "apache-2.0",
"hash": -2752933571886928400,
"line_mean": 36.0324324324,
"line_max": 143,
"alpha_frac": 0.6007882061,
"autogenerated": false,
"ratio": 4.314231738035264,
"config_test": fals... |
import logging
from datetime import datetime, timedelta
from pytz import timezone
import pytz
from apps.xgds_core.views import get_handlebars_templates
utc = pytz.utc
from django.shortcuts import render
from django.template import RequestContext
from django.http import HttpResponse
from django.core.urlresolvers impo... | {
"repo_name": "xgds/xgds_status_board",
"path": "xgds_status_board/views.py",
"copies": "1",
"size": "11785",
"license": "apache-2.0",
"hash": 3270175405918558700,
"line_mean": 38.4180602007,
"line_max": 125,
"alpha_frac": 0.6438693254,
"autogenerated": false,
"ratio": 4.10341225626741,
"config... |
import math
from django import template
register = template.Library()
@register.filter(name='secstohms')
def secstohms(value):
try:
durationSeconds = int(math.ceil(value))
minutes, seconds = divmod(durationSeconds, 60)
hours, minutes = divmod(minutes, 60)
return "%02d:%02d:%02d" %... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/templatetags/xgds_planner2_extras.py",
"copies": "1",
"size": "2359",
"license": "apache-2.0",
"hash": -208322009283138080,
"line_mean": 35.859375,
"line_max": 83,
"alpha_frac": 0.6795252226,
"autogenerated": false,
"ratio": 3.89273927392... |
import math
import numpy
import sys
import time
from django.conf import settings
# pylint: disable=E1101
MIN_SEGMENT_LENGTH_MS = (settings.XGDS_PLOT_MIN_DATA_INTERVAL_MS
* settings.XGDS_PLOT_SEGMENT_RESOLUTION)
MIN_SEGMENT_LEVEL = int(math.log(MIN_SEGMENT_LENGTH_MS, 2))
MAX_SEGMENT_LEVEL ... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/segment.py",
"copies": "1",
"size": "5301",
"license": "apache-2.0",
"hash": 7253585696113435000,
"line_mean": 32.5506329114,
"line_max": 150,
"alpha_frac": 0.5768722882,
"autogenerated": false,
"ratio": 3.794559770937724,
"config_test": false,... |
import math
import pyproj
from xgds_planner2.planExporter import JsonPlanExporter, TreeWalkPlanExporter
# pylint: disable=W0223
GEOD = pyproj.Geod(ellps='WGS84')
def norm2(lonLat1, lonLat2):
lon1, lat1 = lonLat1
lon2, lat2 = lonLat2
return math.sqrt((lon1 - lon2) ** 2 + (lat1 - lat2) ** 2)
def getDi... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/statsPlanExporter.py",
"copies": "1",
"size": "3945",
"license": "apache-2.0",
"hash": -6729427438934475000,
"line_mean": 33.0086206897,
"line_max": 107,
"alpha_frac": 0.6641318124,
"autogenerated": false,
"ratio": 3.77151051625239,
"co... |
import operator
from geocamUtil.loader import getClassByName
from django.conf import settings
def expandTimeSeriesMeta(meta):
"""
Evaluates IncludeMeta and IncludeFunctionResultMeta objects. Returns
a list of trees with Group and TimeSeries nodes.
"""
mtype = meta['type']
if mtype == 'Group... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/meta.py",
"copies": "1",
"size": "3483",
"license": "apache-2.0",
"hash": 1021386794316493700,
"line_mean": 31.858490566,
"line_max": 83,
"alpha_frac": 0.633649153,
"autogenerated": false,
"ratio": 4.278869778869779,
"config_test": false,
"ha... |
import os
from collections import deque
import time
import pytz
import datetime
from django import db
import numpy
from scipy.misc import pilutil
import matplotlib
matplotlib.use('Agg') # non-interactive png plotting backend
from matplotlib import pyplot, mpl
import matplotlib.cm
from PIL import Image
from geocamUt... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/tileIndex.py",
"copies": "1",
"size": "10024",
"license": "apache-2.0",
"hash": -638346437615586400,
"line_mean": 35.9889298893,
"line_max": 93,
"alpha_frac": 0.5959696728,
"autogenerated": false,
"ratio": 3.868776534156696,
"config_test": fals... |
import os
from geocamUtil.SettingsUtil import getOrCreateArray, getOrCreateDict
# Use this if you want to replace the default OSM baselayer with something (like Bing) that needs a key
XGDS_MAP_SERVER_MAP_API_KEY = ""
XGDS_MAP_SERVER_MEDIA_SUBDIR = 'xgds_map_server/'
XGDS_MAP_SERVER_DATA_SUBDIR = 'xgds_map_server/'
X... | {
"repo_name": "xgds/xgds_map_server",
"path": "xgds_map_server/defaultSettings.py",
"copies": "1",
"size": "7400",
"license": "apache-2.0",
"hash": 4493639858726304300,
"line_mean": 51.8642857143,
"line_max": 172,
"alpha_frac": 0.6645945946,
"autogenerated": false,
"ratio": 3.328834907782276,
"... |
import os
from setuptools import setup, find_packages
def read_file(filename):
"""Read a file into a string"""
path = os.path.abspath(os.path.dirname(__file__))
filepath = os.path.join(path, filename)
try:
return open(filepath).read()
except IOError:
return ''
# Use the docstring... | {
"repo_name": "xgds/xgds_core",
"path": "setup.py",
"copies": "1",
"size": "1649",
"license": "apache-2.0",
"hash": -489253708743833800,
"line_mean": 33.3541666667,
"line_max": 83,
"alpha_frac": 0.6889023651,
"autogenerated": false,
"ratio": 3.9168646080760094,
"config_test": false,
"has_no_k... |
import os
import datetime
from io import BytesIO
from PIL import Image, ExifTags, ImageFile
from django.conf import settings
from django.core.files import File
from geocamUtil.loader import LazyGetModelByName
CAMERA_MODEL = LazyGetModelByName(settings.XGDS_IMAGE_CAMERA_MODEL)
def getExifValue(exif, key):
try:
... | {
"repo_name": "xgds/xgds_image",
"path": "xgds_image/utils.py",
"copies": "1",
"size": "7162",
"license": "apache-2.0",
"hash": -2452989525731744300,
"line_mean": 30.6902654867,
"line_max": 126,
"alpha_frac": 0.6239877129,
"autogenerated": false,
"ratio": 3.56141223272004,
"config_test": false,... |
import os
import math
from collections import deque
import time
from django import db
from geocamUtil import anyjson as json
from geocamUtil.loader import getClassByName
from geocamUtil.store import FileStore, LruCacheStore
from geocamUtil.zmqUtil.delayBox import DelayBox
from django.conf import settings
from xgds_... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/segmentIndex.py",
"copies": "1",
"size": "9472",
"license": "apache-2.0",
"hash": -7593862663124321000,
"line_mean": 36,
"line_max": 93,
"alpha_frac": 0.6084248311,
"autogenerated": false,
"ratio": 4.032354193273734,
"config_test": false,
"ha... |
import os
import math
import sys
import numpy
from scipy.ndimage import filters
from django.conf import settings
# pylint: disable=E1101
EARTH_RADIUS_METERS = 6371 * 1000
METERS_PER_DEGREE = 2 * math.pi * EARTH_RADIUS_METERS / 360
DATA_PATH = os.path.join(settings.DATA_ROOT,
settings.XGDS_... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/tile.py",
"copies": "1",
"size": "6080",
"license": "apache-2.0",
"hash": 1784869163768893000,
"line_mean": 30.832460733,
"line_max": 90,
"alpha_frac": 0.6351973684,
"autogenerated": false,
"ratio": 3.1983166754339822,
"config_test": false,
"... |
import os
import pytz
import datetime
from django.conf import settings
from django.test import TransactionTestCase
from xgds_core.importer.csvImporter import CsvImporter
class test_csv(TransactionTestCase):
"""
Tests for csv importer
"""
fixtures = ['xgds_core_testing.json']
def test_parse(s... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/test/test_csv.py",
"copies": "1",
"size": "3003",
"license": "apache-2.0",
"hash": 2549182894866887700,
"line_mean": 41.9,
"line_max": 115,
"alpha_frac": 0.6656676657,
"autogenerated": false,
"ratio": 3.830357142857143,
"config_test": true,
"... |
import os
import shutil
import sys
import datetime
import pytz
import re
from geocamUtil import anyjson as json
from django.conf import settings
FLOAT_REGEX = re.compile(r'^-?\d+(\.\d*)?$')
# CompactFloat/compactFloats: annoying hack to avoid printing out bogus
# extra digits when floats are embedded in JSON objec... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/plotUtil.py",
"copies": "1",
"size": "3827",
"license": "apache-2.0",
"hash": -2752286167428178000,
"line_mean": 29.8629032258,
"line_max": 149,
"alpha_frac": 0.6420172459,
"autogenerated": false,
"ratio": 3.766732283464567,
"config_test": fals... |
import os
import sys
import pytz
import datetime
import time
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from django.conf import settings
from django.core.cache import caches
import urlparse
import json
import requests
if settings.XGDS_CORE_REDIS:
from redisUtil import queueR... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/util.py",
"copies": "1",
"size": "6067",
"license": "apache-2.0",
"hash": 5090709857229496000,
"line_mean": 30.4352331606,
"line_max": 118,
"alpha_frac": 0.6522169112,
"autogenerated": false,
"ratio": 3.832596336070752,
"config_test": false,
... |
import os
import sys
import tempfile
import re
# avoid crazy error on mac os
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
def getEnvironmentFromSourceMe(d='.'):
# pick up environment variables from sourceme
fd, varsFile = tempfile.mkstemp('djangoWsgiSourceMe.txt')
os.close(fd)
ret = os.system('bash -c "(... | {
"repo_name": "xgds/xgds_basalt",
"path": "djangoWsgi.py",
"copies": "1",
"size": "3348",
"license": "apache-2.0",
"hash": 3801198306908648000,
"line_mean": 34.6170212766,
"line_max": 160,
"alpha_frac": 0.6833930705,
"autogenerated": false,
"ratio": 3.5316455696202533,
"config_test": false,
"... |
import os
import time
import datetime
import json
import copy
from django.conf import settings
from geocamUtil.dotDict import convertToDotDictRecurse
from geocamUtil.loader import getModelByName
from xgds_planner2 import models, xpjson
from xgds_planner2.fillIdsPlanExporter import FillIdsPlanExporter
# Please don'... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/planImporter.py",
"copies": "1",
"size": "4847",
"license": "apache-2.0",
"hash": 2904841654455932400,
"line_mean": 33.1338028169,
"line_max": 114,
"alpha_frac": 0.6820713844,
"autogenerated": false,
"ratio": 4.076534903280067,
"config_... |
import os
from setuptools import setup, find_packages
def read_file(filename):
"""Read a file into a string"""
path = os.path.abspath(os.path.dirname(__file__))
filepath = os.path.join(path, filename)
try:
return open(filepath).read()
except IOError:
return ''
# Use the docstrin... | {
"repo_name": "xgds/xgds_planner2",
"path": "setup.py",
"copies": "1",
"size": "1663",
"license": "apache-2.0",
"hash": -5560844508707666000,
"line_mean": 32.9387755102,
"line_max": 83,
"alpha_frac": 0.691521347,
"autogenerated": false,
"ratio": 3.885514018691589,
"config_test": false,
"has_n... |
import pytz
from django import forms
from django.db import models
from django.utils.safestring import mark_safe
from django.db.models import fields
#from django.forms.widgets import RadioSelect, TextInput
from django.contrib.auth.models import User
try:
from django.contrib.contenttypes.fields import GenericForeign... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/forms.py",
"copies": "1",
"size": "23136",
"license": "apache-2.0",
"hash": 6749354167072674000,
"line_mean": 42.6528301887,
"line_max": 139,
"alpha_frac": 0.5455567082,
"autogenerated": false,
"ratio": 4.57957244655582,
"config_test": false,
... |
import pytz
import re
import datetime
from django.utils import timezone
import os
import traceback
import m3u8
from django.conf import settings
from geocamUtil.loader import LazyGetModelByName, getClassByName
from xgds_core.views import getDelay
from xgds_video.recordingUtil import getFudgeForSource
TIME_ZONE = pytz... | {
"repo_name": "xgds/xgds_video",
"path": "xgds_video/util.py",
"copies": "1",
"size": "11763",
"license": "apache-2.0",
"hash": 9003171033991681000,
"line_mean": 35.0828220859,
"line_max": 154,
"alpha_frac": 0.6289211936,
"autogenerated": false,
"ratio": 3.901492537313433,
"config_test": false,... |
import pytz
import traceback
from django.forms.models import ModelChoiceField, ModelForm
from django.conf import settings
from django.utils import timezone
from django import forms
from dal import autocomplete
from xgds_core.models import NamedURL
from django.db.models.fields import *
from django.db.models import ... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/forms.py",
"copies": "1",
"size": "9851",
"license": "apache-2.0",
"hash": 595296826247135200,
"line_mean": 38.0912698413,
"line_max": 135,
"alpha_frac": 0.6354684804,
"autogenerated": false,
"ratio": 4.206233988044406,
"config_test": false,
... |
import re
from django import template
from django.conf import settings
from django.db import models, DatabaseError, IntegrityError
from django.contrib.auth.models import User
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/templatetags/xgds_data_extras.py",
"copies": "1",
"size": "9663",
"license": "apache-2.0",
"hash": -4118953686496153000,
"line_mean": 32.9052631579,
"line_max": 143,
"alpha_frac": 0.5802545793,
"autogenerated": false,
"ratio": 4.172279792746114,
... |
import re
import datetime
import calendar
import pytz
from math import floor, log10, pow as mpow # shadows built-in pow()
from operator import itemgetter
#from django import forms
from django.db import connection
from django.db.models import (Q, Field, fields, StdDev)
from django.db.models.fields import (PositiveIn... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/search.py",
"copies": "1",
"size": "49261",
"license": "apache-2.0",
"hash": -1271991098146957000,
"line_mean": 39.1802610114,
"line_max": 144,
"alpha_frac": 0.5355149104,
"autogenerated": false,
"ratio": 4.174307262096432,
"config_test": false... |
import re
import datetime
import collections
import json
from django.db import models
from geocamUtil.TimeUtil import utcDateTimeToPosix
def intIfInt(val):
"""
Turn a string into an int if it looks like an int.
"""
if re.search(r'^\d+$', val):
return int(val)
else:
return val
... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/models.py",
"copies": "1",
"size": "7915",
"license": "apache-2.0",
"hash": 6177434761684153000,
"line_mean": 42.2513661202,
"line_max": 280,
"alpha_frac": 0.616298168,
"autogenerated": false,
"ratio": 4.434173669467787,
"config_test": false,
... |
import re
from geocamUtil.xml2json import xml2struct
from xgds_planner2.planImporter import PlanImporter, planDocFromPlanDict
def parseCoordinateTuple(s):
return [float(v) for v in s.split(',')]
def parseCoordinateTuples(s):
s = s.strip()
return [parseCoordinateTuple(s)[:2]
for s in re.sp... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/kmlPlanImporter.py",
"copies": "1",
"size": "2159",
"license": "apache-2.0",
"hash": 3976498589203641,
"line_mean": 29.4084507042,
"line_max": 83,
"alpha_frac": 0.6706808708,
"autogenerated": false,
"ratio": 3.9254545454545453,
"config_... |
#import sys
import re
import traceback
import json
import csv
import datetime
import pytz
import calendar
#import StringIO
from itertools import chain
from django.apps import apps
from django import forms
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from d... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/views.py",
"copies": "1",
"size": "61245",
"license": "apache-2.0",
"hash": 296255411318172860,
"line_mean": 37.278125,
"line_max": 457,
"alpha_frac": 0.5542003429,
"autogenerated": false,
"ratio": 4.273900907187718,
"config_test": false,
"ha... |
import traceback
from cStringIO import StringIO
import datetime
import inspect
import json
import logging
import os
import pytz
import re
import string
from subprocess import Popen, PIPE
import threading
import urllib
import zipfile
import csv
from dateutil.parser import parse as dateparser
from django.conf import se... | {
"repo_name": "xgds/xgds_map_server",
"path": "xgds_map_server/views.py",
"copies": "1",
"size": "102065",
"license": "apache-2.0",
"hash": -7561441182331417000,
"line_mean": 39.0254901961,
"line_max": 262,
"alpha_frac": 0.5841375594,
"autogenerated": false,
"ratio": 4.102290996784566,
"config_... |
import traceback
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.http import JsonResponse
from django.template import RequestContext
from django.template.loader import render_to_string
from django.views.decorators.cache import never_cache
from django.conf import settings
f... | {
"repo_name": "xgds/xgds_sample",
"path": "xgds_sample/views.py",
"copies": "1",
"size": "15834",
"license": "apache-2.0",
"hash": -1720132227423576300,
"line_mean": 42.8614958449,
"line_max": 145,
"alpha_frac": 0.620373879,
"autogenerated": false,
"ratio": 4.129890453834116,
"config_test": fal... |
import traceback
import cgi
import re
from datetime import datetime, timedelta
import itertools
import json
import pytz
import csv
import ast
from dateutil.parser import parse as dateparser
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import Con... | {
"repo_name": "xgds/xgds_notes2",
"path": "xgds_notes2/views.py",
"copies": "1",
"size": "27274",
"license": "apache-2.0",
"hash": -4331591429205203000,
"line_mean": 37.5225988701,
"line_max": 150,
"alpha_frac": 0.5853926817,
"autogenerated": false,
"ratio": 3.993265007320644,
"config_test": fa... |
import traceback
import datetime
import pytz
from django import forms
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms.fields import IntegerField, ChoiceField
from django.db.models import Q
from django.contrib.sites.models import Site
from resumable.fields import Resuma... | {
"repo_name": "xgds/xgds_map_server",
"path": "xgds_map_server/forms.py",
"copies": "1",
"size": "10124",
"license": "apache-2.0",
"hash": -3963711757730840600,
"line_mean": 38.7019607843,
"line_max": 190,
"alpha_frac": 0.641050968,
"autogenerated": false,
"ratio": 3.995264404104183,
"config_te... |
import traceback
import os
import pytz
import glob
import json
import datetime
import httplib
import threading
import shlex
from dateutil.parser import parse as dateparser
from django.utils import timezone
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import me... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/views.py",
"copies": "1",
"size": "51102",
"license": "apache-2.0",
"hash": 5840198202769101000,
"line_mean": 36.2470845481,
"line_max": 165,
"alpha_frac": 0.6161989746,
"autogenerated": false,
"ratio": 4.0725215173732865,
"config_test": false,... |
import unicodedata
import traceback
from django.utils import timezone
from django.db import models
from django.db.models.query import QuerySet
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.... | {
"repo_name": "xgds/xgds_notes2",
"path": "xgds_notes2/models.py",
"copies": "1",
"size": "27582",
"license": "apache-2.0",
"hash": 7513768457320994000,
"line_mean": 34.681759379,
"line_max": 168,
"alpha_frac": 0.6083677761,
"autogenerated": false,
"ratio": 4.075354609929078,
"config_test": fal... |
"""
settings.py -- Local site settings
Override in this what you wish. By default it simply imports the
site default settings and overrides nothing.
This file should *not* be checked into git.
"""
import sys
from siteSettings import *
# Make this unique, and don't share it with anybody. Used by Django's
# cooki... | {
"repo_name": "xgds/xgds_basalt",
"path": "management/templates/settings.py",
"copies": "1",
"size": "2253",
"license": "apache-2.0",
"hash": 1957136928639028500,
"line_mean": 33.6615384615,
"line_max": 91,
"alpha_frac": 0.7225920994,
"autogenerated": false,
"ratio": 3.418816388467375,
"config_... |
"""
shared_jupyter_notebook_config.py is where you put customizations for the
Jupyter notebook that you want to share across all sites that use the
xgds_plot app. If you want to do customizations for a particular
deployment, use jupyter_notebook_config.py instead.
"""
from django.conf import settings
# pylint: disab... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/notebook/jupyter/shared_jupyter_notebook_config.py",
"copies": "1",
"size": "2060",
"license": "apache-2.0",
"hash": 2251097514316277200,
"line_mean": 43.7826086957,
"line_max": 83,
"alpha_frac": 0.7694174757,
"autogenerated": false,
"ratio": 3.8... |
"""
This app may define some new parameters that can be modified in the
Django settings module. Let's say one such parameter is FOO. The
default value for FOO is defined in this file, like this:
FOO = 'my default value'
If the admin for the site doesn't like the default value, they can
override it in the site-le... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/defaultSettings.py",
"copies": "1",
"size": "6872",
"license": "apache-2.0",
"hash": -3193889922698918000,
"line_mean": 34.4226804124,
"line_max": 147,
"alpha_frac": 0.6260186263,
"autogenerated": false,
"ratio": 2.6812329301599687,
"config_tes... |
"""
Utilities for parsing and modeling XPJSON format plans, plan schemas, and plan libraries.
"""
import sys
import os
import json
from collections import deque, Mapping, OrderedDict
import re
import logging
import iso8601
try:
import pyproj
except ImportError:
# pyproj is only needed if you're doing geospat... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/xpjson.py",
"copies": "1",
"size": "34255",
"license": "apache-2.0",
"hash": 2051316782181248000,
"line_mean": 31.0439663237,
"line_max": 148,
"alpha_frac": 0.6152678441,
"autogenerated": false,
"ratio": 4.059611282294383,
"config_test"... |
"""
Version-controlled shared config for IPython Notebook.
Shared settings specified here are normally imported in the
non-version-controlled file ipython_notebook_config.py where you can
override settings on a site-specific basis.
"""
from django.conf import settings
# pylint: disable=E0602
c = get_config()
c.Not... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/notebook/profile_default/shared_notebook_config.py",
"copies": "1",
"size": "1309",
"license": "apache-2.0",
"hash": -2318829567207706000,
"line_mean": 36.4,
"line_max": 83,
"alpha_frac": 0.7677616501,
"autogenerated": false,
"ratio": 3.729344729... |
"""
xgds_status_board
"""
__version_info__ = {
'major': 0,
'minor': 1,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version():
"""
Return the formatted version information
"""
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro']:
... | {
"repo_name": "xgds/xgds_status_board",
"path": "xgds_status_board/__init__.py",
"copies": "1",
"size": "1692",
"license": "apache-2.0",
"hash": -1366316005859859000,
"line_mean": 29.2142857143,
"line_max": 91,
"alpha_frac": 0.6938534279,
"autogenerated": false,
"ratio": 3.6862745098039214,
"co... |
# pylint: disable=E1120
from django.conf.urls import url, include
from django.core.urlresolvers import reverse_lazy
from django.views.generic.base import RedirectView
from xgds_plot import views
urlpatterns = [url(r'^$', RedirectView.as_view(url=reverse_lazy('xgds_plot_plots'), permanent=False), {}, name='xgds_plot... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/urls.py",
"copies": "1",
"size": "1513",
"license": "apache-2.0",
"hash": -4302656135906270700,
"line_mean": 46.28125,
"line_max": 129,
"alpha_frac": 0.6999339061,
"autogenerated": false,
"ratio": 3.92987012987013,
"config_test": false,
"has_... |
# pylint: disable=W0105
from geocamUtil.SettingsUtil import getOrCreateArray
XGDS_ZMQ_WEB_SOCKET_URL = 'ws://{{host}}:8001/zmq/'
# include trailing slash but no leading slash
XGDS_PLOT_DATA_SUBDIR = 'xgds_plot/'
# the shortest time interval between data points
XGDS_PLOT_MIN_DATA_INTERVAL_MS = 500
# the longest ti... | {
"repo_name": "xgds/xgds_plot",
"path": "xgds_plot/defaultSettings.py",
"copies": "1",
"size": "5653",
"license": "apache-2.0",
"hash": 7395374970280645000,
"line_mean": 35.4709677419,
"line_max": 83,
"alpha_frac": 0.7369538298,
"autogenerated": false,
"ratio": 3.368891537544696,
"config_test":... |
# pylint: disable=W0612, W0702
import datetime
import pytz
import logging
import os
import re
from xml.sax.saxutils import escape
from django.conf import settings
from xgds_planner2.planExporter import TreeWalkPlanExporter
from xgds_planner2.models import getPlanSchema
from geocamUtil.dotDict import convertToDotDict... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/pmlPlanExporter.py",
"copies": "1",
"size": "10464",
"license": "apache-2.0",
"hash": -8424047577521567000,
"line_mean": 39.2461538462,
"line_max": 176,
"alpha_frac": 0.5859136086,
"autogenerated": false,
"ratio": 4.352745424292845,
"co... |
# siteSettings.py -- site default settings
#
# This contains the default settings for the site-level django app. This will
# override any application-default settings and define the default set of
# installed applications. This should be a full settings.py file which needs
# minimal overrides by the settings.py file ... | {
"repo_name": "xgds/xgds_basalt",
"path": "siteSettings.py",
"copies": "1",
"size": "38579",
"license": "apache-2.0",
"hash": 603845093354410900,
"line_mean": 52.8826815642,
"line_max": 440,
"alpha_frac": 0.5906062884,
"autogenerated": false,
"ratio": 3.690710800727064,
"config_test": false,
... |
# this has been renamed to dlogging as logging was causing a very confusing name conflict
from math import (floor, log)
from django import forms
from django.shortcuts import render
from django.conf import settings
from xgds_data.logconfig import logEnabled
from xgds_data.introspection import (pk, pkValue, concrete_... | {
"repo_name": "xgds/xgds_data",
"path": "xgds_data/dlogging.py",
"copies": "1",
"size": "5691",
"license": "apache-2.0",
"hash": 158400169468677900,
"line_mean": 37.7142857143,
"line_max": 143,
"alpha_frac": 0.606396064,
"autogenerated": false,
"ratio": 4.10310021629416,
"config_test": false,
... |
import sys
import pytz
import collections
import os
from cStringIO import StringIO
import datetime
import json
import traceback
import requests
from uuid import uuid4
from dateutil.parser import parse as dateparser
from django.forms.models import model_to_dict
from django.contrib import messages
from django.contrib.st... | {
"repo_name": "xgds/xgds_planner2",
"path": "xgds_planner2/views.py",
"copies": "1",
"size": "43638",
"license": "apache-2.0",
"hash": -9043019085144100000,
"line_mean": 38.4556962025,
"line_max": 143,
"alpha_frac": 0.5978504973,
"autogenerated": false,
"ratio": 4.071088720962776,
"config_test"... |
import pytz
import json
from geocamUtil.datetimeJsonEncoder import DatetimeJsonEncoder
from uuid import uuid4
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from geocamUtil.loader import LazyGetModelByName
if settings.XGDS_CORE_REDIS and settings.XGDS_SSE:
from xgds_core.r... | {
"repo_name": "xgds/xgds_core",
"path": "xgds_core/flightUtils.py",
"copies": "1",
"size": "11146",
"license": "apache-2.0",
"hash": 8597216861284823000,
"line_mean": 34.9548387097,
"line_max": 118,
"alpha_frac": 0.645971649,
"autogenerated": false,
"ratio": 3.7847198641765702,
"config_test": f... |
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#__END_LICENSE__
import subprocess
import os
import json, yaml
import shutil
from django.test import TransactionTestCase
from django.core.urlresolvers import revers... | {
"repo_name": "xgds/xgds_video",
"path": "xgds_video/test/tests.py",
"copies": "1",
"size": "9596",
"license": "apache-2.0",
"hash": 2676842503925871000,
"line_mean": 35.3484848485,
"line_max": 119,
"alpha_frac": 0.5592955398,
"autogenerated": false,
"ratio": 3.89132197891322,
"config_test": tr... |
from markdown.inlinepatterns import SimpleTagPattern
from markdown.extensions import Extension
reg_pattern =r'(={2})([^\?]+?)(={2})'
class Highlighting(Extension):
def extendMarkdown(self, md, md_globals):
"""Modifies inline patterns."""
mark_tag = SimpleTagPattern(reg_pattern, 'mark')
... | {
"repo_name": "byohay/Remarkable",
"path": "markdown/extensions/Highlighting.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": 556071624281276500,
"line_mean": 42.9473684211,
"line_max": 79,
"alpha_frac": 0.7377245509,
"autogenerated": false,
"ratio": 4.164588528678304,
"config_test... |
from markdown.inlinepatterns import SimpleTagPattern
from markdown.extensions import Extension
reg_pattern =r'(~{2})([^\?]+?)(~{2})'
class Strikethrough(Extension):
def extendMarkdown(self, md, md_globals):
"""Modifies inline patterns."""
mark_tag = SimpleTagPattern(reg_pattern, 'del')
... | {
"repo_name": "byohay/Remarkable",
"path": "markdown/extensions/Strikethrough.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": 3002627407301893000,
"line_mean": 42.9473684211,
"line_max": 79,
"alpha_frac": 0.7377245509,
"autogenerated": false,
"ratio": 4.143920595533499,
"config_te... |
import threading
import math
import os, os.path, sys
import time
import datetime
import urllib2
import json
import random
import socket
import re
import locale
locale.setlocale(locale.LC_ALL, '')
##############################################################################
# ... | {
"repo_name": "jpnos26/thermostat_V3",
"path": "thermostat.py",
"copies": "1",
"size": "61228",
"license": "mit",
"hash": 2409760808211314700,
"line_mean": 38.4002574003,
"line_max": 225,
"alpha_frac": 0.5862187235,
"autogenerated": false,
"ratio": 3.2206617221608544,
"config_test": false,
"h... |
import threading
import math
import os, os.path, sys
import time
import datetime
import urllib2
import json
import random
import socket
import re
import subprocess32
import locale
locale.setlocale(locale.LC_ALL, '')
##############################################################################
# ... | {
"repo_name": "jpnos26/thermostat",
"path": "thermostat.py",
"copies": "1",
"size": "62768",
"license": "mit",
"hash": 7193861613079282000,
"line_mean": 38.0348258706,
"line_max": 217,
"alpha_frac": 0.591017716,
"autogenerated": false,
"ratio": 3.306363253265908,
"config_test": false,
"has_no... |
from markdown.inlinepatterns import SimpleTagPattern
from markdown.extensions import Extension
reg_pattern =r'(={2})([^\?]+?)(={2})'
class Highlighting(Extension):
def extendMarkdown(self, md, md_globals):
"""Modifies inline patterns."""
mark_tag = SimpleTagPattern(reg_pattern, 'mark')
... | {
"repo_name": "jamiemcg/Remarkable",
"path": "markdown/extensions/Highlighting.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": 4091035431309976000,
"line_mean": 42.9473684211,
"line_max": 79,
"alpha_frac": 0.7377245509,
"autogenerated": false,
"ratio": 4.164588528678304,
"config_t... |
from markdown.inlinepatterns import SimpleTagPattern
from markdown.extensions import Extension
reg_pattern =r'(~{2})([^\?]+?)(~{2})'
class Strikethrough(Extension):
def extendMarkdown(self, md, md_globals):
"""Modifies inline patterns."""
mark_tag = SimpleTagPattern(reg_pattern, 'del')
... | {
"repo_name": "jamiemcg/Remarkable",
"path": "markdown/extensions/Strikethrough.py",
"copies": "1",
"size": "1670",
"license": "mit",
"hash": -7403876527183053000,
"line_mean": 42.9473684211,
"line_max": 79,
"alpha_frac": 0.7377245509,
"autogenerated": false,
"ratio": 4.143920595533499,
"config... |
from lflib.lightfield import LightField
from lflib.imageio import save_image
import numpy as np
import time
from scipy.sparse.linalg.interface import LinearOperator
from scipy.sparse.dia import dia_matrix
from pylflib import compute_long_object_compensation
# -------- Variance stabilizing transforms ----------- ... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/iterative_deconvolution.py",
"copies": "1",
"size": "48145",
"license": "bsd-2-clause",
"hash": -1259111131154160400,
"line_mean": 38.9875415282,
"line_max": 173,
"alpha_frac": 0.5684702461,
"autogenerated": false,
"ratio": 3... |
import numpy as np
import os
try:
import cv2
except ImportError:
import cv as cv2
def load_image(filename, dtype = None, normalize = False):
"""
Load the image supplied by the user using OpenCV, and then
immediately convert it to a numpy array. The user may request
that it be cast into a spec... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/imageio.py",
"copies": "1",
"size": "4516",
"license": "bsd-2-clause",
"hash": -7677223633115829000,
"line_mean": 34.5590551181,
"line_max": 139,
"alpha_frac": 0.5936669619,
"autogenerated": false,
"ratio": 3.8763948497854077... |
import numpy as np
#---------------------------------------------------------------------------------------
# UTILITY METHODS
#---------------------------------------------------------------------------------------
def subaperture2lenslet(lf_subaperture, nu, nv, ns, nt):
"""
... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/lightfield.py",
"copies": "1",
"size": "4410",
"license": "bsd-2-clause",
"hash": -3453127813640720400,
"line_mean": 37.0172413793,
"line_max": 88,
"alpha_frac": 0.5519274376,
"autogenerated": false,
"ratio": 3.56219709208400... |
import os, sys
import array
import numpy as np
from lflib.imageio import load_image, save_image
from lflib.lightfield import LightField
#----------------------------------------------------------------------------------
# RAYSPREAD SUPPORT ROUTINES
#-----------------------------------------... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/optics.py",
"copies": "1",
"size": "41502",
"license": "bsd-2-clause",
"hash": 9170839990156027000,
"line_mean": 44.9601328904,
"line_max": 296,
"alpha_frac": 0.5529853983,
"autogenerated": false,
"ratio": 3.7473589164785555,... |
import sys
import numpy as np
from lflib.lightfield import LightField
from lflib.imageio import save_image
from scipy.ndimage import filters
try:
import pyopencl as cl
import pyopencl.array as cl_array
import pyopencl.characterize as cl_characterize
LFLIB_HAVE_OPENCL = True
except ImportError:
LFL... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/volume.py",
"copies": "1",
"size": "59029",
"license": "bsd-2-clause",
"hash": -2746328218904807400,
"line_mean": 41.4669064748,
"line_max": 167,
"alpha_frac": 0.5237425672,
"autogenerated": false,
"ratio": 3.6824079850280724... |
# Major libraries
import h5py, time
import numpy as np
import pylab as pl
# Classes and functions
import rpy2.robjects as ro
from rpy2.robjects.packages import importr
import rpy2.robjects.numpy2ri as np2ri; np2ri.activate()
from multiprocessing import Pool
import scipy.linalg as la
# Local functions
from group_lass... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/admm_deconvolution.py",
"copies": "1",
"size": "20259",
"license": "bsd-2-clause",
"hash": -8104600489506638000,
"line_mean": 36.8672897196,
"line_max": 113,
"alpha_frac": 0.4902018856,
"autogenerated": false,
"ratio": 4.2136... |
'''
This small collection of projective geometry routines are useful for
computeng the intersection of arbitrary planes in 3-space. These are
useful for computing rayspreads, among other things.
'''
import numpy as np
from numpy.linalg import *
# ---------------------------------------------------------------------... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/projective_geometry.py",
"copies": "1",
"size": "1896",
"license": "bsd-2-clause",
"hash": -7475745082753082000,
"line_mean": 33.4727272727,
"line_max": 91,
"alpha_frac": 0.5284810127,
"autogenerated": false,
"ratio": 2.28985... |
import numpy as np
import time
import scipy.signal as sig
from scipy.ndimage.filters import median_filter
# R imports
from rpy2.robjects.packages import importr
waveslim = importr("waveslim")
wavethresh = importr("wavethresh")
import rpy2.robjects as ro
# --------- Define R functions --------
ro.r( """
"data... | {
"repo_name": "sophie63/FlyLFM",
"path": "stanford_lfanalyze_v0.4/lflib/multiscale3d.py",
"copies": "1",
"size": "18491",
"license": "bsd-2-clause",
"hash": -5704521541144249000,
"line_mean": 31.7274336283,
"line_max": 127,
"alpha_frac": 0.5810394246,
"autogenerated": false,
"ratio": 3.1145359609... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.