text
stringlengths
475
200k
import os import unittest from nose.tools import assert_is_not_none from sqlalchemy import text from wcloud.tasks.db_tasks import connect, create_db, destroy_db # Fix the working directory. cwd = os.getcwd() if cwd.endswith(os.path.join("wcloud", "test")): cwd = cwd[0:len(cwd)-len(os.path.join("wcloud", "test"))]...
# Adapted from test_file.py by Daniel Stutzbach #from __future__ import unicode_literals import sys import os import unittest from array import array from weakref import proxy from test.test_support import (TESTFN, findfile, check_warnings, run_unittest, make_bad_fd) from UserList impor...
# This file is part of Merlin. # Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen. # Individual portions may be copyright by individual contributors, and # are included in this collective work with permission of the copyright # owners. # This program is free software; ...
# // license # Copyright 2016, Free Software Foundation. # # This file is part of Solent. # # Solent 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, or (at your option) ...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
import qctests.ICDC_aqc_10_local_climatology_check as ICDC import util.testingProfile import numpy as np ##### ICDC 10 local climatology check. ##### -------------------------------------------------- class TestClass(): parameters = { 'db': 'iquod.db', 'table': 'unit' } def setUp(self): ...
# Copyright 2015, 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 the f...
# -*- encoding: utf-8 -*- import os SECRET_KEY = 'p23jof024jf5-94j3f023jf230=fj234fp34fijo' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEST_DATA_DIR = os.path.join(BASE_DIR, 'tests', 'test_data') DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', ...
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_mpa_ascii.py ----------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ************************...
#!/usr/bin/env python try: import pacman except ImportError: import alpm pacman = alpm import os, tempfile, shutil, sys, re remove = False if len(sys.argv) > 1: if sys.argv[1] == "--help": print "no longer necessary %s fpms" % sys.argv[2] sys.exit(0) elif sys.argv[1] == "--remove": remove = True arch = s...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" API for initiating and tracking requests for credit from a provider. """ import datetime import logging import uuid import pytz from django.db import transaction from edx_proctoring.api import get_last_exam_completion_date from openedx.core.djangoapps.credit.exceptions import ( UserIsNotEligible, CreditP...
from re import compile, MULTILINE from os import walk, getcwd notice = ('''/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * 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 th...
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <[EMAIL]> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def autodict(): ...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
GEO_INTERFACE_MARKER = "__geo_interface__" def is_mapping(ob): return hasattr(ob, "__getitem__") def to_mapping(ob): if hasattr(ob, GEO_INTERFACE_MARKER): candidate = ob.__geo_interface__ candidate = to_mapping(candidate) else: candidate = ob if not is_mapping(candidate): ...
# -*- coding: utf-8 -*- """Test for autolag of adfuller Created on Wed May 30 21:39:46 2012 Author: Josef Perktold """ import numpy as np from numpy.testing import assert_equal, assert_almost_equal import statsmodels.tsa.stattools as tsast from statsmodels.datasets import macrodata def test_adf_autolag(): #see i...
# 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 appl...
from datadog_checks.base.checks.prometheus.prometheus_base import PrometheusCheck from datadog_checks.base.errors import CheckException EVENT_TYPE = SOURCE_TYPE_NAME = 'portworx' class PortworxCheck(PrometheusCheck): """ Collect px metrics from Portworx """ def __init__(self, name, init_config, agen...
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
# (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...
import sys import linecache import time import socket import traceback import thread import threading import Queue from idlelib import CallTips from idlelib import AutoComplete from idlelib import RemoteDebugger from idlelib import RemoteObjectBrowser from idlelib import StackViewer from idlelib import...
# RAVEn Plugin # # Author: Dnpwwo, 2016 # # # Plugin parameter definition below will be parsed during startup and copied into Manifest.xml, this will then drive the user interface in the Hardware web page # """ <plugin key="RAVEn" name="RAVEn Zigbee energy monitor" author="dnpwwo" version="1.3...
from django.conf import settings from django.template import Template, Context, TemplateDoesNotExist from django.utils.html import escape from django.http import HttpResponseServerError, HttpResponseNotFound import os, re HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD|PROFANITIES_LIST') def linebreak_iter(template_sou...
"""Provides the CameraDetection class which creates a window for detecting objects in a video stream.""" try: # Python 3 import tkinter as Tkinter from tkinter import N, E, S, W from tkinter import ttk from tkinter import messagebox as tkMessageBox from tkinter import filedialog as tkFi...
# -*- 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 'ManualEnrollmentAudit' db.create_table('student_manualenr...
SECRET_KEY = 'test' DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'controlcenter', ) MIDDLEWARE_CLASSES = ( 'django.contr...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
# -*- coding: utf-8 -*- """ osisoft_pi_webapi_python_client.client ~~~~~~~~~~~~~~~~~~~ This module contains the client used to access OSIsoft PI infrastructure and data """ from src.osisoftpy import _base, _server class client(_base): """A client to interact with the PI Web WebAPI""" def __init__(self, ...
# Unix SMB/CIFS implementation. # Copyright (C) 2008 Kai Blin <[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 3 of the License, or # (at your option) any later versi...
from __future__ import unicode_literals from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, a...
# Copyright 2015, 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 the f...
from __future__ import unicode_literals import datetime from django.db import models class UserPhoto(models.Model): user_name = models.CharField(max_length=128, default="") user_phone = models.CharField(max_length=128, default="") access_code = models.CharField(max_length=128) photo_name = models.CharField(...
#! /usr/bin/env python3 """ Parse an IDX file like the one used in the MNIST handwritten digit database. A description of the format is on this page: http://yann.lecun.com/exdb/mnist/ """ import struct import array import sys def _is_sequence(seq): return hasattr(seq, '__getitem__') and not hasattr(seq, 'strip')...
# -*- coding: utf-8 -*- """ Display output of given script. Display output of any executable script set by 'script_path'. Pay attention. The output must be one liner, or will break your i3status ! The script should not have any parameters, but it could work. Configuration parameters: - cache_timeout : how often w...
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <[EMAIL]> # Copyright (c) 2016 Dell Inc. # 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', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 Adam.Dybbroe # Author(s): # Adam.Dybbroe <[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 3 of th...
import os import subprocess from django.core.files.temp import NamedTemporaryFile from django.db.backends.base.client import BaseDatabaseClient from django.utils.six import print_ def _escape_pgpass(txt): """ Escape a fragment of a PostgreSQL .pgpass file. """ return txt.replace('\\', '\\\\').replace...
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
# -*- coding: utf-8 -*- import 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 'MapLayerUserRememberedParams' db.create_table(u'maps_maplayeruserrememberedparams', ( ...
""" XML serializer. """ from __future__ import unicode_literals from collections import OrderedDict from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.serializers import bas...
# coding: utf-8 # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime from uuid import uuid4 from odoo import api, exceptions, fields, models, _ class PaymentAcquirerTest(models.Model): _inherit = 'payment.acquirer' provider = fields.Selection(selection_ad...
#openerp.loggers.handlers. -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class Infinity(object): def __repr__(self): return "Infinity...
# Copyright 2013 Red Hat, 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...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
from plex import Plex from tests.core.helpers import read import responses # Set client configuration defaults Plex.configuration.defaults.server(host='mock') @responses.activate def test_get_all(): responses.add( responses.GET, 'http://mock:32400/:/prefs', body=read('fixtures/prefs.xml'), statu...
# -*- coding: utf-8 -*- # ================================================================= # # Authors: Tom Kralidis <[EMAIL]> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), t...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
import unittest import numpy as np from VelocityConversion import MantleConversion, UnavailableMethodError def assemblage(): a = { "ol": 0.617, "cpx": 0.133, "opx": 0.052, "gnt": 0.153, "jd": 0.045, "XFe": 0.11 } return a class TestVelocityConversion(unittes...
# 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 ...
from collections import OrderedDict import sys import warnings from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from ...
"""Compatibility interface between dense and sparse polys. """ from __future__ import print_function, division from sympy.polys.densearith import dup_add_term from sympy.polys.densearith import dmp_add_term from sympy.polys.densearith import dup_sub_term from sympy.polys.densearith import dmp_sub_term from sympy.poly...
# # Copyright (C) 2014 National Institute For Space Research (INPE) - Brazil. # # This file is part of Python Client API for Web Time Series Service. # # Web Time Series Service for Python is free software: you can # redistribute it and/or modify it under the terms of the # GNU Lesser General Public License as pu...
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
import sys import mock import os from mock import patch, call import kiwi from .test_helper import argv_kiwi_tests from kiwi.tasks.system_prepare import SystemPrepareTask class TestSystemPrepareTask(object): def setup(self): sys.argv = [ sys.argv[0], '--profile', 'vmxFlavour', 'system', 'p...
""" Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any la...
"""RFC 2822 message manipulation. Note: This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Note: RFC 2822 is a long awaited update to RFC 822. This module should conform to RFC 2822, and is thus mis-named (it's not wort...
# -*- 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 'Settings' db.create_table(u'vpw_settings', ( ...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2013, 2014, 2015 CERN. # # Invenio 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 (a...
# 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 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from setuptools import setup, find_packages import os.path def project_path(*names): return os.path.join(os.path.dirname(__file__), *names) setup( name='zeit.retresco', version='1.32.3.dev0', author='gocept, Zeit Online', author_email='[EMAIL]', url='http://www.zeit.de/', description="vi...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, ) from osf.utils import permissions @pytest.fixture() def user(): return AuthUserFactory() @pytest.mark.django_db @pytest.mark.enable_quickfiles_creat...
import json import hail as hl from hail.expr.types import dtype from hail.ir.base_ir import BaseIR, TableIR from hail.utils.java import Env from hail.utils.misc import escape_str, parsable_strings, dump_json, escape_id class MatrixRowsTable(TableIR): def __init__(self, child): super().__init__(child) ...
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2018 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Thi...
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2018 bbi-yggy <[EMAIL]> # # ...
from livesettings import config_value from payment.listeners import capture_on_ship_listener from product.models import Product from product.listeners import default_product_search_listener, discount_used_listener from satchmo_store.contact import signals as contact_signals from satchmo_store.mail import send_html_emai...
from __future__ import division, absolute_import, print_function import sys import warnings import itertools import platform from decimal import Decimal import numpy as np from numpy.core import umath from numpy.random import rand, randint, randn from numpy.testing import ( TestCase, run_module_suite, assert_, as...
# 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. """This module wraps the Android Asset Packaging Tool.""" import os from devil.utils import cmd_helper from pylib import constants _AAPT_PATH = os.path.jo...
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: [EMAIL] # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops = [] f...
import os import subprocess import sys import unittest import needy.process class ProcessTest(unittest.TestCase): def test_list_command_output(self): self.assertEqual('hello', needy.process.command_output([sys.executable, '-c', 'print(\'hello\')']).strip()) def test_shell_command_output(self): ...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest, json # test_records = frappe.get_test_records('Auto Email Report') class TestAutoEmailReport(unittest.TestCase): def test_auto_email(self): fr...
#!/usr/bin/python import os def get_devkitarm_bin(): try: return os.path.join(os.environ['DEVKITARM'], 'bin') except KeyError: return '' def detect(conf): from Logs import warn if 'DEVKITARM' not in os.environ: warn("`DEVKITARM' variable is not set, compiler may not be found") ...
# 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...
#!/usr/bin/env python ## # @author This file is part of libsnark, developed by SCIPR Lab # and contributors (see AUTHORS). # @copyright MIT license (see LICENSE file) from __future__ import division import itertools def valid_formula(truth_table, x_coeff, y_coeff, z_coeff, offset): for x in [0,1]...
"""Cholesky decomposition functions.""" from __future__ import division, print_function, absolute_import from numpy import asarray_chkfinite, asarray # Local imports from .misc import LinAlgError, _datacopied from .lapack import get_lapack_funcs __all__ = ['cholesky', 'cho_factor', 'cho_solve', 'cholesky_banded', ...
#! /usr/bin/env python from time import strftime, localtime def convert_h(): f = open("_hermes_common_api_new.h", "w") f.write("/* Generated by convert_api.py on %s */\n\n" % \ strftime("%a %b %d %H:%M:%S %Y", localtime())); lines = open("_hermes_common_api.h").readlines() line = lines[0];...
# Copyright 2006--2010 Red Hat, Inc. # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT...
# (c) 2014, Chris Church <[EMAIL]> # Copyright (c) 2017 Ansible Project # 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 DOCUMENTATION = """ author: Ansible Core Team connection:...
from numpy import zeros, asarray, eye, poly1d, hstack, r_ from scipy import linalg __all__ = ["pade"] def pade(an, m, n=None): """ Return Pade approximation to a polynomial as the ratio of two polynomials. Parameters ---------- an : (N,) array_like Taylor series coefficients. m : int ...
import requests import bs4 import json class NoMaxQuantity(Exception): pass def load_single_page(url): response = requests.get(url) soup = bs4.BeautifulSoup(response.text, 'html.parser') return soup def _find_options_from_form(soup): form = soup.find("form", class_="variations_form cart") ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Cronvar Plugin: The goal of this plugin is to provide an idempotent # method for set cron variable values. It should play well with the # exi...
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
# coding: utf-8 from flask import g, render_template, request, jsonify from flask_sqlalchemy import SQLAlchemy from flask_oauthlib.provider import OAuth1Provider db = SQLAlchemy() def enable_log(name='flask_oauthlib'): import logging logger = logging.getLogger(name) logger.addHandler(logging.StreamHandl...
# Copyright 2008-2009 ITA Software, 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 ...
# -*- coding: utf-8 -*- """ Created on Sat Aug 15 14:12:12 2015 @author: rc, alex """ import os import sys if __name__ == '__main__' and __package__ is None: filePath = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(filePath) import numpy as np import yaml from copy import deepcop...
#!/usr/bin/env python import XenAPI import sanitychecklib from pprint import pprint, pformat #Generally, we wish to announce the name of this file. #When running in the interpreter, however, this doesn't exist, and we #probably shouldn't log out either try: this_test_name = __file__ logout_after_test = True e...
# Copyright 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. from future import All, Future from object_store import ObjectStore class CacheChainObjectStore(ObjectStore): '''Maintains an in-memory cache along with ...
# 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...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2018 (ita) """ Classes and methods shared by tools providing support for C-like language such as C/C++/D/Assembly/Go (this support module is almost never used alone). """ import os, re from waflib import Task, Utils, Node, Errors, Logs from waflib.TaskGen im...
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import current_app from flask_principal import Permission, RoleNeed, UserNeed, identity_loaded from flask_login import current_user # admin_need = RoleNeed('admin') # editor_need = RoleNeed('editor') # writer_need = RoleNeed('writer') # reader_need = ...
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import os import unittest import autoconfig import parser_test_case from pygccxml import utils from pygccxml import...
# # 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is largely copied from the Nagios module included in the # Func project. Original copyright follows: # # func-nagios - Schedule downtime and enables/disable notifications # Copyright 2011, Red Hat, Inc. # Tim Bielawa <[EMAIL]> # # This software may be freely redis...
# 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 requi...
from thorpy._utils.images import load_image from thorpy._utils.interpolation import get_y from pygame import surfarray import math, pygame from PyWorld2D.rendering.tilers.roundtiler import RoundTiler class BeachTiler(RoundTiler): def get_round(self, radius, background): w,h = self.c.get_size() s...