src
stringlengths
721
1.04M
#!/usr/bin/env python # encoding: utf-8 ''' Created on Aug 4, 2016 :author: Yusuke Kawatsu ''' # built-in modules. import os import copy import time import shutil import codecs import sqlite3 import tempfile import datetime # installed modules. from flask import request # my modules. from http_error import make_ht...
# MIT License # # Copyright (c) 2016 Daily Actie # # 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, merge, ...
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
from datetime import timedelta from time import sleep from assertpy import assert_that from bson import ObjectId from pydash import pick from ereuse_devicehub.exceptions import SchemaError from ereuse_devicehub.resources.hooks import TooLateToDelete, MaterializeEvents from ereuse_devicehub.tests import TestStandard f...
# The Model of DeepVO from keras.layers import Input from keras.layers.core import Dense, Dropout, Activation, Flatten, Lambda from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.layers.normalization import BatchNormalization from keras.models import Model from keras.layers.advanced_activation...
# Licensed under GPLv3 (https://www.gnu.org/licenses/gpl.html) import time import threading import RPi.GPIO as GPIO # Button input pins P_BTN_OSC_WAVEFORM = 11 P_BTN_FILT_TYPE = 13 # PTM momentary switches should be connected to these pins and GND # Wave IDs WAVE_SUPERSAW = 1 # Roland JP-8000 emulation WAVE_SINE = 2...
# -*- coding: utf-8 -*- """Field classes for formatting and validating the serialized object. """ # Adapted from https://github.com/twilio/flask-restful/blob/master/flask_restful/fields.py. # See the `NOTICE <https://github.com/sloria/marshmallow/blob/master/NOTICE>`_ # file for more licensing information. from __futu...
# -*- coding: UTF-8 """ Common parsers logic Classes ======= AbstractParser -- Abstract parser Functions ========= parse_multiline_html -- Join html paragraphs collection into one multi line string Attributes ========== RawPost -- Raw post immutable structure """ import re from collections import named...
#!/usr/bin/env python """ If commands require input, it must be line-delimited JSON (e.g. quoted strings). For further documentation, see: https://github.com/jlevy/ghizmo """ import logging as log import sys import os import argparse from ghizmo.commands.lib import to_bool __author__ = 'jlevy' NAME = "ghizmo" VERSI...
# -*- coding: utf-8 -*- # awikie -- This is Wiki engine working in Google App Engine. # Copyright (C) <2013> Motoki Naruse <motoki@naru.se> # # 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 So...
from random import randrange from sympy.simplify.hyperexpand import (ShiftA, ShiftB, UnShiftA, UnShiftB, MeijerShiftA, MeijerShiftB, MeijerShiftC, MeijerShiftD, MeijerUnShiftA, MeijerUnShiftB, MeijerUnShiftC, MeijerUnShiftD, Re...
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = os.environ.get('SECRET_KEY', 'sj0q9n1_h=b8my#6-n^r=l5=hgekx4gwrl1nmaoox^-_%6=%qj') DEBUG = True if not DEBUG and not 'SECRET_KEY' in os.environ: raise Exception('production environments must have it\'s own SECRET_KEY')...
# coding=utf-8 # Author: Gonçalo M. (aka duramato/supergonkas) <supergonkas@gmail.com> # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 Fo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # loki_gtk.py # # Copyright 2014 Daniel Mende <mail@c0decafe.de> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # *...
import json #from LandOrSea import overLand from LandOrSeaBaseline import overLand def filterByLand(path, opath): obj = json.load(file(path)) recs = obj['records'] landRecs = [] n = 0 nLand = 0 for rec in recs: n += 1 lat = rec['lat'] lon = rec['lon'] if overLan...
""" Django settings for scale_test 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/ """ import os import scale import sys import dj_database_url def get_env...
import bpy import os import addon_utils from subprocess import call from urllib.request import urlretrieve from zipfile import ZipFile from tempfile import TemporaryDirectory from shutil import copytree,rmtree from os.path import join python_exec = bpy.app.binary_path_python path_to_addons = bpy.utils.user_resourc...
# -*- coding:utf-8 -*- __author__ = 'LexusLee' import time import json import tornado import tornado.gen from tornado.web import HTTPError from tornado.escape import json_decode from foundation.log import logger from foundation import const from serverAppConfig import DEVICE_TYPE from serverAppConfig import TOKEN_...
import fauxfactory import pytest from widgetastic.utils import partial_match from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.infrastructure.provider.scvmm import SCVMMProvider from cfme.infrastructure.pxe import get_pxe_server_from_config from cfme.infrastructure.pxe...
#!/usr/bin/python # vim: set shiftwidth=4 tabstop=8 autoindent expandtab: # 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/. # For general fontforge documentation, see: # ...
#!/usr/bin/env python2.7 import argparse import logging import os import subcommands import tree def create_groups_subcommands(subparsers): parser_list_group = subparsers.add_parser( 'list', help='list nodes in a groups') parser_list_group.add_argument( 'name', type=str, nargs='?', action='s...
#!/usr/bin/python2.6 import sys, string, os, time, fnmatch, imgFG, markup, re from markup import oneliner as o from numpy import * rootDir = "" pngDir = "" pngBase = 'png/' pathwayNameDict = {} entityDict = {} entityFile = {} imgFG.printPDF = True class1 = [] class2 = [] class3 = [] def parseContrast(file_name, red...
#!/usr/bin/env python3 import json import yaml import click from jinja2 import Environment, FileSystemLoader import os from domain.server import Server from domain.service import Service from domain.cluster import Cluster from utils.common import translate_id, id_to_swarm from database import db from tinydb import w...
#!/usr/bin/python import sys import os import numpy as np import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt import subprocess import traceback pci_dev ={ "name" : "", "loc" : "", "class" : "", "vender" : "", "device" : "", "vd" : "", ...
# -*- coding: utf-8 -*- """ General Command line tool """ import StringIO from optparse import OptionValueError, make_option from django.conf import settings from django.core.cache import cache from django.core.management.base import CommandError, BaseCommand from sveedocuments.models import Page, Insert class Comm...
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
#!/usr/bin/env python # vim: sts=4 sw=4 et # GladeVcp Widgets # # Copyright (c) 2010 Pavel Shramov <shramov@mexmat.net> # # 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...
'''In this lab, you practice "fanning in" and "fanning out" with generator functions. NOTE: The methods of str are detailed here: https://docs.python.org/3/library/stdtypes.html#string-methods First, define the words_in_text() generator function. It takes a path to a text file, and reads its contents, producing its w...
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License from load import load_dataset import numpy as np from knn import learn_model, apply_model, accuracy fe...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
# -*- coding: utf-8 -*- #Canto-curses - ncurses RSS reader # Copyright (C) 2014 Jack Miller <jack@codezen.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. CANTO_PROTOCO...
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def GuestWindowsFileAttributes(vim, *args, **kwargs): '''Different attributes for a Windo...
import json import unittest from testfixtures import LogCapture from kafka.tools.models.broker import Broker from kafka.tools.models.topic import Topic from kafka.tools.models.cluster import Cluster class SimpleClusterTests(unittest.TestCase): def setUp(self): self.cluster = Cluster() def add_broker...
# 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...
# this is used for generating the repo front page from __future__ import print_function def do(cmd, comment=None): if comment: print("# " + comment) print(">>> " + cmd) c = compile(cmd, filename="<string>", mode='single') eval(c, globals()) print() do('from jsondiff import diff') do("dif...
# Sebastian Raschka, 2015 (http://sebastianraschka.com) # Python Machine Learning - Code Examples # # Chapter 5 - Compressing Data via Dimensionality Reduction # # S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015. # GitHub Repo: https://github.com/rasbt/python-machine-learning-book # # License: MIT # ht...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. # 2019, SMART Health IT. import os import io import unittest import json from . import medicinalproduct from .fhirdate import FHIRDate class MedicinalProductTests(unittest.TestCase): def instantiate_from(self...
# -*- coding: utf-8 -*- from django.shortcuts import render from django.views.generic import ListView, CreateView, UpdateView, DeleteView from django.contrib import messages from braces.views import LoginRequiredMixin from .models import InterConsultas from ..historias.models import Historias class InterConsultasMix...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
# Generated by Django 2.2.1 on 2019-07-04 04:49 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('adventure', '0058_auto_20190703_2149'), ('player', '0002_savedgame_created'), ] operations = [ migr...
# 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 # d...
#!/usr/bin/env python #-*- coding:utf-8 -*- """This is a class for Multinomial Logit Regression Class uses scipy.optimize package for minimalization of a cost function. The gradient of the cost function is passed to the minimizer. Piotr Milanowski, November 2011, Warsaw """ from scipy.optimize import fmin_ncg, fmin_...
# Copyright (c) 2010-2020 Manfred Moitzi # License: MIT License import pytest import random from ezdxf.math import ( cubic_bezier_interpolation, Vec3, Bezier3P, quadratic_to_cubic_bezier, Bezier4P, have_bezier_curves_g1_continuity, bezier_to_bspline, ) def test_vertex_interpolation(): points = [(0, 0), (...
#coding:utf-8 ''' 这个通用的自定义功能页面 ''' from django.conf.urls import patterns, url def model_serialize(queryset, extra_fields=[], remove_fields = [], fields = []): """ @param queryset queryset @return a list of dict [{}, {}] 自定义的json转换函数,跟extramixin中的get_fields密切相关 """ return_list = [] for obje...
import requests import logging log = logging.getLogger(__name__) def get_id_from_username(username): url = 'http://graph.facebook.com/{}'.format(username) r = requests.get(url) return r.json()['id'] def get_username_from_id(fb_id): url = 'http://graph.facebook.com/{}'.format(fb_id) r = requests.g...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'meshsettings.ui' # # Created: Thu Jan 31 10:54:20 2013 # by: PyQt4 UI code generator 4.9.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUt...
#!/usr/bin/python3 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The MIT License (MIT) Copyright (c) 2016 Tyler Cromwell 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 th...
# -*- coding:utf8 -*- # !/usr/bin/env python # Copyright 2017 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...
from django.utils import translation from django.utils.functional import lazy import conf from xadrpy.core.i18n.utils import i18n_patterns from django.conf.urls import patterns from xadrpy.core.preferences.base import Prefs from xadrpy.utils.key_string import key_string from django.core.exceptions import ObjectDoesNotE...
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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...
__author__ = 'sekely' # this is a comment. we use it for code documentation. ''' this is comment block. everything between those markers, is considered as a string, or block ''' 1 + 1 # these are pure integers, complete numbers. the result is '2' 3 / 1 # division ot integers will produce an integer. in that case,...
#!/usr/bin/env python # -*- coding:utf8 -*- # Copyright (C) 2012 FinalsClub Foundation import json import os.path import requests from karmaworld.apps.notes.models import Note from karmaworld.apps.notes.models import NoteMarkdown as NoteContent from karmaworld.apps.notes.models import Document from karmaworld.apps.n...
from pymongo import MongoClient from bson.objectid import ObjectId client = MongoClient('localhost', 27017) db = client['tandem'] audios = db['audio'] users = db['users'] files = db['fs.files'] chunks = db['fs.chunks'] practice_sets = db['practice_sets'] practice_sessions = db['practice_sessions'] # remove practice...
#!/usr/bin/env python2.7 # Get error kinds from postfix log messages import os import re import sys class Extractor(object): # 2.X.X Success # 4.X.X Persistent Transient Failure # 5.X.X Permanent Failure EXTCODES = { 0: { None: 'Undefined', 0: 'Other undefined...
# # Copyright (C) 2010, 2014, 2015 Smithsonian Astrophysical Observatory # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any late...
from django.db import models from django.utils.translation import ugettext_lazy as _ class ImmortalQuerySet(models.query.QuerySet): """ Represents a lazy database lookup for a set of objects. It updates "deleted" attribute instead deleting items. """ def delete(self): self.update(deleted=T...
#------------------------------------------------------------------------------- # Name: haxeutils.py # Purpose: # # Author: Darcy.G # # Created: 04/03/2013 # Copyright: (c) Darcy.G 2013 # Licence: <your licence> #------------------------------------------------------------------------------- im...
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> __revision__ = "$Id$" import string, re try: _unicode = unicode except NameError: # If Python is built without Unicode support, the un...
# 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/. print('# This Source Code Form is subject to the terms of the Mozilla Public') print('# License, v. 2.0. If a copy of th...
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" from flask import Flask, render_template from whose_turn_is_it_anyway.settings import ProdConfig from whose_turn_is_it_anyway.assets import assets from whose_turn_is_it_anyway.extensions import ( bcrypt, cache, db, login...
import py, os, sys from pytest import raises from .support import setup_make class TestREGRESSION: helpout = [] def setup_class(cls): import cppyy def stringpager(text, cls=cls): cls.helpout.append(text) import pydoc pydoc.pager = stringpager def test01_kdcr...
# -*- coding:utf-8 -*- from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains import time import sys reload(sys) sys.setdefaultencoding('utf-8') driver = webdriver.Chrome() driver.get("http://bk47.thunics.org:8888/login?next=/plat"...
from django.conf import settings from django.template.base import Context, TemplateDoesNotExist, TemplateSyntaxError from django.template.loader import get_template from django.test import SimpleTestCase from .test_basic import basic_templates from .utils import render, setup include_fail_templates = { 'include-...
#!/usr/bin/env python # Copyright (C) 2013 National Cheng Kung University, Taiwan # All rights reserved. # Configure wether to trace these feature # Warning : Too many contents may freeze Grasp TRACE_QUEUE = True TRACE_MUTEX = True TRACE_BINARY_SEMAPHORE = False TRACE_INTERRUPT = False log = open('log', 'r') lines =...
# 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...
# -*- coding: utf-8 -*- ## Add path to library (just for examples; you do not need this) import sys, os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg from pyqtgraph.GraphicsScene import GraphicsScene app = QtGui.QApplication([]) w...
# -*- coding: UTF-8 -*- ############################################# ## (C)opyright by Dirk Holtwick, 2008 ## ## All rights reserved ## ############################################# __version__ = "$Revision: 103 $" __author__ = "$Author: holtwick $" __date__ = "$Date: 2007-10-31 17:08:54 ...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # This program is distrib...
from django.contrib.auth.decorators import login_required from django.shortcuts import render, render_to_response from seeding.models import Tournament, Team, Session, Game from django.contrib.auth import authenticate, login from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestC...
#!/opt/local/bin/python import string import os import re def header(n) : return "//\n\ // BAGEL - Brilliantly Advanced General Electronic Structure Library\n\ // Filename: RelCASPT2" + n + ".cc\n\ // Copyright (C) 2014 Toru Shiozaki\n\ //\n\ // Author: Toru Shiozaki <shiozaki@northwestern.edu>\n\ // Maintainer: ...
from sympy import diff, Integral, Limit, sin, Symbol, Integer, Rational, cos, \ tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, E, I, oo, \ pi, GoldenRatio, EulerGamma, Sum, Eq, Ne, Ge, Lt, Float from sympy.printing.mathml import mathml, MathMLPrinter from xml.dom.minidom import parseString from ...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAss...
#!python3 def sort_by_stupid_algorithm(in_list, iter_count): ''' (list, int) -> None Applies iter_count iterations of "stupid sort" algorithm to the given input list in place (its mean that source in_list will be mutated). The resulting list will be also returned. >>> _list = []; print(sor...
''' WHAT: Simple test framework for checking algorithms TASK: *Handle output that's an object, eg. bst that gets modified *option3: optional param - Class (accept input/output as arrays and TURN INTO object) (option1: optional param - comparison function (instead of simple "!=") (option2: optional param - Class (autom...
from unittest import TestCase from messageDecode import MessageDecode import time import unittest __author__ = 'Ramki Subramanian' inputstring = "Hi @Ramki how are you (smiles)http://www.cubrid.org/blog/dev-platform/understanding-jvm-internals/" messageTime = time.ctime() class TestMessageDecode(TestCase): def ...
# Copyright 2020 Google LLC. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
import logging import argparse import sys import shlex from os import path from socket import gethostname from getpass import getuser from multiprocessing import cpu_count from xdg.BaseDirectory import load_first_config, xdg_config_home class CustomArgumentParser(argparse.ArgumentParser): def __init__(self, *args,...
# -*- 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 Li...
import os from io import BytesIO from itertools import islice from pathlib import Path from PIL import Image from starlette.responses import Response, PlainTextResponse # TODO centralize this BASE_DIR = os.getenv("BASE_DIR", os.path.dirname(os.path.abspath(__file__))) THUMBNAIL_SIZE = (300, 300) DEFAULT_SIZE = 200 ...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
#!/usr/bin/env python # # Copyright 2009,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr from gnuradio import blocks from gnuradio import filter from gnuradio import analog from gnuradio import channels import sys, ma...
# Copyright (c) 2014-2015, Heliosphere Research LLC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of c...
#!/usr/bin/env python # -*- coding: utf-8 -*- from scipy.stats import binned_statistic as bin_stat from lif import * from syn import * prefs.codegen.target = 'numpy' defaultclock.dt = 1*ms params = LifParams(constant_input=3) params.update(SynParams()) neurons = LifNeurons(1000, params) excitatory_synapses = Excitato...
import prettytable from PythonGists import PythonGists from appuselfbot import bot_prefix from discord.ext import commands from cogs.utils.checks import * '''Module for server commands.''' class Server: def __init__(self, bot): self.bot = bot def find_server(self, msg): serve...
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
""" This module runs a convergence history for a hybridized-DG discretization of a model elliptic problem (detailed in the main function). The method used is the LDG-H method. """ from firedrake import * from firedrake.petsc import PETSc from firedrake import COMM_WORLD import numpy as np import pandas as pd def run...
# -*- coding: utf-8 -*- '''Base TestCase class for OSF unittests. Uses a temporary MongoDB database.''' import os import re import shutil import logging import unittest import functools import datetime as dt from json import dumps import blinker import httpretty from webtest_plus import TestApp from webtest.utils impo...
#!/usr/bin/env python # encoding: utf-8 from operator import itemgetter import cadnano.util as util import cadnano.preferences as prefs from cadnano.cnproxy import ProxyObject, ProxySignal from cadnano.cnproxy import UndoStack, UndoCommand from cadnano.strand import Strand from cadnano.oligo import Oligo from cadna...
""" @author emiller @date 01/22/2013 @description Simple Sublime plugin that enables the familiar Open Terminal Here support within the editor. """ import sublime, sublime_plugin, os, sys class OpenTerminalCommand(sublime_plugin.TextCommand): def run(self, edit): path = os.path.dirn...
import os.path from coalib.bears.LocalBear import LocalBear from coalib.results.Diff import Diff from coalib.results.Result import Result from coalib.bearlib.naming_conventions import ( to_camelcase, to_kebabcase, to_pascalcase, to_snakecase, to_spacecase) class FilenameBear(LocalBear): LANGUAGES = {'All'} ...
from django.contrib.auth.decorators import login_required from django.conf.urls import url from django.views.generic import TemplateView from . import views urlpatterns = [ url(r'^$', login_required(views.IdeaListView.as_view()), name="idealist"), # Idea url(r'idea/(?P<pk>[0-9]+)/$', login_required(views.Ide...
import unittest from aiogibson import errors from aiogibson.parser import Reader, encode_command class ParserTest(unittest.TestCase): def test_not_found(self): data = b'\x01\x00\x00\x01\x00\x00\x00\x00' parser = Reader() parser.feed(data) obj = parser.gets() self.assertEqu...
from __future__ import unicode_literals import base64 import re from .common import InfoExtractor from ..utils import qualities class TeamcocoIE(InfoExtractor): _VALID_URL = r'http://teamcoco\.com/video/(?P<video_id>[0-9]+)?/?(?P<display_id>.*)' _TESTS = [ { 'url': 'http://teamcoco.com/v...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import unittest from typing import Sequence from fairseq.data import LanguagePairDataset, ListDataset, RoundRobinZipDatasets f...
import unittest import doctest from zope.testing import doctestunit from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import zcml from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSi...
# This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2017 DataONE # # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
import StringIO import os import sys import unittest import numpy as np import tigre import tigre.algorithms as algs from tigre.demos.Test_data import data_loader dirname = os.path.dirname(__file__) class TestStdout(unittest.TestCase): pass def test_generator(algorithm, proj, geo, angles, niter): def test...
""" This script contains the hrf() function, which is a utility for computing values of the hemodynamic response function at given times. This is a necessary tool for predicting BOLD signals. Future Python scripts can take advantage of the hrf() function by including the command sys.path.append("code/utils") fr...
# Copyright (c) 2015, Nordic Semiconductor # 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 # list of cond...
# 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...