content
stringlengths
4
20k
# -*- coding: utf-8 -*- """ werkzeug.testsuite.cache ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the cache system :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import time import unittest import tempfile import shutil from werkzeug.testsuite import Werkzeug...
''' Installer for the `jml` python API wrapper. To install, run: python setup.py build_ext --inplace or python setup.py install''' # from distutils.core import setup, Extension from setuptools import setup, Extension from setuptools import find_packages from subprocess import call import os import sys sys.path.a...
"""The backups api.""" from oslo_log import log as logging import webob from webob import exc from cinder.api import common from cinder.api import extensions from cinder.api.openstack import wsgi from cinder.api.views import backups as backup_views from cinder import backup as backupAPI from cinder import exception f...
""" Command definition module. Relates circuit gates to pulse commands. """ from typing import List, Tuple, Iterable, Union, Dict, Optional from qiskit.qobj import PulseQobjInstruction from qiskit.qobj.converters import QobjToInstructionConverter from .commands import SamplePulse from .exceptions import PulseError f...
""" File-based monitors for SimpleMonitor. """ import os import os.path import time from monitor import Monitor class MonitorBackup(Monitor): filename = os.path.join("C:\\", "Program Files", "VERITAS", "Backup Exec", "status.txt") def run_test(self): if not os.path.exists(self.filename): ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.onyx import onyx_bgp from units.modules.utils import set_module_args from .onyx_module import TestOnyxModule, load_fixture class TestOnyxBgpModule(TestOnyxM...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time import warnings from collections import OrderedDict from importlib import import_module from django.apps import apps from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django...
from openerp.osv import fields, osv import logging _logger = logging.getLogger(__name__) # # crm.meeting is defined in module base_calendar # class crm_meeting(osv.Model): """ Model for CRM meetings """ _inherit = 'crm.meeting' _columns = { 'phonecall_id': fields.many2one ('crm.phonecall', 'Phoneca...
""" Verifies build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the gyp file changes. """ import os import TestGyp env_stack = [] def PushEnv(): env_copy = os.environ.copy() env_stack.append(env_copy) def PopEnv(): os.eniron=env_stack.pop...
""" Cred plugin for UNIX user accounts. """ from zope.interface import implements from twisted import plugin from twisted.cred.strcred import ICheckerFactory from twisted.cred.checkers import ICredentialsChecker from twisted.cred.credentials import IUsernamePassword from twisted.cred.error import UnauthorizedLogin fr...
""" Middleware that checks user standing for the purpose of keeping users with disabled accounts from accessing the site. """ from django.http import HttpResponseForbidden from django.utils.translation import ugettext as _ from django.conf import settings from student.models import UserStanding class UserStandingMidd...
import contextlib import bookshelf from conftest import flaky_filter from flaky import flaky import mock from oauth2client.client import OAuth2Credentials import pytest @pytest.fixture def client_with_credentials(app): """This fixture provides a Flask app test client that has a session pre-configured with us...
# -*- coding: utf8 -*- from __future__ import print_function import sqlite3,zlib from bs4 import BeautifulSoup import codecs import urllib2 import json db = sqlite3.connect('raw_real.db') cur = db.cursor() info = sqlite3.connect('info.db') infocur = info.cursor() startid = 10000153 print("sucks1") cur.execute('selec...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/Users/chernomirdinmacuvele/Documents/workspace/PescArt2.0/UserInt/ui_compAmostra.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class U...
"""Validators for OAuth 2.0 redirect URIs and scopes.""" from __future__ import absolute_import from oauthlib.oauth2.rfc6749.errors import InsecureTransportError, \ InvalidRedirectURIError from six.moves.urllib_parse import urlparse from .errors import ScopeDoesNotExists def validate_redirect_uri(value): "...
from os.path import dirname, abspath import sys from multiprocessing import Process, Queue import time from gevent.wsgi import WSGIServer from celery import Celery par_path = dirname(dirname(abspath(__file__))) sys.path.append(par_path) from flask import Flask, jsonify, render_template, send_from_directory, request,...
from openerp import tools from openerp.osv import fields, osv class payment_advice_report(osv.osv): _name = "payment.advice.report" _description = "Payment Advice Analysis" _auto = False _columns = { 'name':fields.char('Name', readonly=True), 'date': fields.date('Date', readonly=True,),...
from Visitor import ScopeTrackingTransform from Nodes import StatListNode, SingleAssignmentNode, CFuncDefNode, DefNode from ExprNodes import DictNode, DictItemNode, NameNode, UnicodeNode from PyrexTypes import py_object_type from StringEncoding import EncodedString import Symtab class AutoTestDictTransform(ScopeTracki...
from odoo import api, fields, models, _ from odoo.exceptions import UserError class StockPickingBatch(models.Model): _inherit = ['mail.thread'] _name = "stock.picking.batch" _description = "Batch Picking" _order = "name desc" name = fields.Char( string='Batch Picking Name', default='New',...
from __future__ import print_function import fontforge from misc import MathMLAssociationCopyright em = 1000 def create(aName): print("Generating %s.woff..." % aName, end="") mathFont = fontforge.font() mathFont.fontname = aName mathFont.familyname = aName mathFont.fullname = aName mathFont.co...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.common...
"""A non-blocking, single-threaded HTTP server. Typical applications have little direct interaction with the `HTTPServer` class except to start a server at the beginning of the process (and even that is often done indirectly via `tornado.web.Application.listen`). .. versionchanged:: 4.0 The ``HTTPRequest`` class ...
import hashlib import logging import re from django import http from django.conf import settings from django.core import urlresolvers from django.core.exceptions import PermissionDenied from django.core.mail import mail_managers from django.utils.encoding import force_text logger = logging.getLogger('django.request')...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'pyweed/gui/uic/SpinnerWidget.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_SpinnerWidget(object): def setupUi(self, SpinnerW...
from utils.commands import ErrorHandlingCommand from django.conf import settings from utils.amazon import default_s3_store from videos.models import Video, VIDEO_TYPE_FLV, VIDEO_TYPE_HTML5 import urllib import os import commands import sys from django.core.exceptions import ImproperlyConfigured from django.core.files.b...
""" Tests for credit app views. """ import unittest import json import datetime import pytz import ddt from mock import patch from django.test import TestCase from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.conf import settings from student.tests.factories impo...
import tempfile import re import os import sys def _get_cmd_options(module, cmd): thiscmd = cmd + " --help" rc, stdout, stderr = module.run_command(thiscmd) if rc != 0: module.fail_json(msg="Could not get output from %s: %s" % (thiscmd, stdout + stderr)) words = stdout.strip().split() cmd_...
#!/usr/bin/env python """ Utilities for handling subprocesses. Mostly necessary only because of http://bugs.python.org/issue1652. """ import copy import errno import fcntl import gevent.socket import os import signal import subprocess import sys from subprocess import PIPE from cStringIO import StringIO class Non...
class King: def __init__(self, board, end): self._board = board self._position = end self._kings_moves = [] def populate_moves(self): self._kings_moves = [self._position + 1, self._position - 1, self._position + 9, self._position + 10, self._position + 11, self._position - 9, self._posit...
from distutils.core import setup, Extension import os import sys import platform # find pjsip version pj_version="" pj_version_major="" pj_version_minor="" pj_version_rev="" pj_version_suffix="" f = open('../../../../version.mak', 'r') for line in f: if line.find("export PJ_VERSION_MAJOR") != -1: tokens=line....
from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.maxDiff = None filename = 'chart_axis38.xlsx' ...
import os import stat import urllib import urllib2 import email.Utils class RangeError(IOError): """Error raised when an unsatisfiable range is requested.""" pass class HTTPRangeHandler(urllib2.BaseHandler): """Handler that enables HTTP Range headers. This was extremely simple. The Range header is a ...
from django.contrib.localflavor.de.forms import (DEZipCodeField, DEStateSelect, DEIdentityCardNumberField) from utils import LocalFlavorTestCase class DELocalFlavorTests(LocalFlavorTestCase): def test_DEStateSelect(self): f = DEStateSelect() out = u'''<select name="states"> <option value="BW"...
import webob from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import compute from nova.compute import vm_states from nova import exception from nova.openstack.common.gettextutils import _ from nova.openstack.common impor...
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ExtractorError class BYUtvIE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?byutv.org/watch/[0-9a-f-]+/(?P<video_id>[^/?#]+)' _TEST = { 'url': 'http://www.byutv.org/watch/6587b9a3-...
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) from decimal import Decimal import json import shutil import subprocess import time import re from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * START_P2P_PORT=11000...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, update_url_query, ) class ZingMp3BaseInfoExtractor(InfoExtractor): def _extract_item(self, item, page_type, fatal=True): error_message = ite...
"""Chromium presubmit script for src/extensions/browser. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API built into depot_tools. """ import sys def _CreateHistogramValueChecker(input_api, output_api): original_sys_path = sys.path try: sys.pat...
import os import pytest import tarfile from thefuck.rules.dirty_untar import match, get_new_command, side_effect from tests.utils import Command @pytest.fixture def tar_error(tmpdir): def fixture(filename): path = os.path.join(str(tmpdir), filename) def reset(path): with tarfile.TarFi...
from scrapy.item import BaseItem from scrapy.http import Request from scrapy.exceptions import ContractFail from . import Contract # contracts class UrlContract(Contract): """ Contract to set the url of the request (mandatory) @url http://scrapy.org """ name = 'url' def adjust_request_args(...
#!/usr/bin/python3 #This program produces temperature vs density, and pressure vs temperature phase diagrams #from data stored in *best.dat (or *best_tensor.dat) data files generated by figs/new-melting.cpp #and found in deft/papers/fuzzy-fmt/data/phase-diagram (edit later - currently files in newdata/phase-diagram a...
import sys # # IDL Node # # IDL Node defines the IDLAttribute and IDLNode objects which are constructed # by the parser as it processes the various 'productions'. The IDLAttribute # objects are assigned to the IDLNode's property dictionary instead of being # applied as children of The IDLNodes, so they do not exist i...
import numpy, os import matplotlib.pyplot as plt def load_binary_file(file_name, dimension): fid_lab = open(file_name, 'rb') features = numpy.fromfile(fid_lab, dtype=numpy.float32) fid_lab.close() frame_number = features.size / dimension features = features[:(dimension * (features.size / di...
def compare_links(actual, expected): """Compare xml atom links.""" return compare_tree_to_dict(actual, expected, ('rel', 'href', 'type')) def compare_media_types(actual, expected): """Compare xml media types.""" return compare_tree_to_dict(actual, expected, ('base', 'type')) def compare_tree_to_di...
from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch class EarlyWarningSystemTaskDelegate(PatchAnalysisTaskDelegate): pass class EarlyWarningSystemTask(PatchAnalysisTask): def __init__(self, delegate, patch, should_run_tests=True): PatchAna...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.handlers.wsgi import WSGIHandler, WSGIRequest from django.core.signals import request_started, request_finished from django.db import close_old_connections, connection from django.test import RequestFactory, TestCase, TransactionTestCase...
import json from django.conf import settings from django.contrib.auth import get_user_model from django.test import Client, TestCase, LiveServerTestCase, tag from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from se...
""" A simple example demonstrating basic Spark SQL features. Run with: ./bin/spark-submit examples/src/main/python/sql/basic.py """ # $example on:init_session$ from pyspark.sql import SparkSession # $example off:init_session$ # $example on:schema_inferring$ from pyspark.sql import Row # $example off:schema_inferring...
"""The tests for the notify demo platform.""" import unittest import homeassistant.components.notify as notify from homeassistant.components.notify import demo from tests.common import get_test_home_assistant class TestNotifyDemo(unittest.TestCase): """Test the demo notify.""" def setUp(self): # pylint: d...
from __future__ import absolute_import from PyQt4.QtGui import QWidget from PyQt4.QtGui import QToolBar from PyQt4.QtGui import QPushButton from PyQt4.QtGui import QIcon from PyQt4.QtGui import QStyle from PyQt4.QtGui import QStackedWidget from PyQt4.QtGui import QHBoxLayout from PyQt4.QtGui import QVBoxLayout from Py...
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import sys import uuid import json import time import getpass import ha...
import agents as ag #An unnecessary change so that I can once again commit and push def HW2Agent() -> object: oldPercepts = [('None', 'Clean')] oldActions = ['NoOp'] def program(percept): wall, status = percept myAction = oldActions[-1] if myAction == 'NoOp': program.do ...
""" Module :mod:`openquake.hazardlib.tom` contains implementations of probability density functions for earthquake temporal occurrence modeling. """ import math import numpy import scipy.stats from openquake.baselib.slots import with_slots @with_slots class PoissonTOM(object): """ Poissonian temporal occurr...
""" Views related to operations on course objects """ import json from django.contrib.auth.decorators import login_required from django_future.csrf import ensure_csrf_cookie from django.conf import settings from django.core.exceptions import PermissionDenied from django.http import HttpResponse, HttpResponseBadRequest...
import json from django.core.urlresolvers import reverse from django import http from mox3.mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.test import helpers as test from openstack_dashboard.test.test_data import utils as test_utils INDEX_URL = reverse('horizon:admin:metering:i...
from __future__ import unicode_literals import warnings from django import forms from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.test import ( SimpleTestCase, TestCase, ignore_warnings, override_settings, ) from django.test.client import RequestFact...
# -*- coding: utf-8 -*- from openerp.osv import orm, fields def selection_fn(obj, cr, uid, context=None): return list(enumerate(["Corge", "Grault", "Wheee", "Moog"])) def function_fn(model, cr, uid, ids, field_name, arg, context): return dict((id, 3) for id in ids) def function_fn_write(model, cr, uid, id, f...
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule fro...
from django.contrib.auth import authenticate from django.contrib.auth import login from django.contrib.auth import get_user_model from registration import signals from registration.views import RegistrationView as BaseRegistrationView User = get_user_model() class RegistrationView(BaseRegistrationView): """ ...
#!/usr/bin/env python """ Python port of SolarCalc 1.0 This port only the internal calculation routines, thus making the tool applicable for batch data processing without GUI. Please contact me, in case I'm violating anything with this... Not doing it on purpose.. I'm just tired of clicking through the GUI :/ For re...
#!/usr/bin/python """ Some test functions used to sanity check during development. Not unit tests. """ import sys sys.path.insert(0, '..') from clarify_python_2 import clarify def metadata_create(): """Create metadata and create a bundle with it.""" # Create a bundle with metadata. # Note that all examp...
"""HTML utilities suitable for global use.""" from __future__ import unicode_literals import re from django.utils import six from django.utils.encoding import force_str, force_text from django.utils.functional import keep_lazy, keep_lazy_text from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS from dj...
import wiz_product_default_location import wiz_product_default_location_line import wizard_pdl_assign
"""Package Alias admin handler.""" import httplib import json from simian.mac import admin from simian.mac import common from simian.mac import models from simian.mac.common import auth class PackageAlias(admin.AdminHandler): """Handler for /admin/package_alias.""" @admin.AdminHandler.XsrfProtected('manifests_...
from msrest.serialization import Model class TroubleshootingResult(Model): """Troubleshooting information gained from specified resource. :param start_time: The start time of the troubleshooting. :type start_time: datetime :param end_time: The end time of the troubleshooting. :type end_time: date...
from nova.tests.integrated.v3 import test_servers class ServersIpsJsonTest(test_servers.ServersSampleBase): extends_name = 'core_only' sample_dir = 'server-ips' def test_get(self): # Test getting a server's IP information. uuid = self._post_server() response = self._do_get('server...
""" This is an example of integrating curses with the twisted underlying select loop. Most of what is in this is insignificant -- the main piece of interest is the 'CursesStdIO' class. This class acts as file-descriptor 0, and is scheduled with the twisted select loop via reactor....
""" Stub implementation of XQueue for acceptance tests. Configuration values: "default" (dict): Default response to be sent to LMS as a grade for a submission "<submission>" (dict): Grade response to return for submissions containing the text <submission> "register_submission_url" (str): URL to send grader...
from __future__ import absolute_import import stix import stix.bindings.stix_common as common_binding import stix.bindings.stix_core as core_binding from .vocabs import VocabString from .information_source import InformationSource from .confidence import Confidence class GenericRelationship(stix.Entity): _namespa...
microcode = ''' def macroop PEXTRW_R_MMX_I { mov2int reg, mmxm, "IMMEDIATE & mask(2)", size=2, ext=0 }; def macroop PINSRW_MMX_R_I { mov2fp mmx, regm, "IMMEDIATE & mask(2)", size=2, ext=0 }; def macroop PINSRW_MMX_M_I { ld t1, seg, sib, disp, dataSize=2 mov2fp mmx, t1, "IMMEDIATE & mask(2)", size=2, e...
import inspect import importlib import os.path from urlparse import urlunsplit """ * adds github_link(mode) context variable: provides URL (in relevant mode) of current document on github * if sphinx.ext.linkcode is enabled, automatically generates github linkcode links (by setting config.linkcode_resolve) Settin...
# -*- coding: utf-8 -*- from __future__ import absolute_import """ oauthlib.oauth1.rfc5849 ~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 1.0 RFC 5849 requests. """ import logging import urlparse from oauthlib.common import Request, urlencode from . import par...
import GemRB from GUIDefines import * import GUICommon import CharGenCommon #import from a character sheet ImportWindow = 0 TextAreaControl = 0 def OnLoad(): global ImportWindow, TextAreaControl GemRB.LoadWindowPack("GUICG", 640, 480) ImportWindow = GemRB.LoadWindow(20) GUICommon.CloseOtherWindow(ImportWindow.U...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_initial'), (...
"""Tests for the NetworkDataGenerator class.""" import os import pandas import random import unittest from fluent.utils.network_data_generator import NetworkDataGenerator from nupic.data.file_record_stream import FileRecordStream try: import simplejson as json except: import json class NetworkDataGeneratorTes...
#!/usr/bin/python # -*- coding: utf-8 -*- # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type """ (c) 2018, Milan Ilic <<EMAIL>> This file is part of Ansible Ansible is free software: you can redistribute it and/or modify it under the terms of the G...
################################################################# # AlignTool.py # Written by Yi-Hong Lin, <EMAIL>, 2004 ################################################################# from direct.tkwidgets.AppShell import * from direct.showbase.TkGlobal import * class AlignTool(AppShell): #####################...
"""Tests for distutils.log""" import sys import unittest from tempfile import NamedTemporaryFile from test.support import run_unittest from distutils import log class TestLog(unittest.TestCase): def test_non_ascii(self): # Issue #8663: test that non-ASCII text is escaped with # backslashreplace e...
import logging import time import uuid from apiclient.discovery import build from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook class _DataProcJob: def __init__(self, dataproc_api, project_id, job): self.dataproc_api = dataproc_api self.project_id = project_id self.j...
"""Interface for package data stored in the "data" folder, providing methods to both resolve and load data. For Pyroclast servers, this module supports importing and serving data files contained in (or under) this directory. """ import os import shutil def get_path(data_path): """Returns the absolute path to t...
from pycoinnet.util.debug_help import asyncio import hashlib from pycoin.tx.Tx import Tx, TxIn, TxOut from pycoinnet.InvItem import InvItem, ITEM_TYPE_TX, ITEM_TYPE_BLOCK from pycoinnet.helpers import standards from pycoinnet.peer.BitcoinPeerProtocol import BitcoinPeerProtocol, BitcoinProtocolError from pycoinnet.pee...
import sublime import sublime_plugin import os import time from .rust import (messages, rust_proc, rust_thread, util, target_detect, cargo_settings, semver, log) """On-save syntax checking. This contains the code for displaying message phantoms for errors/warnings whenever you save a Rust file. ""...
import nmrglue as ng import numpy as np import tempfile import os import shutil import glob from numpy.testing import assert_array_equal # subroutines def dic_similar(dic1,dic2): if dic1.keys() != dic2.keys(): print "Not same keys!" assert dic1.keys() == dic2.keys() for key in dic1.keys(): ...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsDataItemProviderRegistry .. note:: 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 2 of the License, or (at your option) any later ver...
import sys import _jpype from . import _jclass from . import _jarray from . import _jwrapper from . import _jproxy from . import _jexception from . import _jcollection from . import _jobject from . import _properties from . import nio from . import reflect from . import _refdaemon _usePythonThreadForDaemon = False ...
""" /*************************************************************************** Plugin Installer module Plugin version comparison functions ------------------- Date : 2008-11-24 Copyright : (C) 2008 by Borys...
from __future__ import division from math import cos, pi, sqrt from random import choice, uniform from shapeworld.util import quadratic_uniform from shapeworld.world import Point golden_ratio = sqrt(5.0) / 2.0 - 0.5 sqrt34 = sqrt(0.75) cos18 = cos(0.1 * pi) cos45 = sqrt(2.0) / 2.0 empirical_distortion_multiplier = 0...
#################################################################### # This code is PCA base face recognition programme. It reads 5 # faces from ORL database and the rest 5 are used as test. # PCA_Performance shows the recognition performance. # # Download the ORL database from internet. # This code was modified by...
from oslo_db import exception as db_exc import testtools from neutron.db import api as db_api from neutron.tests import base class TestExceptionToRetryContextManager(base.BaseTestCase): def test_translates_single_exception(self): with testtools.ExpectedException(db_exc.RetryRequest): with db...
__author__ = '<EMAIL> (Jeff Scudder)' import os import StringIO import urlparse import urllib import httplib class Error(Exception): pass class UnknownSize(Error): pass class ProxyError(Error): pass MIME_BOUNDARY = 'END_OF_PART' class HttpRequest(object): """Contains all of the parameters for an HTT...
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE VARCHAR2 = VARCHAR class AShareholdersmeeting(BaseModel): """ 4.101 中国A股召开股东大会 Attributes ---------- object_id: VARCHAR2(100) 对象ID s_info_windcode: VARCHAR2(40) Win...
"""Unit tests for the contents of parallelizer.py.""" # pylint: disable=W0212 # pylint: disable=W0613 import os import tempfile import time import unittest from pylib.utils import parallelizer class ParallelizerTestObject(object): """Class used to test parallelizer.Parallelizer.""" parallel = parallelizer.Par...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.python.platform import numpy as np import tensorflow as tf class SparseMaskTest(tf.test.TestCase): def testBasic(self): values = np.random.rand(4, 4).astype(np.single) indices = ...
# -*- coding: utf-8 -*- import datetime import tempfile import os from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models class Section(m...
import sale_mrp # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
from flask import Blueprint from flask import render_template from app.helpers.data_getter import DataGetter from app.helpers.ticketing import TicketingManager my_tickets = Blueprint('my_tickets', __name__, url_prefix='/mytickets') @my_tickets.route('/') def display_my_tickets(): page_content = {"tab_upcoming_e...
# coding=utf-8 """ Exports data from optparse or argparse based manage.py commands and reports it to _xml.XmlDumper. This module encapsulates Django semi-public API knowledge, and not very stable because of it. Optional env var ``_PYCHARM_DJANGO_DEFAULT_TIMEOUT`` sets timeout (in seconds) to wait for each command to be...
#!/usr/bin/env python from __future__ import absolute_import, print_function, division from future.utils import with_metaclass import abc from opsimsummary import Tiling, HealpixTiles from analyzeSN import LightCurve from .universe import Universe from .paramDistribution import SimpleSALTDist import os import numpy as...
# -*- coding: utf-8 -*- # """ ORCA Open Remote Control Application Copyright (C) 2013-2020 Carsten Thielepape Please contact me by : http://www.orca-remote.org/ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
import sys from twisted.internet import reactor from twisted.python import log from autobahn.twisted.websocket import WebSocketClientFactory, \ WebSocketClientProtocol, \ connectWS from autobahn.websocket.compress import PerMessageDeflateOffer, \ PerMessageDeflateResponse, \ PerMessageDeflateResponse...