content string |
|---|
import logging
import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg'] = 'image/x-dwg'
mimetypes.types_map['.ico'] = 'image/x-icon'
mimetypes.types_map['.bz2'] = 'application/x-bzip2'
mimetypes.types_map['.gz'] = 'application/x-gzip'
import os
import re
import stat
import time
from urllib import unquote
import ... |
from openerp.osv import fields, osv
class product_category(osv.osv):
_inherit = "product.category"
_columns = {
'property_account_income_categ': fields.property(
type='many2one',
relation='account.account',
string="Income Account",
help="This account will... |
import unittest
from mock import patch
from mock import MagicMock as Mock
from oioswift.common.ring import FakeRing
from oioswift import server as proxy_server
from swift.common.swob import Request
from swift.proxy.controllers.base import headers_to_container_info
from swift.common.request_helpers import get_sys_meta_... |
import unittest
import idlelib.CallTips as ct
CTi = ct.CallTips() # needed for get_entity test in 2.7
import textwrap
import types
import warnings
default_tip = ''
# Test Class TC is used in multiple get_argspec test methods
class TC(object):
'doc'
tip = "(ai=None, *args)"
def __init__(self, ai=None, *b)... |
"""Verifies that GRD resource files define all the strings used by a given
set of source files. For file formats where it is not possible to infer which
strings represent message identifiers, localized strings should be explicitly
annotated with the string "i18n-content", for example:
LocalizeString(/*i18n-content*/... |
from future.builtins import int
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.template.defaultfilters import linebreaksbr, urlize
from mezzanine import template
from mezzanine.conf import settings
from theme.forms import ThreadedCommentForm
from mezzanine.generic.models... |
from solum.objects import registry
from solum.objects.sqlalchemy import execution
from solum.objects.sqlalchemy import pipeline
from solum.tests import base
from solum.tests import utils
class TestPipeline(base.BaseTestCase):
def setUp(self):
super(TestPipeline, self).setUp()
self.db = self.useFix... |
from __future__ import division
import copy
import fnmatch
import re
from collections import defaultdict
from whoosh import matching
from whoosh.analysis import Token
from whoosh.compat import bytes_type, text_type, u
from whoosh.lang.morph_en import variations
from whoosh.query import qcore
class Term(qcore.Query):... |
"""
Experimental code can be introduced to Iris through this package.
Changes to experimental code may be more extensive than in the rest of the
codebase. The code is expected to graduate, eventually, to "full status".
"""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filt... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazu... |
from __future__ import unicode_literals
import collections
from rest_framework.compat import OrderedDict, unicode_to_repr
class ReturnDict(OrderedDict):
"""
Return object from `serialier.data` for the `Serializer` class.
Includes a backlink to the serializer instance for renderers
to use if they need ... |
try:
import boto.ec2
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
import random
import string
def main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
name=dict(required=True),
key_material=dict(required=False),
state = dict(default='p... |
#copied from http://code.activestate.com/recipes/576611-counter-class/
from operator import itemgetter
from heapq import nlargest
from itertools import repeat, ifilter
class Counter(dict):
'''Dict subclass for counting hashable objects. Sometimes called a bag
or multiset. Elements are stored as dictionary ... |
"""This is part of the Mouse Tracks Python application.
Source: https://github.com/Peter92/MouseTracks
"""
#Easy to use wrappers for sockets
from __future__ import absolute_import
import psutil
import socket
import struct
from select import select
from .compatibility import pickle
def send_msg(sock, msg):
"""P... |
from gnuradio import gr, gr_unittest
from gnuradio import blocks, digital
import pmt
import numpy as np
import sys
def make_length_tag(offset, length):
return gr.python_to_tag({'offset' : offset,
'key' : pmt.intern('packet_len'),
'value' : pmt.from_long(len... |
from django.core.exceptions import ValidationError
from django.db import transaction
import json
import productmd
from productmd.common import create_release_id
from pdc.apps.common import hacks as common_hacks
from pdc.apps.common import models as common_models
from . import models
def _maybe_log(request, created,... |
from sympy import (
Symbol, gamma, I, oo, nan, zoo, factorial, sqrt, Rational, log,
polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin,
cos, O, lowergamma, exp, erf, erfc, exp_polar, harmonic, zeta,conjugate)
from sympy.core.function import ArgumentIndexError
from sympy.utilities.randtest ... |
"""
defines class that describes C++ typedef declaration
"""
from . import declaration
from . import dependencies
class typedef_t(declaration.declaration_t):
"""describes C++ typedef declaration"""
def __init__(self, name='', type=None):
"""creates class that describes C++ typedef"""
declar... |
import logging
import requests
import json
from beets.plugins import BeetsPlugin
from beets import ui
from beets import dbcore
from beets import config
from pprint import pprint
from beets.dbcore import types
log = logging.getLogger('beets')
api_url = 'http://ws.audioscrobbler.com/2.0/?method=track.getInfo&mbid=%s&api... |
# -*- coding: utf-8 -*-
from mako.template import Template
import unittest
from util import result_lines, flatten_result
class FilterTest(unittest.TestCase):
def test_basic(self):
t = Template("""
${x | myfilter}
""")
assert flatten_result(t.render(x="this is x", myfilter=lambda t: "MYFILT... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingResults.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... |
"""
Hierarchical Token Bucket traffic shaping.
Patterned after U{Martin Devera's Hierarchical Token Bucket traffic
shaper for the Linux kernel<http://luxik.cdi.cz/~devik/qos/htb/>}.
@seealso: U{HTB Linux queuing discipline manual - user guide
<http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm>}
@seealso: U{Token ... |
import logging
import openerp
from openerp import netsvc, tools, pooler
from openerp.osv import fields, osv
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
class inherit_res_partner(osv.osv):
_name='res.partner'
_inherit='res.partner'
def write(self, cr, uid, ids... |
#!/usr/bin/env python
# coding=utf8
"""
Add list of closed bugs to changes table
@contact: Debian FTP Master <<EMAIL>>
@copyright: 2012 Ansgar Burchardt <<EMAIL>>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of... |
"""Backend which can generate charts using the Google Chart API."""
from graphy import line_chart
from graphy import bar_chart
from graphy import pie_chart
from graphy.backends.google_chart_api import encoders
def _GetChartFactory(chart_class, display_class):
"""Create a factory method for instantiating charts with... |
from distutils.core import setup
import os
LOCALE_DIR= '/usr/share/locale'
locales = []
if os.path.exists('po/locale'):
for lang in os.listdir('po/locale'):
locales.append(os.path.join(lang, 'LC_MESSAGES'))
data_files = [("share/applications/", ["share/applications/mageiasync.desktop"]),
("... |
from . import controllers
from . import models
from . import edi_service
from .models.edi import EDIMixin, edi
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
"""
Tests for Django's bundled context processors.
"""
from django.test import TestCase
class RequestContextProcessorTests(TestCase):
"""
Tests for the ``django.core.context_processors.request`` processor.
"""
urls = 'regressiontests.context_processors.urls'
def test_request_attributes(self):
... |
import unittest
import IECore
class SWAReaderTest( unittest.TestCase ) :
def testConstruction( self ) :
r = IECore.SWAReader()
self.assertEqual( r["fileName"].getTypedValue(), "" )
r = IECore.SWAReader( "test/IECore/data/swaFiles/test.swa" )
self.assertEqual( r["fileName"].getTypedValue(), "test/IECore/d... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
APP_NAME = 'FoodSnag'
MAILER_NAME = 'Snagger'
MAILER_EMAIL = '<EMAIL>'
MG_KEY = os.environ.get('MG_KEY')
MG_URL = 'https://api.mailgun.net/v3/sandbox86fa708b0be84193924a6900094a11cf.mailgun.org'
SECRET_KEY = os.enviro... |
'''
@author: Pedram Amini
@license: GNU General Public License 2.0 or later
@contact: <EMAIL>
@organization: www.openrce.org
'''
try:
from idaapi import *
from idautils import *
from idc import *
except:
pass
import pgraph
from instruction import *
from defines... |
# NOTE: Documentation is intended to be processed by epydoc and contains
# epydoc markup.
"""
Overview
========
The ``grizzled.forwarder`` module contain classes that make building proxies
easier.
"""
from __future__ import absolute_import
__docformat__ = "restructuredtext en"
# -----------------------------------... |
from Components.ActionMap import ActionMap
from Components.Ipkg import IpkgComponent
from Components.Label import Label
from Components.Slider import Slider
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from enigma import eTimer
class Ipkg(Screen):
def __init__(self, session, cmdList=Non... |
import os
import io
import tarfile
import sys
import pytest
import docker.errors
__client = None
if sys.version_info.major == 2:
file_not_found_error = IOError
else:
file_not_found_error = FileNotFoundError
def get_client():
"""
Returns:
docker.DockerClient
"""
global __client
i... |
import os
import unittest
from bisect_results import BisectResults
import source_control
class MockDepotRegistry(object):
def ChangeToDepotDir(self, depot):
pass
class MockRevisionState(object):
def __init__(self, revision, index, depot='chromium', value=None,
perf_time=0, build_time=0, pass... |
import json
from rally import consts
from rally.plugins.openstack import scenario
from rally.plugins.openstack.scenarios.ceilometer import utils as ceiloutils
from rally.task import validation
class CeilometerQueries(ceiloutils.CeilometerScenario):
"""Benchmark scenarios for Ceilometer Queries API."""
@vali... |
import Gaffer
import GafferUI
class TransformPlugValueWidget( GafferUI.CompoundPlugValueWidget ) :
def __init__( self, plug, collapsed=True, label=None, **kw ) :
GafferUI.CompoundPlugValueWidget.__init__( self, plug, collapsed, label, self.__summary )
@staticmethod
def __summary( plug ) :
info = []
tr... |
"""Self-test suite for Crypto.Hash.MD2"""
__revision__ = "$Id$"
# This is a list of (expected_result, input[, description]) tuples.
test_data = [
# Test vectors from RFC 1319
('8350e5a3e24c153df2275c9f80692773', '', "'' (empty string)"),
('32ec01ec4a6dac72c0ab96fb34c0b5d1', 'a'),
('da853b0d3f88d99b302... |
#!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import run_only
from mock import patch
from slony import SlonyCollector
def run_only_if_psycopg2_is_available(func):
... |
import hashlib
from twisted.internet import reactor
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol, listenWS
class FrameBasedHashServerProtocol(WebSocketServerProtocol):
"""
Frame-based WebSockets server that computes a running SHA-256 for message data
received. It wil... |
from celery.schedules import crontab, timedelta
import time
import logging
ALERTS = {
'bro_intel.AlertBroIntel': {'schedule': crontab(minute='*/1')},
'bro_notice.AlertBroNotice': {'schedule': crontab(minute='*/1')},
'bruteforce_ssh.AlertBruteforceSsh': {'schedule': crontab(minute='*/1')},
'cloudtrail.A... |
from .kernel_struct import *
from .raw_dump import *
from .fingerprint import *
from xml.dom.minidom import parse, Document
import os.path
CONFIG_VERSION = 1.0
class Config:
init_task = None
arch = None
offsets = {}
dumpfile = None
debug = False
@classmethod
def setDebug(cls, debug=False):
... |
import re
import json
from base64 import b64encode
import sickbeard
from sickbeard.clients.generic import GenericClient
class TransmissionAPI(GenericClient):
def __init__(self, host=None, username=None, password=None, custom_url=None): #TODO : plug that custom_url argument to live data
... |
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(object):
"""
Executor class for commands, including "commands" implemented by
Python functions.
"""
verbose = True
active = True
def __init__(self, dictionary={}):
s... |
"""
This program checks C code for compliance to coding standards used in
libsndfile and other projects I run.
"""
import re
import sys
class Preprocessor:
"""
Preprocess lines of C code to make it easier for the CStyleChecker class to
test for correctness. Preprocessing works on a single line at a time but
main... |
"""
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was attempted (if the caller wants to treat that
... |
IOC_TO_ISO = {
'AFG': 'AF',
'ALB': 'AL',
'ALG': 'DZ',
'AND': 'AD',
'ANG': 'AO',
'ANT': 'AG',
'ARG': 'AR',
'ARM': 'AM',
'ARU': 'AW',
'ASA': 'AS',
'AUS': 'AU',
'AUT': 'AT',
'AZE': 'AZ',
'BAH': 'BS',
'BAN': 'BD',
'BAR': 'BB',
'BDI': 'BI',
'BEL': 'BE',... |
from __future__ import print_function
import sys
from command import Command
from git_command import GitCommand
class Rebase(Command):
common = True
helpSummary = "Rebase local branches on upstream branch"
helpUsage = """
%prog {[<project>...] | -i <project>...}
"""
helpDescription = """
'%prog' uses git reba... |
"""
Module containing the Independent class to handle all operations pertaining
to the independent model.
"""
import os
import pandas as pd
class Independent:
"""Returns an Independent object that reads in the data, splits into sets,
trains and classifies, and writes the results."""
def __init__(self, co... |
import os
import tempfile
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import gradient_check
from chainer import links
from chainer.serializers import npz
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import t... |
from pandajedi.jediconfig import jedi_config
from pandajedi.jedicore import Interaction
# interface to DDM
class DDMInterface:
# constructor
def __init__(self):
self.interfaceMap = {}
# setup interface
def setupInterface(self):
# parse config
for configStr in jedi_config.ddm.... |
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser']
import warnings
from cStringIO import StringIO
from email.feedparser import FeedParser
from email.message import Message
class Parser:
def __init__(self, *args, **kws):
"""Parser of RFC 2822 and MIME email messag... |
# encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class KickStarterIE(InfoExtractor):
_VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>[^/]*)/.*'
_TESTS = [{
'url': 'https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-g... |
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables set to the
variables passed to the generator. Like gypd, it's intended as a debugging
aid, to facilitate the exploration of .gyp structures after being pro... |
"""Logging support for Tornado.
Tornado uses three logger streams:
* ``tornado.access``: Per-request logging for Tornado's HTTP servers (and
potentially other servers in the future)
* ``tornado.application``: Logging of errors from application code (i.e.
uncaught exceptions from callbacks)
* ``tornado.general``: ... |
from datetime import datetime
def main(request, response):
last_event_id = request.headers.get("Last-Event-Id", "")
ident = request.GET.first('ident', "test")
cookie = "COOKIE" if ident in request.cookies else "NO_COOKIE"
origin = request.GET.first('origin', request.headers["origin"])
credentials =... |
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('configurations.gyp')
test.set_configuration('Release')
test.build('configurations.gyp')
test.run_built_executable('configurations',
stdout=('Base configuration\n... |
import json
import sys
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.urls import fetch_url
def scaleway_argument_spec():
return dict(
api_token=dict(required=True, fallback=(env_fallback, ['SCW_TOKEN', 'SCW_API_KEY', 'SCW_OAUTH_TOKEN', 'SCW_API_TOKEN']),
... |
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
class stock_move(osv.osv):
_inherit = 'stock.move'
_columns = {
'purchase_line_id': fields.many2one('purchase.order.line',
'Purchase Order Line', ondelete='set null', select=True,
... |
"""Calculates timelines from the client."""
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import utils
from grr.proto import flows_pb2
class MACTimesArgs(rdfvalue.RDFProtoStruct):
protobuf = flows_pb2.MACTimesArgs
class MACTimes(flow.GRR... |
#!/usr/bin/env python
import os, unittest
from xdis.load import load_module
def get_srcdir():
filename = os.path.normcase(os.path.dirname(os.path.abspath(__file__)))
return os.path.realpath(filename)
srcdir = get_srcdir()
class TestMarshal(unittest.TestCase):
def test_basic(self):
"""Tests xdi... |
"""creates: bigpicture.svg bigpicture.png"""
import os
from math import pi, cos, sin
import numpy as np
import matplotlib
#matplotlib.use('Agg')
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
class Box:
def __init__(self, name, description=(), attributes=(), color='grey'):
self.na... |
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import int_or_none
class LiveLeakIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<id>[\w_]+)(?:.*)'
_TESTS = [{
'url': 'http://www.liveleak.com/view?i=757... |
import luigi
from luigi.mock import MockFile
import unittest
import decimal
import datetime
import luigi.notifications
luigi.notifications.DEBUG = True
File = MockFile
class Report(luigi.Task):
date = luigi.DateParameter()
def run(self):
f = self.output().open('w')
f.write('10.0 USD\n')
... |
import unittest
from airflow import configuration
HELLO_SERVER_CMD = """
import socket, sys
listener = socket.socket()
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listener.bind(('localhost', 2134))
listener.listen(1)
sys.stdout.write('ready')
sys.stdout.flush()
conn = listener.accept()[0]
conn.send... |
from nose import SkipTest
from nose.tools import assert_true
import networkx as nx
class TestConvertPandas(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
try:
import pandas as pd
except ImportError:
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import e... |
from alembic import op
import contextlib
import sqlalchemy as sa
from sqlalchemy.engine import reflection
def alter_enum(table, column, enum_type, nullable):
bind = op.get_bind()
engine = bind.engine
if engine.name == 'postgresql':
values = {'table': table,
'column': column,
... |
"""
A Python Markdown extension to convert plain-text diagrams to images.
"""
# The MIT License (MIT)
#
# Copyright (c) 2014 Sergey Astanin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... |
import logging
from c2corg_api import DBSession
from c2corg_api.models.feed import FollowedUser
from c2corg_api.views import cors_policy, restricted_json_view
from c2corg_api.views.document_listings import get_documents_for_ids
from c2corg_api.views.document_schemas import user_profile_documents_config
from c2corg_api... |
from __future__ import unicode_literals
import webnotes
def execute():
from stock.stock_ledger import update_entries_after
item_warehouse = []
# update valuation_rate in transaction
doctypes = {"Purchase Receipt": "purchase_receipt_details", "Purchase Invoice": "entries"}
for dt in doctypes:
for d in webnotes.... |
from unittest import mock
from heat.common import exception
from heat.common import template_format
from heat.engine import node_data
from heat.engine import resource
from heat.engine import scheduler
from heat.tests.autoscaling import inline_templates
from heat.tests import common
from heat.tests import utils
as_te... |
{
'name': 'EU Mini One Stop Shop (MOSS)',
'category': 'Localization',
'description': """
EU Mini One Stop Shop (MOSS) VAT for telecommunications, broadcasting and electronic services
=============================================================================================
As of January 1rst, 2015, tele... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Daniel Zhang (張道博)'
__copyright__ = 'Copyright (c) 2014, University of Hawaii Smart Energy Project'
__license__ = 'https://raw.github.com/Hawaii-Smart-Energy-Project/Smart-Grid' \
'-PV-Inverter/master/BSD-LICENSE.txt'
import unittest
from inser... |
"""Exceptions used throughout package"""
from __future__ import absolute_import
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class ... |
# -*- coding: utf-8 -*-
"""
werkzeug.exceptions
~~~~~~~~~~~~~~~~~~~
This module implements a number of Python exceptions you can raise from
within your views to trigger a standard non-200 response.
Usage Example
-------------
::
from werkzeug.wrappers import BaseRequest
... |
import json
import re
import time
import urllib
import urlparse
from resources.lib.modules import cache
from resources.lib.modules import cleandate
from resources.lib.modules import client
from resources.lib.modules import control
from resources.lib.modules import log_utils
from resources.lib.modules import utils
BAS... |
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from appcrawl.items import AppItem, AppStoreItem
from scrapy.http import Request
import datetime
import re
class PlaystoreSpider(CrawlSpider):
def gen... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import constants as C
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
class CallbackModule(CallbackModule_default):
'''
This is the stderr callback plugin, which reuses ... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
from ansible.module_utils.ipa import IPAClient
class SudoCmdGroupIPAClient(IPAClient):
def __init__(self, module, host, port, protocol):
super(SudoCmdGroupIPAClient, self).__i... |
""" Module Analysing code to extract positive subscripts from code. """
# TODO check bound of while and if for more occurate values.
import ast
import copy
from pythran.analyses import Globals, Aliases
from pythran.intrinsic import Intrinsic
from pythran.passmanager import FunctionAnalysis
from pythran.range import ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This is a very trivial example of how any callback function can get at play and task objects.
play will be 'None' for runner inv... |
from optparse import make_option
from django.conf import settings
from django.core.management.commands.runserver import Command as RunserverCommand
from django.contrib.staticfiles.handlers import StaticFilesHandler
class Command(RunserverCommand):
option_list = RunserverCommand.option_list + (
make_optio... |
from django.conf.urls.defaults import *
from views import empty_view, absolute_kwargs_view
other_patterns = patterns('',
url(r'non_path_include/$', empty_view, name='non_path_include'),
)
urlpatterns = patterns('',
url(r'^places/(\d+)/$', empty_view, name='places'),
url(r'^places?/$', empty_view, name="pl... |
from django import template
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models, transaction
from django.forms.models import modelform_factory
from django.http import Http404, HttpResponse
from django.utils.encoding import force_unicode, smart_unicode
from django.utils.h... |
# -*- coding: utf-8 -*-
import random
import string
from itertools import cycle
from django.core.exceptions import ValidationError
import mock
from nose.tools import eq_, ok_
import mkt.site.tests
import mkt.feed.constants as feed
from mkt.feed.models import (FeedApp, FeedBrand, FeedCollection, FeedItem,
... |
"""Validate extended attributes.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler#TOC-Extended-attribute-validation
"""
import os.path
import re
module_path = os.path.dirname(__file__)
source_path = os.path.join(module_path, os.pardir, os.pardir)
EXTENDED_ATTRIBUTES_RELATIVE_PATH = os.pa... |
"""
Acceptance tests for the Import and Export pages
"""
from nose.plugins.attrib import attr
from datetime import datetime
from flaky import flaky
from abc import abstractmethod
from bok_choy.promise import EmptyPromise
from .base_studio_test import StudioLibraryTest, StudioCourseTest
from ...fixtures.course import... |
"""base tables
Revision ID: 2f3bd55d88a
Revises: None
Create Date: 2013-04-22 15:26:47.296443
"""
# revision identifiers, used by Alembic.
revision = '2f3bd55d88a'
down_revision = None
from ansiblereport.model import JSONEncodedDict
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands au... |
import sys
import unittest
import Tkinter
import ttk
from test.test_support import requires, run_unittest
import support
requires('gui')
class LabeledScaleTest(unittest.TestCase):
def setUp(self):
support.root_deiconify()
def tearDown(self):
support.root_withdraw()
def test_widget_des... |
"""
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... |
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap
from Components.Label import Label
from OMBManagerCommon import OMB_DATA_DIR, OMB_UPLOAD_DIR, OMB_TMP_DIR, OMB_MANAGER_VERION
from OMBManagerInstall import BOX_NAME
from OMBManagerLocale import _
fro... |
"""
===========================================
Comparison of F-test and mutual information
===========================================
This example illustrates the differences between univariate F-test statistics
and mutual information.
We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the
targ... |
"""
Copyright (c) 2013, SMART Technologies ULC
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 conditions an... |
#!/usr/bin/env python
import xcsoar
import argparse
from pprint import pprint
# Parse command line parameters
parser = argparse.ArgumentParser(
description='Please give me a IGC file name...')
parser.add_argument('file_name', type=str)
args = parser.parse_args()
print "Init xcsoar.Flight, don't store flight in... |
#!/usr/bin/python
# -*- encoding: utf8 -*-
import os
import unittest
import json
from datetime import timedelta, datetime
from apiisim import tests
from apiisim.common import AlgorithmEnum, TransportModeEnum
from apiisim.common.plan_trip import LocationStructure
from apiisim.common.mis_plan_trip import ItineraryRespon... |
"""
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .test import *
from .sauce import *
# You ... |
#!/usr/bin/env python
import binascii
from bitcoin.core import COutPoint, CTxIn, CTxOut, CTransaction, CBlock
coinbase = "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73"
scriptPubKeyHex = "4104678afdb0fe55482... |
from django.http import Http404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.exceptions import PermissionDenied
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import uge... |
from migrate import ForeignKeyConstraint
from sqlalchemy import MetaData, String, Table
from sqlalchemy import select, Column, ForeignKey, Integer
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.