content string |
|---|
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSnappingUtils (complement to C++-based tests)
.. 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 ... |
"""Tests Google Test's exception catching behavior.
This script invokes gtest_catch_exceptions_test_ and
gtest_catch_exceptions_ex_test_ (programs written with
Google Test) and verifies their output.
"""
__author__ = '<EMAIL> (Vlad Losev)'
import os
import gtest_test_utils
# Constants.
FLAG_PREFIX = '--gtest_'
LIS... |
import nova.scheduler.utils
import nova.servicegroup
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional.api import client
from nova.tests.unit import cast_as_call
import nova.tests.unit.image.fake
from nova.tests.unit import policy_fixture
class TestServerGet(test.TestCa... |
from werkzeug import urls
from odoo import api, fields, models
from odoo.tools.translate import html_translate
class RecruitmentSource(models.Model):
_inherit = 'hr.recruitment.source'
url = fields.Char(compute='_compute_url', string='Url Parameters')
@api.one
@api.depends('source_id', 'source_id.n... |
import json
import shlex
import os
import re
import sys
PACMAN_PATH = "/usr/bin/pacman"
def query_package(module, name, state="present"):
# pacman -Q returns 0 if the package is installed,
# 1 if it is not installed
if state == "present":
cmd = "pacman -Q %s" % (name)
rc, stdout, stderr = ... |
""" TrainExtensions for doing random spatial windowing and flipping of an
image dataset on every epoch. TODO: fill out properly."""
import warnings
import numpy
from . import TrainExtension
from pylearn2.datasets.preprocessing import CentralWindow
from pylearn2.utils.exc import reraise_as
from pylearn2.utils.rng i... |
# -*- coding: utf-8 -*-
"""
tests.test_instance
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Flask Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pytest
import flask
from flask._compat import PY2
def test_explicit_instance_paths(mo... |
import datetime
import pickle
import base64
import httplib2
from utils import log as logging
from oauth2client.client import OAuth2WebServerFlow, FlowExchangeError
from bson.errors import InvalidStringData
import uuid
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
# from django... |
# -*- coding: utf-8 -*-
import math
import re
# TODO: Split the 1000 and 1024 factor out. Now it is not an issue as it is used FOR COMPARISON ONLY
FACTOR = 1024
PREFIXES = ['', 'K', 'M', 'G', 'T', 'P']
FACTORS = {prefix: int(math.pow(FACTOR, i)) for i, prefix in enumerate(PREFIXES)}
UNITS = ['Byte', 'Bytes', 'B', 'b'... |
import re
from gi.repository import Gtk, GObject
from quodlibet import _
from quodlibet.plugins.editing import RenameFilesPlugin, TagsFromPathPlugin
from quodlibet.util import connect_obj
from quodlibet.qltk import Icons
class RegExpSub(Gtk.HBox, RenameFilesPlugin, TagsFromPathPlugin):
PLUGIN_ID = "Regex Substi... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TestCenterUser'
db.create_table('student_testcenteruser', (
('id', self.gf('djan... |
import sys
import time
import json
import re
try:
import boto.sns
from boto.exception import BotoServerError
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
class SnsTopicManager(object):
""" Handles SNS Topic creation and destruction """
def __init__(self,
module,
... |
from StringIO import StringIO
def jsmin(js):
ins = StringIO(js)
outs = StringIO()
JavascriptMinify().minify(ins, outs)
str = outs.getvalue()
if len(str) > 0 and str[0] == '\n':
str = str[1:]
return str
def isAlphanum(c):
"""return true if the character is a letter, digit, underscor... |
import json
from django.contrib.postgres import lookups
from django.contrib.postgres.forms import SimpleArrayField
from django.contrib.postgres.validators import ArrayMaxLengthValidator
from django.core import checks, exceptions
from django.db.models import Field, IntegerField, Transform
from django.db.models.lookups ... |
from flask import Flask, render_template, session, request, abort, g
import requests
app = Flask(__name__)
app.config.update(
DEBUG=True,
SECRET_KEY='my development key',
PERSONA_JS='https://login.persona.org/include.js',
PERSONA_VERIFIER='https://verifier.login.persona.org/verify',
)
app.config.from... |
"""Tests for nets.inception_v1."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.framework.python.ops import variables as variables_lib
from tensorfl... |
from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check vi... |
from __future__ import absolute_import
import datetime
import unittest2
from expects import be_below_or_equal, expect, equal, raise_error
from endpoints_management.control import timestamp
class TestToRfc3339(unittest2.TestCase):
A_LONG_TIME_AGO = datetime.datetime(1971, 12, 31, 21, 0, 20, 21000)
TESTS = [... |
"""Functional tests for 3d pooling operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.tests.xla_test import XLATestCase
from tensorflow.python.framework import dtypes
from tensorflow.python.framework ... |
# -*- coding: utf-8 -*-
'''
Specto 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 l... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Interfaces to cloud providers, using `Apache LibCloud <http://libcloud.apache.org>`
"""
# Copyright (C) 2011, 2012 ETH Zurich and University of Zurich. All rights reserved.
#
# Authors:
# Riccardo Murri <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (th... |
from __future__ import absolute_import
from django.db import models
from django.test import TestCase
from .models import Author, Book
class SignalsRegressTests(TestCase):
"""
Testing signals before/after saving and deleting.
"""
def get_signal_output(self, fn, *args, **kwargs):
# Flush any ... |
"""Example of Estimator for Iris plant dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from sklearn import cross_validation
from sklearn import datasets
from sklearn import metrics
import tensorflow as tf
layers = tf.contrib.layers
learn = tf.co... |
{
'name': 'Base currency symbol',
'version': '0.1',
'url': 'http://launchpad.net/openerp-ccorp-addons',
'author': 'ClearCorp S.A.',
'website': 'http://clearcorp.co.cr',
'category': 'General Modules/Base',
'description': """Adds symbol to currency:
Use symbol_prefix and symbol_suffix depending on the currency sta... |
from viscm.gui import *
from viscm.bezierbuilder import *
import numpy as np
import matplotlib as mpl
from matplotlib.backends.qt_compat import QtGui, QtCore
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
cms = {"viscm/examples/sample_linear.jscm",
"viscm/examples/sample_dive... |
import test
import os
from os.path import join, dirname, exists, basename, isdir
import re
import utils
class RemotingTestCase(test.TestCase):
def __init__(self, path, file, arch, mode, nwdir, context, config, additional=[]):
super(RemotingTestCase, self).__init__(context, path, arch, mode, nwdir)
self.file... |
# -*- coding: utf-8 -*-
"""
Author: Bernhard Scheirle
"""
from __future__ import unicode_literals
import logging
import os
import hashlib
logger = logging.getLogger(__name__)
_log = "pelican_comment_system: avatars: "
try:
from . identicon import identicon
_identiconImported = True
except ImportError as e:... |
"""
convertcolors.py provides functions for converting various color formats to (red, green, blue, alpha)
"""
RED_MASK = 0xff000000
GREEN_MASK = 0x00ff0000
BLUE_MASK = 0x0000ff00
ALPHA_MASK = 0x000000ff
def color_from_hex(hex_color:int)->(int,int,int,int):
"""
Takes a hex value in either of the form 0xRRGG... |
from .. import constants, logger
from . import base_classes, image, api
class Texture(base_classes.BaseNode):
"""Class that wraps a texture node"""
def __init__(self, node, parent):
logger.debug("Texture().__init__(%s)", node)
base_classes.BaseNode.__init__(self, node, parent, constants.TEXTUR... |
import sys
from opendrop.app import OpendropApplication
from opendrop.appfw import Injector
def main(*argv) -> int:
# https://stackoverflow.com/questions/13514031/py2exe-with-multiprocessing-fails-to-run-the-processes#27547300
import multiprocessing
multiprocessing.freeze_support()
injector = Injecto... |
class Solution(object):
def solveSudoku(self, board):
"""
:type board: List[List[str]]
:rtype: void Do not return anything, modify board in-place instead.
"""
if board is None or len(board) != 9 or len(board[0]) != 9:
return
for row in range(9):
... |
"""
Tests for the Spring Metrics template tags and filters.
"""
import re
from django.contrib.auth.models import User, AnonymousUser
from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings
from analytical.templatetags.spring_metrics import SpringMetrics... |
# Django settings for frontend project.
import os
import common
from autotest_lib.client.common_lib import global_config
DEBUG = True
TEMPLATE_DEBUG = DEBUG
FULL_ADMIN = False
ADMINS = (
# ('Your Name', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql',
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Stderr built-in backend.
"""
__author__ = "Lluís Vilanova <<EMAIL>>"
__copyright__ = "Copyright 2012, Lluís Vilanova <<EMAIL>>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ = "<EMAIL>"
... |
from django.db import models
import json, string
from django.core.exceptions import ValidationError
class Objective(models.Model):
name = models.CharField(max_length=200)
description = models.CharField(max_length=240, blank=True)
def __unicode__(self):
return self.name
class How(models.Model):
n... |
""" Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (<EMAIL>).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This ... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.algebra
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for computer algebra systems.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from py... |
"""
test_groups
----------------------------------
Functional tests for `shade` keystone group resource.
"""
import openstack.cloud
from openstack.tests.functional.cloud import base
class TestGroup(base.BaseFunctionalTestCase):
def setUp(self):
super(TestGroup, self).setUp()
i_ver = self.operat... |
__authors__ = ["S Thery, M Glass, M Sanchez del Rio - ESRF ISDD Advanced Analysis and Modelling"]
__license__ = "MIT"
__date__ = "31/08/2016"
import unittest
import numpy as np
import scipy.constants as codata
from pySRU.MagneticStructureUndulatorPlane import MagneticStructureUndulatorPlane as Undulator
from pySRU.El... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Join article names for the popular concepts found in each community
"""
from collections import defaultdict
import glob, os
IN_DIR = "../../../DATA/CV"
#########################################################
# SR
###################################################... |
import sys
sys.path.append( '../pymod' )
import gdaltest
###############################################################################
# Read a truncated and modified version of arvidson_original.cub from
# ftp://ftpflag.wr.usgs.gov/dist/pigpen/venus/venustopo_download/ovda_dtm.zip
def isis2_1():
tst = gdalt... |
from roglick.dungeon.base import Map,Room,Tile
from roglick.dungeon import tiles
from roglick.lib import libtcod
class Cave(object):
def __init__(self):
self.cells = []
@property
def center(self):
if 0 >= self.size:
return None
sum_x = 0
sum_y = 0
for ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: aci_rest
short_description: Direct access to the Cisco APIC ... |
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import socket
import struct
import re
import logging
from shadowsocks import common, lru_cache, eventloop, shell
CACHE_SWEEP_INTERVAL = 30
VALID_HOSTNAME = re.compile(br"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
com... |
"""
Balanced neuron example
-----------------------
This script simulates a neuron driven by an excitatory and an
inhibitory population of neurons firing Poisson spike trains. The aim
is to find a firing rate for the inhibitory population that will make
the neuron fire at the same rate as the excitatory population.
O... |
from __future__ import division
import base64
import random
import tempfile
from twisted.internet import defer, reactor
from twisted.python import failure
from twisted.trial import unittest
from twisted.web import client, resource, server
from p2pool import data, node, work
from p2pool.bitcoin import data as bitcoin... |
"""Utilities for views (text and number formatting, etc)"""
import math
import datetime
def big_filesizeformat(bytes):
if bytes is None or bytes is "":
return "N/A"
assert bytes >= 0
# Special case small numbers (including 0), because they're exact.
if bytes < 1024:
return "%d B" % bytes
units = ... |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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
version 2.1 of the License, ... |
# Homework 7 for Principles of Computing class, by k., 08/01/2014
# class Puzzle from program template at http://www.codeskulptor.org/#poc_fifteen_template.py
'''
Loyd's Fifteen puzzle - solver and visualizer
Note that solved configuration has the blank (zero) tile in upper left
Use the arrows key to swap this tile w... |
from boto.ec2.elb.listelement import ListElement
class Listener(object):
"""
Represents an EC2 Load Balancer Listener tuple
"""
def __init__(self, load_balancer=None, load_balancer_port=0,
instance_port=0, protocol='', ssl_certificate_id=None, instance_protocol=None):
self.lo... |
import json
import time
try:
import boto
import boto.cloudformation.connection
except ImportError:
print "failed=True msg='boto required for this module'"
sys.exit(1)
def boto_exception(err):
'''generic error message handler'''
if hasattr(err, 'error_message'):
error = err.error_messa... |
import sys, time
sys.path.append('lib')
import ht3_worker
configurationfilename='./etc/config/HT3_db_cfg.xml'
logfilename="ht_logger.log"
#### reconfiguration has to be done in configuration-file ####
HT3_logger=ht3_worker.ht3_cworker(configurationfilename, hexdump_window=False, gui_active=False, logfilename_in=... |
#!/usr/bin/env python
from lxml import html
import os
import requests
import shutil
import urllib
def main():
if not os.path.exists("SearchPlugins"):
os.makedirs("SearchPlugins")
locales = getLocaleList()
for locale in locales:
files = getFileList(locale)
if files == None:
... |
from django.contrib import messages
from django.core.paginator import Paginator
from django.shortcuts import redirect
from django.utils.translation import ungettext, ugettext_lazy, ugettext as _
from misago.threads import moderation
from misago.threads.views.generic.actions import ActionsBase, ReloadAfterDelete
__al... |
"""Class of Augeas Configurators."""
import logging
import augeas
from letsencrypt import errors
from letsencrypt import reverter
from letsencrypt.plugins import common
from letsencrypt_apache import constants
logger = logging.getLogger(__name__)
class AugeasConfigurator(common.Plugin):
"""Base Augeas Configu... |
"""
Clang Enumerations
==================
This module provides static definitions of enumerations that exist in libclang.
Enumerations are typically defined as a list of tuples. The exported values are
typically munged into other types or classes at module load time.
All enumerations are centrally defined in this fi... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ZonalStatistics.py
---------------------
Date : August 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
**********... |
"""
Django Model baseclass for database-backed configuration.
"""
from django.db import connection, models
from django.contrib.auth.models import User
from django.core.cache import caches, InvalidCacheBackendError
from django.utils.translation import ugettext_lazy as _
try:
cache = caches['configuration'] # pylin... |
import unittest
import pytest
from selenium.webdriver.support.wait import WebDriverWait
class WindowTests(unittest.TestCase):
@pytest.mark.ignore_chrome
@pytest.mark.ignore_opera
@pytest.mark.ignore_ie
def testShouldMaximizeTheWindow(self):
resize_timeout = 5
wait = WebDriverWait(sel... |
{
'name': 'Address Book',
'version': '1.0',
'category': 'Tools',
'description': """
This module gives you a quick view of your address book, accessible from your home page.
You can track your suppliers, customers and other contacts.
""",
'author': 'OpenERP SA',
'website': 'https://www.odoo.com/p... |
from __future__ import unicode_literals, print_function
import os
import sys
import subprocess
import json
from ape import feaquencer
from ape import tasks
from .exceptions import ContainerError, ContainerNotFound, ProductNotFound
class Config(object):
APE_ROOT = os.environ['APE_ROOT_DIR']
SOURCE_HEADER = '#... |
"""
Strava OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/strava.html
"""
from social.backends.oauth import BaseOAuth2
class StravaOAuth(BaseOAuth2):
name = 'strava'
AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token... |
"""
Base Graph class
#--Version 2.1
#--Bob Ippolito October, 2004
#--Version 2.0
#--Istvan Albert June, 2004
#--Version 1.0
#--Nathan Denny, May 27, 1999
"""
from altgraph import GraphError
from compat import *
class Graph(object):
"""
The Graph class represents a directed graph with C{N} nodes and C{E} ... |
from pele.potentials import BasePotential
import numpy as np
__all__ = ["GMINPotential"]
class GMINPotential(BasePotential): # pragma: no cover
"""
Interface to fortran GMIN potential
Potentials implemented in GMIN can be called from python if GMIN is compiled with the flag WITH_PYTHON enabled. This cr... |
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import test
class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
"""
Tests Flavor Extra Spec API extension.
SET, UNSET, UPDATE Flavor Extra specs require admin privileges.
GET Flavor Extra specs can... |
import os
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
'openstackdocstheme',]
# autodo... |
from django.template import Library
from django.template import defaulttags
register = Library()
@register.tag
def ssi(parser, token):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
return defaulttags.ssi(parser, token)
@register.tag
def url(parser, token):
# Used for deprecation pa... |
"""Support for Brunt Blind Engine covers."""
import logging
from brunt import BruntAPI
import voluptuous as vol
from homeassistant.components.cover import (
ATTR_POSITION,
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
CoverDevice,
)
from homeassistant.const import ATTR_A... |
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='scirius',
version='2.0',
packa... |
"""
This is a set of utilities for faster development with Django templates.
Template loaders that load from the app/template/model directories
'templates' folder when you specify an app prefix ('app/template.html').
It's possible to register global template libraries by adding this to your
settings:
GLOBALTA... |
import alsaaudio
from math import pi, sin, pow
import getch
SAMPLE_RATE = 44100
FORMAT = alsaaudio.PCM_FORMAT_U8
PERIOD_SIZE = 512
N_SAMPLES = 1024
notes = "abcdefg"
frequencies = {}
for i, note in enumerate(notes):
frequencies[note] = 440 * pow(pow(2, 1/2), i)
# Generate the sine wave, centered at y=128 with 10... |
import logging
from Orphereus.lib.base import *
from Orphereus.model import *
from sqlalchemy.orm import eagerload
import os
import datetime
from Orphereus.lib.miscUtils import *
from Orphereus.lib.constantValues import *
from OrphieBaseController import OrphieBaseController
log = logging.getLogger(__name__)
class ... |
"""Class representing instrumentation test apk and jar."""
import os
from devil.android import apk_helper
from pylib.instrumentation import test_jar
class TestPackage(test_jar.TestJar):
def __init__(self, apk_path, jar_path, test_support_apk_path):
test_jar.TestJar.__init__(self, jar_path)
if not os.path... |
r"""
================================================================
Robust covariance estimation and Mahalanobis distances relevance
================================================================
An example to show covariance estimation with the Mahalanobis
distances on Gaussian distributed data.
For Gaussian dis... |
'''
Report tool
===========
This tool is a helper for users. It can be used to dump information
for help during the debugging process.
'''
import os
import sys
import time
from time import ctime
from configparser import ConfigParser
from io import StringIO
from xmlrpc.client import ServerProxy
import kivy
report =... |
from django.db.models import Q
from django.core.exceptions import PermissionDenied
from cpro import models
############################################################
# Cards
def filterCards(queryset, parameters, request):
if request.user.is_authenticated():
request.user.all_accounts = request.user.accou... |
import calendar
import time
import unittest
import random
import pytest
from selenium.test.selenium.webdriver.common import utils
class CookieTest(unittest.TestCase):
def setUp(self):
self._loadPage("simpleTest")
# Set the cookie to expire in 30 minutes
timestamp = calendar.timegm(time.gm... |
import conf
from base import BaseDbObj
class SqliteDbObj(BaseDbObj):
def __init__(self):
try:
import sqlite3 as sqlite
except ImportError:
from pysqlite2 import dbapi2 as sqlite
self.connection = sqlite.connect(self.db_name)
self.cursor = self.connection.cur... |
import cPickle
import cStringIO as StringIO
import pickle
import mechanize
import mechanize._response
import mechanize._testcase
def pickle_and_unpickle(obj, implementation):
return implementation.loads(implementation.dumps(obj))
def test_pickling(obj, check=lambda unpickled: None):
check(pickle_and_unpick... |
from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Inner, OuterA, OuterB, Poll
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.... |
"""This module implements the Scraper component which parses responses and
extracts information from them"""
from collections import deque
from twisted.python.failure import Failure
from twisted.internet import defer
from scrapy.utils.defer import defer_result, defer_succeed, parallel, iter_errback
from scrapy.utils... |
'''
Created on 21/02/2013
@author: u76345
'''
import os
import sys
import logging
import re
import numpy
from datetime import datetime, time
from osgeo import gdal
from agdc.stacker import Stacker
from EOtools.utils import log_multiline
from EOtools.stats import temporal_stats
SCALE_FACTOR = 10000
# Set top level s... |
#!/usr/bin/env python
import sys
import smtplib
from optparse import OptionParser
from email.mime.text import MIMEText
import json
from datetime import datetime
try:
from sensu import Handler
except ImportError:
print('You must have the sensu Python module i.e.: pip install sensu')
sys.exit(1)
class MailHa... |
import json
import logging
import os
import sys
import salt.cli.caller
import salt.config
from salt import exceptions
import yaml
WORKING_DIR = os.environ.get('HEAT_SALT_WORKING',
'/var/lib/heat-config/heat-config-salt')
SALT_MINION_CONFIG = os.environ.get('SALT_MINION_CONFIG',
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: bigip_wait
short_description: Wait for a BIG-IP con... |
from time import sleep
from webiopi.utils.version import BOARD_REVISION, VERSION
from webiopi.utils.logger import setInfo, setDebug, info, debug, warn, error, exception
from webiopi.utils.thread import runLoop
from webiopi.server import Server
from webiopi.devices.instance import deviceInstance
from webiopi.decorator... |
from portage.tests import TestCase
from portage.dep import get_required_use_flags
from portage.exception import InvalidDependString
class TestCheckRequiredUse(TestCase):
def testCheckRequiredUse(self):
test_cases = (
("a b c", ["a", "b", "c"]),
("|| ( a b c )", ["a", "b", "c"]),
("^^ ( a b c )", ["a", "b... |
"""Admin definition for Bonus Points widget."""
from django.shortcuts import render_to_response
from django.template import RequestContext
from apps.admin.admin import challenge_designer_site, challenge_manager_site, developer_site
'''
Created on Aug 5, 2012
@author: Cam Moore
'''
from django.contrib import admin
f... |
from pycuda.tools import context_dependent_memoize
# from neon.backends.cuda_templates import (_ew_template,
# _stage_template,
# _fin_template,
# _init_rand_func,
# ... |
from security_monkey.views import AuthenticatedService
from security_monkey.views import __check_auth__
from security_monkey.views import USER_SETTINGS_FIELDS
from security_monkey.datastore import Account
from security_monkey.datastore import User
from security_monkey import db
from security_monkey import api
from fla... |
import threading
from testutils import unittest, ConnectingTestCase, skip_before_postgres, slow
import psycopg2
from psycopg2.extensions import (
ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY)
class TransactionTests(ConnectingTestCase):
def setUp(self):
ConnectingTestCase.setUp(self)
... |
import mrp
import stock
import product
import wizard
import report
import company
import procurement
import res_config |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core import management
from django.test import TestCase
from django.utils.six import StringIO
from .models import (
Car, CarDriver, Driver, Group, Membership, Person, UserMembership,
)
class M2MThroughTestCase(TestCa... |
# -*- coding: utf-8 -*-
import datetime
from dateutil import relativedelta
from openerp import tools, SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import slug
from openerp.addons.web.http import request
class MailGroup(http.Controller):
_thread_per_page = 20
_r... |
"""SDLRPCV2 XML parser unit test."""
import os
import unittest
import generator.Model
import generator.parsers.SDLRPCV2
class TestSDLRPCV2Parser(unittest.TestCase):
"""Test for SDLRPCV2 xml parser."""
class _Issue:
def __init__(self, creator, value):
self.creator = creator
s... |
import logging
import datetime
import hashlib
import os
import re
import time
import urllib
import urlparse
import jinja2
GITHUB_VIEW_TEMPLATE = 'https://github.com/%s/blob/%s/%s#L%s'
GITHUB_COMMIT_TEMPLATE = 'https://github.com/%s/commit/%s'
LINKIFY_RE = re.compile(
r'(^\s*/\S*/)(kubernetes/(\S+):(\d+)(?: \+0x[... |
"""A `Predictor` constructed from a `SavedModel`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from tensorflow.contrib.predictor import predictor
from tensorflow.contrib.saved_model.python.saved_model import reader
from tensorflow.cont... |
"""
Widgets specific to search mode
"""
import urwid
from ..settings.const import settings
from ..helper import shorten_author_string
from .utils import AttrFlipWidget
from .globals import TagWidget
class ThreadlineWidget(urwid.AttrMap):
"""
selectable line widget that represents a :class:`~alot.db.Thread`
... |
import lldb
import re
import testutils as test
# bpmd -md <MethodDesc pointer>
def runScenario(assembly, debugger, target):
process = target.GetProcess()
res = lldb.SBCommandReturnObject()
ci = debugger.GetCommandInterpreter()
# Run debugger, wait until libcoreclr is loaded,
# set breakpoint at ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.