src
stringlengths
721
1.04M
#!/usr/bin/python3 # -*- coding: utf-8 -*- import codecs import os import sys import jinja2 import time import datetime from datetime import date import re import gettext from email import utils from importlib import reload from ActivityInfo import ActivityInfo from ApplicationInfo import ApplicationInfo from PyQt5.Q...
#!/usr/bin/env python3 from argparse import ArgumentParser from mapcombine import outer_process parser = ArgumentParser(description='MapCombine example') parser.add_argument('--mapreduce', default='MapReduce', help="Module that implements map_ and reduce_") parser.add_argument('--MR_init', default=...
# 참고자료 # 모두를 위한 머신러닝/딥러닝 강의 # 홍콩과기대 김성훈 # http://hunkim.github.io/ml from __future__ import print_function import tensorflow as tf import random as ran import matplotlib.pyplot as plt import math from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("./MNIST_data/", one_hot=True...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, formatdate, flt, getdate from frappe import _, throw from erpnext.setup.utils import get_company_currency i...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A class to mail the try bot results. """ try: # Create a block to work around evil sys.modules manipulation in # email/__init__.py that triggers ...
""" @author: Bingwei Chen @time: 8/4/17 @desc: models 每个field 生效是要重新删表,建表 """ import json from datetime import datetime from peewee import * from server.database.db import database from server.utility.constant.basic_constant import \ DELIVERY, APPOINTMENT_STATUS from server.utility.constant.const_db import C...
# -*- coding: utf-8 -*- # (C) 2015 Muthiah Annamalai # setup the paths from opentamiltests import * from solthiruthi.data_parser import * from solthiruthi.solthiruthi import Solthiruthi import sys class CmdLineIO(unittest.TestCase): def test_CLI_interface_help(self): return # find a way to run th...
''' Created on May 17, 2010 @author: jnaous ''' import sys from os.path import join, dirname import subprocess import shlex PYTHON_DIR = join(dirname(__file__), "../../../") sys.path.append(PYTHON_DIR) from unittest import TestCase from expedient.common.utils.certtransport import SafeTransportWithCert from expedient....
import hashlib from app import app from flask import request from flask_restful import Resource, reqparse from app import api from app.auth import require_token from app.handler.dbHelper import DBHelper from app.handler.error_handler import CustomError, NotAllowed __author__ = 'Xiaoxiao.Xiong' class UserAPI(Resourc...
import asyncio import ssl import time from urllib.parse import urlsplit, urlunsplit import aiohttp from . import constants as c def _get_rate_limit_wait(log, resp, opts): """ Returns the number of seconds we should wait given a 429 HTTP response and HTTP options. """ max_wait = 3600 wait =...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Category' db.create_table('content_category', ( ...
import os from flask import Flask, request, jsonify from mongoengine import * import datetime app = Flask(__name__) mongodb_uri = os.environ.get('MONGODB_URI', 'localhost:27017') connect("pokerstats", host=mongodb_uri) class Player(Document): name = StringField(required=True, unique=True, max_length=200) class R...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update encrypted deploy password in Travis config file """ from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.h...
""" Main trainer function """ import theano import theano.tensor as tensor import cPickle as pkl import numpy import copy import os import warnings import sys import time import homogeneous_data from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams from collections import defaultdict from utils imp...
# Copyright (c) 2010-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 # # Unless required by applicable law or agree...
#!/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 endpoint from .fhirdate import FHIRDate class EndpointTests(unittest.TestCase): def instantiate_from(self, filename): ...
# Copyright 2016 Sotera Defense Solutions 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 agre...
# obsolete.py - obsolete markers handling # # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org> # Logilab SA <contact@logilab.fr> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Obsolete ma...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configurati...
"""Component entity and functionality.""" from homeassistant.const import ATTR_HIDDEN, ATTR_LATITUDE, ATTR_LONGITUDE from homeassistant.helpers.entity import Entity from homeassistant.loader import bind_hass from homeassistant.util.async_ import run_callback_threadsafe from homeassistant.util.location import distance ...
#!/usr/bin/python # # Copyright (c) 2019 Yuwei Zhou, <yuwzho@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# Copyright 2006-2015 Mark Diekhans import os import sys import unittest import difflib import threading import errno import re import glob import io import logging try: MAXFD = os.sysconf("SC_OPEN_MAX") except ValueError: MAXFD = 256 def rmTree(root): "remove a file hierarchy, root can be a file or a di...
""" Test email as username authentication """ from __future__ import absolute_import, division, print_function, unicode_literals import json import ddt from django.core.urlresolvers import reverse from provider.constants import CONFIDENTIAL, PUBLIC from .base import OAuth2TestCase from .factories import ClientFactor...
import unittest from minerva.storage.valuedescriptor import ValueDescriptor from minerva.storage.outputdescriptor import OutputDescriptor from minerva.storage import datatype class TestOutputDescriptor(unittest.TestCase): def test_constructor(self): value_descriptor = ValueDescriptor( 'x', ...
from LSP.plugin.core.protocol import Point from LSP.plugin.core.url import filename_to_uri from LSP.plugin.core.views import did_change from LSP.plugin.core.views import did_open from LSP.plugin.core.views import did_save from LSP.plugin.core.views import MissingFilenameError from LSP.plugin.core.views import point_to_...
import sys from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_OAEP import nacl.secret import nacl.utils import base64 class Encryptor: """ Implementation for experiment payload builder using public key RSA encryption. """ def __init__(self, keypath: str): """ param: ke...
####################################### ############### Imports ############### ####################################### import urllib.request import shutil import re import os, errno ############################################ ############### Inital setup ############### ############################################...
# This file is part of OpenHatch. # Copyright (C) 2010, 2011 Jack Grigg # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
#!/usr/bin/env python # encoding: utf-8 """ vecsearch.py Created by mikepk on 2010-05-30. Copyright (c) 2010 Michael Kowalchik. All rights reserved. """ import sys import os import unittest import getopt from Daemon import Daemon import signal import socket import threading import SocketServer import time # standa...
"""MLESAC implementation from https://github.com/vcg-uvic/learned-correspondence-release/blob/master/tests.py""" import cv2 import numpy as np from verifiers.VerificationTemplate import VerificationTemplate MIN_PT_NUM = 8 class MLESAC(VerificationTemplate): def __init__(self): super( MLESAC...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Quicksilver(MakefilePackage): """Quicksilver is a proxy application that represents some e...
#!/usr/bin/env python """Distribution Utilities setup program for NDG Security Package NERC Data Grid Project """ __author__ = "P J Kershaw" __date__ = "24/04/06" __copyright__ = "(C) 2009 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Ke...
import datetime import logging import os import sys import datetime import json from dateutil.parser import parse import multiprocessing import ast import random # cloud from pymongo import MongoClient # kafka from kafka import KafkaConsumer, KafkaProducer from kafka.errors import KafkaError from volttron.platform.v...
AR = '/usr/bin/ar' ARFLAGS = 'rcs' CCFLAGS = ['-g'] CCFLAGS_MACBUNDLE = ['-fPIC'] CCFLAGS_NODE = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] CC_VERSION = ('4', '2', '1') COMPILER_CXX = 'g++' CPP = '/usr/bin/cpp' CPPFLAGS_NODE = ['-D_GNU_SOURCE', '-DEV_MULTIPLICITY=0'] CPPPATH_NODE = '/usr/local/include/node' CPPP...
from twitchio.ext import commands import asyncio import datetime import os import sys import aiohttp import asyncpg import dotenv import pyowm from utilities import context from utilities import logging sys.path.insert(0, "..") from units.games import eightball sys.path.pop(0) class Bot(commands.Bot): def __in...
#!/usr/bin/env python '''------------------------------------------------------------------------------------------------- Check reads distribution over exon, intron, UTR, intergenic ... etc -------------------------------------------------------------------------------------------------''' #import built-in modules im...
import logging from library.config.frontend import adminuser from library.config.security import vault_header from library.connecter.database.mongo import Op_Mongo from library.connecter.database.redis_api import Op_Redis from library.security.encryption.AES256.api import Using_AES256 from library.security.password im...
class Event(object): """ Base class for events Fabio Manganiello, 2015 <blacklight86@gmail.com> """ def __init__(self, component=None, **kwargs): """ Constructor kwargs -- key-value associations for the attributes of the object """ self.__kwargs = kwargs ...
# -*- coding: utf-8 -*- import scrapy from ansicolor import red from ansicolor import cyan from ansicolor import green from ansicolor import blue from django.db.models import Q from urllib import urlencode from parlament.settings import BASE_HOST from parlament.spiders.persons import PersonsSpider from parlament.re...
# -*- coding: utf-8 -*- import unittest from unittest.mock import patch import os from flannelfox.torrenttools.TorrentQueue import Queue from flannelfox.torrenttools import Torrents class TestTorrentQueue(unittest.TestCase): testDatabaseFile = 'ff.db' def removeDatabase(self): try: os.remove(self.testDataba...
# This file is part of MyPaint. # Copyright (C) 2011-2015 by Andrew Chadwick <a.t.chadwick@gmail.com> # Copyright (C) 2007-2012 by Martin Renold <martinxyz@gmx.ch> # # 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 S...
# Lint as: python3 # Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r'''Helper code to handle editing BUILD.gn files.''' from __future__ import annotations import difflib import pathlib import re import su...
# # 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...
# -*- coding: utf-8 -*- # Copyright(C) 2013 Bezleputh # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
from bs4 import BeautifulSoup from django.db import models from django import forms from wagtail.core.models import Page, Orderable from wagtail.core.fields import RichTextField, StreamField from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel, InlinePanel from wagtail.images.edit_handlers import Imag...
""" Django settings for untitled1 project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
from django.db import IntegrityError from django.test import TestCase from candidates.tests.auth import TestUserMixin from duplicates.models import DuplicateSuggestion from people.tests.factories import PersonFactory class TestDuplicateSuggestion(TestUserMixin, TestCase): def setUp(self): self.people = P...
#!/usr/bin/env python # Copyright (C) 2009-2013 Roman Zimbelmann <hut@lepus.uberspace.de> # This software is distributed under the terms of the GNU GPL version 3. import distutils.core import os.path import ranger def _findall(directory): return [os.path.join(directory, f) for f in os.listdir(directory) \ ...
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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: # 1. Redistributions of source code must retain the above copyright notice, # this list...
from math import cos from math import sin import numpy as np import sympy from sympy import pprint def two_wheel_2d_model(x, u, dt): """Two wheel 2D motion model Parameters ---------- x : np.array Two Wheel model state vector (x, y, theta) u : np.array Input dt : float ...
# (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) """ Collects network metrics. """ import array import distutils.spawn import os import re import socket import struct from collections import defaultdict import psutil from six import PY3, iteritems, itervalu...
from .operations import Operations from .migration import MigrationContext from . import util class EnvironmentContext(object): """Represent the state made available to an ``env.py`` script. :class:`.EnvironmentContext` is normally instantiated by the commands present in the :mod:`alembic.command` m...
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists o...
# -*- coding: utf-8 -*- """Tests for the artifact definitions readers.""" import io import os import unittest from artifacts import definitions from artifacts import errors from artifacts import reader class YamlArtifactsReaderTest(unittest.TestCase): """Class to test the YAML artifacts reader.""" def testRead...
# A3C -- unfinished! from actor_learner import * from policy_v_network import * import time class A3CLearner(ActorLearner): def __init__(self, args): super(A3CLearner, self).__init__(args) # Shared mem vars self.learning_vars = args.learning_vars conf_learning...
#!/usr/bin/python # @Author: Tobias Holmqvist <tohol> # @Date: 2017-09-11 # @Email: tobias.m.holmqvist@gmail.com # @Project: awsCrud # @Last modified by: tohol # @Last modified time: 2017-09-11 # @License: GPLv3 class Instances: def __init__(self, response): # New instance object self.__insta...
#! Last Change: Fri Jan 25 05:00 PM 2008 J import unittest from numscons.checkers.fortran.fortran import parse_f77link from numscons.checkers.fortran.fortran import gnu_to_scons_flags, find_libs_paths from fortran_output import g77_link_output, gfortran_link_output, \ sunfort_v12_link_output, ifort_v10_link_outpu...
# Copyright 2019 The TensorNetwork 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 applicable law or agreed ...
""" Plugin for pylint that tells it about flask's extension classes. """ from pylint.utils import PyLintASTWalker from logilab.astng import MANAGER from logilab.astng import node_classes def copy_node_info(src, dest): """Copy information from src to dest Every node in the AST has to have line number information....
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging from google.appengine.ext import ndb import mock from components import config as config_component from components.config import validation...
# -*- coding: utf-8 -*- # # Default constance keys, and their values. # u""" Copyright 2013-2014 Olivier Cortès <oc@1flow.io>. This file is part of the 1flow project. 1flow 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 Soft...
from os.path import join from uuid import uuid4 from shutil import copyfile _js_repl = """;(function () { var repl = require('repl'); var os = require('os'); var empty = '(' + os.EOL + ')'; repl.start({ prompt: "NODE> ", eval: function (cmd, context, filename, callback) { i...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright © 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hop...
import numpy as np from scipy._lib._util import _asarray_validated __all__ = ["logsumexp", "softmax", "log_softmax"] def logsumexp(a, axis=None, b=None, keepdims=False, return_sign=False): """Compute the log of the sum of exponentials of input elements. Parameters ---------- a : array_like I...
import datetime import gviz_api from logger.models import Log from logger.heatmaps import moving_average # TODO NEED TO CLEAN THIS CODE def fountains_current(fountains): description = [ ('Fountain Name', 'string'), ('Latest Reading', 'number'), ('Daily Rate', 'number')] data_table = gviz_api....
import datetime from django.db import models from django.contrib.auth.models import User import json import uuid from qa import models as qamodels PROGRAM_MODEL_CHOICES = ( ('school_wide', '2+2'), ('fellowship', 'Fellowship Model'), ('ptlt', 'PTLT'), ) class District(models.Model): name = models.CharF...
from coati.powerpoint import open_pptx, runpowerpoint import os import sys import logging from shutil import copyfile from colorlog import ColoredFormatter LOG_LEVEL = logging.DEBUG LOGFORMAT = "%(asctime)s - %(log_color)s%(message)s" logging.root.setLevel(LOG_LEVEL) formatter = ColoredFormatter(LOGFORMAT) stream = lo...
# Copyright 2017,2018,2019,2020,2021 Sony Corporation. # # 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...
import os import logging import argparse from pyotdr.dump import tofile, ExportDataType from pyotdr.read import sorparse logging.basicConfig(format="%(message)s") logger = logging.getLogger(__name__) LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG") logger.setLevel(LOG_LEVEL) def main(): parser = argparse.ArgumentPars...
import sys sys.path.append('tensorflow-deepq') from tf_rl.controller.discrete_deepq import DiscreteDeepQ import tensorflow as tf import random import numpy as np class DDQN(DiscreteDeepQ): target_update_frequency = 1e4 def create_variables(self): self.target_network_update_rate = 1.0 self.target_network_upda...
#!/usr/bin/env python # nvPY: cross-platform note-taking app with simplenote syncing # copyright 2012 by Charl P. Botha <cpbotha@vxlabs.com> # new BSD license # inspired by notational velocity and nvALT, neither of which I've used, # and ResophNotes, which I have used. # full width horizontal bar at top to search # ...
# -*- coding: utf-8 -*- # # matrigram documentation build configuration file, created by # sphinx-quickstart on Tue Dec 20 11:09:38 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
import os import re import yaml from .exceptions import MiuraException import logging logger = logging.getLogger(__name__) def load_data_from_path(path): file_paths = load_file_or_directory(path) return retrieve_data(file_paths) def load_file_or_directory(path): """ given a path, determine if the p...
from __future__ import unicode_literals import unittest from ship.fmp.datunits import riverunit from ship.fmp.datunits import ROW_DATA_TYPES as rdt from ship.datastructures.rowdatacollection import RowDataCollection from ship.datastructures import dataobject as do from ship.fmp.fmpunitfactory import FmpUnitFactory ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # javascript.py # # Copyright 2015 Neil Williams <codehelp@debian.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 version 3 of ...
import Image, ImageEnhance def add_watermark(image, watermark, opacity=1, wm_interval=None): assert opacity >= 0 and opacity <= 1 if opacity < 1: if watermark.mode != 'RGBA': watermark = watermark.convert('RGBA') else: watermark = watermark.copy() alpha = waterm...
import zeit.content.article.edit.browser.testing class Form(zeit.content.article.edit.browser.testing.BrowserTestCase): block_type = 'raw' def test_inline_form_saves_values(self): self.get_article(with_empty_block=True) b = self.browser b.open('editable-body/blockname/@@edit-rawxml?s...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# -*- coding: utf-8 -*- # # Copyright (c) 2012-2018, CRS4 # # 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...
# Copyright 2018, The TensorFlow Federated 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 applicable law o...
import os.path from django.http import HttpResponseRedirect, HttpResponseServerError from casexml.apps.case.models import CommCareCase from corehq.apps.importer import base from corehq.apps.importer import util as importer_util from corehq.apps.importer.tasks import bulk_import_async from django.views.decorators.http i...
""" Copyright (c) 2013, Regents of the University of California 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 o...
from __future__ import print_function from builtins import object from django.core.management.base import BaseCommand from iati.models import Organisation from iati_synchroniser.models import Publisher class Command(BaseCommand): option_list = BaseCommand.option_list counter = 0 def handle(self, *args, **...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # seriesly - XBMC Plugin # Conector para videos externos de veevr # http://blog.tvalacarta.info/plugin-xbmc/seriesly/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from co...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject Steps for deploying a new verison: 1. Increase the version number 2. remove the old deployment under [dist] folder 3. run: python setup.py sdist run: python setup.py bdist_wheel -...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import unittest import numpy as np from monty.os.path import which from pymatgen.core.lattice import Lattice from pymatgen.core.structure import Structure, Molecule from pymatgen.transformations.site_transfo...
import numpy as np from matplotlib import pyplot as plt from matplotlib import gridspec from itertools import product from scipy.ndimage.filters import gaussian_filter1d import sys import logging from biseqt.blot import WordBlot, find_peaks, band_radius from biseqt.sequence import Alphabet from biseqt.stochastics imp...
#!/usr/bin/env python3 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the foll...
from .default import default class tag_value(default): def compile(self, prop): if prop['value_type'] == 'string': return repr(prop['value']) # TODO: first priority should name "name:" + LANG if prop['value'] == 'auto' and \ (prop['key'] == 'text' or prop['key'][-5:...
# MultiAgent 2.0 # (c) 2017-2018, NiL, csningli@gmail.com import sys, math sys.path.append("../..") from mas.multiagent import * from mas.extension import ShowLabelObject POS_ERROR = 5 SPIN_SPEED = math.pi / 6.0 class SpinModule(ObjectModule) : def act(self, resp) : resp.add_msg(Message(key = "avel", ...
from twisted.internet import defer from decaf_utils_rpc.rpc_layer import RpcLayer from . import __version__ from . import version_date __author__ = "Andreas Krakau" __date__ = "$20-oct-2015 12:22:23$" class BunnyConnector(object): def __init__(self, url, logger): self.logger = logger self._rpc = ...
#!/usr/bin/env python import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def main(): sns.set_style('ticks') df = pd.read_csv('results.csv') df['fraction_good_splits'] = (df['perfect_splits']/df['fraction_perfect_splits'] - df['mismatching_leaf_sets'] - df['flipped_splits']) / (df['p...
""" Test Plugins ------------ """ from nose.tools import raises from virtstrap.hooks import Hook, create def test_initialize_Hook(): hook = Hook() @raises(NotImplementedError) def test_run_hook(): hook = Hook() options = None hook.run('fake_event', options) def test_fake_hook(): class FakeHook(H...
""" Django settings for zibawa_PKI project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ https://docs.zibawa.com For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/r...
# Load Game Menu Component # Part of the Glitch_Heaven project # Copyright 2015-2016 Penaz <penazarea@altervista.org> from components.UI.loadmenu import loadMenu from os import listdir from os.path import join as pjoin from os import remove from game import Game from components.UI.textMenuItem import textMenuItem from ...
import pyxb.utils.domutils import xml.dom import xml.dom.minidom import pyxb.namespace # Structure #import DWML #print 'Validating DWML' #DWML.Namespace.validateSchema() #print 'Validated DWML: types %s' % ("\n".join(DWML.Namespace.typeDefinitions().keys()),) xmls = open('NDFDgen.xml').read() dom = xml.dom.minidom.pa...
#!/bin/env python #-*-coding:utf-8-*- import MySQLdb import string import sys reload(sys) sys.setdefaultencoding('utf8') import ConfigParser def get_item(data_dict,item): try: item_value = data_dict[item] return item_value except: pass def get_parameters(conn): ...
""" Tools for managing data for use with `~windspharm.standard.VectorWind` (or indeed `spharm.Spharmt`). """ # Copyright (c) 2012-2013 Andrew Dawson # # 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 ...
#! /usr/bin/env python """ Copyright 2015 Akamai Technologies, 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 Unles...
"""Simple textbox editing widget with Emacs-like keybindings.""" import sys, curses, ascii def rectangle(win, uly, ulx, lry, lrx): "Draw a rectangle." win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, l...