src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This file is part of DaBroker, a distributed data access manager. ## ## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>, ## it is licensed under the GPLv3. See the file `README.rst` fo...
''' Tests for intuition.data.universe ''' import os import unittest from nose.tools import raises, eq_ import dna.test_utils import intuition.data.universe as universe from intuition.errors import LoadMarketSchemeFailed class MarketTestCase(unittest.TestCase): def setUp(self): dna.test_utils.setup_logge...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
__author__ = 'Alejandro Esquiva Rodriguez' from aarpy.AARConnector import AARConnector #AAR Instance ##Create instance via URL AAR = AARConnector(url="http://automaticapirest.info/demo/getData.php?t=Country&c=Code,Name&l=0,5") ##Create instance via parameters AAR = AARConnector(domain="http://automaticapirest.info/d...
"""snipping.prompt_toolkit.layout wrappers for layout """ from prompt_toolkit.key_binding import vi_state from prompt_toolkit.layout import containers from prompt_toolkit.layout import controls from prompt_toolkit.layout import dimension from prompt_toolkit.layout import highlighters from prompt_toolkit.layout import...
from __future__ import (nested_scopes, generators, division, absolute_import, print_function, unicode_literals) from six.moves import zip, range import numpy as np from numpy import zeros, searchsorted, unique, ravel try: import pandas as pd except ImportError: pass from pyNastran.op2....
from __future__ import absolute_import, division, print_function import numbers import toolz import inspect from toolz import unique, concat, compose, partial import toolz from pprint import pprint from ..compatibility import StringIO, _strtypes, builtins from ..dispatch import dispatch __all__ = ['Node', 'path', '...
# -*- coding: utf-8 -*- """ Copyright (C) 2013-2017 Danilo Bargen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,...
"""GUI to calculate gas properties based on cantera. Designed with similar functionality to GasEq Created by Jeffrey Santner """ import os import tkinter from tkinter import ttk import numpy as np import cantera class GasProps(ttk.Frame): """Main window.""" fmt = '{:.6g}' # Number format used throughout...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
# Rekall Memory Forensics # # Copyright 2013 Google Inc. All Rights Reserved. # # Authors: # Michael Hale Ligh <michael.ligh@mnin.org> # # Contributors/References: # Richard Stevens and Eoghan Casey # Extracting Windows Cmd Line Details from Physical Memory. # http://ww.dfrws.org/2010/proceedings/stevens.pdf # ...
from sqlalchemy import Column, Integer, String from internaljobmarket.database import Base class StudentModel(Base): __tablename__ = 'student' student_id = Column(String(50), primary_key=True) studentUid = Column(String(120)) nameLast = Column(String(120)) nameFirst = Column(String(120)) email...
#!/usr/bin/env python3 import time import smbus2 as smbus import logging import threading from collections import deque from rpiweather.sampler import Sampler from rpiweather.data import insert_data from rpiweather import config import rpiweather.data import datetime import pytz logger = logging.getLogger(__name__) ...
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys import os # For unix the prefix 'lib' is not considered. if find_library('linear'): liblinear = CDLL(find_library('linear')) elif find_library('liblinear'): liblinear = CDLL(find_library('liblinear')) else: if sys.platform =...
import pytest from dice.dice import DiceTokenizer import re def test_dice_tokenizer(): TEST_PAIRS = ( ("0d0", ("0", "d0")), ("3d6", ("3", "d6")), ("10d7+4", ("10", "d7", "+4")), ("8d12-3", ("8", "d12", "-3")), ("4d2-2L", ("4", "d2", "-2L")), ("23d24-5H", ("23", "d2...
# -*- coding: utf-8 -*- from pyramid_urireferencer.models import ( RegistryResponse, ApplicationResponse, Item ) class TestRenderers: def test_empty_registry_renderer(self): rr = RegistryResponse('http://id.example.org/foo/1', True, False, 0, []) from pyramid_urireferencer.renderers i...
from rest_framework.viewsets import ModelViewSet from rest_framework.filters import SearchFilter, OrderingFilter from django_filters.rest_framework import DjangoFilterBackend from api.models import * from api.permission import HasGroupPermission from api.v330.spacestation.serializers import SpaceStationDetailedSeriali...
from django.conf.urls import include, url from django.core.urlresolvers import reverse_lazy from django.views.generic import RedirectView from MyInfo import views as my_info_views from django_cas import views as cas_views from oam_base import views as base_views from Duo import views as duo_views # Uncomment the next...
import json import logging import docker.errors import pebbles.drivers.provisioning.docker_driver as docker_driver from pebbles.tests.base import BaseTestCase from pebbles.drivers.provisioning.docker_driver import NAMESPACE_CPU, NAMESPACE_GPU from pebbles.drivers.provisioning.docker_driver import DD_STATE_ACTIVE, DD_ST...
import glob import os from distutils.dep_util import newer from distutils.core import Command from distutils.spawn import find_executable from distutils.util import change_root class build_gschemas(Command): """build message catalog files Build message catalog (.mo) files from .po files using xgettext ...
'''Minion hierarchy ================ Rumor has it there's a mad scientist out there who has abducted hundreds of rabbits to test out a new zombie serum. Agent Beta Rabbit, spy and brilliant mathematician, storms into the room: "I know who's behind that plan. It's a man who calls himself Professor Boolean. My prelimi...
# Copyright 2012 Grid Dynamics # 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ gateway tests - Testing the gateway.getObject() and deleteObjects() methods Copyright 2013-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt pytest fixtures used as defined in conftest.py: - gatewa...
#coding: utf-8 from hashlib import md5 from urllib import urlencode from django import forms from robokassa.conf import LOGIN, PASSWORD1, PASSWORD2 from robokassa.conf import STRICT_CHECK, FORM_TARGET, EXTRA_PARAMS from robokassa.models import SuccessNotification class BaseRobokassaForm(forms.Form): def __init_...
# Copyright 2020 Florent de Labarre # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from datetime import datetime from unittest import mock from odoo import fields from odoo.tests import common _module_ns = 'odoo.addons.account_bank_statement_import_online_ponto' _provider_class = ( _module_ns ...
# Copyright 2008 (C) Nicira, Inc. # # This file is part of NOX. # # NOX 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. # # NOX is dist...
# -*-coding: utf-8-*- import logging from pyramid.view import view_config, view_defaults from pyramid.httpexceptions import HTTPFound from . import BaseView from ..models import DBSession from ..models.transfer import Transfer from ..lib.bl.subscriptions import subscribe_resource from ..lib.utils.common_utils import...
import pytest from pytest_bdd import scenarios, when, then, parsers from ebu_tt_live.errors import OverlappingActiveElementsError, RegionExtendingOutsideDocumentError from ebu_tt_live.documents.converters import EBUTT3EBUTTDConverter from ebu_tt_live.documents import EBUTT3Document from ebu_tt_live.documents import EBU...
# This file is part of GridCal. # # GridCal 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. # # GridCal is distributed in the hope that...
import sys import time from orders.models import Order """ Plug-in example for an Orchestration Action at the "Order Approval" trigger point. May change CloudBolt's default approval behavior to implement custom logic or integrate with an external change management system. The context passed to the plug-in includes t...
import sys import unittest class TestTranslater(unittest.TestCase): @unittest.skipUnless(sys.platform.startswith("win"), "requires Windows") def test_coordinate_identifier(self): import AXUI.driver.windows.Translater as translater from AXUI.parsing.identifier_parsing import identi...
from __future__ import unicode_literals from datetime import date from django.db import models from django.db.models import Q, F from django.utils.translation import get_language from reverse_unique import ReverseUnique def filter_lang(): return Q(lang=get_language()) class Article(models.Model): pub_date...
""" Module spatial referencing for flopy model objects """ import sys import os import numpy as np import warnings class SpatialReference(object): """ a class to locate a structured model grid in x-y space Parameters ---------- delr : numpy ndarray the model discretiza...
from thorpy.elements.ghost import Ghost from thorpy.elements.slider import _SliderXSetter from thorpy.elements.element import Element from thorpy.miscgui import functions, style, painterstyle from thorpy.miscgui import storage class SliderXSetter(Ghost): """Set of text, slider and value""" def __init__(self,...
import unittest import os import shutil import tempfile from foam_controlwrapper.blockmesh_utils import create_quad_mesh from simphony.api import CUDS, Simulation from simphony.core.cuba import CUBA from simphony.cuds.meta import api from simphony.engine import EngineInterface class WrapperRunTestCase(unittest.Test...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module implements a simple conversion and localization between simplified and traditional Chinese using tables from MediaWiki. It doesn't contains a segmentation function and uses maximal forward matching, so it's simple. For a complete and accurate solution, see O...
# Copyright 2017 Fortinet, 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 ...
from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys import unittest import re import sys import os # importing Product_unit_test as a module # set relative path dir_path = os.path.dirname(os.path.realpath(__file__)) try: # First Try for pytho...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # ...
from app.modules.example_data import ExampleWorkItems as WorkItems, ExampleWorks as Works, \ ExampleItems as Items, ExampleVendors as Vendors, ExampleUnits as Units, ExampleCustomers as Customers, \ ExampleUsers as Users from test.e2e.base_api_test import CommonApiTest, append_mandatory_field_tests from test.e2...
import pandas as pd import numpy as np def ss_calc( contrib_yearly, inv_gwth_rt, num_years, safe_withdrw_rate, start_age=28 ): """ inv_gwth_rt is infaltion adjusted. contrib_yearly is in first years dollars """ tot_years = max(0, 62 - start_age - num_years) + num_years df = pd.DataFrame({ ...
import argparse import os import re import sys from . import export_main import load_file import mylogger import save_file from . import proxybuild_main from proxy import paper from proxybuilder_types import SaveFuncTy, ReadFuncTy logger = mylogger.MAINLOGGER # noinspection PyAttributeOutsideInit class SetupData: ...
# -*- coding: utf-8 -*- """ #TODO: break out display utils to another module """ def display_class(class_instance,pv,method_pv=None): #TODO: Handle methods return ('%s:\n' % type(class_instance) + property_values_to_string(pv,extra_indentation=4)) def float_or_none_to_string(x): if ...
"""ShutIt module. See http://shutit.tk """ from shutit_module import ShutItModule class docker_selinux(ShutItModule): def build(self, shutit): # Some useful API calls for reference see shutit's docs for more info and options: # shutit.send(send) - send a command # shutit.multisend(send,send_dict) - send a co...
import urllib, urllib2 import cgi import os from django.conf import settings from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext ...
from unittest import mock from unittest.mock import patch, PropertyMock import pytest from model.agents.student import Student from model.simulation.result import ResultTopics __author__ = 'e.kolpakov' @pytest.fixture def student(behavior_group, curriculum, resource_lookup, env): """ :rtype: student "...
from unittest import TestCase from scrapy.http import Request, HtmlResponse from conftest import RESOURCE_DIR from crimeparser.spiders.police_spider import PoliceSpider class TestPoliceSpider(TestCase): def test_parse_id(self): response = self.fake_response("sample.html", ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.purchase_requisition.tests.common import TestPurchaseRequisitionCommon class TestPurchaseRequisition(TestPurchaseRequisitionCommon): def test_00_purchase_requisition_users(self): self.asse...
# Copyright 2019 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...
# 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...
""" Flask-HTTPAuth -------------- Basic and Digest HTTP authentication for Flask routes. """ from setuptools import setup setup( name='Flask-HTTPAuth', version='3.0.1', url='http://github.com/miguelgrinberg/flask-httpauth/', license='MIT', author='Miguel Grinberg', author_email='miguelgrinber...
# Copyright 2013 OpenStack Foundation # # 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 a...
import autocomplete_light.shortcuts as al from .models import Address from django.contrib.auth import get_user_model from firecares.firestation.models import FireDepartment, FireStation User = get_user_model() al.register(Address, # Just like in ModelAdmin.search_fields search_fields=['addres...
""" OrgEmailDomain manager class @author Chris Church <cchurch@americanri.com> @copyright Copyright 2011 American Research Institute, Inc. """ from pr_services.object_manager import ObjectManager from pr_services.rpc.service import service_method import facade class OrgEmailDomainManager(ObjectManager): """ ...
from scipy.optimize import fmin_cobyla import sys, os, subprocess, numpy P, E = 1000.0, 69e9 # N, Pa, m, m fileName = 'optimizeTest.txt' resultName = '../TestsResults/opt.txt' def objective(x): height = x[0] width = x[1] length = x[2] volume = length * width * height return volume def g0(x): ...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-03-05 13:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('music', '0001_initial'), ] operations = [ mi...
import mock import pytest from signaling.exceptions import InvalidEmit from signaling.exceptions import InvalidSlot from signaling import Signal class Receiver(object): def __init__(self): self.m = mock.Mock() def slot(self): self.m() class TestSignalSlot(object): def setup_method(se...
# Tai Sakuma <tai.sakuma@gmail.com> import ROOT import re ##__________________________________________________________________|| class BranchAddressManagerForVector: """The branch address manager for ROOT TTree This class manages ROOT.vector objects used for branch addresses of ROOT TTree. The main purpos...
#!/usr/bin/python # -*- encoding: utf-8 -*- # Copyright (c) 2012 OpenStack Foundation. # # 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 # # Un...
''' to run in python terminal: python -c "execfile('examples/friendsoffriends.py')" ''' from examples.helpers import Nameable from random import random from whiskeynode import WhiskeyNode from whiskeynode.db import db from whiskeynode.edges import Edge from whiskeynode.terminals import outbound_node, bidirectional_lis...
""" Tests the stem.process functions with various use cases. """ import shutil import subprocess import tempfile import time import unittest import stem.prereq import stem.process import stem.socket import stem.util.system import stem.version import test.runner try: # added in python 3.3 from unittest.mock impor...
#!/usr/bin/env python3 import os import shutil import json import yaml from PIL import Image from nxtools import * class GremaProduct(): def __init__(self, parent, title): self.parent = parent self.title = title self.slug = slugify(title) @property def data_dir(self): re...
"""added copy of customer fields to invoice Revision ID: 76cfb65376ff Revises: 4b75ad4ab96f Create Date: 2016-04-25 13:40:50.053245 """ # revision identifiers, used by Alembic. revision = '76cfb65376ff' down_revision = '4b75ad4ab96f' from alembic import op import sqlalchemy as sa def upgrade(): ### commands a...
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
# coding: utf-8 import pyexcel import xlsxwriter import models import re import datetime from accent_remover import * def formatindicator(indicator): data = indicator if type(indicator) == str: if '.' in indicator and '>' not in indicator: data = float(indicator) return data def f...
""" sentry.models.dsymfile ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2016 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import os import shutil import hashlib import six import tempfile from requests.exceptions import Reque...
# -*- coding: utf-8 -*- # This file is part of AudioLazy, the signal processing Python package. # Copyright (C) 2012-2014 Danilo de Jesus da Silva Bellini # # AudioLazy 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 Foun...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
#Exercício 8 (alternativa) - mostra todos os números negativos de uma vez só no final da execução #Leia quatro valores reais, faça um programa que: #a) Imprima os valores negativos. #b) Calcule e imprima a média dos valores positivos. somatorio = 0 #variável que acumula cada valor positivo qtdePositivos = 0 #variáv...
import pytest from duy_bst import BST @pytest.fixture(scope="function") def make_bst(): b = BST() our_list = [32, 16, 48, 8, 24, 40, 56, 11, 22, 33, 10, 55] for num in our_list: b.insert(num) return b def test_insert(): b = BST() b.insert(50) assert b.size() == 1 assert b.depth...
# 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 under ...
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
import unittest from tonalmodel.modality import Modality, ModalityType, ModalitySpec from tonalmodel.tonality import Tonality class TestTonality(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_major_key(self): tonality = Tonality.create(ModalityType.Ma...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__='''$Id: colortest.py 3959 2012-09-27 14:39:39Z robin $''' import reportlab.pdfgen.canvas from reportlab.lib import colors from reportlab.lib.units import inch def run(): c = reportlab.pdfgen.canvas.Canvas('colortest.pdf') ...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- ''' __author__ = 'Chen Xin' __mtime__ = '02/06/15' ''' import json from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.cors import CORS from flask.ext.restful import Api import requests app = Flask(__name__) # Read Config app.config.fr...
from simplerandom._bitcolumnmatrix import BitColumnMatrix __all__ = [ "Cong", "SHR3", "MWC1", "MWC2", "MWC64", "KISS", "KISS2", "LFSR113", "LFSR88", "_traverse_iter", ] def _traverse_iter(o, tree_types=(list, tuple)): """Iterate over nested containers and/or iterators. ...
from django.contrib import admin from django.utils.safestring import mark_safe from .models import Choice, Question from polls.forms import QuestionForm, ChoiceForm from core.utils import SemanticIcons from django.utils.translation import ugettext_lazy as _ class ChoiceAdmin(admin.ModelAdmin): model = Choice ...
# # # File to test current configuration of GranuleCell project. # # To execute this type of file, type '..\..\..\nC.bat -python XXX.py' (Windows) # or '../../../nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the # NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh # # Author: Padr...
# -*- coding: utf-8 -*- """ Created on Wed Apr 30 16:43:00 2014 @author: jahad """ import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import os def phasePlot(fp,fm,seqname,saveAs): if(os.path.exists(saveAs)): os.remove(saveAs) for x,y,label in zip(fp,fm,seqname): ...
""" Plugin for URLResolver Copyright (C) 2016 script.module.urlresolver 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) a...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-26 21:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('human_resources', '0003_auto_20160826_2113'), ] operations = [ migrations.Cre...
#!/usr/bin/env jython from optparse import OptionParser from kahuna.abstract import AbsPlugin from kahuna.utils.prettyprint import pprint_tiers from kahuna.utils.prettyprint import pprint_vdcs from org.jclouds.abiquo.predicates.cloud import VirtualDatacenterPredicates from org.jclouds.abiquo.domain.exception import Ab...
""" Django settings for djangoproject project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ....
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # ...
import csv import os import random import numpy as np import pandas as pd import matlab_wrapper from lib.utils.timer import Timer from tools.ear_recog import get_gt, ROI_boxes import scipy.io as sio def listdir_no_hidden(path): list1 = [] for f in sorted(os.listdir(path)): if not f.startswith('.'): ...
""" This module provides functions to calculate antenna factors for a given time, a given sky location and a given detector. Adapted from the implementation in pylal """ import sys from math import * import lal import lalsimulation __author__ = "Alexander Dietz <Alexander.Dietz@astro.cf.ac.uk>; Daniel Williams <danie...
# -*- coding: utf-8 -*- # Copyright © 2012-2015 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights t...
""" Copyright (C) 2016 Wojciech Kuprianowicz This file is a part of Simple Queueing System Simulator (SQSS). SQSS 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2013,2014 Rodolphe Quiédeville <rodolphe@quiedeville.org> # # 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 ver...
# -*- coding: utf-8 -*- # Follow up for "Unique Paths": # # Now consider if some obstacles are added to the grids. How many unique paths would there be? # # An obstacle and empty space is marked as 1 and 0 respectively in the grid. # # For example, # There is one obstacle in the middle of a 3x3 grid as illustrated belo...
#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Copyright (C) 2012 by Konstantin Ryabitsev and contributors # # 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Provides a service to store ROS message objects in a mongodb database in JSON. """ import rospy import actionlib import pymongo import os import shutil import subprocess from mongodb_store_msgs.msg import MoveEntriesAction, MoveEntriesFeedback from datetime import * ...
import copy from collections import OrderedDict from collections.abc import Mapping class OrderedSet: """ A set which keeps the ordering of the inserted items. Currently backs onto OrderedDict. """ def __init__(self, iterable=None): self.dict = OrderedDict.fromkeys(iterable or ()) de...
#!/usr/bin/python import sys import pynotify capabilities = {'actions': False, 'body': False, 'body-hyperlinks': False, 'body-images': False, 'body-markup': False, 'icon-multi': False, 'icon-static': False, 'sound': False, 'image/svg+xml': False, ...
# -*- test-case-name: mamba.test.test_web -*- # Copyright (c) 2012 - 2013 Oscar Campos <oscar.campos@member.fsf.org> # See LICENSE for more details """ .. module: page :platform: Unix, Windows :synopsis: The Page object is the main web application entry point .. moduleauthor:: Oscar Campos <oscar.campos@membe...
import pytest from pyramid.exceptions import HTTPNotFound from puzzle_app.views.hitori import hitori_boards_get, hitori_board_get from factories import ( HitoriGameBoardFactory, HitoriGameBoardCellFactory ) class TestHitoriGameBoardsGet: @pytest.fixture def board(self, db_session): board ...
#!/usr/bin/env python # # Copyright (C) 2006 Josh Taylor (Kosmix Corporation) # Created 2006-03-29 # # This file is part of Alien. # # Alien 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 o...
"""$<ticker symbol> for a quote on a stock price""" from __future__ import print_function import logging import re try: from urllib import quote except ImportError: from urllib.request import quote from bs4 import BeautifulSoup import requests logger = logging.getLogger(__name__) def stockprice(ticker): ...
""" Tests for setting up an EventsLoader and a BlazeEventsLoader. """ from datetime import time from itertools import product from unittest import skipIf import blaze as bz import numpy as np import pandas as pd import pytz from zipline.pipeline import Pipeline, SimplePipelineEngine from zipline.pipeline.common impor...