text
stringlengths
475
200k
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 3333) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, however, and w...
from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.db.backends.base.operations import \ BaseSpatialOperations from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates from django.db.backends.mysql.operations import D...
#!/usr/bin/env python3 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Run this script from the root of the repository to update all translations from transifex. It will do the foll...
""" Simple solver "core". Contains capabilities for unpacking a JSON n-tuple, as well as routing this n-tuple based on the predicate_type (command, query, assertion, etc.). Other general capabilities can be added. The design is general enough that the same "unpacking" and "routing" method can be used, as long as a new ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import re import httplib import urllib from pyquery import PyQuery as pq parser = argparse.ArgumentParser( description='Download video resource from tudou.com', epilog="Parse the url to video address using flvcd.com") parser.add_argument('-...
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsPalLabeling: base suite of render check tests Class is meant to be inherited by classes that test different labeling outputs See <qgis-src-dir>/tests/testdata/labeling/README.rst for description. .. note:: This program is free software; you can redistribute it and/or...
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2013 Christopher L. Felton # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published ...
#!/usr/bin/env python # 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. """Given a GYP/GN filename, sort C-ish source files in that file. Shows a diff and prompts for confirmation before doing the deed. Wor...
''' class Aniaml: count = 10 def __init__(self,name): self.name = name self.num = None hobbie = 'meat' @classmethod #类方法,不能访问实例变量 def talk(self): print('%s is talking ...'%self.hobbie ) @staticmethod #静态方法,不能访问类变量及实例变量 def walk(): print('is walking ...')...
from django import http from django.contrib.auth.models import User from django.contrib.messages.storage.user_messages import UserMessagesStorage,\ LegacyFallbackStorage from django.contrib.messages.tests.base import skipUnlessAuthIsInstalled from django.contrib.messages.tests.cookie import set_cookie_data from dja...
#!/usr/bin/env python """ FCKeditor - The text editor for internet Copyright (C) 2003-2005 Frederico Caldeira Knabben Licensed under the terms of the GNU Lesser General Public License: http://www.opensource.org/licenses/lgpl-license.php For further information visit: http://www.fckeditor.net/ "Suppo...
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # # or in the "license" f...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
""" specpolsplit Split O and E beams """ import numpy as np from scipy.interpolate import interp1d from scipy.ndimage.interpolation import shift from specpolutils import rssmodelwave def read_wollaston(hdu, wollaston_file): """ Correct the O or E beam for distortion due to the beam splitter Parameters...
import tensorflow as tf import numpy as np import os import sys import random import subprocess from redis import Redis import time sys.path.append(os.path.realpath("..")) import helpers.utils as hlp from models.feed_forward import FFDiscrete class A3CDiscreteTrainer(FFDiscrete): def __init__(self, sess, args):...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # Copyright (c) 2013 Hewlett-Pa...
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver import libcloud.security # Skip this step if you are launching nodes on an official vCloud # provider. It is intended only for self signed SSL certs in # vanilla vCloud Director v1.5 test deployments. # Note: Code like this ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
"""Functions to construct sparse matrices """ from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum', 'hstack', 'vstack', 'bmat', 'rand', 'diags', 'block_diag'] from warnings import warn import nu...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <[EMAIL]> # Chris Houseknecht, <[EMAIL]> # # 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 = {'me...
# Copyright: (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import copy import json import pytest from mock import MagicMock from ansible.module_utils import hetzner class ModuleFailException(Exception): def __init__(self, msg, **kwargs): ...
# ---------------------------------------------------------------------- # 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...
from testsuite.base_test import BaseTest from testfixtures import log_capture from testsuite import config from core.sessions import SessionURL from core import modules from core import messages import subprocess import tempfile import datetime import logging import os class FileDOwnload(BaseTest): def setUp(self...
# This file is part of Invenio. # Copyright (C) 2009, 2010, 2011 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 (at your option) any later version. # # ...
# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
#! /usr/bin/env python """Test script for popen2.py""" import warnings warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*", DeprecationWarning) warnings.filterwarnings("ignore", "os\.popen. is deprecated.*", DeprecationWarning) import os import sys impor...
import re from django.utils.cache import patch_vary_headers from django.utils.text import compress_sequence, compress_string re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header acco...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2013 Artem Glebov <[EMAIL]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
from django import forms from django.contrib.contenttypes.models import ContentType from forms_builder.forms.forms import FormForForm from .models import SurveyFieldEntry, SurveyFormEntry class SurveyFormForForm(FormForForm): field_entry_model = SurveyFieldEntry content_type = forms.ModelChoiceField( ...
from __future__ import unicode_literals from django.utils import unittest from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address class TestUtilsIPv6(unittest.TestCase): def test_validates_correct_plain_address(self): self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a')) ...
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
# encoding: utf-8 try: from collections import OrderedDict except ImportError: # support installable ordereddict module in older python versions from ordereddict import OrderedDict from time import time class TimeCache (dict): __default = object() def __init__ (self,timeout): self.timeout = timeout self.la...
# Generated by Django 2.2 on 2019-05-03 14:05 import civil_registry.models from django.db import migrations, models import libya_elections.libya_bread class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Citizen',...
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import logging import os import sys import time # Needed fo...
USERS = { "haho0032": { "sn": "Hoerberg", "givenName": "Hans", "eduPersonScopedAffiliation": "[EMAIL]", "eduPersonPrincipalName": "[EMAIL]", "uid": "haho", "eduPersonTargetedID": "one!for!all", "c": "SE", "o": "Example Co.", "ou": "IT", ...
import hashlib import logging import re from django.conf import settings from django import http from django.core.mail import mail_managers from django.utils.http import urlquote from django.utils import six from django.core import urlresolvers logger = logging.getLogger('django.request') class CommonMiddleware(ob...
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
#!/usr/bin/env python from saml2.md import AttributeProfile from saml2.sigver import security_context from saml2.config import Config from saml2.validate import valid_instance from saml2.time_util import in_a_while from saml2.extension import mdui from saml2.extension import idpdisc from saml2.extension import shibmd f...
"""Configuration-related classes for versionner""" import codecs import configparser import pathlib import re import sys from versionner import defaults ENV_VERSIONNER_PROJECT_CONFIG_FILE = 'VERSIONNER_PROJECT_CONFIG_FILE' # pylint: disable=too-many-instance-attributes,too-few-public-methods class FileConfig: ...
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test f...
# -*- coding: utf-8 -*- from .Qt import QtCore, QtGui from .Vector import Vector from .Transform3D import Transform3D from .Vector import Vector import numpy as np class SRTTransform3D(Transform3D): """4x4 Transform matrix that can always be represented as a combination of 3 matrices: scale * rotate * translate ...
"""Support for The Things Network's Data storage integration.""" import asyncio import logging import aiohttp from aiohttp.hdrs import ACCEPT, AUTHORIZATION import async_timeout import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( ATT...
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.test import SimpleTestCase, override_settings from django.test.utils import isolate_lru_cache from django.utils import six class FieldDeconstructionTests(SimpleTestCase): """ Tests the deconstruct() ...
#!/usr/bin/env python # copy LIGGGHTS src/libliggghts.so and liggghts.py to system dirs instructions = """ Syntax: python install.py [-h] [libdir] [pydir] libdir = target dir for src/libliggghts.so, default = /usr/local/lib pydir = target dir for liggghts.py, default = Python site-packages dir """ im...
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
# Copyright 2012 the V8 project authors. 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 conditi...
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test f...
import logging from django.core.exceptions import ImproperlyConfigured from rest_framework.permissions import BasePermission from ...settings import oauth2_settings log = logging.getLogger('oauth2_provider') SAFE_HTTP_METHODS = ['GET', 'HEAD', 'OPTIONS'] class TokenHasScope(BasePermission): """ The requ...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes, webnotes.utils, os def execute(): webnotes.reload_doc("core", "doctype", "file_data") webnotes.reset_perms("File Data") singles = get_single_doctypes() for doctype...
import unittest from unittest.mock import Mock class ClassMagicTest(unittest.TestCase): def test_new(self): class A(object): def __new__(cls, *args, **kwargs): # 重载 __new__ 必须返回 return object.__new__(cls, *args, **kwargs) def __init__(self): ...
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
from django.contrib.admin.sites import AdminSite from pyquery import PyQuery as pq from olympia.amo.tests import TestCase, addon_factory, user_factory from olympia.amo.urlresolvers import reverse from olympia.git.admin import GitExtractionEntryAdmin from olympia.git.models import GitExtractionEntry class TestGitExt...
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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: utf-8 -*- """QGIS Unit tests for QgsSnappingUtils (complement to C++-based tests) .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your ...
# -*- 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): # Deleting field 'GeneratedCertificate.certificate_id' db.delete_column('certificates_generatedcertificate',...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \de F \de Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = r'j \de F \de Y à...
# This interface module contains additional behavior for curses to make it more suited for # the current aim of this project. It enables quick interaction between curses and the # actual game while still attempting to be flexible and expendable at the same time. # Developer note: It should be good practice to allow t...
#!/usr/bin/python # Copyright 2013 Google 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 vers...
""" Unit tests for different acquisition functions. This mainly tests that the gradients of each acquisition function are computed correctly. """ # future imports from __future__ import division from __future__ import absolute_import from __future__ import print_function # global imports import numpy as np import num...
# Copyright (c) 2015 Egor Tensin <[EMAIL]> # This file is part of the "Sorting algorithms" project. # For details, see https://github.com/egor-tensin/sorting-algorithms. # Distributed under the MIT License. import sys from ..algorithm import SortingAlgorithm # Disclaimer: implemented in the most literate way. def ...
import torch from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors import torch.distributed as dist from torch.nn.modules import Module ''' This version of DistributedDataParallel is designed to be used in conjunction with the multiproc.py launcher included with this example. It assumes that your r...
"""LTI integration tests""" from collections import OrderedDict import json import mock from nose.plugins.attrib import attr import oauthlib import urllib from django.conf import settings from django.core.urlresolvers import reverse from courseware.tests import BaseTestXmodule from courseware.views.views import get_...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, [EMAIL] # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet from ...format import Form...
# # (c) 2015 Peter Sprygada, <[EMAIL]> # # Copyright (c) 2016 Dell Inc. # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the ...
# -*- coding: utf-8 -*- u""" .. module:: models """ import logging import os # pylint: disable=unused-import import uuid from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db.models import F from django.utils import timezone logger = logging.getLogg...
# Copyright 2010 Hakan Kjellerstrand [EMAIL] # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# # Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['Pool'] # # Imports # import threading import queue import itertools import collections import time from multiprocessing ...
#!/usr/bin/env python ''' antenna pointing module Andrew Tridgell June 2012 ''' import sys, os, time from cuav.lib import cuav_util from MAVProxy.modules.lib import mp_module class AntennaModule(mp_module.MPModule): def __init__(self, mpstate): super(AntennaModule, self).__init__(mpstate, "antenna", "ante...
# Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, includin...
# 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...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class BeatportProIE(InfoExtractor): _VALID_URL = r'https?://pro\.beatport\.com/track/(?P<display_id>[^/]+)/(?P<id>[0-9]+)' _TESTS = [{ '...
""" Bayesian Blocks for Histograms ------------------------------ .. currentmodule:: astroML Bayesian Blocks is a dynamic histogramming method which optimizes one of several possible fitness functions to determine an optimal binning for data, where the bins are not necessarily uniform width. The astroML implementatio...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 (at your option) any...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i' DATETI...
import os from browser import doc #_scripts=doc.createElement('script') #_scripts.src="/src/py_VFS.js" #_scripts.type="text/javascript" #doc.get(tag='head')[0].appendChild(_scripts) VFS=dict(JSObject(__BRYTHON__.py_VFS)) class VFSModuleFinder: def __init__(self, path_entry): print("in VFSModuleFinder") ...
""" Access control operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. TO DO sync instructor and staff flags e.g. should these be possible? {instructor: true, staff: false} {instructor: true, staff: true} """ import logging from djan...
# -*- 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kim Nørgaard # Written by Kim Nørgaard <[EMAIL]> # Based on pkgng module written by bleader <[EMAIL]> # that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <http://github.com/afterb...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <[EMAIL]>, and others # 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',...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import fields, models, api class AccountMoveLine(models.Model): _inherit = "account.move.line" tax_exigible = fields.Boolean(string='Appears in VAT report', default=True, help="Technical fi...
""" Return a CV patterned string based on the word. """ __author__ = ['M. Willis Monroe <[EMAIL]>'] __license__ = 'MIT License. See LICENSE.' from cltk.stem.akkadian.syllabifier import AKKADIAN class CVPattern(object): """Return a patterned string representing the consonants and vowels of the input word.""...
from __future__ import print_function import types import warnings import sys import traceback import inspect import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.ut...
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly) coin...
#!/usr/bin/env python # Fri 2013-05-03 23:49:55 -0400 # Copyright (c) 2013 by Ken Guyton. All Rights Reserved. """A game for guessing a number. Used as a Python class example. A computer player plays the game. """ __author__ = 'Ken Guyton' import argparse import guess_num2 import player MAX_DEFAULT = 100 MIN_DEF...
from setuptools import setup, Command from unittest import TextTestRunner, TestLoader from glob import glob from os.path import splitext, basename, join as pjoin try: from os.path import walk except ImportError: from os import walk import os class TestCommand(Command): user_options = [] def initializ...
import math from mpmath.libmp import sqrtrem as mpmath_sqrtrem from ..logic import true from ..utilities import sift from .add import Add from .cache import cacheit from .compatibility import as_int from .evalf import PrecisionExhausted from .evaluate import global_evaluate from .expr import Expr from .function impor...
# -*- 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 field 'Country.dac_region_code' db.add_column('data_country', 'dac_region_code', ...
import psycopg2.extensions from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can conta...
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges ([EMAIL]), Clovis Peruchi Scotti ([EMAIL]), # Guilherme Augusto Rutzen ([E...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_, assert_raises from scipy._lib._util import _aligned_zeros, check_random_state def test__aligned_zeros(): niter = 10 def check(shape, dtype, order, align): err_msg = r...
# 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...
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
#!/usr/bin/env python # # Created by: Pearu Peterson, September 2002 # from __future__ import division, print_function, absolute_import from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_almost_equal, assert_, assert_raises, assert_allclose, \ assert_almost_equal import numpy ...
from requests.exceptions import ConnectTimeout from rest_framework.exceptions import PermissionDenied from rest_framework.generics import RetrieveAPIView from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from .clients import LearnerAPIClient from .permissions import Ha...
#!/usr/bin/python """ PN-CLI vrouter-bgp-add/vrouter-bgp-remove/vrouter-bgp-modify """ # # 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 Lice...