text
stringlengths
475
200k
import json from collections import namedtuple import pysopnet from django.core.exceptions import ValidationError from django.db import connection from django.http import Http404, HttpResponse from django.shortcuts import get_object_or_404 from catmaid.control.authentication import requires_user_role from catmaid.mo...
from os.path import join, normcase, abspath, sep def safe_join(base, *paths): """ Joins one or more path components to the base path component intelligently. Returns a normalized, absolute version of the final path. The final path must be located inside of the base path component (otherwise a Valu...
# Authors: Olivier Grisel <[EMAIL]> # Alexandre Gramfort <[EMAIL]> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing import assert_array_almost_equal from...
# # vim: set sw=4 sts=4 et tw=80 fileencoding=utf-8: # """weather_stations - Imports weather station data files""" # Copyright (C) 2007-2010 James Rowe # # 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 Fou...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <[EMAIL]> # # This file is part of Ansible # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or ...
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface AttrSequenceType { attribute sequence<object> foo; }; """) results = parser.finish() except: threw = True harness.ok(threw, "Attribute type must not be a...
# -*- encoding: utf-8 -*- # Copyright (c) 2016 Intel Corp # # Authors: Prudhvi Rao Shedimbi <[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/LICENS...
#!/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 json import unittest from extensions_paths import SERVER2 from server_instance import ServerInstance from template_data_sou...
# configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2008 Michael Foord, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # nico AT tekNico DOT net # ConfigObj 4 # http://www.voidspace.org.uk/python/configobj.html # Released subject to th...
from __future__ import unicode_literals, print_function from inspect import getsource import os from os.path import dirname as dirn import sys print('WARNING: Lazy loading extractors is an experimental feature that may not always work', file=sys.stderr) sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) la...
from discord.ext import commands from datetime import datetime from bs4 import BeautifulSoup import discord import re class VisWax: def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, aliases=['wax'], description='Shows the combination of runes needed f...
""" This script processes the output from the C preprocessor and extracts all qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ from __future__ import print_function import re import sys import os # Python 2/3 compatibility: # - it...
import numpy as np import theano.tensor as T from numpy import linalg as la, random as rnd import pymanopt from pymanopt.manifolds import Sphere from pymanopt.solvers import ConjugateGradient def dominant_eigenvector(A): """ Returns the dominant eigenvector of the symmetric matrix A. Note: For the same ...
import sys import logging from scripts import utils as script_utils from framework.transactions.context import TokuTransaction from website.app import init_app from website.addons.osfstorage import model logger = logging.getLogger(__name__) def do_migration(): count = 0 errored = 0 for node_settings in ...
"""ACME Identifier Validation Challenges.""" import abc import functools import hashlib import logging import socket from cryptography.hazmat.primitives import hashes import OpenSSL import requests from acme import errors from acme import crypto_util from acme import fields from acme import jose logger = logging.ge...
# Copyright 2011 OpenStack Foundation # 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 ...
from __future__ import unicode_literals from django.apps.registry import apps as global_apps from django.db import migrations from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor(object): """ End-to-end migration execution - load...
import unittest from test import test_support import operator from sys import maxint maxsize = test_support.MAX_Py_ssize_t minsize = -maxsize-1 class oldstyle: def __index__(self): return self.ind class newstyle(object): def __index__(self): return self.ind class TrapInt(int): def __index...
""" Create copies of wiki pages for existing forks and registrations instead of using the same NodeWikiPage objects as the original node. """ import logging import sys from modularodm import Q from framework.mongo import database as db from framework.transactions.context import TokuTransaction from website.addons.wi...
# AUTHORS: # Hakan Ozadam # Rachel Brown # # Moore Laboratory # UMASS Medical School / HHMI # RNA Therapeutics Institute # Albert Sherman Center, ASC4-1009 # 368 Plantation Street # Worcester, MA 01605 # USA # ##############################################...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) Camptocamp SA - http://www.camptocamp.com # Author: Arnaud WÃŒst ported by nbessi # # This file is part of the c2c_budget module # # WARNING: This program as such is intended to be used by profes...
#!/usr/bin/env python # Copyright (c) 2010 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 build of an executable with C++ define specified by a gyp define using various special characters such as quotes, commas, etc. ...
# Copyright 2001-2013 Python Software Foundation; All Rights Reserved """Function signature objects for callables Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.6, 2.7 and 3.2+. """ from __future__ import absolute_import, division, print_function imp...
""" Takend from http://flask.pocoo.org/snippets/63/ """ from urlparse import urlparse, urljoin from flask import request, url_for, redirect from flask.ext.wtf import Form from wtforms import HiddenField def is_safe_url(target): ref_url = urlparse(request.host_url) test_url = urlparse(urljoin(request.host_ur...
import datetime from ..core import db from ..models import UserModel from ..models import FileModel import json from bson import ObjectId class ProfileModel(db.Document): created_at = db.StringField(default=str(datetime.datetime.utcnow())) user = db.ReferenceField(UserModel, reverse_delete_rule=db.CA...
# encoding: UTF-8 '''一个简单的通联数据客户端,主要使用requests开发,比通联官网的python例子更为简洁。''' import requests import json FILENAME = 'datayes.json' HTTP_OK = 200 ######################################################################## class DatayesClient(object): """通联数据客户端""" name = u'通联数据客户端' #---------------------...
# http://wiki.python.org/moin/BytesIO # # A skeleton one used for systems that don't have BytesIO. # # It's enough for subunit at least.... class BytesIO(object): """ A file-like API for reading and writing bytes objects. Mostly like StringIO, but write() calls modify the underlying bytes object. >>...
#!/usr/bin/env python import os from setuptools import setup from setuptools import find_packages PROJECT = u'AnsibleCharm' VERSION = '0.1' URL = "https://blog.juju.solutions" AUTHOR = u'Whit Morriss <[EMAIL]>' AUTHOR_EMAIL = u'[EMAIL]' DESC = "Python library for charming with ansible" def read_file(file_name): ...
# 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...
import distutils from distutils.core import setup, Extension from distutils.command.build_ext import build_ext from distutils.cmd import Command import platform import os import re CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) # when compiling for Windows Python 2.7, force distutils to use ...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
# 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...
# -*- encoding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (C) 2015 Odoo S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
from math import * from random import * class rabin: def __init__(self): pass def get_big(self, bit): #get a big number x that x % 4 = 3 big = 1 for i in range(bit-3): temp = randrange(0,2) big = big * 2 + temp big = big * 4 + 3 ret...
# 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 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
import wtforms from nose.tools import eq_, ok_ from flask import Flask from werkzeug.wsgi import DispatcherMiddleware from werkzeug.test import Client from wtforms import fields from flask_admin import Admin, form from flask_admin._compat import iteritems, itervalues from flask_admin.model import base, filters fro...
import os import shutil import sys import logging import heapq import yaml import re from distutils.util import strtobool from pkg_resources import resource_string from argparse import ArgumentParser, RawTextHelpFormatter from pywb.utils.loaders import load_yaml_config from pywb.utils.timeutils import timestamp20_no...
"""Check for an aggregated logging Elasticsearch deployment""" import json import re from openshift_checks import OpenShiftCheckException, OpenShiftCheckExceptionList from openshift_checks.logging.logging import LoggingCheck class Elasticsearch(LoggingCheck): """Check for an aggregated logging Elasticsearch dep...
""" An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads the original NORB file format, not the LISA lab's `.npy` version. Currently only supports the Small NORB Dataset. Download the dataset from `here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_. NORB dataset(s) by Fu Jie Huang a...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The nealcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the invalidateblock RPC.""" from test_framework.test_framework import nealcoinTestFramework from...
# Copyright 2019 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 # -*- coding: utf-8 -*- # # (c) 2017, Gaudenz Steinlin <[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 = {'metadata_version': '1.1', ...
# 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...
#!/usr/bin/env python # Copyright 2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import unittest import os import copy # internal modules: from yotta.test.cli import cli from yotta.test.cli import util Test_Target = "x86-osx-native...
from config import settings from salmon import view from salmon.routing import Router from salmon.server import Relay import jinja2 import logging import logging.config import os logging.config.fileConfig("config/test_logging.conf") # the relay host to actually send the final message to (set debug=1 to see what # the...
""" Error checking functions for GEOS ctypes prototype functions. """ from ctypes import c_void_p, string_at from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Getting the `free` routine used to free the memory allocated for # string pointers ...
from django.http import HttpResponse from django.template import Template, Context from django.template.response import TemplateResponse from django.test import TestCase, RequestFactory from django.utils.decorators import decorator_from_middleware class ProcessViewMiddleware(object): def process_view(self, reques...
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.template.response import TemplateResponse from django.utils...
#!/usr/bin/python #Copyright (C) Nial Peters 2013 # #This file is part of AvoPlot. # #AvoPlot 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...
from email.utils import formatdate from scrapy import signals from scrapy.exceptions import NotConfigured, IgnoreRequest from scrapy.utils.misc import load_object class HttpCacheMiddleware(object): def __init__(self, settings, stats): if not settings.getbool('HTTPCACHE_ENABLED'): raise NotCon...
# 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...
# -*- coding: utf-8 -*- # (c) 2017 KMEE- Hendrix Costa <[EMAIL]> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from .abstract_arquivos_governo import AbstractArquivosGoverno class Grrf(AbstractArquivosGoverno): # Informações do Responsavel def _registro_00(self): registro_00 = sel...
class BSTNode(object): """A node in a binary search tree.""" def __init__(self, data, left=None, right=None): self.data = data self.left = left self.right = right class BinarySearchTree(object): """A class for a binary search tree that stores unique values.""" def __init__(sel...
from . import SimIRStmt from ... import s_options as o from ...s_action_object import SimActionObject from ...s_action import SimActionData class SimIRStmt_StoreG(SimIRStmt): def _execute(self): addr = self._translate_expr(self.stmt.addr) data = self._translate_expr(self.stmt.data) expr = d...
#!/usr/bin/env python from setuptools import setup, Command import subprocess, os, shutil, glob, sys coffee_files = [ 'cldoc.coffee', 'page.coffee', 'sidebar.coffee', 'node.coffee', 'type.coffee', 'doc.coffee', 'category.coffee', 'enum.coffee', 'templated.coffee', 'struct.coff...
import srddl.data as sd import srddl.fields as sf import srddl.helpers as sh import srddl.models as sm class PcapFileHeader(sm.Struct): magic = sf.IntField('magic', size=4) version_major = sf.IntField('', size=2) version_minor = sf.IntField('', size=2) thiszone = sf.IntField('gmt to local correction', size=4) ...
"""Kea database config backend commands hook testing""" import pytest import srv_msg from cb_model import setup_server_for_config_backend_cmds pytestmark = [pytest.mark.v6, pytest.mark.kea_only, pytest.mark.controlchannel, pytest.mark.hook, pytest.mark.config_b...
# Copyright (c) 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. import xml.dom.minidom as minidom from xml.parsers.expat import ExpatError import crash_utils from repository_parser_interface import ParserInterface ...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """scdl allows you to download music from Soundcloud Usage: scdl -l <track_url> [-a | -f | -C | -t | -p][-c | --force-metadata][-n <maxtracks>]\ [-o <offset>][--hidewarnings][--debug | --error][--path <path>][--addtofile][--addtimestamp] [--onlymp3][--hide-progress...
#!/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. '''Support for gathering resources from RC files. ''' import re from grit import exception from grit import lazy_re from grit im...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <[EMAIL]> # (c) 2015, René Moser <[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, ei...
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of t...
# # 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 # ...
# Copyright (C) 2017 Lenovo, 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. # # Ansi...
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i, h2o_exec, h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(3) @classmethod def tearDownCl...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Boyd Adamson <boyd () boydadamson.com> # # 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...
# Gurdy.py # Aaron Taylor # Moose Abumeeiz # # This is the first boss, Gurdy. He just sits there and takes your bullets # from pygame import * from const import * from func import * from Animation import * from Enemy import * class Gurdy(Enemy): x = 6 y = 3 health = 100 hurtDistance = 2 def __init__(self, tex...
# -*- coding: utf-8 -*- # # AWL simulator - SFCs # # Copyright 2012-2015 Michael Buesch <[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...
# 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. from base_handler import BaseHandler from base_handler import Permission from waterfall import buildbot from waterfall import masters from model.wf_step impo...
import numpy as num from pyrocko.guts import Bool from .plugin import PluginConfig, Plugin class DerampConfig(PluginConfig): demean = Bool.T(optional=True, default=True) class Deramp(Plugin): def __init__(self, scene, config=None): self.scene = scene self.config = config or DerampConfig()...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
"""Add has function and dependent pgcrpyto Revision ID: 5552dfae2cb0 Revises: c225ea8fbf5e Create Date: 2019-09-14 06:19:36.520447 """ # revision identifiers, used by Alembic. revision = '5552dfae2cb0' down_revision = 'c225ea8fbf5e' branch_labels = None depends_on = None from alembic import op import sqlalchemy as ...
from markdown import message, CRITICAL import sys ## Import def importETree(): """Import the best implementation of ElementTree, return a module object.""" etree_in_c = None try: # Is it Python 2.5+ with C implemenation of ElementTree installed? import xml.etree.cElementTree as etree_in_c exce...
#!/usr/bin/python # # Copyright (C) 2012 Intel Corporation # # 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 option) any later version. # # This pr...
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """Mimic pyquick exercise -- optional extra exercise. Google's Python Class Read in the ...
#!/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. import unittest from environment import GetAppVersion from test_object_store import TestObjectStore from object_store_creator import O...
""" A sub-package for efficiently dealing with polynomials. Within the documentation for this sub-package, a "finite power series," i.e., a polynomial (also referred to simply as a "series") is represented by a 1-D numpy array of the polynomial's coefficients, ordered from lowest order term to highest. For example, a...
import yaml import os class BaseConfigError(Exception): pass class ConfigParsingError(BaseConfigError): pass class ConfigReadError(BaseConfigError): pass class BaseHolder(object): def __init__(self, configfile="/etc/qlivestats.yaml"): self.name = self.__class__.__name__.lower() ...
#!/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...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 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 -alertnotify # from test_framework.test_framework import BitcoinTestFramework from test_framew...
#Replace game name with the rom name, github: https://github.com/dsoft20 #This script takes the gamelist.xml generated by the Universal XML-Scraper #and replace the scraped name field (<name>) with the rom name # <path>./Game name (Europe).zip</path> # <name>Game name</name> # TO # <path>./Game name (Europe).z...
"""Analyze powershell import statements.""" from __future__ import absolute_import, print_function import os import re from lib.util import ( display, ) def get_powershell_module_utils_imports(powershell_targets): """Return a dictionary of module_utils names mapped to sets of powershell file paths. :ty...
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
import asyncio from collections import namedtuple import struct from aerospike_py.connection import Connection, ASConnectionError from aerospike_py.result_code import ASMSGProtocolException class ASIOException(Exception): pass class InvalidMessageException(Exception): pass # --- all messages --- Aerospi...
# Description: FreeViz projector # Category: projection # Uses: zoo # Referenced: Orange.projection.linear # Classes: Orange.projection.linear.FreeViz, Orange.projection.linear.Projector import Orange import numpy as np tab = Orange.data.Table('titanic') ind = Orange.data.sample.SubsetIndices2(p0=0.99...
from unittest import TestCase from similarityPy.algorithms.mean import Mean from tests import test_logger __author__ = 'cenk' class MeanTest(TestCase): def setUp(self): pass def test_algorithm_with_list(self): test_logger.debug("MeanTest - test_algorithm_with_list Starts") mean = M...
''' Created on Mar 9, 2016 @author: charper ''' from collections import Counter import logging from lib import lib_dbg_filehandler, lib_consolehandler, lib_inf_filehandler module_logger=logging.getLogger(__name__) module_logger.addHandler(lib_inf_filehandler) module_logger.addHandler(lib_dbg_filehandler) ...
from pyecharts.charts import Sankey from pyecharts import options as opts linkes=[ {'source':'03万','target':'续费后03万','value':20}, {'source':'03万','target':'续费后05万','value':70}, {'source':'03万','target':'续费后10万','value':25}, {'source':'03万','target':'续费后15万','value':12}, {'source':'03万','target':'续费后25万','value':10}, {...
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
import unittest from cupy import testing @testing.gpu class TestSplit(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_array_equal() def test_array_spliti1(self, xp): a = testing.shaped_arange((3, 11), xp) split = xp.array_split(a, 4, 1) return xp.concaten...
""" sentry.quotas.redis ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from time import time from sentry.exceptions import InvalidConfiguration from sentry.quotas.base import NotRa...
"""Functions new to the pyScss library.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import os.path import random import six from six.moves import xrange from scss import config from scss.errors ...
# Copyright 2011 OpenStack LLC. # Copyright 2012-2013 Hewlett-Packard Development Company, L.P. # 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 # # htt...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function from __future__ import division import binascii import struct import biplist import mac_alias try: next except NameError: next = lambda x: x.next() try: unicode except NameError: unicode = str from ....
import copy import logging from hashlib import sha1 from typing import List import simplejson as json from treeherder.log_parser.utils import validate_perf_data from treeherder.model.models import OptionCollection from treeherder.perf.models import (PerformanceDatum, PerformanceFra...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" Generating and counting primes. """ from __future__ import print_function, division import random from bisect import bisect # Using arrays for sieving instead of lists greatly reduces # memory consumption from array import array as _array from .primetest import isprime from sympy.core.compatibility import as_int...
# Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...