gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
import healpy as hp
import numpy as np
from .. import timing as timing
from ..map import DistRings, PySMSky, LibSharpSmooth, ... | |
import collections
import heapq
import traceback
import weakref
import numpy
import six
import chainer
from chainer import _backprop_utils
from chainer.backends import cuda
from chainer import configuration
from chainer import function_hook
from chainer.utils import type_check
from chainer import variable
class Fun... | |
"""
Handled exceptions raised by REST framework.
In addition Django's built in 403 and 404 exceptions are handled.
(`django.http.Http404` and `django.core.exceptions.PermissionDenied`)
"""
from __future__ import unicode_literals
import math
from django.http import JsonResponse
from django.utils import six
from djang... | |
__author__ = 'thorwhalen'
import ut.parse.google as google
import pandas as pd
import re
from bs4.element import Tag
import ut.semantics.text_processors as semantics_text_processors
import ut.util.ulist as util_ulist
import ut.daf.manip as daf_manip
import ut.coll.order_conserving as colloc
#### Utilsxw
LOCATION_LOC... | |
from __future__ import print_function
from aggregation_api import AggregationAPI
import pandas
import classification
import yaml
import parser
import json
import math
import csv_output
def extract_subject_id(subject_data):
"""
extract the subject id for each subject
:param subject_data:
:return:
""... | |
''' Various kinds of data table (data grid) widgets.
'''
from __future__ import absolute_import
from ...core.enums import DateFormat, FontStyle, NumeralLanguage, TextAlign, RoundingFunction
from ...core.has_props import abstract
from ...core.properties import Bool, Color, Either, Enum, Float, Instance, Int, List, Ove... | |
#!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from __future__ import absolute_import
from bokeh.io import save
from bokeh.models import (
BoxZoomTool,
ColumnDataSource,
DataRange1d,
PanTool,
Plot,
Range1d,
Rect,
LinearAxis
)
from selenium.webdriver.common.action_chains import ActionChains
from tests.integration.utils import has_no_... | |
"""
Common utilities for the shell manager.
"""
import json
import logging
import os
import re
import shutil
import string
from os import chmod, listdir, sep, unlink
from os.path import isdir, isfile, join
from shutil import copy2, copytree
from hashlib import md5
from voluptuous import (
All,
ALLOW_EXTRA,
... | |
# -*- 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... | |
""" Cisco_IOS_XR_lpts_lib_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR lpts\-lib package configuration.
This module contains definitions
for the following management objects\:
lpts\: lpts configuration commands
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
All rights reserved.
""... | |
# coding=utf-8
import os
import os.path
import sys
import json
import re
import threading
import subprocess
import tempfile
import collections
import platform
import semver
import time
import zipfile
is_python3 = sys.version_info[0] > 2
if is_python3:
import urllib.request as url_req
import urllib.error as url_err
... | |
# coding: utf-8
"""
======================
Using display.specshow
======================
This notebook gives a more in-depth demonstration of all things that `specshow`
can do to help generate beautiful visualizations of spectro-temporal data.
"""
# Code source: Brian McFee
# License: ISC
# sphinx_gallery_thumbnail_... | |
""" Unit tests for the txOauth2 module. """
import time
from uuid import uuid4
try:
from urlparse import urlparse, parse_qs
except ImportError:
# noinspection PyUnresolvedReferences
from urllib.parse import urlparse, parse_qs
try:
# noinspection PyProtectedMember
from base64 import encodebytes as ... | |
import socket
from os import mkdir
from os.path import join, exists
from sys import platform
from asyncio import sleep
from math import sqrt
from uuid import uuid4
from enum import Enum
from csv import DictReader
from cyrandom import choice, shuffle, uniform
from time import time
from pickle import dump as pickle_dump... | |
'''@file test_reconstruction.py
this file will test the reconstruction on its own by computing
loss on test set'''
import os
from six.moves import configparser
import tensorflow as tf
import numpy as np
from nabu.neuralnetworks.classifiers.asr import asr_factory
from nabu.neuralnetworks import ops
from nabu.processing... | |
import os
import robot
from robot.errors import DataError
from selenium import webdriver
from Selenium2Library import webdrivermonkeypatches
from Selenium2Library.utils import BrowserCache
from Selenium2Library.locators import WindowManager
from keywordgroup import KeywordGroup
ROOT_DIR = os.path.abspath(os.path.join(... | |
# -*- 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
#... | |
# coding: utf-8
# Copyright 2009 Alexandre Fiori
#
# 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... | |
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | |
from components import *
from utils.ebs import Applicator, System
import pyglet.graphics
from pyglet.gl import *
from pyglet.window import key
from pymunk import Body as pymunk_body
from pymunk import BB
from pymunk import Circle as pymunk_circle
from pymunk import Poly as pymunk_poly
from pymunk import moment_for_circ... | |
# Copyright 2014 Netflix, 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... | |
from __future__ import annotations
from inspect import getmembers, isclass, isdatadescriptor
from os import environ
from pathlib import Path
from typing import Any, Callable, Dict, Optional, Sequence, Union
from sanic.errorpages import DEFAULT_FORMAT, check_error_format
from sanic.helpers import Default, _default
fro... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module that handles tee-ing output to a file."""
from __future__ import print_function
import errno
import fcntl
import o... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
#!/usr/bin/env python3
# Copyright (c) 2009-2019 The Bitcoin Core developers
# Copyright (c) 2014-2019 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for auroracoind node under test"""
import... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
# Standard lib
import os, re, glob, json, shutil
import argparse
import json
# 3rd-party modules
import phonenumbers # https://github.com/daviddrysdale/python-phonenumbers
from phonenumbers import geocoder, Leniency
from phonenumbers import carrier
from operator import attrgetter, itemgetter
from pyspark import SparkC... | |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# Copyright (c) 2017 Jon Cooper
#
# This file is part of pygame-xbox360controller.
# Documentation, related files, and licensing can be found at
#
# <https://github.com/joncoop/pygame-xbox360controller>.
import pygame
import xbox360_controller
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 65, 65)
GRE... | |
"""
This implements the WOFF specification dated September 16, 2009.
The main object is the WOFFFont. It is a subclass for the FontTools
TTFont object, so it has very similar functionality. The WOFFReader
and WOFFWriter are also available for use outside of this module.
Those objects are much faster than WOFFFont, but... | |
import threading
from peewee import _atomic
from peewee import SqliteDatabase
from peewee import transaction
from playhouse.tests.base import database_class
from playhouse.tests.base import mock
from playhouse.tests.base import ModelTestCase
from playhouse.tests.base import skip_if
from playhouse.tests.base import tes... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
import collections.abc
import claripy
class SimVariable:
__slots__ = ['ident', 'name', 'region', 'category']
def __init__(self, ident=None, name=None, region=None, category=None):
"""
:param ident: A unique identifier provided by user or the program. Usually a string.
:param str name:... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from future.utils import iteritems
import os
import re
import sys
import glob
import codecs
from sqlalchemy.sql import select
from collections impo... | |
#! /usr/bin/env python
import os
import itertools as it
import sys
import textwrap
#import gtk
import numpy as np
import sympy as sy
import sympy.stats
import odespy as ode
import matplotlib
import matplotlib.pyplot as plt
import sympy.physics.mechanics as mech
"""
Pretty plotting code.
"""
_all_spines = ["top", "r... | |
import os
import sys
import difflib
import __builtin__
import re
import pydoc
import inspect
import keyword
import unittest
import xml.etree
import test.test_support
from collections import namedtuple
from test.script_helper import assert_python_ok
from test.test_support import (
TESTFN, rmtree, reap_children, capt... | |
from __future__ import division
import datetime
import multiprocessing
from multiprocessing import sharedctypes
import signal
import sys
import threading
import warnings
import numpy
import six
from chainer.dataset import iterator
from chainer.iterators._statemachine import (IteratorState,
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Ivan Cai
# 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 limit... | |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | |
#
# 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... | |
# -*- coding: utf-8 -*-
import time
import itertools
import httplib as http
from collections import Counter
from flask import request
from modularodm.exceptions import ValidationValueError
from framework import forms
from framework import status
from framework.auth import cas
from framework.flask import redirect # V... | |
# Copyright 2021 The ParallelAccel 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 appl... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from mock import MagicMock, call
from uiautomator import AutomatorDeviceObject, Selector, AutomatorDeviceNamedUiObject
class TestDeviceObjInit(unittest.TestCase):
def setUp(self):
self.device = MagicMock()
self.device.server.jsonrpc =... | |
# -*- coding: utf-8 -*-
"""
Presence analyzer unit tests.
"""
from __future__ import unicode_literals
import datetime
import json
import os.path
import unittest
from presence_analyzer import main, views, utils
TEST_DATA_CSV = os.path.join(
os.path.dirname(__file__), '..', '..', 'runtime', 'data', 'test_data.csv... | |
# Copyright 2015 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 agreed to in writing, s... | |
# 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) 2012 Santosh Philip
# Copyright (c) 2021 Jeremy Lerond
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# ===================================================... | |
import os, errno, uuid, threading
from django.conf import settings
from django.core import validators
from django.core.files import base, temp
from django.utils.encoding import force_text
from six.moves import queue as six_queue
try:
from django.utils.deconstruct import deconstructible
except ImportError:
deco... | |
import re
from typing import TYPE_CHECKING, Optional
from urllib.parse import urljoin
from django.utils.translation import gettext_lazy as _
import attr
import requests
from oauthlib.oauth2 import LegacyApplicationClient, BackendApplicationClient
from requests import Session
from requests.adapters import HTTPAdapter
... | |
"""
pghoard - pg_basebackup handler
Copyright (c) 2016 Ohmu Ltd
See LICENSE for details
"""
# pylint: disable=superfluous-parens
from . import common, version, wal
from .common import (
connection_string_using_pgpass,
replication_connection_string_and_slot_using_pgpass,
set_stream_nonblocking,
set_subp... | |
# Copyright (c) 2014 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... | |
from __future__ import unicode_literals
import os
import copy
from ship.utils.fileloaders import fileloader
from ship.utils import filetools as ft
from integration_tests import utils
class TuflowLoadTests(object):
def runTests(self):
cwd = os.getcwd()
path1 = "integration_tests/tes... | |
from __future__ import unicode_literals
from datetime import date
import unittest
from django.core.exceptions import FieldError
from django.db import models
from django.db import connection
from django.test import TestCase
from .models import Author
class Div3Lookup(models.Lookup):
lookup_name = 'div3'
def... | |
# 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 ... | |
#!/usr/bin/env python2
# Copyright (c) 2014 The VeriCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test takes 30 mins or ... | |
from oebakery import die, err, warn, info, debug
from oelite import *
from oelite.dbutil import *
import oelite.recipe
import sys
import os
import copy
import operator
class OEliteRunQueue:
def __init__(self, config, cookbook, rebuild=None, relax=None,
depth_first=True):
self.cookbook =... | |
from __future__ import print_function
from __future__ import absolute_import
import argparse
import logging
import sys
import traceback
import json
import os
import re
import itertools
import six
from six.moves import urllib
import pkg_resources # part of setuptools
from typing import Any, Dict, List, Union, Patter... | |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
import itertools
from paramz.caching import Cache_this
from .kern import CombinationKernel, Kern
from functools import reduce
class Add(CombinationKernel):
"""
Add given list of ... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | |
# -*- 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 experiments on 'Dataset'
db.create_table('tardis_portal_dataset_experiments', (... | |
"""Tests for tensorflow.ops.io_ops."""
import os.path
import time
import tensorflow.python.platform
import tensorflow as tf
import numpy as np
from tensorflow.python.platform import gfile
class SaverTest(tf.test.TestCase):
def testBasics(self):
save_path = os.path.join(self.get_temp_dir(), "basics")
wi... | |
# Copyright 2018 Analytics Zoo 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 i... | |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
classes and helper moment matrices and localizing matrices,
which takes contraints as input produce the right outputs
for the cvxopt SDP solver
Sketchy: tested using sympy 0.7.6 (the default distribution did not work)
and cvxopt
"""
#from __future__ import division... | |
"""(Deprecated) Fit functions. Although these are still supported, use
fit functions of type FitFunction instead
"""
from __future__ import division
from __future__ import print_function
import numpy as np
# SIMPLE FITS
def polyfit4(x, a, b, c, d, e, *constants):
return _polyfitn(x, [a, b, c, d, e], *constants)... | |
# 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... | |
import os
import re
import sys
import time
from nose import SkipTest
from nose.tools import raises
from random import randint
from textwrap import dedent
from rbtools.clients import RepositoryInfo
from rbtools.clients.git import GitClient
from rbtools.clients.mercurial import MercurialClient
from rbtools.clients.perfo... | |
import json
import logging
import os.path
import Bio
import Bio.GenBank
from Bio.GenBank.Scanner import GenBankScanner
from Bio.SeqFeature import ExactPosition, BeforePosition, AfterPosition
import pynpact.track
logger = logging.getLogger(__name__)
def parse_seq_rec(gbkfile, do_features=False):
"Parse the gbkf... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
import pytest
import glob
import os
import shutil
import time
import logging
import re
import tempfile
import subprocess
import sys
import errno
import pprint
from collections import OrderedDict
from cassandra.cluster import Cluster as PyCluster
from cassandra.cluster import NoHostAvailable
from cassandra.cluster impo... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin P2P ... | |
# -*- coding: utf-8 -*-
import copy
import datetime
import hashlib
import logging
import os
import alerts
import enhancements
import jsonschema
import ruletypes
import yaml
import yaml.scanner
from opsgenie import OpsGenieAlerter
from staticconf.loader import yaml_loader
from util import dt_to_ts
from util import dt_t... | |
# Copyright 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, softwa... | |
import collections
import functools
import itertools
from soap import logger
from soap.datatype import int_type, ArrayType
from soap.expression import (
AccessExpr, InputVariable, operators, UpdateExpr, Variable,
)
from soap.semantics import label, Label, label_to_expr
from soap.semantics.schedule.common import (
... | |
"""Implementation of DPLL algorithm
Further improvements: eliminate calls to pl_true, implement branching rules,
efficient unit propagation.
References:
- http://en.wikipedia.org/wiki/DPLL_algorithm
- http://bioinformatics.louisville.edu/ouyang/MingOuyangThesis.pdf
"""
from sympy.core import Symbol
from sympy imp... | |
# 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 ... | |
#!/usr/bin/env python
#
# Copyright (C) 2014
# Brian Caswell <bmc@lungetech.com>
# Narf Industries <info@narfindustries.com>
#
# 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 res... | |
"""
path.py - An object representing a path to a file or directory.
Current Author : Kyle Rockman
Special thanks to:
John Crocker
Jason Orendorff
Mikhail Gusarov <dottedmag@dottedmag.net>
Marc Abramowitz <marc@marc-abramowitz.com>
Jason R. Coombs <jaraco@jaraco.com>
Jason Chu <jchu@xentac.net>
Vojislav Stojkov... | |
import time
from django.conf import settings
from django.template import Context
from sekizai.context import SekizaiContext
from cms.api import add_plugin, create_page, create_title
from cms.cache import _get_cache_version, invalidate_cms_page_cache
from cms.cache.placeholder import (
_get_placeholder_cache_ver... | |
from ctypes import c_char_p
import logging
import traceback
from multiprocessing import Semaphore, Condition, Lock, Value, Pipe, Process
class Task:
class State:
def __init__(self):
pass
NEW = 'NEW'
RUNNING = 'RUNNING'
DONE = 'DONE'
FAILED = 'FAILED'
def... | |
'''
Offline tests
'''
from builtins import object
from unittest import TestCase
from mock import MagicMock
from kafka_monitor import KafkaMonitor
from plugins.base_handler import BaseHandler
from kafka.common import OffsetOutOfRangeError
from jsonschema import Draft4Validator
class ExampleHandler(BaseHandler):
... | |
# flake8: noqa: E501
#
# Author: Joris Vankerschaver 2013
#
import numpy as np
import scipy.linalg
from scipy._lib import doccer
from scipy.special import gammaln
from scipy._lib._util import check_random_state
from scipy.stats import mvn
_LOG_2PI = np.log(2 * np.pi)
_LOG_2 = np.log(2)
_LOG_PI = np.log(np.pi)
_do... | |
# -*- coding: utf-8 -*-
#
# Makahiki documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 6 10:22:39 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | |
import fcntl
import os
import os.path
import sys
import shutil
import platform
import argparse
import flare
import flare_submit
import astropy.units as units
from astropy.cosmology import Planck15 as cosmo
import math
import numpy
import subprocess
import time
import string
#This script controls runs for a multidimens... | |
"""Test zha light."""
from datetime import timedelta
import pytest
import zigpy.profiles.zha as zha
import zigpy.types
import zigpy.zcl.clusters.general as general
import zigpy.zcl.clusters.lighting as lighting
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.light import DOMAIN, FLASH_LONG, FLASH_S... | |
# Copyright 2016 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ['MPIPool']
# If mpi4py is installed, import it.
try:
from mpi4py import MPI
except ImportError:
MPI = None
class _close_pool_message(object):... | |
# 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 __future__ import print_function
from flask import Flask, render_template, flash, redirect, url_for, session, request, jsonify
from passlib.hash import sha256_crypt
from functools import wraps
import string
import chartkick
from forms import *
from job_choosing import *
import os
from apiclient import discovery
fr... | |
# -*- coding: utf-8 -*-
#
from . import color as mycol
from . import path as mypath
def draw_line2d(data, obj):
'''Returns the PGFPlots code for an Line2D environment.
'''
content = []
addplot_options = []
# If line is of length 0, do nothing. Otherwise, an empty \addplot table
# will be cre... | |
import requests
import demjson
from demjson import JSONDecodeError
import datetime
import time
import pytz
import pymongo
import threading
from pymongo import MongoClient
import logging
import ne_testprep
import bd_testprep
import sf_testprep
import ne_scikit
import bd_scikit
import sf_scikit
LOG_FILENAME = 'TTOBackg... | |
import re
from sqlalchemy import sql, util
from sqlalchemy import types as sqltypes
from sqlalchemy import pool, exc
from sqlalchemy.engine import default, reflection
from sqlalchemy_monetdb.base import MonetExecutionContext, \
MonetIdentifierPreparer
from sqlalchemy_monetdb.compiler import MonetDDLCompiler, Mone... | |
"""Test how the DmsDeviceSource handles available and unavailable devices."""
from __future__ import annotations
import asyncio
from collections.abc import AsyncIterable
import logging
from unittest.mock import ANY, DEFAULT, Mock, patch
from async_upnp_client.exceptions import UpnpConnectionError, UpnpError
from didl... | |
"""This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | |
# Authors: Nils Wagner, Ed Schofield, Pauli Virtanen, John Travers
"""
Tests for numerical integration.
"""
from __future__ import division, print_function, absolute_import
import numpy
from numpy import arange, zeros, array, dot, sqrt, cos, sin, eye, pi, exp, \
allclose
from scipy.lib.six import xr... | |
"""Orchestrate the execution of all experiments.
The orchestrator is responsible for scheduling experiments specified in the
user-provided settings.
"""
from __future__ import division
import time
import collections
import multiprocessing as mp
import logging
import copy
import sys
import signal
import traceback
from... | |
## @file
# This file is used to be the main entrance of ECC tool
#
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full t... | |
#!/usr/bin/env python
# Copyright 2016 VMware, 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.