code stringlengths 1 199k |
|---|
import sys
import weechat
SCRIPT_NAME = "fullwidth"
SCRIPT_AUTHOR = "GermainZ <germanosz@gmail.com>"
SCRIPT_VERSION = "0.1"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = ("Convert text to its fullwidth equivalent and send it "
"to buffer.")
PY3 = sys.version > '3'
if PY3:
unichr = chr
def send(buf, text)... |
import numpy as np
def Bootstrap(chi0_wGG, Nw, Kc_GG, printtxt, print_bootstrap, world):
Nw_local = chi0_wGG.shape[0]
npw = chi0_wGG.shape[1]
# arxiv 1107.0199
fxc_GG = np.zeros((npw, npw), dtype=complex)
tmp_GG = np.eye(npw, npw)
dminv_wGG = np.zeros((Nw_local, npw, npw), dtype=complex)
dfl... |
from collections import namedtuple
import itertools
from ..state import AddOnState
class AddOnStopper:
class __StopErrorException(Exception):
pass
__AddonWithDep = namedtuple('AddonDependency', ['addon', 'dependencies'])
def __init__(self, manager, *addons):
self.__manager = manager
... |
import Adafruit_BMP.BMP085 as BMP085
class BMP180:
def __init__(self):
self.sensor = BMP085.BMP085()
@property
def temperature(self):
temp = self.sensor.read_temperature()
return '{0:0.2f} *C'.format(temp)
@property
def presure(self):
presure = self.sensor.read_pressu... |
from pychess.Utils.const import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN
from pychess.Utils.repr import reprSign, reprColor, reprPiece
class Piece:
def __init__ (self, color, piece):
self.color = color
self.piece = piece
self.opacity = 1.0
self.x = None
self.y = None
# Sig... |
from __future__ import print_function
import os
import codecs
import sys
import argparse
import bisect
import re
import fnmatch
import pkg_resources
from collections import OrderedDict
import enchant
from enchant.tokenize import get_tokenizer, URLFilter, WikiWordFilter, Filter
import pygments
from pygments import lexer... |
from . import controllers
from . import models
from . import partner |
(S'9364dda56f0ec0ea32d748574b517361'
p1
(ihappydoclib.parseinfo.moduleinfo
ModuleInfo
p2
(dp3
S'_namespaces'
p4
((dp5
S'Error'
p6
(ihappydoclib.parseinfo.classinfo
ClassInfo
p7
(dp8
g4
((dp9
(dp10
tp11
sS'_filename'
p12
S'../python/frowns/Depict/GraphViz.py'
p13
sS'_docstring'
p14
S''
sS'_class_member_info'
p15
(lp16
s... |
"""Unit test utilities for Google C++ Testing and Mocking Framework."""
import os
import sys
IS_WINDOWS = os.name == 'nt'
IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
IS_OS2 = os.name == 'os2'
import atexit
import shutil
import tempfile
import unittest as _test_module
try:
import subprocess
_SUBPROC... |
import sys, os, traceback, telepot, time, json, random, pprint
import tool, auth, log, mmctool, mmcdb, mmcDefauV, mmcAnali, mmcSachi
from libmsgMmc import msgMain, mainShort, msgCreo, msgOuto, msgInco, msgTran
from libmsgMmc import msgDefSet, msgList, msgEdit, msgAnali, msgSachi
from telepot.delegate import per_chat_id... |
from . import Connector
from .. import util
import sys
import re
class PyODBCConnector(Connector):
driver = 'pyodbc'
supports_sane_multi_rowcount = False
if util.py2k:
# PyODBC unicode is broken on UCS-4 builds
supports_unicode = sys.maxunicode == 65535
supports_unicode_statements = ... |
try:
from setuptools import setup, find_packages
from setuptools.command.test import test
is_setuptools = True
except ImportError:
raise
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages # noqa
from setuptools.command.test import t... |
from sqlalchemy import Column, Integer, String
from datetime import date
import base
from assetjet.cfg import db
from sqlalchemy.orm import sessionmaker
import json
class Asset(base.ModelBase, base.ajModel):
__tablename__ = 'assets'
cd = Column(String, primary_key=True)
name = Column(String)
gicssectori... |
import os, zipfile
def backupToZip(folder):
"""
создает резервную копию всего содержимого папки folder
"""
folder = os.path.abspath(folder)
number = 1
while True:
zipFilename = os.path.basename(folder) + '_' + str(number) + '.zip'
if not os.path.exists(zipFilename):
b... |
from twisted.internet import defer, task, reactor, protocol
from nevow import inevow, rend, tags, loaders, flat, athena, stan, guard
from twisted.web import http, resource, static, server
import time
from common import permissionDenied, uni
from corepost import Response, NotFoundException, AlreadyExistsException
from c... |
from __future__ import absolute_import, unicode_literals
import os
from setuptools import setup, find_packages
from version import get_version
version = get_version()
setup(
name='edem.sponsors',
version=version,
description="Provides the Sponsors Viewlet on page sidebars",
long_description=open("README... |
"""
Copyright (c) 2017 Genome Research Ltd.
Author: Christopher Harrison <ch12@sanger.ac.uk>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any la... |
from cloudinit import helpers
from cloudinit.sources import DataSourceOpenNebula as ds
from cloudinit import util
from mocker import MockerTestCase
from ..helpers import populate_dir
from base64 import b64encode
import os
import pwd
TEST_VARS = {
'VAR1': 'single',
'VAR2': 'double word',
'VAR3': 'multi\nline... |
import scipy.sparse
import numpy as np
from sklearn.utils import check_random_state
from sklearn.utils.extmath import randomized_range_finder, safe_sparse_dot
from divisi2.dense import DenseMatrix
from divisi2._svdlib import svd_ndarray
def divisi_sparse_to_scipy_sparse(matrix):
values, rows, cols = matrix.find()
... |
"""
Pyicoteo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY ... |
import os
import os.path
import shutil
from ipapython.ipa_log_manager import root_logger
import random
import six
from six.moves.configparser import SafeConfigParser
from ipaplatform.tasks import tasks
from ipaplatform.paths import paths
if six.PY3:
unicode = str
SYSRESTORE_PATH = paths.TMP
SYSRESTORE_INDEXFILE = "... |
from functools import lru_cache
import locale
import re
from subprocess import PIPE, Popen, check_call
import sys
from vcsn.tools import _tmp_file
state_style = 'node [shape = circle, style = rounded, width = 0.5]'
state_pretty = 'node [fontsize = 12, fillcolor = cadetblue1, shape = circle, style = "filled,rounded", he... |
from __future__ import division
import errno
import json
import os
import sys
import time
import traceback
from twisted.internet import defer
from twisted.python import log
from twisted.web import resource, static
import p2pool
from bitcoin import data as bitcoin_data
from . import data as p2pool_data, p2p
from util im... |
from decksite.data import query
from decksite.deck_type import DeckType
def test_decks_where_deck_type() -> None:
args = {'deckType': DeckType.LEAGUE.value}
assert "= 'League'" in query.decks_where(args, 1)
args = {'deckType': DeckType.TOURNAMENT.value}
assert "= 'Gatherling'" in query.decks_where(args,... |
import liblo, sys
try:
target = liblo.Address(1234)
except liblo.AddressError, err:
print str(err)
sys.exit()
liblo.send(target, "/jingles", 0) |
"""Test backwards compatibility for resource managers using register().
The transaction package supports several different APIs for resource
managers. The original ZODB3 API was implemented by ZODB.Connection.
The Connection passed persistent objects to a Transaction's register()
method. It's possible that third-part... |
import argparse
import sqlite3
import tempfile
import csv
import subprocess
from generate.schema import Box
def main():
parser = argparse.ArgumentParser(description="Plot a route from database")
parser.add_argument("sqlite_path")
parser.add_argument("route")
args = parser.parse_args()
with sqlite3.c... |
import logging
from cStringIO import StringIO
from plugins.plugin import Plugin
from PIL import Image
class Upsidedownternet(Plugin):
name = "Upsidedownternet"
optname = "upsidedownternet"
desc = 'Flips images 180 degrees'
has_opts = False
implements = ["handleResponse", "handleHeader"]
def init... |
default_app_config = 'wad_Campaign.apps.wad_CampaignConfig' |
import sys, cStringIO, re
from BeautifulSoup import BeautifulSoup
from WebCursor import WebCursor
from pdfminer.pdfparser import PDFParser, PDFDocument
from pdfminer.converter import TextConverter
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, \
process_pdf
from pdfminer.cmapdb import CM... |
from hypothesis import given, assume
from hypothesis.strategies import text, just, integers, tuples, sampled_from
import nose
from nose.tools import raises
from repeatedmistakes.strategies import *
"""
Test all of the strategies in the strategies module for common functionality
"""
two_characters = text(min_size=2, max... |
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.convert.azw3_output_ui import Ui_Form
from calibre.gui2.convert import Widget
font_family_model = None
class PluginWidget(Widget, Ui_Form):
... |
def trim_cloud_list(clouds):
i = 0
j = 0
while i < len(clouds):
j = i + 1
while j < len(clouds):
if clouds[i].contains_cloud(clouds[j]):
clouds.remove(clouds[j])
return trim_cloud_list(clouds)
elif clouds[j].contains_cloud(clouds[i]):
... |
import os
import unittest
import ansibleinventorygrapher.inventory
class TestVault(unittest.TestCase):
def test_vault_password_file(self):
invfile = os.path.join('test', 'vault', 'inventory')
vault_password_files = [os.path.join('test', 'vault', 'vaultpass')]
inventory_mgr = ansibleinventory... |
from .solution_level_clustering import MetaboliteLevelDiseaseClustering |
from pyramid.response import Response
from pyramid.view import view_config
from qrcode import *
@view_config(route_name='qrcode')
def qrcode(request):
uri = request.matchdict['uri']
qr = QRCode(version=3, error_correction=ERROR_CORRECT_L)
qr.add_data(request.route_url('view_paste', pasteID=uri))
qr.make... |
import base64
from cipher import Cipher
from Crypto import Cipher as CryptoCipher
from Crypto import Random
import hashlib
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[:-ord(s[len(s)-1:])]
class AES(Cipher):
# Generates a key using a hash of some passphrase
@static... |
"""
Often you can control monitors simply from the Monitor Center in the
PsychoPy application, but you can also create/control them using scripts.
This allow you to override certain values for the current run: :
mon = monitors.Monitor('testMonitor') # load the testMonitor
mon.setDistance(120) # change distanc... |
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2016, LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
import sys
def getLg(soilClass):
'''
From a length greater than de distance "lg" the soil mouvement
can bi consideread as completely uncorrelated.
'''
retval= ... |
from .pysoroban import cli |
from BeautifulSoup import BeautifulSoup
from urllib2 import urlopen, URLError, HTTPError, HTTPCookieProcessor, build_opener, install_opener
class ParserOhio:
def __init__(self):
self.baseurl = 'http://procure.ohio.gov/proc/'
self.listurl = self.baseurl + 'searchCurContracts.asp'
def parse_list(s... |
import struct, imghdr
def get_image_size( fname ):
'''Determine the image type of fhandle and return its size.
from draco'''
with open(fname, 'rb') as fhandle:
head = fhandle.read(24)
if len(head) != 24:
return
if imghdr.what(fname) == 'png':
check = struct.un... |
"""Postprocessors about additional items in minimum needs."""
from safe.definitions import minimum_needs_fields, displaced_field
from safe.utilities.i18n import tr
from safe.definitions.concepts import concepts
from safe.definitions.fields import (
pregnant_displaced_count_field, lactating_displaced_count_field)
fr... |
import glob
import logging
import os
import unittest
from abstract_domains.numerical.octagon_domain import OctagonDomain
from abstract_domains.usage.usage_domains import UsedSegmentationDomain
from core.expressions import VariableIdentifier
from engine.backward import BackwardInterpreter
from engine.forward import Forw... |
from settings_local import SUBSCRIPTION_ID, STORAGE_ACCOUNT_NAME, STORAGE_ACCOUNT_KEY, EMAIL_PASSWORD, EMAIL_USERNAME
__author__ = 'Natalie Sanders'
from azure.servicemanagement import *
from azure.storage import *
from subprocess import call
from os import chdir
import os
import socket
import zipfile
import pickle
imp... |
from ConfigParser import ConfigParser
import requests
import sys
import os
import json
import matplotlib.pylab as pl
_cur_path = os.path.dirname(os.path.realpath(__file__))
_root_path = os.path.join(_cur_path, '../..')
config = ConfigParser()
config.read(os.path.join(_root_path, 'config.ini'))
_fact_path = os.path.join... |
import os
import mozharness
from mozharness.base.script import platform_name
external_tools_path = os.path.join(
os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
'external_tools',
)
PYTHON_WIN32 = 'c:/mozilla-build/python27/python.exe'
PLATFORM_CONFIG = {
'linux': {
'exes': {
... |
# -*- coding: utf-8 -*-
from hashlib import md5, sha256
import base64
import webbrowser
from Crypto import Random
from Crypto.Cipher import AES
import wx
try:
from auth import SALT
except ImportError:
SALT = ""
class LogInDialog(wx.Dialog):
def __init__(self, parent=None, title="", caption=""):
super(LogInDialog,... |
from __future__ import absolute_import
import os
import subprocess
import sys
import psutil
from distutils.util import strtobool
from distutils.version import LooseVersion
import mozpack.path as mozpath
PROCESSORS_THRESHOLD = 4
MEMORY_THRESHOLD = 7.4
FREESPACE_THRESHOLD = 10
LATEST_MOZILLABUILD_VERSION = '1.11.0'
DISAB... |
class GEMINI(DataClassification):
name="GEMINI"
# this a description of the intent of the classification
# to what does the classification apply?
usage = '''
Applies to all data from either GMOS-North or GMOS-South instruments in any mode.
'''
# Added the instrument names directly, s... |
'''Tests related to importing comments.'''
import requests
import unittest
from importer import add_comment
json_data = {
u"url": u"www.💩.com",
u"title": u"Upgrade browser message",
u"browser": u"Firefox 30",
u"os": u"Windows 7",
u"body": u"The site asks me to upgrade",
u"labels": [u"contactready", u"inval... |
from . import models, wizard |
import mmap
import re
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand, CommandError
from grouprise.features.contributions.models import Contribution
from grouprise.features.content.models import Version
class Command(BaseCommand):
TAGS_PATTERN = rb"COPY... |
from unittest import TestCase
from ..debian_urls import wnpp_issue_url
class DebianUrlsTest(TestCase):
def test_wnpp_issue_url(self):
self.assertEqual(wnpp_issue_url(748374),
'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748374') |
import requests
import re
import json
from . import macro_replacement_fields
from decimal import Decimal
from superdesk.cache import cache
from flask import current_app as app
RATE_SERVICE = 'http://data.fixer.io/api/latest?access_key={}&symbols={}'
SUFFIX_REGEX = r'((\s*\-?\s*)((mln)|(bln)|(bn)|([mM]illion)|([bB]illio... |
import unittest
from butler_offline.viewcore.converter import datum_from_german as datum
from butler_offline.core.database.sparen.orderdauerauftrag import OrderDauerauftrag
from butler_offline.core.database.sparen.order import Order
def test_add_should_add():
component_under_test = OrderDauerauftrag()
component... |
import logging
from django.contrib.auth.mixins import (
LoginRequiredMixin,
PermissionRequiredMixin
)
from django.urls import reverse_lazy
from django.utils.translation import (
ugettext as _,
ugettext_lazy
)
from django.views.generic import (
CreateView,
DeleteView,
ListView,
UpdateView... |
from datetime import date
from odoo import _, api, fields, models
from odoo.exceptions import Warning as UserError
class RibaList(models.Model):
def _compute_acceptance_move_ids(self):
for riba in self:
move_ids = self.env["account.move"]
for line in riba.line_ids:
mo... |
"""
This file blocks all the routes defined automatically by cms_form.
"""
from odoo import http
from odoo.addons.cms_form.controllers.main import \
CMSFormController, CMSWizardFormController, CMSSearchFormController
class UwantedCMSFormController(CMSFormController):
@http.route()
def cms_form(self, model, ... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dashboard_app', '0021_auto_20151207_0921'),
]
operations = [
migrations.AlterField(
model_name='imagechartfi... |
{
'name': 'BOM price report',
'version': '0.0.1',
'category': 'Generic Modules/Customization',
'author': 'Micronaet s.r.l.',
'website': 'http://www.micronaet.it',
'depends': [
'base',
'mrp',
'bom_total_component', # for bom component
'report_aeroo',
],
... |
__author__ = 'lijiyang'
'''
host = 'localhost'
port = 27017
db = 'test_app_store'
indexfile = 'repo/index.xml'
repo_path = '/home/public/users/lijiyang/appstore/repo/'
'''
host = 'localhost'
port = 27017
db = 'sen5_app_store'
indexfile = 'repo/index.xml'
repo_path = '/home/appstore/appstore/repo/' |
from openerp import models, fields, api, exceptions
from openerp.tools.translate import _
import re
import logging
_logger = logging.getLogger(__name__)
class CountryStateCity(models.Model):
"""
Model added to manipulate separately the cities on Partner address.
"""
_description = 'Model to manipulate C... |
from . import ir_mail_server |
import account_check_duo
import account_voucher
import res_partner_bank
import wizard_third
import wizard_issued
import account
import report
import account_checkbook
import ticket_deposit |
import datetime
import dj_database_url
from app.schedule.service.sms import FakeSMS
from .default import *
ALLOWED_HOSTS = ['*']
DATABASES = {'default': dj_database_url.config()}
CORS_ORIGIN_ALLOW_ALL = True
JWT_AUTH = {
'JWT_EXPIRATION_DELTA': datetime.timedelta(days=10)
}
DJOSER['SEND_ACTIVATION_EMAIL'] = False
R... |
from ..base.Mineral import Mineral
from erukar.system.engine import Observation
import erukar
class Crystal(Mineral):
Probability = 0.05
Desirability = 16.0
PriceMultiplier = 50
WeightMultiplier = 4.5
DurabilityMultiplier = 0.5
InventoryName = "Crystal"
InventoryDescription = 'Delicate, clea... |
from django import forms
from django.core.exceptions import ValidationError
from elections.uk.geo_helpers import (
BadPostcodeException,
UnknownGeoException,
get_ballots_from_postcode,
)
from people.forms.fields import CurrentUnlockedBallotsField
class PostcodeForm(forms.Form):
q = forms.CharField(
... |
"""
Test helpers for Comprehensive Theming.
"""
from django.test import TestCase
from mock import patch
from openedx.core.djangoapps.theming import helpers
class ThemingHelpersTests(TestCase):
"""
Make sure some of the theming helper functions work
"""
def test_get_value_returns_override(self):
... |
from xmodule.modulestore import Location
from contentstore.utils import get_modulestore
from xmodule.x_module import XModuleDescriptor
from xmodule.modulestore.inheritance import own_metadata
from xblock.core import Scope
from xmodule.course_module import CourseDescriptor
import copy
class CourseMetadata(object):
'... |
from odoo import models
class ContractContract(models.Model):
_inherit = 'contract.contract'
def _prepare_invoice(self, date_invoice, journal=None):
contract_lines = self._get_lines_to_invoice(date_invoice)
line_min_fec = min(
contract_lines, key=lambda x: x.next_period_date_start)
... |
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "page",
"name": "sales-dashboard",
"icon": "icon-dashboard",
"label": _("Sales Dashboard"),
"link": "sales-dashboard",
"description": _("Sales Dashboard"),
... |
import time
from random import randint, gauss
from colorsys import hls_to_rgb
from lampapp import LampApp
from hardware.lamp import Color #FIXME odd import..
app = LampApp()
app.need("lamp")
app.need("volume")
def randColor(light, sat, mu=0.3, sigma=0.06):
hue = gauss(mu, sigma)
c = [hue%1, light, sat]
c =... |
from taiga.base.api import serializers
from taiga.base.fields import TagsField
from taiga.base.fields import PgArrayField
from taiga.base.neighbors import NeighborsSerializerMixin
from taiga.mdrender.service import render as mdrender
from taiga.projects.validators import ProjectExistsValidator
from taiga.projects.notif... |
from . import test_biaya_jabatan, test_ptkp, test_pph_rate, test_partner_pph_21 |
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change the feature
configuration ... |
from osv import fields, osv
from tools.translate import _
class receipt_receipt (osv.osv):
_name = "receipt.receipt"
_description = 'Receipt'
_columns = {
'name':fields.char(string='Receipt number',size=128, required=True, readonly=True, ondelete='set null'),
'receiptbook_id': fields... |
from cybox.core import Observable, ObservableComposition
from cybox.objects.file_object import File
from cybox.objects.address_object import Address
from cybox.objects.hostname_object import Hostname
from cybox.objects.uri_object import URI
from cybox.objects.pipe_object import Pipe
from cybox.objects.mutex_object impo... |
import os
import sys
import logging
import openerp
import openerp.netsvc as netsvc
import openerp.addons.decimal_precision as dp
from openerp.osv import fields, osv, expression, orm
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from openerp import SUPERUSER_ID, api
from opene... |
from datetime import datetime, timedelta
import requests
from recall.convenience import settings
from recall import jobs, convenience, messages
_VERIFY_SSL = False
class UpstreamError(Exception):
def __init__(self, response):
Exception.__init__(self, repr(
{"message": response.text,
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('representatives', '0003_auto_20150702_1827'),
('representatives_votes', '0002_auto_20150707_1611'),
]
operations = [
migrations.RemoveField(
... |
from medea.agnostic import freq, ticks_ms, ticks_diff
freq(160000000)
def timeit(fun):
startMs = ticks_ms()
fun()
stopMs = ticks_ms()
print("Took:", ticks_diff(stopMs, startMs)) |
from . import medical_patient_occupation
from . import medical_patient |
{
'name': 'Piwik for Website',
'version': '0.1',
'category': 'Website',
'complexity': "easy",
'description': """
Piwik for Website.
=================
Collects web application usage of website with Piwik.
""",
'author': 'Echoes Technologies SAS',
'website': 'https://www.echoes-tech.com',
... |
from ts_utils import decryptTsSegment
import stress_base
import http_utils
import urlparse
import commands
import tempfile
import urllib2
import hashlib
import shutil
import random
import struct
import socket
import time
import gzip
import os
import re
from hls_compare_params import *
MAX_TS_SEGMENTS_TO_COMPARE = 10
TS... |
import usb.core
import usb.util
import serial
import socket
from datecs import *
from exceptions import *
from time import sleep
class Usb(Datecs):
""" Define USB printer """
def __init__(self, idVendor, idProduct, interface=0, in_ep=0x82, out_ep=0x01):
"""
@param idVendor : Vendor ID
@... |
from __future__ import absolute_import
from .tests_mechanism import AbstractTestFixture, dataset
from jormungandr.street_network.asgard import Asgard
import logging
from navitiacommon import response_pb2, type_pb2
MOCKED_ASGARD_CONF = [
{
"modes": ['walking', 'car', 'bss', 'bike', 'car_no_park'],
"c... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'primdb_app.views.index', name='index'),
url(r'^admin/', include(admin.site.urls)),
url(r'^mzml/$','primdb_app.views.mzml', name='mzml'),
url(r'^pepxml/$','prim... |
from odoo.tests.common import SavepointCase
from .. import exceptions
class UnsubscriptionCase(SavepointCase):
def test_details_required(self):
"""Cannot create unsubscription without details when required."""
with self.assertRaises(exceptions.DetailsRequiredError):
self.env["mail.unsubs... |
"""
WSGI config for RapidPro project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "temba.settings")
from django.core.wsgi i... |
"""
Code which dynamically discovers comprehensive themes. Deliberately uses no Django settings,
as the discovery happens during the initial setup of Django settings.
"""
from __future__ import absolute_import
import os
from django.utils.encoding import python_2_unicode_compatible
from path import Path
def get_theme_ba... |
import pytest
from werkzeug.datastructures import Headers
from flask import jsonify, request, Response, json
import config
from skylines.api.cors import cors
from skylines.api.oauth import oauth
from skylines.app import SkyLines
from skylines.model import User
from skylines.database import db as _db
ORIGIN = 'https://w... |
import os.path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if... |
# -*- coding: utf-8 -*-
__author__ = "OKso <okso.me>"
__version__ = '0.2.1'
from druid.druid import Druid
import druid.image as image
import druid.bootstrap as bootstrap |
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.conf import settings
from taiga.importers.jira.agile import JiraAgileImporter
from taiga.importers.jira.normal import JiraNormalImporter
from taiga.users.models import User
import json
class Command(BaseCommand):
def add_... |
__author__ = 'Iván Arias León (ivan.ariasleon@telefonica.com)'
from lettuce import world
import json
import os
import sys
"""
Parse the JSON configuration file located in the src folder and
store the resulting dictionary in the lettuce world global variable.
"""
with open("properties.json") as config_file:
try:
... |
import os
import django
from django.conf import global_settings
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = '!DJANGO_JET_TESTS!'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DEBUG_PROPAGATE_EXCEPTIONS = True
ROOT_URLCONF = 'jet.tests.urls'
INSTALLED_APPS = (
'jet.dashboard',
'jet',
'django.con... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("popolo", "0002_update_models_from_upstream"),
("candidates", "0009_migrate_to_django_popolo"),
]
operations = [
migrations.AddField(
model_name="loggedaction",
n... |
from ckan import plugins
from ckan.logic.schema import (
default_create_package_schema,
default_update_package_schema,
default_show_package_schema,
)
ignore_missing = plugins.toolkit.get_validator('ignore_missing')
convert_to_extras = plugins.toolkit.get_converter('convert_to_extras')
convert_from_extras = ... |
from django import forms
from django.contrib.auth.models import User
from amcat.forms import forms
from django.contrib.auth.forms import PasswordResetForm
class UserPasswordResetForm(PasswordResetForm):
"""
Reset Password by filling in either email address or user name.
If email is valid, choose the email a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.