code
stringlengths
1
199k
"""Moderator of Zinnia comments""" from django.conf import settings from django.contrib.sites.models import Site from django.core.mail import EmailMessage from django.core.mail import send_mail from django.template import loader from django.utils.translation import activate from django.utils.translation import get_lang...
import logging import os import numpy as np import pandas as pd from astropy import constants, units as u from astropy.utils.decorators import deprecated from tardis.io.util import to_hdf from util import intensity_black_body from tardis.plasma.standard_plasmas import LegacyPlasmaArray logger = logging.getLogger(__name...
""" runtests.py [OPTIONS] [-- ARGS] Run tests, building the project first. Examples:: $ python runtests.py $ python runtests.py -s {SAMPLE_SUBMODULE} $ # Run a standalone test function: $ python runtests.py -t {SAMPLE_TEST} $ # Run a test defined as a method of a TestXXX class: $ python runtests...
""" Extensions for pyrestcli Resource and Manager classes .. module:: carto.resources :platform: Unix, Windows :synopsis: Extensions for pyrestcli Resource and Manager classes .. moduleauthor:: Daniel Carrion <daniel@carto.com> .. moduleauthor:: Alberto Romeu <alrocar@carto.com> """ import warnings from pyrestcli...
__author__ = 'jbt' import pdb import time def getfunfdata(data): devtype = data['probe'] if devtype== 'deviceinfo': funfdata = deviceinfo(data) return funfdata #if devtype == 'motion': # funfdata = motion(data) # return if devtype == 'positioning': funfdata = positi...
from datetime import datetime import urlparse from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from tagging.fields import TagField from tagging.models import Tag """ A Bookmark is unique to a URL whereas a BookmarkInstance represents a part...
from __future__ import unicode_literals import webnotes @webnotes.whitelist() def update(ml): """update modules""" webnotes.conn.set_global('hidden_modules', ml) webnotes.msgprint('Updated') webnotes.clear_cache()
import json import datetime import numpy as np import re import time from google.appengine.ext import ndb from helpers.tbavideo_helper import TBAVideoHelper from helpers.youtube_video_helper import YouTubeVideoHelper from models.event import Event from models.team import Team class Match(ndb.Model): """ Matches...
import sys, os from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc ...
def spiralNumbers(n): # Create a n*n matrix and store in it increasing numbers in a spiral. matrix = [[0 for _ in range(n)] for _ in range(n)] # 4 possible directions to go around dirs = ["right", "down", "left", "up"] # Index of the current direction we're taking, increasing it while # also wra...
import pytest from teuthology import config class TestYamlConfig(object): def setup(self): self.test_class = config.YamlConfig def test_set_multiple(self): conf_obj = self.test_class() conf_obj.foo = 'foo' conf_obj.bar = 'bar' assert conf_obj.foo == 'foo' assert c...
import unittest import os import json import mock from nose.plugins import PluginTester from nose.plugins.skip import Skip import holmium.core from holmium.core.env import ENV import holmium.core.noseplugin from .utils import build_mock_mapping support = os.path.join(os.path.dirname(__file__), "support") class TestOpti...
import sys,re import urllib.parse as urlparse def fillside(stuff,width=None,fill=' ',side='left'): if not width or not isinstance(width,int): return stuff stuff = str(stuff) w = len(stuff) if w > width: return num fillstr = fill * (width-w) if side=='left': return fillstr+stuff elif side=='right': return...
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2008 Allen B. Downey. Distributed under the GNU General Public License at gnu.org/licenses/gpl.html. """ """Functions for building CDFs (cumulative distribution functions).""" import bisect import math ...
""" *************************************************************************** SelectByLocation.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***********************************************...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Module', fields=[ ('id', models.AutoField(auto_created=True, primary_key=Tru...
from zipfile import ZipFile from bs4 import BeautifulSoup from colorama import init, Fore import urllib.request import shutil import os import errno import time import re import sys init() VALIDATE_LOCALES = True translations_folder_name = 'translations-crowdin' translations_folder_path = os.path.abspath(translations_f...
from __future__ import absolute_import __all__ = ['Parser'] import struct import time import logging import cStringIO from . import core from . import EXIF from . import IPTC log = logging.getLogger('metadata') SOF = { 0xC0 : "Baseline", 0xC1 : "Extended sequential", 0xC2 : "Progressive", 0xC3 :...
from dataclasses import dataclass from typing import ( List, Optional, ) from pcs.common.interface.dto import DataTransferObject @dataclass(frozen=True) class ServiceStatusDto(DataTransferObject): service: str installed: Optional[bool] enabled: Optional[bool] running: Optional[bool] @dataclass(f...
__copyright__ = """ Copyright (c) 2010 Torsten Schmits 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 later version. This program is distribut...
import dbus import sys args = {} for n in range(1, len(sys.argv) - 1, 2): args[sys.argv[n]] = sys.argv[n + 1] obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") pidgin = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") current = pidgin.PurpleSavedstatusGetCurr...
from __future__ import division import nltk import argparse def tok_words(infile,outfile): with open(infile, 'r') as f: text = f.read() text = text.lower() print "Found %d words..." % len(text.split(" ")) text = text.decode('utf8') tokens = nltk.word_tokenize(text) pr...
from django.conf import settings from django.utils.importlib import import_module from misago.thread import local __all__ = ('merge_contexts', 'process_context', 'process_templates') def load_middlewares(): """ Populate _middlewares with list of template middlewares instances """ middlewares = [] fo...
import unittest from PyFoam.Execution.AnalyzedRunner import AnalyzedRunner theSuite=unittest.TestSuite()
from opencv.cv import * from opencv.highgui import * import sys if __name__ == "__main__": laplace = None colorlaplace = None planes = [ None, None, None ] capture = None if len(sys.argv)==1: capture = cvCreateCameraCapture( 0 ) elif len(sys.argv)==2 and sys.argv[1].isdigit(): ca...
from datetime import datetime, timedelta from django.utils.html import strip_tags from django.http import HttpResponse from django.utils.tzinfo import FixedOffset import vobject def icalendar(request, queryset, date_field, ical_filename, title_field='title', description_field='description', ...
""" Creates the default Site object. """ from django.db.models import signals from django.contrib.sites.models import Site from django.contrib.sites import models as site_app def create_secondary_site(app, created_models, verbosity, db, **kwargs): if Site in created_models: if verbosity >= 2: pr...
import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline dataset=pd.read_csv('Salary_Data.csv') dataset.describe() X=dataset.iloc[:,:-1].values y=dataset.iloc[:,1].values from sklearn.model_selection import train_test_split X_train,X_test,y_train,y_test=train_test_spit(X,y,test_size=1/3...
from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import ValidationError from django.db import models from django.urls import reverse from django.utils.functional import cached_property from pootle.core.delegate import data_tool from pootle.core.mixins import CachedTreeItem from...
from itertools import cycle, islice import bpy from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import (dataCorrect, repeat_last) class SvVertMaskNode(bpy.types.Node, SverchCustomTreeNode): '''Delete verts from mesh''' bl_idname = 'SvVertMaskNode' bl_label = 'Mask Vertices' ...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'committer', 'version': '1.0'} DOCUMENTATION = ''' --- module: docker_image_facts short_description: Inspect docker images version_added: "2.1.0" description: - Provide one or more image names, and the module will in...
import os version = "latest" try: fn = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION') version = open(fn).read().strip() except IOError: from subprocess import Popen, PIPE import re VERSION_MATCH = re.compile(r'\d+\.\d+\.\d+(\w|-)*') try: dir = os.path.dirname(os.path...
from time import mktime, strptime from module.plugins.Account import Account class SimplydebridCom(Account): __name__ = "SimplydebridCom" __version__ = "0.1" __type__ = "account" __description__ = """Simply-Debrid.com account plugin""" __author_name__ = ("Kagenoshin") __author_mail__ = ("kagenos...
import sys import getopt import os import time def main(argv): wait_time = 5 power = False reboot = False try: opts, args = getopt.getopt(argv, "hr", ["time="]) except getopt.GetoptError: print('Usage - shutdown.py -h -r --time=<seconds>') sys.exit(2) print args for opt,...
from __future__ import unicode_literals from cStringIO import StringIO from node import (AtomNode, BinaryExpressionNode, BinaryOperatorNode, ConditionalNode, DataNode, IndexNode, KeyValueNode, ListNode, NumberNode, StringNode, UnaryExpressionNode, UnaryOperatorNode,...
"""Read and write Ogg Theora comments. This module handles Theora files wrapped in an Ogg bitstream. The first Theora stream found is used. Based on the specification at http://theora.org/doc/Theora_I_spec.pdf. """ __all__ = ["OggTheora", "Open", "delete"] import struct from mutagen import StreamInfo from mutagen._vorb...
import urlparse import urllib from openerp import models from openerp.tools.translate import _ class MailMail(models.Model): _inherit = 'mail.mail' def _get_unsubscribe_url(self, cr, uid, mail, email_to, msg=None, context=None): m_config = self.pool.get('ir.config_parameter'...
"""Steps to test the "scan-ports" subcommand""" from behave import then, when from hamcrest import assert_that, equal_to, has_items from json import loads import subprocess def _get_hostname(context, name): return context.vm_helper.get_hostname(name) def _assert_discovered_ports(ports, expected_ports): ports = ...
from spack import * class RDichromat(RPackage): """Collapse red-green or green-blue distinctions to simulate the effects of different types of color-blindness.""" homepage = "https://cloud.r-project.org/package=dichromat" url = "https://cloud.r-project.org/src/contrib/dichromat_2.0-0.tar.gz" li...
import random import logging import openpathsampling as paths from openpathsampling.netcdfplus import StorableObject, lazy_loading_attributes from openpathsampling.netcdfplus import DelayedLoader from openpathsampling.tools import refresh_output from collections import Counter import sys if sys.version_info > (3, ): ...
from __future__ import print_function import os import sys import re import rclexecm import subprocess import tempfile import atexit import signal import rclconfig import glob tmpdir = None def finalcleanup(): if tmpdir: vacuumdir(tmpdir) os.rmdir(tmpdir) def signal_handler(signal, frame): sys.e...
from IPython.external.qt import QtGui from IPython.utils.traitlets import Bool from console_widget import ConsoleWidget class HistoryConsoleWidget(ConsoleWidget): """ A ConsoleWidget that keeps a history of the commands that have been executed and provides a readline-esque interface to this history. """...
""" Copyright (C) 2013 Project Hatohol This file is part of Hatohol. Hatohol is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 3 as published by the Free Software Foundation. Hatohol is distributed in the hope that it will be useful,...
import unittest import idlelib.calltips as ct import textwrap import types default_tip = ct._default_callable_argspec class TC(): 'doc' tip = "(ai=None, *b)" def __init__(self, ai=None, *b): 'doc' __init__.tip = "(self, ai=None, *b)" def t1(self): 'doc' t1.tip = "(self)" def t2(self, ai, b=N...
from TestAPIs.StorageDomainAPIs import StorageDomainAPIs import TestData.VirtualMachine.ITC05_SetUp as ModuleData ''' @note: PreData ''' ''' @note: 存储域名称应该由该模块的Setup用例初始化获得,这里暂时用字符串代替 ''' disk_name = 'DISK-1%s'%ModuleData.vm_name sd_id = StorageDomainAPIs().getStorageDomainIdByName(ModuleData.data1_nfs_name) disk_info=...
ANSIBLE_METADATA = { 'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.0' } DOCUMENTATION = ''' --- module: bigip_dns_record short_description: Manage DNS resource records on a BIG-IP description: - Manage DNS resource records on a BIG-IP version_added: "2.2" options: user: ...
from rest_framework.authentication import SessionAuthentication from rest_framework.permissions import IsAdminUser from rest_framework.response import Response from rest_framework.views import APIView from rest_framework import status from seaserv import seafile_api from seahub.api2.endpoints.utils import check_time_pe...
from nova.db.sqlalchemy import models from nova.tests.functional.api_sample_tests import test_servers TAG1 = 'tag1' TAG2 = 'tag2' class ServerTagsJsonTest(test_servers.ServersSampleBase): sample_dir = 'os-server-tags' microversion = '2.26' scenarios = [('v2_26', {'api_major_version': 'v2.1'})] def _get_...
import os from distutils.core import setup from distutils.extension import Extension from Pyrex.Distutils import build_ext kernel = "/lib/modules/" + os.uname()[2] + "/build/include" incs = [kernel] setup( name="python-dvb3", version="0.0.4", author="Paul Clifford", author_email="paul@clifford.cx", license=...
"""Built-in metrics. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import types import numpy as np import six from tensorflow.python.autograph.core import ag_ctx from tensorflow.python.autograph.impl import api as autograph from tensorflow.py...
"""Thread-local context managers for AutoGraph.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading import enum stacks = threading.local() def _control_ctx(): if not hasattr(stacks, 'control_status'): stacks.control_status = [_default_co...
"""Base class for tests in this module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import imp from tensorflow.contrib.autograph import operators from tensorflow.contrib.autograph import utils from tensorflow.contrib.autograph.pyct im...
import asyncio import aiohttp async def fetch(session): print('Query http://httpbin.org/basic-auth/andrew/password') async with session.get( 'http://httpbin.org/basic-auth/andrew/password') as resp: print(resp.status) body = await resp.text() print(body) async def go(loop): ...
from qds_sdk.qubole import Qubole from qds_sdk.resource import Resource import argparse import json class UserCmdLine: @staticmethod def parsers(): argparser = argparse.ArgumentParser( prog="qds.py user", description="User level operations for Qubole Data Service.") subpa...
import logging from opentrons.protocol_api.contexts import ProtocolContext from opentrons.protocols.execution.execute_python import run_python from opentrons.protocols.execution.json_dispatchers import ( pipette_command_map, temperature_module_command_map, magnetic_module_command_map, thermocycler_module_comman...
from nova import context from nova import db from nova import exception from nova.objects import instance_group from nova import test from nova.tests.objects import test_objects class _TestInstanceGroupObjects(test.TestCase): def setUp(self): super(_TestInstanceGroupObjects, self).setUp() self.user_...
import traceback import Axon import time from Axon.AxonExceptions import ServiceAlreadyExists from Axon.CoordinatingAssistantTracker import coordinatingassistanttracker as CAT from Axon.ThreadedComponent import threadedcomponent from Kamaelia.Util.Splitter import PlugSplitter as Splitter from Kamaelia.Util.Splitter imp...
input = """ % This constraint is detected to be violated after it is realized % that the ground idb is empty. % Handled in dl.C, unlike bug.34, where this is done by depgraph.h. d :- e. :- not d. """ output = """ """
"""Keras initializers for TF 2. """ 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.keras import backend from tensorflow.python.ops impor...
from datetime import timedelta from django.db import models from django.utils import timezone from django.contrib.auth.models import User from approver.constants import STATE_CHOICES, COUNTRY_CHOICES, QI_CHECK from approver import utils class Provenance(models.Model): created_by = models.ForeignKey(User, editable=F...
"""Test covariance and correlation on 2 columns, matrices on 400x1024 matric""" import unittest import numpy from sparktkregtests.lib import sparktk_test class CorrelationTest(sparktk_test.SparkTKTestCase): def setUp(self): """Build test frames""" super(CorrelationTest, self).setUp() data_in...
from ..exceptions import StreamError from .stream import Stream from .akamaihd import AkamaiHDStream from .hds import HDSStream from .hls import HLSStream from .http import HTTPStream from .rtmpdump import RTMPStream from .streamprocess import StreamProcess from .wrappers import StreamIOWrapper, StreamIOThreadWrapper f...
from __future__ import unicode_literals from decimal import Decimal import datetime from django.conf import settings from django.core.urlresolvers import reverse from django.core.validators import MinValueValidator, RegexValidator from django.db.models import Manager, Q from django.utils.encoding import python_2_unicod...
from django.conf import settings from django.conf.urls import include, url from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.utils.html import format_html, format_html_join from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models impo...
from __future__ import absolute_import import contextlib import datetime import json import logging import numbers import os import posixpath import sys import time import six if sys.version_info.major == 3: DEFAULT_MODE = 'w+' else: DEFAULT_MODE = 'w+b' PASS = 'PASS' FAIL = 'FAIL' SKIP = 'SKIP' MEASUREMENTS_NAME =...
from __future__ import absolute_import import six from collections import defaultdict from sentry.api.bases.user import UserEndpoint from sentry.api.fields.empty_integer import EmptyIntegerField from sentry.api.serializers import serialize, Serializer from sentry.models import UserOption, UserOptionValue from rest_fram...
import unittest from conans.model.env_info import DepsEnvInfo from conans.model.ref import ConanFileReference class EnvInfoTest(unittest.TestCase): def assign_test(self): env = DepsEnvInfo() env.foo = "var" env.foo.append("var2") env.foo2 = "var3" env.foo2 = "var4" en...
import unittest from configman import option, dotdict, namespace from configman.def_sources import for_mappings class TestCase(unittest.TestCase): def test_setup_definitions_1(self): s = dotdict.DotDict() s.x = option.Option('x', 17, 'the x') s.n = {'name': 'n', 'doc': 'the n', 'default': 23...
from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import TemplateDoesNotExist, loader from django.utils im...
class PlexApiException(Exception): """ Base class for all PlexAPI exceptions. """ pass class BadRequest(PlexApiException): """ An invalid request, generally a user error. """ pass class NotFound(PlexApiException): """ Request media item or device is not found. """ pass class UnknownType(PlexApiE...
from rapidsms.models import Connection from selectable.base import ModelLookup from selectable.registry import registry class ConnectionLookup(ModelLookup): model = Connection search_fields = ('identity__icontains', 'contact__name__icontains') def get_item_value(self, item): return self.get_item_lab...
from datetime import timedelta import numpy as np import pandas as pd from pandas import DataFrame, Series from pandas.core.indexes.timedeltas import timedelta_range import pandas.util.testing as tm from pandas.util.testing import assert_frame_equal, assert_series_equal def test_asfreq_bug(): df = DataFrame(data=[1...
"""Test cases for Zinnia's admin""" from django.test import TestCase from django.test import RequestFactory from django.utils import timezone from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.utils.translation import activate from django.utils.translation import deacti...
from __future__ import print_function import platform import sys import util import psutil import command_executor from command_executor import Command from webelement import WebElement from webshadowroot import WebShadowRoot from websocket_connection import WebSocketConnection ELEMENT_KEY_W3C = "element-6066-11e4-a52e...
"""classes for full test""" import os from cement.core import backend, handler, output from cement.utils import test from scilifelab.pm import PmApp filedir = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) config_defaults = backend.defaults('production', 'archive', 'config', 'project','log', 'runqc', 'db'...
import sys from django.core.management.commands.migrate import Command as MigrateCommand from django.db import transaction from tenant_schemas.utils import get_public_schema_name def run_migrations(args, options, executor_codename, schema_name, allow_atomic=True): from django.core.management import color from d...
"""empty message Revision ID: f450aba2db Revises: 43b2a245dba Create Date: 2015-01-29 14:22:48.300077 """ revision = 'f450aba2db' down_revision = '43b2a245dba' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): op.add_column('job', sa.Column('tags', postgresql.A...
from django.conf import settings from appconf import AppConf class ThemeAppConf(AppConf): ADMIN_URL = "admin:index" CONTACT_EMAIL = "support@example.com" class Meta: prefix = "theme"
"""ErrorCatcher class for Cheetah Templates Meta-Data ================================================================================ Author: Tavis Rudd <tavis@damnsimple.com> Version: $Revision: 1.7 $ Start Date: 2001/08/01 Last Revision Date: $Date: 2005/01/03 19:59:07 $ """ __author__ = "Tavis Rudd <tavis@damnsimpl...
''' Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.html version: 1.0.0b1 ''' import os, re, string, logging, logging.config import const from cStringIO import StringIO from optparse import OptionParser from pygments import highlight from ...
''' Neptune Rising Add-on Copyright (C) 2016 Mr. Blamo 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 later version. ...
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'directsound.pyd') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
from spacewalk.common.rhnLog import log_debug from spacewalk.server import rhnSQL from spacewalk.server.rhnLib import InvalidAction, ShadowAction from spacewalk.server.rhnServer import server_kickstart, server_packages __rhnexport__ = ['initiate', 'schedule_sync'] _query_initiate = rhnSQL.Statement(""" select ak.ap...
from __future__ import absolute_import import json from graphql.language import ast from .scalars import Scalar class JSONString(Scalar): '''JSON String''' @staticmethod def serialize(dt): return json.dumps(dt) @staticmethod def parse_literal(node): if isinstance(node, ast.StringValu...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: hostname author: - "Adrian Likins (@alikins)" - "Hideki Saito (@saito-hideki)" version_added: "1.4" short_description: Manage hostname requir...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = """ --- module: edgeos_config version_added: "2.5" author: - "Nathaniel Cas...
''' OWASP ZSC https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project https://github.com/zscproject/OWASP-ZSC http://api.z3r0d4y.com/ https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ] ''' import binascii import random import string from core.compatible import version _version = version() ...
import json import os import socket import threading import time import traceback import uuid from urllib.parse import urljoin from .base import (CallbackHandler, CrashtestExecutor, RefTestExecutor, RefTestImplementation, TestharnessExecutor, ...
{ "name": "Account voucher display writeoff", "version": "1.0r089", "author": "Therp BV", "category": 'Accounting & Finance', 'complexity': "normal", "description": """ Display writeoff options on sale or purchase vouchers. Without setting these options explicitely, if a payment difference is en...
from spack import * class Fastphase(Package): """Software for haplotype reconstruction, and estimating missing genotypes from population data.""" homepage = "https://stephenslab.uchicago.edu/software.html" url = "http://scheet.org/code/Linuxfp.tar.gz" version('2016-03-30', sha256='f0762eaae3...
import pddl_types class Predicate(object): def __init__(self, name, arguments): self.name = name self.arguments = arguments def parse(alist): name = alist[0] arguments = pddl_types.parse_typed_list(alist[1:], only_variables=True) return Predicate(name, arguments) pars...
from __future__ import print_function import time import os import csv import json import numpy as np from collections import OrderedDict import mxnet as mx from mxnet import profiler from mxnet.gluon import nn from mxnet.test_utils import is_cd_run from common import run_in_spawned_process import pytest def enable_pro...
""" AMT Management Driver """ import copy from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import importutils from ironic.common import exception from ironic.common.i18n import _ from ironic.common.i18n import _LE from ironic.common.i18n import _LI from ironic.conductor import task_ma...
""" Artificial Intelligence for Humans Volume 2: Nature-Inspired Algorithms Python Version http://www.aifh.org http://www.jeffheaton.com Code repository: https://github.com/jeffheaton/aifh Copyright 2014 by Jeff Heaton Licensed under the Apache License, Version 2.0 (the "License"); ...
import os import sys sys.path.insert(0, os.path.abspath('../..')) extensions = [ 'sphinx.ext.autodoc', #'sphinx.ext.intersphinx', 'oslosphinx' ] source_suffix = '.rst' master_doc = 'index' project = u'oslo.context' copyright = u'2014, OpenStack Foundation' add_function_parentheses = True add_module_names = ...
""" IPMI power manager driver. Uses the 'ipmitool' command (http://ipmitool.sourceforge.net/) to remotely manage hardware. This includes setting the boot device, getting a serial-over-LAN console, and controlling the power state of the machine. NOTE THAT CERTAIN DISTROS MAY INSTALL openipmi BY DEFAULT, INSTEAD OF ipmi...
"""The entropy calculation implementation.""" import collections import math from plaso.analyzers.hashers import interface from plaso.analyzers.hashers import manager class EntropyHasher(interface.BaseHasher): """Calculates the byte entropy of input files.""" NAME = 'entropy' ATTRIBUTE_NAME = 'file_entropy' DES...
from testtools import matchers from tempest.api.compute import base from tempest.common.utils import data_utils from tempest import config from tempest import test CONF = config.CONF class VolumesGetTestJSON(base.BaseV2ComputeTest): @classmethod def resource_setup(cls): super(VolumesGetTestJSON, cls).re...
"""Tests for :mod:`dicts`""" import copy import re import unittest import mock import six from simpl.incubator import dicts class TestSplitMergeDicts(unittest.TestCase): """Tests for split/merge dicts in :mod:`dicts`.""" def test_split_dict_simple(self): fxn = dicts.split_dict self.assertEqual(f...
class SortedDict(dict): """ A very rudamentary sorted dictionary, whose main purpose is to allow dictionaries to be displayed in a consistent order in regression tests. keys(), items(), values(), iter*(), and __repr__ all sort their return values before returning them. (note that the sort order...