content
string
import json import pytest from units.compat import mock from ansible.modules.remote_management.lxca import lxca_cmms @pytest.fixture(scope='module') @mock.patch("ansible.module_utils.remote_management.lxca.common.close_conn", autospec=True) def setup_module(close_conn): close_conn.return_value = True class Tes...
import plotly.plotly as py import plotly.graph_objs as go #Get data data = open('Real_Final_database_02.csv') alldata = data.readlines() listdata = [] for i in alldata: listdata.append(i.strip().split(',')) #Seperate information year = [] affect = [] damage = [] death =[] for j in listdata: if j[0] == 'Malays...
from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.test import profiling NUM = 500 DIVISOR = 50 engine = create_engine('sqlite://') meta = MetaData(engine) items = Table('items', meta, Column('item_id', Integer, primary_key=True), Column('value', String(100))) subitems =...
"""Unit test for the gtest_xml_output module""" __author__ = '<EMAIL> (Sean Mcafee)' import errno import os import sys from xml.dom import minidom, Node import gtest_test_utils import gtest_xml_test_utils GTEST_OUTPUT_FLAG = "--gtest_output" GTEST_DEFAULT_OUTPUT_FILE = "test_detail.xml" GTEST_PROGRAM_NAME ...
import base64 from openerp.osv import fields, osv from openerp.tools.translate import _ class l10n_be_vat_declaration(osv.osv_memory): """ Vat Declaration """ _name = "l1on_be.vat.declaration" _description = "Vat Declaration" def _get_xml_data(self, cr, uid, context=None): if context.get('fil...
from __future__ import absolute_import import numpy as np from .core import MaskedLayer import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams class GaussianNoise(MaskedLayer): ''' Corruption process with GaussianNoise ''' def __init__(self, s...
"""Tests for the hybrid tensor forest model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import random # pylint: disable=unused-import from tensorflow.contrib.tensor_forest.hybrid.python.models import forest_to_data_then_nn from tensorflow.contrib.t...
from django.core import signals from django.db.utils import ( DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler, ConnectionRouter, DatabaseError, DataError, Error, IntegrityError, InterfaceError, InternalError, NotSupportedError, OperationalError, ProgrammingError, ) __all__ = [ 'backe...
from __future__ import absolute_import, division, print_function INCLUDES = """ #include <CommonCrypto/CommonDigest.h> """ TYPES = """ typedef uint32_t CC_LONG; typedef uint64_t CC_LONG64; typedef struct CC_MD5state_st { ...; } CC_MD5_CTX; typedef struct CC_SHA1state_st { ...; } CC_SHA1_CTX; typedef struct CC...
# -*- coding: utf-8 -*- """ Tests for auth manager WMS/WFS using QGIS Server through PKI enabled qgis_wrapped_server.py. This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth configuration to access an HTTP Basic pro...
# -*- coding: utf-8 -*- """ flaskext_compat ~~~~~~~~~~~~~~~ Implements the ``flask.ext`` virtual package for versions of Flask older than 0.7. This module is a noop if Flask 0.8 was detected. Usage:: import flaskext_compat flaskext_compat.activate() from flask.ext import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os # Get the project root dir, which is the parent dir of this cwd = os.getcwd() project_root = os.path.dirname(cwd) # Insert the project root dir as the first element in the PYTHONPATH. # This lets us ensure that the source package is imported, and tha...
from __future__ import absolute_import, division, print_function, unicode_literals from concurrent.futures import ( ProcessPoolExecutor, ThreadPoolExecutor) from c7n.registry import PluginRegistry import threading class ExecutorRegistry(PluginRegistry): def __init__(self, plugin_type): super(Execu...
""" Copyright (c) 2008, appengine-utilities project All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and ...
"""The email command 'help'.""" from __future__ import absolute_import, print_function, unicode_literals __metaclass__ = type __all__ = [ 'Help', ] from zope.interface import implementer from mailman.config import config from mailman.core.i18n import _ from mailman.interfaces.command import ContinueProcess...
# -*- coding: utf-8 -*- """ Functionality related to loading extensions from a set location. The client context is constructed ahead of time and provided to this module, which then uses it to instantiate the extension components. """ import copy from gettext import gettext as _ import logging import os import sys im...
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, int): if default_handler == signal.SIG_D...
""" Ceilometer Middleware for Swift Proxy Configuration: In /etc/swift/proxy-server.conf on the main pipeline add "ceilometer" just before "proxy-server" and add the following filter in the file: [filter:ceilometer] use = egg:ceilometer#swift # Some optional configuration # this allow to publish additional metadata...
from sqlalchemy.ext.compiler import compiles from sqlalchemy import types as sqltypes from sqlalchemy import schema from ..util.compat import string_types from .. import util from .impl import DefaultImpl from .base import ColumnNullable, ColumnName, ColumnDefault, \ ColumnType, AlterColumn, format_column_name, \ ...
# tests command line execution of scripts import unittest import sys import os import os.path import py_compile from test import support from test.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, assert_python_ok, assert_python_failure, temp_dir) verbose = support.verbose example...
from __future__ import unicode_literals import cgi import codecs import logging import sys from io import BytesIO from threading import Lock from django import http from django.conf import settings from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_pr...
import cx_Oracle import sys from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS...
""" AppletBlock can render and process AppletIdevices as XHTML """ import os.path from exe.webui.block import Block from exe.webui import common #from string import Template import logging log = logging.getLogger(__name__) # ======================================================================...
import os import re import sys import unittest class TestDiscovery(unittest.TestCase): # Heavily mocked tests so I can avoid hitting the filesystem def test_get_name_from_path(self): loader = unittest.TestLoader() loader._top_level_dir = '/foo' name = loader._get_name_from_path('/fo...
#!/usr/bin/env python try: from twisted.trial import unittest unittest # http://divmod.org/trac/ticket/1499 except ImportError, le: print "Skipping test_iputil since it requires Twisted and Twisted could not be imported: %s" % (le,) else: from pyutil import iputil, testutil import re DOTTED_QU...
import logging import os import pipes import re import subprocess import sys import time from telemetry.core import exceptions from telemetry.core import forwarders from telemetry.core import util from telemetry.core.backends import adb_commands from telemetry.core.backends import browser_backend from telemetry.core.b...
__author__ = 'Dzmitry' from model.contact import Group class ContactHelper: def __init__(self, app): self.app = app def create(self, contact): wd = self.app.wd wd.get("http://localhost/addressbook/") # init new contact creation wd.find_element_by_link_text("add new").c...
#._cv_part guppy.heapy.Monitor import os, pprint, signal, socket, SocketServer, sys, threading, time, traceback import cPickle as pickle try: import readline # Imported to _enable_ command line editing except ImportError: pass import select, Queue from guppy.heapy.RemoteConstants import * from guppy.heapy.Co...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from turbogears.finddata import find_package_data import os execfile(os.path.join("tgpisa", "release.py")) packages=find_packages() package_data = find_package_data(where='tgpisa', package='tgpisa') if os.path.isdir('locales'): packages.appe...
from django.core.urlresolvers import reverse from oscar.test import testcases, factories from oscar.apps.offer import models class TestAnAdmin(testcases.WebTestCase): # New version of offer tests buy using WebTest is_staff = True def setUp(self): super(TestAnAdmin, self).setUp() self.ran...
from django.shortcuts import get_object_or_404, render, HttpResponse from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.views import generic from django.utils import timezone from .models import Choice, Question # entry point of the polls app class Inde...
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Acceso a directorios con samba # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import logger import os import config ...
"""Automatically download MLdata datasets.""" # Copyright (c) 2011 Pietro Berkes # License: BSD 3 clause import os from os.path import join, exists import re import numbers try: # Python 2 from urllib2 import HTTPError from urllib2 import quote from urllib2 import urlopen except ImportError: # Pyt...
def sort_xml_elements(tree): # Retrieve all children of the root XML node in the tree elements = list(tree) # Initialize empty lists for the sorted and comment elements sorted_elements = [] # Initialize an empty set of tags (e.g., Surface, Cell, and Lattice) tags = set() # Find the uniqu...
"""NETRCAuthorizer class""" import base64 import netrc import urlparse from common.twisted_util.authorizer import IAuthorizer from zope.interface import implements class EmptyNetrc(object): def authenticators(self, _): return None def __repr__(self): return '' @property def hosts(self): return...
from django.conf import settings from .. import Tags, Warning, register from ..utils import patch_middleware_message W003 = Warning( "You don't appear to be using Django's built-in " "cross-site request forgery protection via the middleware " "('django.middleware.csrf.CsrfViewMiddleware' is not in your " ...
from .regioninfo import SDBRegionInfo from boto.regioninfo import get_regions def regions(): """ Get all available regions for the SDB service. :rtype: list :return: A list of :class:`boto.sdb.regioninfo.RegionInfo` instances """ return get_regions( 'sdb', region_cls=SDBRegion...
#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import sys from urllib.request import urlopen if __name__ == '__main__': parser = ArgumentParser(description='Grab di.fm playlists') parser.add_argument('--key', help='Listening key') parser.add_argument('--destination',...
from sqlparse import tokens as T from sqlparse.compat import text_type class _CaseFilter(object): ttype = None def __init__(self, case=None): case = case or 'upper' self.convert = getattr(text_type, case) def process(self, stream): for ttype, value in stream: if ttype...
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject class GmlTopologyStyle(IdentifiedObject): """The style for one topology property. Similarly to the Geometry style, a feature can have multiple topology properties, thus multiple topology style descriptors can be specified within one feature style.Th...
from regexLibraryBA import RegexLibraryBA from parseRegexLib import ParseRegexLib from qt import * from util import restoreWindowSettings, saveWindowSettings, kodos_toolbar_logo import os GEO = "regex-lib_geometry" class RegexLibrary(RegexLibraryBA): def __init__(self, parent, filename): RegexLibraryBA._...
"""The TaskView allows you to modify what the loader is doing.""" from __future__ import (absolute_import, division, print_function) from ranger.ext.accumulator import Accumulator from . import Widget class TaskView(Widget, Accumulator): old_lst = None def __init__(self, win): Widget.__init__(self...
"""runpy.py - locating and running Python code using the module namespace Provides support for locating and running Python scripts using the Python module namespace instead of the native filesystem. This allows Python code to play nicely with non-filesystem based PEP 302 importers when locating support scripts as wel...
""" Support for Fritzbox binary sensors. For more details about this component, please refer to the documentation at https://home-assistant.io/components/binary_sensor.fritzbox/ """ import logging import requests from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.frit...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django_pgjson.fields import django.utils.timezone import django.db.models.deletion import djorm_pgarray.fields import taiga.projects.history.models class Migration(migratio...
# -*- coding: utf-8 -*- from logging import getLogger from cms.management.commands.subcommands.base import SubcommandsCommand from cms.models import CMSPlugin, Title from cms.models.pagemodel import Page from django.core.management.base import NoArgsCommand log = getLogger('cms.management.moderator') class Moderato...
from django.core.management.base import BaseCommand from django.db.models import F from django.utils.translation import ugettext as _ from oioioi.problems.models import Problem from oioioi.programs.models import ModelProgramSubmission class Command(BaseCommand): help = str( _( "Prints problems...
from datetime import datetime from twisted.web import resource, static from twisted.application.service import IServiceCollection from .interfaces import IPoller, IEggStorage, ISpiderScheduler from . import webservice class Root(resource.Resource): def __init__(self, config, app): resource.Resource.__in...
from setuptools import setup, find_packages NAME = "autorestparameterizedhosttestclient" VERSION = "1.0.0" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools REQUIRES = ["msrestazure>=0.4.7"] setup( name=NAME, version...
from ee.utils import test from ee.cli.main import get_test_app class CliTestCaseStack(test.EETestCase): def test_ee_cli(self): self.app.setup() self.app.run() self.app.close() def test_ee_cli_stack_services_start_nginx(self): self.app = get_test_app(argv=['stack', 'start', '-...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import djbetty.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Campaign', fields=[ ('id'...
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
"""Tests for the Kodi integration.""" from unittest.mock import patch from homeassistant.components.kodi.const import CONF_WS_PORT, DOMAIN from homeassistant.const import ( CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_SSL, CONF_USERNAME, ) from .util import MockConnection from tests.c...
""" A helper class for using TLS Lite with stdlib clients (httplib, xmlrpclib, imaplib, poplib). """ from gdata.tlslite.Checker import Checker class ClientHelper: """This is a helper class used to integrate TLS Lite with various TLS clients (e.g. poplib, smtplib, httplib, etc.)""" def __init__...
import numpy as np maximum = 4.5 minimum = 3 def make_pair(x, y): xx, yy = np.meshgrid(range(len(x)), range(len(y))) return np.c_[xx.ravel(), yy.ravel()] def compute_distance(x, y, pairs): return np.array([np.sqrt(np.sum(np.power(x[i] - y[j], 2))) for (i, j) in pairs]) def compute_native_contact(x, y...
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...
""" Results for SARIMAX tests Results from R, KFAS library using script `test_ucm.R`. See also Stata time series documentation. Author: Chad Fulton License: Simplified-BSD """ from numpy import pi irregular = { 'models': [ {'irregular': True}, {'level': 'irregular'}, {'level': 'ntrend'}, ...
# -*- coding: utf-8 -*- """ AR-specific Form helpers. """ from django.forms import ValidationError from django.core.validators import EMPTY_VALUES from django.forms.fields import RegexField, CharField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ class...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.learn.python.learn import datasets from tensorflow.python.platform import test class LoadCsvTest(test.TestCase): """Test load csv functions.""" def testIris(self): iris = data...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import subprocess from contextlib import contextmanager @contextmanager def preserve_stty_settings(): """Run potentially stty-modifying operations, e.g., REPL exec...
from office365.runtime.client_value import ClientValue class ObjectIdentity(ClientValue): """ Represents an identity used to sign in to a user account. """ def __init__(self, signInType=None, issuer=None, issuerAssignedId=None): """ :param str signInType: Specifies the user sign-in t...
import threading from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR class GEOSContextHandle(object): """ Python object representing a GEOS context handle. """ def __init__(self): # Initializing the context handler for this thread with # the notice and erro...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2017 homik 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 la...
from couchpotato.core.event import fireEvent from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.logger import CPLog from couchpotato.core.providers.nzb.base import NZBProvider from dateutil.parser import parse import re import time log = CPLog(__name__) class Moovee(NZBProvider): u...
""" Built-in, globally-available admin actions. """ from django import template from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.shortcuts import render_to_resp...
"""Tests for MapDefunOp.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from tensorflow.python.client import session from tensorflow.python.data.experimental.ops import map_defun from tensorflow.python.data.kernel_tests import test_base from...
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen from Components.ActionMap import NumberActionMap from Components.config import config, getConfigListEntry, ConfigNothing, NoSave, ConfigPIN from Components.ParentalControlList import ParentalControlEntryComponent, ParentalControlList ...
import datetime import warnings import weakref import unittest from itertools import product class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, ...
import copy from spec import Spec, eq_, skip, ok_, raises from invoke.parser import Argument, Context from invoke.tasks import task from invoke.collection import Collection class Context_(Spec): "ParserContext" # meh def may_have_a_name(self): c = Context(name='taskname') eq_(c.name, 'taskna...
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * # Tab Completion of Words {{{# class Completion_SimpleExample_ECR(_VimTest): snippets = ('test', '$1 ${1:blah}') keys = 'superkallifragilistik\ntest' + EX + 'sup' + COMPL_KW + \ COMPL_ACCEPT + ' some more' wanted ...
"""A more or less complete user-defined wrapper around list objects.""" import collections class UserList(collections.MutableSequence): def __init__(self, initlist=None): self.data = [] if initlist is not None: # XXX should this accept an arbitrary sequence? if type(initlis...
import unittest from test.test_support import run_unittest from email.test.test_email import TestEmailBase from email.charset import Charset from email.header import Header, decode_header from email.message import Message # We're compatible with Python 2.3, but it doesn't have the built-in Asian # codecs, so we have ...
import configuration import datetime import warnings from ConfigParser import NoSectionError, NoOptionError _no_value = object() class ParameterException(Exception): """Base exception.""" pass class MissingParameterException(ParameterException): """Exception signifying that there was a missing Paramete...
''' @author: frank ''' import unittest import time import threading from ..utils.thread import ThreadFacade from ..utils.thread import AsyncThread class TestThreadFacade(unittest.TestCase): def _do(self, name, value=None): self.ok = name self.value = value; def test_ru...
from flask import Blueprint, current_app, request, session as cookie_session from flask_themes2 import render_theme_template from structlog import get_logger from app.globals import get_session_store from app.utilities.schema import load_schema_from_session_data from app.utilities.cookies import analytics_allowed log...
from .common import BaseTest, functional import base64 import os import json import time import tempfile import zlib from c7n.exceptions import PolicyValidationError class NotifyTest(BaseTest): @functional def test_notify_address_from(self): session_factory = self.replay_flight_data("test_notify_ad...
import bpy from bpy.props import FloatProperty import bmesh from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import (updateNode, Vector_generate, Vector_degenerate, match_long_repeat) from sverchok.utils.sv_bmesh_utils import bmesh_from_pydata # "co...
"""Poll module is ungraded xmodule used by students to to do set of polls. On the client side we show: If student does not yet anwered - Question with set of choices. If student have answered - Question with statistics for each answers. """ import cgi import json import logging from copy import deepcopy from collecti...
# Practicing Dynamic Programming (DP) with the log cutting problem given on the practice midterm. import numpy as np ################################################################################ # Slow Algorithm ################################################################################ def cut_log...
#!/usr/bin/env python # summarize the sql-bench trace file import sys import re import os.path class testreports: def __init__(self): self.reports = [] def append(self, report): self.reports.append(report) def duration(self, start, stop): t0 = os.popen('date -d"' + start + '" +%...
import unittest import logging import six import socket from struct import * from nose.tools import * from ryu.ofproto.ofproto_v1_3_parser import * from ryu.ofproto import ofproto_v1_3_parser from ryu.ofproto import ofproto_v1_3 from ryu.ofproto import ofproto_protocol from ryu.ofproto import ether from ryu.ofproto.ofp...
from Xlib import X from Xlib.protocol import rq extname = 'RECORD' FromServerTime = 0x01 FromClientTime = 0x02 FromClientSequence = 0x04 CurrentClients = 1 FutureClients = 2 AllClients = 3 FromServer = 0 FromClient = 1 ClientStarted ...
import sys from twisted.internet import reactor, ssl from twisted.python import log from twisted.web.server import Site from twisted.web.static import File from autobahn.websocket import WebSocketServerFactory, \ WebSocketServerProtocol from autobahn.resource import WebSocketResource, ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest from mock import ANY from ansible.module_utils.network.fortios.fortios import FortiOSHandler try: from ansible.modules.network.fortios import fortios_router_ospf except ImportError: pyte...
"""Tests for Estimator related util.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from tensorflow.python.platform import test from tensorflow.python.util import function_utils def silly_example_function(): pass class SillyCalla...
"""Base stream class. """ # Note: request.connection.write/read are used in this module, even though # mod_python document says that they should be used only in connection # handlers. Unfortunately, we have no other options. For example, # request.write/read are not suitable because they don't allow direct raw bytes ...
import os import sys import inspect import core.plugin def load_plugins(dir, instantiate = False, shell = None): plugins = {} for root, dirs, files in os.walk(dir): sys.path.append(root) # make forward slashes on windows module_root = root.replace(dir, "").replace("\\", "/") ...
from django.conf import settings from django.http import HttpResponseForbidden from django.template import Context, Engine, TemplateDoesNotExist, loader from django.utils.translation import ugettext as _ from django.utils.version import get_docs_version # We include the template inline since we need to be able to reli...
# pylint: disable=C0301 import decimal from django.core import mail from django.test import TestCase from mock import patch from ..models import Customer from ..utils import get_user_model class EmailReceiptTest(TestCase): def setUp(self): User = get_user_model() self.user = User.objects.creat...
import traceback import json import six from oslo_config import cfg from st2common import log as logging from st2common.util import driver_loader __all__ = ["get_available_backends", "get_backend_instance"] LOG = logging.getLogger(__name__) BACKENDS_NAMESPACE = "st2auth.backends.backend" def get_available_backen...
import os import logging from odoo import api, models, fields, _ try: from pyquery import PyQuery except ImportError: logger = logging.getLogger(__name__) logger.error("Please install python pyquery") NOMINATIVE = 0 ACCUSATIVE = 1 DATIVE = 2 SINGULAR = 0 PLURAL = 1 DIR = os.path.join(os.path.dirname(_...
import os import shutil import tempfile from importlib import import_module from django import conf from django.contrib import admin from django.test import SimpleTestCase, override_settings from django.test.utils import extend_sys_path from django.utils import autoreload from django.utils._os import npath LOCALE_PAT...
from __future__ import absolute_import import os import time from . import (LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # super(Symlin...
import re import os def run(): sourceDirectory = "../lib/OpenLayers" allFiles = [] SUFFIX_JAVASCRIPT = ".js" ## Find all the Javascript source files for root, dirs, files in os.walk(sourceDirectory): for filename in files: if filename.endswith(SUFFIX_JAVASCRIPT) and not f...
# -*- coding: utf-8 -*- """Tests for the 'the' plugin""" from __future__ import division, absolute_import, print_function import unittest from test import _common from beets import config from beetsplug.the import ThePlugin, PATTERN_A, PATTERN_THE, FORMAT class ThePluginTest(_common.TestCase): def test_unthe_...
"""Webhooks for external integrations.""" import logging from typing import Any, Dict, List from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import authenticated_rest_api_view from zerver.lib.email_notifications import convert_html_to_markdown ...
from __future__ import print_function import logging import usi.api.systemc as api # Renaming time constants for easy reuse FS = api.SC_FS PS = api.SC_PS NS = api.SC_NS US = api.SC_US MS = api.SC_MS SEC = api.SC_SEC """Time constants units""" TIME_UNITS = { FS:"fs", PS:"ps", NS:"ns", US:"us", MS:"...
import account_analytic_profit import report_analytic import hr_timesheet_invoice_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010-2012 Asidev s.r.l. 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 b...
"""Common tags used for graphs in SavedModel. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.util.tf_export import tf_export # Tag for the `serving` graph. SERVING = "serve" tf_export( "saved_model.SERVING", v1=["saved_...