gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 10/3/13
###Purpose: visualize results of time-based epidemic simulations when aligned by epidemic time, which is defined as aligning tsteps at which simulation attained 5% of cumulative infections duri... | |
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
# builtin
import os
import itertools
import collections
import functools
import StringIO
# external
import xlrd
from lxml import etree
# internal
from sdv import errors, utils, xmlconst
# relative
from . import c... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# BSD 3-Clause License
#
# Copyright (c) 2012, the Sentry Team, see AUTHORS for more details
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Red... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# kate: space-indent on; indent-width 4; mixedindent off; indent-mode python;
from __future__ import print_function
import sys
import os.path
from arsoft.trac.plugins.commitupdater import *
import trac.env
import time, unittest
from trac import perm
from trac.util.datefmt imp... | |
#!/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... | |
#from out2_sup import *
import out2_sup as model_
rootObj = model_.rootTag(
comments=[
model_.comments(
content_ = [
model_.MixedContainer(1, 0, "", "1. This is a "),
model_.MixedContainer(2, 2, "emp", "foolish"),
model_.MixedContainer(1, 0, "", " comment. ... | |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Benjamin Kampmann <ben.kampmann@googlemail.com>
"""
This is a Media Backend that allows you to access the Trailers from Apple.com
"""
from coherence.backend import BackendItem, BackendStore
fr... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import unittest, json, sys
import xmlrunner
import importlib
from frappe.modules import load_doctype_module, get_module_name
from frappe.utils import cstr
import fr... | |
from invoke import task
import glob
import os
import json
import webbrowser
import requests
import re
import subprocess
import datetime
from monty.os import cd
from pymatgen import __version__ as CURRENT_VER
NEW_VER = datetime.datetime.today().strftime("%Y.%-m.%-d")
"""
Deployment file to facilitate releases of pym... | |
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# import matplotlib.finance as mf
from matplotlib.widgets import MultiCursor
import statsmodels.tsa.stattools as stt
# import scipy.signal as sgn
import statsmodels.api as sm
# from statsmodels.sandbox.regression.predstd import... | |
from __future__ import print_function
import os
import time
import numpy as np
import theano
import theano.tensor as T
import lasagne
import matplotlib.pyplot as plt
from tqdm import tqdm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from lasagne.layers import InputLayer, Conv2DLayer, Pool2DLayer
from lasag... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=u... | |
"""
wind.driver
~~~~~~~~~~~
Drivers for io multiplexing.
"""
import select
from itertools import chain
from wind.exceptions import PollError, WindException
def pick():
"""Pick best event driver depending on OS.
`Select`, `Poll` are available in most OS.
`Epoll` is available on Linux 2.5.44... | |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import gdal
from skimage import filter
import numpy as np
from numpy.lib.function_base import histogram
import skimage
def CalMI(a,b):
"""
Calculate the MI
"""
reference = np.array(a)
query = np.array(b)
L=256
miMat = np.zeros((L,L))
... | |
from django.forms.fields import BooleanField
from django.test.client import RequestFactory
from django.utils.safestring import SafeText
from django.utils.translation import ugettext_lazy as _
import mock
from nose.tools import eq_, ok_
import mkt
import mkt.site.tests
from mkt.comm.models import CommunicationNote
fro... | |
# 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... | |
"""The tests for the UniFi device tracker platform."""
from copy import copy
from datetime import timedelta
from aiounifi.controller import SIGNAL_CONNECTION_STATE
from aiounifi.websocket import STATE_DISCONNECTED, STATE_RUNNING
from asynctest import patch
from homeassistant import config_entries
from homeassistant.c... | |
# 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 ... | |
from __future__ import division
import pytest
import numpy as np
from pandas import (
Index,
IntervalIndex,
interval_range,
CategoricalIndex,
Timestamp,
Timedelta,
NaT)
from pandas.core.dtypes.dtypes import CategoricalDtype, IntervalDtype
import pandas.util.testing as tm
class Base(object... | |
# swift_build_support/targets.py - Build target helpers -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for li... | |
"""distutils.dir_util
Utility functions for manipulating directories and directory trees."""
__revision__ = "$Id: dir_util.py 76956 2009-12-21 01:22:46Z tarek.ziade $"
import os
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition t... | |
# pythonpath modification to make hytra and empryonic available
# for import without requiring it to be installed
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('..'))
# standard imports
import configargparse as argparse
import logging
import numpy as np
import h5p... | |
# coding: utf-8
from tw.api import WidgetsList
from tw.forms.fields import Form
from tribal.widgets.components import *
from tribal.model import *
from tribal.model.sample import *
#__all__=["search_form", "report_form", "SFSamplingWidget", "SFPrintoutWidget", "SF3DImageWidget"]
def getOptions(dbobj, orderField, us... | |
# Copyright 2016 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 ... | |
import logging
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import QMenu, QMenuBar, QToolBar, QAction
from gii.core import signals, app
from Menu import MenuManager
from gii.qt.IconCache import getIcon
class ToolBarItem(object):
def __init__( self, name, **option ):
option = option or {}
self.name = nam... | |
# -*- coding: utf-8 -*-
from rest_framework import permissions
from rest_framework import exceptions
from addons.base.models import BaseAddonSettings
from osf.models import (
AbstractNode,
Contributor,
DraftRegistration,
Institution,
Node,
NodeRelation,
OSFUser,
PreprintService,
Pri... | |
# 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... | |
"""
Author: Timothy Moore
Created On: 31th August 2017
Defines a two-dimensional quadtree of arbitrary
depth and bucket size.
"""
import inspect
import math
from collections import deque
from pygorithm.geometry import (vector2, polygon2, rect2)
class QuadTreeEntity(object):
"""
This is the minimum informatio... | |
"""
Main Zencoder module
"""
import os
import httplib2
from urllib import urlencode
# Note: I've seen this pattern for dealing with json in different versions of
# python in a lot of modules -- if there's a better way, I'd love to use it.
try:
# python 2.6 and greater
import json
except ImportError:
try:
... | |
import os
import sys
import shutil
import subprocess
import boto3
import botocore
import hashlib
import struct
from multiprocessing.pool import ThreadPool
from threading import Semaphore
import urllib2
from urllib import urlretrieve
from timeit import default_timer as now
import json
from collections import OrderedDic... | |
" analytical test problem to validate 2D and 3D solvers "
import math
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from collections import OrderedDict
from dolfin import *
from nanopores import *
from nanopores.physics.simplepnps import *
# --- define parameters ---
add_params(
bV = -0.1, # [V]
r... | |
'''This module defines a class of objects, called FRED objects, that make it easy to download and manipulate data from the Federal Reserve Economic Database (FRED). FRED is a rich database managed by the Federal Reserve Bank of St Louis. Learn more about FRED:
http://research.stlouisfed.org/fred2/
An instance of ... | |
# -*- 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... | |
# 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... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/python
# Ship simulator, updated for TW4.
from __future__ import print_function
import enum
import pprint
import random
import dice
class ShipType(enum.Enum):
SPACEDOCK = 1
PDS = 2
FIGHTER = 3
CARRIER = 4
CRUISER = 5
DESTROYER = 6
DREADNOUGHT = 7
WARSUN = 8
FLAGSHIP = ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 BigML
#
# 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 ... | |
"""
.. module: security_monkey.watcher
:platform: Unix
:synopsis: Slurps the current config from AWS and compares it to what has previously
been recorded in the database to find any changes.
.. version:: $$VERSION$$
.. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity
"""
from botocore.e... | |
# stdlib
import os
# 3p
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest
from util import get_hostname
@attr(requires='haproxy')
class HaproxyTest(AgentCheckTest):
CHECK_NAME = 'haproxy'
BACKEND_SERVICES = ['anotherbackend', 'conmon... | |
#!/usr/bin/env python
# The MIT License (MIT)
# Copyright (c) 2017 Massimiliano Patacchiola
# https://mpatacchiola.github.io
# https://mpatacchiola.github.io/blog/
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, F... | |
#!/usr/bin/python
# Global Forest Change calculator for provided species' distributions maps
import csv
import logging
import time
import ee
import collections
from datetime import datetime
assets_filename = 'assets_eoo.csv' # File with IDs of species' range maps (uploaded through Google Maps Engine)
altitude_filena... | |
# Copyright (c) 2010 Chris Moyer http://coredumped.org/
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... | |
import cPickle
import os
import re
from pythoscope.astbuilder import regenerate
from pythoscope.code_trees_manager import FilesystemCodeTreesManager
from pythoscope.compat import any, set
from pythoscope.event import Event
from pythoscope.localizable import Localizable
from pythoscope.logger import log
from pythoscope... | |
"""The tests for the MQTT lock platform."""
import json
from unittest.mock import ANY
from homeassistant.components import lock, mqtt
from homeassistant.components.mqtt.discovery import async_start
from homeassistant.const import (
ATTR_ASSUMED_STATE,
STATE_LOCKED,
STATE_UNAVAILABLE,
STATE_UNLOCKED,
)
... | |
from pyravendb.data.document_convention import DocumentConvention, Failover
from pyravendb.tools.indexqueue import IndexQueue
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
from Crypto.Util.number import bytes_to_long
from pyravendb.custom_exception... | |
from collections import namedtuple
import logging
from django.core.mail import (
EmailMessage, EmailMultiAlternatives, get_connection
)
from django.template.loader import render_to_string, select_template
from django.template import TemplateDoesNotExist
from django.conf import settings
try:
from froide.bounce... | |
"""Defines utility methods for testing jobs and job types"""
from __future__ import unicode_literals
from django.db import transaction
import django.utils.timezone as timezone
import job.test.utils as job_test_utils
import trigger.test.utils as trigger_test_utils
from batch.models import Batch
from data.data.exceptio... | |
# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
# vim: tabstop=2:shiftwidth=2:noexpandtab
# kate: tab-width 2; replace-tabs off; indent-width 2;
#
# ==============================================================================
# Authors: Patrick Lehmann
#
# Python Class: This PoCXCOCompiler compil... | |
# 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 agreed to in... | |
import typing # noqa
# Low-color themes should ONLY use the standard foreground and background
# colours listed here:
#
# http://urwid.org/manual/displayattributes.html
#
class Palette:
_fields = [
'background',
'title',
# Status bar & heading
'heading', 'heading_key', 'heading_i... | |
# Copyright 2011 Nicholas Bray
#
# 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... | |
#!/usr/bin/env python
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil is a cross-platform library for retrieving information on
running processes and system utilization (CPU, memory, disks, net... | |
from dmd import *
import sdl2.ext
from sdl2.ext import *
class LayerTransitionBase(object):
"""Transition base class."""
progress = 0.0
"""Transition progress from 0.0 (100% from frame, 0% to frame) to 1.0 (0% from frame, 100% to frame).
Updated by :meth:`next_frame`."""
progress_per_frame = ... | |
import pkgutil
import numpy
import copyreg
import dedupe.variables
import dedupe.variables.base as base
from dedupe.variables.base import MissingDataType
from dedupe.variables.interaction import InteractionType
for _, module, _ in pkgutil.iter_modules(dedupe.variables.__path__,
... | |
"""Provides the worker thread needed for processing streams."""
from __future__ import annotations
from collections import defaultdict, deque
from collections.abc import Callable, Generator, Iterator, Mapping
import contextlib
import datetime
from io import BytesIO
import logging
from threading import Event
from typin... | |
# -*- coding: utf-8 -*-
#
from six.moves import builtins
import testify as T
from mock import ANY
from mock import mock_open
from mock import patch
from threat_intel.opendns import InvestigateApi
from threat_intel.opendns import ResponseError
from threat_intel.util.api_cache import ApiCache
from threat_intel.util.http... | |
# -*- coding: utf-8 -*-
"""
Wordpress OAuth1.0a Class
"""
__title__ = "wordpress-oauth"
from time import time
from random import randint
from hmac import new as HMAC
from hashlib import sha1, sha256
from base64 import b64encode
import binascii
import webbrowser
import requests
from bs4 import BeautifulSoup
try:
... | |
from functools import partial
from itertools import chain, izip
from pycparser import c_ast
from pyc_fmtstr_parser.printf_parse import printf_parse, Arg_type as p_Arg_type
from pyc_fmtstr_parser.scanf_parse import scanf_parse, Arg_type as s_Arg_type
from decomp import ida, utils
from decomp.c import decl as cdecl, type... | |
import logging
import sys
class NoConsoleAvailableError(Exception):
pass
log = logging.getLogger('pytality.term')
#-----------------------------------------------------------------------------
# Terminal setup/teardown
def _find_impl(choices):
"""
Find a suitable terminal implementation.
"""
suc... | |
"""
Module to test plotly.utils with optional dependencies.
"""
from __future__ import absolute_import
import datetime
import json
import math
from datetime import datetime as dt
from unittest import TestCase
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pandas.util.testing import asser... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# called from wnf.py
# lib/wnf.py --install [rootpassword] [dbname] [source]
from __future__ import unicode_literals
import os, json
import frappe
import frappe.database
import getpass
import importlib
from frappe.... | |
# 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 dilap.core.base as db
import dilap.core.tools as dpr
import dilap.core.vector as dpv
import dilap.core.quaternion as dpq
import dilap.core.bbox as dbb
import dilap.core.ray as dr
import numpy,pdb
###############################################################################
### model is the basic unit of geom... | |
# -*- coding: 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 License, Version 2.0 (the
#... | |
"""
=============================================================================
Manifold learning on handwritten digits: Locally Linear Embedding, Isomap...
=============================================================================
An illustration of various embeddings on the digits dataset.
The RandomTreesEmbed... | |
"""
[2020-02-03] Modified version of the original qcodes.plots.colors
Mofied by Victor Negirneac for Measurement Control
It modules makes available all the colors maps from the qcodes, context menu of
the color bar from pyqtgraph, the circular colormap created by me (Victo),
and the reversed version of all of them.
F... | |
import os
import math
import hashlib
import xml.dom.minidom
from framerange import FrameRange
from valuerange import ValueRange
from cross3d.constants import ControllerType, TangentType, ExtrapolationType
class Key(object):
def __init__(self, **kwargs):
self.value = float(kwargs.get('value', 0.0))
self.time = ... | |
# stdlib
import collections
import logging
import pprint
import socket
import sys
import time
# project
from checks import AGENT_METRICS_CHECK_NAME, AgentCheck, create_service_check
from checks.check_status import (
CheckStatus,
CollectorStatus,
EmitterStatus,
STATUS_ERROR,
STATUS_OK,
)
from checks... | |
# Copyright (c) 2016 Synology Co., 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 re... | |
#!/usr/bin/env python3
import os
import sys
import math
import fcntl
import base64
import socket
import select
import multiprocessing
import pysodium
import mltpipe
# ./mltpiped.py -d -s '[127.0.0.1]:0' -t '[127.0.0.1]:8080'
# For the majority of use-cases the directory will be a DNS
# configuration which is manua... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | |
# -*- coding: utf-8 -*-
from __future__ import (
print_function,
unicode_literals,
)
import hypothesis
import hypothesis.strategies
import mock
import os.path
import pytest
from datetime import timedelta
from hypothesis_regex import regex
from runwith import (
main,
__main__,
timespan,
SIGKI... | |
# -*- coding: utf-8 -*-
"""
Default Controllers
"""
module = "default"
# -----------------------------------------------------------------------------
def call():
"Call an XMLRPC, JSONRPC or RSS service"
# If webservices don't use sessions, avoid cluttering up the storage
#session.forget()
return... | |
# (c) Copyright 2012-2015 Hewlett Packard Enterprise Development LP
# 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/lic... | |
#!/usr/bin/env python
"""Metadata module
Author: Alex Ip (alex.ip@ga.gov.au)
"""
import pickle
import logging
import os
logger = logging.getLogger('root.' + __name__)
class MetadataException(Exception):
pass
class Metadata(object):
"""Superclass of all metadata types
Manages master dict containing al... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use th... | |
import socket
import sys
import unittest
from common import linesep, platform_skip, TestCase
import pyuv
TEST_PORT = 12345
TEST_PORT2 = 12346
MULTICAST_ADDRESS = "239.255.0.1"
class UDPTest(TestCase):
def setUp(self):
super(UDPTest, self).setUp()
self.server = None
self.client = None
... | |
# Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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... | |
"""Tests for WebSocket API commands."""
import datetime
from unittest.mock import ANY, patch
from async_timeout import timeout
import pytest
import voluptuous as vol
from homeassistant.bootstrap import SIGNAL_BOOTSTRAP_INTEGRATONS
from homeassistant.components.websocket_api import const
from homeassistant.components.... | |
# 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... | |
from typing import List, Union
import numpy as np
import tensorflow as tf
import nn_utils.math_utils as math_utils
from dataflow.illumination_integration.helper import (
getBilinearFromUv,
)
from nn_utils.math_utils import shape_to_uv, uv_to_direction
@tf.function
def map_levels_to_samples(
num_roughness_0:... | |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for :module:`flocker.node._docker`.
"""
from __future__ import absolute_import
import time
from functools import partial
from docker.errors import APIError
from docker import Client
# Docker-py uses 1.16 API by default, which isn't su... | |
#! /usr/bin/python3
import sys
import os
import glob
import shutil
from pydub import AudioSegment
import json
from watson_developer_cloud import SpeechToTextV1
import conf #contains username and password to access Watson API
from moviepy.tools import subprocess_call
from moviepy.config import get_setting
import threadi... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
# Copyright 2019 DeepMind Technologies Limited. 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 ... | |
import pytest
from . import normalize_ret
pytestmark = [
pytest.mark.windows_whitelisted,
]
def test_requisites_onfail_any(state, state_tree):
"""
Call sls file containing several require_in and require.
Ensure that some of them are failing and that the order is right.
"""
sls_contents = ""... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
"""
Calculators are used to execute calculations.
"""
from carousel.core import logging, UREG
import numpy as np
LOGGER = logging.getLogger(__name__)
def index_registry(args, reg, ts=None, idx=None):
"""
Index into a :class:`~carousel.core.Registry` to return arguments
from :class:`~carousel.core.data_s... | |
# Copyright (c) 2013, OpenStack
# 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... | |
"""Functional tests for pooling operations."""
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
from tensorflow.python.kernel_tests import gradient_checker as gc
from tensorflow.python.ops import gen_nn_ops
def GetInceptionMaxPoolShapes():
"""Itera... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# encoding: utf8
import logging
from pyramid.httpexceptions import HTTPForbidden, HTTPNotFound, HTTPSeeOther
from pyramid.response import Response
from pyramid.security import effective_principals
from pyramid.view import view_config
from sqlalchemy.orm.exc import NoResultFound
import wtforms
from floof import model
... | |
import functools
import os
import sys
import unittest
from contextlib import contextmanager
from cloudbridge.cloud.factory import CloudProviderFactory
from cloudbridge.cloud.interfaces import InstanceState
from cloudbridge.cloud.interfaces import TestMockHelperMixin
from six import reraise
def parse_bool(val):
... | |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
import re
from sklearn.feature_extraction import DictVectorizer
from sklearn.model_selection import train_test_split
import pandas as pd
from pandas.tseries.holiday import USFederalHolidayCalendar a... | |
from luigi_bigquery.config import get_config
from luigi_bigquery.client import ResultProxy
from luigi_bigquery.job import Job
from luigi_bigquery.targets.result import ResultTarget
from luigi_bigquery.targets.bq import DatasetTarget
from luigi_bigquery.targets.bq import TableTarget
from luigi_bigquery.targets.gcs impor... | |
# Copyright 2015 DataStax, 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, s... | |
#!/usr/bin/env python
##########################################################################
#
# Copyright 2011 Jose Fonseca
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in th... | |
# Copyright 2011 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... | |
import numpy as np
import regreg.api as rr
from selection.randomized.glm import pairs_bootstrap_glm, bootstrap_cov
from selection.randomized.query import query
from selection.randomized.randomization import split
import functools
def pairs_bootstrap_glm(glm_loss,
active,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.