text
stringlengths
475
200k
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing base test results classes.""" class ResultType(object): """Class enumerating test types.""" PASS = 'PASS' SKIP = 'SKIP' FAI...
#! /usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2011-2014, International Business Machines # Corporation and others. All Rights Reserved. # # file name: depstest.py # # created on: 2011may24 """ICU dependency tester. This probably works only on Linux. The exit code is 0 if everything is fine, 1 for erro...
def get_message(params, operation): message = 'Handling requested operation...' if operation == 'new-metadata': message = 'Opening New Metadata UI' elif operation == 'compile-metadata': if 'paths' in params and len(params['paths']) == 1: what = params['paths'][0] if '...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para thevideo.me # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re from core import httptools from core import l...
""" Unit tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ import json from functools import partial from uuid import uuid4 import ddt from celery.states import FAILURE, SUCCESS from django.utils.translation import ugettext_n...
from requests.auth import HTTPBasicAuth from requests_oauthlib import OAuth2 from mangopaysdk.tools import enums from mangopaysdk.configuration import Configuration class AuthenticationHelper: # Root/parent MangoPayApi instance that holds the OAuthToken and Configuration instance _root = None def __init...
#!/usr/bin/python # # Copyright: Ansible Team # 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', 'status': ['preview'], ...
import numpy as np import _example class Example(_example.Example): title = 'Hello Program' def __init__(self, **kwargs): super().__init__(**kwargs) self.prog = self.ctx.program( vertex_shader=''' #version 330 in vec2 in_vert; vo...
#!/usr/bin/env python """Setup script for cf-predict.""" import setuptools from cf_predict import __project__, __version__ try: README = open("README.rst").read() CHANGES = open("CHANGES.rst").read() except IOError: DESCRIPTION = "<placeholder>" else: DESCRIPTION = README + '\n' + CHANGES setuptool...
""" A 2-dimensional vector class >>> v1 = Vector2d(3, 4) >>> x, y = v1 >>> x, y (3.0, 4.0) >>> v1 Vector2d(3.0, 4.0) >>> v1_clone = eval(repr(v1)) >>> v1 == v1_clone True >>> print(v1) (3.0, 4.0) >>> octets = bytes(v1) >>> octets b'\\x00\\x00\\x00\\x00\\x00\\x00\...
"""numpy.distutils.fcompiler Contains FCompiler, an abstract base class that defines the interface for the numpy.distutils Fortran compiler abstraction model. Terminology: To be consistent, where the term 'executable' is used, it means the single file, like 'gcc', that is executed, and should be a string. In contras...
# Copyright 2019 DeepMind Technologies Ltd. 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 appl...
# -*- test-case-name: twisted.trial.test.test_runner -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A miscellany of code used to run Trial tests. Maintainer: Jonathan Lange """ __all__ = [ 'TestSuite', 'DestructiveTestSuite', 'DryRunVisitor', 'ErrorHolder', 'LoggedSuite', ...
# Copyright (C) 2004, 2005, 2006, 2007 StatPro Italia srl # # This file is part of QuantLib, a free-software/open-source library # for financial quantitative analysts and developers - http://quantlib.org/ # # QuantLib is free software: you can redistribute it and/or modify it under the # terms of the QuantLib license....
"""Component to integrate the Home Assistant cloud.""" import logging import voluptuous as vol from homeassistant.auth.const import GROUP_ID_ADMIN from homeassistant.components.alexa import smart_home as alexa_sh from homeassistant.components.google_assistant import const as ga_c from homeassistant.const import ( ...
import sys import wx #import wx.lib.agw.ultimatelistctrl as ULC from ObjectListView import ObjectListView, ColumnDefn import wx.lib.mixins.gridlabelrenderer as glr from src.wizard.controller.frmVirtualList import VirtualList from src.wizard.controller.frmVirtualGrid import VirtualGrid, GridBase #from lib.ObjectListView...
#!/usr/bin/env python from __future__ import print_function, division, absolute_import import json import os from bokeh.io import curdoc from bokeh.layouts import column, row from toolz import valmap from tornado import gen from distributed.core import rpc from distributed.bokeh.worker_monitor import (worker_table...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
"""numpy.distutils.fcompiler Contains FCompiler, an abstract base class that defines the interface for the numpy.distutils Fortran compiler abstraction model. Terminology: To be consistent, where the term 'executable' is used, it means the single file, like 'gcc', that is executed, and should be a string. In contras...
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <[EMAIL]> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ import (empirical_covari...
""" Test the internal RIFF reader. """ import os import unittest from pyglet.media.sources.riff import WaveSource test_data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'data', 'media')) class RiffTest(unittest.TestCase): def test_pcm_16_11025_1ch(self): file_name = os.path...
#!/usr/bin/env python # # x08c.c # # 3-d plot demo. from Numeric import * import math #import pl import sys import os module_dir = "@MODULE_DIR@" if module_dir[0] == '@': module_dir = os.getcwd () sys.path.insert (0, module_dir) XPTS = 35 # Data points in x YPTS = 46 # Data points in y opt = [1, 2, 3, 3] alt ...
#!/usr/bin/python # -*- coding: utf-8 -*- from EmeraldAI.Logic.Singleton import Singleton from EmeraldAI.Logic.NLP.SentenceResolver import SentenceResolver from EmeraldAI.Entities.ContextParameter import ContextParameter from EmeraldAI.Entities.User import User from EmeraldAI.Config.Config import Config from EmeraldAI....
"""Provides an interface like pexpect.spawn interface using subprocess.Popen """ import os import threading import subprocess import sys import time import signal import shlex try: from queue import Queue, Empty # Python 3 except ImportError: from Queue import Queue, Empty # Python 2 from .spawnbase import ...
# # # Copyright (C) 2013 Google 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 of conditions and ...
# -*- coding: utf-8 -*- """ Site upload test. These tests write to the wiki. """ # # (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __version__ = '$Id: 4d1b1ea2f42aee542722240c9618cc72b4f1bcbb $' import os import pywikibot from tests import _...
import urllib.parse from typing import Sequence from typing import Tuple from mitmproxy.net import check def parse(url): """ URL-parsing function that checks that - port is an integer 0-65535 - host is a valid IDNA-encoded hostname with no null-bytes - path is valid AS...
# hack to return special attributes from _sys import * from javascript import JSObject has_local_storage=__BRYTHON__.has_local_storage has_session_storage = __BRYTHON__.has_session_storage has_json=__BRYTHON__.has_json brython_debug_mode = __BRYTHON__.debug argv = ['__main__'] base_exec_prefix = __BRYTHON__.brython_...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from enum import Enum, auto from inspect import getsourcefile import os import sys from unittest.mock import Mock import pytest from collections import deque current_path = os.path.abspath(getsourcefile(lambda: 0)) current_dir = os.path.dirname(current_path) root_dir = os.path.join(current_dir, os.pardir, os.pardir) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a la...
__author__ = 'hiroki' import theano import theano.tensor as T import numpy as np from nn_utils import sigmoid class Layer(object): def __init__(self, rand, input=None, n_input=784, n_output=10, activation=None, W=None, b=None): self.input = input if W is None: W_values = np.asarray(...
"""distutils.command.build Implements the Distutils 'build' command.""" __revision__ = "$Id$" import sys, os from distutils.util import get_platform from distutils.core import Command from distutils.errors import DistutilsOptionError def show_compilers(): from distutils.ccompiler import show_compilers show...
""" A sub-package for efficiently dealing with polynomials. Within the documentation for this sub-package, a "finite power series," i.e., a polynomial (also referred to simply as a "series") is represented by a 1-D numpy array of the polynomial's coefficients, ordered from lowest order term to highest. For example, a...
""" Test authorization functions """ from django.contrib.auth.models import AnonymousUser from django.test import TestCase from .mixins import CourseApiFactoryMixin from ..permissions import can_view_courses_for_username class ViewCoursesForUsernameTestCase(CourseApiFactoryMixin, TestCase): """ Verify func...
from wptserve.handlers import HTTPException import urllib def main(request, response): if request.method != "GET": raise HTTPException(400, message="Method was not GET") if not "id" in request.GET: raise HTTPException(400, message="No id") id = request.GET['id'] if "read" in request....
""" Tests for the bdist_wheel tag options (--python-tag, --universal, and --plat-name) """ import sys import shutil import pytest import py.path import tempfile import subprocess SETUP_PY = """\ from setuptools import setup, Extension setup( name="Test", version="1.0", author_email="[EMAIL]", py_modu...
#!/usr/bin/env python ''' Open the ./OSPF_DATA/ospf_single_interface.txt and extract the interface, IP address, area, type, cost, hello timer, and dead timer. Use regular expressions to accomplish your extraction. Your output should look similar to the following: Int: GigabitEthernet0/1 IP: 172.16.13.150/29 ...
# -*- coding: UTF-8 -*- #!/usr/bin/env python from __future__ import unicode_literals # odfpy_gen_example.py # http://mashupguide.net/1.0/html/ch17s04.xhtml """ Description: This program used odfpy to generate a simple ODF text document odfpy: http://opendocumentfellowship.com/projects/odfpy documentation for o...
""" Serialize data to/from JSON """ import datetime import decimal from StringIO import StringIO from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as PythonDeserializer from django.utils import datetime_safe from django.utils i...
# (c) 2012, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # A...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
""" Unit tests for instructor dashboard Based on (and depends on) unit tests for courseware. Notes for running by hand: ./manage.py lms --settings test test lms/djangoapps/instructor """ from django.test.utils import override_settings # Need access to internal func to put users in the right group from django.contr...
#!/usr/bin/env python # 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. import unittest from cpp_util import ( Classname, CloseNamespace, GenerateIfndefName, OpenNamespace) class CppUtilTest(unitte...
"""Base classes for all estimators.""" # Author: Gael Varoquaux <[EMAIL]> # License: BSD 3 clause import copy import inspect import warnings import numpy as np from scipy import sparse from .externals import six class ChangedBehaviorWarning(UserWarning): pass ##################################################...
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) Cornelius Kölbel, privacyidea.org # # 2015-02-26 Cornelius Kölbel, <[EMAIL]> # Initial writeup # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # License as publishe...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from hachoir...
""" core implementation of testing process: init, session, runtest loop. """ import imp import os import re import sys import _pytest import _pytest._code import py import pytest try: from collections import MutableMapping as MappingMixin except ImportError: from UserDict import DictMixin as MappingMixin from...
"""SCons.Tool.gnulink Tool-specific initialization for the gnu linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons F...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# (c) 2012, Michael DeHaan <[EMAIL]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # A...
""" Support for ZoneMinder Sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.zoneminder/ """ import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import STATE_UNKNOWN ...
from django.conf import settings from django.db import models from django.utils.translation import gettext as _ from openpds.core.models import Profile class Context(models.Model): datastore_owner = models.ForeignKey(Profile, blank = False, null = False, related_name="datastore_owner_context") context_...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from ggrc import utils from unittest import TestCase class TestUtilsFunctions(TestCase): def test_mapping_rules(self): """ Test that all mappings go both ways """ mappings = utils.get_mapping_ru...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_str, compat_urllib_parse_urlparse, ) from ..utils import ( determine_ext, int_or_none, try_get, qualities, ) class SixPlayIE(InfoExtractor): ...
#!/usr/bin/python # # Copyright (C) 2012 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
import os import sys import time import logging import datetime import numpy as np from data import * from time import clock from parameters import * from collections import defaultdict spike_generators = {} # dict name_part : spikegenerator spike_detectors = {} # dict name_part : spikedetector multimeters = {} ...
# DEPRECATED """ Copyright 2011 Software Freedom Conservancy. 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 ag...
# -*- coding: utf-8 -*- """ pygments.lexers.dsls ~~~~~~~~~~~~~~~~~~~~ Lexers for various domain-specific languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import ExtendedRegexLexer, RegexLexer, ...
# Copyright (C) 2003-2007 Robey Pointer <[EMAIL]> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) ...
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
""" ================================================= Orthogonal distance regression (:mod:`scipy.odr`) ================================================= .. currentmodule:: scipy.odr Package Content =============== .. autosummary:: :toctree: generated/ Data -- The data to fit. RealData -- Dat...
# Copyright (C) 2013 Stratosphere Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# -*- coding: utf-8 -*- """ jinja2.testsuite.api ~~~~~~~~~~~~~~~~~~~~ Tests the public API and related stuff. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, Undefi...
""" USA-specific Form helpers """ from __future__ import absolute_import import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select, CharField from django.utils.encoding import smart_unicode from django.utils.translatio...
# Copyright 2016 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...
# 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. from telemetry.page import shared_page_state from telemetry import story from page_sets import top_pages def _Reload(action_runner): # Numbers below are ...
#-*- conding: utf-8 -*- ''' Creole Reader ------------- This plugins allows you to write your posts using the wikicreole syntax. Give to these files the creole extension. For the syntax, look at: http://www.wikicreole.org/ ''' from pelican import readers from pelican import signals from pelican import settings from...
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
import sys from argparse import ArgumentParser from threading import Timer from time import time from confluent_kafka import avro from confluent_kafka.avro import AvroProducer from random import randint, random from sample_source_props import random_movie, random_series, random_user, random_tags, random_sentence clas...
from django.conf import settings from django.core.cache import cache from django.contrib.sites.models import Site from ragendja.dbutils import db_create from ragendja.pyutils import make_tls_property _default_site_id = getattr(settings, 'SITE_ID', None) SITE_ID = settings.__class__.SITE_ID = make_tls_property() class...
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <[EMAIL]> # Olivier Grisel <[EMAIL]> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..metrics.pairwise import pairwise_di...
"""Test cases for traceback module""" import unittest from test_support import run_unittest import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure that # formatting of SyntaxErrors works based on changes for 2.1. def get_exception_format(self...
# -*- coding: utf-8 -*- import datetime import json import functools from Queue import Queue import six from twisted.application.service import Service from twisted.internet import defer from bouser.excs import SerializableBaseException, ExceptionWrapper from twisted.web.http import Request from bouser.web.cors import...
from __future__ import print_function, division from sympy.core import Basic from sympy.core.compatibility import iterable, as_int, range from sympy.utilities.iterables import flatten from collections import defaultdict class Prufer(Basic): """ The Prufer correspondence is an algorithm that describes the ...
# 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 the...
""" Slapcomp Unit Tests ~~~~~~~~~~~~~~~~~~~~ Testing DAG functions. :Version 0.1 Written by Daniel Hayes ([EMAIL]) June 2012 """ #import os import sys sys.path.append("/Users/d/Dropbox/work/") sys.path.append("/home/d/Dropbox/work/") import unittest from slapcomp.core.dag import Dag from slapcomp.nod...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# -*- coding: utf-8 -*- # # test_vogels_sprekeler_synapse.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 ...
# # (c) 2018 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
""" GCode M562 Example: M562 P0 Reset temperature fault Author: Elias Bakken License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from GCodeCommand import GCodeCommand import numpy as np import logging class M562(GCodeCommand): def execute(self, g): if g.has_letter("P"): ...
# Copyright 2013 IBM Corp. # # 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 t...
"""Utilities for CVS administration.""" import string import os import time import md5 import fnmatch if not hasattr(time, 'timezone'): time.timezone = 0 class File: """Represent a file's status. Instance variables: file -- the filename (no slashes), None if uninitialized lseen -- true if the ...
# This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
from datetime import datetime as d from distutils.dir_util import copy_tree import os from racconto.generator import Generator from racconto.settings_manager import SettingsManager as SETTINGS def generate_archive(pages, posts): """ Generate archive from posts. Assumes posts have been generated (i.e directori...
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
from direct.showbase.InputStateGlobal import inputState #from DirectGui import * #from PythonUtil import * #from IntervalGlobal import * #from otp.avatar import Avatar from direct.directnotify import DirectNotifyGlobal #import GhostWalker #import GravityWalker #import NonPhysicsWalker #import PhysicsWalker #if __debu...
# -*- coding: utf-8 -*- ############################################################################## # # This module uses OpenERP, Open Source Management Solution Framework. # Copyright (C): # 2012-Today Serpent Consulting Services (<http://www.serpentcs. # # This program is free software: you can red...
# # This file is part of CAVIAR. # # CAVIAR 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. # # CAVIAR is distributed in the hope that ...
# 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 use ...
# Copyright 2011 Matt Chaput. 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 conditions and the...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
import scanpy as sc import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import scipy as sp import tensorflow as tf from tensorflow.contrib.opt import ScipyOptimizerInterface nb_zero = lambda t, mu: (t/(mu+t))**t zinb_zero = lambda t, mu, p: p + ((1.-p)*((t/(mu+t))**t)) sigmoid...
import urllib import json import time import mismatch import csv import numpy as np import cPickle import os import pdb class Protein(): """ Class describing a protein in terms of its amino acid sequence Arguments name : string name of the protein """ def __init__(self,name): ...
import numpy import logging from lazyflow.utility import blockwise_view logger = logging.getLogger("tests.test_blockwise_view") def test_2d(): # Adapted from: # http://stackoverflow.com/a/8070716/162094 n=4 m=5 a = numpy.arange(1,n*m+1).reshape(n,m) logger.debug("original data:\n{}".format(a)...
import gc import pprint import sys import unittest from test import support class TestGetProfile(unittest.TestCase): def setUp(self): sys.setprofile(None) def tearDown(self): sys.setprofile(None) def test_empty(self): self.assertIsNone(sys.getprofile()) def test_setget(self)...
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from functools import partial import errno import sys try: import eventlet except ImportError: raise RuntimeError("You need eventlet installed to use this worker.") # validate the ev...