gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
Support for an interface to work with a remote instance of Home Assistant.
If a connection error occurs while communicating with the API a
HomeAssistantError will be raised.
For more details about the Python API, please refer to the documentation at
https://home-assistant.io/developers/python_api/
"""
from dateti... | |
# -*- coding: utf-8 -*-
"""
.. _disc-stats:
=====================
Statistical inference
=====================
Here we will briefly cover multiple concepts of inferential statistics in an
introductory manner, and demonstrate how to use some MNE statistical functions.
.. contents:: Topics
:local:
:depth: 3
"""
... | |
import os
import time
import unittest
from mock import patch
from chirp.library import audio_file_test
from chirp.library import do_delete_audio_file_from_db
from chirp.library import database
TEST_DB_NAME_PATTERN = "/tmp/chirp-library-db_test.%d.sqlite"
class DeleteFingerprintTest(unittest.TestCase):
def set... | |
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.urlresolvers import NoRe... | |
# -*- test-case-name: twistedcaldav.directory.test.test_principal -*-
##
# Copyright (c) 2006-2015 Apple 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://w... | |
"""Functional interface to graph methods and assorted utilities.
"""
# Copyright (C) 2004-2012 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
import networkx as nx
import itertools
__author__ = """\n""".jo... | |
import os
import stat
import shutil
import tempfile
from colorama import init, Fore, Back, Style
from textwrap import dedent
import yaml
import jsonschema
import subprocess
from trackhub import Track, default_hub, CompositeTrack, ViewTrack
from trackhub.upload import upload_hub, upload_track, upload_file
from hubward i... | |
from weakref import ref
from decimal import Decimal
import re
import datetime
import traceback, sys
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (ObjectProperty, DictProperty, NumericProperty,
... | |
from pandac import PandaModules as PM
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import list2dict, uniqueElements
import string
import LevelConstants
import types
if __dev__:
import os
class LevelSpec:
notify = DirectNotifyGlobal.directNotify.newCategory('LevelSpec')
... | |
import time
import struct
from openbci.utils.constants import Constants as k
class ParseRaw(object):
def __init__(self,
board_type=k.BOARD_CYTON,
gains=None,
log=False,
micro_volts=False,
scaled_output=True):
self.board_... | |
# 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
# d... | |
# Dual annealing unit tests implementation.
# Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com>,
# Yang Xiang <yang.xiang@pmi.com>
# Author: Sylvain Gubian, PMP S.A.
"""
Unit tests for the dual annealing global optimizer
"""
from scipy.optimize import dual_annealing
from scipy.optimize._dual_annealing import E... | |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from constants import US_STATES, ACTIONS
# control models
class ControlModel(models.Model):
"""an abstract model that only contains a name - serves as a c... | |
# -*- coding: utf-8 -*-
'''
Management of iptables
======================
This is an iptables-specific module designed to manage Linux firewalls. It is
expected that this state module, and other system-specific firewall states, may
at some point be deprecated in favor of a more generic `firewall` state.
.. code-block... | |
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
#
# 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... | |
from __future__ import print_function
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers import MaxPooling2D, concatenate
from keras.layers.advanced_activations import LeakyReLU
fr... | |
import itertools
from neo4j import GraphDatabase, basic_auth
def set_up_connection():
# setup neo4j database connection
driver = GraphDatabase.driver("bolt://13.58.54.49:7687", auth=basic_auth("neo4j", "goSEAKers!"))
session = driver.session()
return session
def diagnose_symptoms_by_subset_of_anoma... | |
# Copyright (c) 2015 Uber Technologies, Inc.
#
# 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, publ... | |
# -*- coding: utf-8 -*-
# MonAMI Asterisk Manger Interface Server
# Asterisk AMI Emulator Handler Process
# (c) AMOOMA GmbH 2012-2013
from threading import Thread
from log import ldebug, linfo, lwarn, lerror, lcritic
from time import sleep
from traceback import format_exc
from collections import deque
from urllib impo... | |
# 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 ... | |
from .xgig import XgigEvent, ParsedCommand
from itertools import takewhile, dropwhile
import logging
COMMANDS = {
'SMART': 0xB0,
'READ_FPDMA_QUEUED' : 0x60,
'WRITE_FPDMA_QUEUED' : 0x61,
'DATA_SET_MANAGEMENT' : 0x06,
'WRITE_DMA' : 0xCA,
'WRITE_DMA_EXT' : 0x35,
'READ_DMA' : 0xC8,
'READ_DM... | |
"""Zwave discovery schemas."""
from . import const
DEFAULT_VALUES_SCHEMA = {
'power': {
const.DISC_SCHEMAS: [
{const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SENSOR_MULTILEVEL],
const.DISC_INDEX: [const.INDEX_SENSOR_MULTILEVEL_POWER]},
{const.DISC_COMMAND_CLASS: [const.... | |
from __future__ import absolute_import, unicode_literals
from django.db.models.lookups import Lookup
from django.db.models.query import QuerySet
from django.db.models.sql.where import SubqueryConstraint, WhereNode
from django.utils.six import text_type
from wagtail.wagtailsearch.index import class_is_indexed
class... | |
import time
import datetime
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, date2num
import numpy as np
import subprocess as sp
import time
import sys
import os
# Takes south_local_signal.txt and south_global_signal.txt
# and adds microseconds, UTC ti... | |
import cPickle
import cv2
import os
import json
import numpy as np
from ..logger import logger
from imdb import IMDB
# coco api
from ..pycocotools.coco import COCO
from ..pycocotools.cocoeval import COCOeval
from ..pycocotools import mask as COCOmask
class coco(IMDB):
def __init__(self, image_set, root_path, da... | |
__author__ = 'tylin'
__version__ = 1.0
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visualizing the annotations in COCO.
# Please ... | |
from __future__ import absolute_import
import logging
from datetime import timedelta
from django.utils import timezone
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint
from sentry.ap... | |
#!/usr/bin/env python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file ... | |
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
from django.contrib.auth import authenticate, login, logout, REDIRECT_FIELD_NAME
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.decorators import login_required
from django.contrib.au... | |
# 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 gym
import random
import numpy as np
from itertools import count
from collections import deque
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import os
from torch.autograd import Variable
from atari_wrappers import WarpFrame, FrameStack, ClipRewardEnv
use_cuda ... | |
from __future__ import unicode_literals
import datetime
import time
import sys
from email.header import Header
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.conf import settings
from django.core import signals
from django.core import signing
from django.c... | |
# Copyright (c) 2016-2018 Uber Technologies, 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 argparse
import os
import random
import string
from awacs.aws import PolicyDocument, Statement
from awacs.s3 import Action as S3Action
from awacs.sqs import Action as SQSAction
from troposphere import *
from troposphere import ec2, rds
from troposphere.iam import Role, InstanceProfile, Policy
from troposphere.s... | |
# Copyright 2011 The greplin-exception-catcher 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 la... | |
#!/usr/bin/env python
# Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
import networkx as nx
import pprint as pp
import logging as log
import subprocess
import math_functions as m
impor... | |
#
# yosys -- Yosys Open SYnthesis Suite
#
# Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#... | |
""" generic mechanism for marking and selecting python functions. """
import typing
from typing import AbstractSet
from typing import List
from typing import Optional
from typing import Union
import attr
from .expression import Expression
from .expression import ParseError
from .structures import EMPTY_PARAMETERSET_O... | |
#!/usr/bin/env python3
import os
import random
import bpy
import bpy_extras
from mathutils import Matrix, Vector
import math
import numpy as np
import scipy.io
import pickle
import png
RENDERING_PATH = './'
MAX_CAMERA_DIST = 2
MAX_DEPTH = 1e8
FACTOR_DEPTH = 10000
g_shape_synset_name_pairs = [('02691156', 'aeroplane')... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python wrapper for Android uiautomator tool."""
import sys
import os
import subprocess
import time
import itertools
import json
import hashlib
import socket
import re
import collections
import xml.dom.minidom
DEVICE_PORT = int(os.environ.get('UIAUTOMATOR_DEVICE_PORT',... | |
# 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
# distributed under the Li... | |
#!/usr/bin/env python
"""
Sentry
======
Sentry is a realtime event logging and aggregation platform. It specializes
in monitoring errors and extracting all the information needed to do a proper
post-mortem without any of the hassle of the standard user feedback loop.
Sentry is a Server
------------------
The Sentry ... | |
#!/usr/bin/python
import binascii, re, json, copy, sys
from bitcoin.main import *
from _functools import reduce
### Hex to bin converter and vice versa for objects
def json_is_base(obj, base):
if not is_python2 and isinstance(obj, bytes):
return False
alpha = get_code_string(base)
if isinsta... | |
import logging
import math
import os
import secrets
from datetime import datetime, timedelta
from decimal import Decimal
from functools import wraps
from typing import Any, Callable, Dict, Generator, Optional, Tuple, TypeVar, Union, cast
import orjson
import stripe
from django.conf import settings
from django.core.sig... | |
# -*- coding: utf-8 -*-
#
# Random/_UserFriendlyRNG.py : A user-friendly random number generator
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that ... | |
from PyQt4.QtGui import (QDockWidget, QMenu, QAction, QMessageBox,
QItemSelectionRange, QItemSelection,
QStandardItemModel, QStandardItem,
QItemSelectionModel)
from PyQt4.QtCore import Qt, pyqtSignal
from spyderlib.utils.qthelpers import get_ico... | |
# -*- coding: utf-8 -*-
"""
Video object
"""
import logging
import numpy as np
import cv2
from .utils import _mean_squared_error
logger = logging.getLogger(__name__)
class Video:
"""
OpenCV Video.
"""
def __init__(self, filepath, grayscale=False):
# OpenCV VideoCapture object
s... | |
import numpy as np
from typing import Optional, Union
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.utils.annotations import override
from ray.rllib.utils.exploration.gaussian_noise import GaussianNoise
from ray.rllib.utils.framework import try_import_tf, try_import_torch, \
get_variab... | |
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
from __future__ import print_function
import argparse
import logging
import os
# colorama, BSD 3-Clause license, cross-platform terminal colours, pip install colorama
import... | |
#
# PATCHED VERSION of django-filebrowser 'sites' module that replaces the
# 'staff_member_required' decorator with the 'login_required' decorator
# Also, it used the COG-specific decorator 'filebrowser_check_role'
# to enforce a specific role for the project associated with a specific target folder
# COG imports
fr... | |
"""
Parser for the datashape grammar.
"""
from __future__ import absolute_import, division, print_function
from . import lexer, error
# TODO: Remove coretypes dependency, make 100% of interaction through
# the type symbol table
from . import coretypes
__all__ = ['parse']
class DataShapeParser(object):
"""... | |
"""
Creates a shapefile with a given root name using data from given
X, Y, Z, and value arrays (curvilinear-type data). The shapes
are quadrilaterals derived from the X and Y arrays which can have
varying Z coordinates; i.e., vertices are the (i,j), (i,j+1),
(i+1,j+1), and (i+1,j) elements of the X, Y, and Z coordinat... | |
#!/usr/bin/python
#given a fastq location, create a .sh script to run mapping through generation of sorted bam
'''
The MIT License (MIT)
Copyright (c) 2013 Charles Lin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to... | |
import subprocess
from mozpackager.settings import BUILD_DIR, BUILD_LOG_DIR, MEDIA_PATH
import json
class Mock:
root = None
mock = '/usr/bin/mock'
_build_log_text = None
_error_log_text = None
def __init__(self, build_package):
"""
Perhaps pull these dynamically at some point
... | |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-08-26 14:45
import logging
import math
import os
from abc import ABC, abstractmethod
from typing import Optional, List, Any, Dict
import numpy as np
import tensorflow as tf
import hanlp.utils
from hanlp_common.io import save_json, load_json
from hanlp.callbacks.fin... | |
import sys
import unittest
from dynd import nd, ndt
import numpy as np
class TestCopyFromPy(unittest.TestCase):
def test_bool(self):
a = nd.empty('var * bool')
a[...] = [True, False, 1, 0, 'true', 'false', 'on', 'off']
self.assertEqual(nd.as_py(a), [True, False] * 4)
@unittest.skip('Test d... | |
'''
List resource API
@author: Youyk
'''
import apibinding.api_actions as api_actions
import account_operations
import deploy_operations
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstacklib.utils.lock as lock
import zstacklib.utils.xmlobject as xmlobject
import tim... | |
# Copyright (c) 2018 PaddlePaddle 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 app... | |
# Copyright 2014, Scalyr, Inc.
#
# Note, this can be run in standalone mode by:
# python -m scalyr_agent.run_monitor
# scalyr_agent.builtin_monitors.apache_monitor
from __future__ import absolute_import
from __future__ import unicode_literals
import six
import six.moves.http_client
import six.moves.urllib.request
impo... | |
"""The tests for the MQTT light platform.
Configuration for RGB Version with brightness:
light:
platform: mqtt
name: "Office Light RGB"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: "office/rgb1/brightness/status"
brightness_command_topic: "offic... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import compas
import compas.colors
import compas.geometry
from compas.data import Data
from compas.datastructures import Mesh
from compas.files.urdf import URDFElement
from compas.geometry import Frame
from com... | |
import pickle
import struct
from datasketch.storage import (
ordered_storage, unordered_storage, _random_name)
from scipy.integrate import quad as integrate
def _false_positive_probability(threshold, b, r):
_probability = lambda s : 1 - (1 - s**float(r))**float(b)
a, err = integrate(_probability, 0.0, t... | |
"""Test the translation helper."""
import asyncio
from os import path
import pathlib
import pytest
from homeassistant.const import EVENT_COMPONENT_LOADED
from homeassistant.generated import config_flows
from homeassistant.helpers import translation
from homeassistant.loader import async_get_integration
from homeassis... | |
###############################################################################
# AnyAxisymmetricRazorThinDiskPotential.py: class that implements the
# potential of an arbitrary
# axisymmetric, razor-thin disk
####################... | |
# -*- coding: utf-8 -*-
from .grammar import SchemaGrammar
from ..blueprint import Blueprint
from ...query.expression import QueryExpression
from ...support.fluent import Fluent
class SQLiteSchemaGrammar(SchemaGrammar):
_modifiers = ['nullable', 'default', 'increment']
_serials = ['big_integer', 'integer']... | |
#!/usr/bin/env python
import binascii
import serial
import stm32_crc
import sys
import threading
import time
import traceback
import zipfile
from struct import pack, unpack
import os
import glob
import logging
import json
log = logging.getLogger()
logging.basicConfig(format='[%(levelname)-8s] %(message)s')
log.setLev... | |
# -*- coding: utf-8 -*-
"""
unittests for spike_train_surrogates module.
:copyright: Copyright 2014-2016 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
import unittest
import elephant.spike_train_surrogates as surr
import numpy as np
import quantities as pq
import neo
... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Script to write and assist SOAPdenovo assembly.
"""
import os.path as op
import sys
from jcvi.formats.fastq import guessoffset, readlen, is_fastq
from jcvi.assembly.base import FastqNamings, Library, get_libs
from jcvi.apps.base import OptionParser, ActionDispatcher, ... | |
import gzip
import pandas as pd
import numpy as np
import pandas.util.testing as tm
import os
import dask
from operator import getitem
import pytest
from toolz import valmap
import tempfile
import shutil
from time import sleep
import dask.array as da
import dask.dataframe as dd
from dask.dataframe.io import (read_csv,... | |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: checkpoint_ops.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
fr... | |
"""Zookeeper Partitioner Implementation
:Maintainer: None
:Status: Unknown
:class:`SetPartitioner` implements a partitioning scheme using
Zookeeper for dividing up resources amongst members of a party.
This is useful when there is a set of resources that should only be
accessed by a single process at a time that mul... | |
# ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | |
from __future__ import print_function
import sys
import glob
import serial
import time
import datetime
import struct
import os
MAX_ALARM_DID = chr(0x3F)
DID_ALARM_LEN = 12
SER_TIMEOUT = .1 # Serial timeout, seconds
eeprom = None
class EEPROMError(Exception):
pass
class MsgDef:
def __init__(self, v, const):
... | |
#
# 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... | |
# 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... | |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | |
#!/usr/bin/python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Generate stats of CQ usage.'''
import argparse
import calendar
import collections
import datetime
import dateutil.parser
import dateutil... | |
#!/usr/bin/env python
#
# Copyright 2014 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
#
# Unle... | |
"""
Copyright (c) 2015 SONATA-NFV
ALL RIGHTS RESERVED.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import numbers
import warnings
from abc import ABCMeta, abstractmethod
from collections import OrderedDict, defaultdict
import torch
import pyro.poutine as poutine
from pyro.distributions import Categorical, Empirical
from pyro.o... | |
#!/usr/bin/python2.4
import sys
import bx.pwm.position_weight_matrix as pwmx
from bx.align import maf as align_maf
def isnan(x):
# return ieeespecial.isnan(x)
if x == x:
return False
return True
NaN = float('nan')
def main():
pwm_file = sys.argv[1]
splist = sys.argv[2]
if len(sy... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""parameters.py -- This module contains the prospector base class for
models, ProspectorParams. This class is responsible for maintaining model
parameter state, converting between parameter dictionaries and vectors,
and computing parameter dependencies and prior probabil... | |
#!/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... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Copyright (C) 2013 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
"""Python API for interacting with installer API
"""
import abc
import json
import os
from subprocess import CalledProcessError
import pkg_resources
import requests
import yaml
from retrying import retry
from ssh.ssh_tunnel import run_scp_cmd, run_ssh_cmd, SSHTunnel
MAX_STAGE_TIME = int(os.getenv('INSTALLER_API_MAX_... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | |
"""--------------------------------------------------------------------
COPYRIGHT 2016 Stanley Innovation Inc.
Software License Agreement:
The software supplied herewith by Stanley Innovation Inc. (the "Company")
for its licensed SI Vector Platform is intended and supplied to you,
the Company's customer, for use so... | |
#!/usr/bin/env python2
# transpiled with BefunCompile v1.3.0 (c) 2017
import sys
import zlib, base64
_g = ("AR+LCAAAAAAABAC8vVnP9cZ17/lVqh1fRXCf1xmcRAh0ziK5NllkDfutKnK/fBAk6YsD9UU3IKD75CofvmvVfuRMNuAO4t9GYsuSrGWSNazhP/zg/u3vn9wf8vvhD/47"
+ "/+0vSrn/9T/mF//9v3v9xZ9+9933f/blpy9ffvrhy6/7v7sfvv/y5ccff/E/fvGr77/845/8/T/8... | |
from __future__ import print_function, unicode_literals
import six
import os, sys
from io import BytesIO
from twisted.python import usage
from twisted.internet import defer
# does "flappserver start" need us to refrain from importing the reactor here?
import foolscap
from foolscap.api import Tub, Referenceable, fireEv... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical 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
#
# htt... | |
from django.core.exceptions import ValidationError
import inflection
import shanghai
from shanghai.actions import *
from shanghai.exceptions import ModelValidationError, NotFoundError
from shanghai.inspectors import Inspector, MetaInspector, ModelInspector
from shanghai.mixins import *
from shanghai.serializers impor... | |
#!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
#
# Copyright (c) EMC/Greenplum Inc 2011. All Rights Reserved.
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
"""
Internal Use Function.
"""
# THIS IMPORT MUST COME FIRST
from gppylib.mainUtils import sim... | |
#!/usr/bin/env python
# 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... | |
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD Style.
"""Implementation of Stochastic Gradient Descent (SGD)."""
import numpy as np
import scipy.sparse as sp
import warnings
from ..externals.joblib import Parallel, delayed
... | |
# Copyright 2015 VMware, 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.