gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python3 #SenseHatLogger. Author: kurtd5105 from sense_hat import SenseHat import argparse import sys import time from datetime import datetime from datetime import timedelta from itertools import product #Create a dictionary for the representation of the numbers in a pixel array numbers = { "0": ...
from django.shortcuts import render_to_response from django.core import serializers from django.http import HttpResponse from django.template import RequestContext from django.core.urlresolvers import reverse from django.conf import settings from django import forms from django.db.models import Avg, Max, Min, Count fro...
from __future__ import absolute_import from datafs.services.service import DataService from datafs.core.data_archive import DataArchive from datafs._compat import open_filelike import hashlib import fnmatch import re import fs.path from fs.osfs import OSFS try: PermissionError except NameError: class Permiss...
import json import pymongo from datadiff.tools import assert_equal from nose.tools import assert_is_none from data_access import ReviewerDao, ReviewDao, MagazineDao from mongo_utils import MongoUtils from my_exceptions import InvalidData from my_mongo_client import MyMongoClientReader class DataAccessTestCase(objec...
# # Copyright (c) 2013-2017 Kevin Steves <[email protected]> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AN...
""" Copyright (c) 2017 SONATA-NFV and Paderborn University 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 ap...
import os import sys import logging import inspect import pandas as pd import numpy as np from sklearn.externals import joblib from drain import util, metrics from drain.step import Step, Call class FitPredict(Step): """ Step which can fit a scikit-learn estimator and make predictions. """ def __in...
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from datetime import datetime from datetime import timedelta import json import unittest from bson.objectid import ObjectId from flask import url_for from flask.ext import testing from flask.ext import pymongo import logcas.bootstrap import db class RequestShowTestCase(testing.TestCase): col = db.logs cont...
#!/usr/bin/env python """ @package ion.services.mi.test.test_port_agent_client @file ion/services/mi/test/test_port_agent_client.py @author David Everett @brief Some unit tests for R2 port agent client """ __author__ = 'David Everett' __license__ = 'Apache 2.0' # Ensure the test class is monkey patched for gevent fr...
import datetime import json import requests import sys import csv import os import us from .managers import PriorityDepartmentsManager from django.conf import settings from django.contrib.gis.db import models from django.contrib.gis.geos import Point, MultiPolygon from django.core.validators import MaxValueValidator f...
import sys import pytest import numpy as np from datetime import date import dateutil import pandas as pd import pandas.util.testing as tm from pandas.compat import lrange from pandas import (DatetimeIndex, Index, date_range, DataFrame, Timestamp, offsets) from pandas.util.testing import assert_...
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# -*- coding: utf-8 -*- from functools import partial from json import dumps from logging import getLogger from time import sleep from urllib import quote from rfc6266 import build_header from urlparse import urlparse, parse_qs from base64 import b64encode from cornice.resource import resource from cornice.util import ...
from __future__ import print_function import sys import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import os import time # Options for mode 'lower_level' MODE = 'S-4mu_WigD' label_size = 28 #################################################################################################...
# Copyright (c) 2006-2013 Regents of the University of Minnesota. # For licensing terms, see the file LICENSE. import hashlib from lxml import etree import conf import g from grax.access_level import Access_Level from gwis.query_filters import Query_Filters from item import item_base from item import item_versioned ...
''' Test cases for class AnnotateCommand The construction of the test case are driven by the fact that the target cigar only has three types of regions: M(M_0), D(D_0), and I(I_0). For a region mapped to a target genome, its start and end position will always be in M_0 or I_0, because only M_0 and I_0 have target po...
# Copyright 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
# -*- coding: utf-8 -*- """ ====================== Laplacian segmentation ====================== This notebook implements the laplacian segmentation method of `McFee and Ellis, 2014 <http://bmcfee.github.io/papers/ismir2014_spectral.pdf>`_, with a couple of minor stability improvements. Throughout the example, we wil...
# -*- encoding: utf-8 -*- # # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudbase Solutions Srl # 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.ap...
###################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2010, Rice University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions...
"""The tests for the logbook component.""" # pylint: disable=protected-access,invalid-name import collections from datetime import datetime, timedelta import json from unittest.mock import Mock, patch import pytest import voluptuous as vol from homeassistant.components import logbook, recorder from homeassistant.comp...
# -*- 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...
import urllib import json from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.template import RequestContext from django.forms.util import ErrorLis...
# -*- coding: utf-8 -*- # # Copyright (C) 2014, 2015, 2016 Carlos Jenkins <[email protected]> # # 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...
from merc.actor import Actor from merc.collision import Collision from merc.player import Player from pprint import pprint import sys import json import numpy import itertools from PIL import Image, ImageDraw, ImageColor class Game: NUM_TWEENS = 10 def __init__(self, data): """ `data` should contain the JSON o...
#!/usr/bin/env python3 """ * This file is part of plainRFM69. * Copyright (c) 2014, Ivor Wanders * MIT License, see the LICENSE.md file in the root folder. """ import crcmod from Crypto.Cipher import AES """ This script does some analysis on the packets produced by the RFM69 radio modules. It investiga...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' import xml import tempfile import contextlib import OpenSSL.crypto from xml.sax.saxutils import escape import re ''' GLOBALS/PARAMS ''' FETCH_MAX_INCIDENTS = 500 SECURITY_INCIDENT_NODE_XPATH = ".//Sec...
""" Websocket based API for Home Assistant. For more details about this component, please refer to the documentation at https://home-assistant.io/developers/websocket_api/ """ import asyncio from contextlib import suppress from functools import partial import json import logging from aiohttp import web import voluptu...
"""Durus backend test classes.""" # Copyright (c) 2001-2009 ElevenCraft Inc. # See LICENSE for details. from StringIO import StringIO from schevo import database from schevo.lib import module from durus.file import File _db_cache = { # (backend_args, format, version, evolve_skipped, schema_source, suffix): ...
import unittest from pokemongo_bot.inventory import * class InventoryTest(unittest.TestCase): def test_types(self): td = Types self.assertIs(types_data(), td) self.assertEqual(len(td.STATIC_DATA), 18) self.assertEqual(len(td.all()), 18) for name, s in td.STATIC_DATA.iteri...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import json import os import posixpath from mlflow.entities import FileInfo from mlflow.exceptions import MlflowException from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE from mlflow.store.tracking.rest_store import RestStore from mlflow.store.artifact.artifact_repo import ArtifactRepository from mlflo...
from unittest import TestCase, main import datetime import pandas as pd import numpy as np import numpy.testing as npt import pandas.util.testing as pdt from break4w.question import (Question, _check_cmap ) class QuestionTest(TestCase): def setUp(sel...
from ethereum import utils from ethereum.abi import is_numeric import copy from ethereum import opcodes import time from ethereum.slogging import get_logger from rlp.utils import encode_hex, ascii_chr from ethereum.utils import to_string, safe_ord log_log = get_logger('eth.vm.log') log_vm_exit = get_logger('eth.vm.exi...
# 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. """This module classifies NativeHeap objects filtering their allocations. The only filter currently available is 'stacktrace', which works as follows: {'na...
# coding: utf-8 from __future__ import unicode_literals import itertools import json from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, compat_urlparse, ) from ..utils import ( clean_html, ExtractorError, int_or_none, parse_age_limit, parse_duration,...
"""Test losses""" import datetime import numpy as np import pandas as pd from .conftest import assert_series_equal from pvlib.soiling import hsu, kimber from pvlib.iotools import read_tmy3 from .conftest import DATA_DIR import pytest @pytest.fixture def expected_output(): # Sample output (calculated manually) ...
"""Support for interacting with Spotify Connect.""" from asyncio import run_coroutine_threadsafe import datetime as dt from datetime import timedelta import logging from typing import Any, Callable, Dict, List, Optional from aiohttp import ClientError from spotipy import Spotify, SpotifyException from yarl import URL ...
import binascii import _dynStruct import capstone unsigned_int_instr = [capstone.x86.X86_INS_ADCX, capstone.x86.X86_INS_ADOX, capstone.x86.X86_INS_DIV, capstone.x86.X86_INS_MUL, capstone.x86.X86_INS_MULX] xmm_regs = [xmm for xmm in range(capstone.x86.X86_REG_XMM0 - 1, capst...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import sys from .yugen_core import list_api_keys, get_lambdas, delete_api, \ export_to_swagger, create_api_key, list_apis, \ deploy_custom_domain, delete_api_key, deploy_api from . import utils from .gcdt_cmd_...
# Copyright (c) 2012 Citrix Systems, Inc. # Copyright 2010 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...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import datetime import ipaddress from email.utils import parseaddr impo...
''' This module provides the class PIDClientCredentials which handles the credentials for Handle server Interaction and for the Search Servlet. Author: Merret Buurman (DKRZ), 2015-2016 ''' import json import os import logging import pyhandle from pyhandle.handleexceptions import CredentialsFormatError, HandleSynta...
#!/usr/bin/env python # cardinal_pythonlib/typing_helpers.py """ =============================================================================== Original code copyright (C) 2009-2021 Rudolf Cardinal ([email protected]). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2...
import weakref import six import itertools from contextlib import contextmanager from functools import partial _MAPPING = {"&" : "&amp;", "'" : "&apos;", '"' : "&quot;", "<" : "&lt;", ">" : "&gt;"} def xml_escape(text): if text is None: return "" return "".join(_MAPPING.get(ch, ch) for ch in str(text)...
__author__ = 'minhtule' from exception import ValidateException from utility import * import types import re import urllib import random import sys REGEX_OBJECT_TYPE = type(re.compile("")) class Parameter(object): """Parameter of http request specified by Google Analytics Details at https://developers.goog...
# Copyright 2012 by Eric Talevich. All rights reserved. # This code is part of the Biopython distribution and governed by its license. # Please see the LICENSE file that should have been included as part of this # package. """Command-line wrapper for the tree inference program RAxML. Derived from the help page for RA...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright (c) 2015, Battelle Memorial Institute # 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. Redistr...
from __future__ import unicode_literals import boto import boto3 from boto.exception import SQSError from boto.sqs.message import RawMessage, Message import requests import sure # noqa import time from moto import mock_sqs from tests.helpers import requires_boto_gte @mock_sqs def test_create_queue(): conn = bo...
# 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...
#!/usr/bin/env python # Standard library imports import argparse import datetime import gzip import json import logging import os import pickle import sys from collections import OrderedDict from functools import partial from itertools import count, groupby from urllib.request import Request, urlopen # External impor...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CopyContract.check_result_info' db.add_column(u'build_cop...
""" A cmdset holds a set of commands available to the object or to other objects near it. All the commands a player can give (look, @create etc) are stored as the default cmdset on the player object and managed using the CmdHandler object (see cmdhandler.py). The power of having command sets in CmdSets like this is th...
"""Test :mod:`letsencrypt.display.util`.""" import os import unittest import mock from letsencrypt.display import util as display_util class DisplayT(unittest.TestCase): """Base class for both utility classes.""" # pylint: disable=too-few-public-methods def setUp(self): self.choices = [("First",...
import tornado.web import tornado.escape import os import logging import tempfile import tornado.locale import auth import datetime import hashlib import re from database import KeySearchTimeout LOGGER = logging.getLogger("tornado.application") SUBMISSION_ERROR_OK = 0 SUBMISSION_ERROR_FILE_COUNT...
#!/usr/bin/env python # # 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) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
import json import keyword import textwrap import re prologue_template = """ # XXX This code file has been automatically generated. Do not edit it. from .base import Resource, register_resource __all__ = [] """ def generate_prologue(): print(prologue_template) first_cap_re = re.compile('(.)([A-Z][a-z]+)') all_...
"""Curve Interpolators""" from __future__ import absolute_import, division, print_function import numpy as np from scipy.interpolate import PPoly, CubicSpline, interp1d from scipy.linalg import solve_banded, solve from numpy import repeat, prod, arange from numpy.matlib import repmat from six import string_types cl...
""" Atomic data. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from collections import defaultdict from astropy.table import Table from astropy.units import angstrom, s, Quantity import numpy as np import os __all__ = ['Ar', 'Transition', 'AtomDa...
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
"""Test all functions related to the basic accessory implementation. This includes tests for all mock object types. """ from unittest.mock import Mock, patch import pytest from homeassistant.components.homekit.accessories import ( HomeAccessory, HomeBridge, HomeDriver, ) from homeassistant.components.hom...
# -*- coding: utf-8 -*- """ """ from collections import OrderedDict import os import subprocess import librosa import numpy as np import pandas as pd import sklearn as sk import sklearn.model_selection import skimage as skim import skimage.measure import skimage.morphology import skimage.restoration from tqdm import...
from luigi import IntParameter from xlrd import open_workbook from xlrd.xldate import xldate_as_tuple from lib.timespan import get_timespan from tasks.base_tasks import ColumnsTask, TableTask, TempTableTask, RepoFileUnzipTask from tasks.util import shell from tasks.meta import current_session, OBSColumn from collectio...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_datafs ---------------------------------- Tests for `datafs` module. """ from __future__ import absolute_import import pytest from datafs._compat import u from tests.resources import prep_manager import os import tempfile import hashlib import random from six...
"""HTML utilities suitable for global use.""" from __future__ import unicode_literals import re import warnings from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_str, force_text from django.utils.functional import allow_lazy from django...
r"""Functions for nuclear and neutron beta decay effective couplings and $Ft$ values.""" from math import pi, log, sqrt import flavio from flavio.config import config from flavio.physics.betadecays.common import wc_eff from flavio.physics.ckm import get_ckm from flavio.physics.taudecays.taulnunu import GFeff from fla...
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import unittest from stix.test import EntityTestCase, assert_warnings from stix.utils import silence_warnings from stix.common.related import ( RelatedCampaign, RelatedCampaignRef, RelatedIdentity, RelatedCOA,...
# -*- coding: utf8 -*- # # 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...
# Copyright 2016 The Eyra 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 applicable la...
#!/usr/bin/env python """Bootstrap setuptools installation To use setuptools in your package's setup.py, include this file in the same directory and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() To require a specific version of setuptools, set a download mirror, ...
#pylint: disable=line-too-long,too-many-public-methods,invalid-name #pylint: disable=missing-docstring,protected-access,too-few-public-methods #pylint: disable=too-many-arguments,too-many-instance-attributes from __future__ import print_function, absolute_import, division from argparse import Namespace from collection...
#!/usr/bin/python2.5 # Copyright (C) 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
""" NonPhysicsWalker.py is for avatars. A walker control such as this one provides: - creation of the collision nodes - handling the keyboard and mouse input for avatar movement - moving the avatar it does not: - play sounds - play animations although it does send messeges that allow a listener t...
from fsdict import FSDict import feedgenerator from urllib import quote_plus import os.path from feeddirectives import Latest from feednodes import latest from sphinx.addnodes import toctree from docutils import nodes #global feed_entries = None #constant unlikely to occur in a docname and legal as a filename MAGIC_...
# Copyright 2020 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 cgi import random import shlex import string import logging import pymongo from pylons import c, g, request from . import helpers as h from . import security log = logging.getLogger(__name__) _macros = {} class macro(object): def __init__(self, context=None): self._context = context def __c...
import re import os import sys import types from copy import copy from distutils.ccompiler import * from distutils import ccompiler from distutils.errors import DistutilsExecError, DistutilsModuleError, \ DistutilsPlatformError from distutils.sysconfig import customize_compiler from distut...
# Copyright 2013 Cloudbase Solutions Srl # # 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 unittest from meerkat_abacus import model from meerkat_abacus.codes.variable import Variable positive = { "applicable": 1, "value": 1 } negative = { "applicable": 0, "value": 0 } class VariableTest(unittest.TestCase): """ Tests to check that Variables class gives the correct...
from pymutils.process import Process import pymutils.verifier as verifier from optparse import OptionParser import pymutils.http_service as http_service from pymutils.debug import verbose, debug, log import collections import os import json import inspect import signal import sys import time from pymutils.global_storag...
import re import sys from numbers import Number import six ERRORS = { 'unexp_end_string': u'Unexpected end of string while parsing Lua string.', 'unexp_end_table': u'Unexpected end of table while parsing Lua string.', 'mfnumber_minus': u'Malformed number (no digits after initial minus).', 'mfnumber_de...
#!/usr/bin/env python3 """Standalone utility functions for Mininet tests.""" import collections import os import socket import subprocess import time # pylint: disable=import-error from mininet.log import error, output DEVNULL = open(os.devnull, 'wb', encoding=None) # pylint: disable=consider-using-with GETPORT =...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import datetime from frappe import _ import frappe import frappe.database import frappe.utils import frappe.utils.user from frappe import conf from frappe.sessions import Session...
import datetime from exchangelib.errors import ErrorInvalidOperation, ErrorItemNotFound, ErrorMissingInformationReferenceItemId from exchangelib.ewsdatetime import UTC from exchangelib.fields import MONDAY, NOVEMBER, THIRD, WEDNESDAY, WEEK_DAY, WEEKEND_DAY from exchangelib.folders import Calendar from exchangelib.item...
'''created by Yuriy Sivalnev. Its free!!! Totally...i mean it''' ''' ---------------------------------------------------------------------------------------- INSTALLATION: put in is scripts folder(C:\Users\__SOME_NAME__\Documents\maya\2015-x64\scripts) ---------------------------------------------------------...
from __future__ import absolute_import, division, print_function import pytest pytest.importorskip('numpy') import dask.array as da from dask.core import get_deps from dask.context import set_options import numpy as np # temporary until numpy functions migrated try: from numpy import nanprod except ImportError: ...
""" Field classes. """ from __future__ import absolute_import, unicode_literals import copy import datetime import os import re import urlparse from decimal import Decimal, DecimalException from io import BytesIO from django.core import validators from django.core.exceptions import ValidationError from django.forms....
# -*- test-case-name: twisted.internet.test.test_gtk2reactor -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides support for Twisted to interact with the glib/gtk2 mainloop. In order to use this support, simply do the following:: | from twisted.interne...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides a base class for tensor-like objects and methods for basic tensor manipulation. It also provides a class, SquareTensor, that provides basic methods for creating and manipulating rank 2...
#!/usr/bin/python # -*- coding: utf-8 -*- r""" This script runs commands on each entry in the API caches. Syntax: cache.py [-password] [-delete] [-c '...'] [dir ...] If no directory are specified, it will detect the API caches. If no command is specified, it will print the filename of all entries. If only -delete i...
# -*- coding: utf-8 -*- # Copyright: 2011, Grigoriy Petukhov # Author: Grigoriy Petukhov (http://lorien.name) # License: BSD """ The core of grab package: the Grab class. """ import logging import os from random import randint from copy import copy, deepcopy import threading import itertools import collections try: ...
## # Copyright (c) 2011-2015 Apple 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 l...
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
# 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 compliance with the License. You may obtain # a ...
import pandas as pd import numpy as np import pytest # noqa: F401 import calliope from calliope import exceptions from calliope.time import funcs, masks from calliope.test.common.util import ( build_test_model, check_error_or_warning, python36_or_higher, ) class TestClustering: @pytest.fixture d...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding M2M table for field region on 'Location' db.create_table(u'main_location_region', ( ('i...