text
stringlengths
475
200k
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above ...
# -*- 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 GNU...
""" Models for bulk email WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration bulk_email --auto description_of_your_change 3. Add...
#pylint: disable=missing-docstring ################################################################# # DO NOT MODIFY THIS HEADER # # MOOSE - Multiphysics Object Oriented Simulation Environment # # # # (c) 2010...
import gc from typing import Type import numpy as np import pytest from pandas._libs import iNaT from pandas.errors import InvalidIndexError from pandas.core.dtypes.common import is_datetime64tz_dtype from pandas.core.dtypes.dtypes import CategoricalDtype import pandas as pd from pandas import ( CategoricalInde...
from pylearn2.models.mlp import MLP from pylearn2.models.maxout import Maxout from pylearn2.training_algorithms.sgd import SGD import logging import warnings import sys import numpy as np from theano.compat import six from theano import config from theano import function from theano.gof.op import get_debug_values impo...
# Copyright (C) 2010 Chris Jerdonek ([EMAIL]) # # 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 followin...
""" The GeometryColumns and SpatialRefSys models for the PostGIS backend. """ from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class PostGISGeometryColumns(models.Model): ...
# This file is part of DiSTAF # Copyright (C) 2015-2016 Red Hat, Inc. <http://www.redhat.com> # # 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 # any l...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import pytest from psd_tools import PSDImage, Layer, Group from .utils import full_name PIXEL_COLORS = ( # filename probe point pixel value ('1layer.psd', (5, 5), (0x27, 0xBA, 0x0F)), (...
from datetime import datetime import json from pytz import UTC from django.test import TestCase from track.utils import DateTimeJSONEncoder class TestDateTimeJSONEncoder(TestCase): def test_datetime_encoding(self): a_naive_datetime = datetime(2012, 05, 01, 07, 27, 10, 20000) a_tz_datetime = dat...
""" tell.py: written by sklnd in July 2009 2010.01.25 - modified by Scaevolus""" import time import re from util import hook, timesince db_ready = [] def db_init(db, conn): """Check that our db has the tell table, create it if not.""" global db_ready if not conn.name in db_ready: db.exec...
data = ( '-', # 0x00 '-', # 0x01 '|', # 0x02 '|', # 0x03 '-', # 0x04 '-', # 0x05 '|', # 0x06 '|', # 0x07 '-', # 0x08 '-', # 0x09 '|', # 0x0a '|', # 0x0b '+', # 0x0c '+', # 0x0d '+', # 0x0e '+', # 0x0f '+', # 0x10 '+', # 0x11 '+', # 0x12 '+', # 0x13 '+', # 0...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
import sys import codecs import snowballstemmer def usage(): print('''usage: %s [-l <language>] [-i <input file>] [-o <output file>] [-c <character encoding>] [-p[2]] [-h] The input file consists of a list of words to be stemmed, one per line. Words should be in lower case, but (for English) A-Z letters are mappe...
# 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. """Traffic control library for constraining the network configuration on a port. The traffic controller sets up a constrained network configuration on a...
from unittest import skip from django.conf import settings from django.db import DEFAULT_DB_ALIAS def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: @skip("This test is skipped on...
#!/usr/bin/env python3 # 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. '''python3 %(prog)s [options] Pass at least: --chrome-version-file <path to src/chrome/VERSION> or --all-chrome-versions --target-...
# Copyright (c) 2012 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions...
#!/usr/bin/env python2 # # Example to run classifier on webcam stream. # Brandon Amos & Vijayenthiran # 2016/06/21 # # Copyright 2015-2016 Carnegie Mellon University # # 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 ...
import sys from teamcity.unittestpy import TeamcityTestResult from twisted.trial.reporter import Reporter from twisted.python.failure import Failure from twisted.plugins.twisted_trial import _Reporter class FailureWrapper(Failure): def __getitem__(self, key): return self.value[key] class TeamcityReport...
#!/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...
#!/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 distributed...
import os from glob import glob inputDirectory = "../../../../Databases/taslp/"; outputDirectory = "../../../output3 "; testCommand = " "; #testCommand = " -q 1 "; beginCommand = "../../bin/release/peakClustering "; beginCommand = "..\\..\\bin\\release\\peakClustering.exe "; endCommand = " -P -f -S 0 ...
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
# -*- coding: utf-8 -*- """ *************************************************************************** sql_dictionary.py --------------------- Date : April 2012 Copyright : (C) 2012 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ************...
#!/usr/bin/env python """ @package mi.idk.platform.test.test_metadata @file mi.idk/platform/test/test_metadata.py @author Bill French @brief test metadata object """ __author__ = 'Bill French' __license__ = 'Apache 2.0' from os.path import basename, dirname from os import makedirs from os.path import exists import s...
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Howto Square # Generated: Thu Nov 12 11:26:07 2009 ################################################## import howto from gnuradio import eng_notation from gnuradio import gr from gnuradio.eng_option import eng...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases covering L{twisted.python.filepath}. """ from __future__ import division, absolute_import import os, time, pickle, errno, stat from pprint import pformat from twisted.python.compat import _PY3, unicode from twisted.python.win32 i...
""" For the ``future`` package. Adds this import line:: from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, list, map, next, object, oct, open, pow, range, round, str, super, zip) to a module, irrespective of whether each definition is used....
#!/usr/bin/env python ########################################################################## # frontends/swig_python/python_test.py # # Part of Project Thrill - http://project-thrill.org # # Copyright (C) 2015 Timo Bingmann <[EMAIL]> # # All rights reserved. Published under the BSD-2 license in the LICENSE file. ##...
## ## Copyright 2007, Red Hat, Inc ## see AUTHORS ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave...
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: bdist_dumb.py 61000 2008-02-23 17:40:11Z christian...
import os import sys from tempfile import mkdtemp, mkstemp, NamedTemporaryFile from shutil import rmtree from urlparse import urlparse from urllib2 import URLError import urllib2 from numpy.testing import * from numpy.compat import asbytes import numpy.lib._datasource as datasource def urlopen_stub(url, data=None):...
import numpy as np from dipy.sims.voxel import add_noise from dipy.segment.mrf import (ConstantObservationModel, IteratedConditionalModes) class TissueClassifierHMRF(object): r""" This class contains the methods for tissue classification using the Markov Random Fields modelin...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
# # The Python Imaging Library. # $Id$ # # a Windows DIB display interface # # History: # 1996-05-20 fl Created # 1996-09-20 fl Fixed subregion exposure # 1997-09-21 fl Added draw primitive (for tzPrint) # 2003-05-21 fl Added experimental Window/ImageWindow classes # 2003-09-05 fl Added fromstring/tostring me...
#!/usr/bin/env python # vim: sw=2 ts=2 import click import os import sys @click.command() ### Cluster options @click.option('--console-port', default='443', type=click.IntRange(1,65535), help='OpenShift web console port', show_default=True) @click.option('--deployment-type', default='openshift-enterpri...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
""" Schema for bill objects. """ from .common import sources, extras, fuzzy_date_blank, fuzzy_date from opencivicdata import common versions_or_documents = { "items": { "properties": { "note": {"type": "string"}, "date": fuzzy_date_blank, "links": { ...
# Copyright 2012 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...
from __future__ import unicode_literals from django.template.defaultfilters import escapejs_filter from django.test import SimpleTestCase from ..utils import setup class EscapejsTests(SimpleTestCase): @setup({'escapejs01': '{{ a|escapejs }}'}) def test_escapejs01(self): output = self.engine.render_...
import os import sys import tempfile import shutil from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.log import logger from pip.locations import (src_prefix, virtualenv_no_global, distutils_scheme, build_prefix) from pip.basecommand import Command from pip.in...
import unittest from test import support, test_genericpath import posixpath import os import sys from posixpath import realpath, abspath, dirname, basename try: import posix except ImportError: posix = None # An absolute path to a temporary filename for testing. We can't rely on TESTFN # being an absolute pa...
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import os, os.path import concurrent.futures import csv import urllib.request import shutil import gzip os.chdir('/home/will/AutoMicroAnal/') # <codecell> with open('MicroarraySamples.tsv') as handle: microdata = list(csv.DictReader(handle, delimi...
# -*- 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 GNU...
# # 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 us...
import unittest import sys import numpy as np from sklearn.mixture import DPGMM, VBGMM from sklearn.mixture.dpgmm import log_normalize from sklearn.datasets import make_blobs from sklearn.utils.testing import assert_array_less, assert_equal from sklearn.mixture.tests.test_gmm import GMMTester from sklearn.externals.s...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jimmy Tang <[EMAIL]> # Based on okpg (Patrick Pelletier <[EMAIL]>), pacman # (Afterburn) and pkgin (Shaun Zinck) modules # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #...
"""Output streaming, processing and formatting. """ import json import xml.dom.minidom from functools import partial from itertools import chain import pygments from pygments import token, lexer from pygments.styles import get_style_by_name, STYLE_MAP from pygments.lexers import get_lexer_for_mimetype, get_lexer_by_n...
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
# Copyright (c) 2013-2014 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # DESCRIPTION # This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest # It provides a class and methods for running commands on the host in a convienent way for tests. import os import s...
#!/usr/bin/python3 """ OneDrive REST API for onedrive_d. Refer to http://msdn.microsoft.com/en-us/library/dn659752.aspx Notes: * The API object can be called by any arbitrary thread in the program. * Call get_instance() will realize a API singleton object. * When there is network issue at an API call, the calling...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'elasticsearch>=1.1.1', 'pyramid>=1.5.2', ...
import os import sys import tempfile import operator import functools import itertools import re import pkg_resources if os.name == "java": import org.python.modules.posix.PosixModule as _os else: _os = sys.modules[os.name] try: _file = file except NameError: _file = None _open = open from distutils.e...
import sys import itertools PY3 = sys.version_info >= (3,) PY2 = not PY3 if PY2: basestring = basestring import __builtin__ as builtins import ConfigParser from StringIO import StringIO BytesIO = StringIO func_code = lambda o: o.func_code func_globals = lambda o: o.func_globals im_func...
# -*- 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 GNU...
#!/usr/bin/python # # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ High-level plotting extensions to :mod:`iris.plot`. These routines work much like their :mod:`iris.plot` counterparts, but...
import unittest from urwid.compat import B from urwid.escape import str_util class DecodeOneTest(unittest.TestCase): def gwt(self, ch, exp_ord, exp_pos): ch = B(ch) o, pos = str_util.decode_one(ch,0) assert o==exp_ord, " got:%r expected:%r" % (o, exp_ord) assert pos==exp_pos, " go...
import numpy import pandas as pd from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from keras.utils import np_utils from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold from sklearn.preprocessing import Lab...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import numpy as np from util import LOG log = LOG.out.info """ Parser Library. Every class gets instantiated with the name of the file that should be parsed. Every instance of a parser is bound to a file and thus maintains the files data. The classes shou...
# Copyright 2014 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 telemetry.core.platform.power_monitor as power_monitor class PowerMonitorController(power_monitor.PowerMonitor): """ PowerMonitor that acts as f...
import sys import urllib import cgi import base64 import json from functools import partial import requests __all__ = ('TEST_SERVER_HOST', 'build_root_url', 'build_basic_authorization_header', 'build_access_token_url', 'parse_json_response', 'parse_query_string',...
# Copyright 2015 Conchylicultor. 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 applicable law ...
__devmine_version__ = '0.1.0' __api_version__ = '1' import logging import bottle from bottle.ext import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from devmine.app.models import Base from devmine.config import routes from devmine.lib import composition class Devmine: ...
""" Exceptions """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause import sys from ._compat import PY3_OR_LATER class JoblibException(Exception): """A simple exception with an error message that you can get to.""" def __init__(se...
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
# 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 # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
#!/usr/bin/python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Stefane Fermigier <[EMAIL]> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for ea...
################################################################################ # nc.py # # Base class for NC code creation # And global functions for calling current creator # # Hirutso Enni, 2009-01-13 # altered by Dan Falck 2010-08-04 # added tap() arguments Michael Haberler 2010-10-07 ####################...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='PaydirektCapture', fields=[ ('id', models.AutoF...
# Copyright (c) 2009-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.test.proto_helpers}. """ from zope.interface.verify import verifyObject from twisted.internet.interfaces import (ITransport, IPushProducer, IConsumer, IReactorTCP, IReactorSSL, IReactorUNIX, IAddress, IListe...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Serial Port Protocol """ # system imports import os, errno # dependent on pyserial ( http://pyserial.sf.net/ ) # only tested w/ 1.18 (5 Dec 2002) import serial from serial import PARITY_NONE, PARITY_EVEN, PARITY_ODD from serial import STOPB...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
# Copyright (c) 2012 NTT DOCOMO, INC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Lint as: python2, python3 # 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 # ...
#!/usr/bin/env python # # Copyright 2008, 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: # # * Redistributions of source code must retain the above copyright # notice, this list...
#!/usr/bin/python2.4 """Test harness for diff_match_patch.py Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ 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://...
#!/usr/bin/env python ''' Jottings to work out format for __function_workspace__ matrix at end of mat file. ''' from __future__ import division, print_function, absolute_import from os.path import join as pjoin, dirname import sys from io import BytesIO from numpy.testing import \ assert_array_equal, \ as...
# -*- coding: utf-8 -*- ''' test_qgsoptional.py -------------------------------------- Date : September 2016 Copyright : (C) 2016 Matthias Kuhn email : [EMAIL] ***************************************************...
# Copyright (C) 2010 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <[EMAIL]> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify # it under t...
# vim: set fileencoding=utf-8 : # # (C) 2018 Michael Stapelberg <[EMAIL]> # 2018 Guido Günther <[EMAIL]> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Lice...
import pytest import py mypath = py.path.local(__file__).new(ext=".py") @pytest.mark.xfail def test_forwarding_to_warnings_module(): pytest.deprecated_call(py.log._apiwarn, "1.3", "..") def test_apiwarn_functional(recwarn): capture = py.io.StdCapture() py.log._apiwarn("x.y.z", "something", stacklevel=1) ...
# You must first run "bokeh serve" to view this example import numpy as np from bokeh.client import push_session from bokeh.models import BoxSelectTool, LassoSelectTool, Paragraph from bokeh.plotting import curdoc, figure, hplot, vplot # create three normal population samples with different parameters x1 = np.random...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
"""Unit test module for portal views""" from datetime import datetime import tempfile import urllib from flask_swagger import swagger from flask_webtest import SessionScope from swagger_spec_validator import validate_spec_url from portal.config.config import TestConfig from portal.extensions import db from portal.fa...
# -*- coding: utf-8 -*- """ Production Configurations """ from __future__ import absolute_import, unicode_literals from django.utils import six from .common import * # noqa # Enable social integration plugins SOCIAL_ACCOUNTS = ( 'allauth.socialaccount.providers.google', 'allauth.socialaccount.providers.face...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, limit_length, ) class InstagramIE(InfoExtractor): _VALID_URL = r'https://instagram\.com/p/(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'https://instagram.com/p/aye83DjauH/?foo=bar#...
"""preferences.py - Preference handler.""" import os import cPickle import gtk import pango import constants import labels ZOOM_MODE_BEST = 0 ZOOM_MODE_WIDTH = 1 ZOOM_MODE_HEIGHT = 2 ZOOM_MODE_MANUAL = 3 # All the preferences are stored here. prefs = { 'comment extensions': ['txt', 'nfo'], 'auto load last ...
''' @author: frank ''' from kvmagent import kvmagent from zstacklib.utils import jsonobject from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import lock from zstacklib.utils import shell from zstacklib.utils import linux import os import traceback CHECK_PHYSICAL_NETW...
# This file is part of CherryPy <http://www.cherrypy.org/> # -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab:fileencoding=utf-8 import cherrypy from cherrypy._cpcompat import md5, ntob from cherrypy.lib import auth_basic from cherrypy.test import helper class BasicAuthTest(helper.CPWebCase): def setup_server():...
import logging import logging.handlers import os def convert_log_level(level=26): """ Get a numeric log level from a string. The default 26 is for SHORT logs. :param level :return level """ # annoying but the level can be passed in as None if not level: level = 26 levels = {'...