content
string
from utils import Filehandler from ConfigParser import SafeConfigParser import re class PostboxFunctions(object): def __init__(self): self.fhandler = Filehandler() def help(self, channel, callback, msg=None, nck=None, hq=None, keys=None, **kwargs): helpmsg = "!tell <user> - Store message in <...
import pytest from framework.auth import Auth from osf.models import NodeLog from api.logs.serializers import NodeLogSerializer from osf_tests.factories import ProjectFactory, UserFactory from tests.utils import make_drf_request_with_version pytestmark = pytest.mark.django_db class TestNodeLogSerializer: # Regr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from pg_fts.fields import TSVectorField from django.db import models @python_2_unicode_compatible class TSQueryModel(models.Model): title = models.CharField(max_length=50) body = mode...
""" Make sure msvs_large_pdb works correctly. """ import TestGyp import struct import sys CHDIR = 'large-pdb' def CheckImageAndPdb(test, image_basename, expected_page_size, pdb_basename=None): if not pdb_basename: pdb_basename = image_basename + '.pdb' test.built_file_must_exist(image...
import os import sys import periphery from .test import ptest, pokay, passert, AssertRaises if sys.version_info[0] == 3: raw_input = input spi_device = None def test_arguments(): ptest() # Invalid mode with AssertRaises("invalid mode", ValueError): periphery.SPI("/dev/spidev0.0", 4, int(1...
"""Main entry point into the Identity service.""" import abc import six from keystone.common import dependency from keystone.common import manager from keystone import config from keystone import exception from keystone.i18n import _ from keystone import notifications from keystone.openstack.common import log CONF...
"""SCons.Tool.c++ Tool-specific initialization for generic Posix C++ compilers. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons...
""" Base class for objects that live in both Python and JS. This basically implements the syncing of signals. """ import sys import json import weakref import hashlib from .. import react from ..react.hassignals import HasSignalsMeta, with_metaclass from ..react.pyscript import create_js_signals_class, HasSignalsJS ...
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand class Command(TemplateCommand): help = ("Creates a Django app directory structure for the given app " "name in the current directory or optionally in t...
# coding=utf-8 """ Save stats in RRD files using rrdtool. """ import os import re import subprocess import Queue from Handler import Handler # # Constants for RRD file creation. # # NOTE: We default to the collectd RRD directory # simply as a compatibility tool. Users that have # tools that look in that location a...
''' Organizes a java source file's import statements in a way that pleases Apache Aurora's checkstyle configuration. This expects exactly one argument: the name of the file to modify with preferred import ordering. ''' from __future__ import print_function import re import sys from collections import defaultdict IM...
from widgetastic.widget import Image from widgetastic.widget import Text from widgetastic.widget import View class LinksView(View): """ Widgets for all of the links on the documentation page Each doc link is an anchor with a child image element, then an anchor with text Both the image and the text anc...
"""Tools for helping with testing capa.""" import gettext import os import os.path import fs.osfs from capa.capa_problem import LoncapaProblem, LoncapaSystem from capa.inputtypes import Status from mock import Mock, MagicMock import xml.sax.saxutils as saxutils TEST_DIR = os.path.dirname(os.path.realpath(__file__)...
""" Definition List Extension for Python-Markdown ============================================= Added parsing of Definition Lists to Python-Markdown. A simple example: Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An american computer company. Orange ...
class ModuleDocFragment(object): # Postgres documentation fragment DOCUMENTATION = """ options: login_user: description: - The username used to authenticate with required: false default: postgres login_password: description: - The password used to authenticate with required: ...
from spotlight.service.util.LibLoader import LibLoader from spotlight.model.GlobalSettings import GlobalSettings settings = GlobalSettings() loader = LibLoader(settings) loader.load_all() xbmc.log("LibLoader sys.path is now %s" % sys.path) from spotlight.service.Server import Server server = Server() server.sta...
import pdb from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape from keras.layers.convolutional import Convolution1D, Convolution2D, MaxPooling2D # from keras.layers.normalization import BatchNormalization # from keras.layers.advanced_activations import LeakyReL...
import numpy as np import tt_eigb from tt import tensor def eigb(A, y0, eps, rmax = 150, nswp = 20, max_full_size = 1000, verb = 1): """ Approximate computation of minimal eigenvalues in tensor train format This function uses alternating least-squares algorithm for the computation of several minimal eigenva...
"""Copyright 2008 Orbitz WorldWide 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 writing, software...
"""Parametric testing on top of twisted.trial.unittest. """ __all__ = ['parametric','Parametric'] from twisted.trial.unittest import TestCase def partial(f, *partial_args, **partial_kwargs): """Generate a partial class method. """ def partial_func(self, *args, **kwargs): dikt = dict(kwargs) ...
from guacamol.utils.chemistry import canonicalize, canonicalize_list, is_valid, \ calculate_internal_pairwise_similarities, calculate_pairwise_similarities, parse_molecular_formula def test_validity_empty_molecule(): smiles = '' assert not is_valid(smiles) def test_validity_incorrect_syntax(): smile...
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, howev...
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='st2actions', version='0.4.0', description='', author='StackStorm', author_email='<EMAIL>', install_r...
from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import GB2312DistributionAnalysis from .mbcssm import GB2312_SM_MODEL class GB2312Prober(MultiByteCharSetProber): def __init__(self): super(GB2312Prober, self).__init__() se...
from __future__ import absolute_import, division, print_function, unicode_literals from os import path from setuptools import setup, find_packages with open(path.join(path.dirname(__file__), 'README.md'), 'r') as fp: long_description = fp.read() setup( name='pylijm', version='1.1b2', description='Py...
''' Created on Oct 31, 2016 @author: David Zwicker <<EMAIL>> ''' import copy class ParameterMixin(object): """ a mixin which manages a dictionary of parameters assigned to classes """ parameters_default = {} def __init__(self, parameters=None, check_validity=True): """ initialize th...
""" Consumes messages from a Amazon Kinesis streams and does wordcount. This example spins up 1 Kinesis Receiver per shard for the given stream. It then starts pulling from the last checkpointed sequence number of the given stream. Usage: kinesis_wordcount_asl.py <app-name> <stream-name> <endpoint-url> <regio...
""" ============================================= Neighborhood Components Analysis Illustration ============================================= An example illustrating the goal of learning a distance metric that maximizes the nearest neighbors classification accuracy. The example is solely for illustration purposes. Ple...
# -*- coding: utf-8 -*- from functools import partial from os import path from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.utils._os import upath from django.utils.translation import ugettext_lazy as _ from django.views import defaults, i18n, static from . import v...
import sys import os import signal try: import PyQt4 except Exception: sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'") from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore from electrum.i18n import _, set_language from el...
from openerp import models, api class ProcurementCompute(models.TransientModel): _inherit = 'procurement.orderpoint.compute' @api.multi def procure_calculation(self): config_param_obj = self.env['ir.config_parameter'] config_param = config_param_obj.search( [('key', '=', 'proc...
"""Helpful routines for regression testing.""" from base64 import b64encode from binascii import unhexlify from decimal import Decimal, ROUND_DOWN from subprocess import CalledProcessError import inspect import json import logging import os import re import time import unittest from . import coverage from .authproxy ...
""" WSGI middleware for OpenStack API controllers. """ from oslo.config import cfg import routes import stevedore import webob.dec import webob.exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import exception from nova.i18n import _ from nova.i18n import _LC from nova.i18n ...
import datetime import os import tempfile import time from uuid import uuid4 import boto from boto.s3.key import Key from funfactory.urlresolvers import reverse from popcoder.popcoder import process_json from django.db import transaction from django.conf import settings from django.utils import timezone from airmozi...
import math import random from gi.repository import GObject as gobject from lib import graphics from lib.pytweener import Easing from lib import game_utils from lib import layout import colors class Label(layout.Label): def __init__(self, *args, **kwargs): layout.Label.__init__(self, *args, **kwargs) ...
""" Manager for dealing with uploading/managing files on Amazon S3 """ from boto.s3.connection import S3Connection from boto.s3.key import Key from seleniumbase.config import settings already_uploaded_files = [] class S3LoggingBucket(object): """ A class to upload log files from tests to Amazon S3. Those...
from __future__ import absolute_import from __future__ import print_function from keras.datasets import mnist from keras.models import Sequential, model_from_config from keras.layers.core import AutoEncoder, Dense, Activation, TimeDistributedDense, Flatten from keras.layers.recurrent import LSTM from keras.layers.embed...
#! /usr/bin/env python # vim: expandtab shiftwidth=4 softtabstop=4 tabstop=17 filetype=python : import unittest from itertools import zip_longest import transaction from caramel.models import ( init_session, DBSession, ) from . import fixtures class ModelTestCase(unittest.TestCase): @classmethod de...
#! /usr/bin/env python from openturns import * from math import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: elementaryFunctions = Description(0) elementaryFunctions.add("sin") elementaryFunctions.add("cos") elementaryFunctions.add("tan") elementaryFunctions.add("asin") elementaryFunction...
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import random import inspect def cv_carsGBM(): # read in the dataset and construct training set (and validation set) cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv")) # choose the type...
""" Copyright (c) 2011, 2012, Regents of the University of California 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 l...
import time from lxml import etree from openerp.osv import fields, osv class asset_modify(osv.osv_memory): _name = 'asset.modify' _description = 'Modify Asset' _columns = { 'name': fields.char('Reason', required=True), 'method_number': fields.integer('Number of Depreciations', required=Tr...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ screen_size property """ from rebulk.remodule import re from rebulk import Rebulk, Rule, RemoveMatch from ..common.validators import seps_surround from ..common import dash def screen_size(): """ Builder for rebulk object. :return: Created Rebulk object ...
""" Generate a report of certificate statuses """ from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from django.db.models import Count from opaque_keys.edx.keys import CourseKey from six import text_type from lms.djangoapps.certificates.models import Generat...
from mock import patch from nose.tools import * import pandas as pd import philharmonic @patch('philharmonic.simulator.simulator.run') def test_explore_ga_weights(mock_run): philharmonic._setup('philharmonic.settings.ga_explore') from philharmonic import conf conf.parameter_space = 'GAWeights' from p...
from collections import defaultdict from django.conf import settings from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\ token_kwargs, Variable from django.template.loader import get_template from django.utils.safestring import mark_safe from django.utils import six register = Library(...
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (<EMAIL>)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section from MOAL.helpers.display import divider from MOAL.helpers.display import print_h4 from MOAL.computer_org...
import json from pyspark import SparkContext, SparkConf def prepare_mark_precomp(data): key = str(data).rstrip() #print("[prepare_mark_precomp] data: {}".format(data)) return [(key, [key, "info", "precomp_sim", "True"])] def mark_precomp_sim(hbase_man_in, hbase_man_out): in_rdd = hbase_man_in.read_h...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # Site information AUTHOR = 'Scott Berrevoets' SITENAME = 'Scott Berrevoets' SITEURL = 'https://scottberrevoets.com' # Show line numbers in code snippets MARKDOWN = { 'extension_configs': { 'markdown.extensions.codehilite': ...
from boto.regioninfo import RegionInfo class EC2RegionInfo(RegionInfo): """ Represents an EC2 Region """ def __init__(self, connection=None, name=None, endpoint=None): from boto.ec2.connection import EC2Connection RegionInfo.__init__(self, connection, name, endpoint, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import gzip import math import os import sys import tarfile import numpy as np from scipy.io import loadmat as loadmat from six.moves import cPickle as pickle from six.moves import urllib from six.moves import...
''' An encryption plugin for Elixir utilizing the excellent PyCrypto library, which can be downloaded here: http://www.amk.ca/python/code/crypto Values for columns that are specified to be encrypted will be transparently encrypted and safely encoded for storage in a unicode column using the powerful and secure Blowfis...
import os.path def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ): """Makes sure that all sources have the specified eol sequence (default: unix).""" if not os.path.isfile( path ): raise ValueError( 'Path "%s" is not a file' % path ) try: f = open(path, 'rb') exce...
""" ========================================= Adapting gray-scale filters to RGB images ========================================= There are many filters that are designed to work with gray-scale images but not with color images. To simplify the process of creating functions that can adapt to RGB images, scikit-image p...
from student.models import CourseEnrollment from django_comment_common.models import Role from courseware.access import has_staff_access_to_preview_mode from course_modes.models import ( get_cosmetic_verified_display_price ) from courseware.date_summary import ( verified_upgrade_deadline_link, verified_upgrade_...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'VotaInteligenteMessage.author_ville' db.add_column(u'elec...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil import sys from pkg_resources import resource_filename from migrate.versioning.config import * from migrate.versioning import pathed class Collection(pathed.Pathed): """A collection of templates of a specific type""" _mask = None de...
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
from .stochastic_gradient import BaseSGDClassifier from .stochastic_gradient import BaseSGDRegressor from .stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDClassifier): """Passive Aggressive Classifier Read more in the :ref:`User Guide <passive_aggressive>`. Parameters...
from copy import deepcopy from zlib import decompress import six from .utilities import is_text_payload, is_json_payload, is_batch_payload, replace_subscription_id class RecordingProcessor(object): def process_request(self, request): # pylint: disable=no-self-use return request def process_response...
from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * class InvalidateTest(BitcoinTestFramework): def setup_chain(self): print("Initializing test directory "+self.options.tmpdir) initialize_chain_clean(se...
class OVSPort(object): def __init__(self, module): self.module = module self.bridge = module.params['bridge'] self.port = module.params['port'] self.state = module.params['state'] self.timeout = module.params['timeout'] def _vsctl(self, command): '''Run ovs-vsctl...
# -*- coding: utf-8 -*- """ tests.api.product_tests ~~~~~~~~~~~~~~~~~~~~~~~ api product tests module """ from ..factories import CategoryFactory, ProductFactory from . import OverholtApiTestCase class ProductApiTestCase(OverholtApiTestCase): def _create_fixtures(self): super(ProductApiTestC...
# -*- coding: utf-8 -*- import unittest from django.conf import settings settings.configure() from debug_toolbar.toolbar import DebugToolbar from django.http import HttpResponse from django.test import RequestFactory from elasticsearch.connection import Connection from elastic_panel import panel class ImportTest(u...
from socket import * import time SOCKET_NAME = '/tmp/osmocom_loader' s = socket(AF_UNIX, SOCK_STREAM) s.connect(SOCKET_NAME) while 1: try: x = raw_input(">") y = len(x) + 1 s.send(chr(y>>8) + chr(y&255) + x + "\n") except: print '' break s.close()
import unittest from urllib3.packages.six.moves import xrange from urllib3.util.retry import Retry from urllib3.exceptions import ( ConnectTimeoutError, ReadTimeoutError, MaxRetryError ) class RetryTest(unittest.TestCase): def test_string(self): """ Retry string representation looks the way ...
#!/usr/bin/env py.test """Unit tests for the solve function""" # Copyright (C) 2011 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either versi...
# -*- coding: utf-8 -*- """Generic feature selection mixin""" # Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman # License: BSD 3 clause from abc import ABCMeta, abstractmethod from warnings import warn import numpy as np from scipy.sparse import issparse, csc_matrix from ..base import TransformerMixin f...
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self): # Changing field 'SoftwareSecurePhotoVerification.window'. Setting its default value to None if db.backend_name == 'mysql': db.execute('ALTER TAB...
"""TensorFlow Learn Utils.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.learn.python.learn.utils.export import export_estimator from tensorflow.contrib.learn.python.learn.utils.input_fn_utils import build_default_serving_input_...
import unittest import os.path import traceback def ConstructionTestCase(Graph): class C(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) self.g = Graph("First graph") def expect(self, dotString): testName = None for...
# -*- coding: utf-8 -*- """ *************************************************************************** ScriptEdit.py --------------------- Date : February 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible.errors import AnsibleError from ansible.plugins.action import ActionBase class ActionModule(ActionBase): TRANSFERS_FILES = False def run(self, tmp=None, task_vars=None): if task_vars is N...
import re from collections import namedtuple from datetime import datetime from enum import Enum, auto from functools import reduce from typing import Iterable, Iterator, List, Optional, Tuple TestResult = namedtuple('TestResult', ['status','suites','log']) class TestSuite(object): def __init__(self) -> None: sel...
#!/usr/bin/python24 import cgi import time import MySQLdb from traceback import format_exception from sys import exc_info from string import split from string import strip from sys import exit from urllib import urlencode import urllib2 DATADIR = "/home/user/data/" PP_URL = "https://www.sandbox.paypal.com/cgi-bin/web...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from six import PY3 from yaml.scanner import ScannerError from ansible.compat.tests import unittest from ansible.compat.tests.mock import patch, mock_open from ansible.errors import AnsibleParserError from ansible.parsing.dataloa...
""" #################### blacktie_pipeline.py #################### Code defining an object oriented python pipeline script to allow simplified coordination of data through parts or all of the popular Tophat/Cufflinks RNA-seq analysis suite. """ import os import sys import argparse import base64 import traceback import...
import unittest import thread_cert from pktverify.consts import MLE_ADVERTISEMENT, MLE_PARENT_REQUEST, MLE_CHILD_ID_RESPONSE, MLE_CHILD_ID_REQUEST, MGMT_ACTIVE_SET_URI, MGMT_ACTIVE_GET_URI, RESPONSE_TLV, LINK_LAYER_FRAME_COUNTER_TLV, MODE_TLV, TIMEOUT_TLV, VERSION_TLV, TLV_REQUEST_TLV, CHALLENGE_TLV, SCAN_MASK_TLV, AD...
from django.core.management.base import BaseCommand from optparse import make_option from geonode.services.models import Service from geonode.services.views import _register_cascaded_service, _register_indexed_service, \ _register_harvested_service, _register_cascaded_layers, _register_indexed_layers import json fr...
from nova import db from nova import objects from nova.objects import base from nova.objects import fields # TODO(berrange): Remove NovaObjectDictCompat @base.NovaObjectRegistry.register class DNSDomain(base.NovaPersistentObject, base.NovaObject, base.NovaObjectDictCompat): # Version 1.0: Initial ...
# Scraper for the United States Court of Appeals for the Seventh Circuit # CourtID: ca7 # Court Short Name: 7th Cir. import time from datetime import date, timedelta import urllib from dateutil.rrule import rrule, DAILY from lxml import html from juriscraper.OpinionSite import OpinionSite class Site(OpinionSite): ...
""" exynos_checkpatch_helper.py - a helper script for exynos_checkpatch.sh Dept : S/W Solution Dev Team Author : Solution3 Power Part Update : 2014.12.08 """ import subprocess as sp import sys def print_log(color, log): colored_log = '' if color == 'r': colored_log = "\033[31m" + log + "\033...
import urllib2 from BeautifulSoup import BeautifulSoup import os HOME = os.getenv("HOME") # Pain to parse but gives more options islamicFinder="http://www.islamicfinder.org/prayerDetail.php?country=usa&city=Cleveland&state=OH&id=18707&month=&year=&email=&home=2012-7-18&lang=&aversion=&athan=&monthly=" # Easy to parse...
import ctypes from pyglet import com lib = ctypes.oledll.dsound DWORD = ctypes.c_uint32 LPDWORD = ctypes.POINTER(DWORD) LONG = ctypes.c_long LPLONG = ctypes.POINTER(LONG) WORD = ctypes.c_uint16 HWND = DWORD LPUNKNOWN = ctypes.c_void_p D3DVALUE = ctypes.c_float PD3DVALUE = ctypes.POINTER(D3DVALUE) class D3DVECTOR(ct...
import contextlib import logging import sys import string import uuid import types from bs4 import BeautifulSoup from django.conf import settings from django.core.exceptions import MiddlewareNotUsed from django.core.urlresolvers import set_urlconf, clear_url_caches, get_urlconf from django.test import override_settin...
""" @name: Modules/House/rooms.py @author: D. Brian Kimmel @contact: <EMAIL> @copyright: (c) 2013-2020 by D. Brian Kimmel @license: MIT License @note: Created on Apr 10, 2013 @summary: Handle the rooms information for a house. """ __updated__ = '2020-02-17' __version_info__ = (19, 10, 5) __version_...
class ModuleDocFragment(object): # Documentation fragment for ProxySQL connectivity CONNECTIVITY = ''' options: login_user: description: - The username used to authenticate to ProxySQL admin interface. login_password: description: - The password used to authenticate to ProxySQL admin in...
#!/usr/bin/env python3 import contextlib import inspect import textwrap from pathlib import Path from typing import List, Type import mitmproxy.addons.next_layer # noqa from mitmproxy import hooks, log, addonmanager from mitmproxy.proxy import server_hooks, layer from mitmproxy.proxy.layers import http, tcp, tls, web...
# -*- coding: utf-8 -*- """ *************************************************************************** TextToFloat.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com *************************...
""" A set of tests for the util.py module """ # LOCAL from astropy.io.votable import util from astropy.tests.helper import raises def test_range_list(): assert util.coerce_range_list_param((5,)) == ("5.0", 1) def test_range_list2(): assert util.coerce_range_list_param((5e-7, 8e-7)) == ("5e-07,8e-07", 2) ...
"""Experimental utilities for tf.feature_column.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=unused-import,line-too-long,wildcard-import from tensorflow.contrib.feature_column.python.feature_column.sequence_feature_column import * ...
import volatility.utils as utils import volatility.plugins.common as common import volatility.cache as cache import volatility.debug as debug import volatility.obj as obj import datetime class _DMP_HEADER(obj.CType): """A class for crash dumps""" @property def SystemUpTime(self): """Returns a stri...
"""This demo program solves Poisson's equation - div C grad u(x, y) = f(x, y) on the unit square with source f given by f(x, y) = 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02) and boundary conditions given by u(x, y) = 0 for x = 0 or x = 1 du/dn(x, y) = 0 for y = 0 or y = 1 The conductivity C is a sym...
import scipy import numpy import sys from astropy import time as aptime sys.path.append('../') import CIAO_DatabaseTools import Graffity import tkinter def getGRAVITY_OBS(GRAVITY_values, frame): tkinter.Label(frame, text="GRAVITY Observations", width = 3, borderwidth="1", relief="solid").grid(row=0, ...
import unittest import sys from test.support import import_fresh_module, run_unittest TESTS = 'test.datetimetester' # XXX: import_fresh_module() is supposed to leave sys.module cache untouched, # XXX: but it does not, so we have to save and restore it ourselves. save_sys_modules = sys.modules.copy() try: pure_tests...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
""" Tests for the course completion helper functions. """ from datetime import datetime from badges.events import course_complete from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory class ...
import sys, os import unittest try: sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) except: sys.path.insert(0, os.path.dirname(os.path.abspath("."))) from bx.intervals.intersection import Interval from bx.intervals.intersection import IntervalNode from bx.intervals.intersection import IntervalTr...
""" Support for SCSGate components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scsgate/ """ import logging from threading import Lock from blumate.core import EVENT_BLUMATE_STOP REQUIREMENTS = ['scsgate==0.1.0'] DOMAIN = "scsgate" SCSGATE = None _...
#!/usr/bin/env python import logging import optparse import traceback import unittest import sys import os import utils import framework from queryservice_tests import cache_tests from queryservice_tests import nocache_tests from queryservice_tests import stream_tests from queryservice_tests import status_tests from...