content
stringlengths
4
20k
from node import hex import patch, util, error import hbisect # This helper class allows us to handle both: # "{files}" (legacy command-line-specific list hack) and # "{files % '{file}\n'}" (hgweb-style with inlining and function support) class _hybrid(object): def __init__(self, gen, values, joinfmt=None): ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import time import json from collections import MutableMapping from ansible.module_utils._text import to_bytes from ansible.plugins.callback import CallbackBase # NOTE: in Ansible 1.2 or later general logging is availa...
"""Nearest Neighbor Regression""" # Authors: Jake Vanderplas <<EMAIL>> # Fabian Pedregosa <<EMAIL>> # Alexandre Gramfort <<EMAIL>> # Sparseness support by Lars Buitinck <<EMAIL>> # Multi-output support by Arnaud Joly <<EMAIL>> # # License: BSD 3 clause (C) INRIA, University of Amste...
"""Support for working directly with ethernet frames""" import struct from twisted.internet import protocol from twisted.pair import raw from zope.interface import implements, Interface class IEthernetProtocol(Interface): """An interface for protocols that handle Ethernet frames""" def addProto(): ...
from collections import namedtuple import fractions class DataType(object): """ABC for Lisp Datatypes. We do not guarantee that all Lisp data inherrits from DataType. """ class Fraction(DataType, fractions.Fraction): def __repr__(self): if self.denominator == 1: print 'NUM %s' % ...
from Screens.Screen import Screen from Components.Sources.CurrentService import CurrentService from Components.Sources.EventInfo import EventInfo from Components.Sources.FrontendStatus import FrontendStatus from Components.Sources.FrontendInfo import FrontendInfo from Components.Sources.Source import Source from Compon...
#!/usr/bin/env python import re import sys import hashlib import subprocess as sp import numpy as np debug = False typ1 = np.dtype([('name', 'a50'), ('beg', 'i'), ('end', 'i'), ('type', 'a4')]) # starts with spaces or spaces and one of { 'end', 'pure', ... } # if function it can have a type next goes subroutine or f...
#!/usr/bin/env python # This example demonstrates cell picking using vtkCellPicker. It # displays the results of picking using a vtkTextMapper. from __future__ import print_function import vtk # create a sphere source, mapper, and actor sphere = vtk.vtkSphereSource() sphereMapper = vtk.vtkPolyDataMapper() sphereMap...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'MainWindow.ui' # # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): ...
import copy as cp import logging import lib.const as C import lib.visit as v from .. import util from ..meta import class_lookup from ..meta.template import Template from ..meta.clazz import Clazz from ..meta.method import Method from ..meta.field import Field from ..meta.statement import Statement, to_statements fro...
""" Tests pyamf.util.imports @since: 0.3.1 """ import unittest import sys import os.path from pyamf.util import imports class InstalledTestCase(unittest.TestCase): """ Tests to ensure that L{imports.finder} is installed in L{sys.meta_path} """ def test_installed(self): f = imports.finder ...
import mango import unittest TEST_DOCS = [ { "type": "complex_key", "title": "normal key" }, { "type": "complex_key", "title": "key with dot", "dot.key": "dot's value", "none": { "dot": "none dot's value" }, "name.first" : "Kvothe"...
"""Test cases for sqlite-specific logic""" from nova import test from sqlalchemy import create_engine from sqlalchemy import Column, BigInteger, String import sqlalchemy.engine.reflection from sqlalchemy.ext.declarative import declarative_base class TestSqlite(test.NoDBTestCase): """Tests for sqlite-specific log...
from django import VERSION as django_version if django_version >= (1, 5, 0): import json else: from django.utils import simplejson as json from django.http import HttpResponseNotAllowed, HttpResponseServerError from util import to_json_response from util import to_dojo_data try: from functools import wrap...
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 GetAudio(Choreography): def __init__(self, temboo_session): """ Create a new ...
"""Tests for ragged_string_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized from tensorflow.python.framework import tensor_shape from tensorflow.python.framework import test_util from tensorflow.python.ops.ragged...
import os import sys import platform import stat import tarfile import tempfile import shutil import subprocess import hashlib try: # Attempt to load python 3 module from urllib.request import urlopen except ImportError: # Import python 2 version from urllib2 import urlopen try: # Rename raw_input ...
import argparse import sys from time import sleep from Bio import Entrez from Bio import SeqIO import urllib # Not very DRY, but, I think this will get the job done and be easy to read/alter for anyone in the future. def do_multi(user_input,db,sleep_amt,ret_type): """ Formats a multi-fasta/gbk """ acc_list = ...
from road import Road import csv import math class Roads(): def __init__(self,roadsList): self.roads =[] for itr in roadsList: self.roads.append(Road(itr[0],itr[1],itr[2],itr[3],itr[4],itr[5],itr[6], itr[7], itr[8])) def SignalCheck(self,itr): if (itr+1)%20 == 0: #check itr logic ...
from BirdsEyeView import BirdsEyeView from glob import glob import os,sys import cv2 # OpenCV ######################################################################### # function that does the transformation: Image --> BirdsEyeView ######################################################################### def main(data...
from __future__ import with_statement from google.appengine.api import files, images from google.appengine.ext import blobstore, deferred from google.appengine.ext.webapp import blobstore_handlers import json import re import urllib import webapp2 WEBSITE = 'http://blueimp.github.io/jQuery-File-Upload/' MIN_FILE_SIZE ...
# # (c) Simon Marlow 2002 # import sys import os import string import getopt import platform import time import re # We don't actually need subprocess in runtests.py, but: # * We do need it in testlibs.py # * We can't import testlibs.py until after we have imported ctypes # * If we import ctypes before subprocess on...
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.db.models import F from django.test import TestCase from .models import Article, Author, Reference class OrderingTests(TestCase): def setUp(self): self.a1 = Article.objects.create( ...
"""distutils.command.install_headers Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.""" from distutils.core import Command # XXX force is never used class install_headers(Command): description = "install C/C++ header files" user_options = ...
#! /usr/bin/env python3 """Test script for the dumbdbm module Original by Roger E. Masse """ import io import os import unittest import dbm.dumb as dumbdbm from test import support _fname = support.TESTFN def _delete_files(): for ext in [".dir", ".dat", ".bak"]: try: os.unlink(_fname + ext...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'core'} import grp from ansible.module_utils.basic import AnsibleModule, load_platform_subclass ...
from __future__ import print_function from __future__ import unicode_literals from localization import N_ from outputable import Outputable from changes import FileDiff import comment import filtering import interval import re import subprocess __metric_eloc__ = {"java": 500, "c": 500, "cpp": 500, "h": 300, "hpp": 300...
from urllib import urlencode from django.utils import simplejson from social_auth.backends import BaseOAuth2, OAuthBackend, USERNAME from social_auth.utils import dsa_urlopen INSTAGRAM_SERVER = 'instagram.com' INSTAGRAM_AUTHORIZATION_URL = 'https://instagram.com/oauth/authorize' INSTAGRAM_ACCESS_TOKEN_URL = 'https:...
"Test posix functions" from test import test_support try: import posix except ImportError: raise test_support.TestSkipped, "posix is not available" import time import os import pwd import shutil import unittest import warnings warnings.filterwarnings('ignore', '.* potential security risk .*', ...
import mock from nova import db from nova import exception from nova.objects import flavor as flavor_obj from nova.tests.unit.objects import test_objects fake_flavor = { 'created_at': None, 'updated_at': None, 'deleted_at': None, 'deleted': 0, 'id': 1, 'name': 'm1.foo', 'memory_mb': 1024,...
import contextlib from oslo_config import cfg from oslo_db.sqlalchemy import session from sqlalchemy import exc _FACADE = None MAX_RETRIES = 10 def _create_facade_lazily(): global _FACADE if _FACADE is None: _FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite_fk=True) return _FACADE ...
#!/usr/bin/env python from Acspy.Nc.CommonNC import CommonNC from Acspy.Nc.Supplier import Supplier import datacapEx from datacapEx import ExecBlockProcessedEvent, DataCapturerId, ExecBlockStartedEvent, ScanStartedEvent import asdmEX s = Supplier('pyTest-NC') name = 'DATACAP1' s.publishEvent(name) ses...
import mock import testtools from openstack.compute.v2 import limits ABSOLUTE_LIMITS = { "maxImageMeta": 128, "maxPersonality": 5, "maxPersonalitySize": 10240, "maxSecurityGroupRules": 20, "maxSecurityGroups": 10, "maxServerMeta": 128, "maxTotalCores": 20, "maxTotalFloatingIps": 10, ...
import time import datetime from struct import Struct from itertools import izip from stormed import method from stormed.message import ContentHeader, Message def parse_fields(fields, data): vals = [] offset = 0 bit_parser = None for f in fields: if f == 'bit': if bit_parser is Non...
''' Downloads and extracts elasticsearch for backwards compatibility tests. ''' import argparse import os import platform import shutil import subprocess import urllib.request import zipfile def parse_config(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--path', metavar='DIR', defa...
import nose import ckan.model as core_model import ckan.logic as logic import ckan.new_tests.helpers as helpers import ckan.logic.auth as logic_auth class TestGetObjectErrors(object): def _get_function(self, obj_type): _get_object_functions = { 'package': logic_auth.get_package_object, ...
import os import multiprocessing as mp import numpy as np import sys if sys.version_info[0] > 2: # In Py3, range corresponds to Py2 xrange xrange = range class mp_eval(object): def __init__(self,function,num_procs=None): self.__name__ = function.__name__ tasks = m...
"""The rescue mode extension.""" import webob from webob import exc from nova import compute from nova import log as logging from nova.api.openstack import extensions as exts from nova.api.openstack import faults LOG = logging.getLogger("nova.api.contrib.rescue") def wrap_errors(fn): """"Ensure errors are not...
import sys import unittest from PySide2.QtCore import QItemSelection from PySide2.QtGui import QStandardItemModel, QStandardItem from PySide2.QtWidgets import QApplication class Bug324(unittest.TestCase): def testOperators(self): model = QStandardItemModel() for i in range(100): model.a...
import re from rootpy import ROOT from rootpy.io import root_open from aligenqa import roofie, utils def _reduce_single_canvases(results_dirs, gen_names, get_canvas_func, legend_regex): fig_comp = roofie.Figure() for i, (result_dir, marker) in enumerate(zip(results_dirs, ['opendiamond', 'cross'])): ...
from gnuradio import gr, gru, eng_notation, optfir from gnuradio import audio from gnuradio import usrp from gnuradio import blks2 from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2 from optparse import OptionParser from...
from taiga.base.api import serializers from taiga.base.fields import JsonField, I18NJsonField from . import models HISTORY_ENTRY_I18N_FIELDS=("points", "status", "severity", "priority", "type") class HistoryEntrySerializer(serializers.ModelSerializer): diff = JsonField() snapshot = JsonField() values = I...
from shinken_test import * class TestConfig(ShinkenTest): def setUp(self): self.setup_with_file('etc/shinken_1r_1h_1s.cfg') def test_dummy(self): # # Config is not correct because of a wrong relative path # in the main config file # print "Get the hosts and se...
from random import Random import os import re import sys import numpy as np from operator import itemgetter from PIL import Image from PIL import ImageDraw from PIL import ImageFont from .query_integral_image import query_integral_image item1 = itemgetter(1) FONT_PATH = os.environ.get("FONT_PATH", "/usr/share/fonts/...
#!/usr/bin/env python2.6 import sys '''watch a telemetry log and show how many databursts are outstanding over time TTT 1393979427248973000 ffffffff messages_in = 68751 TTT 1393979427249019000 ffffffff acks_received_from_upstream = 68722 ''' from datetime import datetime import time import select def outstanding_d...
from __future__ import print_function import sys import yaml import os import re import subprocess errors = 0 os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..')) # hack import paths to pick up extra code sys.path.insert(0, os.path.abspath('tools/buildgen/plugins')) from expand_version import Version t...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: Mcl_Cmd_GetAdmin_DataHandler.py def DataHandlerMain(namespace, InputFilename, OutputFilename): import mcl.imports import mcl.data.Input ...
from odoo import http, _ from odoo.http import request class WebsitePayment(http.Controller): @http.route(['/my/payment_method'], type='http', auth="user", website=True) def payment_method(self, **kwargs): acquirers = list(request.env['payment.acquirer'].search([('website_published', '=', True), ('reg...
"""Transport - HTTP client library support. :mod:`google.auth` is designed to work with various HTTP client libraries such as urllib3 and requests. In order to work across these libraries with different interfaces some abstraction is needed. This module provides two interfaces that are implemented by transport adapte...
import os import argparse from codecs import open import re import subprocess from bs4 import BeautifulSoup import s2p from s2p import common def tmpfile(ext='', tmpdir='tmp'): """ Creates a temporary file in the cfg['temporary_dir'] directory. Args: ext: desired file extension. The dot has to ...
#!/usr/bin/env python from tools.load import LoadMatrix import shogun as sg lm=LoadMatrix() traindna = lm.load_dna('../data/fm_train_dna.dat') testdna = lm.load_dna('../data/fm_test_dna.dat') parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,3,0,False]] def distance_canberraword (fm_train_dna=traindn...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 17-7-22 上午12:41 # @Author : tom.lee # @docs : http://old.sebug.net/paper/books/scipydoc/numpy_intro.html # @File : study_numpy.py # @Software: PyCharm """ numpy Numpy是Python的一个科学计算的库,提供了矩阵运算的功能,其一般与Scipy,matplotlib一起使用. NumPy提供了两种基本的对象: ndarray(N-d...
import boto from boto.sdb.db.property import StringProperty, DateTimeProperty, IntegerProperty from boto.sdb.db.model import Model import datetime, subprocess, time from boto.compat import StringIO def check_hour(val): if val == '*': return if int(val) < 0 or int(val) > 23: raise ValueError cl...
from dcbase.apps import TIMEZONE_SESSION_KEY from django.utils.timezone import get_current_timezone from dcbase.models import UserProfile from dcbase.tests.unit import UnitTestCase from django.utils import translation from django.utils.translation import LANGUAGE_SESSION_KEY class TestUserProfile(UnitTestCase): d...
""" Defines exception classes to handle server connection and request exceptions """ from gettext import gettext as _ class RequestException(Exception): """ Base exception class for all exceptions that originate by the Pulp server. These exceptions coming from the server use the standard exception struct...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest from automation_tools.satellite6.log import LogAnalyzer @pytest.fixture(autouse=True) def execute(mocker): """Mock fabric's execute function to avoid call through network""" execute_mock = mocker.patch('automation_tools.satellite6...
try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__)
""" Download script for the unlabeled version of the MNIST dataset, used in On the Quantitative Analysis of Deep Belief Networks Salakhutdinov and Murray http://www.mit.edu/~rsalakhu/papers/dbn_ais.pdf The MNIST database of handwritten digits LeCun and Cortes http://yann.lecun.com/exdb/mnist/ "...
import os import unittest from telemetry import value from telemetry.page import page_set from telemetry.value import list_of_scalar_values class TestBase(unittest.TestCase): def setUp(self): self.page_set = page_set.PageSet.FromDict({ "description": "hello", "archive_path": "foo.wpr", "pages...
import logging from django.utils.translation import ugettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions from horizon import forms from horizon import workflows from openstack_dashboard.api import network from openstack_dashboard.api import sahara as saharaclient from opens...
from MultipleLocationEntity import MultipleLocationEntity from common.ResolveableInformation import TypeReference ## # Encapsulation of data necessary to refer to an entity. # The idea is to replace all low-level data from Entities # by an instance of an EntityReference (or its future subclasses). ## class EntityRefer...
from openerp.osv import fields, osv from openerp.tools.translate import _ LANG_CODE_MAPPING = { 'ar_SY': ('ar', 'Arabic'), 'id_ID': ('id', 'Indonesian'), 'nl_NL': ('nl', 'Dutch'), 'fr_CA': ('fr-ca', 'French (Canada)'), 'pl_PL': ('pl', 'Polish'), 'zh_TW': ('zh-tw', 'Chinese (Traditional)'), ...
import datetime import uuid as stdlib_uuid from oslo_policy import policy as oslo_policy from oslo_utils import timeutils import webob from nova.api.openstack.compute import consoles as consoles_v21 from nova.compute import vm_states from nova import exception from nova import policy from nova import test from nova.t...
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 = 'textbox15.xlsx' ...
"""Sharded mutable dense hash table.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range from tensorflow.contrib import lookup from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensor...
"""This module is deprecated. Please use `airflow.providers.apache.hdfs.sensors.web_hdfs`.""" import warnings # pylint: disable=unused-import from airflow.providers.apache.hdfs.sensors.web_hdfs import WebHdfsSensor # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.apache.hdfs.senso...
''' Fourier-transform blocks and related functions. ''' import os try: from fft_swig import * except ImportError: dirname, filename = os.path.split(os.path.abspath(__file__)) __path__.append(os.path.join(dirname, "..", "..", "swig")) from fft_swig import *
# -*- coding: utf-8 -*- """ Basic ColdfusionHtmlLexer Test ~~~~~~~~~~~~~~~~~ :copyright: Copyright 2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import unittest import os from pygments.token import Token from pygments.lexers import ColdfusionHtmlLexer class Col...
try: from urllib.parse import urlencode except ImportError: from urllib import urlencode from .filepost import encode_multipart_formdata __all__ = ['RequestMethods'] class RequestMethods(object): """ Convenience mixin for classes who implement a :meth:`urlopen` method, such as :class:`~urllib3....
import os import gtk import re import urllib import pkgutil from pygtkhelpers.gthreads import GeneratorTask, gcall from pygtkhelpers.ui.objectlist import ObjectList, Column # PIDA Imports from pida.core.environment import home from pida.core.service import Service from pida.core.actions import ActionsConfig from pida...
import pygame import os from OpenGL.GL import * from OpenGL.GL.ARB.multisample import * from PIL import Image import Log import struct from Language import _ class Video: def __init__(self, caption = "Game", icon = None): self.screen = None self.caption = caption self.icon = icon s...
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
from django.views.generic import ListView, DetailView from django.db.models import Q from oscar_sagepay import models from . import forms class Transactions(ListView): model = models.RequestResponse context_object_name = 'transactions' template_name = 'sagepay/dashboard/request_list.html' paginate_by...
source("../../shared/qtcreator.py") def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return for targ, qVer in [[Targets.DESKTOP_480_GCC, "1.1"], [Targets.DESKTOP_521_DEFAULT, "2.1"], [Targets.DESKTOP_521_DEFAULT, "2.2"]]: # ...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer. .. 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 version. """ __autho...
""" MUSE -- A Multi-algorithm-collaborative Universal Structure-prediction Environment Copyright (C) 2010-2017 by Zhong-Li Liu 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 version 2 of ...
""" Test the change_enrollment command line script.""" import ddt from mock import patch from django.core.management import call_command from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from student.tests.factories import UserF...
"""Contains extensions to Atom objects used with Google Analytics.""" __author__ = 'api.suryasev (Sal Uryasev)' import atom import gdata GAN_NAMESPACE = 'http://schemas.google.com/analytics/2009' class TableId(gdata.GDataEntry): """tableId element.""" _tag = 'tableId' _namespace = GAN_NAMESPACE class Prope...
# -*- coding: utf-8 -*- """Shared functionality for JSON based output modules.""" import json from plaso.lib import errors from plaso.output import dynamic from plaso.output import formatting_helper from plaso.serializer import json_serializer class JSONEventFormattingHelper(formatting_helper.EventFormattingHelper)...
# Hack to prevent stupid error on exit of `python setup.py test`. (See # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html.) try: import multiprocessing # noqa except ImportError: pass from re import sub from setuptools import setup, find_packages def get_long_description(): # Fix display iss...
{ 'name': 'Documentation', 'category': 'Website', 'summary': 'Forum, Documentation', 'version': '1.0', 'description': """ Documentation based on question and pertinent answers of Forum """, 'author': 'OpenERP SA', 'depends': [ 'website_forum' ], 'data': [ 'dat...
import sqlalchemy as sql from keystone.common import sql as ks_sql WHITELIST_TABLE = 'whitelisted_config' SENSITIVE_TABLE = 'sensitive_config' def upgrade(migrate_engine): meta = sql.MetaData() meta.bind = migrate_engine whitelist_table = sql.Table( WHITELIST_TABLE, meta, sql.C...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import os import shutil import time from ansible.module_utils.basic import AnsibleModule ...
import json import copy import collections class QueryError(Exception): '''Query error base class''' def __init__(self, message, status_code=None): super(QueryError, self).__init__(message) if status_code: self.status_code = status_code class QueryResourceDoesNotExist(QueryError...
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-style-property-011 ~ 020 which cover all possible values of text-emphasis-style property, except none and <string>, with horizontal writing mode. It outputs a list of all tests it generated in the format of Mozilla reftest....
import unittest import socket import threading from nose.plugins.skip import SkipTest from tornado import ioloop, web from dummyserver.server import ( SocketServerThread, run_tornado_app, run_loop_in_thread, DEFAULT_CERTS, ) from dummyserver.handlers import TestingApp from dummyserver.proxy import Prox...
# -*- coding: utf-8 -*- __author__ = 'sandlbn' from django import template from django.template.loader import render_to_string from django_bootstrap_calendar.utils import MinifyJs register = template.Library() @register.simple_tag def bootstrap_calendar(css_classes): """ return a calendar div if none push e...
#!/usr/bin/env python '''Test that mouse cursor can be set to a platform-dependent image. Expected behaviour: One window will be opened. Press the left and right arrow keys to cycle through the system mouse cursors. The current cursor selected will be printed to the terminal. Note that not all curs...
from __future__ import absolute_import, print_function import json import sys from subprocess import Popen, PIPE TEST_CMD = [ "./mach", "test-wpt", "--release", "--processes=24", "--binary-arg=--random-pipeline-closure-probability=0.1", "--binary-arg=--random-pipeline-closure-seed=123", "...
# -*- coding: utf-8 -*- ''' Manage Route53 records .. versionadded:: 2014.7.0 Create and delete Route53 records. Be aware that this interacts with Amazon's services, and so may incur charges. This module uses ``boto``, which can be installed via package, or pip. This module accepts explicit route53 credentials but ...
# -*- coding: utf-8 -*- """ pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" cod...
"""Compressed Sparse Row matrix format""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['csr_matrix', 'isspmatrix_csr'] import numpy as np from scipy._lib.six import xrange from .base import spmatrix from ._sparsetools import csr_tocsc, csr_tobs...
"""Python wrapper for Amazon web APIs This module allows you to access Amazon's web APIs, to do things like search Amazon and get the results programmatically. Described here: http://www.amazon.com/webservices You need a Amazon-provided license key to use these services. Follow the link above to get one. These f...
# -*- coding: utf-8 -*- """ pluginbase ~~~~~~~~~~ Pluginbase is a module for Python that provides a system for building plugin based applications. :copyright: (c) Copyright 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from pydevd_constants impo...
from __future__ import print_function import unittest from nose.plugins.skip import SkipTest import numpy import theano # Skip test if cuda_ndarray is not available. from nose.plugins.skip import SkipTest import theano.sandbox.cuda as cuda_ndarray if cuda_ndarray.cuda_available == False: raise SkipTest('Opti...
# -*- coding: utf-8 -*- """ pygments.lexers._stan_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names of functions for Stan used by ``pygments.lexers.math.StanLexer. This is for Stan language version 2.8.0. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :li...
import uproot import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm shift_list = [[1, -2], [2, -1], [3, 1], [4, 2]] dcaxy_list = [[0, 1.0], [1, 1.4]] dcaz_list = [[0, 0.5], [1, 0.75], [2, 1.25], [3, 1.50]] pid_list = [[0, 3.25], [1, 3.5]] tpc_list = [[0, 60], [1, 65], [2, 75]...
import mock from odoo.addons.connector_carepoint.unit import backend_adapter from .common import SetUpCarepointBase model = 'odoo.addons.connector_carepoint.unit.backend_adapter' class TestBackendAdapter(SetUpCarepointBase): def setUp(self): super(TestBackendAdapter, self).setUp() self.Model ...
import logging from django.conf import settings from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.migrations.executor import MigrationExecutor from health_check.backends import BaseHealthCheckBackend from health_check.exceptions import ServiceUnavailable logger = logging.getLogger(__n...
from __future__ import unicode_literals from .cbs import CBSBaseIE class CBSSportsIE(CBSBaseIE): _VALID_URL = r'https?://(?:www\.)?cbssports\.com/video/player/[^/]+/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.cbssports.com/video/player/videos/708337219968/0/ben-simmons-the-next-lebron?-not-so-fast',...