content
string
from django.test import TestCase, override_settings, Client from django.utils.translation import override class CsrfViewTests(TestCase): urls = "view_tests.urls" def setUp(self): super(CsrfViewTests, self).setUp() self.client = Client(enforce_csrf_checks=True) @override_settings( ...
"""`LinearOperator` acting like a tridiagonal matrix.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import check_ops from tensorflow.pyth...
import unittest, random, sys, time sys.path.extend(['.','..','py']) import h2o_hosts import h2o, h2o_cmd, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() if ...
""" Network Utilities (from web.py) """ __all__ = [ "validipaddr", "validip6addr", "validipport", "validip", "validaddr", "urlquote", "httpdate", "parsehttpdate", "htmlquote", "htmlunquote", "websafe", ] import urllib, time try: import datetime except ImportError: pass import re import socket def validip6ad...
from __future__ import unicode_literals import frappe from frappe.email import sendmail_to_system_managers from frappe.utils import get_url_to_form def execute(): wrong_records = [] for dt in ("Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Purchase Order", "Purchase Receipt", "Purchase Invoice"): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Imports of external stuff that is needed import tornado.escape import tornado.ioloop import tornado.web import logging import os,yaml import logging.handlers # import scheduling ingredients from apscheduler.schedulers.tornado import TornadoScheduler from core.jobs impor...
""" Plugin for monitoring new adds to HOs and alerting if users were not added by an admin or mod. Add mods to the config.json file either globally or on an individual HO basis. Add a "watch_new_adds": true parameter to individual HOs in the config.json file. Author: @Riptides """ import logging import hangups impo...
from django.core.files.uploadedfile import UploadedFile from django.utils.datastructures import MultiValueDict from django.utils.functional import lazy_property from django.utils import six from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured class BaseStorage(object): step_key ...
# -*- coding: utf8 -*- from urllib.request import Request, urlopen import json __all__ = 'API'.split() class DictWrapper(dict): """ dictインスタンスへインスタンス変数を追加するために使用する """ pass class BytesWrapper(bytes): """ bytesインスタンスへインスタンス変数を追加するために使用する """ pass class API: """全てのConoHa APIを呼び出すクラスのスーパークラス""" def __init__(self,...
''' This module implements the communication between - the topology view and the monitoring backend that feeds it - the log view and NOX's logger - the json command prompt and NOX's json messenger @author Kyriakos Zarifis ''' from PyQt4 import QtGui, QtCore import SocketServer import socket ...
from _common import unittest from helper import TestHelper from beets.mediafile import MediaFile class InfoTest(unittest.TestCase, TestHelper): def setUp(self): self.setup_beets() self.load_plugins('info') def tearDown(self): self.unload_plugins() self.teardown_beets() ...
import unittest from autothreadharness.harness_case import HarnessCase class Leader_9_2_19(HarnessCase): role = HarnessCase.ROLE_LEADER case = '9 2 19' golden_devices_required = 1 def on_dialog(self, dialog, title): pass if __name__ == '__main__': unittest.main()
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
from sos.plugins import Plugin, RedHatPlugin class Tuned(Plugin, RedHatPlugin): """Tuned system tuning daemon """ packages = ('tuned',) profiles = ('system', 'performance') plugin_name = 'tuned' def setup(self): self.add_cmd_output([ "tuned-adm list", "tuned-ad...
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name="shadowsocks", version="2.6.9", license='http://www.apache.org/licenses/LICENSE-2.0', description="A fast tunnel proxy that help you get through firewalls", ...
try: import DistUtilsExtra.auto except ImportError: import sys print >> sys.stderr, 'To build notifythis you need https://launchpad.net/python-distutils-extra' sys.exit(1) assert DistUtilsExtra.auto.__version__ >= '2.10', 'needs DistUtilsExtra.auto >= 2.10' import os def update_data_path(prefix, oldv...
import traceback from autotest.tko import status_lib, utils as tko_utils class parser(object): """ Abstract parser base class. Provides a generic implementation of the standard parser interfaction functions. The derived classes must implement a state_iterator method for this class to be useful. "...
#!/usr/bin/env python """ Inspired by https://github.com/mbrochh/tdd-with-django-reusable-app Thanks a lot! """ import os import sys from django.conf import settings EXTERNAL_APPS = [ 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django...
#!/usr/bin/env python """ Example Azure Handler script for Linux IaaS Update example Reads port from Public Config if present. Creates service_port.txt in resources dir. Copies the service to /usr/bin and updates it with the resource path. """ import os import sys import imp import time waagent=imp.load_source('waage...
import py, pytest import _pytest._code from _pytest.config import getcfg, get_common_ancestor, determine_setup from _pytest.main import EXIT_NOTESTSCOLLECTED class TestParseIni: def test_getcfg_and_config(self, testdir, tmpdir): sub = tmpdir.mkdir("sub") sub.chdir() tmpdir.join("setup.cfg"...
from django.test import TestCase from .models import OrderedModel class OrderTest(TestCase): def create_ordered_model_items(self): pks = [] priorities = [5, 2, 9, 1] for pk, priority in enumerate(priorities): pk += 1 model = OrderedModel(pk=pk, priority=priority) ...
# https://community.nitrous.io/tutorials/asynchronous-programming-with-python-3 import aiohttp import asyncio import itertools async def download(url, parts=16): print("URL: {}".format(url)) async def get_partial_content(_url, _part, start, end): print("Part {}/{} (Bytes {} to {})".format(_part, pa...
from oslo_policy import policy from armada.common.policies import base armada_policies = [ policy.DocumentedRuleDefault( name=base.ARMADA % 'create_endpoints', check_str=base.RULE_ADMIN_REQUIRED, description='Install manifest charts', operations=[{'path': '/api/v1.0/apply/', 'meth...
from nova.compute import api as compute_api from nova.tests.functional.v3 import api_sample_base class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3): ADMIN_API = True extension_name = "os-hypervisors" def test_hypervisors_list(self): response = self._do_get('os-hypervisors') ...
""" WSGI config for fixthecode project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION...
import numpy as np from numpy import dot, einsum from numpy import tensordot as tdot from scipy.optimize import minimize import ctm import gates def _make_double_layer_tensor(a, D): return einsum(a, [8,0,2,4,6], a.conj(), [8,1,3,5,7]).reshape([D**2]*4) def _itebd_square_fu_singlebond(a, b, abg, env): tdot(b, ...
from __future__ import unicode_literals import frappe from frappe.utils import flt, getdate, cstr from frappe import _ from datetime import date, timedelta def execute(filters=None): columns, res = [], [] validate_filters(filters) columns = get_columns() res = get_result(filters) return columns , res def valida...
"""Generates a syntax tree from a Mojo IDL file.""" import imp import os.path import sys def _GetDirAbove(dirname): """Returns the directory "above" this file containing |dirname| (which must also be "above" this file).""" path = os.path.abspath(__file__) while True: path, tail = os.path.split(path) a...
import unittest import numpy from chainer import functions from chainer import testing from chainer.testing import backend @backend.inject_backend_tests( None, # CPU tests testing.product({ 'use_cuda': [False], 'use_ideep': ['never', 'always'], }) # GPU tests + [{'use_cuda': ...
import tools from osv import osv import addons import os class WizardMultiChartsAccounts(osv.osv_memory): _inherit ='wizard.multi.charts.accounts' _defaults = { 'bank_accounts_id': False, 'code_digits': 0, 'sale_tax': False, 'purchase_tax':False } def execute(self, cr...
"""Functions for specifying custom gradients. See ${python/contrib.bayesflow.custom_gradient}. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function # go/tf-wildcard-import # pylint: disable=wildcard-import from tensorflow.contrib.bayesflow.python.ops.custom...
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
from sympy import (S, Symbol, symbols, factorial, factorial2, binomial, rf, ff, gamma, polygamma, EulerGamma, O, pi, nan, oo, zoo, simplify, expand_func, Product) from sympy.functions.combinatorial.factorials import subfactorial from sympy.functions.special.gamma_functions import u...
import logging import os import sys import tempfile from openstack_dashboard import exceptions ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) BIN_DIR = os.path.abspath(os.path.join(ROOT_PATH, '..', 'bin')) if ROOT_PATH not in sys.path: sys.path.append(ROOT_PATH) DEBUG = False TEMPLATE_DEBUG = DEBUG MET...
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import logging import logging.handlers import socket from ansible.plugins.callback import CallbackBase class CallbackModule(CallbackBase): """ logs ansible-playbook a...
# Initialize App Engine SDK if necessary try: from google.appengine.api import api_proxy_stub_map except ImportError: from .boot import setup_env setup_env() from djangoappengine.utils import on_production_server, have_appserver DEBUG = not on_production_server TEMPLATE_DEBUG = DEBUG ROOT_URLCONF = 'urls...
from __future__ import absolute_import, division, print_function class _Reasons(object): BACKEND_MISSING_INTERFACE = object() UNSUPPORTED_HASH = object() UNSUPPORTED_CIPHER = object() UNSUPPORTED_PADDING = object() UNSUPPORTED_MGF = object() UNSUPPORTED_PUBLIC_KEY_ALGORITHM = object() UNSU...
from . import libmdaxdr __all__ = ['libmdaxdr']
# coding=utf-8 import gc from django.shortcuts import _get_queryset def get_object_or_None(klass, *args, **kwargs): """ Uses get() to return an object or None if the object does not exist. klass may be a Model, Manager, or QuerySet object. All other passed arguments and keyword arguments are used in t...
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geolocation, t...
from thumbor.detectors.local_detector import CascadeLoaderDetector from thumbor.point import FocalPoint from thumbor.utils import logger HAIR_OFFSET = 0.12 class Detector(CascadeLoaderDetector): def __init__(self, context, index, detectors): super(Detector, self).__init__(context, index, detectors) ...
""" Database schema version management. """ import sys import logging from sqlalchemy import (Table, Column, MetaData, String, Text, Integer, create_engine) from sqlalchemy.sql import and_ from sqlalchemy import exceptions as sa_exceptions from sqlalchemy.sql import bindparam from migrate import exceptions fro...
# -*- coding: utf-8 -*- from .money import Money class Serializer: """Serialize a Money object for sending over the wire. It is not recommended to use the utility of this class to store in the database. This would prevent you from doing anything with aggregate functions in SQL, such as SUM, MAX,...
from __future__ import absolute_import, division, print_function import abc import binascii import inspect import sys import warnings # the functions deprecated in 1.0 and 1.4 are on an arbitrarily extended # deprecation cycle and should not be removed until we agree on when that cycle # ends. DeprecatedIn10 = Depre...
# -*- 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...
""" Yandex OpenID and OAuth2 support. This contribution adds support for Yandex.ru OpenID service in the form openid.yandex.ru/user. Username is retrieved from the identity url. If username is not specified, OpenID 2.0 url used for authentication. """ from django.utils import simplejson from urllib import urlencode ...
#!/usr/bin/env python import argparse import csv import os import pysam def break_count(bam, chrom, poslist, minpad=5, flex=1, minmapq=10): ''' ref = number of reads spanning TSD, alt = number of reads clipped at breakpoint in poslist ''' altcount = 0 refcount = 0 discards = 0 poslist = list(po...
"""ParenMatch -- An IDLE extension for parenthesis matching. When you hit a right paren, the cursor should move briefly to the left paren. Paren here is used generically; the matching applies to parentheses, square brackets, and curly braces. """ from HyperParser import HyperParser from configHandler import ...
from __future__ import (absolute_import, division) __metaclass__ = type import sys import syslog from ansible.compat.tests import unittest from ansible.compat.tests.mock import patch, MagicMock from ansible.module_utils.basic import heuristic_log_sanitize class TestHeuristicLogSanitize(unittest.TestCase): def s...
__all__ = ["PerMessageCompressOffer", "PerMessageCompressOfferAccept", "PerMessageCompressResponse", "PerMessageCompressResponseAccept", "PerMessageCompress"] class PerMessageCompressOffer: """ Base class for WebSocket compression parameter client offers. """ pa...
import logging from collections import OrderedDict from .signal import (EpicsSignal, EpicsSignalRO) from .device import Device from .device import (Component as C, DynamicDeviceComponent as DDC) logger = logging.getLogger(__name__) def _scaler_fields(attr_base, field_base, range_, **kwargs): defn = OrderedDict...
#!/usr/bin/python import os; import sys; options = [ "gconf", "xml", "gnome3", "indicator", "distribution", "gstreamer", "dbus", "exercises", "pulse", "debug", "x11-monitoring-fallback", ...
"""A couple of point pens to filter contours in various ways.""" from fontTools.pens.basePen import AbstractPen, BasePen from robofab.pens.pointPen import AbstractPointPen from robofab.objects.objectsRF import RGlyph as _RGlyph from robofab.objects.objectsBase import _interpolatePt import math # # threshold filter...
#! /usr/bin/env python from __future__ import print_function import argparse import re import numpy as np import matplotlib.pyplot as plt import seaborn as sns def str2num(s): try: return int(s) except ValueError: return float(s) class Dakota(object): FLOAT_REGEX = '[-+]?[0-9]*\.?[0-9]...
import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .request import RequestMethods f...
# -*- coding: utf-8 -*- # # Currently this module only handles an implicit oauth authentication. # # ---------------------------------------- # Access token authorization # ---------------------------------------- # # With Basic HTTP Auth: # # HTTP AUTH # User owner | ---user/password--> | /login # ...
"""Backward compatible with arrayfns from Numeric """ __all__ = ['array_set', 'construct3', 'digitize', 'error', 'find_mask', 'histogram', 'index_sort', 'interp', 'nz', 'reverse', 'span', 'to_corners', 'zmin_zmax'] import numpy as np from numpy import asarray class error(Exception): pass d...
#! /usr/bin/env python """Calculate simple semiconductor properties from effective mass theory""" ################################################################################ # Aron Walsh 2014 # ##########################################################...
"""Module tests.""" from __future__ import absolute_import, print_function import pytest from flask import Flask, url_for from invenio_db import db from invenio_webhooks import InvenioWebhooks def test_version(): """Test version import.""" from invenio_webhooks import __version__ assert __version__ d...
""" Template file used by the OPF Experiment Generator to generate the actual description.py file by replacing $XXXXXXXX tokens with desired values. This description.py file was generated by: '/Users/ronmarianetti/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/experiment_generator.py' """ fro...
"""Constants and static functions to support protocol buffer wire format.""" __author__ = '<EMAIL> (Will Robinson)' import struct from google.protobuf import descriptor from google.protobuf import message TAG_TYPE_BITS = 3 # Number of bits used to hold type info in a proto tag. TAG_TYPE_MASK = (1 << TAG_TYPE_BITS)...
from setuptools import setup, find_packages NAME = "autorestresourceflatteningtestservice" VERSION = "1.0.0" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools REQUIRES = ["msrest>=0.2.0"] setup( name=NAME, version=VE...
{ 'name': 'OpenID Authentification', 'version': '2.0', 'category': 'Tools', 'description': """ Allow users to login through OpenID. ==================================== """, 'author': 'OpenERP s.a.', 'maintainer': 'OpenERP s.a.', 'website': 'http://www.openerp.com', 'depends': ['base', '...
from __future__ import unicode_literals import logging import sys import types from django import http from django.conf import settings from django.core import urlresolvers from django.core import signals from django.core.exceptions import MiddlewareNotUsed, PermissionDenied, SuspiciousOperation from django.db import...
import unittest class BaseConverterTests(unittest.TestCase): def _getTargetClass(self): from opencore.utilities.converters.baseconverter import BaseConverter return BaseConverter def _makeOne(self, content_type='text/plain', content_description='Testing', ...
{ 'name': 'Magento Connector - Order comment', 'version': '0.1', 'category': 'Connector', 'depends': ['magentoerpconnect', ], 'author': "Akretion,Odoo Community Association (OCA)", 'license': 'AGPL-3', 'website': 'http://www.odoo-magento-connector.com', 'description': """...
from .configuration import config from collections import namedtuple from datetime import datetime, timezone from os.path import expanduser import falcon import json import marshmallow class TinnitusRecorder: def __init__(self): self._schema = SlashCommandDataSchema(config['slack']['tinnitus_command']['to...
#!/usr/bin/env ptatioython # -*- coding: utf-8 -*- ''' Created on May 18, 2016 @author: riccardo ''' from __future__ import print_function import os import sys # @UnusedImport from gfzreport.templates.network.core.utils import relpath from gfzreport.templates.network.core import get_noise_pdfs_content, gen_title,\ ...
import logging from django.utils.translation import ugettext_lazy as _ from horizon import tabs from openstack_dashboard.contrib.sahara.api import sahara as saharaclient LOG = logging.getLogger(__name__) class GeneralTab(tabs.Tab): name = _("General Info") slug = "job_details_tab" template_name = ("pr...
import math import os SPACER = None QUIT_OPTION = 'Done' INVALID_CHOICE = (-1) def clear_screen(): os.system(('cls' if (os.name == 'nt') else 'clear')) class Menu(object, ): def __init__(self, heading, choices, choice_heading, prompt): self.heading = heading self.choices = choices sel...
"""Defines interface for DB access. Functions in this module are imported into the sahara.db namespace. Call these functions from sahara.db namespace, not the sahara.db.api namespace. All functions in this module return objects that implement a dictionary-like interface. **Related Flags** :db_backend: string to lo...
from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils import cstr from frappe import throw, _ from frappe.model.document import Document import erpnext.tasks class Newsletter(Document): def onload(self): if self.email_sent: self.get("__onload").status_count = dict(frappe.db...
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <<EMAIL>> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call stack by dr...
import os import unittest import re from volvox_biodb_test import AbstractVolvoxBiodbTest class VolvoxBiodbTest121 ( AbstractVolvoxBiodbTest, unittest.TestCase ): data_dir = 'tests/data/volvox_formatted_1_2_1/' def setUp( self ): # skip calling VolvoxBiodbTest's setUp, cause we are not # actu...
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.oneview import OneViewModuleBase class EnclosureFactsModule(One...
"""Keras built-in datasets.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.keras.api.keras.datasets import boston_housing from tensorflow.contrib.keras.api.keras.datasets import cifar10 from tensorflow.contrib.keras.api.keras.dat...
''' A translation function for Township of Langley Roads_shp.shp roads data. The shapefiles are availble under the PDDL as "Roads" from the Township of Langley at http://www.tol.ca/ServicesContact/OpenData/OpenDataCatalogue.aspx The following fields are dropped from the source shapefile: Field De...
from card01054 import Card01054 from card01055 import Card01055 from card01056 import Card01056 from card01057 import Card01057 from card01058 import Card01058 from card01059 import Card01059 from card01060 import Card01060 from card01061 import Card01061 from card01062 import Card01062 from card01063 import Card01063 ...
r"""Multivariate autoregressive model (vector autoregression). Implements the following model (num_blocks = max(ar_order, ma_order + 1)): y(t, 1) = \sum_{i=1}^{ar_order} ar_coefs[i] * y(t - 1, i) y(t, i) = y(t - 1, i - 1) + ma_coefs[i - 1] * e(t) for 1 < i < num_blocks y(t, num_blocks) = y(t - 1, num_blocks - 1...
from __future__ import absolute_import, division, print_function from mybuild._compat import * import functools import unittest from mybuild.req import pgraph from mybuild.req.solver import (ComparableSolution, create_trunk, solve_trunk, ...
"""Truncated SVD for sparse matrices, aka latent semantic analysis (LSA). """ # Olivier Grisel <<EMAIL>> # Michael Becker <<EMAIL>> # License: 3-clause BSD. import numpy as np import scipy.sparse as sp try: from scipy.sparse.linalg import svds except ImportError: from ..utils.arpack import sv...
from openerp.osv import fields, osv from openerp.tools.translate import _ class mrp_config_settings(osv.osv_memory): _name = 'mrp.config.settings' _inherit = 'res.config.settings' _columns = { 'module_mrp_repair': fields.boolean("Manage repairs of products ", help='Allows to manage all...
from _testcapi import _test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX, \ PY_SSIZE_T_MAX, PY_SSIZE_T_MIN import unittest from test import support ts=_test...
import Common.EdkLogger as EdkLogger import CommonDataClass.DataClass as DataClass from Table import Table from Common.String import ConvertToSqlString ## TableDsc # # This class defined a table used for data model # # @param object: Inherited from object class # # class TableDsc(Table): def __init__(self, ...
import os.path import shutil import tempfile import unittest from airflow.exceptions import AirflowSensorTimeout from airflow.models.dag import DAG from airflow.sensors.filesystem import FileSensor from airflow.utils.timezone import datetime TEST_DAG_ID = 'unit_tests_file_sensor' DEFAULT_DATE = datetime(2015, 1, 1) ...
import fnmatch import os import jsonpath_rw from oslo_config import cfg from oslo_log import log from oslo_utils import timeutils import six import yaml from ceilometer.event.storage import models from ceilometer.i18n import _ OPTS = [ cfg.StrOpt('definitions_cfg_file', default="event_definitions....
from androguard.core.analysis.analysis import TAINTED_PACKAGE_CREATE, TAINTED_PACKAGE_CALL from androguard.core.bytecodes import dvm TAINTED_PACKAGE_INTERNAL_CALL = 2 FIELD_ACCESS = { "R" : 0, "W" : 1 } PACKAGE_ACCESS = { TAINTED_PACKAGE_CREATE : 0, TAINTED_PACKAGE_CALL : 1, TAINTED_PACKAGE_INTERNAL_CALL : 2 } class ...
"""Test test stubs.""" from unittest import mock import pytest @pytest.fixture def timer(stubs): return stubs.FakeTimer() def test_timeout(timer): """Test whether timeout calls the functions.""" func = mock.Mock() func2 = mock.Mock() timer.timeout.connect(func) timer.timeout.connect(func2)...
''' 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 ...
# coding: utf-8 """ kinto Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch ...
__author__ = 'DongMin Kim' from opencog.atomspace import * # Only run the unit tests if the required dependencies have been installed # (see: https://github.com/opencog/opencog/issues/337) try: __import__("nose.tools") except ImportError: import unittest raise unittest.SkipTest( "ImportError exce...
""" This module adds shared support for generic api modules In order to use this module, include it as part of a custom module as shown below. ** Note: The order of the import statements does matter. ** from ansible.module_utils.basic import * from ansible.module_utils.api import * The 'api' module provides the fol...
"""Support for Wink locks.""" import pywink import voluptuous as vol from homeassistant.components.lock import LockEntity from homeassistant.const import ( ATTR_CODE, ATTR_ENTITY_ID, ATTR_MODE, ATTR_NAME, STATE_UNKNOWN, ) import homeassistant.helpers.config_validation as cv from . import DOMAIN, W...
# Check every path through every method of UserDict import test.test_support, unittest from sets import Set import UserDict class TestMappingProtocol(unittest.TestCase): # This base class can be used to check that an object conforms to the # mapping protocol # Functions that can be useful to override to...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'prefviews.ui' # # by: PyQt4 UI code generator 4.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_viewsForm(object): def setupUi(self, viewsForm): viewsForm.setObjectName("...
"""Definition of vision ops""" from __future__ import absolute_import from tvm import topi from tvm.te.hybrid import script from tvm.runtime import convert from .. import op as reg from .. import strategy from ..op import OpPattern # multibox_prior reg.register_strategy("vision.multibox_prior", strategy.multibox_pri...
""" Test the modlist replace logic. Some attributes require a MOD_REPLACE while others are fine using ADD/DELETE. Note that member management in other tests also exercises the gen_modlist code. """ from ipatests.test_xmlrpc.xmlrpc_test import Declarative from ipatests.test_xmlrpc.test_user_plugin import get_user_resu...
# -*- coding: utf-8 -*- """ pygments.styles.fruity ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "fruity" vim theme. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Token, Co...
"""Example of Converting TextSum model data. Usage: python data_convert_example.py --command binary_to_text --in_file data/data --out_file data/text_data python data_convert_example.py --command text_to_binary --in_file data/text_data --out_file data/binary_data python data_convert_example.py --command binary_to_text -...