code
stringlengths
1
199k
"""Tests for tf.contrib.tensor_forest.ops.finished_nodes_op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow # pylint: disable=unused-import from tensorflow.contrib.tensor_forest.python.ops import training_ops from tensorflow.python.fram...
"""A simple MNIST classifier which displays summaries in TensorBoard. This is an unimpressive MNIST model, but it is a good example of using tf.name_scope to make a graph legible in the TensorBoard graph explorer, and of naming summary tags so that they are grouped meaningfully in TensorBoard. It demonstrates the func...
""" This is module that represents the helper methods. Updated since version 1.1: 1. Added check_path_exist(), check_is_directory() and check_is_file(). Updated since version 1.2 (OpenWarp - Add Logging Functionality) : Added support for logging """ __author__ = "caoweiquan322, yedtoss" __copyright__ = "Copyrig...
''' Copyright 2012 Konrad Jopek 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 writ...
import re import time import importlib import boto.ec2 import boto.route53 from st2actions.runners.pythonrunner import Action from ec2parsers import ResultSets class BaseAction(Action): def __init__(self, config): super(BaseAction, self).__init__(config) if config['st2_user_data'] is not "": ...
import struct import binascii from datetime import datetime import extra_field_parse class ZipParser(): zipLDMagic = "\x50\x4b\x03\x04" # Local Directory zipCDMagic = "\x50\x4b\x01\x02" # Central Directory def getFileComment(self): if self.getCommentLength() == 0: return None s...
import os, sys, posix from reclass import get_storage, output from reclass.core import Core from reclass.errors import ReclassException from reclass.config import find_and_read_configfile, get_options, \ path_mangler from reclass.constants import MODE_NODEINFO from reclass.defaults import * from reclass.version...
from __future__ import print_function, unicode_literals """ Launches a local Weblab instance which makes use of the launch_sample configuration, and runs on it the WeblabWeb tests using PhantomJS. Once the tests are run, the instance is automatically stopped. """ import os import threading import sys import time origin...
""" A run through of basic Sumatra functionality. As our example code, we will use a Python program for analyzing scanning electron microscope (SEM) images of glass samples. This example was taken from an online SciPy tutorial at http://scipy-lectures.github.com/intro/summary-exercises/image-processing.html Usage: ...
import logging from copy import copy from . import Analysis, register_analysis from networkx import DiGraph l = logging.getLogger("angr.analyses.dfg") class DFG(Analysis): def __init__(self, cfg=None, annocfg=None): """ Build a Data Flow Grah (DFG) for every basic block of a CFG The DFGs are...
import numpy as np from bokeh.document import Document from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid from bokeh.models.markers import Triangle from bokeh.plotting import show N = 9 x = np.linspace(-2, 2, N) y = x**2 sizes = np.linspace(10, 20, N) source = ColumnDataSource(dict(x=x, y=y,...
from django.db import migrations, connection def _table_exists(db_cursor, tablename): "Returns bool if table exists or not" return tablename in connection.introspection.table_names() class Migration(migrations.Migration): dependencies = [("objects", "0008_auto_20170705_1736")] db_cursor = connection.cur...
import sys, os extensions = ['sphinx.ext.intersphinx'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'django-reversion' copyright = '2013, Dave Hall' version = '1.9' release = '1.9.3' exclude_patterns = ['_build'] pygments_style = 'sphinx' html_theme = 'default' html_static_path ...
import os import subprocess import unittest import imath import IECore import IECoreScene import IECoreImage import Gaffer import GafferOSL import GafferTest import GafferImage import GafferScene import GafferSceneTest import GafferArnold def withMetadata( func ) : def wrapper( self ) : metadataPath = os.path.join( ...
""" This module contains unittests which test the time domain Feature Extraction node :Author: Andrei Ignat (Andrei_Cristian.Ignat@dfki.de) :Created: 2014/06/16 """ import unittest if __name__ == '__main__': import sys import os # The root of the code file_path = os.path.dirname(os.path.abspath(__file__...
""" Get system hardware information http://stackoverflow.com/a/4194146/1002176 """ import cpuinfo # pip install --user py-cpuinfo import sys, os, fcntl, struct import pickle if os.geteuid() > 0: print("ERROR: Must be root to use") sys.exit(1) with open(sys.argv[1], "rb") as fd: # tediously derived from the...
""" This example shows how to validate addresses. Note that the validation class can handle up to 100 addresses for validation. """ import logging from example_config import CONFIG_OBJ from fedex.services.address_validation_service import FedexAddressValidationRequest logging.basicConfig(level=logging.INFO) connection ...
import pychrono as chrono import pychrono.vehicle as veh import pychrono.irrlicht as irr import os import math as m def main() : #print("Copyright (c) 2017 projectchrono.org\nChrono version: ", CHRONO_VERSION , "\n\n") # -------------------------- # Create the various modules # -------------------------...
import commands import socket import time from multiprocessing import Process from framework.dependency_management.dependency_resolver import BaseComponent from framework.lib.general import cprint class TOR_manager(BaseComponent): ''' This class is responsible for TOR management. ''' COMPONENT_NAME = "t...
from __future__ import unicode_literals import datetime import uuid from django.conf import settings from django.core.exceptions import FieldError, ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from django.db.backends.base.operations import BaseDatabaseOperations...
""" A wait callback to allow psycopg2 cooperation with gevent. Use `make_psycopg_green()` to enable gevent support in Psycopg. """ from __future__ import absolute_import import psycopg2 from psycopg2 import extensions from gevent.socket import wait_read, wait_write def make_psycopg_green(): """Configure Psycopg to ...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * from builtins import object import logging import emission.storage.pipeline_q...
''' blog.views ========== Note: As Django is only used as a backend there are no template based views. All views are ajax views returning json objects of models. ''' import logging from rest_framework import viewsets from rest_framework.response import Response from rest_framework.deco...
"""Base class to manage the interaction with a running kernel""" from __future__ import absolute_import from IPython.kernel.channels import major_protocol_version from IPython.utils.py3compat import string_types, iteritems import zmq from IPython.utils.traitlets import ( Any, Instance, Type, ) from .channelsabc imp...
""" To run this test, type this in command line <kolibri manage test -- kolibri.content> """ import datetime import os import shutil import tempfile from django.test import TestCase from django.core.management import call_command from django.core.urlresolvers import reverse from django.db import connections from django...
import signal import sys import time import tornado.ioloop from thumbor.utils import logger def signal_handler(server, config, sig, _): io_loop = tornado.ioloop.IOLoop.instance() def stop_loop(now, deadline): if now < deadline and ( io_loop._callbacks # pylint: disable=protected-access ...
def get_single_number(nums, pos): if pos >= 0 and pos < len(nums): return nums[pos] return 0 def get_number(nums, pos): pr = pos+1 pl = pos-1 while get_single_number(nums, pos) == 0: pos = pr pr += 1 if get_single_number(nums, pos) == 0: pos = pl ...
import datetime try: from django_mongoengine import Document except ImportError: from mongoengine import Document from mongoengine import EmbeddedDocument, StringField, ListField, BooleanField from mongoengine import EmbeddedDocumentField from django.conf import settings from crits.actors.migrate import migrate_actor...
""" higwidgets/higscrollers.py scrollers related classes """ __all__ = ['HIGScrolledWindow'] import gtk class HIGScrolledWindow(gtk.ScrolledWindow): def __init__(self): gtk.ScrolledWindow.__init__(self) self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.set_border_width(5)
"A python script that converts RSS/Atom newsfeeds to email" import codecs as _codecs from distutils.core import setup import os.path as _os_path from rss2email import __version__, __url__, __author__, __email__ _this_dir = _os_path.dirname(__file__) setup( name='rss2email', version=__version__, maintainer=_...
""" Module for debugging mod_python && mod_wsgi applications that run inside the Apache webserver (or any other webserver). This is a utility module that makes remote debugging possible and easy. """ from invenio.remote_debugger_config import CFG_REMOTE_DEBUGGER_ENABLED, \ CFG_REMOTE_DEBUGGER_IMPORT, CFG_REMOTE_DEBUGG...
import unittest from datetime import datetime from .. import lbmetaclass from .. import pytypes class lbmetaclass_test(unittest.TestCase): def setUp(self): pass def test_metaclass_generation(self): test_class = lbmetaclass.generate_class('test_class',[ { 'name':'name', ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals class FieldTestBase(object): field_type = None instance_type = None translation_failures = [] translation_success = [] validation_exception = None ...
""" jumpserver.__app__.hands.py ~~~~~~~~~~~~~~~~~ This app depends other apps api, function .. should be import or write mack here. Other module of this app shouldn't connect with other app. :copyright: (c) 2014-2018 by JumpServer Team. :license: GPL v2, see LICENSE for more details. """ from co...
''' Description : This endpoint allows you to delete entries in the Unsubscribes list. ''' import YtelAPI import YtelConstant message360Credential = YtelAPI.Message360API(auth_id=YtelConstant.Constant.ACCOUNT_SID,auth_token=YtelConstant.Constant.AUTH_TOKEN) params = { 'Email':'ex@ex.com', } response = message360Crede...
"""These are some tips that are displayed to the user.""" from gettext import gettext as _ tips = [ _("At the end of a translation, simply press <Enter> to continue with the next one."), _("To copy the original string into the target field, simply press <Alt+Down>."), #_("When editing a fuzzy translation, t...
from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal from aubio import fvec, zero_crossing_rate, alpha_norm, min_removal from numpy import array, shape class aubio_fvec_test_case(TestCase): def test_vector_created_with_zeroes(self): a = fvec(10) ...
import unittest from itertools import izip import numpy as np from pele.utils.vec3 import invert3x3 from pele.utils import rotations from pele.utils.rotations import q2aa, mx2q, q_multiply, random_aa, random_q, q2mx rot_epsilon = 1e-6 def aa2q(AA): """ convert angle axis to quaternion input V: angle axis ve...
""" Course Certificates page objects. The methods in these classes are organized into several conceptual buckets: * Helpers: General utility methods used throughout, such as css selection helpers * Properties: Specific page/object field getters/setters (mainly for form inputs) * Wait Actions: EmptyPromises ...
__title__="FreeCAD Draft Trackers" __author__ = "Yorik van Havre" __url__ = "http://www.freecadweb.org" import FreeCAD,FreeCADGui,math,Draft, DraftVecUtils from FreeCAD import Vector from pivy import coin class Tracker: "A generic Draft Tracker, to be used by other specific trackers" def __init__(self,dotted=Fa...
"""Runs a ResNet model on the ImageNet dataset.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl import app as absl_app from absl import flags import tensorflow as tf # pylint: disable=g-bad-import-order from official.utils.flags import...
import webob from cinder.api import common from cinder.api.openstack import wsgi from cinder import exception from cinder import volume class Controller(wsgi.Controller): """The volume metadata API controller for the OpenStack API.""" def __init__(self): self.volume_api = volume.API() super(Cont...
"""Tests for tensorflow.python.training.saver.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import math import os import random import time import numpy as np import six from google.protobuf.any_pb2 import Any from tensorflow.core.pr...
import os import sys import time import unittest from optparse import OptionParser from util import local_libpath SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) class AbstractTest(unittest.TestCase): def setUp(self): if options.trans == 'http': uri = '{0}://{1}:{2}{3}'.format(('https' i...
"""Support for MQTT lights.""" import functools import voluptuous as vol from homeassistant.components import light from homeassistant.core import HomeAssistant from homeassistant.helpers.reload import async_setup_reload_service from homeassistant.helpers.typing import ConfigType from .. import DOMAIN, PLATFORMS from ....
"""Maintain moving averages of parameters.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import control_flow_ops from tensorflow.python....
from jpype import * import time def pySubscriber (proxy, javaNamingFactory="weblogic.jndi.WLInitialContextFactory", javaNamingProvider="t3://158.188.40.21:7001", connectionFactory="weblogic.jms.ConnectionFactory", topicName="defaultTopic"): ret...
""" .. Copyright 2012-2015 Spotify AB Copyright 2018 Copyright 2018 EMBL-European Bioinformatics Institute 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/lice...
''' 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"); you may not use this ...
from __future__ import absolute_import from django import http from mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.api import cinder from openstack_dashboard.test import helpers as test from openstack_dashboard.usage import quotas class QuotaTests(test.APITestCase): def get_usag...
from __future__ import print_function from BinPy.combinational.combinational import * print(HalfSubtractor.__doc__) hs = HalfSubtractor(1, 1) print (hs.output()) hs.set_input(1, 0) print (hs.output()) conn_1 = Connector(1) conn_2 = Connector(0) conn_3 = Connector() hs.set_inputs(conn_1, conn_2) hs.set_output(0, conn_3)...
""" This encapsulates the logic for displaying filters in the Django admin. Filters are specified in models with the "list_filter" option. Each filter subclass knows how to display a filter for a field that passes a certain test -- e.g. being a DateField or ForeignKey. """ import datetime from django.db import models f...
from __future__ import print_function from distutils.core import setup, Extension import RDConfig from distutils import sysconfig save_init_posix = sysconfig._init_posix def my_init_posix(): print('my_init_posix: changing gcc to g++') save_init_posix() g = sysconfig.get_config_vars() g['CC'] = 'g++' g['LDSHAR...
import re import Common.LongFilePathOs as os from ParserWarning import Warning from Common.LongFilePathSupport import OpenLongFilePath as open PPDirectiveList = [] AssignmentExpressionList = [] PredicateExpressionList = [] FunctionDefinitionList = [] VariableDeclarationList = [] EnumerationDefinitionList = [] StructUni...
from .cantera import *
import sys import types import uuid from StringIO import StringIO import json from .outputhandlers.shellcolors import OutputHandler from .. import unicodehelper class BaseErrorBundle(object): """Keyword Arguments: **determined** Whether the validator should continue after a tier fails **instant** ...
from __future__ import unicode_literals, absolute_import import frappe from frappe import _ import json from frappe.core.doctype.user.user import extract_mentions from frappe.utils import get_fullname, get_link_to_form from frappe.website.render import clear_cache from frappe.model.db_schema import add_column from frap...
from neutronclient.i18n import _ from neutronclient.neutron import v2_0 as neutronV20 def _get_pool_id(client, pool_id_or_name): return neutronV20.find_resourceid_by_name_or_id(client, 'pool', pool_id_or_name, cm...
from wtforms import StringField, PasswordField, SelectField, BooleanField, IntegerField from wtforms.validators import DataRequired from flask_wtf import Form class LoginForm(Form): """后台管理登录框""" username = StringField(u'帐号', validators=[DataRequired(u'该项不能为空')]) password = PasswordField(u'密码', validators=[...
import django from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection if django.VERSION >= (1, 8, 0): from django.db.backends.base.introspection import TableInfo class DatabaseSchemaIntrospection(DatabaseIntrospection): def get_table_list(self, cursor): "Returns a list of ...
""" Helper functions for writing to terminals and files. """ import sys, os, unicodedata import py py3k = sys.version_info[0] >= 3 py33 = sys.version_info >= (3, 3) from py.builtin import text, bytes win32_and_ctypes = False colorama = None if sys.platform == "win32": try: import colorama except ImportE...
""" Sahana Eden Security Model @copyright: 2012-15 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, includin...
from sys import argv, exit, stdin from getopt import getopt, GetoptError usage=""" BELOW.PY Print all lines from a text file in which entries in a particular column are numbers below a given level. Stops at the end of the file OR the first line which contains only whitespace. Examples: 1) To show lines in diffs.txt wh...
import os, re, traceback, time from drTank.util import shotgun_session import projectAwareness from projectAwareness import get_tank_render_container from util import is_valid_render import tank import ContextSession from ContextSession import get_tank_obj_f...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import sys from ansible.errors import AnsibleError, AnsibleOptionsError from ansible.parsing.dataloader import DataLoader from ansible.parsing.vault import VaultEditor from ansible.cli import CLI class VaultCLI(CLI): "...
''' Genesis Add-on Copyright (C) 2015 lambda 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) any later version. This pr...
import pytest from pages.firefox.whatsnew.whatsnew_96 import FirefoxWhatsNew96Page @pytest.mark.skip_if_not_firefox(reason="Whatsnew pages are shown to Firefox only.") @pytest.mark.nondestructive @pytest.mark.parametrize("locale", [("de"), ("fr")]) def test_relay_button_is_displayed_signed_in(locale, base_url, selenium...
""" Execute a Job, passed as a container or as a container and a configuration string (i.e., from a wizard). """ from __future__ import absolute_import from __future__ import print_function import sys from aeneas.tools.execute_job import ExecuteJobCLI __author__ = "Alberto Pettarin" __email__ = "aeneas@readbeyond.it" _...
import base64 import hashlib import hmac import json import requests import time import werkzeug.urls class AdyenProxyAuth(requests.auth.AuthBase): def __init__(self, adyen_account_id): super(AdyenProxyAuth, self).__init__() self.adyen_account_id = adyen_account_id def __call__(self, request): ...
from __future__ import unicode_literals import frappe from frappe.model.mapper import get_mapped_doc from frappe.utils import flt, nowdate, getdate from frappe import _ from erpnext.controllers.selling_controller import SellingController form_grid_templates = { "items": "templates/form_grid/item_grid.html" } class Quo...
from spack import * class RDygraphs(RPackage): """An R interface to the 'dygraphs' JavaScript charting library (a copy of which is included in the package). Provides rich facilities for charting time-series data in R, including highly configurable series- and axis-display and interactive features like z...
from spack import * class RGgally(RPackage): """The R package 'ggplot2' is a plotting system based on the grammar of graphics. 'GGally' extends 'ggplot2' by adding several functions to reduce the complexity of combining geometric objects with transformed data. Some of these functions include a ...
"""Unit tests for the type-hint objects and decorators.""" from __future__ import absolute_import import functools import inspect import unittest from builtins import next from builtins import range import apache_beam.typehints.typehints as typehints from apache_beam.typehints import Any from apache_beam.typehints impo...
import os from mock import patch, MagicMock from django.test import TestCase from django.conf import settings from django.core.management import call_command from zerver.models import get_realm from confirmation.models import RealmCreationKey, generate_realm_creation_url from datetime import timedelta from zerver.lib.t...
"""Test Customize config panel.""" import asyncio import json from unittest.mock import patch from homeassistant.bootstrap import async_setup_component from homeassistant.components import config from homeassistant.config import DATA_CUSTOMIZE @asyncio.coroutine def test_get_entity(hass, hass_client): """Test getti...
from builtins import str from pyhive import presto from pyhive.exc import DatabaseError from requests.auth import HTTPBasicAuth from airflow.hooks.dbapi_hook import DbApiHook class PrestoException(Exception): pass class PrestoHook(DbApiHook): """ Interact with Presto through PyHive! >>> ph = PrestoHook(...
"""A class to store named variables and a scope operator to manage sharing.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections as collections_lib import copy import enum # pylint: disable=g-bad-import-order import functools import sys impo...
"""Library for testing DistributionStrategy descendants.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import os import tempfile import numpy as np from tensorflow.core.protobuf import config_pb2 from tensorflow.core.util import event_pb...
""" The :mod:`sklearn.cluster` module gathers popular unsupervised clustering algorithms. """ from .spectral import spectral_clustering, SpectralClustering from .mean_shift_ import (mean_shift, MeanShift, estimate_bandwidth, get_bin_seeds) from .affinity_propagation_ import affinity_propagatio...
""" ==================================================================== Mass-univariate twoway repeated measures ANOVA on single trial power ==================================================================== This script shows how to conduct a mass-univariate repeated measures ANOVA. As the model to be fitted assumes...
"""Tests clean exit of server/client on Python Interpreter exit/sigint. The tests in this module spawn a subprocess for each test case, the test is considered successful if it doesn't hang/timeout. """ import atexit import os import signal import six import subprocess import sys import threading import time import unit...
"""passlib.handlers.sha1_crypt """ import logging; log = logging.getLogger(__name__) from passlib.utils import safe_crypt, test_crypt from passlib.utils.binary import h64 from passlib.utils.compat import u, unicode, irange from passlib.crypto.digest import compile_hmac import passlib.utils.handlers as uh __all__ = [ ] ...
import sys import time print sys.argv[1] f = open(sys.argv[1],"r") for line in f: print line time.sleep(1) f.close()
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.particles import ParticleEffect, Particles, ForceGroup from EffectController import EffectController from PooledEffect import PooledEffect import random class RingEffect(PooledEffect, EffectController): def __init__(self): ...
import sys, unittest, re, os.path sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'src')) from Exscript.Log import Log from Exscript import Host from util.reportTest import FakeError class LogTest(unittest.TestCase): CORRELATE = Log def setUp(self): self.log = Log('testm...
"""reindent [-d][-r][-v] [ path ... ] -d (--dryrun) Dry run. Analyze, but don't make any changes to, files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -n (--nobackup) No backup. Does not make a ".bak" file before reindenting. -v (--verbose) Verbose. Print informative msgs; else no...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: gcp_compute_target_http_proxy description: - Represents a TargetHttpProxy resource, which is used by on...
import orange, orngPCA data = orange.ExampleTable("iris.tab") attributes = ['sepal length', 'sepal width', 'petal length', 'petal width'] pca = orngPCA.PCA(data, attributes = attributes, standardize = True) projected = pca(data) print "Projection on first two components:" for d in projected[:5]: print d
from adhocracy.model import Poll, Vote from adhocracy.tests import TestController from adhocracy.tests.testtools import tt_make_proposal, tt_make_user class TestPoll(TestController): def test_begin_end(self): proposal = tt_make_proposal(voting=False) poll = Poll.create(proposal, proposal.creator, Po...
from __future__ import unicode_literals from django.db import migrations from auth_helpers.migrations import ( get_migration_group_create, get_migration_group_delete, ) from candidates.models import TRUSTED_TO_RENAME_GROUP_NAME class Migration(migrations.Migration): dependencies = [ ('candidates', '...
from __future__ import unicode_literals import itertools import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urlparse, ) from ..utils import ( unified_strdate, qualities, ) class WDRIE(InfoExtractor): _PLAYER_REGEX = '-(?:video|audio)player(?:_size-[LMS])?' ...
import mock import requests from novaclient import client from novaclient import exceptions from novaclient.tests import utils fake_response = utils.TestResponse({ "status_code": 200, "text": '{"hi": "there"}', }) mock_request = mock.Mock(return_value=(fake_response)) refused_response = utils.TestResponse({ ...
"""A simple test runner for docker (experimental).""" import copy import os import os.path import shlex import StringIO import subprocess import sys import threading from third_party.py import gflags gflags.DEFINE_multistring( "image", [], "The list of additional docker image to load (path to a docker_build " ...
from django.db import models from south.db import db from paypal.standard.ipn.models import * class Migration: def forwards(self, orm): # Adding model 'PayPalIPN' db.create_table('paypal_ipn', ( ('id', models.AutoField(primary_key=True)), ('business', models.CharField(max_len...
import json import sys version_json = ''' { "dirty": false, "error": null, "full-revisionid": "1bfc7551f32f7b42ba50620a837f03e51d5b7c77", "version": "2.0.0" } ''' # END VERSION_JSON def get_versions(): return json.loads(version_json)
{ "options" : { "validatePixelAlignment" : False }, "ids" : [ "GafferLogo" ] }
from __future__ import print_function, division from .str import StrPrinter from sympy.utilities import default_sort_key class LambdaPrinter(StrPrinter): """ This printer converts expressions into strings that can be used by lambdify. """ def _print_MatrixBase(self, expr): return "%s(%s)" % ...
from __future__ import print_function import time from upm import pyupm_led as led def main(): # Create the Grove LED object using GPIO pin 2 led = led.Led(2) # Print the name print(led.name()) # Turn the LED on and off 10 times, pausing one second # between transitions for i in range (0,10)...
""" @author: AAron Walters @license: GNU General Public License 2.0 or later @contact: awalters@volatilesystems.com @organization: Volatile Systems """ from forensics.object2 import * from forensics.object import * from forensics.linked_list import * from forensics.linux.tasks import * from vutils impor...
''' test_qgscomposerlabel.py -------------------------------------- Date : Oct 2012 Copyright : (C) 2012 by Dr. Hugo Mercier email : hugo dot mercier at oslandia dot com *****************************************...