text
stringlengths
475
200k
################################################################################ # 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...
# -*- 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...
# Copyright 2008-2009 WebDriver committers # Copyright 2008-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 requir...
#!/usr/bin/env python """ This script is similiar to modemake.pl. The script will generate DIMER_VECTOR in CP2K. """ from XYZFile import * import sys, copy def GetDiffXYZ(XYZ1, XYZ2): """ Get the difference of two XYZ file. A DIMER VECTOR or MODECAR is made from this difference. """ DiffXYZ = XYZ()...
# Copyright 2017 OVH SAS # 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 ...
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from datetime import datetime from .compat import cookielib from .cookies import cookiejar_from_dict from .models import Request,...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys from idl_log import ErrOut, InfoOut, WarnOut from idl_option import GetOption, Option, ParseOptions from idl_parser imp...
# -*- coding: utf-8 -*- """ pygments.lexers.special ~~~~~~~~~~~~~~~~~~~~~~~ Special lexers. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import cStringIO from pygments.lexer import Lexer from pygments.token import Token,...
#!/usr/bin/env python # (C) 2010 Norbert Nemec # # USAGE: src-normal.py < input.f90 > output.f90 # # Script to normalize Fortran source code: # a) expand tabs to spaces (tab width 8 characters # b) remove trailing space # c) normalize multiword keywords # d) normalize capitalization of keywords and intrinsics ...
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module from page_sets import key_mobile_sites_pages from page_...
""" =========================================================== A demo of K-Means clustering on the handwritten digits data =========================================================== In this example with compare the various initialization strategies for K-means in terms of runtime and quality of the results. As the ...
import datetime import pickle import pprint import argparse import time from alert.corpus_importer.lawbox.import_law_box import ( get_judge, get_court_object, get_html_from_raw_text, ) from alert.search.models import Court DEBUG = 4 ########################################## # This variable is used to do statis...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Creation of Windows shortcuts. Requires win32all. """ from win32com.shell import shell import pythoncom import os def open(filename): """Open an existing shortcut for reading. @return: The shortcut object @rtype: Shortcut ...
# This file is part of Rubber and thus covered by the GPL # (c) Emmanuel Beffara, 2008 # vim: noet:ts=4 """ General-purpose classes for reading TeX code. Classes and functions from this module can be used without Rubber. """ import re from io import StringIO # The catcodes EOF = -2 CSEQ = -1 ESCAPE = 0 OPEN = 1 CLOS...
""" Shared Utilities """ from functools import wraps from uuid import UUID import warnings import six from jwkest import JWKESTException from ..exceptions import InvalidIssuerFormat, InvalidIssuerVersion, \ JWTValidationFailure, InvalidJWTResponse, WebhookAuthorizationError, \ XiovJWTValidationFailure, XiovJ...
"File-based cache backend" import errno import glob import hashlib import io import os import random import tempfile import time import zlib from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.files.move import file_move_safe from django.utils.encoding import force_bytes try: f...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, 2015 YAEGASHI Takeshi <[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 Licen...
import json class Led: def __init__(self): self.x_start = 0 self.x_end = 0 self.y_start = 0 self.y_end = 0 self.position = 0 self.color = bytearray([0,0,0]) def setCoordinates(self, in_x_start, in_x_end, in_y_start,in_y_end): self.x_start = in_x_start self.x_end = in_x_end self.y_st...
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio ([EMAIL])" __copyright__ = "Copyright 2006, Joe ...
# Copyright 2012 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 a...
#!/usr/bin/python # # Copyright 2013 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...
#!/usr/bin/env python # Safe Eyes is a utility to remind you to take break frequently # to protect your eyes from eye strain. # Copyright (C) 2017 Gobinath # 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...
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWSumm. # # GWSumm 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) ...
#!/usr/bin/python # # (c) 2015 Peter Sprygada, <[EMAIL]> # # Copyright (c) 2016 Dell 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 Li...
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse User = get_user_model() class TestViews(TestCase): """ tests for django_netjsonconfig.views """ def setUp(self): User.objects.create_superuser( username='admin', passwo...
# -*- coding: utf-8 -*- """ Created on Fri Sep 23 10:49:39 2016 @author: adam """ import pytest from rickshaw.simspec import SimSpec, def_niches, def_commodities from rickshaw.generate import random_niches, choose_commodity, choose_commodities @pytest.mark.parametrize("i", range(100)) def test_random_niches(i): s...
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
# -*- coding: utf-8 -*- """ *************************************************************************** lasgrid.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- D...
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data from util impo...
""" Django settings for mcfinance project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ from mongoengine import connect # Build paths inside the project like t...
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self....
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O...
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config import sys import warnings from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.depr...
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', ) class MessageFailure(Exception): pass def add_message(request, level, mess...
"""Concrete date/time and related types -- prototype implemented in Python. See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage See also http://dir.yahoo.com/Reference/calendars/ For a primer on DST, including many current DST rules, see http://webexhibits.org/daylightsaving/ For more about DST than you e...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, clean_html, get_element_by_attribute, ExtractorError, ) class TVPIE(InfoExtractor): IE_NAME = 'tvp' IE_DESC = 'Telewizja Polska' _VALID_URL = r'https?:...
# -*- coding: cp1252 -*- #Copyright Milkey Mouse 2015 from HTMLParser import HTMLParser import simplejson as json import celery from celery import Celery from flask import render_template from flask.ext.gzip import Gzip from celery import task from flask import Flask import datetime import urllib2 import string import ...
# coding=utf-8 from __future__ import print_function, unicode_literals import os import posixpath from libtrakt.exceptions import traktException from libtrakt.trakt import TraktAPI import sickbeard from sickbeard import helpers, logger from sickbeard.indexers.indexer_config import INDEXER_TVDB from sickrage.helper....
import unittest from hearthbreaker.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire from tests.agents.trade.test_helpers import TestHelpers from tests.agents.trade.test_case_mixin import TestCaseMixin from hearthbreaker.agents.trade.possible_play import PossiblePlays class Te...
import sys from ansible.compat.tests.mock import patch, Mock from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase base_modules_mock = Mock() nitro_service_mock = Mock() nitro_exception_mock = Mock() base_modules_to_mock = { 'nssrc': base_modules_mock, 'nssrc.com': base_modules_mo...
# -*- coding: utf-8 -*- from Test_Column_ObjFnc import tac_column import time """ % ------------------------------------------------------------------------- % SIMULATION-BASED OPTIMIZATION OF A SINGLE CONVENTIONAL DISTILLATION % COLUMN USING THE PARTICLE SWARM OPTIMIZATION ALGORITHM %----------------------...
import re, os, sys from optparse import OptionParser from numpy import * import subprocess from communities import * class ResCluster : members = [] selection_text = None #selection text for pymol number = 0 #cluster number intra_cluster_variance = 0 extra_cluster_variance = 0 indexlist = [] ...
# -*- coding: utf-8 -*- """Regression test for issue #51.""" import unittest import os.path from xml.etree import ElementTree as ET from statik.generator import generate class TestStaticPagesFromProjectDynamicContext(unittest.TestCase): def test_issue(self): test_path = os.path.dirname(os.path.realpath...
#!/usr/bin/env python # 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. """ Verifies the use of the environment during regeneration when the gyp file changes, specifically via build of an executable with C prepro...
# Software License Agreement (BSD License) # # Copyright (c) 2008, 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 ...
#!/usr/bin/env python # # Copyright 2007 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...
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
import re import os import logging import time from autotest.client.shared import error from virttest import virsh from virttest import utils_libvirtd from virttest import data_dir from virttest.utils_test import libvirt from virttest import utils_misc from virttest.libvirt_xml import vm_xml def manipulate_domain(vm_...
# -*- coding: utf-8 -*- ''' Poseidon Add-on Copyright (C) 2016 Poseidon 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) a...
import ipaddress from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ def clean_ipv6_address(ip_str, unpack_ipv4=False, error_message=_("This is not a valid IPv6 address.")): """ Clean an IPv6 address string. Raise ValidationErr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_filesize class TagesschauIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tagesschau\.de/multimedia/(?:[^/]+/)*?[^/#?]+?(?P<id>-?[0-9]+)(?:~_[^/#?]+?)?\.html' _TESTS = [...
""" Field classes. """ from __future__ import unicode_literals import copy import datetime import os import re import sys import uuid import warnings from decimal import Decimal, DecimalException from io import BytesIO from django.core import validators from django.core.exceptions import ValidationError # Provide th...
# Generated by Django 3.0.5 on 2020-06-01 00:13 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('isisdata', '0091_auto_20200601_0...
#!/usr/bin/env python3 # _*_coding:utf-8_*_ # Created by "LiuXin" # Time import traceback import pymongo # text = """吖】ā[吖嗪](āqín)名有机化合物的一类,呈环状结构,含有一个或几个氮原子,如吡啶、哒嗪、嘧啶等。[英azine] # # 【阿】ā〈方〉前缀。①用在排行、小名或姓的前面,有亲昵的意味:~大|~宝|~唐。②用在某些亲属名称的前面:~婆|~爹|~哥。 # 另见2页•ɑ“啊”;354页ē。 # # 【阿鼻地狱】ābídìyù佛教指最深层的地狱,是犯了重罪的人死后灵魂永远受苦的地方。""" # fi...
# Copyright 2012-2013 John Sullivan # Copyright 2012-2013 Other contributers as noted in the CONTRIBUTERS file # # This file is part of Galah. # # Galah 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, e...
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and an alphabetical list of states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('KA', 'Karnataka'), ('AP', 'Andhra Pr...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
# -*- 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): # Changing field 'MailGroupEmail.email' db.alter_column('dbmail_mailgrou...
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.pa...
# -*- coding: utf-8 -*- import os import mock import unittest from flask import Flask from nose.tools import * # noqa (PEP8 asserts) import datetime from tests.base import OsfTestCase from tests.factories import RegistrationFactory from framework.routing import Rule, json_renderer from framework.utils import secure_...
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. import sys from django.core.ma...
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call t...
#!/usr/bin/env python3 from paramecio.cromosoma.corefields import CharField from paramecio.citoplasma.slugify import slugify from paramecio.cromosoma.coreforms import HiddenForm class SlugifyField(CharField): def __init__(self, name, size=255, field_related=None, required=False): super(Slugi...
#------------------------------------------------------------------------------- # Name : subtitle downloader # Purpose : One step subtitle download # # Authors : manoj m j, arun shivaram p, Valentin Vetter, niroyb # Edited by : Valentin Vetter # Created : # Copyright : (c) www.manojmj.com # Licence : GPL ...
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
""" Contains a convenience function to create a ready-made Smith plot """ # Major library imports from numpy import array, ndarray, transpose, real, imag from enthought.chaco.array_data_source import ArrayDataSource from enthought.chaco.data_range_1d import DataRange1D # Local relative imports from .smith_mapper imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- from bs4 import BeautifulSoup as bs from datetime import date, timedelta, datetime import re from suds.client import Client from ..models import Player class Comunio: def __init__(self): self.client = Client(url='http://www.comunio.es/soapservice.php?wsdl') ...
# -*- 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 under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
""" Test cogapp. http://nedbatchelder.com/code/cog Copyright 2004-2015, Ned Batchelder. """ from __future__ import absolute_import import os, os.path, random, re, shutil, stat, sys, tempfile # Use unittest2 if it's available, otherwise unittest. This gives us # back-ported features for 2.6. try: import...
"""Component to interface with switches that can be controlled remotely.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.loader import bind_hass from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import ToggleEntity from ho...
# # 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/env python import json from tests.unit import AWSMockServiceTestCase from boto.beanstalk.layer1 import Layer1 # These tests are just checking the basic structure of # the Elastic Beanstalk code, by picking a few calls # and verifying we get the expected results with mocked # responses. The integration t...
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: 'T...
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
# # 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/env python from ctypes import * from ctypes.util import find_library import sys # For unix the prefix 'lib' is not considered. if find_library('svm'): libsvm = CDLL(find_library('svm')) elif find_library('libsvm'): libsvm = CDLL(find_library('libsvm')) else: if sys.platform == 'win32': libsvm = CDLL('...
from core.Cipher import DES from hashlib import md5 import hashlib import base64 import re import os ''' PBEWithMD5AndDES port based on ''' class PBEWithMD5AndDES(): @staticmethod def get_derived_key(password, salt, count): key = password + salt for i in range(count): m = hashlib....
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2015, René Moser <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'comm...
#!/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) # This is a virtual module that is entirely implemented as an action plugin and runs on the controller from __future__ import absolute_import, ...
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.contrib.sites import models from django.contrib.sites.management import create_default_site from django.contrib.sites.middleware import CurrentSiteMiddleware from django.contrib.sites.models import Site, c...
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on October 04, 2018 @author: jakob <[EMAIL]> ''' from __future__ import print_function from builtins import next from builtins import str from builtins import range import datetime import mock import pytest from eWRT.ws.wikidata.bundle_wikipedia_requests import co...
# -*- coding: utf-8 -*- # # Copyright (c) 2011 SUSE LLC # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have...
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. This is just a copy of the Python 2.2 HMAC module, modified to work when used on versions of Python before 2.2. """ __revision__ = "$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $" import strin...
# 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) 2014 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...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 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 # # Unl...
# Configure the test suite from the env variables. import os dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test') dbhost = os.environ.get('PSYCOPG2_TESTDB_HOST', None) dbport = os.environ.get('PSYCOPG2_TESTDB_PORT', None) dbuser = os.environ.get('PSYCOPG2_TESTDB_USER', None) dbpass = os.environ.get('PSYCOPG2_T...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <[EMAIL]> # Copyright (C) 2014-2017 Jesús Espino <[EMAIL]> # Copyright (C) 2014-2017 David Barragán <[EMAIL]> # Copyright (C) 2014-2017 Alejandro Alonso <[EMAIL]> # Copyright (C) 2014-2017 Anler Hernández <[EMAIL]> # This program is free software: you can ...
import logging from django.contrib.gis.db.models.fields import GeometryField from django.db.utils import OperationalError from django.db.backends.mysql.schema import DatabaseSchemaEditor logger = logging.getLogger('django.contrib.gis') class MySQLGISSchemaEditor(DatabaseSchemaEditor): sql_add_spatial_index = 'C...
from six import BytesIO, text_type from six.moves.urllib.parse import urlparse, parse_qsl class Request(object): """ VCR's representation of a request. There is a weird quirk in HTTP. You can send the same header twice. For this reason, headers are represented by a dict, with lists as the values. ...
from __future__ import division, print_function, absolute_import from ._ufuncs import _lambertw def lambertw(z, k=0, tol=1e-8): r""" lambertw(z, k=0, tol=1e-8) Lambert W function. The Lambert W function `W(z)` is defined as the inverse function of ``w * exp(w)``. In other words, the value of ``...
#!/usr/bin/python ## Copyright 2017 Knossos authors, see NOTICE file ## ## 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...
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader,...
#!/usr/bin/env python """ @brief A base class for constructing shapes @author [EMAIL] """ from __future__ import print_function from csg.core import CSG from csg.geom import Vector import numpy DEFAULTS = dict(origin=[0.0, 0.0, 0.0], lengths=[1.0, 1.0, 1.0], radius=1.0, ...
# -*- coding: utf-8 -*- """ *************************************************************************** gdal2xyz.py --------------------- Date : September 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com **************...
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ import sys import time as _time from datetime import datetime, timedelta, tzinfo from threading import local from django.conf import settings from django.utils import lru_cache, six from django.util...
#!/usr/bin/env python """ Build call-back mechanism for f2py2e. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <[EMAIL]> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2005/07...
# -*- coding: utf-8 -*- from lxml import objectify import time import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_ogone.controllers.main import OgoneController from openerp.tools i...