gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from testify import *
import datetime
import pytz
from dmc import (
Time,
TimeInterval,
TimeSpan,
TimeIterator,
TimeSpanIterator)
class InitTimeTestCase(TestCase):
def test_direct(self):
d = Time(2014, 4, 18, 17, 50, 21)
assert_equal(d.year, 2014)
assert_equal(d.month... | |
"""
The Saltelli method
Code is built upon the code provided by Vinzenze Eck.
"""
import numpy
import numpoly
import chaospy
class Saltelli(object):
"""
Buffer class to be able to retrieve Saltelli matrices.
The core of the method relies on cross-combining the columns of two random
matrices as part ... | |
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2020 Intel Corporation
#
# 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-... | |
# This is a set of Python modules that shouldn't be unloaded during hot reload.
SAFE_MODULES = {
"__future__",
"__main__",
"_abc",
"_asyncio",
"_bisect",
"_blake2",
"_bootlocale",
"_bz2",
"_cares",
"_cares.lib",
"_cffi_backend",
"_codecs",
"_collections",
"_colle... | |
# encoding: utf-8
"""An object for managing IPython profile directories."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import shutil
import errno
from traitlets.config.configurable import LoggingConfigurable
from IPython.paths import get_ipython_pac... | |
#!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
from mystic.constraints impo... | |
# -*- coding: utf-8 -*-
"""The EXT file entry implementation."""
from dfdatetime import posix_time as dfdatetime_posix_time
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.path import ext_path_spec
from dfvfs.vfs import attribute
from dfvfs.vfs import ext_attribute
from dfvfs.vfs import ext_... | |
# 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 (c) 2015 GigaSpaces Technologies Ltd. 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... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from django.conf import settings
from django.test import TestCase
import os
import shutil
import ujson
from mock import patch, MagicMock
from six.moves import range
from typing import Any
from zerver.lib.actions imp... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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 requ... | |
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import
import sys
import os
import json
import click
import hashlib
import cProfile
import StringIO
import pstats
import frappe
import frappe.utils
from frappe.utils ... | |
#=======================================================================
# cpp_helpers.py
#=======================================================================
from __future__ import print_function
from pymtl import *
from ...model.signal_lists import PortList
from cffi import FFI
#... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# Test numpy bindings
import numpy as np
from .. import (c_types, fff_type, npy_type, copy_vector, pass_matrix,
pass_vector, pass_array, pass_vector_via_iterator,
sum_via_i... | |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2017 SML
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy... | |
"""
Test the base classes for managing datasets and tasks.
"""
import os
import pytest
import numpy as np
from dbcollection.datasets import (
BaseDataset,
BaseTask,
BaseField,
BaseColumnField
)
@pytest.fixture()
def test_data():
return {
"data_path": '/path/to/data',
"cache_path... | |
#!/usr/bin/python2.4
#
# Copyright (C) 2009 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... | |
#!/usr/bin/env python
import os
import glob
from optparse import OptionParser
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from rompy import rompy, plot_utils, utils, extract_utils
def surface_map(... | |
"""
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
from __future__ import division, absolute_import, p... | |
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 New Vector Ltd.
#
# 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... | |
# Copyright 2014: Mirantis 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 b... | |
#
# 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... | |
"""Support for interface with a Gree climate systems."""
from datetime import timedelta
import logging
from typing import List
from greeclimate.device import (
FanSpeed,
HorizontalSwing,
Mode,
TemperatureUnits,
VerticalSwing,
)
from greeclimate.exceptions import DeviceTimeoutError
from homeassista... | |
# coding: utf-8
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
import iso8601
import datetime
import itertools
import re
from m3u8 import protocol
'''
http://tools.ietf.org/html/draft-pantos-http-l... | |
# Copyright 2016 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
from __future__ import absolute_import
from builtins import object
from proteus import *
from proteus.default_p import *
from math import *
try:
from .vortex2D import *
except:
from vortex2D import *
from proteus.mprans import NCLS
#import Profiling
LevelModelType = NCLS.LevelModel
logEvent = Profiling.lo... | |
import random
import re
from sets import Set
from background_hang_reporter_job.categories import categories_p1, categories_p2
# For now we want like deterministic results, to aid debugging
random.seed(0)
def to_struct_of_arrays(a):
if len(a) == 0:
raise Exception('Need at least one item in array for this... | |
# 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... | |
import warnings
from distutils.version import LooseVersion
from typing import TYPE_CHECKING
import requests
import six
from pyramid.authentication import IAuthenticationPolicy
from pyramid.httpexceptions import (
HTTPBadRequest,
HTTPException,
HTTPForbidden,
HTTPOk,
HTTPServiceUnavailable,
HTTP... | |
"""Transformers
This module contains transformers for preprocessing data. Most operate on DataFrames and are named appropriately.
"""
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin
from imblearn.over_sampling import RandomOverSampler
from imblearn.under_sampling import RandomUnderSam... | |
# Copyright 2017 The Kubernetes 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 or agreed to ... | |
from Adafruit_I2C import Adafruit_I2C
import time
import math
Oled = Adafruit_I2C(0x3c)
Command_Mode=0x80
Data_mode=0x40
grayH= 0xF0
grayL= 0x0F
Normal_Display_Cmd=0xA4
BasicFont = [[0 for x in xrange(8)] for x in xrange(10)]
BasicFont=[[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00],
[0x00,0x00,0x5F,0x00,0x00,0x00,0x... | |
# Copyright 2016 Stephen Shirley
#
# 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 writi... | |
# This Python module is part of the PyRate software package.
#
# Copyright 2022 Geoscience Australia
#
# 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/... | |
from __future__ import unicode_literals
from moto.core.exceptions import RESTError
from moto.core.utils import amzn_request_id
from moto.core.responses import BaseResponse
from .models import elbv2_backends
from .exceptions import DuplicateTagKeysError
from .exceptions import LoadBalancerNotFoundError
from .exceptions ... | |
"""Support for Vallox ventilation units."""
import ipaddress
import logging
from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox
from vallox_websocket_api.constants import vlxDevConstants
from vallox_websocket_api.exceptions import ValloxApiException
import voluptuous as vol
from homeassistant.const im... | |
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from collections import OrderedDict
import os
import re
import shutil
import signal
import time
import traceback
import flask
import gevent
import gevent.event
import gevent.queue
from . import utils
from .con... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
import pytest
import mock
import random
from framework.auth.core import Auth
from api.base.settings.defaults import API_BASE
from api.draft_registrations.serializers import DraftRegistrationContributorsCreateSerializer
from api_tests.nodes.views.test_node_contributors_list import (
NodeCRUDTestCase,
TestNodeCo... | |
"""Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# Giorgio Patrini
# Thierry Guillemot
# License: BSD 3 clause
import os
import inspect
import p... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import abspath, join, dirname
from pymongo import Conn... | |
#!/usr/bin/env python2
#
# 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 "L... | |
"""
this file does variant calling for DNAseq
"""
#============= import required packages =================
import os
import sys,subprocess
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) # disable buffer so that in the log file all information is printed in order.
from Modules.f00_Message import Message
from Mod... | |
# -*- coding: utf-8 -*-
'''
Remote package support using ``pkg_add(1)``
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-ov... | |
# 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 applicab... | |
# Copyright (c) 2008-2011 by Enthought, Inc.
# Copyright (c) 2013-2017 Continuum Analytics, Inc.
# All rights reserved.
from __future__ import absolute_import, unicode_literals
import ctypes
import logging
import os
from os.path import isdir, join, exists
import pywintypes
import sys
import locale
from .utils impor... | |
# -*- 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""
An example of implemnting a search for the nearest item.
This example requires the "restpose" and "flask" python modules to be
installed.
... | |
# epydoc -- Introspection
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: docintrospecter.py 1678 2008-01-29 17:21:29Z edloper $
"""
Extract API documentation about python objects by directly introspecting
their values.
The function L{introspect_do... | |
""" Test the file recognizer capabilities.
"""
import gzip
import os
import shutil
import socket
import sys
import nose
from grin import FileRecognizer
def empty_file(filename, open=open):
f = open(filename, 'wb')
f.close()
def binary_file(filename, open=open):
f = open(filename, 'wb')
f.write(''.j... | |
import calendar
from django.test import TestCase
from ..serializer import ProjectFormSerializer, DataSerializer
from geokey.categories.tests.model_factories import (
TextFieldFactory, NumericFieldFactory, DateFieldFactory, TimeFieldFactory,
LookupFieldFactory, LookupValueFactory, DateTimeFieldFactory,
Mult... | |
#!/usr/bin/python2.4
#
# Copyright (C) 2009 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... | |
# Copyright 2016 Arie Bregman
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# Copyright 2019 The Magenta 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 or agreed to in ... | |
"""Short messaging system.
"""
__docformat__ = 'restructuredtext en'
from .utils import *
class SmsMessage(Cached):
"""Represents an SMS message.
"""
_ValidateHandle = int
def __repr__(self):
return Cached.__repr__(self, 'Id')
def _Alter(self, AlterName, Args=None):
return self... | |
"""
Support for WeMo switches.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.wemo/
"""
import asyncio
import logging
from datetime import datetime, timedelta
import requests
import async_timeout
from homeassistant.components.switch import Swit... | |
# 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 ... | |
"""Directory based queue.
A port of Perl module Directory::Queue
http://search.cpan.org/~lcons/Directory-Queue/
The documentation from Directory::Queue module was adapted for Python.
The goal of this module is to offer a simple queue system using the
underlying filesystem for storage, security and to prevent race
con... | |
import django_filters
from django_filters.widgets import BooleanWidget
from waldur_core.core import filters as core_filters
from waldur_core.structure import filters as structure_filters
from waldur_openstack.openstack_tenant.utils import get_valid_availability_zones
from . import models
class FlavorFilter(structur... | |
from __future__ import absolute_import, unicode_literals
__version__ = '0.39'
__license__ = 'MIT'
import re
import os
import sys
import time
import logging
import marshal
import tempfile
import threading
from math import log
from hashlib import md5
from ._compat import *
from . import finalseg
if os.name == 'nt':
... | |
# 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 ... | |
# Copyright (c) 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in section and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import (absolute_import, division... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | |
"""
Base class for item similarity recommenders.
"""
import numpy as np
from itertools import izip
from operator import itemgetter
from scipy.sparse import csr_matrix
from ..sparse import fast_sparse_matrix
from ..base_recommender import BaseRecommender
class ItemSimilarityRecommender(BaseRecommender):
"""
A... | |
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... | |
# 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 (t... | |
# Created By: Virgil Dupras
# Created On: 2004-12-27
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licens... | |
#!/usr/bin/env python
# Copyright 2012 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
"""Front end tool to operate on .isolate files.
This includes creating, merging or compiling them to generate a .isolat... | |
"""The tests for the pilight component."""
import logging
import unittest
from unittest.mock import patch
import socket
from datetime import timedelta
import pytest
from homeassistant import core as ha
from homeassistant.setup import setup_component
from homeassistant.components import pilight
from homeassistant.util... | |
# 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... | |
"""Generated message classes for cloudresourcemanager version v1beta1.
The Google Cloud Resource Manager API provides methods for creating, reading,
and updating project metadata.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from googlecloudsdk.third_party.apitools.base.protorpclite import... | |
# =============================================================================
# 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... | |
from django.db import models
from django.forms import ModelForm
from django.conf.global_settings import LANGUAGES
from django.contrib.auth.models import User
class CreatedUpdatedModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
class Meta:
abs... | |
### Author: yela @cyela4t
### Description: Gravity makes squares falling down. Try to erase the colorful evil squares before it is too late!
### Category: Game
### License: MIT
### Appname : SQUARE WITH GRAVITY
## https://github.com/annaeg/square-with-gravity
import ugfx
import pyb
import buttons
# IMU is the Inerti... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from pyvows import Vows, expect
from thumbor.config import Config
... | |
from string import Template
from gettext import gettext as _
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import models
from cyder.base.utils import transaction_atomic
from cyder.core.ctnr.models import Ctnr
from cyder.cydhcp.interface.static_intr.models import StaticInterface... | |
import os.path, time
import win32com.client
class ExcelConstant:
xlAutomatic = -4105
#Direction
xlToRight = -4161
#Alignment
xlLeft = -4131
xlRight = -4152
#Border
xlDiagonalDown = 5
xlDiagonalUp = 6
xlEdgeBottom = 9
xlEdgeLeft = 7
xlEdgeRight = 10
xlE... | |
import oomlout_SVGG as oomSVG
details = list()
parts = list()
def oompAddDetail(category,code,name,sort="",extra1="",extra2=""):
details.append(oompDetail(category,code,name,sort,extra1="",extra2=""))
def getDetailFromCode(category,code):
for x in details:
if x.category == category:
i... | |
"""audio_read reads in a whole audio file with resampling."""
# Equivalent to:
#import librosa
#def audio_read(filename, sr=11025, channels=1):
# """Read a soundfile, return (d, sr)."""
# d, sr = librosa.load(filename, sr=sr, mono=(channels == 1))
# return d, sr
# The code below is adapted from:
# https://gi... | |
import copy
import quantities as pq
import scipy as sp
import scipy.signal
import scipy.special
import tools
default_kernel_area_fraction = 0.99999
class Kernel(object):
""" Base class for kernels. """
def __init__(self, kernel_size, normalize):
"""
:param kernel_size: Parameter controlling... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import with_statement
import json
import os
import platform
import locale
from re import sub
from .const import IS_PY2
from .const import PLUGIN_NAME
from .const import PRETTIER_CONFIG_FILES
from .co... | |
# 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 ... | |
################################################################################
# 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... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Eldar Nugaev
# 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://... | |
# 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 (t... | |
#!/usr/bin/env python
"""
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");... | |
# stdlib
import os
import re
import requests
import time
import socket
import urllib2
from collections import defaultdict, Counter, deque
# project
from checks import AgentCheck
from config import _is_affirmative
from utils.dockerutil import find_cgroup, find_cgroup_filename_pattern, get_client, MountException, \
... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import glob
import o... | |
# Copyright 2012 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 requ... | |
# Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Glenn Gobeli. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2015 Alex Meade. All rights reserved.
#
# Licensed under the Apache Li... | |
from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase
class FrozensetTests(TranspileTestCase):
pass
class UnaryFrozensetOperationTests(UnaryOperationTestCase, TranspileTestCase):
data_type = 'frozenset'
not_implemented = [
'test_unary_... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import json
import platform
import subprocess
import logging
from time import sleep
import invoke
from invoke import Collection
from we... | |
import ast
from sys import version_info
from pyflakes import messages as m, checker
from pyflakes.test.harness import TestCase, skipIf, skip
class Test(TestCase):
def test_undefined(self):
self.flakes('bar', m.UndefinedName)
def test_definedInListComp(self):
self.flakes('[a for a in range(10... | |
# Copyright 2022 The Magenta 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 or agreed to in ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
import sys
import sysconfig
import os
import re
import errno
import shlex
import shutil
import subprocess
import itertools
import concurrent.futures
from site import USER_SITE
from glob import iglob
from collections import namedtuple, deque
from xml.sax.saxutils import escape
from distutils import version
from email.p... | |
from __future__ import annotations
from statsmodels.compat.pandas import (
is_float_index,
is_int_index,
is_numeric_dtype,
)
import numbers
import warnings
import numpy as np
from pandas import (
DatetimeIndex,
Index,
Period,
PeriodIndex,
RangeIndex,
Series,
Timestamp,
dat... | |
"""Utilities for drawing random numbers."""
import contextlib
import numpy as np
import zlib
from caput import config
from ..core import task
_rng = None
_default_bitgen = np.random.SFC64
def default_rng():
"""Returns an instance of the default random number generator to use.
This creates a randomly see... | |
"""Test Axis config flow."""
from unittest.mock import Mock, patch
from homeassistant.components import axis
from homeassistant.components.axis import config_flow
from tests.common import MockConfigEntry, mock_coro
async def test_configured_devices(hass):
"""Test that configured devices works as expected."""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.