text
stringlengths
475
200k
# -*- coding: utf-8 -*- ############################################################################### # # EntityOverview # Returns general information about a particular politician, individual, or organization with a given entity id. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed unde...
from __future__ import division from collections import Counter from linear_algebra import distance, vector_subtract, scalar_multiply import math, random def sum_of_squares(v): """computes the sum of squared elements in v""" return sum(v_i ** 2 for v_i in v) def difference_quotient(f, x, h): return (f(x +...
#!/usr/bin/env python # Copyright (c) 2014 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 that extra filters are pruned correctly for Visual Studio 2008. """ import re import TestGyp def strip_ws(str): return r...
#!/usr/bin/env python # kamene.contrib.description = EIGRP # kamene.contrib.status = loads """ EIGRP Scapy Extension ~~~~~~~~~~~~~~~~~~~~~ :version: 2009-08-13 :copyright: 2009 by Jochen Bartl :e-mail: [EMAIL] / [EMAIL] :license: GPL v2 This program is free software; you can r...
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid - **Clipper test suite.** Contact : [EMAIL] .. 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...
# Copyright (c) 2020 PaddlePaddle 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 appli...
from __future__ import unicode_literals import re from django.core.exceptions import FieldDoesNotExist from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Col, Expression from django.db.models.lookups import Lookup from django.utils import six gis_lookups = {} class GISLookup...
# # (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 d...
# -*- coding: utf-8 -*- import itsdangerous import mock from nose.tools import * # noqa: import unittest from django.utils import timezone import pytest from tests.base import ApiTestCase from osf_tests.factories import ( AuthUserFactory, ApiOAuth2ScopeFactory, ) from api.base.settings.defaults import API_BA...
import io import unittest import sys import xml.sax from xml.sax.xmlreader import AttributesImpl from xml.dom import pulldom from test.support import run_unittest, findfile tstfile = findfile("test.xml", subdir="xmltestdata") # A handy XML snippet, containing attributes, a namespace prefix, and a # self-closing ta...
import os import sys from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.creation import BaseDatabaseCreation from django.utils.six.moves import input class DatabaseCreation(BaseDatabaseCreation): def _get_test_db_name(self): test_database_name = self.connection.settings...
# # Copyright (c) 2015 ThoughtWorks, Inc. # # Pixelated 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 version. # # Pixelated is distrib...
input = """ c num blocks = 1 c num vars = 180 c minblockids[0] = 1 c maxblockids[0] = 180 p cnf 180 745 -91 56 -175 0 118 74 115 0 -36 -83 167 0 16 44 142 0 -88 33 20 0 177 132 -8 0 115 121 2 0 -13 -47 28 0 48 -174 163 0 -67 -54 123 0 -130 -132 -71 0 -171 -158 2 0 -35 23 83 0 129 109 -137 0 -8 -139 75 0 -52 -42 -79 0 5...
import json from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.core.urlresolvers import reverse from django.test import TestCase from django.conf import settings from guardian.shortcuts import get_anonymous_user from geonode.groups.models import GroupProfile, Group...
#!/usr/bin/env python3 import pygame, os, random, numpy, math, color_palettes, queue, name_gen, triangle from pygame.locals import * from geom import * from PIL import ImageFilter, Image class City: """docstring for City.""" def __init__(self, location, name="default"): self.name = name self.l...
# Copyright 2014 Rackspace Hosting # # 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 ...
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from urbansim.functions import attribute_label from numpy import reshape class income_less_housing_cost_scaled(Variable): """ (income - ...
#!/usr/bin/env python # coding=utf8 # Copyright 2011 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 # # Un...
import os import fnmatch import re # for htest import sys from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog from tkinter import Tk, Text, Button, SEL, END # for htest from idlelib import SearchEngine import itertools from idlelib.SearchDialogBase import SearchDialogBase # Importing OutputWindow...
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
# -*- encoding: 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 G...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
#!/usr/bin/python from config import hostname, port, username, password, subscriber_username, subscriber_password, \ superuser, superuser_password import sys import unittest import webdavlib import time import sogotests import utilities # TODO: # - cal: complete test for "modify": "respond to" causes a 204 but...
# ============================================================================ # # Copyright (C) 2007-2012 Conceptive Engineering bvba. All rights reserved. # www.conceptive.be / [EMAIL] # # This file is part of the Camelot Library. # # This file may be used under the terms of the GNU General Public # License ver...
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
""" Selectors for Nursing Shift Change Wizard """ from selenium.webdriver.common.by import By WIZARD_STAGE_CONTAINER = ( By.CSS_SELECTOR, '.modal .oe_form_field_status' ) WIZARD_STAGE = ( By.CSS_SELECTOR, '.modal .oe_form_field_status .label' ) WIZARD_BUTTON = ( By.CSS_SELECTOR, '.modal .oe_fo...
# Copyright (c) 2010, 2011, 2012 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
#!/usr/bin/env python # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Main program for testing the infrastructure.""" __author__ = "Guido van Rossum <[EMAIL]>" # Support imports (need to be imported first) from . import support # Python imports import os import...
# 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...
# 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...
from __future__ import unicode_literals import functools import re from .turner import TurnerBaseIE from ..compat import ( compat_urllib_parse_urlencode, compat_urlparse, ) from ..utils import ( OnDemandPagedList, remove_start, ) class NBAIE(TurnerBaseIE): _VALID_URL = r'https?://(?:watch\.|www\...
import os import json from celery.utils.log import get_task_logger from vsi.iglob import glob as iglob logger = get_task_logger(__name__); #Move to ingest.tools when done devving def match_images(images, camera_names, json_config={}): ''' returns dictionary camera_name:image pairs json example: {...
""" Tests for the score change signals defined in the courseware models module. """ import re from datetime import datetime from unittest.mock import MagicMock, patch import ddt import pytest import pytz from django.test import TestCase from submissions.models import score_reset, score_set from common.djangoapps.ut...
"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg ([EMAIL]). """ import codecs import binascii ### Codec APIs def hex_encode(input, errors='strict'): assert errors == 'strict' return (binascii.b2a_hex(input), len(in...
try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django import template from django.template.base import Node from django.utils.encoding import iri_to_uri register = template.Library() class PrefixNode(template.Node): def __repr__(self): ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
from util import CachedDict from util.serial import query_serial cache = CachedDict() table_act = { 'TEMP': 0, 'TXOUT': 1, 'RXOUT': 1, 'P12V': 3, 'PA3': 4, 'PA4': 5, 'PA5': 6, 'PA6': 7, 'N5V': 8, 'OSLPLL': 9, 'TXPLL': 10, 'RXPLL': 11, 'LNBV': 12,...
#!/usr/bin/env python # -*- coding: utf-8 -*- import binascii PAYLOAD_HEADER_SIZE_IN_BITS = 200 PAYLOAD_HEADER_SIZE_IN_BYTES = PAYLOAD_HEADER_SIZE_IN_BITS / 8 NORMAL = 0x1 END_OF_STREAM = 0x2 class Cell(object): def __init__(self, model_uuid, model_instance_id, stream_id, seq_id, length=0, ce...
#!/opt/anaconda2/bin/python # -*- coding: utf-8 -*- """ ################################################################################ # # Copyright (c) 2015 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # ####################################################################...
# -*- coding:utf-8 -*- # Copyright 2015 NEC Corporation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License...
"""Extensible class instrumentation. The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate systems of class instrumentation within the ORM. Class instrumentation refers to how the ORM places attributes on the class which maintain data and track changes to that data, as well as event hooks installed...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Class representing instrumentation test apk and jar.""" import os from pylib.utils import apk_helper import test_jar class TestPackage(test_jar.T...
# sql/__init__.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .expression import ( Alias, ClauseElement, ColumnCollection, Co...
#from sympy.mpmath.calculus import ODE_step_euler, ODE_step_rk4, odeint, arange from sympy.mpmath import odefun, cos, sin, mpf, sinc, mp ''' solvers = [ODE_step_euler, ODE_step_rk4] def test_ode1(): """ Let's solve: x'' + w**2 * x = 0 i.e. x1 = x, x2 = x1': x1' = x2 x2' = -x1 """ d...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/python -u # -*- coding: ISO-8859-1 -*- # # this tests the basic APIs of the XmlTextReader interface # import libxml2 import sys try: import StringIO str_io = StringIO.StringIO except: import io str_io = io.StringIO # Memory debug specific libxml2.debugMemory(1) f = str_io("""<a><b b1="b1"/>...
"""Utility functions for HTTP header value parsing and construction. Copyright 1997-1998, Gisle Aas Copyright 2002-2006, John J. Lee This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distribution). """ impo...
import operator from functools import reduce from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils.datas...
from django.core.files.uploadedfile import UploadedFile from django.utils.datastructures import MultiValueDict from django.utils.functional import lazy_property from django.utils import six from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured class BaseStorage(object): step_key ...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: [EMAIL] ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, are permitted ...
# -*- coding: utf-8 -*- """ pygments.cmdline ~~~~~~~~~~~~~~~~ Command line interface. :copyright: 2006-2008 by Georg Brandl. :license: BSD, see LICENSE for more details. """ import sys import getopt from textwrap import dedent from pygments import __version__, __author__, highlight from pygments....
"""Low-level memory management tracking""" VERBOSITY = 0 # TODO: use logging class Bitmap(object): """Just a raw bitmap for reserving the pages""" def __init__(self, size, verbosity): self._size = size self._bits = 0 self._verbosity = verbosity self._bits_allocd = 0 def _m...
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.core.cache import cache from django.db.utils import DatabaseError from django.db.mod...
#!/usr/bin/env python # (c) 2012, Michael DeHaan <[EMAIL]> # # This file is part of the Ansible Documentation # # 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 # (...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
# 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...
# base unit test classes for ansible/module_utils/facts/ tests # -*- coding: utf-8 -*- # # 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 lat...
"""Deals with creating the atoms class. Copyright (C) 2013, Joshua More and Michele Ceriotti This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any ...
# NamedType specification for constructed types import sys from pyasn1.type import tagmap from pyasn1 import error class NamedType: isOptional = 0 isDefaulted = 0 def __init__(self, name, t): self.__name = name; self.__type = t def __repr__(self): return '%s(%r, %r)' % ( self.__class__....
"""Hypergeometric and Meijer G-functions""" from __future__ import print_function, division from sympy.core import S, I, pi, oo, ilcm, Mod from sympy.core.function import Function, Derivative, ArgumentIndexError from sympy.core.containers import Tuple from sympy.core.compatibility import reduce, range from sympy.core...
self.description = "-U --recursive upgrades outdated dependencies" # git (new package) # |-- perl (up to date) # |-- glibc (out of date, will be updated) # |-- curl (out of date, will be updated) # |-- expat (up to date) perl_lpkg = pmpkg("perl", "5.14.1-3") perl_lpkg.depends = ["glibc"] self.addpkg2db("local", p...
# 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 command_common import logging import manifest_util def Info(manifest, bundle_names): valid_bundles, invalid_bundles = command_common.GetValidBu...
import os import sys def patch_process_for_coverage(): # patch multiprocessing module to get coverage # https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-measurement-of-code-run-by from coverage.collector import Collector from coverage import coverage import multiprocessing # dete...
data = ( 'Ie', # 0x00 'Io', # 0x01 'Dj', # 0x02 'Gj', # 0x03 'Ie', # 0x04 'Dz', # 0x05 'I', # 0x06 'Yi', # 0x07 'J', # 0x08 'Lj', # 0x09 'Nj', # 0x0a 'Tsh', # 0x0b 'Kj', # 0x0c 'I', # 0x0d 'U', # 0x0e 'Dzh', # 0x0f 'A', # 0x10 'B', # 0x11 'V', # 0x12 'G', # 0x...
#!/bin/python # -*- coding: utf-8 -*- """ Unit tests for gluon.tools """ import os import sys if sys.version < "2.7": import unittest2 as unittest else: import unittest from fix_path import fix_sys_path fix_sys_path(__file__) DEFAULT_URI = os.getenv('DB', 'sqlite:memory') from gluon.dal import DAL, Fie...
# -*- coding: utf-8 -*- """ pygments.lexers.make ~~~~~~~~~~~~~~~~~~~~ Lexers for Makefiles and similar. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, include, bygroups, \ ...
# -*- 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 = 'd/m/Y' TIME_FORMAT = 'P' DATETIME...
# -*- coding: utf-8 -*- import pytest from wasp_general.network.messenger.proto import WMessengerOnionProto, WMessengerEnvelopeProto from wasp_general.network.messenger.proto import WMessengerOnionSessionProto, WMessengerOnionLayerProto from wasp_general.network.messenger.proto import WMessengerOnionSessionFlowProto ...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 res...
""" IPython/Jupyter Notebook progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm_notebook import tnrange[, tqdm_notebook] >>> for i in tnrange(10): #same as: for i in tqdm_notebook(xrange(10)) ... ... """ # future division is important to divide ...
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models class Award(models.Model): name = models.CharField(max_length=25) object_id = models.PositiveIntegerField() content_type = mode...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
# Copyright (c) 2013 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. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittests for test_dispatcher.py.""" # pylint: disable=R0201 # pylint: disable=W0212 import os import sys import unittest from py...
############## outhid = outhid_dropout(outhid, use_noise=False) ############## outhid_activ = UnaryOp(activation=eval(state['dout_activ'])) ############## emb_words_out = MultiLayer( rng, n_in=state['n_in'], n_hids=eval(state['dout_nhid']), activation=linear, init_fn='sample_weights_classic', ...
from django.db import models from django.contrib.auth.models import User class Component(models.Model): name = models.CharField(default='', max_length=200) notes = models.CharField(default='', max_length=500) is_working = models.CharField(default='', max_length=10) rating = models.CharField(default=''...
import base64 from datetime import timedelta import os import shutil import string import tempfile import unittest import warnings from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.cache import SessionStore as CacheSes...
from flask import Flask, request, jsonify import heapq import logging import trie server = Flask(__name__, static_url_path='') LOGGING_FILE_NAME = 'log.txt' NUM_SUGGESTIONS_TO_RETURN = 10 single_word_trie = None def init(): global single_word_trie logging.basicConfig(filename=LOGGING_FILE_NAME, level=logging...
# Copyright 2011 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...
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import logging from collections import namedtuple import pytest import torch import pyro.distributions as dist from pyro.contrib.gp.kernels import Cosine, Matern32, RBF, WhiteNoise from pyro.contrib.gp.likelihoods import Gaussian...
from __future__ import absolute_import import logging import time import pystache from flask import request from .authentication import current_org from flask_login import current_user, login_required from flask_restful import abort from redash import models, utils from redash.handlers import routes from redash.handl...
# 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...
# 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...
#!/usr/bin/python #coding: utf-8 -*- # (c) 2016, Mathieu Bultel <[EMAIL]> # (c) 2016, Steve Baker <[EMAIL]> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
"""Gaussian processes regression. """ # Authors: Jan Hendrik Metzen <[EMAIL]> # # License: BSD 3 clause import warnings from operator import itemgetter import numpy as np from scipy.linalg import cholesky, cho_solve, solve_triangular from scipy.optimize import fmin_l_bfgs_b from sklearn.base import BaseEstimator, R...
import os import unittest import six import bmemcached from bmemcached.exceptions import AuthenticationNotSupported, InvalidCredentials, MemcachedException if six.PY3: from unittest import mock else: import mock class TestServerAuth(unittest.TestCase): @mock.patch.object(bmemcached.protocol.Protocol, '...
""" Generic Python Character Mapping Codec. Use this codec directly rather than through the automatic conversion mechanisms supplied by unicode() and .encode(). Written by Marc-Andre Lemburg ([EMAIL]). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import codecs ### Codec APIs ...
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.forms.formsets import BaseFormSet, formset_factory from bootstrap3.tests import TestForm RADIO_CHOICES = ( ('1', 'Radio 1'), ('2', 'Radio 2'), ) MEDIA_CHOICES = ( ('Audio', ( ('vinyl', 'Vinyl'), ...
# This class manages all the menu items in the main menu of the editor import wx from constants import * from evhdlr import * import util import logging from preference import Preferences from wx.lib.pubsub import setupkwargs, pub import pvscomm class MainFrameMenu(wx.MenuBar): """The class implementing and man...
"""A cache for storing small matrices in multiple formats.""" from __future__ import print_function, division from sympy import Matrix, I, Pow, Rational, exp, pi from sympy.physics.quantum.matrixutils import ( to_sympy, to_numpy, to_scipy_sparse ) class MatrixCache(object): """A cache for small matrices in...
import os from colorama import Fore from helpers import deflate, inflate, run_cmd outDirDefault = 'test-outs' testDirDefault = 'test-files' """ Run a single test @param tFile- required; the full path to the file to run @param level- optional (default: all); the compression level [1-9] @param delete- optional (defaul...
from __future__ import print_function import numpy as np from numba import cuda from numba.cuda.testing import unittest class CudaArrayIndexing(unittest.TestCase): def test_index_1d(self): arr = np.arange(10) darr = cuda.to_device(arr) for i in range(arr.size): self.assertEqual...
from __future__ import unicode_literals import webnotes from webnotes import msgprint, _ from webnotes.utils import getdate, nowdate, flt, cstr def execute(filters=None): if not filters: filters = {} columns = get_columns() entries = get_gl_entries(filters) entries_after_report_date = [[gle.voucher_type, gle.vou...
#!/usr/bin/python2.4 from __future__ import division """Diff Match and Patch Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Lice...
from __future__ import unicode_literals from __future__ import absolute_import import sys from itertools import cycle from .multiplexer import Multiplexer from . import colors from .utils import split_buffer class LogPrinter(object): def __init__(self, containers, attach_params=None, output=sys.stdout, monochro...
# -*- 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...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # # 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 ...
# -*- coding: utf-8 -*- from xml.dom import minidom from _pytest.main import EXIT_NOTESTSCOLLECTED import py import sys import os from _pytest.junitxml import LogXML import pytest def runandparse(testdir, *args): resultpath = testdir.tmpdir.join("junit.xml") result = testdir.runpytest("--junitxml=%s" % resul...