repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xia2/xia2 | src/xia2/Handlers/Syminfo.py | 1 | 1881 | # A collection of functions relating to spacegroup symmetry information
from __future__ import annotations
import re
from cctbx import sgtbx
from cctbx.sgtbx.bravais_types import bravais_lattice
_int_re = re.compile("^[0-9]*$")
def get_pointgroup(name):
"""Get the pointgroup for this spacegroup, e.g. P422 fo... | bsd-3-clause | 561b59c7f09c9670c39c3e445c6ac1bf | 23.115385 | 82 | 0.620415 | 3.496283 | false | false | false | false |
xia2/xia2 | src/xia2/Wrappers/XDS/XDSIdxref.py | 1 | 19322 | from __future__ import annotations
import logging
import math
import os
import shutil
from xia2.Driver.DriverFactory import DriverFactory
from xia2.Experts.LatticeExpert import SortLattices, s2l
# helpful expertise from elsewhere
from xia2.Experts.SymmetryExpert import lattice_to_spacegroup_number
from xia2.Handlers... | bsd-3-clause | 485c7d9e4cfb17441d087d3a684a24bc | 34.323583 | 88 | 0.522565 | 4.012043 | false | false | false | false |
personalrobotics/prpy | tests/planning/methods/PlanToEndEffectorOffset.py | 2 | 5752 | import numpy
from prpy.clone import CloneException
from prpy.planning.base import PlanningError
from prpy.planning.exceptions import (
CollisionPlanningError,
SelfCollisionPlanningError,
ConstraintViolationPlanningError,
JointLimitError)
class PlanToEndEffectorOffsetTest(object):
# This configurat... | bsd-3-clause | 56e2e70467c11ccb71aa27d69ac5d6b9 | 37.346667 | 84 | 0.660814 | 3.715762 | false | true | false | false |
personalrobotics/prpy | src/prpy/perception/vncc.py | 2 | 5398 | import rospy
import vncc_msgs.srv
import vncc_msgs.msg
import math
import tf
import tf.transformations as transformations
import numpy
import os.path
from base import PerceptionModule, PerceptionMethod
class VnccModule(PerceptionModule):
def __init__(self, kinbody_path, detection_frame, world_frame,
... | bsd-3-clause | 85c553513dff02a8fd5c4798203cc121 | 35.472973 | 87 | 0.597073 | 4.095599 | false | false | false | false |
personalrobotics/prpy | src/prpy/base/manipulator.py | 2 | 8396 | #!/usr/bin/env python
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
# Authors: Michael Koval <mkoval@cs.cmu.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of sourc... | bsd-3-clause | 2b03059220942c985b33947129067165 | 43.898396 | 89 | 0.672582 | 4.29024 | false | false | false | false |
personalrobotics/prpy | src/prpy/planning/cbirrt.py | 1 | 15686 | #!/usr/bin/env python
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
# Authors: Michael Koval <mkoval@cs.cmu.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source... | bsd-3-clause | f93a63eb83cbd11ef311feb120be1b67 | 38.215 | 92 | 0.614752 | 4.076403 | false | true | false | false |
personalrobotics/prpy | src/prpy/planning/mk.py | 2 | 10953 | #!/usr/bin/env python
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
# Authors: Michael Koval <mkoval@cs.cmu.edu>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of sourc... | bsd-3-clause | a1de6150c410e404c84ef8401832900f | 48.116592 | 133 | 0.634621 | 4.29361 | false | false | false | false |
cornell-brg/pydgin | riscv/bootstrap.py | 2 | 6842 | #=======================================================================
# bootstrap.py
#=======================================================================
from machine import State
from isa import reg_map
from pydgin.utils import r_uint
page_size = 8192
memory_size = 0xc0000000 + 1
stack_base = memory_size-1... | bsd-3-clause | 2bd99f758724ddb5b918525ccc8f7317 | 32.704433 | 75 | 0.500438 | 3.622022 | false | false | false | false |
cornell-brg/pydgin | riscv/isa_RV32M.py | 2 | 3393 | #=======================================================================
# isa_RV32M.py
#=======================================================================
'RISC-V instructions for integer multiplication and division.'
from utils import sext_xlen, sext_32, sext, signed, trim, multhi64
from pydgin.utils imp... | bsd-3-clause | 90a452dadaf929b96569dafda3d6f297 | 27.512605 | 97 | 0.492779 | 2.834586 | false | false | false | false |
cornell-brg/pydgin | pydgin/utils.py | 2 | 4249 | #=======================================================================
# utils.py
#=======================================================================
# General-purpose bitwise operation utilities.
try:
from rpython.rlib.rarithmetic import r_uint, intmask, r_ulonglong
from rpython.rlib.objectmodel import spe... | bsd-3-clause | 08991ee3b63dbe16e93ec30390c1809d | 35.62931 | 79 | 0.419393 | 4.900807 | false | false | false | false |
cornell-brg/pydgin | scripts/parc_inject_bootstrap.py | 3 | 1892 | #=======================================================================
# parc_inject_bootstrap.py
#=======================================================================
# Script to take a pisa ELF binary and insert bootstrap code needed by
# our research processor.
#
# Usage:
#
# python insert_bootstrap <elf_file... | bsd-3-clause | 863598cefdb3ca31fd55fb3c59ceac8f | 27.666667 | 74 | 0.64852 | 3.212224 | false | false | false | false |
cornell-brg/pydgin | riscv/syscalls.py | 2 | 4814 | #=========================================================================
# syscalls.py
#=========================================================================
from pydgin.utils import intmask
import pydgin.syscalls as cmn_sysc
SYS_exit = 93
SYS_exit_group = 94
SYS_getpid = 172
SYS_kill = 129
SYS_read = 63
SYS_wr... | bsd-3-clause | a6f1f472bc885b7da705d86d80fddbaa | 29.468354 | 75 | 0.569173 | 2.696919 | false | false | false | false |
lawsie/guizero | examples/paint.py | 1 | 2540 | from guizero import App, Text, Box, Drawing, Slider, PushButton, Combo
def start_paint(event):
painting.last_event = event
def stop_paint():
painting.last_event = None
painting.last_shape = None
def draw_paint(event):
if tool.value == "line":
painting.line(
painting.last_event.x, ... | bsd-3-clause | 990f7bf33e84b28597c51cc03aa8e19d | 32.434211 | 126 | 0.632677 | 3.131936 | false | false | false | false |
lawsie/guizero | tests/test_box.py | 1 | 2906 | from guizero import App, Box, Text
from common_test import (
schedule_after_test,
schedule_repeat_test,
destroy_test,
display_test,
color_test,
size_pixel_test,
size_fill_test,
events_test,
cascading_enable_test,
cascading_properties_test,
inheriting_properties_test,
add_... | bsd-3-clause | 2d6d0bfd417c09a8697d618c530ad173 | 18.245033 | 75 | 0.561253 | 2.932392 | false | true | false | false |
lawsie/guizero | guizero/Text.py | 1 | 1784 | from tkinter import Label, StringVar
from . import utilities as utils
from .base import TextWidget
class Text(TextWidget):
def __init__(
self,
master,
text="",
size=None,
color=None,
bg=None,
font=None,
grid=None,
align=None,
visible=... | bsd-3-clause | 520666d2f4038edf5836e851e2b761c0 | 21.3 | 82 | 0.51009 | 4.158508 | false | false | false | false |
menpo/menpo | menpo/transform/piecewiseaffine/base.py | 2 | 14227 | import numpy as np
from copy import deepcopy
from menpo.base import Copyable
from menpo.transform.base import Alignment, Invertible, Transform
# TODO View is broken for PWA (TriangleContainmentError)
class TriangleContainmentError(Exception):
r"""
Exception that is thrown when an attempt is made to map a poi... | bsd-3-clause | 84f2e1e3d7ade408417f700bb3434685 | 34.128395 | 87 | 0.601181 | 3.961849 | false | false | false | false |
ros-naoqi/naoqi_bridge | naoqi_pose/src/xapparser/xapparser.py | 5 | 3174 | # # -*- coding: utf-8 -*-
# Copyright 2013 Séverin Lemaignan
# http://www.ros.org/wiki/nao
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# # Redistributions of source code must retain the above copyright
# ... | bsd-3-clause | df52f4bb3fecf4e465c71cc1166d50dc | 34.255556 | 109 | 0.690514 | 3.846061 | false | false | false | false |
diefenbach/django-lfs | docs/conf.py | 5 | 6481 | # -*- coding: utf-8 -*-
#
# django-lfs documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 17 06:50:23 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | bsd-3-clause | ce31a5766db4d2aede9b09f4756d26b0 | 31.567839 | 80 | 0.711927 | 3.692877 | false | true | false | false |
diefenbach/django-lfs | lfs/catalog/utils.py | 1 | 24319 | import locale
import logging
from django.db import connection
from django.core.exceptions import FieldError
from django.db.models import Q, Count, Min, Max
import lfs.catalog.models
from lfs.catalog.settings import CONFIGURABLE_PRODUCT
from lfs.catalog.settings import PRODUCT_WITH_VARIANTS
from lfs.catalog.settings i... | bsd-3-clause | 1c8bcb81f11a8f6ab98b6a9078ab3d17 | 38.543089 | 134 | 0.565977 | 4.289822 | false | false | false | false |
diefenbach/django-lfs | lfs/addresses/utils.py | 1 | 5288 | # django imports
from django.template.loader import select_template
# lfs imports
import lfs.core.utils
from lfs.addresses.settings import INVOICE_ADDRESS_FORM, SHIPPING_ADDRESS_FORM, CHECKOUT_NOT_REQUIRED_ADDRESS
from lfs.core.models import Country
# django-postal imports
from postal.library import form_factory
cl... | bsd-3-clause | 3104091dcda017ac5d46194bbe631a95 | 35.219178 | 120 | 0.60174 | 3.958084 | false | false | false | false |
diefenbach/django-lfs | lfs/manage/tests.py | 1 | 12523 | import json
from django.contrib.auth.models import User
from django.urls import reverse
from django.test import TestCase
from django.test import override_settings
from lfs.catalog.models import Category, Product, Property, ProductsPropertiesRelation, PropertyOption, ProductPropertyValue
from lfs.catalog.settings impo... | bsd-3-clause | fb9aa6ea4e54576898cb1f4468aba9f2 | 49.293173 | 124 | 0.621736 | 3.861548 | false | true | false | false |
diefenbach/django-lfs | lfs/manage/views/export.py | 1 | 10908 | import json
from django.contrib.auth.decorators import permission_required
from django.urls import reverse
from django.forms import ModelForm
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from django.... | bsd-3-clause | f540b50521268367db2c4af1916691e7 | 28.722071 | 141 | 0.636047 | 4.089989 | false | false | false | false |
mgaitan/waliki | waliki/management/commands/sync_waliki.py | 2 | 3015 | import os
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.files import File
from waliki.settings import WALIKI_DATA_DIR, WALIKI_UPLOAD_TO
from waliki.models import Page
if 'waliki.attachments' in settings.INSTALLED_APPS:
from wal... | bsd-3-clause | 9f70c311f713ed6fa0c9402292586432 | 40.875 | 123 | 0.570481 | 4.270538 | false | false | false | false |
mgaitan/waliki | tests/factories.py | 8 | 3217 | import factory
from django.contrib.auth.models import User, Group, Permission
from waliki.models import ACLRule, Page, Redirect
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: u'user{0}'.format(n))
password = factory.PostGenerationMethodCall('set_password', 'pass')
... | bsd-3-clause | 31ceb521e6e9834a3849305e644d607c | 27.981982 | 98 | 0.60429 | 4.238472 | false | false | false | false |
mgaitan/waliki | waliki/git/urls.py | 3 | 1714 | import django
try:
from django.conf.urls import patterns, url # django 1.8, 1.9
except ImportError:
from django.conf.urls import url
from waliki.settings import WALIKI_SLUG_PATTERN
from waliki.git.views import whatchanged, WhatchangedFeed, webhook_pull, history, version, diff
_pattern_list = [
url(r'^_w... | bsd-3-clause | b8b95ca6a6a6848e174b1060cf0b0f17 | 40.804878 | 117 | 0.573512 | 2.716323 | false | false | true | false |
rdevon/cortex | cortex/_lib/handlers.py | 1 | 9528 | '''Handlers.
'''
from collections.abc import MutableMapping
import logging
import torch
logger = logging.getLogger('cortex.handlers')
class Handler(MutableMapping):
_type = None
_get_error_string = 'Attribute `{}` not found. Available: {}'
def __init__(self, allow_overwrite=True, **kwargs):
s... | bsd-3-clause | b91ad93a211a304923035cf0a8928566 | 29.735484 | 79 | 0.529072 | 4.122891 | false | false | false | false |
rdevon/cortex | cortex/_lib/data/noise.py | 1 | 2263 | '''Module for handling noise.
'''
import torch
import torch.distributions as tdist
_dist_dict = dict(
bernoulli=tdist.bernoulli.Bernoulli,
beta=tdist.beta.Beta,
binomial=tdist.binomial.Binomial,
categorical=tdist.categorical.Categorical,
cauchy=tdist.cauchy.Cauchy,
chi2=tdist.chi2.Chi2,
... | bsd-3-clause | 487fd527203314dbf74a753f424b4809 | 30.873239 | 77 | 0.650906 | 3.460245 | false | false | false | false |
rdevon/cortex | cortex/built_ins/networks/utils.py | 1 | 2817 | '''Utils for networks
'''
import logging
from torch import nn
logger = logging.getLogger('cortex.arch.modules' + __name__)
def get_nonlinearity(nonlinearity=None):
if not nonlinearity:
pass
elif callable(nonlinearity):
if nonlinearity == nn.LeakyReLU:
nonlinearity = nonlinearit... | bsd-3-clause | 349f6fa34547adabb8f190adbfbc28c2 | 31.37931 | 78 | 0.611999 | 3.9125 | false | false | false | false |
rdevon/cortex | tests/built_ins/networks/test_fully_connected.py | 1 | 1421 | from cortex.built_ins.networks.fully_connected import FullyConnectedNet
from torch import nn
def test_fully_connected_build():
"""
Asserts: True if a the FullyConnectedNet has correct layers and
attributes.
"""
dim_in = 4096
dim_out = 10
dim_h = 64
dim_ex = None
nonlinea... | bsd-3-clause | 4405f70d8acfe8fba32ec9425e028262 | 35.435897 | 78 | 0.611541 | 3.465854 | false | false | false | false |
rdevon/cortex | cortex/_lib/data/data_handler.py | 1 | 6973 | """Data module"""
import signal
import torch
from progressbar import Bar, ProgressBar, Percentage, Timer, ETA
from .noise import get_noise_var
from .. import exp
__author__ = 'R Devon Hjelm'
__author_email__ = 'erroneus@gmail.com'
class DataHandler:
def __init__(self):
self.dims = {}
self.inpu... | bsd-3-clause | aa7771279177ada805748dc0b0d4ed33 | 30.840183 | 79 | 0.499211 | 4.028307 | false | false | false | false |
sncosmo/sncosmo | docs/_helpers/magsystem_page.py | 2 | 1231 | """Generate a restructured text document that describes built-in magsystems
and save it to this module's docstring for the purpose of including in
sphinx documentation via the automodule directive."""
import string
from sncosmo.magsystems import _MAGSYSTEMS
lines = ['',
' '.join([10*'=', 60*'=', 35*'=', 1... | bsd-3-clause | 8beb9b316fde09135960c92a133b8abb | 29.02439 | 76 | 0.571893 | 3.256614 | false | false | false | false |
sncosmo/sncosmo | benchmarks/models.py | 3 | 1357 | #!/usr/bin/env python
"""Run benchmarks for model synthetic photometry"""
import time
import os
import glob
import argparse
from collections import OrderedDict
import numpy as np
import sncosmo
delim = 61 * "-"
# test data
ndata = 100 # make divisible by 4!
dates = np.linspace(-15., 40., ndata)
bands = np.array((nda... | bsd-3-clause | 160ece7c6bbcf185ad9882ff5c2183b4 | 27.87234 | 64 | 0.591746 | 3.035794 | false | false | false | false |
sncosmo/sncosmo | sncosmo/_registry.py | 3 | 8259 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import OrderedDict
class Registry(object):
"""Connect strings to instances and loaders."""
def __init__(self):
self._loaders = OrderedDict()
self._instances = OrderedDict()
self._primary_loaders = [] # ... | bsd-3-clause | c29e4c9c7fca68b769e1dc50f48b4a00 | 36.035874 | 79 | 0.54934 | 4.762976 | false | false | false | false |
kvesteri/sqlalchemy-continuum | tests/test_savepoints.py | 5 | 1540 | import pytest
from tests import TestCase
class TestSavepoints(TestCase):
def test_flush_and_nested_rollback(self):
article = self.Article(name=u'Some article')
self.session.add(article)
self.session.flush()
self.session.begin_nested()
self.session.add(self.Article(name=u'S... | bsd-3-clause | c65d8fb6febb4917c9fccd4b6698d8b9 | 33.222222 | 62 | 0.624026 | 3.989637 | false | true | false | false |
kvesteri/sqlalchemy-continuum | tests/test_mapper_args.py | 1 | 2531 | from pytest import mark
from packaging import version
import sqlalchemy as sa
from sqlalchemy_continuum import version_class
from tests import TestCase
class TestColumnPrefix(TestCase):
def create_models(self):
class TextItem(self.Model):
__tablename__ = 'text_item'
__versioned__ ... | bsd-3-clause | 094063374f09a7760aa458822ed64a10 | 28.776471 | 76 | 0.576452 | 3.930124 | false | true | false | false |
django-oscar/django-oscar-paypal | tests/unit/gateway_tests.py | 4 | 1343 | from unittest import mock
from django.test import TestCase
from paypal.gateway import post
# Fixtures
ERROR_RESPONSE = 'RESULT=126&PNREF=V25A2BB645A7&RESPMSG=Under review by Fraud Service&AUTHCODE=525PNI&PREFPSMSG=Review: More than one rule was triggered for Review&POSTFPSMSG=Review' # noqa E501
class TestErrorRe... | bsd-3-clause | 9aabe6749292e0b39281a1a1726d5100 | 32.575 | 195 | 0.609829 | 3.837143 | false | true | false | false |
django-oscar/django-oscar-paypal | paypal/base.py | 4 | 1482 | from urllib.parse import parse_qsl
from django.db import models
from django.utils.translation import gettext_lazy as _
class ResponseModel(models.Model):
# Debug information
raw_request = models.TextField(max_length=512)
raw_response = models.TextField(max_length=512)
response_time = models.FloatFi... | bsd-3-clause | a44ff785ee14edd61883b1c031c0f2a7 | 27.5 | 85 | 0.588394 | 3.632353 | false | false | false | false |
arista-eosplus/pyeapi | test/unit/test_api_staticroute.py | 2 | 11572 | #
# Copyright (c) 2014, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... | bsd-3-clause | 35c5f2b24e82c25ef760a487c1139f93 | 37.065789 | 74 | 0.517456 | 3.839416 | false | true | false | false |
arista-eosplus/pyeapi | pyeapi/api/mlag.py | 1 | 10972 | #
# Copyright (c) 2015, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... | bsd-3-clause | 8a3c325746e97e8ecd513b052caf9282 | 35.331126 | 79 | 0.641633 | 4.629536 | false | true | false | false |
googleapis/python-spanner-django | tests/system/django_spanner/test_check_constraint.py | 1 | 2024 | # Copyright 2021 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
from .models import Event
from django.test import TransactionTestCase
import datetime
import unittest
from django.utils impor... | bsd-3-clause | 8dd2209d5eb44ce5ce10a7ef5115b433 | 30.625 | 71 | 0.663043 | 4.088889 | false | true | false | false |
googleapis/python-spanner-django | django_spanner/_opentelemetry_tracing.py | 1 | 1635 | # Copyright 2021 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Manages OpenTelemetry trace creation and handling"""
from contextlib import contextmanager
from google.api_core.exceptio... | bsd-3-clause | b41232061bd31b43deccf875add4725c | 29.849057 | 80 | 0.681957 | 4.10804 | false | false | false | false |
agiliq/merchant | billing/utils/paylane.py | 7 | 8267 | # -*- coding: utf-8 -*-
# vim:tabstop=4:expandtab:sw=4:softtabstop=4
"""
Example usage:
from billing.utils.credit_card import Visa
product = PaylanePaymentProduct(description='Some description')
customer_address = PaylanePaymentCustomerAddress(street_house='',city='',state='',zip_code='',country_code='PT')
customer =... | bsd-3-clause | 72614ba80c9c32df66aaf9703dadce1a | 35.579646 | 112 | 0.629733 | 3.420356 | false | false | false | false |
agiliq/merchant | billing/forms/braintree_payments_forms.py | 7 | 3975 | from django import forms
from django.conf import settings
class BraintreePaymentsForm(forms.Form):
transaction__customer__first_name = forms.CharField(max_length=50, required=False)
transaction__customer__last_name = forms.CharField(max_length=50, required=False)
transaction__customer__company = forms.Cha... | bsd-3-clause | aeac1799413c7c10812917ab51922f44 | 69.982143 | 102 | 0.76327 | 3.889432 | false | false | false | false |
agiliq/merchant | billing/gateways/braintree_payments_gateway.py | 3 | 16376 | from billing import Gateway, GatewayNotConfigured
from billing.gateway import InvalidData
from billing.signals import *
from billing.utils.credit_card import InvalidCard, Visa, MasterCard, \
AmericanExpress, Discover, CreditCard
from django.conf import settings
import braintree
class BraintreePaymentsGateway(Gate... | bsd-3-clause | 995bc73c11e5f6f9b8e5a03b235ae344 | 43.379404 | 105 | 0.503236 | 4.792508 | false | false | false | false |
agiliq/merchant | billing/models/world_pay_models.py | 7 | 1927 | from django.db import models
class WorldPayResponse(models.Model):
# merchant details
installation_id = models.CharField(max_length=64)
company_name = models.CharField(max_length=255, blank=True, null=True)
# purchase details sent by merchant
cart_id = models.CharField(max_length=255)
descrip... | bsd-3-clause | d31de3818251ced8702bd7068660ad1c | 39.145833 | 74 | 0.714582 | 3.595149 | false | false | false | false |
agiliq/merchant | billing/gateways/bitcoin_gateway.py | 6 | 2594 | import bitcoinrpc
from decimal import Decimal
from billing import Gateway, GatewayNotConfigured
from billing.signals import transaction_was_unsuccessful, \
transaction_was_successful
from billing.utils.credit_card import CreditCard
from django.conf import settings
from django.utils import simplejson as json
cla... | bsd-3-clause | 535e61bd106b9a56da4b6703a333df9e | 38.30303 | 75 | 0.606399 | 4.359664 | false | false | false | false |
agiliq/merchant | billing/tests/test_braintree_payments.py | 3 | 8537 | import braintree
from django.conf import settings
from django.test import TestCase
from django.utils.unittest import skipIf
from billing import get_gateway, CreditCard
from billing.signals import *
from billing.gateway import CardNotSupported, InvalidData
from billing.utils.credit_card import Visa
@skipIf(not setti... | bsd-3-clause | 49cd4ae6b90900f67cb379e4f6a628ce | 39.268868 | 97 | 0.595994 | 4.174572 | false | true | false | false |
agiliq/merchant | billing/gateways/paylane_gateway.py | 6 | 12907 | # -*- coding: utf-8 -*-
# vim:tabstop=4:expandtab:sw=4:softtabstop=4
import datetime
from suds.client import Client
from suds.cache import ObjectCache
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from billing import Gateway, GatewayNotConfigured
from billing.models import ... | bsd-3-clause | 6ca1e6f4f27ebf5348dc6340c9c3bced | 45.595668 | 136 | 0.606957 | 4.631145 | false | false | false | false |
agiliq/merchant | billing/integrations/braintree_payments_integration.py | 3 | 5258 | from billing import Integration, IntegrationNotConfigured
from django.conf import settings
from django.views.decorators.http import require_GET
from billing.signals import transaction_was_successful, transaction_was_unsuccessful
from django.conf.urls import patterns, url
import braintree
import urllib
from django.core.... | bsd-3-clause | 758ee3653411a9826000259958b0dae9 | 46.8 | 119 | 0.615253 | 4.345455 | false | false | false | false |
agiliq/merchant | billing/integrations/global_iris_real_mpi_integration.py | 4 | 8897 | import base64
import decimal
import json
import logging
from django.conf import settings
from django.core.signing import TimestampSigner
from django.shortcuts import render_to_response
from django.template.loader import render_to_string
import lxml
import requests
from billing import Integration, get_gateway, Integra... | bsd-3-clause | 3335d599d5c0273d13345c809928ba50 | 37.184549 | 123 | 0.614364 | 3.876688 | false | false | false | false |
opencivicdata/python-opencivicdata | opencivicdata/elections/models/election.py | 2 | 2705 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Election-related models.
"""
from django.db import models
from opencivicdata.core.models.base import OCDBase, IdentifierBase, LinkBase, OCDIDField
from opencivicdata.core.models import Division, Organization
class Election(OCDBase):
"""
A collection of politic... | bsd-3-clause | 31ff9264767782fe5f25d267f4e612a9 | 28.402174 | 92 | 0.640665 | 3.960469 | false | false | false | false |
opencivicdata/python-opencivicdata | opencivicdata/elections/models/contests/ballot_measure.py | 2 | 6084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
BallotMeasureContest-related models.
"""
from django.db import models
from opencivicdata.core.models.base import IdentifierBase, LinkBase
from opencivicdata.core.models import Membership
from .base import ContestBase
class BallotMeasureContest(ContestBase):
"""
... | bsd-3-clause | bcffc1b83ff5b47beed8f6b17ff37a7d | 28.391304 | 89 | 0.657627 | 3.979071 | false | true | false | false |
opencivicdata/python-opencivicdata | opencivicdata/core/models/jurisdiction.py | 2 | 1677 | from django.db import models
from django.contrib.postgres.fields import ArrayField
from ...common import JURISDICTION_CLASSIFICATION_CHOICES
from .base import OCDBase, OCDIDField
from .division import Division
class Jurisdiction(OCDBase):
"""
A Jurisdiction represents a logical unit of governance.
Examp... | bsd-3-clause | 8ab6d64fc4067da304eb4c8a7f552939 | 31.25 | 87 | 0.673226 | 3.811364 | false | false | false | false |
opencivicdata/python-opencivicdata | opencivicdata/legislative/models/vote.py | 2 | 3396 | from django.db import models
from django.contrib.postgres.fields import ArrayField, JSONField
from opencivicdata.core.models.base import OCDBase, LinkBase, OCDIDField, RelatedBase
from opencivicdata.core.models import Organization, Person
from .session import LegislativeSession
from .bill import Bill, BillAction
from ... | bsd-3-clause | e36469abf28067b88f9ddd717f7a8506 | 30.155963 | 87 | 0.648999 | 3.683297 | false | false | false | false |
uwescience/raco | raco/python/tests/udf_test.py | 1 | 2830 | # coding=utf-8
""" Tests for expressions with UDFs """
from collections import Counter
from python_test import PythonTestCase
from raco.algebra import Apply
from raco.backends.myria.connection import FunctionTypes
from raco.python import convert
from raco.python.exceptions import PythonArgumentException
from raco.type... | bsd-3-clause | 07f076cdcf15d2bffaffeba49775cfe9 | 37.243243 | 75 | 0.5 | 3.586819 | false | true | false | false |
uwescience/raco | examples/sp2bench/sp2bench_rdf.py | 1 | 5756 | import test_query
from raco.language import CCAlgebra, GrappaAlgebra
tr = "sp2bench_1m"
queries = {}
queriesI = {} # manually RDF prefix expanded to internal integer
queries['Q1'] = """A(yr) :- %(tr)s(journal, 'rdf:type', 'bench:Journal'),
%(tr)s(journal, 'dc:title', 'Journal 1 (1940)'),
... | bsd-3-clause | 809461dc88208fc614581865877fed41 | 43.276923 | 133 | 0.511814 | 3.153973 | false | false | false | false |
uwescience/raco | raco/backends/sql/catalog.py | 1 | 10121 | """
A RACO language to compile expressions to SQL.
"""
from sqlalchemy import (Column, Table, MetaData, Integer, String,
Float, Boolean, LargeBinary, DateTime, select, func,
literal, case)
import raco.algebra as algebra
from raco.catalog import Catalog
import raco.expre... | bsd-3-clause | 042757227e8eaa274dfda6609e5f9175 | 38.07722 | 78 | 0.614366 | 4.124287 | false | false | false | false |
uwescience/raco | raco/tests.py | 1 | 4728 | import unittest
from raco import RACompiler
import raco.expression as e
import raco.expression.boolean
from raco.expression.visitor import ExpressionVisitor
class ExpressionTest(unittest.TestCase):
def test_postorder(self):
expr1 = e.MINUS(e.MAX(e.NamedAttributeRef("salary")),
e.MI... | bsd-3-clause | c079af4bd0c84fd35370e153e6f24bdd | 29.503226 | 117 | 0.53236 | 4.079379 | false | false | false | false |
uwescience/raco | raco/python/tests/syntax_test.py | 1 | 2929 | # coding=utf-8
""" Tests for expressions with invalid syntax """
from raco.python import convert
from raco.python.exceptions import PythonConvertException, \
PythonSyntaxException, PythonArgumentException, \
PythonUnsupportedOperationException
from python_test import PythonTestCase
class TestSyntax(PythonTes... | bsd-3-clause | 546cf4e4e2537f335660096a6bd2494e | 38.053333 | 64 | 0.584158 | 4.275912 | false | true | false | false |
uwescience/raco | raco/types.py | 1 | 1488 |
"""Names of primitive types understand by raco.
Note that raco internally supports a limited set of types. Different backends
can support a richer set of types, but these aren't understood by raco's
type system. For example, raco doesn't distinguish between int and long,
so unsafe casts are not detected inside raco... | bsd-3-clause | 83ccc8906730092944019533766817b8 | 28.176471 | 102 | 0.71707 | 3.220779 | false | false | false | false |
uwescience/raco | raco/myrial/myrial_test.py | 1 | 4110 | import json
import unittest
from raco.backends.myria import compile_to_json, MyriaStore, MyriaSink
import raco.fakedb
import raco.myrial.interpreter as interpreter
import raco.myrial.parser as parser
import raco.viz
from raco.replace_with_repr import replace_with_repr
from raco import relation_key
class MyrialTestCa... | bsd-3-clause | 565d74d721be12e5189bd8cfcd9d81b7 | 35.052632 | 76 | 0.609246 | 3.967181 | false | true | false | false |
uwescience/raco | raco/rules.py | 1 | 38249 | import re
from raco import algebra, expression
from raco.representation import RepresentationProperties
from .expression import (accessed_columns, UnnamedAttributeRef,
rebase_local_aggregate_output, rebase_finalizer,
to_unnamed_recursive, StateVar, RANDOM)
from abc im... | bsd-3-clause | eca787a5881594c03eb39343535fa6a8 | 34.481447 | 80 | 0.567335 | 4.316069 | false | false | false | false |
uwescience/raco | raco/compile.py | 1 | 2618 | from raco import algebra
import raco.backends as language
from .pipelines import Pipelined
from raco.utility import emit
import raco.viz as viz
import os
from raco.utility import colored
import logging
LOG = logging.getLogger(__name__)
"""
Apply rules to an expression
If successful, output will
only involve operator... | bsd-3-clause | e73dd363b195e32eb207c5fe30fbbd95 | 26.270833 | 77 | 0.585561 | 3.70297 | false | false | false | false |
uwescience/raco | c_test_environment/verifier.py | 1 | 3497 | import re
import sys
"""
Checks two query outputs for equality
"""
class ComparableFloat(object):
"""Wrapper to use == on floats safely"""
def __init__(self, d, ep=0.00001):
self._raw = d
self._ep = ep
def __eq__(self, other):
if type(other) is ComparableFloat:
return... | bsd-3-clause | daac837d4d89f530685c7e08c69bbbfd | 23.626761 | 73 | 0.47841 | 3.700529 | false | true | false | false |
uwescience/raco | raco/backends/myria/tests/test_myria_execution.py | 1 | 9947 | from httmock import urlmatch, HTTMock
import unittest
import json
from raco.backends.myria.connection import MyriaConnection
from raco.backends.myria.catalog import MyriaCatalog
from raco.relation_key import RelationKey
from raco.representation import RepresentationProperties
import raco.myrial.interpreter as interpr... | bsd-3-clause | c1c3d759b9142ace03f49b6886863d95 | 34.525 | 78 | 0.597467 | 3.888585 | false | true | false | false |
clips/pattern | examples/01-web/14-flickr.py | 1 | 1520 | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
from io import open
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import Flickr, extension
from pattern.web import RELEVANCY, LATES... | bsd-3-clause | 2618e68675d24f11fb0f782d7c287290 | 32.043478 | 79 | 0.717763 | 3.166667 | false | false | false | false |
clips/pattern | pattern/text/ru/__init__.py | 1 | 3268 | #### PATTERN | RU ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
############... | bsd-3-clause | b7fddcd0c52061d81d56ae3b60dc41d6 | 30.737864 | 100 | 0.609547 | 3.383023 | false | false | false | false |
clips/pattern | examples/03-en/05-tagset.py | 1 | 4716 | # coding: utf-8
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
# By default, parse() uses part-of-speech tags from the Penn Treebank tagset:
# http:/... | bsd-3-clause | ba541c0200cf6b97c68f7683723101d9 | 38.905983 | 105 | 0.712786 | 2.936478 | false | false | false | false |
clips/pattern | examples/01-web/12-dom.py | 1 | 5757 | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import URL, DOM, plaintext
from pattern.web import NODE, TEXT, COMMENT, ELEMENT, DOCUM... | bsd-3-clause | 362f13b82c4002d29f71efbc4830836e | 34.325153 | 122 | 0.651381 | 3.052492 | false | false | false | false |
clips/pattern | examples/03-en/03-parse.py | 1 | 2238 | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.en import parse, pprint, tag
# The en module contains a fast regular expressions-based pa... | bsd-3-clause | 714f2c09482e43ade836265dd3a172f7 | 38.263158 | 85 | 0.697051 | 3.27672 | false | false | false | false |
clips/pattern | examples/01-web/08-wiktionary.py | 1 | 2987 | from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import Wiktionary, DOM
from pattern.db import csv, pd
# This example retrieves male a... | bsd-3-clause | 777a01d0e3eb4e11852ec66a2fee1c75 | 30.114583 | 104 | 0.662538 | 3.147524 | false | false | false | false |
ctuning/ck-env | package/perl-strawberry-5.24.1.1-win/custom.py | 1 | 2943 | #!/usr/bin/python
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def setup(i):
"""
Input: {
cfg - meta of this ... | bsd-3-clause | daa1d2f4070bcac52aad6428c4a95a61 | 26.504673 | 116 | 0.491335 | 3.674157 | false | false | false | false |
ctuning/ck-env | package/dataset-imagenet-preprocessed-using-opencv/preprocess_image_dataset.py | 1 | 7392 | #!/usr/bin/env python3
supported_extensions = ['jpeg', 'jpg', 'gif', 'png']
import os
import cv2
import numpy as np
# Load and preprocess image
def load_image(image_path, # Full path to processing image
target_size, # Desired size of resulting image
intermediate_siz... | bsd-3-clause | c4f7f4004442473b4310d3f8ea23cc32 | 41.482759 | 168 | 0.585363 | 3.705263 | false | true | false | false |
ctuning/ck-env | soft/lib.freeglut/customize.py | 1 | 4526 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
######################################################################... | bsd-3-clause | 9159ac85785f129e75b8e3a38f446f16 | 24.715909 | 99 | 0.463102 | 3.530421 | false | false | false | false |
ctuning/ck-env | soft/lib.python.scipy/customize.py | 1 | 5089 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
import os
import sys
##############################################################################
def version_cmd(i):
path_with_init_py = i['full_path'] ... | bsd-3-clause | 0d946053757b687d0bf133474cba35db | 36.145985 | 151 | 0.511888 | 3.926698 | false | false | false | false |
ctuning/ck-env | module/env/module.py | 1 | 97657 | #
# Collective Knowledge (environment)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal dat... | bsd-3-clause | a656e6394063529b43142f1cd2830c9c | 33.716317 | 157 | 0.466408 | 3.841134 | false | false | false | false |
ctuning/ck-env | module/script/module.py | 2 | 7496 | #
# Collective Knowledge (script)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck... | bsd-3-clause | 81ba910d15d547bbf22b5150801c3115 | 31.877193 | 138 | 0.524947 | 3.703557 | false | false | false | false |
ctuning/ck-env | soft/lib.flatbuffers/customize.py | 1 | 2848 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Leo Gordon @ dividiti
#
import os
def setup(i):
"""
Input: {
cfg - meta of this soft entry
self_cfg ... | bsd-3-clause | 37e8a3402b4eea278373642da962126b | 32.904762 | 133 | 0.48736 | 3.988796 | false | false | false | false |
ctuning/ck-env | package/openjdk-10.44/custom.py | 1 | 2906 | #!/usr/bin/python
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def setup(i):
"""
Input: {
cfg - meta of this ... | bsd-3-clause | 99dcc644263db8d0ded25bfb89c27697 | 25.418182 | 116 | 0.495871 | 3.687817 | false | false | false | false |
ctuning/ck-env | soft/tool.antlr/customize.py | 2 | 2637 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | bsd-3-clause | d35c37e36b964abb90c7a66c405e5f35 | 26.185567 | 78 | 0.484642 | 3.617284 | false | false | false | false |
ctuning/ck-env | soft/compiler.perl/customize.py | 2 | 1577 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
extra_dirs=['C:\\Strawberry', 'D:\\Strawberry',
'C:\\Perl64', 'D:\\Pe... | bsd-3-clause | 3dedbc076713d7193970c4e4f613ff6f | 21.211268 | 78 | 0.457197 | 3.473568 | false | false | false | false |
ctuning/ck-env | soft/lib.protobuf.host/customize.py | 1 | 4269 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
##############################################################################
# ... | bsd-3-clause | 84527a879fdc7d18934a83106fe22190 | 23.534483 | 79 | 0.48044 | 3.639386 | false | false | false | false |
ctuning/ck-env | soft/utils.unix.win/customize.py | 1 | 1269 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
##############################################################################
# ... | bsd-3-clause | 13fbf748bc1f2b66f77bc5cc8472473b | 20.508475 | 78 | 0.439716 | 4.015823 | false | false | false | false |
ctuning/ck-env | soft/compiler.ctuning-cc/customize.py | 1 | 9500 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | bsd-3-clause | 56534e45aac606f552b2eecdfdfb4d1c | 32.450704 | 116 | 0.553684 | 2.945736 | false | false | false | false |
ctuning/ck-env | soft/lib.cjson/customize.py | 1 | 3323 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | bsd-3-clause | dcef5bdb0143614f0764bd6b238a230f | 27.646552 | 99 | 0.495035 | 3.538871 | false | false | false | false |
ctuning/ck-env | package/compiler-llvm-7.0.1-universal/custom.py | 1 | 5311 | #!/usr/bin/python
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def setup(i):
"""
Input: {
cfg - meta of this ... | bsd-3-clause | e98a0133fa02b9ff5ec2f500474799df | 30.802395 | 122 | 0.502918 | 3.435317 | false | false | false | false |
ctuning/ck-env | soft/plugin.milepost.ctuning/customize.py | 1 | 4278 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | bsd-3-clause | 95b0c2831b32782415d835cb68795aff | 30.455882 | 112 | 0.532258 | 3.231118 | false | false | false | false |
ctuning/ck-env | soft/bench.pencil/customize.py | 1 | 2471 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | bsd-3-clause | c4c6e624b42c34632223d07a30bd31f4 | 25.287234 | 78 | 0.477944 | 3.903633 | false | false | false | false |
ctuning/ck-env | package/compiler-llvm-5.0.0-universal/custom.py | 1 | 4638 | #!/usr/bin/python
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def setup(i):
"""
Input: {
cfg - meta of this ... | bsd-3-clause | d07d1d399ed9fc3cb22c5a68ad541f69 | 28.730769 | 122 | 0.494179 | 3.487218 | false | false | false | false |
ctuning/ck-env | soft/compiler.microsoft/customize.py | 1 | 7850 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
extra_dirs=['C:\\Program Files (x86)\\Microsoft Visual Studio\\2017',
'D:\\Progr... | bsd-3-clause | 5d9e67adfbfc528370e67aca1b37c82a | 25.166667 | 112 | 0.480255 | 3.599266 | false | false | false | false |
ctuning/ck-env | soft/compiler.pluto/customize.py | 1 | 2521 | #
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
##############################################################################
# setup envir... | bsd-3-clause | 8b7b13d7de5e983b73faa813351ae6ea | 26.703297 | 78 | 0.478778 | 3.819697 | false | false | false | false |
mozilla/remo | remo/celery.py | 3 | 3585 | from __future__ import absolute_import
import os
from celery import Celery as BaseCelery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'remo.settings')
from django.conf import settings # noqa
RUN_DAILY = 60 * 60 * 24
RUN_HOURLY = 60 * 60
class... | bsd-3-clause | cece282eb7e082e432c695161dbfd92b | 39.280899 | 97 | 0.635425 | 3.746082 | false | false | false | false |
mozilla/remo | remo/remozilla/tasks.py | 2 | 6094 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from urllib import quote
from django.conf import settings
from django.contrib.auth.models import User
from django.db import transaction
from django.utils import timezone
import requests
import waffle
from remo.base.templatetags.helpers... | bsd-3-clause | b9bc5dc25c20f0f463ca57c85df796a0 | 39.626667 | 96 | 0.556777 | 4.125931 | false | false | false | false |
mozilla/remo | remo/featuredrep/models.py | 5 | 1272 | from django.contrib.auth.models import User
from django.db import models
from django.utils.timezone import now
class FeaturedRep(models.Model):
"""Featured Rep model.
Featured Rep -or Rep of the Month- relates existing users with
some text explaining why they are so cool.
"""
created_on = models... | bsd-3-clause | dcb87e03b024c1f8428a3d925cc19649 | 35.342857 | 76 | 0.654874 | 3.925926 | false | false | false | false |
mozilla/remo | remo/events/models.py | 2 | 10835 | from pytz import timezone
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.core.validators import MaxLengthValidator, MinLengthValidator
from django.core.urlresolvers import reverse
from django.db import m... | bsd-3-clause | 36bfa3d80417bc756f54a4c847474dfc | 37.558719 | 99 | 0.659806 | 4.017427 | false | false | false | false |
mozilla/remo | remo/events/migrations/0002_auto_20160407_1156.py | 5 | 2093 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('reports', '0001_initial'),
('events', '0001_initial'),
migr... | bsd-3-clause | 5cfcb6c9b9967b91d103575ff25e1588 | 33.883333 | 161 | 0.583373 | 4.397059 | false | false | false | false |
mozilla/remo | remo/events/templatetags/helpers.py | 2 | 3536 | from django.conf import settings
from django.core.urlresolvers import reverse
from django_jinja import library
from remo.base.templatetags.helpers import urlparams
@library.global_function
def get_link_to_osm(lat, lon, zoom=15):
"""Return link to OSM centered in lat, lon."""
return ('http://openstreetmap.or... | bsd-3-clause | 13966226421c69fce7d95bb7111c5224 | 30.855856 | 76 | 0.604072 | 3.785867 | false | false | false | false |
mozilla/remo | remo/events/api/api_v1.py | 2 | 8462 | from urllib import unquote
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.utils.timezone import now
from jinja2 import escape
from tastypie import fields
from tastypie.authentication import Authentication
from tastypie.authorization import Read... | bsd-3-clause | eb4639c8f3db48d88f4355707d311bc9 | 39.295238 | 94 | 0.621957 | 4.193261 | false | false | false | false |
mozilla/remo | remo/reports/api/views.py | 3 | 5478 | from collections import namedtuple
from datetime import datetime, timedelta
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
import django_filters
from rest_framework.views import APIView
from rest_framework.response import Response
from remo.api.views import BaseReadOnlyModelView... | bsd-3-clause | 0422febe67ca602f40580671da04e547 | 35.765101 | 79 | 0.634173 | 4.276347 | false | false | false | false |
mozilla/remo | remo/profiles/migrations/0001_initial.py | 3 | 7724 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import remo.base.utils
import remo.profiles.models
import django.db.models.deletion
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
... | bsd-3-clause | 079388467175e409277968f9af8d1427 | 67.353982 | 254 | 0.599301 | 4.054593 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.