gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import If, Switch, Concat
from hwt.code_utils import rename_signal
from hwt.hdl.types.bits import Bits
from hwt.hdl.types.defs import BIT
from hwt.hdl.types.struct import HStruct
from hwt.interfaces.std import Signal, Handshaked, VectSignal, \
HandshakeS... | |
"""Functions to construct sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag']
import numpy as np
from sc... | |
# 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... | |
'''
Created on Aug 4, 2011
@author: sean
'''
from __future__ import print_function
from ..visitors import Visitor, visit_children
from ..visitors.symbol_visitor import get_symbols
import ast
from ...utils import py2op
class ConditionalSymbolVisitor(Visitor):
def __init__(self):
self._cond_lhs = set()
... | |
#!/usr/bin/env python
#
#-----------------------------------------------------------------------
# A test suite for the table interface built on bsddb.db
#-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Sm... | |
"""Test code for sparse operator"""
import numpy as np
import tvm
import topi
import topi.testing
from topi.util import get_const_tuple
import tvm.contrib.sparse as tvmsp
from collections import namedtuple
import time
def verify_dynamic_csrmv(batch, in_dim, out_dim, use_bias=True):
nr, nc, n = tvm.var("nr"), tvm.v... | |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.linalg.blas import get_blas_funcs
try:
norm = get_blas_funcs("znrm2", dtype=np.float64)
except:
from scipy.linalg import norm
from numpy.random import RandomState
from qutip.qobj import Qobj, isket
from qutip.solver import Result
from qutip.expect import ... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from __future__ import absolute_import
import sugartensor as tf
# noinspection PyPackageRequirements
import numpy as np
__author__ = 'namju.kim@kakaobrain.com'
#
# transform sugar functions
#
@tf.sg_sugar_func
def sg_identity(tensor, opt):
r"""Returns the same tensor
Args:
tensor: A `Tensor` (automa... | |
# Copyright 2014 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, ... | |
# RiveScript-Python
#
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# https://www.rivescript.com/
from __future__ import unicode_literals
import copy
class SessionManager(object):
"""Base class for session management for RiveScript.
The session manager keeps ... | |
__all__ = ['imread', 'imsave']
import numpy as np
from six import string_types
from PIL import Image
from ...util import img_as_ubyte, img_as_uint
from .tifffile_plugin import imread as tif_imread, imsave as tif_imsave
def imread(fname, dtype=None, img_num=None, **kwargs):
"""Load an image from file.
Param... | |
# -*- coding: utf-8 -*-
"""
Base settings file, common to all environments.
These settings can be overridden in local.py.
"""
import datetime
import os
import json
import hashlib
from datetime import timedelta
from collections import OrderedDict
os_env = os.environ
def parent_dir(path):
'''Return the parent of ... | |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | |
import os
import sys
import boto
import subprocess
from landsat.downloader import Downloader
from landsat.landsat import Process
from boto.s3.key import Key
from shutil import rmtree
from datetime import datetime
from models import UserJob_Model, WorkerLog
from boto import utils
import socket
from sqs import (make_SQS_... | |
""" IO interface to GeoTiffs using GDAL. """
import struct
import sys
from math import ceil
import numpy as np
from .band import CompressedBand
from .. import errors
import osgeo.gdal
import osgeo.osr
import osgeo.gdalconst as gc
osgeo.gdal.UseExceptions()
ALL = -1
class GdalFileBand(object):
""" Read-only rast... | |
# -*- coding: utf-8 -*-
import mock
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
)
from website.settings import MAILCHIMP_GENERAL_LIST, OSF_HELP_LIST
@pytest.fixture()
def user_one():
return AuthUserFactory()
@pytest.fixture()
def user_two()... | |
# -*- test-case-name: flocker.node.agents.functional.test_cinder,flocker.node.agents.functional.test_cinder_behaviour -*- # noqa
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
A Cinder implementation of the ``IBlockDeviceAPI``.
"""
import time
from uuid import UUID
from bitmath import Byte, GiB
fro... | |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
import time
import re
import queue
import datetime
import signal
import argparse
import sys
import os
import zmq
from twisted.internet import reactor, protocol, threads
def agrparser():
parser = argparse.ArgumentParser(
description=' zmq(port) -> tcp/ip(ip/por... | |
# Framework for setting Input and Output expectations in a unit test.
#
# This file defines the class ExpectedInputOutput which can be used to override
# sys.stdout to validate that expected outputs are printed and sys.stdin to
# inject mock responses in the standard input. This is useful in unit test, to
# validate th... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 NTT DOCOMO, 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... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
from __future__ import ... | |
#
# Simple benchmarks for the processing package
#
import time, sys, multiprocess as processing, threading, queue as Queue, gc
processing.freezeSupport = processing.freeze_support
xrange = range
if sys.platform == 'win32':
_timer = time.clock
else:
_timer = time.time
delta = 1
#### TEST_QUEUESPEED
def que... | |
# 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... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import asyncio
from aiopg import connect
import functools
import unittest
from unittest import mock
import pytest
sa = pytest.importorskip("aiopg.sa") # noqa
from sqlalchemy import MetaData, Table, Column, Integer, String
meta = MetaData()
tbl = Table('sa_tbl2', meta,
Column('id', Integer, nullable=Fal... | |
from flask import has_request_context, _request_ctx_stack, flash, request, current_app, session
import flask_login
from flask_login.utils import _get_user
from frasco.ext import get_extension_state, has_extension
from frasco.ctx import ContextStack
from frasco.utils import match_email_domain, populate_obj
from frasco.m... | |
#!/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... | |
# encoding: 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 model 'SearchToken'
db.create_table('sentry_searchtoken', (
('id', self.gf('django.db... | |
import arrow
from extensions import db
class Client(db.Model):
'''define the client node'''
__primarykey__ = 'company_id'
person = db.Label()
company_id = db.Property()
company_name = db.Property()
has_onboard = db.RelatedTo('Onboard')
@staticmethod
def create(company_id, comp... | |
#!/usr/bin/env python
from unittest import main, TestCase
import numpy as np
import pandas as pd
from numpy.testing import assert_array_equal
from pandas.util.testing import assert_frame_equal, assert_index_equal, \
assert_series_equal
from neurokernel.pm import BasePortMapper, PortMapper
class test_base_port_m... | |
import datetime
from dateutil import parser
from itertools import tee
from jinja2 import Template, Environment, FileSystemLoader
import os
import re
import shutil
import time
import warnings
import yaml
DEFAULT_TIME = datetime.time(9, 0)
MAX_SLUG_LENGTH = 30
class Date:
def __init__(self, datetime):
self.datet... | |
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import resolve, reverse
from django.http import HttpResponseRedirect
from django.conf import settings
from console.forms import NewDomainForm, TagForm
from console.views import home, me_page, logout, domains, domain, tags,\
tag, contain... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
"""
Support the OwnTracks platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.owntracks/
"""
import asyncio
import json
import logging
import base64
from collections import defaultdict
import voluptuous as vol
from homeassistant.cor... | |
from _rawffi import alt as _ffi
import _rawffi
from _ctypes.basics import _CData, cdata_from_address, _CDataMeta, sizeof
from _ctypes.basics import keepalive_key, store_reference, ensure_objects
from _ctypes.basics import CArgObject, as_ffi_pointer
class ArrayMeta(_CDataMeta):
def __new__(self, name, cls, typedic... | |
import windows
import windows.generated_def as gdef
import struct
try:
unichr # Py2/Py3 compat
except NameError:
unichr = chr
# http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm#tagcjh_19_03_07
## Array
# A conformant array is an array in which the maximum number of elements is not known beforehand an... | |
from __future__ import absolute_import, print_function
from failover import count, fail, Hysteresis, ok, second
import logging
from sys import stderr
from time import sleep
from units import unit
from unittest import TestCase, main
class TestTask(object):
def __init__(self, result=ok):
super(TestTask, self... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import collections
import acq4.analysis.atlas.Atlas as Atlas
import os
from acq4.util import Qt
import acq4.util.DataManager as DataManager
from acq4.analysis.atlas.AuditoryCortex.CortexROI import CortexROI
import numpy as np
import pyqtgraph as pg
import sc... | |
#
# 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... | |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import sys, struct, socket, time, os
import disassemble
class Message:
DSI = 0
ISI = 1
Program = 2
GetStat = 3
OpenFile = 4
ReadFile = 5
CloseFile = 6
SetPosFile = 7
GetStatFile = 8
Continue =... | |
import mimetypes
import os
import urlparse
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files.storage import Storage
from django.core.files.uploadedfile import UploadedFile
from d... | |
# -*- coding: utf-8 -*-
"""
This module provides function to estimate causal influences of signals on each
other.
Granger causality
*****************
Granger causality is a method to determine causal influence of one signal on
another based on autoregressive modelling. It was developed by Nobel prize
laureate Clive G... | |
#!/usr/bin/env python
from functools import partial
import json
from operator import attrgetter
import os
from random import randint
import sys
import flask
from flask import Flask, request, render_template, make_response, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from sq... | |
# TODO
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
from collections import OrderedDict
import pygame
from diamond.scene import Scene
from diamond.tilematrix import TileMatrix
from diamond import event
from diamond.tools.tilematrix.selection imp... | |
"""
Class Implementations (~Cases for dispatcher)
"""
import os
from . import interfaces
from . import support
from . import errors
from . import configuration
__all__ = [
'OpenProjectFromFilePath',
'OpenProjectFromName',
'OpenProjectFromDirectory',
'OpenProjectFallback'
]
class OpenProjectFromFileP... | |
# -*- coding: utf-8 -*-
# Author: Florian Mayer <florian.mayer@bitsrc.org>
from __future__ import absolute_import, print_function
from datetime import datetime
import pytest
import numpy as np
from numpy.testing import assert_array_almost_equal
from sunpy.spectra.spectrogram import (Spectrogram, LinearTimeSpectrog... | |
# Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
# 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 a... | |
import unittest
from scrapy.linkextractors.regex import RegexLinkExtractor
from scrapy.http import HtmlResponse
from scrapy.link import Link
from scrapy.linkextractors.htmlparser import HtmlParserLinkExtractor
from scrapy.linkextractors.sgml import SgmlLinkExtractor, BaseSgmlLinkExtractor
from tests import get_testdata... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#!/usr/bin/env python
#
# Code to parse CUL usage data, do some analysis, and generate
# a StackScore. See README.md.
#
import datetime
import gzip
import logging
import optparse
import os
from random import SystemRandom
import re
import sys
import math
import numpy
class SkipLine(Exception):
"""Exception to indic... | |
# pyshyacc.py - PLY grammar definition for pysh
#
# Copyright 2007 Patrick Mezard
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
"""PLY grammar file.
"""
import os
import sys
import pyshlex
tokens = pyshlex.tokens
from ply i... | |
#!/usr/bin/python
"""
get_map_stats.py
:author: Brandon Arrendondo
:license: MIT
"""
import sys
import os
import argparse
import math
import logging
import numpy as np
from collections import Counter
def calculate_dimensions(points):
max_across = 0
min_across = 3000
for point in points:
... | |
# 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 ... | |
"""Contains miscellaneous helpers"""
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib import request
from future.utils import PY2
import logging
import ast
import copy
import hashlib
import locale... | |
# -*- coding=utf-8 -*-
from __future__ import absolute_import, unicode_literals
import functools
import io
import os
import sys
from tempfile import _bin_openflags, _mkstemp_inner, gettempdir
import six
try:
from weakref import finalize
except ImportError:
from pipenv.vendor.backports.weakref import finalize... | |
# Copyright 2020 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... | |
"""
Tests of disco_elastigroup
"""
import random
from unittest import TestCase
from parameterized import parameterized
from mock import MagicMock, ANY, patch
from disco_aws_automation import DiscoElastigroup
ENVIRONMENT_NAME = "moon"
class DiscoElastigroupTests(TestCase):
"""Test DiscoElastigroup class"""
... | |
# -*- coding: utf-8 -*-
from unittest import TestCase
import numpy as np
from sklearn.neural_network.multilayer_perceptron import MLPRegressor
from tests.estimator.regressor.Regressor import Regressor
from tests.language.JavaScript import JavaScript
class MLPRegressorJSTest(JavaScript, Regressor, TestCase):
N... | |
import re
import socket
import sys
# Helper module
try:
from .helper import H
except:
from helper import H
# Settings variables
try:
from . import settings as S
except:
import settings as S
# Config module
from .config import get_value
# Log module
from .log import debug
# HTML entities
try:
fr... | |
import copy
import mufsim.utils as util
from mufsim.errors import MufRuntimeError
from functools import cmp_to_key, total_ordering
class Item(object):
value = 0
def __init__(self, value):
self.value = value
def __nonzero__(self):
return self.__bool__()
def __bool__(self):
re... | |
# -*- 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... | |
from .std import tqdm, TqdmTypeError, TqdmKeyError
from ._version import __version__ # NOQA
import sys
import re
import logging
__all__ = ["main"]
def cast(val, typ):
log = logging.getLogger(__name__)
log.debug((val, typ))
if " or " in typ:
for t in typ.split(" or "):
try:
... | |
__author__ = 'phoetrymaster'
from osgeo import gdal
from osgeo.gdalconst import *
import os
import numpy
from datetime import datetime as dt
gdal.UseExceptions()
imagepath = "/Users/phoetrymaster/Documents/School/Geography/Thesis/Data/ARC_Testing/ClipTesting/ENVI_1/test_clip_envi_3.dat"
rootdir = "/Users/phoetrymast... | |
from collections import OrderedDict
import time
from threading import Thread
import requests
from django.db import connection
from aggregator.models import Variable, Dimension
from .utils import GRANULARITY_MIN_PAGES, ResultEncoder
def query_string_from_params(params):
return '?%s' % ('&'.join(['%s=%s' % (key,... | |
"""
Classes that generate content for ImgDataset.
These classes deal with the distributin of labour. The work may be done
online, in worker threads or in owrker processes.
"""
__authors__ = "Nicu Tofan"
__copyright__ = "Copyright 2015, Nicu Tofan"
__credits__ = ["Nicu Tofan"]
__license__ = "3-clause BSD"
__maintainer_... | |
from random import random, randint, choice
from copy import deepcopy
from math import log
class fwrapper:
"""
A wrapper for the functions that will be used on function nodes.
Its member variables are name of the function, the function itself,
and the number of parameters it takes.
"""
def __i... | |
"""Functions for FIR filter design."""
from __future__ import division, print_function, absolute_import
from math import ceil, log
import numpy as np
from numpy.fft import irfft
from scipy.special import sinc
from . import sigtools
__all__ = ['kaiser_beta', 'kaiser_atten', 'kaiserord',
'firwin', 'firwin2',... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""Vispy configuration functions
"""
import os
from os import path as op
import json
import sys
import platform
import getopt
import traceback
import tempfile
import atexit
f... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'EnginePatch.patch_version'
db.alter_column(u'physical_... | |
"""
Test the functions that put vector data into GMT.
"""
import itertools
from datetime import datetime
import numpy as np
import numpy.testing as npt
import pytest
from pygmt import clib
from pygmt.exceptions import GMTCLibError, GMTInvalidInput
from pygmt.helpers import GMTTempFile
def test_put_vector():
"""
... | |
# -*- coding: utf-8 -*-
# file api/tests.py
from __future__ import unicode_literals
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from address.models import ipv6_address, ipv4_address
from bgp.models import aut_num, neighbor
from netdevice.models impor... | |
import os
import tempfile
from numpy.testing import assert_array_equal, assert_almost_equal
import pytest
try:
import rdkit
from rdkit import Chem
except ImportError:
rdkit = None
if rdkit is not None:
from oddt.toolkits.extras.rdkit.fixer import (AtomListToSubMol,
... | |
# Copyright 2019 HTCondor Team, Computer Sciences Department,
# University of Wisconsin-Madison, WI.
#
# 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/LICE... | |
# Copyright (c) 2017 Huawei, 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 a... | |
import pexpect
import sys
import time
def make_tunnel_aps(self, count, namepfx, inlabel_w, outlabel_w, inlabel_p, outlabel_p, nhp_w, nhp_p):
for i in range(1, count+1):
name = namepfx + str(i)
name_w = namepfx + 'w_' + str(i)
name_p = namepfx + 'p_' + str(i)
cmd = 'mpls lsp-pe ' ... | |
# 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 ... | |
'''oscaar v2.0
Module for differential photometry
Developed by Brett Morris, 2011-2013 & minor modifications by Luuk Visser
'''
import numpy as np
import pyfits
from matplotlib import pyplot as plt
from scipy import optimize
from glob import glob
import os
import re
import oscaar
import mathMethods
import ... | |
from __future__ import unicode_literals, division, absolute_import
import logging
import re
import sys
import urllib
import urlparse
from datetime import datetime
from path import Path
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.entry import En... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import unquote
import hashlib
import io
import logging
import mimetypes
import os
import shutil
import socket
import sys
import tempfile
fro... | |
"""
Support for interacting with and controlling the cmus music player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cmus/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MEDIA_TYPE_MU... | |
# -*- coding: utf-8 -*-
# resource.py ---
#
# Created: Mon Dec 12 12:10:00 2011 (+0200)
# Author: Janne Kuuskeri
#
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.conf import settings
import errors
import datamap... | |
"""
Test thread states.
"""
from __future__ import print_function
import unittest2
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ThreadStateTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
... | |
"""
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import asyncio
import copy
import enum
import logging
import uuid
from datetime import datetime
import voluptuous as vol
from homeassistant.core i... | |
# -*- coding: utf-8 -*-
"""
flask.ext.cache
~~~~~~~~~~~~~~
Adds cache support to your application.
:copyright: (c) 2010 by Thadeus Burgess.
:license: BSD, see LICENSE for more details
"""
__version__ = '0.14'
__versionfull__ = __version__
import base64
import functools
import hashlib
import insp... | |
# Copyright (c) 2016 Hewlett-Packard Development Company, L.P.
#
# 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/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
#!/usr/bin/python
#
# Copyright (c) 2014, 2015 NORDUnet A/S
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# ... | |
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError
SSLContext = None
HAS_SNI = False
create_default_context = None
import errno
import ssl
try: # Test for SSL features
from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
from ssl import HAS_S... | |
from sympy.logic.boolalg import to_cnf, eliminate_implications, distribute_and_over_or, \
compile_rule, conjuncts, disjuncts, to_int_repr, fuzzy_not
from sympy import symbols, And, Or, Xor, Not, Nand, Nor, Implies, Equivalent
from sympy.utilities.pytest import raises, XFAIL
def test_overloading():
"""Test that... | |
# Copyright 2013 Cloudbase Solutions Srl
# 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 r... | |
# 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... | |
"""Test network helper."""
import pytest
from homeassistant.components import cloud
from homeassistant.config import async_process_ha_core_config
from homeassistant.core import HomeAssistant
from homeassistant.helpers.network import (
NoURLAvailableError,
_get_cloud_url,
_get_deprecated_base_url,
_get_... | |
# -*- encoding: utf-8 -*-
from supriya.tools.ugentools.UGen import UGen
class Gendy2(UGen):
r'''A dynamic stochastic synthesis generator.
::
>>> gendy_2 = ugentools.Gendy2.ar(
... a=1.17,
... adparam=1,
... ampdist=1,
... ampscale=0.5,
... ... | |
import time
import math
import numpy as np
from collections import Counter
# Util
class Cluster:
def __init__(self, data, labels, base=2):
self._data = np.array(data).T
self._counters = Counter(labels)
self._labels = np.array(labels)
self._base = base
def ent(self, ent=None, ... | |
"""
kombu.entity
================
Exchange and Queue declarations.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .abstract import MaybeChannelBound
TRANSIENT_DELIVERY_MODE = 1
PERSISTENT_DELIVERY_MODE = 2
DELIVERY_MODES = {"tr... | |
import matplotlib.pyplot as plt
import numpy as np
# import pandas as pd
# import os
# This is James Sungjin Kim's library
import kutil
def gff_vec( smiles_vec, rad = 2, nBits = 1024):
"It generates a fingerprint vector from a smiles code vector"
return [gff(x, rad, nBits) for x in smiles_vec]
def gfb_vec( smiles... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.