text
stringlengths
475
200k
## sunspots_get.py ## This is an example of using Wavelets to analyze Sun spots ## using Python libraries numpy, scipy, PyWavelets ## and requests for I/O ## NOTE : this file only gets, web scrapes directly from the main website, the ## sunspot number data. See sunspots.py for actually analyzing the data after ## run...
import math import matplotlib.pyplot as plt import numpy as np import matplotlib.mlab as mlab import pylab #If needed then adjust the parameters totalframe=25 #The number of calibration points used width=1366 #The screen width height=768 #The screen height files=open('svm testing') l=files.readlines() fi=ope...
import macpath from test import support, test_genericpath import unittest class MacPathTestCase(unittest.TestCase): def test_abspath(self): self.assertEqual(macpath.abspath("xx:yy"), "xx:yy") def test_isabs(self): isabs = macpath.isabs self.assertTrue(isabs("xx:yy")) self.ass...
# -*- coding:utf-8 -*- """ 获取股票分类数据接口 Created on 2015/02/01 @author: Jimmy Liu @group : waditu @contact: [EMAIL] """ import pandas as pd from tushare.stock import cons as ct from tushare.stock import ref_vars as rv import json import re from pandas.util.testing import _network_error_classes import ti...
# Copyright (C) 2006-2007 Red Hat, Inc. # Copyright (C) 2009 Tomeu Vizoso, Simon Schampijer # Copyright (C) 2009-2010 One Laptop per Child # # 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, eithe...
from django.contrib import admin from django.contrib.postgres.fields import JSONField from django import forms from .models import * from .tasks import check_ip_status, check_bl from .widgets import SplitJSONWidget class IpAddressAdminForm(forms.ModelForm): class Meta: model = IpAddress fields = ...
# ----------------------------------------------------------------------------- # Vanda news - News application for vanda platform # Copyright (C) 2011 Some Hackers In Town # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
# Generated by Django 2.1.2 on 2018-11-11 12:18 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_countries.fields import workshops.fields def update_contenttypes(apps, schema_editor): ContentType = apps.get_model('contenttypes', 'ContentType...
#!/usr/bin/python # # Copyright 2013 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...
#!/usr/bin/env python """Tests for the flow.""" import time from grr.client import actions from grr.client import vfs from grr.lib import access_control from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import data_store from grr.lib import flags from grr.lib import flow from grr.lib import flo...
# Copyright 2014-2017 Insight Software Consortium. # Copyright 2004-2009 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt from pygccxml import declarations from .. import utils class linker_t( declarations.decl_visitor_t, declara...
#!/usr/bin/env python # python parser module for pre-mir and mature miRNAs, guided by mirbase.org GFF3 # version 0.0.9 (1-6-2014) # Usage MirParser.py <1:index source> <2:extraction directive> <3:output pre-mir> <4: output mature miRs> <5:mirbase GFF3> # <6:pathToLatticeDataframe or "dummy_datafram...
sizes = [20, 10, 5, 1, 0.25, 0.1, 0.05, 0.01] names = ['twenties', 'tens', 'fives', 'ones', 'quarters', 'dimes', 'nickels', 'pennies'] # I tried to write a general greedy algorithm that would # work for both questions 5 and 6, and possible future work def greedy(total, sizes, isDiscrete): quants = [] for size in ...
""" submit failure or test session information to a pastebin service. """ import tempfile from typing import IO import pytest from _pytest.store import StoreKey pastebinfile_key = StoreKey[IO[bytes]]() def pytest_addoption(parser): group = parser.getgroup("terminal reporting") group._addoption( "--...
from NN.Errors import * from NN.PyTorch.Optimizers import * # Abstract Layers class Layer: LayerTiming = Timing() def __init__(self, shape): """ :param shape: shape[0] = units of previous layer shape[1] = units of current layer (self) """ s...
# Copyright 2018 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...
# -*- coding: utf-8 -*- """ koalasendgrid.__init__.py ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Wrapper around the sendgrid package. Adds event hooks and hides as much of the implementation as possible. :copyright: (c) 2015 Lighthouse :license: LGPL """ import config import sendgrid from sendgrid.helpers.mail...
# coding: utf-8 """Forms for the django-shop app.""" from django import forms from django.forms import widgets from django.conf import settings from django.core.exceptions import ValidationError from django.forms.models import modelformset_factory from django.forms.utils import ErrorList, ErrorDict from django.utils.tr...
import numpy import re import math Table=['Xx', 'H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag'...
# Sifer Aseph import numpy import pandas import statsmodels.api as sm def simple_heuristic(file_path): ''' In this exercise, we will perform some rudimentary practices similar to those of an actual data scientist. Part of a data scientist's job is to use her or his intuition and insight t...
""" Given a list with next and random pointer, clone this list """ class Node: def __init__(self, data): """Representation of a linked list Node""" self.data = data self.next = None self.random = None def set_random(self, random_node): self.random = random_node class ...
""" django_extensions.management.jobs """ import os from imp import find_module _jobs = None def noneimplementation(meth): return None class JobError(Exception): pass class BaseJob(object): help = "undefined job description." when = None def execute(self): raise NotImplementedError("Jo...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- encoding:utf8 -*- from fabric import colors from fabric.api import task, settings, hide from denim import django from denim.constants import DeployUser __all__ = ('show_migrations', 'migrate',) def show_migrations(revision=None, non_applied_only=False): """ Print report of migrations. :param revis...
# # Copyright (C) 2008-2013 by Nicolas Piganeau # [EMAIL] # # 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 your option) any later version. ...
from django.template import Library, Node from django import forms, template import re register = Library() SPLIT_RE = re.compile(r'[\s,]+') @register.inclusion_tag('forms/field.html') def show_field(field, wrap_with_tag='tr', classes=()): if isinstance(classes, basestring): classes = classes.split(',') ...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import copy import json import os import pickle import unittest import uuid from django.core.exceptions import SuspiciousOperation from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from django.d...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: [EMAIL] # Maintained By: [EMAIL] import datetime import json import sys import time from flask import current_app class DateTimeEncoder(json.JSON...
# Copyright (c) 2015 Red Hat, 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 require...
#!/usr/bin/python # # Copyright 2012 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...
import kaldi_io import numpy as np import os def get_parser(): import argparse parser = argparse.ArgumentParser() parser.add_argument("w2v_dir", help="wav2vec feature and text directory") parser.add_argument("tar_root", help="output data directory in kaldi's format") parser.add_argument("split", h...
# -*- coding: utf-8 -*- ############################################################################## # # Author: OpenDrive Ltda # Copyright (c) 2013 Opendrive Ltda # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # cons...
from skoolkittest import SkoolKitTestCase from skoolkit.basic import BasicLister, VariableLister class BasicListerTest(SkoolKitTestCase): def _test_basic(self, data, exp_output, prog=23755): snapshot = [0] * prog + data snapshot[23635:23637] = (prog % 256, prog // 256) basic = BasicLister()...
# # Copyright (C) 2011 Red Hat, Inc. # # Author: Angus Salkeld <[EMAIL]> # # 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 your option) any later versio...
#!/usr/bin/env python import os import sys # we want a few paths on the python path # first up we add the root above the application so # we can have absolute paths everywhere python_path = os.path.join( os.path.realpath(os.path.dirname(__file__)), '../../../' ) # we have have a local apps directory apps_path = o...
# Copyright 2012 Karim Sumun # # This file is part of Simple Census Plotter. # # Simple Census Plotter 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...
"""Support for Netgear Arlo IP cameras.""" from datetime import timedelta import logging from pyarlo import PyArlo from requests.exceptions import ConnectTimeout, HTTPError import voluptuous as vol from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME from homeassistant.helpers import confi...
import logging import logging.handlers import os import sys class GroupWriteRotatingFileHandler(logging.handlers.RotatingFileHandler): def _open(self): prevumask = os.umask(0o002) try: rtv=logging.handlers.RotatingFileHandler._open(self) return rtv finally: ...
# # $Id: func.py,v 1.21 2007/04/19 15:51:46 mrnolta Exp $ # # Copyright (C) 2000-2001 Mike Nolta <[EMAIL]> # # 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...
# -*- coding: utf-8 -*- # Helper Functions # Author: Jimmy Royer # [EMAIL] # May 29, 2016 from sknn.mlp import Classifier, Layer, Native import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from sklearn.grid_search import GridSearchCV from sklearn import cross_validation from sklearn.me...
#!/usr/bin/python2 ''' Small utility to execute some llvm bitcode. The use case is a Makefile that builds some executable and runs it as part of the build process. With emmaken, the Makefile will generate llvm bitcode, so we can't just execute it directly. This script will get that code into a runnable form, and run ...
# -*- 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 ve...
from datetime import datetime import pytest import numpy as np import pandas as pd import pandas.util.testing as tm import pandas.util._test_decorators as td from pandas import (DatetimeIndex, date_range, Series, bdate_range, DataFrame, Int64Index, Index, to_datetime) from pandas.tseries.offsets i...
# -*- test-case-name: twisted.conch.test.test_manhole -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Line-input oriented interactive interpreter loop. Provides classes for handling Python source input and arbitrary output interactively from a Twisted application. Also included is syn...
from django.db.models.fields import CharField, DecimalField from django.utils.translation import ugettext_lazy as _ from oscar.core import validators from oscar.forms import fields try: from south.modelsinspector import add_introspection_rules except ImportError: pass else: add_introspection_rules([], ["^...
""" 7zip file parser Informations: - File 7zformat.txt of 7-zip SDK: http://www.7-zip.org/sdk.html Author: Olivier SCHWAB Creation date: 6 december 2006 """ from resources.lib.externals.hachoir.hachoir_parser import Parser from resources.lib.externals.hachoir.hachoir_core.field import (Field, FieldSet, ParserError...
# -*- coding: UTF-8 -*- # This file is part of Beppo. # # Beppo 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 later version. # # Beppo is distribute...
#!/usr/bin/python3 import argparse # Own package imports from common.basic import * """ Script to find trades that are out of order in CSV file Commonly seen in bitcoincharts.com files (at least btceUSD.csv) Then file can be fixed by running sort -t ',' -k 1 -o <output_file> <input_file> """ aparser = argparse.Ar...
#!/usr/bin/env python # # corenlp - Python interface to Stanford Core NLP tools # Copyright (c) 2014 Dustin Smith # https://github.com/dasmith/stanford-corenlp-python # # 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...
import pygame # Colores NEGRO = ( 0, 0, 0) BLANCO = ( 255, 255, 255) AZUL = ( 0, 0, 255) ROJO = ( 255, 0, 0) VERDE = ( 0, 255, 0) # Dimensiones pantalla ANCHO = 300 ALTO = 300 class Menu(): color=BLANCO fondo=NEGRO espacio=30 titulo_x, titulo_y=40,40 pos_titulo=(titulo_x, t...
# Copyright 2015 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...
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # from __future__ import absolute_import, division, unicode_literals from unittest import skipIf ...
__author__ = """Copyright Andy Whitcroft, Martin J. Bligh - 2006, 2007""" import sys, os, subprocess, time, signal, cPickle, logging from autotest_lib.client.common_lib import error, utils # entry points that use subcommand must set this to their logging manager # to get log redirection for subcommands logging_mana...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
#! python ''' This package contains tools for combining high- and low-resolution SSPALS data, and for calculating the so-called delayed fraction, which can be used to estimate the amount of positrons that are converted into long-lived states of positronium. ''' from setuptools import setup def readme()...
from hunting.level.map import LevelMap from hunting.sim.entities import GameObject from hunting.constants import * class Inventory: def __init__(self, max_size, carried_items=[]): self.max_size = max_size self._items = [] for i in carried_items: self.add_item(i) def add_it...
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2015 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
# -*- coding: utf-8 -*- from tower import ugettext_lazy as _lazy NAME_GENERAL = _lazy('For all ages') # L10n: %d is the age in years. For ages %d and higher. NAME_LAZY = _lazy('For ages %d+') # Fill this in after accessing. NAME_REJECTED = _lazy(u'Rating Rejected') NAME_PENDING = _lazy(u'Rating Pending') class RAT...
"""Denon HEOS Media Player.""" import asyncio from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.media_player.const import ( DOMAIN as MEDIA_PLAYER_DOMAIN) from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, EVENT_HOMEAS...
# coding: utf-8 import SocketServer import os import os.path import StringIO from os.path import exists # Copyright 2013 Abram Hindle, Eddie Antonio Santos # # 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 ...
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class which(test.test): """ Autotest module for testing basic functionality of which @author Athira Rajeev<[EMAIL]> """ version = 1 nfail = 0 path = '' de...
from pathlib import Path from shutil import rmtree from subprocess import run pol_ref = ('TTTTTTAGGGAAGATCTGGCCTTCCTACAAGGGAAGGCCAGGGAATTTTCTTCAGAGCAGACCAG' 'AGCCAACAGCCCCACCAGAAGAGAGCTTCAGGTCTGGGGTAGAGACAACAACTCCCCCTCAGAAG' 'CAGGAGCCGATAGACAAGGAACTGTATCCTTTAACTTCCCTCAGGTCACTCTTTGGCAACGACCC' ...
from __future__ import unicode_literals from django.contrib.admin.utils import quote from django.core.urlresolvers import reverse from django.template.response import TemplateResponse from django.test import TestCase, override_settings from .models import Action, Person, Car @override_settings(PASSWORD_HASHERS=('dj...
import unittest from bingo import BingoCard, Simulation from random import choice, randrange # bingo card numbers are generated at random # so we need to repeat the tests some times repetitions = 50 class BingoCardTestCase(unittest.TestCase): def test_size(self): for i in xrange(repetitions): ...
# -*- coding: utf-8 -*- import numpy as np from numpy.random import randint from textwrap import dedent import pytest import pandas as pd from pandas import DataFrame from pandas import read_clipboard from pandas import get_option from pandas.util import testing as tm from pandas.util.testing import makeCustomDatafra...
from QuantumSketchBook.field import Field from QuantumSketchBook.context import MeshContext from scipy.stats import norm from scipy import array, exp, absolute, ones, random class State(Field): def random_values(self, n): probability = absolute(self.vector) ** 2 probability = probability * 10000 ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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 of the ## License, or (at your option) a...
__author__ = 'aanurag' import sys from lcs import printMemo '''returns the maximum value of items that can be stolen items: list of tuples (value,weight); +ve ints max_weight: max weight allowed in your knapsack; +ve int ''' def the_max_you_can_steal(items, max_weight): num_of_items = len(items) max_weigh...
import math import operator import sys import pickle import multiprocessing import ctypes import warnings from distutils.version import LooseVersion import re import numpy as np from numba import njit, jit, vectorize, guvectorize, objmode from numba.core import types, errors, typing, compiler, cgutils from numba.core...
# Author: Paul Kippes <[EMAIL]> import unittest from pyspatialite import dbapi2 as sqlite class DumpTests(unittest.TestCase): def setUp(self): self.cx = sqlite.connect(":memory:") self.cu = self.cx.cursor() def tearDown(self): self.cx.close() def CheckTableDump(self): exp...
import numpy as np from numpy.testing import assert_array_equal from nose.tools import with_setup, assert_true from landlab import FIXED_GRADIENT_BOUNDARY from landlab import RasterModelGrid def setup_grid(): globals().update({ 'rmg': RasterModelGrid(4, 5) }) @with_setup(setup_grid) def test_id_as_...
import asposecellscloud from asposecellscloud.CellsApi import CellsApi from asposecellscloud.CellsApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #sepcify App SID apiServer = "http://api.aspose.com/v1.1" data_fol...
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, Inc. # 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 co...
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models class SaleOrder(models.Model): _inherit = 'sale.order' def _get_order_type(self): return self.env['sale.order.type'].search([], limit=1) type_id = fields.Many2one( comodel_name='sale.ord...
import requests import os import csv import re import os.path import sys import logging from bs4 import BeautifulSoup logging.basicConfig(format = '%(asctime)s %(name)-30s %(levelname)-8s %(message)s', level = logging.DEBUG) def download(info, url = 'http://www.nadaguides.com/Cars/{year}/{make}/{model}/...
# -*- coding: utf-8 -*- import pytest from util.converter import Converter @pytest.mark.parametrize("x, res", [ (1, True), (12, False), (333, True), (333, True) ]) def test_palindrome_number(x, res): from leetcode.palindrome_number import Solution assert Solution().is_palindrome(x) == res ...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys try: from mock import patch except ImportError: from unittest.mock import patch from csvkit.utilities.csvgrep import CSVGrep, launch_new_instance from tests.utils import CSVKitTestCase, ColumnsTests, EmptyFileTests, NamesTests class TestCSVGrep(CSVKi...
# (C) British Crown Copyright 2010 - 2014, Met Office # # This file is part of Iris. # # Iris 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 l...
# # Copyright 2016 Google Inc. # # 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...
""" Add and create new modes for running courses on this particular LMS """ from datetime import datetime, timedelta import pytz from collections import namedtuple, defaultdict from config_models.models import ConfigurationModel from django.core.exceptions import ValidationError from django.db import models from djang...
""" tests.test_component_core ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests core compoments. """ # pylint: disable=protected-access,too-many-public-methods import unittest import homeassistant.core as ha import homeassistant.loader as loader from homeassistant.const import ( STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN...
#!/usr/bin/env python3 from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from io import BytesIO import pyexcel from PIL import Image from .common import * from .version import APP_NAME, APP_VERSION def add_frame(xls, frame, name): ...
# -*- coding: utf-8 -*- """ pint.unit ~~~~~~~~~ Functions and classes related to unit definitions and conversions. :copyright: 2013 by Pint Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import division, unicode_literals, print_function, ab...
from __future__ import print_function import sys import phat if __name__=='__main__': test_data = (sys.argv[1:] and sys.argv[1]) or "../../examples/torus.bin" print("Reading test data %s in binary format ..." % test_data) boundary_matrix = phat.boundary_matrix() # This is broken for some reason i...
from scipy.integrate import odeint from scipy.interpolate import interp1d import numpy as np def ainslie(rel_pos, c_t, D, ti): """Ainslei wake deficit model This function checks if r is greater than the wake radius! Parameters ----------- rel_pos: ndarray [n,3] x,y,z relative positi...
# -*- coding: utf-8 -*- import os from fuel import config from fuel.datasets import H5PYDataset class CalTech101Silhouettes(H5PYDataset): u"""CalTech 101 Silhouettes dataset. This dataset provides the `split1` train/validation/test split of the CalTech101 Silhouette dataset prepared by Benjamin M. Marli...
# =============================================================================== # Copyright 2013 Jake Ross # # 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...
#!/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 DOCUMENTATION = r''' --- module: bigip_gtm_monitor_bigip...
# -*- coding: utf-8 -*- """ Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from types import GeneratorType from flexmock import flexmock, MethodCallError from textwrap import dedent import jso...
################################################################################ # Copyright (C) 2015 Surfacingx # # # # This Program is free software; you can redistribute it and/or modify ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # nest_script.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
""" bjson/request.py Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP Copyright (c) 2010 David Martinez Marti All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions a...
from __future__ import with_statement from django.test import TestCase from tastefulpy.contrib.contenttypes.fields import GenericForeignKeyField from tastefulpy.bundle import Bundle from content_gfk.models import Note, Quote, Rating, Definition from content_gfk.api.resources import NoteResource, DefinitionResource, \ ...
import os import sys sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')) from tartpy.runtime import behavior, SimpleRuntime from tartpy.eventloop import EventLoop @behavior def stateless_beh(self, message): print("Stateless got message: {}".format(message)) @behavior def stat...
#!/usr/bin/env python #coding: utf-8 #### FUNCTIONS #### def header(string): """ Display header """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print '\n', timeInfo, "****", string, "****" def subHeader(string): """ Display subheader """ timeInfo = time.strftime("%Y-%m-%d ...
"""The tests for the panel_iframe component.""" import unittest from unittest.mock import patch from homeassistant import setup from homeassistant.components import frontend from tests.common import get_test_home_assistant class TestPanelIframe(unittest.TestCase): """Test the panel_iframe component.""" def...
import os import sys config = { ######################################################################### ######## WINDOWS GENERIC CONFIG KEYS/VAlUES # if you are updating this with custom 32 bit keys/values please add them # below under the '32 bit specific' code block otherwise, update in this # ...
# -*- coding: utf-8 -*- # # 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 #...