gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import datetime
import re
from typing import List, Optional, Union
import dateutil.parser
import dateutil.relativedelta as rdelta
import typepy
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
class DateT... | |
"""Neural Network Policy implementation."""
from SafeRLBench import Policy
from SafeRLBench.error import add_dependency, MultipleCallsException
from SafeRLBench.spaces import RdSpace
import numpy as np
from numpy.random import normal
try:
import tensorflow as tf
except ModuleNotFoundError:
tf = None
import ... | |
"""
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE!
All settings changes should be done by copy-pasting the variable and
its value to game/settings.py. An empty game/settings.py can be
auto-generated by running game/manage.py without any arguments.
Hint: Don't copy&paste ov... | |
# 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... | |
#!/usr/bin/python
# coding: UTF-8
# kegdata service to read about key status
# Written by: Ron Ritchey
from __future__ import unicode_literals
import json, threading, logging, Queue, time, getopt, sys, logging
import RPi.GPIO as GPIO
from hx711 import HX711
# HOW TO CALCULATE THE REFFERENCE UNIT
# To set the refer... | |
#!/usr/bin/env python
from __future__ import print_function
import copy
import os
import logging
from peyutil import read_as_json
from taxalotl.tax_partition import (INP_TAXONOMY_DIRNAME,
MISC_DIRNAME,
GEN_MAPPING_FILENAME,
... | |
#!/usr/bin/env python
# OpenVirteX control script
# Heavily based on FlowVisor's fvctl
#import python utilities to parse arguments
import sys
from optparse import OptionParser
import urllib2
import json
import getpass
VERSION = '0.1'
SUPPORTED_PROTO = ['tcp']
def getUrl(opts, path):
return URL % (opts.host, o... | |
from generator.actions import Actions
import random
import struct
import sys
import random
class enemy(object):
def __init__(self, x, y, board):
self.myBoard = board
self.x = x;
self.y = y;
self.quadrant = 0;
self.homeColumn = x/2
def __eq__(self, other):
if (self.x == other.x) and (self.y == other.y):... | |
# Copyright (c) 2015 Hitachi Data Systems, 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
#
# U... | |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | |
#!/usr/bin/env python
import argparse
import zmq
# import uuid
import os
import sys
import platform
import random
import time
import pickle
import logging
import queue
import threading
import json
from parsl.version import VERSION as PARSL_VERSION
from ipyparallel.serialize import serialize_object
LOOP_SLOWDOWN = 0.0... | |
# Copyright (c) 2010-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
#
# Unless required by applicable law or agree... | |
from django.conf import settings
from django.template.base import Context, TemplateSyntaxError
from django.template.loader import get_template
from django.test import SimpleTestCase
from .utils import render, setup, SilentGetItemClass, SilentAttrClass, SomeClass
basic_templates = {
'basic-syntax01': 'something c... | |
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils.text import slugify
from django.utils.html import strip_tags
from protein.models import (Protein, ProteinConformation, ProteinState, ProteinSequenceType, ProteinSegment,
ProteinFusion, ProteinFusionProt... | |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | |
'''
.. module:: strategies
This module contains the backtesting strategies
.. moduleauthor:: Christopher Phillippi <c_phillippi@mfe.berkeley.edu>
'''
from pandas.stats.api import ols
import datetime
import normalize
import numpy as np
import numpy.linalg as nplinalg
import pandas as pd
import scipy.optimize as opti... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# tests for the config reader module
from tardis.io import config_reader
from astropy import units as u
import os
import pytest
import yaml
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from tardis.util import parse_quantity
def data_path(filename):
data_dir = os.path... | |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: type_Result.py
from types import *
import array
RESULT_UNIQUE_NAME = 0
RESULT_REGISTERED = 4
RESULT_DEREGISTERED = 5
RESULT_DUPLICATE = 6
RESULT_DUPL... | |
from datetime import datetime, timedelta
from operator import attrgetter
from django.contrib.auth import get_user_model
from django.db import IntegrityError
from django.test import TestCase, skipUnlessDBFeature
from ..models import Document, Poll
User = get_user_model()
class AsOfTest(TestCase):
model = Docume... | |
"""
Earley Parser.
@author: Hardik
"""
import argparse
import sys
import string
from collections import defaultdict
from nltk.tree import Tree
class Rule(object):
"""
Represents a CFG rule.
"""
def __init__(self, lhs, rhs):
# Represents the rule 'lhs -> rhs', where lhs is a non-terminal and
# rhs is a lis... | |
import re
import numpy as np
def get_atoms_adapter(monomer, arg):
return monomer.get_atoms(arg)
def get_atomset_adapter(monomer, arg):
return monomer.get_atomset(arg)
def get_not_atomset_adapter(monomer, arg):
return monomer.get_not_atomset(arg)
def regex_get_other_atoms_adapter(monomer, arg):
re... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
python %prog study.file population.file gene-association.file
This program returns P-values for functional enrichment in a cluster of
study genes using Fisher's exact test, and corrected for multiple testing
(including Bonferroni, Holm, Sidak, and false discovery rate... | |
# 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... | |
# $Id: test_MurckoScaffold.py 3672 2010-06-14 17:10:00Z landrgr1 $
#
# Created by Peter Gedeck, June 2008
#
from collections import namedtuple
import doctest
import unittest
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from rdkit.Chem.Scaffolds.MurckoScaffold import (GetScaffoldForMol, _pyGe... | |
"""
:mod:`zsl.resource.json_server_resource`
----------------------------------------
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
import http.client
import logging
import re
from typing import Any, Dict
from flask import request
from sqlalchemy import ... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | |
# Copyright 2010-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... | |
from sklearn import svm
import datetime
from datetime import date
import random
from scipy import spatial
# import numpy as np
playerPos={}
with open("nflPlayerInfo") as f:
for line in f:
tup=eval(line)
playerPos[tup[0]]=tup[6]
topPlayerInfo={}
with open("nflTopPlayersInfo") as f:
for line in f:
tup=eval(lin... | |
# -*- coding: utf-8 -*-
"""Test exporting functions."""
# Authors: MNE Developers
#
# License: BSD-3-Clause
from datetime import datetime, timezone
from mne.io import RawArray
from mne.io.meas_info import create_info
from pathlib import Path
import os.path as op
import pytest
import numpy as np
from numpy.testing imp... | |
from pyglet.gl import *
from camera import *
from light import *
from fos.actor import Box, Actor
from fos.transform import *
from vsml import vsml
from actor.base import DynamicActor
class Scene(object):
def __init__(self, scenename="Main", transform=None,
extent_min=None, extent_max=None,
... | |
"""
Django-specific helper utilities.
"""
from __future__ import print_function
import os
import re
import sys
import traceback
import glob
from importlib import import_module
from collections import defaultdict
from pprint import pprint
import six
from six import StringIO
from burlap import Satchel
from burlap.cons... | |
"""
test code for html_render.py
includes step 4
"""
import io
from html_render import (Element,
Html,
Body,
P,
TextWrapper,
Head,
Title,
)
# ... | |
import json
from django.conf import settings
from django.core.mail import send_mail, BadHeaderError
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.utils.translation import ugettext_lazy as _
from... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | |
"""ACME AuthHandler."""
import itertools
import logging
import time
import zope.component
from acme import challenges
from acme import messages
from letsencrypt import achallenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces
logger = logging.getLogger(__name__... | |
#!/usr/bin/python
#pylint: skip-file
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# A... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2011 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | |
"""
.. module:: dj-stripe.tests.__init__
:synopsis: dj-stripe test fakes
.. moduleauthor:: Alex Kavanaugh (@kavdev)
.. moduleauthor:: Lee Skillen (@lskillen)
A Fake or multiple fakes for each stripe object.
Originally collected using API VERSION 2015-07-28.
Updated to API VERSION 2016-03-07 with bogus fields.
"""... | |
"""
sentry.models.user
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
import warnings
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django... | |
from direct.directnotify import DirectNotifyGlobal
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from DistributedMinigame import *
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State
from direct.fsm import S... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
# 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... | |
#
# 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
# --------------------------------------------------------------------------
# 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/python
# 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.
"""Unittest for cros_test_lib (tests for tests? Who'd a thunk it)."""
import os
import sys
import time
import unittest
sys.path.in... | |
from galaxy_analysis.plot.plot_styles import *
import numpy as np
from scipy import integrate
import yt
import os, sys
import matplotlib.pyplot as plt
import glob
# AE: Comment out below import unless you feel like
# installing a bunch of stuff:
# from galaxy_analysis.plot.plot_styles import *
SolarAbundances = n... | |
from django.conf import settings
from protein.models import Protein, ProteinConformation, ProteinAnomaly, ProteinState, ProteinSegment
from residue.models import Residue
from residue.functions import dgn, ggn
from structure.models import *
from structure.functions import HSExposureCB, PdbStateIdentifier, update_templa... | |
# coding: UTF-8
"""Layer for packing data into one tunnel.
Packet Structure:
Packet in this layer can be divided into two part, one is header,
the other is body. Body of a packet is plain data which is
received from or being sent to the counterpart of an outside
connection. The following figure illus... | |
"""
Spatial Discretizor
-------------------
Module which contains the classes to 'discretize' a topological space.
When we talk about discretize we talk about creating a non-bijective
mathematical application between two topological spaces.
The main function of an spatial discretization class is the transformation of... | |
import logging
import unittest
from unittest import mock
from . import setup_test_files
import bigchaindb_driver
from prov2bigchaindb.core import clients, accounts, utils, exceptions, local_stores
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
class BaseAccountTest(unittest.TestCase):
... | |
import tempfile
import shutil
import os
import inspect
from lib import BaseTest
class AddRepo1Test(BaseTest):
"""
add package to local repo: .deb file
"""
fixtureCmds = [
"aptly repo create -comment=Repo1 -distribution=squeeze repo1",
]
runCmd = "aptly repo add repo1 ${files}/libboost-... | |
class MoveDirection(object):
ROTATE = 0x00
LEFT = 0x01
RIGHT = 0x02
UP = 0x03
DOWN = 0x04
POSITION = 0x05
class Deck(object):
unit = None
cell = None
def __init__(self, unit):
self.unit = unit
def bind(self, cell):
self.cell = cell
self.cell.bind(self... | |
# -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# License: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | |
# 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 ... | |
import operator
import ipaddr
import re
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.core.exceptions import ValidationError
from django.db.models import Q
from cyder.core.system.models import System
from cyder.cydhcp.interface.static_intr.models import StaticInterface
fro... | |
# Copyright 2015 Dell 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... | |
#!/usr/bin/python
# Copyright (c) 2009, Andrew McNabb
# Copyright (c) 2003-2008, Brent N. Chun
import os
import sys
import shutil
import tempfile
import time
import unittest
basedir, bin = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0])))
sys.path.append("%s" % basedir)
if os.getenv("TEST_HOSTS") is Non... | |
# 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... | |
'''
Consumption-saving models with aggregate productivity shocks as well as idiosyn-
cratic income shocks. Currently only contains one microeconomic model with a
basic solver. Also includes a subclass of Market called CobbDouglas economy,
used for solving "macroeconomic" models with aggregate shocks.
'''
import os
os... | |
"""
pygments.lexers._openedge_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = (
'ABS',
'ABSO',
'ABSOL',
'ABSOLU',
'... | |
# coding: utf-8
# pylint: disable=invalid-name, protected-access, too-many-arguments, no-self-use, too-many-locals, broad-except
"""numpy interface for operators."""
from __future__ import absolute_import
import traceback
from threading import Lock
from ctypes import CFUNCTYPE, POINTER, Structure, pointer
from ctypes... | |
#!/usr/bin/env python
'''======================================================
Created by: D. Spencer Maughan and Ishmaal Erekson
Last updated: March 2015
File name: DF_Plots.py
Organization: RISC Lab, Utah State University
======================================================'''
import roslib... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import base64
import calendar
import collections
import itertools
from co... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MRUListEx Windows Registry plugin."""
from __future__ import unicode_literals
import unittest
from dfdatetime import filetime as dfdatetime_filetime
from dfwinreg import definitions as dfwinreg_definitions
from dfwinreg import fake as dfwinreg_fake
fro... | |
#!/usr/bin/env python3
from asciimatics.widgets import Frame, TextBox, Layout, Label, Divider, Text, \
CheckBox, RadioButtons, Button, PopUpDialog, TimePicker, DatePicker, DropdownList, PopupMenu
from asciimatics.effects import Background
from asciimatics.event import MouseEvent
from asciimatics.scene import Scene... | |
# Utilities for TARDIS
from astropy import units as u, constants
import numexpr as ne
import numpy as np
import os
import yaml
import re
import logging
import atomic
k_B_cgs = constants.k_B.cgs.value
c_cgs = constants.c.cgs.value
h_cgs = constants.h.cgs.value
m_e_cgs = constants.m_e.cgs.value
e_charge_gauss = const... | |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012, Cloudscaling
# 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
#
# ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# JRTPLIB documentation build configuration file, created by
# sphinx-quickstart on Fri May 13 17:36:32 2016.
#
# 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
# au... | |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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... | |
# Copyright 2016 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 ag... | |
# coding: utf8
"""
Delphi Decision Maker - Controllers
"""
module = request.controller
if module not in deployment_settings.modules:
session.error = T("Module disabled!")
redirect(URL(r=request, c="default", f="index"))
response.menu_options = [
[T("Active Problems"), False, URL(r=request, f="index"... | |
# Copyright 2012 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 by ... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "heatmapgl"
_path_str = "heatmapgl.hoverlabel"
_valid_props = {
"align",
... | |
# 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... | |
"""
Support for ZWave HVAC devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/hvac.zwave/
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
import logging
from blumate.components.hvac import DOMAIN
from blumate.component... | |
from cheeseprism.utils import path
from cheeseprism.utils import resource_spec
from itertools import count
from mock import Mock
from mock import patch
from pprint import pformat as pprint
from stuf import stuf
import futures
import json
import logging
import subprocess
import textwrap
import unittest
logger = logging... | |
"""Includes the Validation and Validator classes."""
import idb.util as util
class Validation(object):
"""A simple validation mechanism, designed for use by idb.data.ModelBase."""
def __init__(self, callback, property_name=None, message=None, is_simple=True,
is_property_specific=True):
"""
... | |
from __future__ import unicode_literals
import unittest
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from operator import attrgetter, itemgetter
from uuid import UUID
from django.core.exceptions import FieldError
from django.db import connection, models
from django.db.models import... | |
# -*- coding: utf-8 -*-
"""
Script to "calculate" the detector.
The script estimates the number of photons landing on the scintillator
from the source and the number of photons reaching the detector.
Also it displays the geometrical situation depending no the chosen parameters.
You can run this script to produce seve... | |
"""
Author: Dr. John T. Hwang <hwangjt@umich.edu>
This package is distributed under New BSD license.
"""
import numpy as np
import scipy.sparse
from numbers import Integral
from smt.utils.linear_solvers import get_solver, LinearSolver, VALID_SOLVERS
from smt.utils.line_search import get_line_search_class, LineSearch,... | |
# Copyright (c) 2019, CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribu... | |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/lice... | |
# Copyright (c) 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | |
#!/usr/bin/python
#coding:utf-8
###########################################################
### Utilities for Plexon data collection
### Written by Huangxin
###########################################################
import numpy as np
import logging
logger = logging.getLogger('SpikeRecord.Plexon')
from SpikeRecord i... | |
"""
Preprocess pipeline
"""
import datetime
import logging
import os.path
import numpy as np
from .. import read_config
from ..batch import BatchProcessorFactory
from .detect import threshold_detection
from .filter import whitening_matrix, whitening, localized_whitening_matrix, whitening_score, butterworth
from .sco... | |
# -*- coding: iso-8859-1 -*-
"""Get useful information from live Python objects.
This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the usef... | |
"""
Information-theoretic calculations
"""
import numpy as np
import pandas as pd
from sklearn import cross_validation
EPSILON = 100 * np.finfo(float).eps
def bin_range_strings(bins, fmt=':g'):
"""Given a list of bins, make a list of strings of those bin ranges
Parameters
----------
bins : list_lik... | |
"""Miscellaneous inheritance-related tests, many very old.
These are generally tests derived from specific user issues.
"""
from sqlalchemy.testing import eq_
from sqlalchemy import *
from sqlalchemy import util
from sqlalchemy.orm import *
from sqlalchemy.orm.interfaces import MANYTOONE
from sqlalchemy.testing impor... | |
"""
test all other .agg behavior
"""
import datetime as dt
from functools import partial
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
PeriodIndex,
Series,
date_range,
period_range,
)
impo... | |
"""Commands part of Websocket API."""
import asyncio
import logging
import voluptuous as vol
from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_READ
from homeassistant.components.websocket_api.const import ERR_NOT_FOUND
from homeassistant.const import EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_... | |
##########################################################################
#
# Copyright (c) 2012-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | |
from __future__ import print_function
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import subprocess
# # # # # # # # # # # # #
# Function definitions. #
# # # # # # # # # # # # #
# Range function for floats.
def frange(start, end=None, inc=None):
"A range fu... | |
# -*- encoding: utf-8 -*-
'''
Hubble Nova plugin for running arbitrary commands and checking the output of
those commands
This module is deprecated, and must be explicitly enabled in pillar/minion
config via the hubblestack:nova:enable_command_module (should be set to True
to enable this module). This allows nova to r... | |
# 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
#
# Unless required by applicable law or agreed to in... | |
from __future__ import division, print_function, absolute_import
import numpy as np
import warnings
from ..utils.six.moves import xrange
from dipy.core.geometry import cart2sphere, sphere2cart, vector_norm
from dipy.core.onetime import auto_attr
from dipy.reconst.recspeed import remove_similar_vertices
__all__ = ['... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test fee estimation code."""
from decimal import Decimal
import random
from test_framework.messages im... | |
from nose.tools import * # flake8: noqa
from framework.auth.core import Auth
from osf.models import AbstractNode as Node
from website.util import permissions
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
... | |
# -*- coding: utf-8 -*-
import os
import datetime
import httplib as http
import time
import functools
import furl
import itsdangerous
import jwe
import jwt
import mock
import pytest
from django.utils import timezone
from django.contrib.auth.models import Permission
from framework.auth import cas, signing
from framewo... | |
import functools
from django.db.models import Q
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_unicode
from avocado.models import DataField
from avocado.events import usage
from restlib2.http import codes
from restlib2.resources import Resource
from serrano.resources.field.values i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.