gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""Tests for the Config Entry Flow helper."""
from unittest.mock import patch, Mock
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.helpers import config_entry_flow
from tests.common import (
MockConfigEntry, MockModule, mock_coro, mock_integration,
mock_entit... | |
#coding:utf-8
import os
import string
import sys
import time
import re
import StringIO
import tempfile
import threading
import traceback
import select
from datetime import datetime
from email.parser import Parser
from email.message import Message
from threading import Thread
from mailpile.i18n import gettext as _
from... | |
from django.core.urlresolvers import reverse
from django.test import TestCase, LiveServerTestCase, Client
from django.utils import timezone
from buc.models import Article, Category, Tag
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.contrib.auth.models impo... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright 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... | |
import argparse
import os
from os import path
import subprocess
import sys
import socket
import time
import warnings
from math import floor
import gc # garbage collector
import smtplib
import numpy as np
from scipy import signal, linalg
from matplotlib import pyplot as plt
import GPy
import classes as cls
import util... | |
# 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... | |
from multiprocessing import Process, Queue
import sys
import os
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from casexml.apps.stock.models import StockTransaction, StockReport, DocDomainMapping
from corehq.apps.domain.models import Domain
from dimagi.utils.couch.da... | |
u"""
Fixer for print function to print statement
print(spam,ham,eggs,sep=sep,end=end,file=file)
->
print >>file, sep.join((str(spam),str(ham),str(eggs))),; file.write(end)
in the most complicated case. Simpler cases:
print() -> print
print("spam") -> print "spam"
print(1,2,3) -> print 1,2,3
print(1,2,3,end=" ") -> pr... | |
# Copyright 2012 Nebula, 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 agree... | |
import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class DisputeCloseSplitTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
def run_test(self):
... | |
"""
Test cdflib functions versus mpmath, if available.
The following functions still need tests:
- ncfdtr
- ncfdtri
- ncfdtridfn
- ncfdtridfd
- ncfdtrinc
- nbdtrik
- nbdtrin
- nrdtrimn
- nrdtrisd
- pdtrik
- nctdtr
- nctdtrit
- nctdtridf
- nctdtrinc
"""
import itertools
import numpy as np
from numpy.testing import a... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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.... | |
# -*- test-case-name: twisted.test.test_application,twisted.test.test_twistd -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import absolute_import, division, print_function
import sys
import os
import pdb
import getpass
import traceback
import signal
import warnings
from ... | |
# -*- coding: utf-8 -*-
"""
stellarPYL - python stellar spectra processing software
Copyright (c) 2016 Brunston Poon
@file: pxlambda test
This program comes with absolutely no warranty.
"""
import configparser
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 i... | |
# 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 use ... | |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import cgi
import hashlib
import os
import re
import shutil
import tempfile
import threading
from lib.core.common import Backend
from lib.core.common import checkFile
from li... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, copy, json, re
from frappe import _
from frappe.modules import get_doc_path
from jinja2 import TemplateNotFound
from frappe.utils import cint, strip_html
from... | |
import numpy as np
import tensorflow as tf
import h5py
import time
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
# Functions for initializing neural nets parameters
def init_weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1, dtype=tf.float32)
return tf.Variable(initia... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import time
import pytest
from flexget.entry import Entry
from flexget.manager import Session
from flexget.plugins.internal.api_trakt import TraktUserAuth
from flexget.pl... | |
# Autor: Alexander Herbrich
# Wann: 03.02.2016
# Thema: Hangman
from random import *
import time
import sys
Hangman_Pics = ["""
============== """ , """
|
|
|
|
|
============== """ , """
+====+
|
... | |
"""
Choose SNPs from GWAS summary statistics.
Method 1:
Sort by significance.
Choose top SNP.
Remove all SNPs in LD.
Loop until p-value threshold or n variants is reached.
"""
# This file is part of grstools.
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Marc-Andre Legault
#
# Permission is hereby... | |
"""
TODO docstring
"""
from pyviennacl import _viennacl as _v, backend
class SolverTag(object):
def vcl_solve_call(self, *args):
raise NotImplementedError("Solver not implemented")
def vcl_inplace_solve_call(self, *args):
raise NotImplementedError("In-place solver not implemented")
class So... | |
import re
from bot import Command, categories
from bot.utils import is_float
pat_currency = re.compile('[a-zA-Z]{3}')
baseurl = 'https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE' \
'&from_currency={}&to_currency={}&apikey={}'
baseurl_sbif = 'https://api.sbif.cl/api-sbifv3/recursos_api/{}?ap... | |
# 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 requ... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | |
"""
sphinx.builders._epub_base
~~~~~~~~~~~~~~~~~~~~~~~~~~
Base class of epub2/epub3 builders.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import html
import os
import re
from os import path
from typing import Any, Dict, List, NamedT... | |
#------------------------------------------------------------------------------
# Tests for DataFrame various cases. Uses external csv control files
import os
import numpy as np
import pandas as pd
import nose.tools as nt
import lamana as la
import lamana.utils.tools as ut
from lamana import constructs as con
from ... | |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
#!/usr/bin/python
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2016 ZAP Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | |
# 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 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... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
from contextlib import nullcontext
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal, assert_array_almost_equal_nulp
from astropy.convolution.convolve import convolve_fft, convolve
from astro... | |
"""Memory mapped interface builder."""
import copy
import re
from scoff.ast.visits.syntax import SyntaxChecker
# from scoff.ast.visits.control import SetFlag, ClearFlagAfter
import hdltools.util
from hdltools.abshdl.const import HDLIntegerConstant
from hdltools.abshdl.expr import HDLExpression
from hdltools.abshdl.m... | |
"""A setuptools based setup module.
"""
from __future__ import print_function
import os
import fnmatch
import re
import sys
import subprocess
import yaml
# Always prefer setuptools over distutils
from setuptools import setup, Command
from setuptools_lint.setuptools_command import PylintCommand
from six import string... | |
# encoding: utf8
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version... | |
#!/usr/bin/env python
#
# GrovePi Library for using the Grove - Gesture Sensor v1.0(http://www.seeedstudio.com/depot/Grove-Gesture-p-2463.html)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this lib... | |
import datetime
import inspect
import os
import subprocess
import sys
import textwrap
import time
import uuid
import varlink
if sys.version_info[0] == 2:
raise ImportError("The mock module isn't compatible with python 2")
def cast_type(typeof):
cast = {'str': 'string'}
typeof = str(typeof).replace("<cl... | |
# Copyright 2013: 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... | |
config = {
"name": "Planetoids", # plugin name
"type": "generator", #plugin type
"description": ["Planetoids & Terra"] #description
}
import sys
if __name__ == "__main__":
sys.path.extend(["."])
import os
os.chdir("..")
del (os)
from math import cos, sin, pi
from collections import defa... | |
import numpy as np
import pandas as pd
def unique_row(a):
"""
Returns an array of the ordered, unique set of rows for input array a.
Parameters
----------
a: array
an array with replicated rows.
returns
-------
unique_a: array
an ordered array without replicated rows.... | |
# 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... | |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | |
# ******************************************************************************
# Copyright 2014-2018 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.apa... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 11 22:01:59 2016
@author: ajaver
"""
import numpy as np
import tables
import pandas as pd
import warnings
from tierpsy.helper.params import read_fps, read_microns_per_pixel
from tierpsy.helper.misc import print_flush, get_base_name
from tierpsy.analysis.stage_aligment.f... | |
#!/usr/bin/env python
import os
import argparse
import subprocess
import time
import shutil
import socket
import numpy as np
from pychemia.code.abinit import AbinitInput, AbinitOutput
from pychemia.population.orbitaldftu import dmatpawu2params
def which(program):
import os
def is_exe(fpath):
return ... | |
# Copyright 2019 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
AUXV_SUPPORT_FEATURE_NAME = "qXfer:auxv:read"
@s... | |
"""Base class for mixture models."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import warnings
from abc import ABCMeta, abstractmethod
from time import time
import numpy as np
from .. import cluster
from ..base import BaseEstima... | |
# Super simple Illustrator SVG processor for animations. Uses the BeautifulSoup python xml library.
import os
import errno
from bs4 import BeautifulSoup
def create_file(path, mode):
directory = os.path.dirname(path)
if directory != '' and not os.path.exists(directory):
try:
os.makedirs(directory)
except OSE... | |
# 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... | |
from typing import Sequence
import mock
from kubernetes.client import V1Deployment
from kubernetes.client import V1StatefulSet
from pytest import raises
from paasta_tools.kubernetes.application.controller_wrappers import Application
from paasta_tools.kubernetes_tools import InvalidKubernetesConfig
from paasta_tools.k... | |
# gridworld.py
# ------------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein... | |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
from __future__ import absolute_import, print_function
import copy
import sys
from numba import ctypes_support as ctypes
from numba.typing.templates import AbstractTemplate
from numba import config, compiler, types
from numba.typing.templates import ConcreteTemplate
from numba import funcdesc, typing, utils
from .cud... | |
import ptypes, math, logging
from ptypes import *
from .primitives import *
ptypes.setbyteorder(ptypes.config.byteorder.bigendian)
### primitives
## float types
class FLOAT16(pfloat.half): pass
class FLOAT(pfloat.single): pass
class DOUBLE(pfloat.double): pass
## int types
class SI8(pint.int8_t): pass
class SI16(pi... | |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | |
#--------------------------
# lexer.py
#
# Verilog-AMS Lexical Analyzer
#
# Copyright (C) 2015, Andrew Plumb
# License: Apache 2.0
#--------------------------
from __future__ import absolute_import
from __future__ import print_function
import sys
import os
import re
sys.path.insert(0, os.path.dirname(os.path.dirname(o... | |
"""
Created on Thu Mar 24 08:18:04 2016
@author: npop
Univariate Statistics
Controls saving and access to various statistics
The number of statistics per window has to be provided by the user
This is better for long-term usage
"""
import numpy as np
import scipy.stats as stats
import scipy.interpolate as interp
from c... | |
# Copyright 2021 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, ... | |
'''
Used to parse / process hawkeye data
'''
import numpy as np
from collections import deque
import os
import math
import utilities.paths as paths
import glob
import collections
DRIVE = paths.get_drive(2)
# get projection file list in order, put into dict, where key is timestamp reset to relate to frame of input v... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This code implements a basic, Twitter-aware tokenizer.
A tokenizer is a function that splits a string of text into words. In
Python terms, we map string and unicode objects into lists of unicode
objects.
There is not a single right way to do tokenizing. The best meth... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | |
# -*- coding: utf-8 -*-
"""
chemdataextractor.cli.pos
~~~~~~~~~~~~~~~~~~~~~~~~~
Part of speech tagging commands.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import click
from ..doc import Document, Text
from ..nlp.corpus import gen... | |
import numpy as np
from simupy.block_diagram import SimulationMixin
import warnings
need_state_equation_function_msg = ("if dim_state > 0, DynamicalSystem must"
+ " have a state_equation_function")
need_output_equation_function_msg = ("if dim_state == 0, DynamicalSystem must"
... | |
"""
mobile
=======
Devices which (are supposed to) move in a predictable way
Configurable parameters::
{
"area_centre" : e.g. "London, UK" } optional, but both must be specified if either are. Points-to-visit will be within this set.
"area_radius" : e.g. "Manchester, UK" }
"num_lo... | |
from cspace import CSpace
from .. import robotsim
from ..model import collide
from cspaceutils import AdaptiveCSpace,EmbeddedCSpace
import math
import random
class RobotCSpace(CSpace):
"""A basic robot cspace that allows collision free motion.
Warning: if your robot has non-standard joints, like a free-
f... | |
import cherrypy, re, os.path, cPickle as pickle, time, calendar
from base_proxy import BaseProxy
import tools.hashlib_shortcuts, tools.file
def expires_to_timestamp(expires):
try:
# Expires: 0
int(expires)
return time.time()-86400
except:
return calendar.timegm(time.strptime(ex... | |
import html
import importlib
import re
import token
import tokenize
from io import StringIO
from pathlib import Path
from collections import defaultdict, deque, namedtuple, ChainMap
from typing import Dict, Iterable
TOK_COMMENT = "comment"
TOK_TEXT = "text"
TOK_VAR = "var"
TOK_BLOCK = "block"
tag_re = re.compile(r"{... | |
from savman import gamefind
import os
import gzip
import string
import json
import yaml
import sys
import fnmatch
import logging
import hashlib
from savman.vbackup import Backup
class InvalidIdError(Exception): pass
class Game:
def __init__(self, gid, name):
self.id = gid
self.name = name
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import imp
import os
from config import *
import instances as inst
import util
def _prompt_config(lab, path):
"""Prompt for the lab configuration script"""
# TODO: Check for valid input
files = [d for d in os.listdir(path) if os.path.isfile(os.path.join(pat... | |
# Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
from enum import IntEnum
import datetime
from project.bl.utils import Resource
from project.extensions import db
from project.lib.orm.types import TypeEnum, GUID
from sqlalchemy.ext.orderinglist import ordering_list
from sqlalchemy.ext.associationproxy import association_proxy
from project.lib.orm.conditions import Con... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Forker configuration broker.
A simple servlet handling GET and DELETE commands to provide a raw JSON
configuration for the requested isolate, if available.
The stored configurations should be the ones given by a monitor requesting to
start an isolate.
A confi... | |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2009, Eucalyptus Systems, Inc.
# 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 res... | |
#!/usr/bin/env python
# pylint: skip-file
from __future__ import absolute_import, division, print_function
import salt.ext.tornado.escape
from salt.ext.tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode, squeeze, recursive_unicode
from salt.ext.to... | |
from rest_framework import serializers as ser
from rest_framework import exceptions
from modularodm import Q
from modularodm.exceptions import ValidationValueError
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from django.conf import settings
from website.project.metadata.sc... | |
from unittest import TestCase
from unittest import SkipTest
from chatterbot.adapters.storage import MongoDatabaseAdapter
from chatterbot.conversation import Statement, Response
class MongoAdapterTestCase(TestCase):
def setUp(self):
"""
Instantiate the adapter.
"""
from pymongo.err... | |
# Copyright (c) 2017 DataCore Software Corp. 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... | |
# Copyright (c) 2010 Chris Moyer http://coredumped.org/
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation ... | |
# -- coding: utf-8 --
import logging
import matplotlib.pyplot as plt
import numpy
import data_capture
import mks
class PostProcessor:
def __init__(self, run_experiment, run_data_capture, cfg, notify):
self._run_experiment = run_experiment
self._run_data_capture = run_data_capture
self._... | |
"""Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | |
""" Classes for interpolating values.
"""
__all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp',
'ppform', 'lagrange']
from numpy import shape, sometrue, rank, array, transpose, searchsorted, \
ones, logical_or, atleast_1d, atleast_2d, meshgrid, ravel, \
... | |
import echidna.core.spectra as spectra
import numpy
class Shift(object):
""" A class for shifting the parameter space of a spectra.
Attributes:
_shift (float): The factor you want to shift a parameter by.
"""
def __init__(self):
""" Initialise the Shift class.
"""
self.... | |
from __future__ import absolute_import, unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.shop.defaults
# with default values, but are common enough to be p... | |
import argparse
import pickle
import os, sys
"""
NetworkAnalysis
2017 Joaquim Aguirre-Plans
Structural Bioinformatics Laboratory
Universitat Pompeu Fabra
"""
#################
#### CLASSES ####
#################
class HouseKeepingGenes(object):
""" Class defining a HouseKeepingGenes 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 applicab... | |
"""
Enhanced subprocess.Popen subclass, supporting:
* .communicate() with timeout
Sample usage:
out, err = Popen(...).communicate(input, timeout=300)
"""
# --------------------------------------------------------------------
import os, subprocess
if subprocess.mswindows:
import threading
else:
import... | |
"""Unit test for cgutils module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import os
import shutil
import tempfile
import unittest
# Disable W0611: Unused import
import tests.treadmill_test_skip_w... | |
#!/usr/bin/env python
# this script sets up the testing packages to allow the tests
# 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 ... | |
# Copyright 2021 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 o... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions implementing some of the
algorithms contained within Jean Meeus, 'Astronomical Algorithms',
second edition, 1998, Willmann-Bell.
"""
from __future__ import (absolute_import, division, print_function,
... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import gzip
import json
import os
import random
import unittest
from collections import OrderedDict
import numpy as np
import pandas as pd
from pymatgen import yaml
from pymatgen.core.periodic_table import Ele... | |
# -*- coding: utf-8 -*-
# custom
from mxm.midifile.src.data_type_converters import readBew, readVar, varLen, from_twos_complement, to_twos_complement
from mxm.midifile.src import constants as c
class EventDispatcher:
def __init__(self, event_handler):
"""
The event dispatcher generates e... | |
import logging
import struct
import zlib
from kafka.codec import (
gzip_encode, gzip_decode, snappy_encode, snappy_decode
)
from kafka.common import (
BrokerMetadata, PartitionMetadata, Message, OffsetAndMessage,
ProduceResponse, FetchResponse, OffsetResponse,
OffsetCommitResponse, OffsetFetchResponse,... | |
# 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... | |
import os
import warnings
import re
import html
import logging
import json
import datetime
import unicodedata
import traceback
from bs4 import BeautifulSoup
from lxml import etree
try:
import urllib.parse as urlparse
except:
import urlparse
import collections
import itertools
class Parser(object):
def __i... | |
# -*- coding: utf-8 -*-
import unittest
#import logging
import pyb
import gc
import math
import random
from sys import platform
from ws2812 import WS2812, Pixel, PREALLOCATE, CACHE, RECREATE
#log = logging.getLogger("test_ws2812")
def tg(led_count, start):
def triple(n):
for i in range(3):
... | |
# Copyright (c) 2014 ProphetStor, 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 req... | |
# Copyright 2001 by Katharine Lindner. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Martel based parser to read MetaTool output files.
This is a huge regular regular expr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.