text
stringlengths
475
200k
#!/usr/bin/env python # This file is part of Rogue Vision. # # Copyright (C) 2016 Daniel Reischl, Rene Rathmann, Peter Tan, # Tobias Dorsch, Shefali Shukla, Vignesh Govindarajulu, # Aleksander Penew, Abhinav Puri # # Rogue Vision is free software: you can redistribute it and/or modify # it under th...
from south.db import db from south.v2 import SchemaMigration from zinnia.migrations import user_name from zinnia.migrations import user_table from zinnia.migrations import user_orm_label from zinnia.migrations import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Changing ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """OpenSSL/M2Crypto 3DES implementation.""" from .cryptomath import * from .tripledes import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_TripleDES(key, mode, IV) class OpenSSL_TripleDES(...
#!/usr/bin/env python __author__ = 'greg' from sklearn.cluster import DBSCAN from sklearn.cluster import AffinityPropagation import numpy as np import matplotlib.pyplot as plt import csv import sys import os import pymongo import matplotlib.cbook as cbook import cPickle as pickle import shutil import urllib import math...
# grouprise settings file # see https://docs.djangoproject.com/en/2.1/ref/settings/ import os import subprocess from stadt.settings.default import * from grouprise.core.assets import add_javascript_reference, add_javascript_inline, add_csp_directive, add_meta # see https://www.miniwebtool.com/django-secret-key-genera...
#!/usr/bin/env python # Copyright (C) 2011 Genome Research Limited -- See full notice at end # of module. # Create a plot of ZMW productivity by x/y position on the # SMRTcell. First parameter is input .bas.h5 file. Output png file is # optional command line parameter, defaulting to productivity.png. import sys impo...
import os from subprocess import check_call from pi.dist import read_script def publish(execute=True, verbose=False, script_name='setup.py'): dist = read_script(script_name) name = dist.get_name() version = dist.get_version() if os.path.exists('README.md'): print 'Converting README.md to reSt...
# -*- coding: utf-8 -*- """ Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pyth...
from java.awt import Color, Dimension from javax.swing import JWindow, JTextArea, JScrollPane __author__ = "Don Coleman <[EMAIL]>" __cvsid__ = "$Id: tip.py,v 1.3 2003/05/01 03:43:53 dcoleman Exp $" class Tip(JWindow): """ Window which provides the user with information about the method. For Python, this s...
"""Support for SCSGate lights.""" import logging from scsgate.tasks import ToggleStatusTask import voluptuous as vol from homeassistant.components.light import PLATFORM_SCHEMA, LightEntity from homeassistant.const import ATTR_ENTITY_ID, ATTR_STATE, CONF_DEVICES, CONF_NAME import homeassistant.helpers.config_validatio...
""" Generate docs for examples. """ import os from types import ModuleType from flexx import ui, app THIS_DIR = os.path.dirname(os.path.abspath(__file__)) DOC_DIR = os.path.abspath(os.path.join(THIS_DIR, '..')) EXAMPLES_DIR = os.path.abspath(os.path.join(DOC_DIR, '..', 'examples')) OUTPUT_DIR = os.path.join(DOC_DIR,...
# 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 by applicable law or agreed to in writing, software # distributed unde...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import urllib2 from telemetry.core import tab from telemetry.core import util from telemetry.core.backends.chrome import inspector_backend_list class TabL...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from neutron.models import Word from .models import AlternateData class AlternateDataForm(forms.ModelForm): word = forms.CharField() class Meta: model = AlternateData fields = '__all__' def __init__(self, *args, **...
# Factories are self documenting # pylint: disable=missing-docstring import factory from uuid import uuid4 from django.core.files.base import ContentFile from factory.django import DjangoModelFactory, ImageField from student.models import LinkedInAddToProfileConfiguration from certificates.models import ( Generat...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class ...
# Author: Nic Wolfe <[EMAIL]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Licen...
# -*- coding: utf-8 -*- """Tests for vcfpy.header """ import sys import vcfpy from vcfpy import header import pytest def test_header_field_info(): """Test the builtin functions of the FieldInfo class""" info1 = header.FieldInfo("Integer", 1, "Some description") info2 = header.FieldInfo("Integer", 1, "S...
# Copyright 2013,2014 Cray Inc # # Authors: David Hewson <[EMAIL]> # Stig Telfer <[EMAIL]> # Mark Goddard <[EMAIL]> # # 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 # ...
#!/usr/bin/env python '''Test that an empty document doesn't break. ''' __docformat__ = 'restructuredtext' __noninteractive = True import unittest from pyglet import gl from pyglet import graphics from pyglet.text import document from pyglet.text import layout from pyglet import window class TestWindow(window.Win...
#!/usr/bin/python # # Copyright 2010 Google Inc. 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.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
from argparse import ArgumentParser from typing import Any, List from zerver.lib.actions import ( bulk_add_subscriptions, bulk_remove_subscriptions, do_deactivate_stream, ) from zerver.lib.cache import cache_delete_many, to_dict_cache_key_id from zerver.lib.management import ZulipBaseCommand from zerver.mo...
import unittest2 import openerp.tests.common as common class test_ir_values(common.TransactionCase): def test_00(self): # Create some default value for some (non-existing) model, for all users. ir_values = self.registry('ir.values') # use the old API ir_values.set(self.cr, self.u...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (C) 2016, 2017 Joshua Charles Campbell # 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 2 # of the License, or (at ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/usr/bin/env python3 # This file is part of the Soletta (TM) Project # # Copyright (C) 2015 Intel Corporation. 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 # # ...
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
from sklearn.decomposition import (PCA, DictionaryLearning, MiniBatchDictionaryLearning) from .common import Benchmark, Estimator, Transformer from .datasets import _olivetti_faces_dataset, _mnist_dataset from .utils import make_pca_scorers, make_dict_learning_scorers class PCABenc...
from __future__ import unicode_literals from django.db import models from django.test import TestCase from rest_framework import serializers from rest_framework.tests.models import ( BlogPost, ManyToManyTarget, ManyToManySource, ForeignKeyTarget, ForeignKeySource, NullableForeignKeySource, OneToOneTarget, Nulla...
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for `iris.aux_factory.AuxCoordFactory`. """ # Import iris.tests first so that some things can be initialised b...
""" Test cases for catalog_integrations command. """ from django.test import TestCase from django.core.management import call_command, CommandError from openedx.core.djangoapps.catalog.models import CatalogIntegration from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin class TestCreateCa...
import discord from discord.ext import commands from __main__ import send_cmd_help import os from .utils.dataIO import dataIO from .utils import checks import re import aiohttp import json from .utils.chat_formatting import pagify import asyncio __author__ = "Sebastian Winkler <[EMAIL]>" __version__ = "1.0" class Mir...
# Copyright 2017 The TensorFlow Authors. 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # # 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 # "L...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
# encoding: utf-8 from waflib import Options, Logs, Errors from waflib.Configure import conf import re def addWebsocketOptions(self, opt): opt.add_option('--without-websocket', action='store_false', default=True, dest='with_websocket', help='Disable WebSocket face support') ...
## # # cmap_parse.py # An attempt to parse concept maps, exported from cmap tools...take one # # Copyright 2016 Josh Pelkey # # 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...
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __all__ = ["BadZipfile", "error", "ZIP_STORED", "Z...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Corwin Brown <[EMAIL]> # # This file is part of Ansible # # Ansible 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 # ...
import time import testing as T class PushTemplateTest(T.TemplateTestCase): authenticated = True push_page = 'push.html' push_status_page = 'push-status.html' accepting_push_sections = ['blessed', 'verified', 'staged', 'added', 'pickme', 'requested'] now = time.time() basic_push = { ...
# -*- coding: utf-8 -*- import re from module.plugins.internal.Hoster import Hoster class PornhubCom(Hoster): __name__ = "PornhubCom" __type__ = "hoster" __version__ = "0.55" __status__ = "testing" __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=\w+' __config__...
"""Helpers for listening to events.""" import functools as ft from homeassistant.helpers.sun import get_astral_event_next from ..core import HomeAssistant, callback from ..const import ( ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL) from ..util import dt as dt_util from ..util.async import run_call...
# -*- coding: utf-8 -*- """ Various dependencies that are required for file-metadata which need some special handling. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import ctypes.util import hashlib import os import subprocess import sys from distutil...
import asyncio import os import struct import logging import random import cmd import argparse from urllib.parse import urlparse from collections import defaultdict from ipaddress import ip_address from datetime import datetime, timedelta from version import __version__ class ServerError(Exception): pass class Ud...
# coding=utf-8 """ Openstack swift collector. #### Dependencies * swift-dispersion-report commandline tool (for dispersion report) if using this, make sure swift.conf and dispersion.conf are readable by diamond also get an idea of the runtime of a swift-dispersion-report call and make sure the collect inte...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/env python SazanamiMincho_map = [ (0, 1), (32, 127), (160, 384), (402, 403), (461, 477), (501, 502), (506, 512), (592, 681), (710, 712), (713, 716), (728, 734), (884, 886), (890, 891), (894, 895), (900, 907), (908, 909), (910, 930), (931, 975), (976, 978), (981, 982), (1013, 1014), (1025, 1037), (1038, 1104)...
# -*- coding: utf-8 -*- # Authors: Eric Larson <[EMAIL]> # License: BSD (3-clause) import numpy as np from ..io import BaseRaw from ..utils import _validate_type, warn, logger, verbose @verbose def realign_raw(raw, other, t_raw, t_other, verbose=None): """Realign two simultaneous recordings. Due to clock ...
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details. from testtools.tests.helpers import FullStackRunTest class TestMatchersInterface(object): run_tests_with = FullStackRunTest def test_matches_match(self): matcher = self.matches_matcher matches = self.matches_matches ...
from __future__ import print_function import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemote_vCont(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) def vCont_supports_...
from .models import AbstractPerson, BasePerson, Person, Relating, Relation TEST_RESULTS = { 'get_all_field_names': { Person: [ 'baseperson_ptr', 'baseperson_ptr_id', 'content_type_abstract', 'content_type_abstract_id', 'content_type_base', ...
# 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 u...
from django.contrib.auth.models import User from rest_framework import mixins from rest_framework import generics from rest_framework import renderers from rest_framework import permissions from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from...
# Copyright 2010-2011 OpenStack Foundation # 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.apache.org/licenses/LICENSE-2.0 # # Unless...
"""Support for the Swedish weather institute weather service.""" from homeassistant.config_entries import ConfigEntry from homeassistant.core import Config, HomeAssistant # Have to import for config_flow to work even if they are not used here from .config_flow import smhi_locations # noqa: F401 from .const import DOM...
# @ 2021 Akretion - www.akretion.com.br - # Magno Costa <[EMAIL]> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models class StockInvoiceOnshipping(models.TransientModel): _inherit = "stock.invoice.onshipping" def _build_invoice_values_from_pickings(self, pi...
#!/usr/bin/env python # # 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 # "L...
# This file is part of DEAP. # # DEAP 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 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """Script to encrypt config files. Usage: scripts/encrypt_conf.py confname1 confname2 ... confnameN scripts/encrypt_conf.py credentials """ import io import click import yaycl_crypt from . import link_config from cfme.utils import conf @click.group(help='Functi...
#!/usr/bin/env python from __future__ import print_function from __future__ import absolute_import __author__ = 'Tony Beltramelli - www.tonybeltramelli.com' import os import sys import shutil from classes.Utils import * from classes.model.Config import * argv = sys.argv[1:] if len(argv) < 2: print("Error: not e...
from __future__ import with_statement import os, sys class TiLogger: ERROR = 0 WARN = 1 INFO = 2 DEBUG = 3 TRACE = 4 def __init__(self, logfile, level=TRACE, output_stream=sys.stdout): self.level = level self.output_stream = output_stream global _logfile _logfile = logfile if _logfile is not None: l...
# test_function.py --- # # Filename: test_function.py # Description: # Author: subha # Maintainer: # Created: Sat Mar 28 19:34:20 2015 (-0400) # Version: # Last-Updated: # By: # Update #: 0 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: # # # # # This pr...
## # Control script Addon jython module. # # This module contains extention of the ControlScript class: # - VirtualBox: this extention class is to be used to control Sun VirtualBox images. ## from controlscript import * import time class ControlScriptAddon(ControlScript): """ Control script Addon""" def __init__(s...
from pychess.Utils.const import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN from pychess.Utils.repr import reprSign, reprColor, reprPiece class Piece: def __init__ (self, color, piece, captured=False): self.color = color self.piece = piece self.captured = captured # in crazyho...
import numpy as np import sys from six import StringIO, b from gym import utils import discrete_env LEFT = 0 DOWN = 1 RIGHT = 2 UP = 3 MAPS = { "4x4": [ "SFFF", "FHFH", "FFFH", "HFFG" ], "8x8": [ "SFFFFFFF", "FFFFFFFF", "FFFHFFFF", "FFFFFHFF...
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector for openload.io # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # by DrZ3r0 # ------------------------------------------------------------ # Modified by Shani import re class AADec...
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis, 2013 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, eith...
import io import sys import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=io.StringIO()) def runTests(self, *cases...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel Corporation. # 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 pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
from mock import ( patch, Mock ) from pytest import raises from kiwi.package_manager import PackageManager from kiwi.exceptions import KiwiPackageManagerSetupError class TestPackageManager: def test_package_manager_not_implemented(self): with raises(KiwiPackageManagerSetupError): Package...
# Copyright Bruno da Silva de Oliveira 2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import os import sys import shutil import fnmatch from zipfile import ZipFile, ZIP_DEFLATED def findfiles(directory, mask)...
# -*- coding: utf-8 -*- ''' Genesis 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 opt...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
# -*- coding: utf-8 -*- """ InaSAFE Disaster risk assessment tool developed by AusAid - **metadata module.** Contact : [EMAIL] .. note:: 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; eit...
""" Test functions for fftpack.basic module """ from __future__ import division, absolute_import, print_function from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble import numpy.fft from numpy.random import rand try: from scipy.fftpack import ifft, fft, fftn, irfft, rfft except ImportError: ...
import logging from functools import partial import math import json from django.http import HttpResponseBadRequest from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django_future.csrf import ensure_csrf_cookie from django.views.decorators.http...
# # # import numpy as np import pandas as pd from scipy.interpolate import interp1d import matplotlib.pyplot as plt import sys # effective temperature prior # inputs Sbar = 60. eSbar = 1. Tinput = 8700. # load spectral type |-> temperature conversion file dt = {'ST': np.str, 'STix': np.float64, 'Teff':np.float64,...
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('browser') and module_exists('javascript'): from browser import window, document from javascript import JSObject, JSConstructor GFX = JSObject(w...
#!/usr/bin/env python from utils.munin.base import MuninGraph import redis class NBMuninGraph(MuninGraph): @property def graph_config(self): return { 'graph_category' : 'NewsBlur', 'graph_title' : 'NewsBlur Feed Counts', 'graph_vlabel' : 'Feeds Feed Counts', ...
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("Example: ...
import logging logger = logging.getLogger(__name__) from redbean.secure.identity import SessionIdentity from redbean.secure.keeper import UserIdentityKeeper from redbean.asyncid import AsyncID64 from test.security.app import rest, etcd_endpoint user_id_generator = AsyncID64('/asyncid/user_sn', etcd_endpoint) keeper ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN. # # Invenio 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...
#!/usr/bin/env python # Copyright 2009 Google Inc. 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.apache.org/licenses/LICENSE-2.0 # # Unless required...
"""The tests for the Rfxtrx light platform.""" from unittest.mock import call import pytest from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.rfxtrx import DOMAIN from homeassistant.core import State from tests.common import MockConfigEntry, mock_restore_cache from tests.compon...
# encoding: utf8 from quantiphy import ( Quantity, UnitConversion, QuantiPhyError, IncompatibleUnits, UnknownPreference, UnknownConversion, UnknownUnitSystem, InvalidRecognizer, UnknownFormatKey, UnknownScaleFactor, InvalidNumber, ExpectedQuantity, MissingName, ) Quantity.reset_prefs() import math impo...
# 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 by applicable law or agreed to in writing, software # distribu...
import socket from tornado import gen from tornado.iostream import IOStream from tornado.log import app_log from tornado.stack_context import NullContext from tornado.tcpserver import TCPServer from tornado.testing import AsyncTestCase, ExpectLog, bind_unused_port, gen_test class TCPServerTest(AsyncTestCase): @g...
"""Execute shell commands via os.popen() and return status, output. Interface summary: import commands outtext = commands.getoutput(cmd) (exitstatus, outtext) = commands.getstatusoutput(cmd) outtext = commands.getstatus(file) # returns output of "ls -ld file" A trailing newline is remov...
import numpy as np class linear_regression: def __init__(self,batch_size=0,epochs=100,learning_rate=0.001,tolerance=0.00001,show_progress=True): """ The function initiaizes the class Parameters ---------- batch_size: int It defines the number of data se...
import operator from glob import glob import os import re import warnings import numpy as np import dask.array as da import xray from xray import Variable from xray.backends.common import AbstractDataStore from xray.core.utils import NDArrayMixin from xray.core.pycompat import OrderedDict from xray.core.indexing impo...
import numpy as np from lxmls.deep_learning.utils import ( Model, glorot_weight_init, index2onehot, logsumexp ) class NumpyLogLinear(Model): def __init__(self, **config): # Initialize parameters weight_shape = (config['input_size'], config['num_classes']) # after Xavier G...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2014 Elico Corp (<http://www.elico-corp.com>) # Alex Duan <[EMAIL]> # # This program is free software: you can redistribute it and/or modif...
# Natural Language Toolkit: XML Corpus Reader # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Steven Bird <[EMAIL]> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT """ Corpus reader for corpora whose documents are xml files. (note -- not named 'xml' to avoid conflicting w/ stan...
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: [EMAIL] # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops = [] f...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-21 00:17 from __future__ import unicode_literals import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True ...
#!/usr/bin/env python # # Unix SMB/CIFS implementation. # # HRESULT Error definitions # # Copyright (C) Noel Power <[EMAIL]> 2014 # # 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 versio...