gt
stringclasses
1 value
context
stringlengths
2.49k
119k
"""Circuits using implementation of a Python module (plugin) manager for Naali. here is a Manager that the PythonScriptModule instanciates, and which then loads the python modules that are to be autoloaded. This handles their event registrations, passing incoming events to them etc. """ try: import rexviewer as r...
import datetime import sys import unittest from django.conf import settings from django.contrib.admindocs import utils from django.contrib.admindocs.views import get_return_data_type from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.test import TestCase, modify_settin...
import base64 import datetime import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import socket import os import re import io import contextlib from test import support try: import threading except ImportError: threading = N...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 New Dream Network, LLC (DreamHost) # # 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/li...
from __future__ import print_function, division from collections import deque from random import randint from sympy.core.compatibility import range from sympy.external import import_module from sympy import Mul, Basic, Number, Pow, Integer from sympy.physics.quantum.represent import represent from sympy.physics.quant...
#!/usr/bin/env python import sys import os import inspect import traceback import yaml import pycurl import json import csv import logging import threading from optparse import OptionParser from email import message_from_string # For headers handling import time try: from cStringIO import StringIO as MyIO except:...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#!/usr/bin/env python import sys, platform from Tkinter import * import tkFont, tkMessageBox from tkFileDialog import askopenfilename ### imports for connections import socket,ssl,base64, RSAKeyHandling, os, json from M2Crypto import DH,RSA,Rand from binascii import hexlify import pickle from base64 import b64decode ...
import re import os import json from six.moves.urllib.parse import quote, unquote, urlencode from bottle import Bottle, request, HTTPError, response, HTTPResponse, redirect import requests from warcio.timeutils import timestamp_to_iso_date from pywb.utils.loaders import load_yaml_config from pywb.rewrite.wburl impo...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # 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 Lic...
#!/usr/bin/env python #coding: utf-8 """ This module simply sends request to the Digital Ocean API, and returns their response as a dict. """ from requests import codes, RequestException from dopy import API_TOKEN, API_ENDPOINT from dopy import common as c from dopy.exceptions import DoError REQUEST_METHODS = { '...
# Copyright (c) 2010-2012 OpenStack, LLC. # # 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 ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
""" Implement slices and various slice computations. """ import itertools from llvmlite import ir from numba.six.moves import zip_longest from numba import cgutils, types, typing from .imputils import (lower_builtin, lower_getattr, iternext_impl, impl_ret_borrowed, impl_...
""" Type inference base on CPA. The algorithm guarantees monotonic growth of type-sets for each variable. Steps: 1. seed initial types 2. build constraints 3. propagate constraints 4. unify types Constraint propagation is precise and does not regret (no backtracing). Constraints push types forward fol...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # 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...
# 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/env python3 # Copyright (c) 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 the SegWit changeover logic.""" from test_framework.test_framework import TrollcoinTestFramework from ...
# -*- 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): pass def backwards(self, orm): pass models = { u'auth.group': { 'Meta': {'obje...
# 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...
import numpy as np import nibabel as nib import numpy.linalg as npl from dipy.io.dpy import Dpy def flirt2aff(mat, in_img, ref_img): """ Transform from `in_img` voxels to `ref_img` voxels given `matfile` Parameters ---------- matfile : (4,4) array contents (as array) of output ``-omat`` trans...
# Copyright 2018 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...
try: import unittest2 as unittest except ImportError: import unittest from graphite.render.attime import parseTimeReference, parseATTime, parseTimeOffset, getUnitString from datetime import datetime, timedelta from django.utils import timezone from .base import TestCase import pytz import mock def mockDateT...
# -*- coding: utf-8 -*- import logging import os from django.contrib.auth.models import Group, User from django.contrib.gis.gdal import DataSource from django.contrib.gis.geos import GEOSGeometry, Polygon from django.core.files import File from django.test import TestCase from django.utils import timezone import jobs...
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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.o...
ID = "convert" permission = 0 import simplejson import urllib2 from os import makedirs import os.path as os_path words = ["to", "in"] currency_path = "commands/Currency/currency_data.txt" conversion = { "distance":{"m" : 1.0, "ft" : 0.3048, "km" : 1000, "mi" : 1609.344, "in" : 0.0254, "cm...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProposalMetaData' db.create_table('reviews_proposalmetadata', ( ('id', self.gf...
# Copyright 2011 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 l...
from ipaddress import ip_network from bgpfu.prefixlist import PrefixSet def test_prefixset_init_empty(): ps = PrefixSet() assert ps is not None assert len(ps) == 0 def test_prefixset_init_meta(): value = "test_value" ps = PrefixSet(meta=value) assert ps.meta("meta") == value assert ps.m...
# Copyright 2018 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 from django.db import models, migrations import datetime import behaviouralExperimentDefinition.models from django.conf import settings import django.core.validators class Migration(migrations.Migration): dependencies = [ migrations.swappab...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Feb 23 16:02:10 2018 @author: BallBlueMeercat """ import matplotlib.pyplot as plt from emcee import EnsembleSampler import numpy as np import time import os.path import datasim import tools import ln import plots def stats(test_params, data_dict, sigm...
import sys def is_a_tty(stream): return hasattr(stream, 'isatty') and stream.isatty() class Terminal(object): terminfo = None columns = 80 lines = 25 isatty = True isCygwin = False # output colors C_BLACK = 0 # whatever basic terminal color is set at? C_RED = 1 C_GREEN = 2 ...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== from cntk import output_variable, FreeDimension from cntk.ops.functions import User...
__author__ = "Mohammadjavad valipoor" __copyright__ = "Copyright 2015, SoftTelecom" import json import logging from Queue import Queue import random import string import datetime def config_logger(log_level=logging.DEBUG): logging.basicConfig(format='%(levelname)s %(asctime)s: %(message)s', ...
from collections import defaultdict from typing import List, Type, Dict, Union, Tuple, Optional, Sequence from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType from django.db import models, Integrity...
import pandas as pd import numpy as np import chess import matplotlib.pyplot as plt import guerilla.train.stockfish_eval as sf import guerilla.train.chess_game_parser as cgp import guerilla.data_handler as dh from guerilla.players import Guerilla def metric_by_move(weight_files, labels=None, num_values=100, metric='...
import theano from .. import init from .. import nonlinearities from .base import Layer from .conv import conv_output_length from ..utils import as_tuple from theano.sandbox.cuda.basic_ops import gpu_contiguous from theano.sandbox.cuda.blas import GpuCorrMM __all__ = [ "MMLayer", "Conv2DMMLayer", ] if n...
# -*- coding: utf-8 -*- """ hyper/http11/connection ~~~~~~~~~~~~~~~~~~~~~~~ Objects that build hyper's connection-level HTTP/1.1 abstraction. """ import logging import os import socket import base64 from collections import Iterable, Mapping from .response import HTTP11Response from ..tls import wrap_socket, H2C_PROT...
from __future__ import unicode_literals import logging import urlparse from mopidy.audio import PlaybackState from mopidy.core import listener logger = logging.getLogger(__name__) # TODO: split mixing out from playback? class PlaybackController(object): pykka_traversable = True def __init__(self, mixer, ...
# ============================================================================= # Copyright (c) 2016, Cisco Systems, 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 sour...
# Copyright 2018 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/env python # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # # pylint: disable=invalid-name,missing-docstring """ Eliminate sur...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2015 Kitware 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 cop...
#!/usr/bin/python import subprocess import os import json import pytest import uuid import time import sys import threading import shutil from convoy import VolumeManager TEST_ROOT = "/tmp/convoy_test/" CFG_ROOT = os.path.join(TEST_ROOT, "convoy") PID_FILE = os.path.join(TEST_ROOT, "convoy.pid") LOG_FILE= os.path.jo...
from core import C from basic import Basic from singleton import S from operations import AssocOp from cache import cacheit from expr import Expr class Add(AssocOp): __slots__ = [] is_Add = True #identity = S.Zero # cyclic import, so defined in numbers.py @classmethod def flatten(cls, seq):...
# Copyright 2018 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 applicab...
# Copyright 2018 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 django.conf.urls import include, url from . import views from .models import (NrsimhaTile, GoldenBrick, GuruParamparaBrick, RadhaMadhavaBrick, SilverCoin, GadadharCoin, AdvaitaCoin, GoldCoin, PlatinumCoin, RadharaniCoin, Square...
import logging from collections import defaultdict import ailment from .. import Analysis from ..calling_convention import CallingConventionAnalysis from ..code_location import CodeLocation from ..forward_analysis import ForwardAnalysis, FunctionGraphVisitor from ...engines.light import SpOffset, SimEngineLightVEX, ...
""" Internal tasks are tasks that are started from the teuthology infrastructure. Note that there is no corresponding task defined for this module. All of the calls are made from other modules, most notably teuthology/run.py """ import contextlib import functools import gzip import logging import os import shutil impo...
############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
"""Miscellaneous goodies for psycopg2 This module is a generic place used to hold little helper functions and classes until a better place in the distribution is found. """ # psycopg/extras.py - miscellaneous extra goodies for psycopg # # Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 is f...
import numpy as np import pytest from pandas import DataFrame, Index, MultiIndex, Series, isna, notna import pandas._testing as tm def test_expanding_corr(series): A = series.dropna() B = (A + np.random.randn(len(A)))[:-5] result = A.expanding().corr(B) rolling_result = A.rolling(window=len(A), min...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from copy import deepcopy from datetime import datetime, timedelta import json import logging import mock import os import shutil import tempfile from c7n import policy, manager from c7n.config import Config from c7n.provider import clouds ...
import logging import re from django.conf import settings from django.contrib.sessions.middleware import SessionMiddleware from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.http.response import HttpResponse from django.utils.translation import ugettext as _ f...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# Copyright (c) 2015-2016, 2018 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2015-2016 Ceridwen <ceridwenv@gmail.com> # Copyright (c) 2018 Bryce Guinta <bryce.paul.guinta@gmail.com> # Copyright (c) 2018 Nick Drozd <nicholasdrozd@gmail.com> # Copyright (c) 2018 Anthony Sottile <asottile@umich.edu> # Licensed un...
""" Test functions for the sparse.linalg.eigen.lobpcg module """ from __future__ import division, print_function, absolute_import import itertools import platform import numpy as np from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose, assert_array_less) import pyt...
# -*- coding: utf-8 -*- # # pymunk documentation build configuration file, created by # sphinx-quickstart on Sun Jun 03 03:50:06 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
# Copyright (c) 2015-2021 Patricio Cubillos and contributors. # mc3 is open-source software under the MIT license (see LICENSE). __all__ = [ 'ROOT', 'ignore_system_exit', 'parray', 'saveascii', 'loadascii', 'savebin', 'loadbin', 'isfile', 'burn', 'default_parnames', ] import os imp...
# $Id: pb.py 120 2008-04-10 17:54:14Z mp $ # # Copyright (c) 2007-2008 ReThought Limited and Peloton Contributors # All Rights Reserved # See LICENSE for details from twisted.internet import reactor from twisted.spread import pb from twisted.internet.error import CannotListenError from peloton.adapters import Abstract...
""" Block device listing ==================== Module for processing output of the ``lsblk`` command. Different information is provided by the ``lsblk`` command depending upon the options. Parsers included here are: LSBlock - Command ``lsblk`` --------------------------- The ``LSBlock`` class parses output of the `...
# 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 # d...
# Copyright 2006-2007 Lukas Lalinsky # Copyright 2005-2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # $Id: asf.py 4153 2007-08-05 07:07:49Z piman $ """Read an...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
"""Contains the ShotGroup base class.""" from collections import deque from mpf.core.device_monitor import DeviceMonitor from mpf.core.events import event_handler from mpf.core.mode import Mode from mpf.core.mode_device import ModeDevice from mpf.core.player import Player @DeviceMonitor("common_state", "rotation_e...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import collections import numbers import string import six import re from six.moves import filter, map, zip from functools import total_ordering from monty....
# -*- coding: utf-8 -*- def test_datapackagejson_parse(testdir, datapackage): """Test loading of datapackage json file""" testdir.makepyfile(""" def test_metadata_fixture(metadata): assert metadata['title'] == 'Children by Family Type' assert metadata['name'] == 'chil...
# Copyright 2019 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import unittest from kraken.core.maths.vec3 import Vec3 class TestVec3(unittest.TestCase): def testString(self): vec = Vec3() self.assertEquals(str(vec), "Vec3(0.0, 0.0, 0.0)") def testGetPropertyValues(self): vec = Vec3(0.0, 1.0, 2.0) self.asser...
import json import requests from .Exceptions import * from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) class admin(object): """Administrative functions""" def _login(self): """ Obtain a token from the se...
#!/usr/bin/env python2.7 # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
import sys import unittest import io import atexit import os from test import support from test.support import script_helper ### helpers def h1(): print("h1") def h2(): print("h2") def h3(): print("h3") def h4(*args, **kwargs): print("h4", args, kwargs) def raise1(): raise TypeError def raise2...
""" This script contains code to create the img() and ds005() classes, which will automatically complete all the grunt work required for a set of data before statistical analyses can be performed on it. Future Python scripts can take advantage of the img() and ds005() classes by including the command sys.path.appen...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.internal.results import page_test_results from telemetry.page import page as page_module from telemetry.web_perf.metrics impo...
#!/usr/bin/python3 import subprocess, os, json import imagemgr import network from log import logger import env from lvmtool import sys_run, check_volume from monitor import Container_Collector, History_Manager import lxc class Container(object): def __init__(self, addr, etcdclient): self.addr = addr ...
import numpy as np from scipy.interpolate import pchip, Akima1DInterpolator from scipy.linalg import norm from openmdao.main.api import Component, Assembly from openmdao.lib.datatypes.api import Instance, Array, VarTree, Enum, Int, List, Str, Float, Bool from fusedwind.lib.distfunc import distfunc from fusedwind.lib....
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Copyright (c) 2015, Aaron Karper <maergil@gmail.com> from __future__ import print_function import random import os import functools import itertools import sys from pprint import pprint class Arbitrary(object): """Environment for the running of randomized tests. """ def genOrMake(self, f): if...
from PIL import Image from hotspotter.other.AbstractPrintable import AbstractDataManager from hotspotter.other.logger import logmsg, logdbg, logerr, logio, logwarn import numpy as np import os.path import pylab import re import types import hotspotter.ChipFunctions # Chip Manager handle the chips # this entails mana...
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from __future__ import annotations import cmath import numpy as np import psutil import ray import scipy.special as ssp from pymwm.utils import cylinder_utils from pymwm.waveguide import Database, Sampling, Waveguide from .samples import Samples, SamplesForRay, SamplesLowLoss, SamplesLowLossForRay class Cylinder(...
import sys sys.path.append('/Users/natj/projects/arcmancer/lib/') import pyarcmancer as pyac from img import Imgplane from visualize_polar import Visualize from lineprofile import * import units import numpy as np import matplotlib as mpl from pylab import * import os from matplotlib import cm import scipy.interpol...
"""Set of plots""" # pylint: disable=invalid-name,too-many-arguments,too-few-public-methods import datetime import logging import math from abc import ABC from typing import Optional, Sequence, Tuple import matplotlib import matplotlib.pyplot as plt import numpy as np import numpy.typing as npt from matplotlib.back...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.orm import backref from flask.ext.presst import ModelResource, fields, PolymorphicModelResource, Relationship from tests import PresstTestCase class TestModelResource(PresstTestCase): def setUp(self): super(TestModelResource, self).setUp() ...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """The spm module provides basic functions for interfacing with SPM tools.""" from nipype.interfaces.traits import Directory __docformat__ = 'restructuredtext' # Standard library imports import os from ...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # Dependencies import numpy as np # Project from astropy import units as u from astropy.utils import OrderedDescriptor, ShapedLikeNDArray __all__ = ['Attribute', 'TimeAttribute', 'QuantityAttribute', 'EarthLocationAtt...
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime import operator import nose from numpy import nan, random import numpy as np from pandas.compat import lrange from pandas import compat from pandas import (DataFrame, Series, MultiIndex, Timestamp, date_...
""" Test cases for the various commandline utilities. """ import unittest import tempfile import io import os from unittest.mock import patch from ppci.cli.asm import asm from ppci.cli.build import build from ppci.cli.c3c import c3c from ppci.cli.cc import cc from ppci.cli.hexdump import hexdump from ppci.cli.java im...
""" pydevd_vars deals with variables: resolution/conversion to XML. """ from pydevd_constants import * #@UnusedWildImport from types import * #@UnusedWildImport try: from StringIO import StringIO except ImportError: from io import StringIO import sys #@Reimport try: from urllib import quote except: ...
from __future__ import unicode_literals import boto import sure # noqa from nose.tools import assert_raises, assert_equals, assert_not_equals from boto.exception import BotoServerError import base64 from moto import mock_iam from nose.tools import raises @mock_iam() def test_get_all_server_certs(): conn = boto....
# -*- coding: utf-8 -*- """Calendar is a dictionary like Python object that can render itself as VCAL files according to rfc2445. These are the defined components. """ from datetime import datetime from icalendar.caselessdict import CaselessDict from icalendar.parser import Contentline from icalendar.parser import Con...
import asyncio import collections import io import json import ssl import sys import traceback import warnings from collections import namedtuple from hashlib import md5, sha1, sha256 from http.cookies import CookieError, Morsel, SimpleCookie from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictPro...
import time def weightprice(ok,hk,lk,ck,one,add=0): return add+(ok*one['o']+hk*one['h']+lk*one['l']+ck*one['c'])/(ok+hk+lk+ck) funcs = { 'wprice':weightprice, } class SVG: height = 400.0 # 400.0 block = 10 # 8 width = 6 # 6 half = 3 ...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# Copyright 2013, 2014 IBM Corp. # mock module import mock import sys import stubout import unittest sys.modules['powervc.common.client'] = mock.MagicMock() # import _ from oslo import i18n i18n.install('cinder') from powervc.common import config from cinder import exception from cinder import db from powervc.volume.d...
#!/usr/bin/env python # 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. """Wrapper script to help run clang tools across Chromium code. How to use this tool: If you want to run the tool across all Chrom...