content
stringlengths
4
20k
from django.template.defaultfilters import slice_filter from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class SliceTests(SimpleTestCase): @setup({'slice01': '{{ a|slice:"1:3" }} {{ b|slice:"1:3" }}'}) def test_slice01(self): output = sel...
import os import grokmirror import logging import fnmatch import subprocess logger = logging.getLogger(__name__) def git_rev_parse_all(gitdir): args = ['rev-parse', '--all'] retcode, output, error = grokmirror.run_git_command(gitdir, args) if error: # Put things we recognize into debug ...
from sympy import TableForm, S from sympy.printing.latex import latex from sympy.abc import x from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.elementary.trigonometric import sin from sympy.utilities.pytest import raises from textwrap import dedent def test_TableForm(): s = str(Tabl...
import argparse import StringIO import sys import os SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(os.path.dirname(SCRIPT_DIR), 'tools')) import getos valid_tools = ['newlib', 'glibc', getos.GetPlatform()] def Error(msg): print(msg) sys.exit(1) PREAMBLE = """\ { 'incl...
import codecs from xml.sax.saxutils import quoteattr, escape __all__ = ['XMLWriter'] class XMLWriter(object): def __init__(self, stream, namespace_manager, encoding=None, decl=1, extra_ns={}): encoding = encoding or 'utf-8' encoder, decoder, stream_reader, stream_writer = codecs.lookup(encoding) ...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
from decimal import Decimal from django.db import models from django.core.validators import ( MinValueValidator, MaxValueValidator, ) from shop.models import Product from coupons.models import Coupon class Order(models.Model): first_name = models.CharField(max_length=50) second_name = models.CharFie...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import subprocess DEFAULT_DATASET = 'infovis' DATASETS = [ DEFAULT_DATASET, '20newsgroups', 'nsfgrants', 'nsf25k', 'nsf10k', 'nsf1k', 'poliblogs', 'gjp', 'fomc', 'CR_financial_collapse', 'CR_stock_market_plunge', 'FCIC_final_report', 'FCIC_first_hearing', ...
""" Check code quality using pep8, pylint, and diff_quality. """ from paver.easy import sh, task, cmdopts, needs, BuildFailure import os import re from .utils.envs import Env ALL_SYSTEMS = 'lms,cms,common,openedx,pavelib' def top_python_dirs(dirname): """ Find the directories to start from in order to find ...
"""Tests for the SWIG-wrapped events writer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path from tensorflow.core.framework import summary_pb2 from tensorflow.core.util import event_pb2 from tensorflow.python import pywrap_tensorflow from ...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'd F Y H:i:s' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'd F' SHORT_DATE_FORMAT = 'd...
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL from youtube_dl.extractor import ( YoutubePlaylistIE, YoutubeIE, ) cla...
#pylint: disable=W0703,W0141,W0105 """ agent actions """ import json import logging import os from pylons import request, response, config import pylons import signal import traceback from agent.lib import manifestutil, configutil, utils from agent.lib.agent_globals import stopAgentGlobals from agent.lib.agent_thread....
data = ( ' ', # 0x00 'a', # 0x01 '1', # 0x02 'b', # 0x03 '\'', # 0x04 'k', # 0x05 '2', # 0x06 'l', # 0x07 '@', # 0x08 'c', # 0x09 'i', # 0x0a 'f', # 0x0b '/', # 0x0c 'm', # 0x0d 's', # 0x0e 'p', # 0x0f '"', # 0x10 'e', # 0x11 '3', # 0x12 'h', # 0x13 '9', # ...
data = ( 'Kay ', # 0x00 'Kayng ', # 0x01 'Ke ', # 0x02 'Ko ', # 0x03 'Kol ', # 0x04 'Koc ', # 0x05 'Kwi ', # 0x06 'Kwi ', # 0x07 'Kyun ', # 0x08 'Kul ', # 0x09 'Kum ', # 0x0a 'Na ', # 0x0b 'Na ', # 0x0c 'Na ', # 0x0d 'La ', # 0x0e 'Na ', # 0x0f 'Na ', # 0x10 'Na ', ...
"""Classification metrics library.""" 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 array_ops from tensorflow.python.ops import ma...
from django.contrib.admin import ModelAdmin from django.conf import settings from . import VERSION def default_config(): return { 'VERSION': VERSION, # configurable 'ADMIN_NAME': 'Django Suit', 'HEADER_DATE_FORMAT': 'l, jS F Y', 'HEADER_TIME_FORMAT': 'H:i', # form...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.vyos.v...
""" Support for inheritance of fields down an XBlock hierarchy. """ from __future__ import absolute_import from datetime import datetime from django.conf import settings from pytz import UTC from xmodule.partitions.partitions import UserPartition from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, D...
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for stash in orm.StashContent.objects.all(): if stash.content_id: content = orm.Content( ...
from __future__ import unicode_literals import logging import os import re from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE from ctypes.util import find_library from django.contrib.gis.gdal.error import OGRException from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger('django.contrib...
#!/usr/bin/env python from formsfive.widgets import Select, SelectMultiple, Textarea from django.forms.forms import get_declared_fields from django.utils.datastructures import SortedDict from django.forms.widgets import media_property from django.core.exceptions import FieldError from django.forms import models as orig...
# -*- coding: utf-8 -*- """Utils functions.""" import sys from functools import wraps import numpy def unexpected_value(x): """Define supspicious values.""" return (x is None) or x > 1.e4 or x == 0 or numpy.isnan(x) def dump_on_fail(fp=sys.stdout): """Dump args for unexpected results to `fp`. Para...
__version__=''' $Id: graph_widgets.py 3375 2009-01-16 18:23:19Z jonas $ ''' from tools.docco.rl_doc_utils import * from reportlab.graphics.shapes import * from reportlab.graphics.widgets import signsandsymbols heading2("Widgets") disc(""" We now describe widgets and how they relate to shapes. Using many examples it i...
import warnings from .base import Renderer from ..exporter import Exporter class VincentRenderer(Renderer): def open_figure(self, fig, props): self.chart = None self.figwidth = int(props['figwidth'] * props['dpi']) self.figheight = int(props['figheight'] * props['dpi']) def draw_line(...
"""This test contains necessary smoke tests for the Control.""" import pytest from cfme import control from cfme import test_requirements from cfme.utils.appliance.implementations.ui import navigate_to pytestmark = [ test_requirements.control, pytest.mark.smoke, pytest.mark.tier(2) ] destinations = [ ...
import logging import os import sys from threading import Thread from i3pystatus.core import io, util from i3pystatus.core.exceptions import ConfigError from i3pystatus.core.imputil import ClassFinder from i3pystatus.core.modules import Module DEFAULT_LOG_FORMAT = '%(asctime)s [%(levelname)-8s][%(name)s %(lineno)d] %...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class PlaysTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?plays\.tv/video/(?P<id>[0-9a-f]{18})' _TEST = { 'url': 'http://plays.tv/video/56af17f56c95335490/when-...
"""This is a simple HTTP server for manually testing exponential back-off functionality in Chrome. """ import BaseHTTPServer import sys import urlparse class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): keep_running = True def do_GET(self): if self.path == '/quitquitquit': self.send_respons...
import sys, random, time, pygame from pygame.locals import * def print_text(font, x, y, text, color=(255, 255, 255), shadow=True): if shadow: imgText = font.render(text, True, (0, 0, 0)) screen.blit(imgText, (x - 2, y - 2)) imgText = font.render(text, True, color) screen.blit(imgText, (x, ...
__doc__ = """This module contains the REST API for doing authentication. The methods are tested in the file tests/test_api_validate.py Authentication is either done by providing a username and a password or a serial number and a password. **Authentication workflow** Authentication workflow is like this: In case of ...
import time import sys try: # python 2 import xmlrpclib except ImportError: # python3 import xmlrpc.client as xmlrpclib # pylint: disable=F0401 from rhn.connections import idn_puny_to_unicode from spacewalk.common import apache from spacewalk.common.usix import raise_with_tb from spacewalk.common ...
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class KontrTubeIE(InfoExtractor): IE_NAME = 'kontrtube' IE_DESC = 'KontrTube.ru - Труба зовёт' _VALID_URL = r'http://(?:www\.)?kontrtube\.ru/videos/(?P<id>\d+)/(?P<displa...
from __future__ import absolute_import, division, print_function __metaclass__ = type ################################################################################ # Documentation ################################################################################ ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu...
from boto.exception import BotoServerError from boto.mws.response import ResponseFactory class ResponseErrorFactory(ResponseFactory): def __call__(self, status, reason, body=None): server = BotoServerError(status, reason, body=body) supplied = self.find_element(server.error_code, '', ResponseErro...
import pandas as pd import re from random import sample # Helper Functions def check_nulls(df, col): ''' returns df with NaN in specified column(s) ''' return df.ix[df.ix[:,col].isnull()] def get_notnulls(df, col): ''' returns df without NaN in specified column(s) ''' return df.ix[df....
#-*- coding:utf-8 -*- """ This file is part of PyGaze. PyGaze 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. PyGaze is distributed in the...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import functools def accept_txn(*types): """ Checks first argument against a list of valid types. Use kwargs otherwise. """ def decorator(f): @functools.wraps(f) def wrapper(self, transaction=None, **kwargs): ...
"""Support for Neato botvac connected vacuum cleaners.""" import logging from datetime import timedelta from urllib.error import HTTPError import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.helpers import discov...
"""BibFormat element - Prints comments posted for the record """ __revision__ = "$Id$" from ...comments.api import get_first_comments_or_remarks def format_element(bfo, nbReviews='all', nbComments='all', show_reviews='true'): """ Prints comments posted for the record. @param nbReviews: The max number of ...
import IECore import Gaffer import GafferUI import GafferAppleseed Gaffer.Metadata.registerNode( GafferAppleseed.AppleseedRender, "description", """ Performs offline batch rendering using the appleseed renderer, or optionally generates appleseed projects for later rendering using a SystemCommand node. """, ...
import re from caper.parsers.base import Parser REGEX_GROUP = re.compile(r'(\(|\[)(?P<group>.*?)(\)|\])', re.IGNORECASE) PATTERN_GROUPS = [ ('identifier', [ r'S(?P<season>\d+)E(?P<episode>\d+)', r'(S(?P<season>\d+))|(E(?P<episode>\d+))', r'Ep(?P<episode>\d+)', r'$(?P<absolute>\d...
from django.db import models from django import forms from django.core import exceptions import math class PositiveBigIntegerField(models.BigIntegerField): description = "Positive Big integer" def formfield(self, **kwargs): defaults = {'min_value': 0, 'max_value': models.BigInteger...
"""Produce DBpedia datasets of a smaller size.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.learn.python.learn.datasets import base from tensorflow.contrib.learn.python.learn.datasets import text_datasets from tensorflow.python...
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS class Command(BaseCommand): help = ("Runs the command-line client for specified database, or the " "default database if none is provided.") option_lis...
"""Test BIP66 (DER SIG). Test that the DERSIG soft-fork activates at (regtest) height 1251. """ from test_framework.test_framework import StarwelsTestFramework from test_framework.util import * from test_framework.mininode import * from test_framework.blocktools import create_coinbase, create_block from test_framewor...
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
{ 'name': 'Expense Tracker', 'version': '1.0', 'category': 'Human Resources', 'sequence': 29, 'summary': 'Expenses Validation, Invoicing', 'description': """ Manage expenses by Employees ============================ This application allows you to manage your employees' daily expenses. It gives ...
# -*- coding: utf-8 -*- """ Sahana Eden Automated Tests - INV006 Create Catalog @copyright: 2011-2016 (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 ...
"""Unit tests for the oai repository.""" __revision__ = "$Id$" from invenio.testutils import InvenioTestCase import re from cStringIO import StringIO from invenio import oai_repository_server from invenio.testutils import make_test_suite, run_test_suite class TestVerbs(InvenioTestCase): """Test for OAI verb fu...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.action import ActionBase class ActionModule(ActionBase): TRANSFERS_FILES = False def run(self, tmp=None, task_vars=dict()): # FIXME: need to rework the noop stuff still #if self.runne...
import os from oslo_config import cfg import unittest2 from st2common.constants.action import LIBS_DIR as ACTION_LIBS_DIR from st2actions.container.service import RunnerContainerService from st2tests import config as tests_config class RunnerContainerServiceTest(unittest2.TestCase): @classmethod def setUpCl...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7") from ansible.module_utils.basic import AnsibleModule try: from librar...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7") from ansible.module_utils.basic import AnsibleModule try: from librar...
"""Test for the qlearner strategy.""" import random import axelrod from axelrod import simulate_play, Game from .test_player import TestPlayer, test_responses C, D = 'C', 'D' class TestRiskyQLearner(TestPlayer): name = 'Risky QLearner' player = axelrod.RiskyQLearner expected_classifier = { 'm...
"""Split instance from provider""" __author__ = '<EMAIL> (Thomas Stromberg)' import csv import re reader = csv.reader(open('../config/servers.csv')) writer = csv.writer(open('output.csv', 'w')) for row in reader: name = row[2] matches = re.match('(.*?) \((.*)\)', name) if matches: name = matches.group(1) ...
"""RefExtract configuration.""" __revision__ = "$Id$" from invenio.config import CFG_VERSION, CFG_ETCDIR # pylint: disable=C0301 # version number: CFG_REFEXTRACT_VERSION = "Invenio/%s refextract/%s" % (CFG_VERSION, CFG_VERSION) # periodicals knowledge base: CFG_REFEXTRACT_KB_JOURNAL_TITLES = "%s/bibedit/refextract...
from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError class TestMedicalAppointment(TransactionCase): def setUp(self): super(TestMedicalAppointment, self).setUp() vals = { 'name': 'Test Patient', 'email': '<EMAIL>', } ...
""" Version 1 of the Ironic API NOTE: IN PROGRESS AND NOT FULLY IMPLEMENTED. Should maintain feature parity with Nova Baremetal Extension. Specification can be found at ironic/doc/api/v1.rst """ import pecan from pecan import rest from wsme import types as wtypes import wsmeext.pecan as wsme_pecan from ironic.api...
import pkgutil from importlib import import_module from pathlib import Path from asgiref.local import Local from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.functional import cached_property from django.utils.module_loading import import_string DEFAULT_DB_ALI...
""" ConfigurationModel for the mobile_api djangoapp. """ from config_models.models import ConfigurationModel from django.db import models from . import utils from .mobile_platform import PLATFORM_CLASSES class MobileApiConfig(ConfigurationModel): """ Configuration for the video upload feature. The order...
import uuid import mock from oslo_config import cfg import webob from nova.api.openstack.compute.contrib import evacuate as evacuate_v2 from nova.api.openstack.compute.plugins.v3 import evacuate as evacuate_v21 from nova.api.openstack import extensions from nova.compute import api as compute_api from nova.compute imp...
""" Utility functions for handling images. Requires Pillow (or PIL), as you might imagine. """ import zlib from django.core.files import File class ImageFile(File): """ A mixin for use alongside django.core.files.base.File, which provides additional features for dealing with images. """ def _get...
'''Generates 5 tuple flows from sorted pcap files ##(srcip,destip,proto,timestamp,srcport,destport)''' import sys from operator import itemgetter import time from flow_util import * global sample global label global n_max global n_input_pcaps UDPTIMEOUT = 2000 TCPTIMEOUT = 2000 n_max = 0 clean_names = ['p2pbox'] mal...
"""Invenio BibEdit Administrator Interface.""" __revision__ = "$Id" __lastupdated__ = """$Date: 2008/08/12 09:26:46 $""" from flask.ext.login import current_user from invenio.jsonutils import json, json_unicode_to_utf8, CFG_JSON_AVAILABLE from invenio.access_control_engine import acc_authorize_action from invenio.b...
""" gettext for openstack-common modules. Usual usage in an openstack.common module: from nova.openstack.common.gettextutils import _ """ import copy import functools import gettext import locale from logging import handlers import os import re from babel import localedata import six _localedir = os.environ.ge...
import pubmed from biblio import Biblio import db from app import refset_queue from app import my_redis from scopus import enqueue_scopus from collections import defaultdict import arrow import os from journals_histogram import make_journals_histogram def enqueue_for_refset(medline_citation, core_journals): bibl...
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
#!/usr/bin/env python from __future__ import division __author__ = "Dan Knights" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = [ "Dan Knights", "Jose Carlos Clemente Litran", "Yoshiki Vazquez Baeza", "Greg Caporaso", "Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-de...
"""Tests for compute_gradient. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.eager import backprop from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tenso...
from neutron.api import extensions from neutron.api.v2 import attributes from neutron.common import exceptions as n_exc NETWORK_TYPE = 'provider:network_type' PHYSICAL_NETWORK = 'provider:physical_network' SEGMENTATION_ID = 'provider:segmentation_id' EXTENDED_ATTRIBUTES_2_0 = { 'networks': { NETWORK_TYPE...
from openerp import models, api class AccountBankStatement(models.Model): _inherit = "account.bank.statement" @api.multi def button_confirm_bank(self): res = super(AccountBankStatement, self).button_confirm_bank() entries = self.mapped('line_ids.journal_entry_id') entries.write({'...
#!/usr/bin/python from max31855 import MAX31855, MAX31855Error import unittest class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.thermocouple = MAX31855(1, 2, 3, 4) def test_convert_tc_data(self): '''Verify thermocouple conversion to signed two's complement int and...
import logging import requests class MiddlewareAPI(object): def __init__(self, config, signer): self.signer = signer if config.has_option('api', 'url'): self.url_base = config.get('api', 'url') else: # backwards compatibility with old config keys https ...
import os from ansible import constants as C from ansible.plugins.action import ActionBase class ActionModule(ActionBase): TRANSFERS_FILES = True def run(self, tmp=None, task_vars=None): ''' handler for file transfer operations ''' # FIXME: noop stuff still needs to be sorted out #if...
""" @author: Andrew Case @license: GNU General Public License 2.0 @contact: <EMAIL> @organization: """ import volatility.obj as obj import volatility.debug as debug import volatility.plugins.linux.common as linux_common import volatility.plugins.linux.pslist as linux_pslist class linux_check_creds(li...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} # handy helper for calling system calls. # calls AnsibleModule.run_command and prints a more appropriate message # exec_path - path to file to execute, with all its arguments. # E.g "/sbin/...
import sys from command import Command from progress import Progress class Checkout(Command): common = True helpSummary = "Checkout a branch for development" helpUsage = """ %prog <branchname> [<project>...] """ helpDescription = """ The '%prog' command checks out an existing branch that was previously created...
""" Print system memory information. $ python examples/meminfo.py MEMORY ------ Total : 9.7G Available : 4.9G Percent : 49.0 Used : 8.2G Free : 1.4G Active : 5.6G Inactive : 2.1G Buffers : 341.2M Cached : 3.2G SWAP ---- Total : 0B Used : ...
#!/usr/bin/env python """ Setup script for gemini_python. The tools and modules in this package are developed by the Gemini Data Processing Software Group. In this package: astrodata : AstroData, The Recipe System astrodata_Gemini : Recipes, Primitives and astrodata configurations for Gemini gempy : Gemi...
"""An option parser which handles the first arg as a command. Add other nice functionality such as printing a list of commands and an example in usage. """ import optparse import sys class CommandOptionParser(optparse.OptionParser): """Wrapper class for OptionParser to help with listing commands.""" def __init...
import functools import httplib as http import json import operator from copy import deepcopy from django.contrib.auth.decorators import login_required, user_passes_test from django.core.paginator import Paginator, EmptyPage from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest fr...
#!/usr/bin/env python import json import argparse latencys = [ { 'osd':[ 'op_latency', 'op_process_latency', 'op_r_latency', 'op_r_process_latency', 'op_w_rlat', 'op_w_latency', 'op_w_process_latency', 'op_rw_rlat', 'op_rw_process_latency', 'subop_latency', 'subop_w_latency', 'subop_pull_late...
""" Functions to get information on NEST. """ from .hl_api_helper import * import sys import os import webbrowser @check_stack def sysinfo(): """Print information on the platform on which NEST was compiled.""" sr("sysinfo") @check_stack def version(): """Return the NEST version. Returns -----...
from collections import OrderedDict from json.tests import PyTest, CTest class TestUnicode(object): def test_encoding1(self): encoder = self.json.JSONEncoder(encoding='utf-8') u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' s = u.encode('utf-8') ju = enco...
"""Contains definitions for the preactivation form of Residual Networks. Residual networks (ResNets) were originally proposed in: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 The full preactivation 'v2' ResNet variant implemented in this modu...
"""TestSuite""" import sys import unittest from django.utils.unittest import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests...
from apicapi import apic_manager from keystoneclient.v2_0 import client as keyclient import netaddr from oslo_concurrency import lockutils from oslo_config import cfg from oslo_log import log from neutron.common import constants as n_constants from neutron.plugins.common import constants from neutron.plugins.ml2 impor...
from django.conf import settings from django.shortcuts import render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from djforms.polisci.iea.proposal.forms import ProposalContactForm from djforms.polisci.iea.proposal.forms import ProposalOrderForm from djforms.processo...
"""Tools to extract features.""" import logging import sys import time import cv2 import numpy as np from opensfm import context, pyfeatures logger = logging.getLogger(__name__) def resized_image(image, max_size): """Resize image to feature_process_size.""" h, w, _ = image.shape size = max(w, h) i...
""" InaSAFE Disaster risk assessment tool by AusAid - **Error Message example.** Contact : <EMAIL> .. 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...
#!/usr/bin/env python """Fuel utility for extracting metadata.""" import argparse import os import h5py message_prefix_template = 'Metadata for {}' message_body_template = """ The command used to generate this file is {} Relevant versions are H5PYDataset {} fuel.converters {} "...
"""Tests for tensorflow.contrib.graph_editor.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import numpy as np import tensorflow as tf from tensorflow.contrib import graph_editor as ge # Precision tolerance for floating-point value t...
import ctypes import os import time import argparse import subprocess import scipy.sparse as sp import mxnet as mx import numpy as np import numpy.random as rnd from mxnet.test_utils import rand_ndarray, set_default_context, assert_almost_equal, get_bz2_data from mxnet.base import check_call, _LIB from util import es...
#################################################################################################### # Copyright 2013 John Crawford # # This file is part of PatchCorral. # # PatchCorral is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
# coding:utf-8 ''' New Integration Test for zstack cloudformation. Create Resource Stack when state of stack template is false (expected result is failed). @author: Lei Liu ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.operations.resource_stack as resource_stack_ops import zs...
''' Description Check for each generation n, compare the list of individual IDs in the sim file, to the list of individual IDs in the nth pop in the genepop file ''' from __future__ import print_function __filename__ ="" __date__ = "20160825" __author__ = "Ted Cosart<<EMAIL>>" import sys import supp_utils as supu try:...
"""The database models for bug data.""" import logging from google.appengine.ext import ndb BUG_STATUS_OPENED = 'opened' BUG_STATUS_CLOSED = 'closed' BUG_STATUS_RECOVERED = 'recovered' BISECT_STATUS_STARTED = 'started' BISECT_STATUS_COMPLETED = 'completed' BISECT_STATUS_FAILED = 'failed' class Bug(ndb.Model): ...
""" opbeat.contrib.django.middleware ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011-2012 Opbeat Large portions are :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging import thread...