content
string
import random import warnings from time import time from collections import deque from functools import partial from twisted.internet import reactor, defer from twisted.python.failure import Failure from scrapy.utils.defer import mustbe_deferred from scrapy.utils.signal import send_catch_log from scrapy.utils.httpobj...
"""This module provides unit tests for the ``tigerlily.grc.genome`` module. As with all unit test modules, the tests it contains can be executed in many ways, but most easily by going to the project root dir and executing ``python3 setup.py nosetests``. """ import unittest import tempfile import os import shutil imp...
#!/usr/bin/python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import * import time import os import re import sys import datetime sys.path.append('/usr/share/subterfuge') #Ignore Deprication Warnings import warnings warnings.filterwarnings("ignore", category...
from importlib import import_module from unittest.case import SkipTest from fuel.utils import find_in_data_path from fuel import config def skip_if_not_available(modules=None, datasets=None, configurations=None): """Raises a SkipTest exception when requirements are not met. Parameters ---------- mod...
from opus_core.variables.variable import Variable from urbansim.functions import attribute_label from variable_functions import my_attribute_label class number_of_surveyed_households(Variable): """Number of households in a given gridcell""" _return_type="int32" surveyed_households_starting_id = 50...
"""Test various net timeouts. - Create three bitcoind nodes: no_verack_node - we never send a verack in response to their version no_version_node - we never send a version (only a ping) no_send_node - we never send any P2P message. - Start all three nodes - Wait 1 second - Assert that we're connected - S...
""" Tests for L{twisted.words.im.ircsupport}. """ from twisted.trial.unittest import TestCase from twisted.test.proto_helpers import StringTransport from twisted.words.im.basechat import Conversation, ChatUI from twisted.words.im.ircsupport import IRCAccount, IRCProto class StubConversation(Conversation): def ...
""" DataStore is the service for inserting accounting reports (rows) in the Accounting DB This service CAN be duplicated iff the first is a "master" and all the others are slaves. """ import datetime from DIRAC import S_OK, S_ERROR, gConfig, gLogger from DIRAC.AccountingSystem.DB.MultiAccountingDB import MultiA...
#!/usr/bin/env python # -*- coding: utf-8 -*- #---------------------------------------------------------------------- # Setup script for carlae package import sys from setuptools import setup, find_packages ### CONFIGURE BUILD VARIABLES VERSION = "0.0.2" ### END OF CONFIGURATION # Get requirements from file with op...
# -*- coding: utf-8 -*- from amzqr.mylibs.constant import alig_location, format_info_str, version_info_str, lindex def get_qrmatrix(ver, ecl, bits): num = (ver - 1) * 4 + 21 qrmatrix = [[None] * num for i in range(num)] # [([None] * num * num)[i:i+num] for i in range(num * num) if i % num == 0] ...
__copyright__ = "Uwe Krien" __license__ = "GPLv3" import config as cfg import os from oemof.tools import logger class ConfigurationDe21: def __init__(self): self.pattern = dict() self.files = dict() self.general = dict() self.url = dict() self.pv = dict() target_...
"""Tests for tf.GrpcServer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.client import session from tensorflow.python.framework import errors_impl from tensorflow.python.framework import ops from tensorflow.python.ops import var...
from openerp.addons.resource.tests import test_resource checks = [ test_resource, ] # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
"""CalendarResourceClient simplifies Calendar Resources API calls. CalendarResourceClient extends gdata.client.GDClient to ease interaction with the Google Apps Calendar Resources API. These interactions include the ability to create, retrieve, update, and delete calendar resources in a Google Apps domain. """ __au...
""" Utilities for writing plugins. This is different from bokeh.pluginutils because these are ways of patching routes and objects directly into the bokeh server. You would run this type of code using the --script option """ from __future__ import absolute_import import uuid from flask import abort, render_template...
{ 'name': 'Switzerland Country States', 'category': 'Localisation', 'summary': '', 'version': '8.0.1.0.0', 'author': 'copado MEDIA UG, Odoo Community Association (OCA)', 'website': 'http://www.copado.de', 'license': 'AGPL-3', 'depends': [ 'base', ], 'data': ['data/res_cou...
import unittest import os import random import shutil import sys import py_compile import warnings import marshal from test.test_support import unlink, TESTFN, unload, run_unittest, check_warnings def remove_files(name): for f in (name + os.extsep + "py", name + os.extsep + "pyc", name...
""" Generate a 5-frame trajectory that is pretty degenerates so is good for testing. It starts from (0,0,0) and moves in a straight line on the x axis, at a slow velocity. """ import numpy as np from optv.calibration import Calibration from optv.parameters import ControlParams from optv.imgcoord import image_coordina...
import sys from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import SJISDistributionAnalysis from .jpcntx import SJISContextAnalysis from .mbcssm import SJISSMModel from . import constants class SJISProber(MultiByteCharSetProber): def __i...
"""Writes events to disk in a logdir.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.op...
from __future__ import absolute_import from . import util as testutil from sqlalchemy import pool, orm, util from sqlalchemy.engine import default, url from sqlalchemy.util import decorator from sqlalchemy import types as sqltypes, schema, exc as sa_exc import warnings import re from .exclusions import db_spec, _is_ex...
from msrest.serialization import Model class GatewayRoute(Model): """Gateway routing details. Variables are only populated by the server, and will be ignored when sending a request. :ivar local_address: The gateway's local address :vartype local_address: str :ivar network: The route's networ...
import functools import os from appengine_wrappers import GetAppVersion from compiled_file_system import CompiledFileSystem from copy import deepcopy from file_system import FileNotFoundError from mock_file_system import MockFileSystem from object_store_creator import ObjectStoreCreator from test_file_system import Te...
# -*- coding: utf-8 -*- """ Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U This file is part of Orion Context Broker. Orion Context Broker is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation,...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class CourseSchedule(Document): def validate(self): self.instructor_name = frappe.db.get_value("Instructor", self.instructor, "instructor_name") self.set_title() self.validate_mandatory() self...
"""Tests to ensure that the lxml tree builder generates good trees.""" import re import warnings try: import lxml.etree LXML_PRESENT = True LXML_VERSION = lxml.etree.LXML_VERSION except ImportError, e: LXML_PRESENT = False LXML_VERSION = (0,) if LXML_PRESENT: from bs4.builder import LXMLTreeB...
from django.conf.urls.defaults import * from django.contrib.comments.urls import urlpatterns from osl_comments.models import OslComment urlpatterns += patterns('osl_comments.views', (r'^comment/(?P<comment_id>\d+)/$', 'get_comment'), (r'^delete_comment/(?P<comment_id>\d+)/$', 'delete_comment'), (r'^delete...
""" ======================== Cycle finding algorithms ======================== """ # Copyright (C) 2010-2012 by # Aric Hagberg <<EMAIL>> # Dan Schult <<EMAIL>> # Pieter Swart <<EMAIL>> # All rights reserved. # BSD license. from collections import defaultdict import networkx as nx from networkx.utils...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} # pylint: disable=W0703 def truncate_before(value, srch): """ Return content of str before the srch parameters. """ before_index = value.find(srch) if (before_index...
"""Tests for DELF feature aggregation.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl import flags import numpy as np import tensorflow as tf from delf import aggregation_config_pb2 from delf import feature_aggregation_extractor F...
from __future__ import unicode_literals import re import json import base64 from .common import InfoExtractor from ..utils import ( unescapeHTML, ExtractorError, determine_ext, int_or_none, ) class OoyalaBaseIE(InfoExtractor): def _extract_result(self, info, more_info): embedCode = info[...
"Dummy cache backend" from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): key = self.make_key...
""" A container of sheets No caching. """ from cheat import cheatsheets from cheat.utils import * import os def default_path(): """ Returns the default cheatsheet path """ # determine the default cheatsheet dir default_sheets_dir = os.environ.get('DEFAULT_CHEAT_DIR') or os.path.join(os.path.expanduser('...
import unittest import re import textwrap import antlr3 import testbase # Left-recursion resolution is not yet enabled in the tool. # class TestLeftRecursion(testbase.ANTLRTest): # def parserClass(self, base): # class TParser(base): # def __init__(self, *args, **kwargs): # bas...
from bokeh.charts import Bar, output_file, show, vplot, hplot, defaults from bokeh.sampledata.autompg import autompg as df df['neg_mpg'] = 0 - df['mpg'] defaults.width = 450 defaults.height = 350 bar_plot = Bar(df, label='cyl', title="label='cyl'") bar_plot2 = Bar(df, label='cyl', bar_width=0.4, title="label='cyl' ...
from alembic import op import sqlalchemy as sa OVS_PLUGIN = ('neutron.plugins.openvswitch.ovs_neutron_plugin' '.OVSNeutronPluginV2') CISCO_PLUGIN = 'neutron.plugins.cisco.network_plugin.PluginV2' def should_run(active_plugins, migrate_plugins): if '*' in migrate_plugins: return True els...
import unittest import imath import IECore import Gaffer import GafferTest class NameValuePlugTest( GafferTest.TestCase ) : def assertPlugSerialises( self, plug ): s = Gaffer.ScriptNode() s["n"] = Gaffer.Node() s["n"]["p"] = plug s2 = Gaffer.ScriptNode() s2.execute( s.serialise() ) self.assertEqual(...
# Numbers game # # Hawk and his little brother, Stone, are playing a little game with # the following rules. Initially 8 random integers, from 1 to 100 (inclusive), # are laid on the table for both players to see. The players then have # 2 minutes to construct a sequence of numbers, from the given 8 numbers...
#!/usr/bin/python import sys from .common import FAILURE, SUCCESS from .dbmake_cli import get_command, print_help, get_command_class_reference from .common import CommandNotExists, BadCommandArguments, DBMAKE_VERSION class App: def __init__(self): self.ide_stop_bothering_with_static_method = "!!!" ...
import numpy as np from bokeh.plotting import figure, show, output_file, vplot N = 9 x = np.linspace(-2, 2, N) y = x**2 sizes = np.linspace(10, 20, N) xpts = np.array([-.09, -.12, .0, .12, .09]) ypts = np.array([-.1, .02, .1, .02, -.1]) output_file("glyphs.html", title="glyphs.py example") vplot = vplot() p = fi...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging import os from collections import MutableSet from datetime import datetime, date, time from sqlalchemy import Column, U...
from base import VideoType from vidscraper.sites import google_video class GoogleVideoType(VideoType): abbreviation = 'G' name = 'video.google.com' site = 'video.google.com' def convert_to_video_url(self): return self.format_url(self.url) @classmethod def matches_video_url...
""" Django settings for main project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os #...
#!/usr/bin/python from matplotlib.patches import Rectangle, Circle, RegularPolygon, Arrow from fitness import FITNESS_SECTION class BasicDrawing(object): def __init__(self,config): self.config = config self.grid_x = self.config.getint(FITNESS_SECTION,"grid_x") self.grid_y = self....
# -*- coding: utf-8 -*- #!/usr/bin/env python import warnings import pandas as pd import numpy as np import scipy.cluster.hierarchy as hac from dots_arrays import Experiment from sklearn.decomposition import PCA from itertools import combinations from scipy.stats import ttest_ind, f_oneway from statsmodels.stats.multi...
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
#!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.uic import * from blur.Stone import * from blur.Classes import * from blur.Classesui import HostSelector from blur.absubmit import Submitter from blur import RedirectOutputToLog import sys import time import os.path import r...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.action.normal import ActionModule as _ActionModule class ActionModule(_ActionModule): def run(self, tmp=None, task_vars=None): if self._play_context.connection != 'network_cli': retur...
''' Script to check the correctness of the analysis. The analysis is done on raw data and all results are compared to a recorded analysis. ''' import os import shutil import unittest from testbeam_analysis import track_analysis from testbeam_analysis.tools import analysis_utils, test_tools testing_path = os.path.dirn...
from util import * from resources import * class MainWindowOverlay(object): @staticmethod def _register_tab_prefs(settings): settings.register("TabPanelAssignments", dict, {}) @staticmethod def _update_tab_prefs(settings,mw,layout): # log1("Updating prefs for layout %s", layout) import copy tab...
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from rest_framework import routers from comments.serializers import CommentViewSet from comments.views import...
"""Keras data preprocessing utils.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.keras.api.keras.preprocessing import image from tensorflow.contrib.keras.api.keras.preprocessing import sequence from tensorflow.contrib.keras.api....
#!/usr/bin/env python3 # This file is part of ofxstatement-austrian. # See README.rst for more information. import csv import re from ofxstatement import statement from ofxstatement.parser import CsvStatementParser from ofxstatement.plugin import Plugin from ofxstatement.statement import generate_transaction_id from o...
""" Expressions ----------- Offer fast expression evaluation through numexpr """ import warnings import numpy as np from pandas.core.common import _values_from_object from pandas.core.computation.check import _NUMEXPR_INSTALLED from pandas.core.config import get_option if _NUMEXPR_INSTALLED: import numexpr as n...
"""Waterfall monitoring script. This script checks all builders specified in the config file and sends status email about any step failures in these builders. This also reports a build as failure if the latest build on that builder was built 2 days back. (Number of days can be configured in the config file) ...
''' Created on May 16, 2011 @author: bungeman ''' import sys import getopt import bench_util def usage(): """Prints simple usage information.""" print '-o <file> the old bench output file.' print '-n <file> the new bench output file.' print '-h causes headers to be output.' print '-f <fieldSp...
#!/usr/bin/env python3 # Written by Chesley Tan. # Tweaked by Will Smith. import traceback import time import sys import math import itertools import cv2 import numpy as np import shm from vision.modules.base import ModuleBase from vision.framework.color import bgr_to_lab, elementwise_color_dist, range_threshold fro...
import logging from superdesk.resource import Resource from superdesk.services import BaseService from superdesk.errors import SuperdeskApiError logger = logging.getLogger(__name__) class RuleSetsResource(Resource): schema = { 'name': { 'type': 'string', 'iunique': True, ...
"""Views for Pages module.""" import six from flask import Blueprint, request, render_template, current_app from flask.ctx import after_this_request from sqlalchemy import event from sqlalchemy.orm.exc import NoResultFound from werkzeug.exceptions import NotFound from invenio.base.globals import cfg from invenio.ext...
from openerp.tests import common from openerp.exceptions import Warning from openerp import netsvc from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF from openerp.tools.config import config from datetime import date from random import randint import logging logger = logging.getLogger(__name__) class test_mes...
"""DNS rdatasets (an rdataset is a set of rdatas of a given type and class)""" import random from io import StringIO import struct import dns.exception import dns.rdatatype import dns.rdataclass import dns.rdata import dns.set from ._compat import string_types # define SimpleSet here for backwards compatibility Simp...
#!/usr/bin/env python import sys, os, re from hashlib import md5 import primer3 import pysam import subprocess from collections import defaultdict, OrderedDict '''just a wrapper for pysam''' class MultiFasta(object): def __init__(self,file): self.file = file def createPrimers(self,db,bowtie='bowtie2'...
""" Tests for the linecache module """ import linecache import unittest import os.path from test import support FILENAME = linecache.__file__ INVALID_NAME = '!@$)(!@#_1' EMPTY = '' TESTS = 'inspect_fodder inspect_fodder2 mapping_tests' TESTS = TESTS.split() TEST_PATH = os.path.dirname(support.__file__) MODULES = "li...
"""Minio helper methods.""" from collections.abc import Iterable import json import logging from queue import Queue import re import threading import time from typing import Iterator, List from urllib.parse import unquote from minio import Minio from urllib3.exceptions import HTTPError _LOGGER = logging.getLogger(__n...
import os import socket import subprocess from charms import layer from charms.reactive import when from charmhelpers.core import hookenv from charms.layer import nginx from subprocess import Popen from subprocess import PIPE from subprocess import STDOUT @when('certificates.available') def request_server_certific...
""" GravMag: Calculate the gravity disturbance and Bouguer anomaly for Hawaii """ from fatiando.gravmag import normal_gravity from fatiando.vis import mpl import numpy as np import urllib # Download the gravity and topography data url = 'https://raw.githubusercontent.com/leouieda/geofisica1/master/data/' urllib.urlret...
""" A saml2 backend module for the satosa proxy """ import copy import functools import json import logging from base64 import urlsafe_b64encode from urllib.parse import urlparse from saml2.client_base import Base from saml2.config import SPConfig from saml2.extension.ui import NAMESPACE as UI_NAMESPACE from saml2.met...
import errno import fcntl import os import json class NullResource(object): """ Implments the lock interface for spawn. """ def __init__(self, *args, **kwargs): self.owned = False def remove(self): pass def __enter__(self): return self def __exit__(self, exc_type, exc_va...
import argparse import collections import csv import json import os import random import re import subprocess import sys import time import urllib2 import zlib BASE_DIR = os.path.dirname(os.path.abspath(__file__)) OWNERS_PATH = os.path.abspath( os.path.join(BASE_DIR, '..', 'test', 'test_owners.csv')) OWNERS_JSON_P...
{ 'name': 'Partner Assignation & Geolocation', 'version': '1.0', 'category': 'Customer Relationship Management', 'description': """ This is the module used by OpenERP SA to redirect customers to its partners, based on geolocation. =========================================================================...
#!/usr/bin/env python """Threshold Graphs ================ """ from nose.tools import * from nose import SkipTest from nose.plugins.attrib import attr import networkx as nx import networkx.algorithms.threshold as nxt from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic cnlti = nx.convert_no...
# -*- coding: utf-8 -*- from django.conf import settings from django.template import RequestContext from django.template.loader import render_to_string from django.contrib.contenttypes.models import ContentType from django.http import Http404 from djangorestframework.response import Response, ErrorResponse from django...
#! /usr/bin/env python import requests from requests.auth import HTTPBasicAuth import sys if len(sys.argv) != 6: print "usage: create-flow onos-node name device in-port out-port" sys.exit(1) node = sys.argv[1] name = sys.argv[2] device = sys.argv[3] inPort = sys.argv[4] outPort = sys.argv[5] flowJsonTemp...
""" LICENCE ------- Copyright 2015 by Kitware, Inc. All Rights Reserved. Please refer to KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. """ from . import Indexer import cPickle import os.path as osp import numpy from sklearn.naive...
from __future__ import absolute_import from __future__ import print_function import getopt import sys import happy.HappyNodeEdit from happy.Utils import * if __name__ == "__main__": options = happy.HappyNodeEdit.option() try: opts, args = getopt.getopt(sys.argv[1:], "hi:n:qasl", ...
from __future__ import unicode_literals from django.db import models class Parceiro(models.Model): #Na verdade é o Cliente com nome mais bonito nome_parceiro = models.CharField(max_length=255) nome_representante = models.CharField(max_length=255) telefone = models.CharField(max_length=255) email = ...
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.models import Group from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.views.decorators.vary import ...
from pykickstart.base import * from pykickstart.version import * class FC5Handler(BaseHandler): version = FC5
#!/usr/bin/python3 ''' Created on Aug 18, 2019 @author: johnrabsonjr ''' # potential colors are WHITE, PERIWINKLE, YELLOW, GREEN, VIOLET, BLUE, RED, BLACK import os from time import sleep from atxraspisettings import * os.system('systemctl stop atxraspihello') # Stop the shutdownirq.py script daemon setup_gpio()...
def _Qperm(user=None): from django.db.models.query import Q exQ = Q() if user is None or user.is_anonymous(): exQ = (Q(user_type__exact = 'A') | Q(user_type__exact = 'E')) & Q( groups__isnull=True) elif user.is_superuser: exQ = ~Q(user_type__exact = 'A') elif user.is_staf...
from django.conf import settings from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.models import AnonymousUser from django.utils.translation import ugettext as _ from oauth.oauth import OAuthError from oauth_provider.decorators import CheckOAuth from oauth_provider.utils impor...
## Bokeh server for MultiSelect import pandas as pd from bokeh.io import curdoc from bokeh.layouts import row from bokeh.models import ColumnDataSource from bokeh.models.widgets import MultiSelect from bokeh.plotting import figure x=[3,4,6,12,10,1] y=[7,1,3,4,1,6] label=['Red', 'Orange', 'Red', 'Orange','Red', 'Orange...
''' This is a standalone script that is to be used to load the vocab into the server's mongo database. This only needs to be run once, with the appropriate vocabulary on the filesystem as a one column flat list text file. ''' import re import sys import pymongo as pm from optparse import OptionParser ''' Thi...
from .vitollino import Cena from .vitollino import Sala from .vitollino import Salao from .vitollino import Labirinto from .vitollino import Elemento from .vitollino import Popup from .vitollino import INVENTARIO from .vitollino import Portal from .vitollino import Droppable from .vitollino import Dropper from .vitolli...
from cyphesis.Thing import Thing from atlas import * from Vector3D import Vector3D # bbox = 8,8,2.5 # bmedian = 7.5,7.5,2.5 # offset = SW corner = -0.5,-0.5,0 class Farmhouse_deco_1(Thing): def setup_operation(self, op): ret = Oplist() # South wall loc = Location(self, Vector3D(-0.5,-0.5,0)) ...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} import syslog from ansible.module_utils.pycompat24 import get_exception from ansible.module_utils.basic import * class EjabberdUserException(Exception): """ Base exeption for EjabberdU...
from proteus.default_n import * from proteus import (StepControl, TimeIntegration, NonlinearSolvers, LinearSolvers, LinearAlgebraTools, NumericalFlux) import ls_consrv_p as physics from proteus import Context ct = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Module : main.py # Project : L5MapEditor # Creation date : 2015-09-24 # Description : # import math import os import sqlite3 from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSlot, Qt, QObject from PyQt5.QtGui import QCursor, QColor from PyQt5.Qt...
import logging import copy try: from zabbix_api import ZabbixAPI, ZabbixAPISubClass HAS_ZABBIX_API = True except ImportError: HAS_ZABBIX_API = False # Extend the ZabbixAPI # Since the zabbix-api python module too old (version 1.0, no higher version so far), # it does not support the 'hostinterface' api ...
try: from twisted.python.dist import setup, ConditionalExtension as Extension except ImportError: raise SystemExit("twisted.python.dist module not found. Make sure you " "have installed the Twisted core package before " "attempting to install any other Twisted projects...
from behave import given from factory.fuzzy import FuzzyChoice import tests.ggrc.behave.factories as factories from ggrc import models from ggrc_workflows.models import ( Workflow, TaskGroup, WorkflowPerson, TaskGroupObject, TaskGroupTask, Cycle, CycleTaskEntry, CycleTaskGroup, CycleTaskGroupObjec...
import gzip import os import struct import h5py import numpy from fuel.converters.base import fill_hdf5_file, check_exists MNIST_IMAGE_MAGIC = 2051 MNIST_LABEL_MAGIC = 2049 TRAIN_IMAGES = 'train-images-idx3-ubyte.gz' TRAIN_LABELS = 'train-labels-idx1-ubyte.gz' TEST_IMAGES = 't10k-images-idx3-ubyte.gz' TEST_LABELS =...
"""TestCase for reseting File ID. """ import os import shutil import unittest from test_all import db, test_support, get_new_environment_path, get_new_database_path class FileidResetTestCase(unittest.TestCase): def setUp(self): self.db_path_1 = get_new_database_path() self.db_path_2 =...
import sys PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from androguard.core.androgen import AndroguardS from androguard.core.androgen import AndroguardS from androguard.core.analysis import analysis TEST_CASE = "examples/android/TestsAndroguard/bin/classes.dex" def test(got, expected): if got == expecte...
#!/usr/bin/env python import argparse import glob import os import shutil import sys from lib.config import PLATFORM, get_target_arch, s3_config from lib.util import safe_mkdir, scoped_cwd, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DIST_DIR = os.path.join(SOURCE_ROOT, 'dist'...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import threading import time class ReportingError(Exception): pass class EmitterThread(threading.Thread): """Periodically flush the report buffers. This thr...
from scapy.layers.l2 import ARP from scapy.layers.inet6 import ICMPv6ND_NS, ICMPv6ND_NA, IPv6 from framework import VppTestCase """ TestArping is a subclass of VPPTestCase classes. Basic test for sanity check of arping. """ class TestArping(VppTestCase): """ Arping Test Case """ @classmethod def set...
from __future__ import absolute_import import os import json import collections import itertools __all__ = [ 'dirpath_to_confpath', 'confpath_to_dirpath', 'directory_to_config' ] def dirpath_to_confpath(dirpath): if dirpath[-1] == os.sep: confpath = dirpath[:-1] + ".json" else: co...
from textwrap import dedent from docxUtils.reports import DOCXReport from docxUtils.tables import TableMaker class EpiResultTables(DOCXReport): COLUMN_WIDTHS = [1.0, 1.7, 0.75, 0.75, 1.0, 1.2, 2.6] def _build_result(self, res): rows = 0 tbl = TableMaker( self.COLUMN_WIDTHS, num...
""" The tok-tok tokenizer is a simple, general tokenizer, where the input has one sentence per line; thus only final period is tokenized. Tok-tok has been tested on, and gives reasonably good results for English, Persian, Russian, Czech, French, German, Vietnamese, Tajik, and a few others. The input should be in UT...