content
string
import mock from oslo_concurrency import processutils from oslo_config import cfg from nova import exception from nova import test from nova import utils from nova.virt.libvirt.storage import lvm from nova.virt.libvirt import utils as libvirt_utils CONF = cfg.CONF class LvmTestCase(test.NoDBTestCase): def test_...
#!/bin/env python3 ''' ''' # 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 ...
"""Custom script for gnome-mud.""" __id__ = "$Id$" __version__ = "$Revision$" __date__ = "$Date$" __copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc." __license__ = "LGPL" import pyatspi import orca.debug as debug import orca.scripts.default as default import orca.input_event as input_even...
from django.utils._os import safe_join import os from django.conf import settings from django.contrib.staticfiles.finders import FileSystemFinder from bluebottle.clients.models import Client class TenantStaticFilesFinder(FileSystemFinder): def find(self, path, all=False): """ Looks for files in th...
import os import subprocess from tempfile import mkdtemp from shutil import rmtree from ducktape.template import TemplateRenderer from kafkatest.services.security.minikdc import MiniKdc import itertools class SslStores(object): def __init__(self, local_scratch_dir): self.ca_crt_path = os.path.join(local_s...
import json import re import azurelinuxagent.common.utils.restutil as restutil from azurelinuxagent.common.exception import HttpError from azurelinuxagent.common.future import ustr import azurelinuxagent.common.logger as logger from azurelinuxagent.common.protocol.restapi import DataContract, set_properties from azure...
# -*- 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 field 'Person.img_url' db.add_column('persons_person', 'img_url', self.gf('dj...
""" Indentation maker. @@TR: this code is unsupported and largely undocumented ... This version is based directly on code by Robert Kuzelj <<EMAIL>> and uses his directive syntax. Some classes and attributes have been renamed. Indentation is output via $self._CHEETAH__indenter.indent() to prevent '_indenter' being l...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import os from docopt import docopt from rapidpro_tools import logger, change_logging_level from rapidpro_tools.contacts import (e...
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, OneViewModuleValueError class...
from __future__ import division, print_function, absolute_import #from pnet.vzlog import default as vz import numpy as np import amitgroup as ag import itertools as itr import sys import os import pnet import time def test(ims, labels, net): yhat = net.classify(ims) return yhat == labels if pnet.parallel....
"""Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudioVersion(object): """Information regarding a version of Visual Studio.""" def __init__(self, short_name, description, solution_version, p...
# -*- coding: utf-8 -*- """ werkzeug.contrib.fixers ~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module includes various helpers that fix bugs in web servers. They may be necessary for some versions of a buggy web server but not others. We try to stay updated with the status of the bug...
import os import tempfile import unittest from telemetry.core import browser_credentials SIMPLE_CREDENTIALS_STRING = """ { "google": { "username": "example", "password": "asdf" } } """ class BackendStub(object): def __init__(self, credentials_type): self.login_needed_called = None self.login_n...
""" Helpers for handling compatibility differences between Python 2 and Python 3. """ from __future__ import absolute_import from __future__ import print_function from future.utils import text_type if str != bytes: # On Python 3 and higher, str and bytes # are not equivalent. We must use StringIO for # d...
from openerp.osv import osv class procurement_order(osv.osv): _inherit = "procurement.order" def create(self, cr, uid, vals, context=None): context = context or {} procurement_id = super(procurement_order, self).create(cr, uid, vals, context=context) if not context.get('procurement_aut...
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 resources.datatables import FactionStatus from java.util import Vector def addTemplate(co...
#On the name of ALLAH and may the blessing and peace of Allah #be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam. """ Class of an equation of a circle of the form Ax^2 + Ay^2 + Dx + Ey + F = 0 (A !=0) it represents a circle or a point or has no graph , depending of the radius value. And a class of a...
from __future__ import absolute_import, unicode_literals from .base import MachError INVALID_COMMAND_CONTEXT = r''' It looks like you tried to run a mach command from an invalid context. The %s command failed to meet the following conditions: %s Run |mach help| to show a list of all commands available to the current...
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
#************************************************************** # 9 # / \ # 5 11 # / \ / \ # 2 7 10 15 # / / \ # 1 4 6 # / # ...
""" Usage: import common_z3 as CM_Z3 """ from z3 import * def vset(seq, idfun=None, as_list=True): # This functions preserves the order of arguments while removing duplicates. # This function is from https://code.google.com/p/common-python-vu/source/browse/vu_common.py # (Thanhu's personal co...
from django.apps import apps from django.dispatch import Signal from django.utils import six class_prepared = Signal(providing_args=["class"]) class ModelSignal(Signal): """ Signal subclass that allows the sender to be lazily specified as a string of the `app_label.ModelName` form. """ def __in...
from openerp.osv import osv class account_invoice_line(osv.osv): _inherit = "account.invoice.line" def move_line_get(self, cr, uid, invoice_id, context=None): res = super(account_invoice_line,self).move_line_get(cr, uid, invoice_id, context=context) inv = self.pool.get('account.invoice').brows...
import unittest import Tkinter as tkinter import ttk import test.test_support as support from test_ttk.support import AbstractTkTest, requires_tcl support.requires('gui') class MiscTest(AbstractTkTest, unittest.TestCase): def test_image_types(self): image_types = self.root.image_types() self.ass...
#!/usr/bin/env python # LatitudePlot.py # Created 30 July 2013 # Created by <EMAIL> import os, time, math from datetime import datetime from time import mktime import xml.etree.ElementTree as ET from PIL import Image, ImageDraw def GetKmlFiles(): """Locates and reads local .kml files, returns a list of kml dicti...
import random # Generamos numero aleatorio numeroAdivinar = random.randint(1, 100) # Inicialmente el número es desconocido numero = -1 iteraciones = 0 maxIntentos = 10; print "Bienvenido al wonderfuloso juego de adivinar un número" while (numero != numeroAdivinar) and (iteraciones < maxIntentos): leido = input("...
""" A library for implementing JSON-RPC based web services This is lightweight, low on features, and not a whole lot of effort has been paid to really complying with the JSON-RPC spec. Feel free to improve it. ;) It'd be nice to factor the JSON-RPC stuff out so that it could be used with something besides just HTTP....
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.cloudengine.ce import get_nc_config, set_nc_config from ansible.module_utils.network.cloudeng...
from django.template.defaultfilters import dictsort from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_sort(self): sorted_dicts = dictsort( [{'age': 23, 'name': 'Barbara-Ann'}, {'age': 63, 'name': 'Ra Ra Rasputin'}, {'name': 'Jonny B...
# -*- coding: utf-8 -*- from __future__ import absolute_import import inspect import unittest import warnings from scrapy.exceptions import ScrapyDeprecationWarning from scrapy.utils.deprecate import create_deprecated_class, update_classpath from tests import mock class MyWarning(UserWarning): pass class SomeB...
import mock from bottle_utils import csrf import librarian.utils.route_mixins as mod # Common test helper class MockedRouteBase(object): def __init__(self, *args, **kwargs): # this way all tests will get a separate instance of the mock # object when they instantiate their routes, because othe...
class HTTPError(Exception): "Base exception used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(self, pool, message): self.pool = pool HTTPError.__init__(self, "%s: %s" % (pool, message)) def __reduce__(self): ...
"""These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" import fcntl import os import struct import subprocess import sys def main(args): executor = FlockTool() executor.Dispatch(args) class FlockTool: """This class emu...
# Tests the functions imported from math try: from math import * except ImportError: print("SKIP") raise SystemExit test_values = [-100., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 100.] test_values_small = [-10., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 10.] # so we don't overflow 32-bit precision unit_range_t...
# -*- coding: utf-8 -*- """ *==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. 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...
"""Logging handler. """ import ConfigParser import cStringIO import inspect import itertools import logging import logging.config import logging.handlers import os import sys import traceback import json from oslo.config import cfg _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" common_cli_opts = [ cfg.BoolOpt('...
import numpy as np from matplotlib import pyplot as plt from matplotlib import animation from JSAnimation import IPython_display def basic_animation(frames=100, interval=30): """Plot a basic sine wave with oscillating amplitude""" fig = plt.figure() ax = plt.axes(xlim=(0, 10), ylim=(-2, 2)) line, = ax....
'''Test traversal of adjacency_list.py.''' import pytest from .graph import Graph @pytest.fixture def self_looped(): g = Graph() g.add_edge('a', 'a', 0) return g # The following fixtures for graphs have two associated variables: # <NAME>_DEPTH and <NAME>_BREADTH # which are lists of tuples of two value...
""" Corpus in GibbsLda++ format of List-Of-Words. """ from __future__ import with_statement import logging from gensim import utils from gensim.corpora import IndexedCorpus from six import iteritems, iterkeys from six.moves import xrange, zip as izip logger = logging.getLogger('gensim.corpora.lowcorpus') def spl...
"""Abstract Base Classes (ABCs) according to PEP 3119.""" from _weakrefset import WeakSet def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unles...
""" Copyright (c) 2012-2021 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 option) any la...
#!/usr/bin/env python # How to use # >python genDocDb.postgres.py -h localhost -P 5432 -u username -p password -d database -t table -n 1000 -r 1 # library: # pip install psycopg2 import argparse import psycopg2 import random import math import time import sys def get_args_parser(): parser = argparse.ArgumentPar...
"""Tests for tensorflow.contrib.graph_editor.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib import graph_editor as ge from tensorflow.contrib.graph_editor.tests import match from tensorflow.python.framework import constant_op fro...
from __future__ import print_function, division import sys sys.dont_write_bytecode = True from ok import * import random r = random.random isa = isinstance """ # Compartmental Modeling ## Diapers q +-----+ r +-----+ ---->| C |---->| D |--> s ^ +-----+ +-+---+ | | +-------------...
import os from logshipper.tail import Tail from st2reactor.sensor.base import Sensor class FileWatchSensor(Sensor): def __init__(self, sensor_service, config=None): super(FileWatchSensor, self).__init__(sensor_service=sensor_service, config=config) s...
"""ANTLR3 runtime package""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code ...
from __future__ import absolute_import from .lexer import Lexer from . import nodes import six class Parser(object): def __init__(self,str,filename=None,**options): self.input = str self.lexer = Lexer(str,**options) self.filename = filename self.bloks = {} self.options = opt...
# -*- coding: utf8 -*- import numpy from .. import utils, deflation, linsys from . import factories, evaluators class _RecyclingSolver(object): '''Base class for recycling solvers.''' def __init__(self, DeflatedSolver, vector_factory=None ): '''Initialize recycling so...
"""Tests for ast_util module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import ast import collections import textwrap import gast from tensorflow.python.autograph.pyct import anno from tensorflow.python.autograph.pyct import ast_util from tensorf...
class Grid: # Environment def __init__(self, width, height, start): self.width = width self.height = height self.i = start[0] self.j = start[1] def set(self, rewards, actions): # rewards should be a dict of: (i, j): r (row, col): reward # actions should be a dict of: (i, j): A (row, col): l...
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ from django.conf import settings from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper, BaseDatabaseValidation) from django.db.backends.postgresql_psycopg2.operations import DatabaseOperation...
from __future__ import unicode_literals from math import ceil from django.db import IntegrityError, connection, models from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from django.utils.six.moves import range from .models import...
from django.conf import settings from django.conf.urls import include, patterns, url import mkt from . import views def fireplace_route(path, name=None): """ Helper function for building Fireplace URLs. `path` is the URL route, and `name` (if specified) is the name given to the route. """ kwargs ...
""" Sorts Python import definitions, and groups them based on type (stdlib, third-party, local). isort/isort_kate_plugin.py Provides a simple kate plugin that enables the use of isort to sort Python imports in the currently open kate file. Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, fre...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = r''' --- module: meraki_device short_description: Manage devices in the Meraki cloud version_added: "2....
try: import unittest2 as unittest except ImportError: import unittest # noqa from datetime import datetime, timedelta, time from decimal import Decimal from uuid import uuid1, uuid4, UUID import six from cassandra.cqlengine import columns from cassandra.cqlengine.management import sync_table from cassandra.c...
from __future__ import unicode_literals from guessit.transfo import SingleNodeGuesser from guessit.patterns import find_properties import logging log = logging.getLogger(__name__) def guess_properties(string): try: prop, value, pos, end = find_properties(string)[0] return { prop: value }, (pos, e...
""" Copyright (c) 2006 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc 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, or (at your option) any later ...
"""Tests for some of the utilities """ ############################################################################## # imports ############################################################################## from __future__ import print_function, division import numpy as np from mdtraj.utils import ensure_type from mdt...
# Project imports import os import sys import hashlib import random import re import shutil import string import tempfile import time sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))))) sys.path.insert(0, os.path.abspath(os.path.dirname(o...
#!/usr/bin/env python from __future__ import division import numpy import os.path import cogent.cluster.nmds as nmds_module from qiime.format import format_nmds_coords from qiime.parse import parse_distmat __author__ = "Justin Kuzynski" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Justin Kuczyns...
from stoqlib.gui.editors.producteditor import QualityTestEditor from stoqlib.gui.test.uitestutils import GUITest class TestQualityTestEditor(GUITest): def test_create(self): editor = QualityTestEditor(self.store) self.check_editor(editor, 'editor-qualitytest-create')
""" Django settings for leodavesne project. Generated by 'django-admin startproject' using Django 3.0.1. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os...
"""NDG HTTPS Client package Use pyasn1 to provide support for parsing ASN.1 formatted subjectAltName content for SSL peer verification. Code based on: http://stackoverflow.com/questions/5519958/how-do-i-parse-subjectaltname-extension-data-using-pyasn1 """ __author__ = "P J Kershaw" __date__ = "01/02/12" __copyright_...
""" Support for Zyxel Keenetic NDMS2 based routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.keenetic_ndms2/ """ import logging from collections import namedtuple import requests import voluptuous as vol import homeassistant.helper...
# -*- coding: utf-8 -*- """ A screening process wherein a person returns for regular checkups at a dentist """ # Time interval between appointments appInt = 6*30 # Create a counter for the number of dental appointments, if one doesn't already exist if getattr(entity, "count_DentAppt", 0) == 0: entit...
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. """ import warnings as _warnings trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)]) trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)]) # The size of the digests returne...
#!/usr/bin/env python ######################################################################### # Reinforcement Learning with several optimization algorithms # on the CartPoleEnvironment # # Requirements: pylab (for plotting only). If not available, comment the # last 3 lines out ######################################...
#!/usr/bin env python from tests.compat import mock, unittest from httpretty import HTTPretty import json import requests from boto.cloudsearch.search import SearchConnection, SearchServiceException from boto.compat import six, map HOSTNAME = "search-demo-userdomain.us-east-1.cloudsearch.amazonaws.com" FULL_URL = '...
""" Exceptions common to OpenStack projects """ import logging from rainicorn.openstack.common.gettextutils import _ _FATAL_EXCEPTION_FORMAT_ERRORS = False class Error(Exception): def __init__(self, message=None): super(Error, self).__init__(message) class ApiError(Error): def __init__(self, mess...
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd from ggplot.utils import make_iterable_ntimes from ggplot.utils.exceptions import GgplotError from .stat import stat class stat_function(stat): """ Superimpose a...
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
from charmhelpers.contrib.storage.linux.utils import ( is_block_device, zap_disk, ) from charmhelpers.contrib.storage.linux.loopback import ( ensure_loopback_device, ) from charmhelpers.contrib.storage.linux.lvm import ( deactivate_lvm_volume_group, is_lvm_physical_volume, remove_lvm_physical_...
import unittest import nest class TestSplit(unittest.TestCase): steps = 100 time = 100 def __init__(self, *args, **kwargs): super(TestSplit, self).__init__(*args, **kwargs) self.spike = None def setup(self): nest.ResetKernel() nest.SetDefaults('spike_detector', {'with...
from gnuradio import gr from gnuradio.radar_mono import radar from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser import sys, time n2s = eng_notation.num_to_str logfile = None def process_echo(echo): global logfile if logfile is not None: logf...
from apgl.graph.GeneralVertexList import GeneralVertexList from apgl.graph.test.AbstractVertexListTest import AbstractVertexListTest from apgl.util.PathDefaults import PathDefaults import unittest import logging class GeneralVertexListTest(unittest.TestCase, AbstractVertexListTest): def setUp(self): self....
"""SGE batch system Tasks. Adapted by Jake Feala (@jfeala) from `LSF extension <https://github.com/dattalab/luigi/blob/lsf/luigi/lsf.py>`_ by Alex Wiltschko (@alexbw) Maintained by Jake Feala (@jfeala) SunGrid Engine is a job scheduler used to allocate compute resources on a shared cluster. Jobs are submitted using t...
from django.core.management.color import no_style from django.core.management.sql import custom_sql_for_model from django.db import DEFAULT_DB_ALIAS, connections from django.test import TestCase, override_settings from .models import Simple class InitialSQLTests(TestCase): """ The format of the included SQL ...
import datetime class Storage(object): def __init__(self, parent): self.parent = parent def run_fixtures(self): pass def dispatch(self, event, data): self.parent.dispatch(event, data) def get_fact(self, id): return self.__get_fact(id) def add_fact(self, activity_...
from doc.gallery import * def test_parse_docstring_info(): assert 'error' in parse_docstring_info("No Docstring") assert 'error' in parse_docstring_info("'''No Docstring Title'''") assert 'error' in parse_docstring_info( "'''No Sentence\n======\nPeriods'''" ...
import time try: from novaclient.v1_1 import client as nova_client try: from neutronclient.neutron import client except ImportError: from quantumclient.quantum import client from keystoneclient.v2_0 import client as ksclient HAVE_DEPS = True except ImportError: HAVE_DEPS = False ...
#!/usr/bin/env python3 """ PP_COMBINE - combine frames based on wcs v1.0: 2017-10-03, <EMAIL> """ from __future__ import print_function, division # Photometry Pipeline # Copyright (C) 2016-2018 Michael Mommert, <EMAIL> # This program is free software: you can redistribute it and/or modify # it under the terms o...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # 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.apa...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: bigip_device_group_member short_description: Manages member...
import logging import os import re import signal import subprocess import sys import tempfile from telemetry.core import platform from telemetry.core import util from telemetry.core.platform import profiler from telemetry.core.platform.profiler import android_profiling_helper from telemetry.util import support_binarie...
import datetime from nova.openstack.common import timeutils class ViewBuilder(object): """OpenStack API base limits view builder.""" def build(self, rate_limits, absolute_limits): rate_limits = self._build_rate_limits(rate_limits) absolute_limits = self._build_absolute_limits(absolute_limits...
import re import json import inspect from markdown.extensions import Extension from markdown.preprocessors import Preprocessor from typing import Any, Dict, Optional, List, Tuple import markdown import zerver.openapi.python_examples from zerver.lib.openapi import get_openapi_fixture, openapi_spec, \ get_openapi_p...
import os import warnings import cherrypy from cherrypy._cpcompat import iteritems, copykeys, builtins class Checker(object): """A checker for CherryPy sites and their mounted applications. When this object is called at engine startup, it executes each of its own methods whose names start with ``che...
# -*- coding: utf-8 -*- # Import the reverse lookup function from django.core.urlresolvers import reverse # view imports from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView from django.views.generic import ListView # Only authenticated ...
"""HTML 2.0 parser. See the HTML 2.0 specification: http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html """ from warnings import warnpy3k warnpy3k("the htmllib module has been removed in Python 3.0", stacklevel=2) del warnpy3k import sgmllib from formatter import AS_IS __all__ = ["HTMLPars...
""" Unit tests for nonlinear solvers Author: Ondrej Certik May 2007 """ from __future__ import division, print_function, absolute_import from numpy.testing import assert_, dec, TestCase, run_module_suite from scipy._lib.six import xrange from scipy.optimize import nonlin, root from numpy import matrix, diag, dot from...
""" This module allows importing AbstractBaseUser even when django.contrib.auth is not in INSTALLED_APPS. """ from __future__ import unicode_literals import unicodedata from django.contrib.auth import password_validation from django.contrib.auth.hashers import ( check_password, is_password_usable, make_password, ...
import logging from collections import defaultdict import arrow import OnePy as op from OnePy.event_engine import EventEngine from OnePy.utils.easy_func import get_day_ratio class Environment(object): """作为全局共享变量为各模块提供支持""" # general context sys_date: str = None sys_frequency: str = None instru...
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'), 5:_('Saturday'), 6:_('Sunday') } WEEKDAYS_ABBR = { 0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')...
from __future__ import unicode_literals import json from .common import InfoExtractor class RadioDeIE(InfoExtractor): IE_NAME = 'radio.de' _VALID_URL = r'https?://(?P<id>.+?)\.(?:radio\.(?:de|at|fr|pt|es|pl|it)|rad\.io)' _TEST = { 'url': 'http://ndr2.radio.de/', 'md5': '3b4cdd011bc591745...
import os import re import sys usage = """%s BUILDTYPE BUILDDIR BUILDTYPE: either chromium or chrome. BUILDDIR: The path to the output directory. e.g. relpath/to/out/Release Prints out (to stdout) the sorted list of resource ids that are marked as unused during the repacking process in the given build log (via stdin...
import unittest import json from datetime import datetime from pymongo import MongoClient from apps.basic_resource import server from apps.basic_resource.documents import Article, Comment class ResourcePutIdentifierField(unittest.TestCase): """ Test if a HTTP PUT that updates a resource that has an embedded ...
""" Define interfaces. """ from __future__ import print_function import vim import json import time import os.path from ._compat import PY2 class VimPymodeEnviroment(object): """ Vim User interface. """ prefix = '[Pymode]' def __init__(self): """ Init VIM environment. """ self.curren...
"""Programs views for use with Studio.""" from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import Http404, JsonResponse from django.utils.decorators import method_decorator from django.views.generic import View from edxmako.shortcuts import render_...