text
stringlengths
475
200k
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the getchaintips API. We introduce a network split, work # on chains of different lengths, an...
# Module for XML, HTML and CGI output # jaxml # (C) Jerome Alet <[EMAIL]> 2000-2002 # You're welcome to redistribute this software under the # terms of the GNU General Public Licence version 2.0 # or, at your option, any higher version. # # You can read the complete GNU GPL in the file COPYING # which should come along...
from django.forms import Form, HiddenInput, NullBooleanField, RadioSelect from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class NullBooleanFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_nullbooleanfield_clean(self): f = NullBooleanField() self.assertI...
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
# # @BEGIN LICENSE # # QCDB: quantum chemistry common driver and databases # # Copyright (c) 2011-2017 The QCDB Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of QCDB. # # QCDB is free software; you can redistribute it and/or modify # it ...
"""Base option parser setup""" import sys import optparse import pkg_resources import os import textwrap from distutils.util import strtobool from pip.backwardcompat import ConfigParser, string_types, ssl from pip.locations import default_config_file, default_log_file from pip.util import get_terminal_size, get_prog ...
import pytz from pyrfc3339.utils import timezone, timedelta_seconds def generate(dt, utc=True, accept_naive=False, microseconds=False): ''' Generate an :RFC:`3339`-formatted timestamp from a :class:`datetime.datetime`. >>> from datetime import datetime >>> generate(datetime(2009,1,1,12,59,59,0,p...
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module @step('I fill in the registration form$') def i_fill_in_the_registration_form(step): def fill_in_reg_form(): reg...
"""Classes for storing and processing test results.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import datetime import re from . import types as t from .util import ( display, get_ansible_version, ) from .util_common import ( write_text_test_results, wr...
# encoding: utf-8 import sys import datetime from south.db import db from south.v2 import DataMigration from django.db import models from apps.rss_feeds.models import Feed try: from apps.rss_feeds.models import FeedIcon except ImportError: pass class Migration(DataMigration): def forwards(self, orm): ...
from .. import models from .helpers import PhotologueBaseTest from .factories import GalleryFactory, PhotoFactory class GalleryTest(PhotologueBaseTest): def setUp(self): """Create a test gallery with 2 photos.""" super(GalleryTest, self).setUp() self.test_gallery = GalleryFactory() ...
# !/usr/bin/env python # -*- coding: utf-8 -*- """Bunch of log formatters to be used.""" import logging try: import ujson as json except Exception as ex: import json class TextFormatter(logging.Formatter): """Format the meta data in the log message to fix string length.""" datefmt = '%Y-%m-%d %H:%M...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, 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...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENSE:BSD$ #...
# Copyright 2015 Fujitsu(fnst) Corporation # 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...
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2012-2015 Stephen Tiedemann <[EMAIL]> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EUPL (the "Licence"); # You...
from __future__ import unicode_literals from django.db import router class Operation(object): """ Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it agains...
import simplejson import openerp import openerp.http as http from openerp.http import request import openerp.addons.web.controllers.main as webmain import json class meeting_invitation(http.Controller): @http.route('/calendar/meeting/accept', type='http', auth="calendar") def accept(self, db, token, action, ...
# 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...
# -*- coding: utf-8 -*- """ pygments.lexers.data ~~~~~~~~~~~~~~~~~~~~ Lexers for data file format. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \ ...
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <[EMAIL]> # # Copyright 2012 Zearin <[EMAIL]> #...
from markdown.blockprocessors import BlockProcessor from MooseCommonExtension import MooseCommonExtension import re from markdown.util import etree class MooseCSS(BlockProcessor, MooseCommonExtension): """ Markdown extension for applying CSS styles to paragraph Markdown syntax is: !css <options> ...
# We will need to create Qt4 items from PyQt4 import QtCore from PyQt4.QtGui import QGraphicsRectItem, QGraphicsSimpleTextItem, \ QGraphicsEllipseItem, QColor, QPen, QBrush from ... import Tree, faces, TreeStyle, NodeStyle # To play with random colors import colorsys import random class InteractiveItem(QGraphics...
# Copyright 2011 VMware, 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 by ...
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import warnings warnings.warn( "Create your own event dispatching mechanism, " "twisted.python.dispatch will soon be no more.", DeprecationWarning, 2) class EventDispatcher: """ A global event dispatcher for events....
""" mbed CMSIS-DAP debugger Copyright (c) 2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Failure injection module for the Impala service. There are two main ways this module # can be used - the first is to initialize the failure injector and then call start() # which will kick off a timer that chooses a random impalad/state store process # to fai...
# Copyright 2015 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 by applicable law or agreed ...
from sympy.assumptions import ask, Q from sympy.assumptions.assume import assuming, global_assumptions from sympy.abc import x, y def test_assuming(): with assuming(Q.integer(x)): assert ask(Q.integer(x)) assert not ask(Q.integer(x)) def test_assuming_nested(): assert not ask(Q.integer(x)) ass...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class InaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ina\.fr/video/(?P<id>I?[A-Z0-9]+)' _TEST = { 'url': 'http://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.ht...
from __future__ import absolute_import # -*- coding: utf-8 -*- import numpy as np import random from six.moves import range def pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre'): """ Pad each sequence to the same length: the length of the longuest sequence. If maxlen is ...
""" Tests the helper functions/classes/etc used in wrapping GMT. """ import os import numpy as np import pytest from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import ( GMTTempFile, args_in_kwargs, data_kind, kwargs_to_strings, unique_name, ) @pytest.mark.parametrize( "data,x,...
from panda3d.core import LVector4f import DNANode import DNAUtil import DNAError class DNALandmarkBuilding(DNANode.DNANode): COMPONENT_CODE = 13 def __init__(self, name): DNANode.DNANode.__init__(self, name) self.code = '' self.wallColor = LVector4f(1, 1, 1, 1) self.title = '' ...
"""Selectors module. This module allows high-level and efficient I/O multiplexing, built upon the `select` module primitives. The following code adapted from trollius.selectors. """ from abc import ABCMeta, abstractmethod from collections import namedtuple, Mapping import math import select import sys from gunicor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 # ============================================================================= # $Id: setup.py 114 2007-06-14 21:17:14Z palgarvio $ # ============================================================================= # $URL: http://svn.edgewall...
#!/usr/bin/env python ''' CREATED:2014-01-24 12:42:43 by Brian McFee <[EMAIL]> Compute beat evaluation metrics Usage: ./beat_eval.py REFERENCE.TXT ESTIMATED.TXT ''' from __future__ import print_function import argparse import sys import os import eval_utilities import mir_eval def process_arguments(): '''Ar...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Unix SMB/CIFS implementation. # This speed test aims to show difference in execution time for bulk # creation of user objects. This will help us compare # Samba4 vs MS Active Directory performance. # Copyright (C) Zahari Zahariev <[EMAIL]> 2010 # # This program is free...
# -*- coding: utf-8 -*- ############################################################################### # # account_statement_completion_label for OpenERP # Copyright (C) 2013 Akretion (http://www.akretion.com). All Rights Reserved # @author Benoît GUILLOT <[EMAIL]> # # This program is free software: you can re...
import sys import os import GenericSearch import pandas # Define regions contaminated by telluric residuals or other defects. We will not use those regions in the cross-correlation badregions = [[0, 1510], # Blue end of H band (lots of water absorption) #[1561, 1615], # CO2 band that is often poorly c...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
import hashlib import logging import re import warnings from django.conf import settings from django.core.mail import mail_managers from django.core import urlresolvers from django import http from django.utils.deprecation import RemovedInDjango18Warning from django.utils.encoding import force_text from django.utils.h...
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <[EMAIL]> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software ...
#!/usr/bin/env python # Copyright (c) 2014-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the Apache 2.0 license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree)...
from __future__ import absolute_import, division, unicode_literals from six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBuilder(Elemen...
"""SCons.Tool.rpmutils.py RPM specific helper routines for general usage in the test framework and SCons core modules. Since we check for the RPM package target name in several places, we have to know which machine/system name RPM will use for the current hardware setup. The following dictionaries and functions try t...
# -*- 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 field 'Alumno.activo' db.add_column(u'alumnos_alumno', 'activo',...
# # (c) 2019, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.connection import Connection from ansible.module_utils.network.eos.providers import providers from ansible.m...
import doctest import json import logging import os import unittest import sys sys.path.insert(0, "..") import configr class Tests(unittest.TestCase): ''' Test suite. ''' def tests_metadata(_): _.assertTrue(hasattr(configr, "version")) _.assertTrue(hasattr(configr.version, "__version__")) _.assertT...
import os,sys from PyQt4 import QtCore from PyQt4 import QtGui import functools import itertools import re from subprocess import Popen import pythoncom #-- shortcut from win32com.shell import shell, shellcon from installer_ui import Ui_MainWindow class MainGUI(QtGui.QMainWindow,Ui_MainWindow): def __init__(self,pa...
# -*- 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...
import pytz from datetime import datetime from catalyst.api import symbol from catalyst.utils.run_algo import run_algorithm coin = 'btc' quote_currency = 'usd' n_candles = 5 def initialize(context): context.symbol = symbol('%s_%s' % (coin, quote_currency)) def handle_data_polo_partial_candles(context, data): ...
# LogoMation-like turtle graphics from math import * # Also for export import Tkinter class Error(Exception): pass class RawPen: def __init__(self, canvas): self._canvas = canvas self._items = [] self._tracing = 1 self.degrees() self.reset() def degrees(self, full...
#!/usr/bin/python # -*- coding: utf-8 -*- # By Yusuke Suzuki <[EMAIL]> # Modified by Mathias Bynens <http://mathiasbynens.be/> # http://code.google.com/p/esprima/issues/detail?id=110 import sys import string import re class RegExpGenerator(object): def __init__(self, detector): self.detector = detec...
from build import plot_results, print_results #valid formats are png, pdf, ps, eps and svg #if format=None the plot will be displayed format = 'png' #output = print_results output = plot_results for function in ['fill', 'reduce', 'inner_product', 'gather', 'merge']: output(function + '.xml', 'InputType', 'InputSi...
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import threading import warnings from base64 import b64encode from .compat import urlparse, str, basestring from .cookies import extract_cookies_...
from sqlalchemy import types as sqltypes from sqlalchemy.sql.expression import ( ClauseList, Function, _literal_as_binds, text, _type_from_args ) from sqlalchemy.sql import operators from sqlalchemy.sql.visitors import VisitableType class _GenericMeta(VisitableType): def __call__(self, *args, **kwargs): ...
# 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...
#!/home/amos/anaconda/bin/python from PythonQt.Qt import * from PythonQt.QtGui import * class CGScene(QGraphicsScene): def __init__(self, parent = None): super(CGScene, self).__init__(self) class Texture(QGraphicsItem): def __init__(self, pos, tex): super(Texture, self).__init__(self) self.tex = tex s...
"""Miscellaneous functions and classes that dont fit into specific categories.""" import sys, os, vtk #---------------------------------------------------------------------- # the following functions are for the vtk regression testing and examples def vtkGetDataRoot(): """vtkGetDataRoot() -- return vtk example d...
"""inject_closure module""" INJECTEDKEY = "injected_{}" OUTERLINE = " outer_{0} = injected_{0}" INNERLINE = " inner_{0} = outer_{0}" SOURCE= ("def not_important():", " def also_not_important():", " return also_not_important") def inject_closure(f, *args): """Ret...
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-09-03 10:43 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ (...
# Copyright 2015 Intel 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 agr...
#---------------------------------------------------------------------- # Name: wx.lib.flashwin # Purpose: A class that allows the use of the Shockwave Flash # ActiveX control # # Author: Robin Dunn # # Created: 22-March-2004 # RCS-ID: $Id: flashwin.py 54040 2008-06-08 23:03:22Z RD...
#!/usr/bin/python import sys import time import os import string import StringIO sys.path.insert(0, "python") import libxml2 # Memory debug specific libxml2.debugMemory(1) debug = 0 verbose = 0 quiet = 1 # # the testsuite description # CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml") LOG=...
""" Utilities related to nose. """ from django.core.management import call_command from django.db import DEFAULT_DB_ALIAS, connections, transaction import django_nose class NoseTestSuiteRunner(django_nose.NoseTestSuiteRunner): """Custom NoseTestSuiteRunner.""" def setup_databases(self): """ Setup dat...
# 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...
# encoding: 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 index on 'Player', fields ['is_dead'] db.create_index('namelist_player', ['is_dead']) # ...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.manhole import service from twisted.spread.util import LocalAsRemote class Dummy: pass class DummyTransport: def getHost(self): return 'INET', '127.0.0.1', 0 class DummyManholeCl...
# −*− coding: UTF−8 −*− # Copyright (C) 2010 Joel Dunham # # This file is part of OnlineLinguisticDatabase. # # OnlineLinguisticDatabase 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...
# A Monkey's Audio (APE) reader/tagger # # Copyright 2006 Lukas Lalinsky <[EMAIL]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Monkey's Audio streams with APEv2 tags. Monkey...
# Copyright (C) 2014-2015 Andrey Antukh <[EMAIL]> # Copyright (C) 2014-2015 Jesús Espino <[EMAIL]> # Copyright (C) 2014-2015 David Barragán <[EMAIL]> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software F...
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of ...
try: from django.conf.urls import include, patterns, url except ImportError: from django.conf.urls.defaults import include, patterns, url from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', ...
# # Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA 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 in the top-level directory # of this distribution and at: # # http:...
# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import logging from portage.util import writemsg_level def create_depgraph_params(myopts, myaction): #configure emerge engine parameters # # self: include _this_ package regardless of if it is merged. #...
import cx_Oracle import logging import os os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' class OkSqlHandler(object): @classmethod def setupConn(cls): # dsn = cx_Oracle.makedsn("10.0.44.99", "1521", "ompdb") dsn = cx_Oracle.makedsn("10.0.76.128", "1521", "omp2st") conn = cx_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :Date: Thu Jun 30 17:17:35 CEST 2011 :Version: 1 :Authors: Einar Uvsløkk <[EMAIL]> :Copyright: (c) 2011 Einar Uvsløkk :License: GNU General Public License (GPL) version 3 or later vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 """ import gettext import locale imp...
""" Microsoft Bitmap picture parser. - file extension: ".bmp" Author: Victor Stinner Creation: 16 december 2005 """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, UInt8, UInt16, UInt32, Bits, String, RawBytes, Enum, PaddingBytes, NullBytes, createPaddingField) from hachoir_cor...
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
# -*- coding: utf-8 -*- # Scrapy settings for zhihu_spider project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/l...
"""Tests for the Area Registry.""" import asyncio import pytest from homeassistant.core import callback from homeassistant.helpers import area_registry import tests.async_mock from tests.common import flush_store, mock_area_registry @pytest.fixture def registry(hass): """Return an empty, loaded, registry.""" ...
#!/usr/bin/env python # # Copyright 2010 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 o...
# Copyright 2012 Nebula, Inc. # 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...
# Copyright (C) 2011 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...
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient from django.db.b...
# Copyright 2013 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 -*- from collections import defaultdict from itertools import combinations from sys import stdout class cached_property(object): """A cached property only computed once """ def __init__(self, func): self.func = func def __get__(self, obj, cls): if obj is None: retu...
#!/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...
# -*- coding: utf-8 -*- """ Flaskr ~~~~~~ A microblog example application written as Flask tutorial with Flask and sqlite3. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from sqlite3 import dbapi2 as sqlite3 from flask import Flask, request...
# (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 # (at your option) any later version. # # Ansible is dis...
#!/usr/bin/env python3 import math import operator import sys def rem(a, b): ret = a % b if ret < 0 and a > 0 and b < 0 or \ ret > 0 and a < 0 and b > 0: ret -= b return ret FUNS = { 'add': operator.add, 'sub': operator.sub, 'mul': operator.mul, 'div': operator.truediv, ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
# -*- coding: utf-8 -*- # ********************************************************************* # # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved. # # ********************************************************************* # # Licensed under the Apache License, Version 2.0 (the "License"); ...
# Copyright (c) 2013, Rethink Robotics # 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 an...
from __future__ import unicode_literals from operator import attrgetter from django.test import TestCase from .models import Person class RecursiveM2MTests(TestCase): def setUp(self): self.a, self.b, self.c, self.d = [ Person.objects.create(name=name) for name in ["Anne", "Bill"...
# %codegen(cl_gen) import generate_opencl_structs def main(): plane_defd = [ { 'type': 'vector', 'length': 3, 'name': 'normal', }, { 'type': 'float', 'length': 1, 'name': 'd', } ] sphere_defd = [ ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # 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 Li...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <[EMAIL]> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free Software ...