content stringlengths 4 20k |
|---|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Ipython Notebook specific ploting utilities
"""
from numpy import array, pi,sqrt, degrees
import Image as PIL
from StringIO import StringIO
from IPython.core.display import Image
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL import arrays
try:
from Op... |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... |
# -*- coding: utf-8 -*-
"""
This module is used for testing the functions within the pyhpeimc.wsm.apinfo module.
"""
import ipaddress
from unittest import TestCase
from pyhpeimc.wsm.apinfo import *
from test_machine import *
# test for get_ac_info_all
class Test_Get_get_ap_info_all(TestCase):
def test_get_ap_... |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qrtextedit import ScanQRTextEdit
import re
from decimal import Decimal
from electrum_creditbit import bitcoin
RE_ADDRESS = '[1-9A-HJ-NP-Za-km-z]{26,}'
RE_ALIAS = '(.*?)\s*\<([1-9A-HJ-NP-Za-km-z]{26,})\>'
frozen_style = "QWidget { background-color:none; border... |
import inspect
from sqlalchemy.engine import create_engine
from sqlalchemy.engine.url import URL
from sqlalchemy.orm import configure_mappers, sessionmaker
from .base import Base, Entity
from .intersection import Intersection
from .lookup import LookupResult
from .mvt import MVTCache
from .route import Route
from .st... |
# Run with nosetests tests/test_pep8.py:test_pep8
from debile.slave.runners.pep8 import pep8, version
from debile.slave.wrappers.pep8 import parse_pep8
from firehose.model import (Analysis, Generator, Metadata)
import unittest
import mock
class Pep8TestCase(unittest.TestCase):
filepath = "tests/resources/python-... |
from command import PagedCommand
try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
import itertools
import sys
import StringIO
class Status(PagedCommand):
common = True
helpSummary = "Show the working tree status"
helpUsage = """
%prog [<project>...]
"""
helpDes... |
import report_sale_layout
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
"""BibEdit Configuration."""
__revision__ = "$Id$"
from invenio.config import CFG_ETCDIR, CFG_TMPSHAREDDIR
import os
## CFG_BIBEDIT_FILENAME - default filename for BibEdit files.
CFG_BIBEDIT_FILENAME = "bibedit_record"
## The CFG_BIBEDIT_JS_* constants are passed on and used by the BibEdit
## Javascript engine.
#... |
__all__ = [
'LinodeDNSDriver'
]
from libcloud.utils.misc import merge_valid_keys, get_new_obj
from libcloud.common.linode import (API_ROOT, LinodeException,
LinodeConnection, LinodeResponse)
from libcloud.dns.types import Provider, RecordType
from libcloud.dns.types import ZoneD... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''get metadata from the lastfm'''
from utils import get_json, strip_newlines, get_compare_string
from simplecache import use_cache
import xbmcvfs
class LastFM(object):
'''get metadata from the lastfm'''
api_key = "1869cecbff11c2715934b45b721e6fb0"
ignore_cache ... |
# coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu',
'%Y-%m-%d': '%d.%m.%Y',
'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
'%s rows deleted... |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.... |
import mock
from neutron.db import l3_db
from neutron import manager
from neutron.tests import base
class TestL3_NAT_dbonly_mixin(base.BaseTestCase):
def setUp(self):
super(TestL3_NAT_dbonly_mixin, self).setUp()
self.db = l3_db.L3_NAT_dbonly_mixin()
def test__each_port_having_fixed_ips_none(... |
"""
Make sure a relink is performed when a .def file is touched.
"""
import TestGyp
import sys
if sys.platform == 'win32':
print "This test is currently disabled: https://crbug.com/483696."
sys.exit(0)
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
CHDIR = 'linker-flags'
target = 'test_deffile_dll_ok'... |
{
'name': 'Stock picking package preparation add to wave',
'version': "1.0",
"author": "OdooMRP team,"
"AvanzOSC,"
"Serv. Tecnol. Avanzados - Pedro M. Baeza",
'website': "http://www.odoomrp.com",
"contributors": [
"Pedro M. Baeza <<EMAIL>",
"Ana Juaristi <... |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
'''
BASH completion for calibre commands that are too complex for simple
completion.
'''
import... |
from django.db import models
from model_utils.models import TimeStampedModel
class DataverseStatsSnapshot(TimeStampedModel):
"""
This model stores stats retrieved/screen scraped from the DV 3.6 homepage:
http://thedata.harvard.edu/dvn/
"""
retrieval_datetime = models.DateTimeField()
d... |
"""A very very simple mock object harness."""
DONT_CARE = ''
class MockFunctionCall(object):
def __init__(self, name):
self.name = name
self.args = tuple()
self.return_value = None
self.when_called_handlers = []
def WithArgs(self, *args):
self.args = args
return self
def WillReturn(sel... |
#! /usr/bin/env python
'''
Simple tool for set intersection
Copyright (C) 2014 Sergey Kolevatov
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) ... |
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .middleware import RedirectFallbackMiddleware
from .models import Redi... |
"""
Unit tests for the
`iris.aux_factory.OceanSigmaZFactory` class.
"""
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests
from unittest import mock
from cf_units import Unit
import numpy as np
from iris.aux_factory import OceanSigmaZFactor... |
"""
Support for Clang as toolchain compiler.
@author: Dmitri Gribenko (National Technical University of Ukraine "KPI")
"""
import easybuild.tools.systemtools as systemtools
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.toolchain.compiler import Compiler
class Clang(Compiler):
"""Clan... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'd F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'd F'
SHORT_DATE_FORMAT = 'd M Y... |
#!/usr/bin/env python
import os
import sys
import unittest
BASEDIR = os.path.dirname(os.path.abspath(__file__))
# Ensure robot found in PYTHONPATH
sys.path.insert(0, os.path.join(BASEDIR, '..', '..', 'src'))
from robot.result import ExecutionResult
from robot.utils.asserts import assert_equals
import fixml
OUTDIR ... |
# -*- coding: utf-8 -*-
from cherrypy.process import plugins
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
class SAEnginePlugin(plugins.SimplePlugin):
def __init__(self, bus, connection_string=None):
self.sa_engine = None
self.connection_string = con... |
import math, random, re
from collections import defaultdict, Counter, deque
from linear_algebra import dot, get_row, get_column, make_matrix, magnitude, scalar_multiply, shape, distance
from functools import partial
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn" },
{ "id": 2, "name": "Sue... |
import plugit
from flask_sqlalchemy import models_committed
from SPI.executor_actor import SPIGeneratorManager
from models import ServiceProvider, Station, Channel, Ecc, CountryCode, Clients, Picture, Show, Schedule, \
GenericServiceFollowingEntry, LogoImage
spi_generator_manager = SPIGeneratorManager()
@models... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y à\s H:i'
YEAR_MONTH_FORMAT = r'F \d\e Y'
MONTH_DAY_FORMAT = ... |
from __future__ import absolute_import
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.unittest import skipUnless
if HAS_GEOS and HAS_SPATIAL_DB:
from django.co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from response import Response
from pb_logging import PBLogger
logger = PBLogger("Unflip")
#"unflips" text
def run(response, args=[]):
response_obj = Response(sys.modules[__name__])
toUnFlip = ''
for n in range(0, len(args)):
toUnFlip += arg... |
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections, migrations
from django.db.migrations.loader import AmbiguityError, MigrationLoader
from django.db.migrations.migration import SwappableTuple
from django.db.migrations.o... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
RegexNotFoundError,
unescapeHTML,
)
class JukeboxIE(InfoExtractor):
_VALID_URL = r'^http://www\.jukebox?\..+?\/.+[,](?P<id>[a-z0-9\-]+)\.html'
_TEST = {
'url': 'http:... |
from .currency_getter_interface import Currency_getter_interface
from openerp import _
from openerp.exceptions import except_orm
import logging
_logger = logging.getLogger(__name__)
class CA_BOC_getter(Currency_getter_interface):
"""Implementation of Curreny_getter_factory interface
for Bank of Canada RSS s... |
from base import Compare
class Exact(Compare):
'''
check if a and b are exact
'''
def match(self, a, b):
if a == b:
return True
return False
class Positive(Compare):
'''
Determin if a as changes in a positive direction to b
Cannot compare string
Boolean:... |
# encoding: utf-8
# module gdbm
# from /opt/centralfitestoque/venvs/centralfitestoque/lib/python2.7/lib-dynload/gdbm.so
# by generator 1.130
"""
This module provides an interface to the GNU DBM (GDBM) library.
This module is quite similar to the dbm module, but uses GDBM instead to
provide some additional functionalit... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ListSubscriptions(Choreography):
def __init__(self, temboo_session):
"""
Crea... |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
"""
WSGI config for test_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... |
__revision__ = "test/Climb/explicit-parent--U.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""
Make sure explicit targets beginning with ../ get built correctly.
by the -U option.
"""
import TestSCons
test = TestSCons.TestSCons()
test.subdir('subdir')
test.write('SConstruct', """\
def cat(env, sour... |
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from landlab.graph import Graph
r"""
For these tests the nodes are given column-by-column::
(1) -- (3) --- (4)
| | /
(0) | /
\ | /
(2)
Once sorted, the node numbering becomes::
... |
########################################################################
# $HeadURL $
# File: File.py
########################################################################
"""
:mod: File
.. module: File
:synopsis: RMS operation file
operation file
"""
# Disable invalid names warning
# pylint: disable=invalid-nam... |
# -*- coding: utf-8 -*-
"""
digparser
---------
Encode/decode DNS packets from DiG textual representation. Parses
question (if present: +qr flag) & answer sections and returns list
of DNSRecord objects.
Unsupported RR types are skipped (this is different from the packet
parser which wi... |
from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Integer,
Bool,
Alias,
Sequence,
)
from openpyxl.descriptors.excel import ExtensionList
from openpyxl.descriptors.nested impo... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
unified_strdate,
)
class SportBoxIE(InfoExtractor):
_VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P<display_id>.+)'
_TES... |
class ModuleDocFragment(object):
# Standard documentation fragment
DOCUMENTATION = '''
options:
validate:
required: false
description:
- The validation command to run before copying into place. The path to the file to
validate is passed in via '%s' which must be present as in th... |
from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str
from tornado.iostream import IOStream
from tornado.template import DictLoader
from tornado.testing import LogTrapTestCase, AsyncHTTPTestCase
from tornado.util import b, bytes_type
from tornado.web import RequestHandler, _O, authenti... |
"""Support for RESTful binary sensors."""
import logging
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_AUTHENTICA... |
from django.http import HttpResponseRedirect
from django.views.generic.list import ListView
from django.utils.translation import ugettext as _
from django.contrib import messages
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required
from account.mixins import Lo... |
from django.core.cache import cache
from ratelimit.backends import BaseBackend
CACHE_PREFIX = 'rl:'
class CacheBackend(BaseBackend):
def _keys(self, request, ip=True, field=None):
keys = []
if ip:
keys.append('ip:' + request.META['REMOTE_ADDR'])
if field is not None:
... |
#!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... |
"""
"""
import time
import logging
class Main(object):
"""All the commands under 'fldigi.main' in the XML-RPC spec for fldigi.
.. note:: An instance of this class automatically gets created under :py:class:`pyfldigi.client.client.Client` when it is constructed.
"""
def __init__(self, clientObj):
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
__version__ = '${version}'
import json
import os
import traceback
from distutils.version i... |
import os
import pkg_resources
from pip.basecommand import Command
from pip.log import logger
class ShowCommand(Command):
"""Show information about one or more installed packages."""
name = 'show'
usage = """
%prog [options] <package> ..."""
summary = 'Show information about installed packages.'... |
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import integrated_helpers
from nova.tests.unit import cast_as_call
from nova.tests.unit import policy_fixture
class ServerListLimitMarkerCell0Test(test.TestCase,
integrated_helpers.In... |
import time, sys, os, shutil, subprocess, distutils.dir_util
sys.path.append("../../configuration")
if os.path.isfile("log.log"):
os.remove("log.log")
log = open("log.log", "w")
from scripts import *
from buildsite import *
from process import *
from tools import *
from directories import *
printLog(log, "")
printLo... |
from django.template.defaultfilters import escape
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class EscapeTests(SimpleTestCase):
"""
The "escape" filter works the same whether autoescape is on or off,
but it has no effect on strings alrea... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FORMAT = 'H:i:s' # 14:30:59
DATETIME_FORMAT = 'l d F Y H:i:s' # Mercoledì 25 Ottobre 2006 14:30:59
YEAR_... |
"""
Class that implements reading vom a pickled file. Every utility that
gets input from a pipe should use it
"""
from optparse import OptionGroup
from PyFoam.ThirdParty.six.moves import cPickle as pickle
from PyFoam.ThirdParty.six import print_
import sys
class CommonPickledDataInput(object):
""" The class that... |
# -*- coding: utf-8 -*-
__author__ = 'joko'
"""
@author:joko
@time: 16/11/8 下午2:52
"""
import lib.Utils as U
def data_marker(cpu, mem, h_cpu, h_mem, path):
"""
:param cpu: cpu列表
:param mem: 内存列表
:param path: 存储的文件路径
:return:
"""
import matplotlib
matplotlib.use('Agg')
import pyl... |
# -*- coding: utf-8 -*-
from textwrap import dedent
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.widgets import AdminTextareaWidget
from django.forms.widgets import SelectMultiple
from django.utils.safestring import mark_safe
class ShortTextArea... |
from __future__ import unicode_literals
from django.contrib.admin.utils import quote
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.test import TestCase, override_settings
from .models import Action, Person, Car
@override_settings(PASSWORD_HASHERS=('dj... |
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
class ImplicitWaitsTests(base_test.WebDriverBaseTest):
def setUp(self):
self.driver.get(self.webserver.where_is('timeouts/res/implicit_waits_te... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql replication
(c) 2013, Balazs Pocze <<EMAIL>>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU General P... |
import os
from gobject import SIGNAL_RUN_FIRST
from virtaal.common import GObjectWrapper, pan_app
from virtaal.models.langmodel import LanguageModel
from basecontroller import BaseController
class LanguageController(BaseController):
"""
The logic behind language management in Virtaal.
"""
__gtype_n... |
#!/usr/bin/env python
import os
from config.header import Header
from config.write_output import print_debug, print_output
from config.moduleInfo import ModuleInfo
class Gnome(ModuleInfo):
def __init__(self):
options = {'command': '-g', 'action': 'store_true', 'dest': 'gnomeKeyring', 'help': 'Gnome Keyring'}
Modu... |
from django.conf import settings
from rest_auth.serializers import (
TokenSerializer as DefaultTokenSerializer,
UserDetailsSerializer as DefaultUserDetailsSerializer,
LoginSerializer as DefaultLoginSerializer,
PasswordResetSerializer as DefaultPasswordResetSerializer,
PasswordResetConfirmSerializer... |
"""An interface for publishing rich data to frontends.
There are two components of the display system:
* Display formatters, which take a Python object and compute the
representation of the object in various formats (text, HTML, SVG, etc.).
* The display publisher that is used to send the representation data to the... |
import urlparse
import logging
import os
import sys
import random
import re
from twisted.web.http import Request
from twisted.web.http import HTTPChannel
from twisted.web.http import HTTPClient
from twisted.internet import ssl
from twisted.internet import defer
from twisted.internet import reactor
from twisted.in... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_timestamp
class InternazionaleIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?internazionale\.it/video/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://www.internazionale... |
import numpy
from constellation_map_generator import *
'''
Note on the naming scheme. Each constellation is named using a prefix
for the type of constellation, the order of the constellation, and a
distinguishing feature, which comes in three modes:
- No extra feature: the basic Gray-coded constellation map; others
... |
#!/usr/bin/env python
# coding: utf-8
"""
This module contains implementations of various routines for
encoding and decoding raw data into feature vectors.
"""
S_BEGIN = "<<BEGIN>>" #chr(244)
S_END = "<<END>>" #chr(243)
U_WORD = "<<UWORD>>" #chr(242)
WORD_TAG_SEP = "_"
class Token(object):
def __init__(s... |
# -*- coding:utf-8 -*-
'''
InCar单元测试.
'''
import inspect
import os
import unittest
from ..incar import InCar
from . import path
class InCarTest(unittest.TestCase):
def setUp(self):
# Create an InCar object.
self.maxDiff = True
def test_rdata(self):
" Test data line in INCAR can be ... |
from cffi import FFI
from xcffib.ffi_build import ffi as xcffib_ffi
from cairocffi.ffi_build import ffi as cairocffi_ffi
pango_ffi = FFI()
# PyPy < 2.6 compatibility
if hasattr(pango_ffi, 'set_source'):
pango_ffi.set_source("libqtile._ffi_pango", None)
pango_ffi.include(cairocffi_ffi)
pango_ffi.cdef("""
type... |
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.translate import _
from datetime import date
import logging
_logger = logging.getLogger(__name__)
class gamification_badge_user(osv.Model):
"""User having received a ... |
import unittest
import sys
import mock
from libcloud.common.base import LazyObject, Response
from libcloud.common.exceptions import BaseHTTPError, RateLimitReachedError
from libcloud.test import LibcloudTestCase
class LazyObjectTest(LibcloudTestCase):
class A(LazyObject):
def __init__(self, x, y=None):... |
def test_chrono_system_clock():
from pybind11_tests import test_chrono1
import datetime
# Get the time from both c++ and datetime
date1 = test_chrono1()
date2 = datetime.datetime.today()
# The returned value should be a datetime
assert isinstance(date1, datetime.datetime)
# The number... |
import BoostBuild
import os
t = BoostBuild.Tester(translate_suffixes=0)
# First check some startup.
t.set_tree("project-test3")
os.remove("jamroot.jam")
t.run_build_system(status=1)
t.expect_output_lines("error: Could not find parent for project at '.'\n"
"error: Did not find Jamfile.jam or Jamroot.jam in any pa... |
import numpy as np
from scipy.sparse.sputils import isshape
from scipy.sparse import isspmatrix
__all__ = ['LinearOperator', 'aslinearoperator']
class LinearOperator:
"""Common interface for performing matrix vector products
Many iterative methods (e.g. cg, gmres) do not need to know the
individual entri... |
from . import config
from . import assertions, schema
from .util import adict
from .. import util
from .engines import drop_all_tables
from .entities import BasicEntity, ComparableEntity
import sys
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
# whether or not we use ... |
from UserDict import DictMixin
class OrderedDict(dict, DictMixin):
def __init__(self, *args, **kwds):
if len(args) > 1:
raise TypeError('expected at most 1 arguments, got %d' % len(args))
try:
self.__end
except AttributeError:
self.clear()
self.u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from GLXCurses import EventBusClient
# It script it publish under GNU GENERAL PUBLIC LICENSE
# http://www.gnu.org/licenses/gpl-3.0.en.html
__author__ = 'Tuux'
# Ref Doc: https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-struct
class Ob... |
from optparse import make_option
import pprint
import requests
from django.core.management.base import BaseCommand
from market.models import Price, PriceCurrency
domains = {
'prod': 'https://marketplace.firefox.com',
'stage': 'https://marketplace.allizom.org',
'dev': 'https://marketplace-dev.allizom.or... |
"""
This module is pending deprecation as of Django 1.6 and will be removed in
version 1.8.
"""
import json
import re
import unittest as real_unittest
import warnings
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test import runner
from django.test.utils import... |
import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal
from nose.tools import assert_true
import warnings
from mne.datasets import testing
from mne import io, find_events, Epochs, pick_types
from mne.utils import run_tests_if_main
from mne.label import read_label
from mne.minimum_... |
from whoosh.compat import iteritems
# Exceptions
class CompositionError(Exception):
pass
# Utility functions
def unstopped(tokenstream):
"""Removes tokens from a token stream where token.stopped = True.
"""
return (t for t in tokenstream if not t.stopped)
def entoken(textstream, positions=False,... |
"""
Test the Data Aggregation Layer for Course Enrollments.
"""
import ddt
from mock import patch
from nose.tools import raises
import unittest
from django.conf import settings
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from enr... |
import gi
gi.require_version("BlockDev", "1.0")
from gi.repository import BlockDev as blockdev
from ... import udev
from ...devices import LUKSDevice
from ...errors import DeviceError, LUKSError
from ...flags import flags
from .devicepopulator import DevicePopulator
from .formatpopulator import FormatPopulator
from .... |
from __future__ import (absolute_import, division, print_function)
import os
import stresstesting
import shutil
import mantid.simpleapi as mantid
from mantid import config
from isis_powder import Pearl
DIRS = config['datasearch.directories'].split(';')
# Setup various path details
inst_name = "PEARL"
# Relative t... |
"""
Management utility to create superusers.
"""
from __future__ import unicode_literals
import getpass
import sys
from django.contrib.auth import get_user_model
from django.contrib.auth.management import get_default_username
from django.core import exceptions
from django.core.management.base import BaseCommand, Comm... |
import skin
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from enigma import eLabel, eWidget, eSlider, fontRenderClass, ePoint, eSize
class ScrollLabel(HTMLComponent, GUIComponent):
def __init__(self, text=""):
GUIComponent.__init__(self)
self.message = text
self.instance = None
... |
#==============================================================================
#==================================Main Model==================================
#==============================================================================
from __future__ import print_function
class MainModel(object):
def __init__... |
import cgi
import gdata.service
import gdata.urlfetch
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import b2wp
import wsgiref.handlers
__author__ = 'JJ Lueck (<EMAIL>)'
# Use urlfetch instead of httplib
gdata.service.http_request_handler = gdata.urlfetch
class Tr... |
"""Tests for tensorflow.ops.reshape_op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
fro... |
# -*- coding: utf-8 -*-
import json
from django.db.models import Q
from django.http import HttpResponse
from wizresource.models import Zone, VM, SSHKey
from wizresource.services import userToTenant
from wizresource.tasks import createSSHKey, resetSSHKey, deleteSSHKey
from utils.common import fakeID
de... |
#!/usr/bin/python
"""
HeaderID Extension for Python-Markdown
======================================
Adds ability to set HTML IDs for headers.
Basic usage:
>>> import markdown
>>> text = "# Some Header # {#some_id}"
>>> md = markdown.markdown(text, ['headerid'])
>>> md
u'<h1 id="some_id">Some Hea... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests import unittest
from ansible.playbook.taggable import Taggable
from units.mock.loader import DictDataLoader
class TaggableTestObj(Taggable):
def __init__(self):
self._loader = DictDataLoader... |
from __future__ import absolute_import
import os
import boto3
import pytest
from moto import mock_secretsmanager
from instana.singletons import tracer
from ...helpers import get_first_span_by_filter
pwd = os.path.dirname(os.path.abspath(__file__))
def setup_method():
""" Clear all spans before a test run """
... |
"""Support Vector Machine (SVM) Estimator (deprecated).
This module and all its submodules are deprecated. See
[contrib/learn/README.md](https://www.tensorflow.org/code/tensorflow/contrib/learn/README.md)
for migration instructions.
"""
from __future__ import absolute_import
from __future__ import division
from __fut... |
import re
import time
import redis
from redis.exceptions import ConnectionError
from backends.base import BaseDataStore
from backends.base import BaseEventEmitter
from backends.base import BaseQueue
from backends.base import BaseSchedule
from utils import EmptyData
def clean_name(name):
return re.sub('[^a-z0-9]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.