gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Retrieve and interpolate data for Earth Orientation and timescales conversions
"""
import logging
from pathlib import Path
from inspect import isclass
from pkg_resources import iter_entry_points
from ..config import config
from ..errors import EopError, ConfigError
_... | |
# Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
from . import AWSObject
from . import AWSProperty
from troposphere import Tags
from .validators import integer
class AudioLanguageSelection(AWSProperty):
props = {
'LanguageCode': (basestr... | |
#!/usr/bin/env ambari-python-wrap
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 30 10:18:12 2014
%reset -f
%clear
%pylab
%load_ext autoreload
%autoreload 2
@author: isaac
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
import eqns
reload(eqns)
# setup better p... | |
# Copyright (c) 2015 The New Mexico Consortium
#
# {{{NMC-LICENSE
#
# 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
# notice... | |
# 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 ... | |
# 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 th... | |
# -*- coding: iso-8859-15 -*-
"""Handling for raw EC2 security group rules"""
from sgtools import utils
from operator import itemgetter
from functools import total_ordering
import fileinput
import re
class InvalidRule(Exception):
pass
class MultipleNameMatches(Exception):
pass
# Module-level cache for gr... | |
from decimal import Decimal
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_almost_equal, assert_array_equal, assert_array_almost_equal, \
assert_, dec
import scipy.signal as signal
from scipy.signal import lfilter, correlate, convolve, convolve2d, hilbert
from numpy import arr... | |
# vim:ts=4:sw=4:et:
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import random
import stat
import string
import sys
import time
import unittest
import pywatchman
from watchm... | |
from __future__ import unicode_literals
import hashlib
import time
import re
from xml.sax.saxutils import escape
import boto.sqs
from moto.core import BaseBackend
from moto.core.utils import camelcase_to_underscores, get_random_message_id, unix_time_millis
from .utils import generate_receipt_handle
from .exceptions ... | |
# Copyright (c) 2014 Mirantis, 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... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2019 Edgewall Software
# Copyright (C) 2006-2011, Herbert Valerio Riedel <hvr@gnu.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at ht... | |
'''
Unit tests for mir_eval.hierarchy
'''
from glob import glob
import re
import warnings
import json
import numpy as np
import scipy.sparse
import mir_eval
from nose.tools import raises
A_TOL = 1e-12
def test_tmeasure_pass():
# The estimate here gets none of the structure correct.
ref = [[[0, 30]], [[0... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
Tests for offsets.CustomBusinessHour
"""
from datetime import datetime
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas._libs.tslibs.offsets import (
BusinessHour,
CustomBusinessHour,
Nano,
)
import pandas._testing as tm
from pandas.tests.tseries.offsets.common i... | |
'''
A silly demonstration of how to use the Apple remote.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import pyglet
from pyglet.gl import *
import sys
class MainWindow(pyglet.window.Window):
def __init__(self):
super(MainWindow, self).__init__(visible=False)
self.set_caption('A... | |
import os
import subprocess
import sys
from six import print_
from ccmlib import common, repository
from ccmlib.cluster import Cluster
from ccmlib.cluster_factory import ClusterFactory
from ccmlib.cmds.command import Cmd
from ccmlib.common import ArgumentError
from ccmlib.dse_cluster import DseCluster
from ccmlib.dse... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from copy import deepcopy
from bg.breakpoint_graph import BreakpointGraph
from bg.edge import BGEdge
from bg.genome import BGGenome
from bg.multicolor import Multicolor
from bg.utils import add_to_dict_with_path
from bg.vertices import BlockVertex, TaggedV... | |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | |
"""seahub/api2/views.py::Repo api tests.
"""
import json
from django.urls import reverse
from seahub.test_utils import BaseTestCase
from seahub.base.accounts import User
from seahub.share.models import FileShare, UploadLinkShare
from tests.common.utils import randstring
from seaserv import seafile_api, ccnet_api
cla... | |
# 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... | |
"""
@package mi.instrument.teledyne.workhorse.driver
@file marine-integrations/mi/instrument/teledyne/workhorse/driver.py
@author Sung Ahn
@brief Driver for the Teledyne Workhorse class instruments
Release notes:
Generic Driver for ADCPS-K, ADCPS-I, ADCPT-B and ADCPT-DE
"""
import time
import struct
import re
from con... | |
# Copyright 2013 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... | |
"""Test functions for the sparse.linalg.interface module
"""
from __future__ import division, print_function, absolute_import
from functools import partial
from itertools import product
import operator
import pytest
from pytest import raises as assert_raises, warns
from numpy.testing import assert_, assert_equal
imp... | |
"""Deal with representations of Markov Models.
"""
# standard modules
import copy
import math
import random
# biopython
from Bio.Seq import MutableSeq
class MarkovModelBuilder:
"""Interface to build up a Markov Model.
This class is designed to try to separate the task of specifying the
Markov Model from ... | |
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.db import transaction
from django.db.models import Q
from django.utils import timezone
from django.views.decorators.http import require_http_methods
from django.template import RequestContext
from passlib.apps import dja... | |
from subprocess import call
import os
import shutil
import subprocess
import json
import codecs
from collections import OrderedDict
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
DIST_PATH = os.path.join(ROOT_PATH, 'dist')
INPUT_SVG_DIR = os.path.join(ROOT_PATH,... | |
# -*- coding: utf-8 -*-
"""Functions for prompting the user for project info."""
from collections import OrderedDict
import json
import click
import six
from jinja2.exceptions import UndefinedError
from cookiecutter.exceptions import UndefinedVariableInTemplate
from cookiecutter.environment import StrictEnvironmen... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
import functools
from urllib.parse import urlencode, urljoin
from django import http, forms
from django.conf import settings
from django.contrib import admin
from django.core import validators
from django.forms.models import modelformset_factory
from django.http.response import (
HttpResponseForbidden,
HttpRes... | |
# Status
import sys
class Status(object):
"""Status
The status object of the running pools and tasks.
To retrieve the status of a pool, use:
* my_pool.status
To retrieve the status of a task, use:
* my_task.status
.. note:: Read-only class
"""
def __in... | |
from lxml import etree
from pytz import UTC
import copy
import dateutil.parser
from datetime import timedelta
from .interchange import WaypointType, Activity, ActivityStatistic, ActivityStatistics, ActivityStatisticUnit, ActivityType, Waypoint, Location, Lap, LapIntensity, LapTriggerMethod
from .devices import DeviceId... | |
"""
Copyright (C) 2012 Alan J Lockett
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, distribute,... | |
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Alex Headley <aheadley@waysaboutstuff.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, inclu... | |
import unittest
import numpy
import chainer
from chainer import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
class BinaryOpTestBase(object):
def make_data(self):
raise NotImplemen... | |
"""
This module implements the ssh (Secure SHell) protocol for encrypted
connections.
This depends on a generic session module that implements the actual
login procedure of the game, tracks sessions etc.
Using standard ssh client,
"""
from __future__ import print_function
from builtins import object
import os
import... | |
import numpy as np
import hail as hl
import unittest
import pytest
from ..helpers import *
from hail.utils import new_temp_file
setUpModule = startTestHailContext
tearDownModule = stopTestHailContext
class Tests(unittest.TestCase):
@skip_unless_spark_backend()
def test_ld_score(self):
ht = hl.import... | |
from collections import namedtuple
import hashlib
import logging
import mimetypes
import os
import subprocess32 as subprocess
import time
from dropbox.client import DropboxClient
from dropbox.rest import ErrorResponse
from app import analytics
from app import celery
from app import db
from app import emailer
from app... | |
#!/usr/bin/python3
# encoding: utf-8
"""
Check ECR to see if a given version of the image exists in the repo
Notes:
all_tags: json string in the form '{"all_tags" : ["a", "b", "c"]}'
"""
import json
import sys
from sarge import get_stdout, run
AWS = '/usr/local/bin/aws'
DOCKER = '/usr/bin/docker'
def get_image... | |
import unittest
from io import BytesIO, BufferedReader
try:
import http.client as httplib
except ImportError:
import httplib
from urllib3.response import HTTPResponse
from urllib3.exceptions import DecodeError, ResponseNotChunked
from base64 import b64decode
# A known random (i.e, not-too-compressible) pay... | |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Pascual Martinez-Gomez
#
# 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 ... | |
#!/usr/bin/python -u
# Copyright (c) 2010-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 required by applica... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Red Hat, 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
... | |
import glob
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', 50) # print all rows
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/correct_phylo_files")
normalB = glob.glob("binary_position_RRBS_normal_B_cell*")
mcell = glob.glob("binary_position_RRBS_NormalBCD19pCD27... | |
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See LICENSE
from typing import Dict, List
import frappe
import frappe.utils
from frappe import _
from frappe.website.website_generator import WebsiteGenerator
from frappe.utils.verified_command import get_signed_params, verify_reques... | |
'''
Created on 2013-1-25
@author: desperedo
miniPascal Compiler Parser
'''
class Type(object):
def __init__(self):
self.Type = None;
self.Array = False;
self.ArrayLow = None;
self.ArrayHigh = None;
def Parse(self, Scanner):
if Scanner.TokenExpected('Type'):
self.Type = Scanner.NextToken()[1];
el... | |
"""Support for Coinbase sensors."""
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import ATTR_ATTRIBUTION
from .const import (
API_ACCOUNT_AMOUNT,
API_ACCOUNT_BALANCE,
API_ACCOUNT_CURRENCY,
API_ACCOUNT_ID,
API_ACCOUNT_NAME,
API_ACCOUNT_NATIVE_... | |
#!/usr/bin/env python
#
# "THE BEER-WARE LICENSE" (Revision 43~maze)
#
# <maze@pyth0n.org> wrote these files. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
import atexit
import math
import ... | |
# 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 __future__ import unicode_literals
from datetime import datetime
import unittest
from django.core.paginator import (Paginator, EmptyPage, InvalidPage,
PageNotAnInteger)
from django.test import TestCase
from django.utils import six
from .models import Article
from .custom import ValidAdjacentNumsPaginator
... | |
from django.test import TestCase
from django.test import Client
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from datetime import datetime, timedelta
import json
from comments.models import Comment, Site, Thread
User = get_user_model()
class AdminUsertestCases(TestCa... | |
"""Support for installing and building the "wheel" binary package format.
"""
import collections
import compileall
import contextlib
import csv
import importlib
import logging
import os.path
import re
import shutil
import sys
import warnings
from base64 import urlsafe_b64encode
from itertools import chain, filterfalse... | |
# Natural Language Toolkit: Viterbi Probabilistic Parser
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from nltk.tree import Tree, Proba... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
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,... | |
from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... | |
# -*- coding: utf-8 -*-
import re
import os
import toml
import warnings
try:
import pypandoc
except ImportError:
pypandoc = None
from packaging.version import Version as PackageVersion
from packaging.utils import canonicalize_name
from .exceptions.poet import MissingElement, InvalidElement
from .version_par... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | |
# Copyright 2013 Nebula Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
#
#
# Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
... | |
import time
from utils.data_utils import prepare_datasets
from utils import constants as Constants
from model import Model
import torch
import os
import json
from torch.utils.data import DataLoader
from utils.timer import Timer
from utils.logger import ModelLogger
from utils.eval_utils import AverageMeter
from utils.da... | |
#!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | |
from django import forms
from django.conf import settings
from django.db import models
from django.db.models.fields import related
from django.utils import translation as translation_utils
from django.utils.translation.trans_real import to_language
from .hold import add_translation, make_key, save_translations
from .m... | |
"""Test Home Assistant util methods."""
# pylint: disable=too-many-public-methods
import unittest
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from datetime import datetime, timedelta
from homeassistant import util
import homeassistant.util.dt as dt_util
class TestUtil(unit... | |
"""Fixer for __metaclass__ = X -> (metaclass=X) methods.
The various forms of classef (inherits nothing, inherits once, inherints
many) don't parse the same in the CST so we look at ALL classes for
a __metaclass__ and if we find one normalize the inherits to all be
an arglist.
For one-liner classes ('c... | |
# -*- coding: utf-8 -*-
"""
Contains functions for the `Arrhenius equation
<https://en.wikipedia.org/wiki/Arrhenius_equation>`_
(:func:`arrhenius_equation`) and a convenience fitting routine
(:func:`fit_arrhenius_equation`).
"""
from .._util import get_backend
from ..util.regression import least_squares
from ..util.py... | |
#!/usr/bin/python
# ----------------------------------------------------------------------------
# cocos2d "compile" plugin
#
# Copyright 2013 (C) Luis Parravicini
#
# License: MIT
# ----------------------------------------------------------------------------
'''
"compile" plugin for cocos command line tool
'''
__docf... | |
import mock
import pytest
from service_configuration_lib.cached_view import _EventHandler
from service_configuration_lib.cached_view import ConfigsFileWatcher
from service_configuration_lib.yaml_cached_view import YamlConfigsCachedView
def test_event_handler_create(mock_configs_file_watcher, mock_event):
event_h... | |
'''
Created on Feb 15, 2012
@author: Jeff
'''
import numpy
import numpyTransform
from scipy.spatial import cKDTree as KDTree
# from scipy.spatial import Delaunay
from scipy.spatial.distance import cdist
import scipy.optimize
import time
from math import pi
from MatlabFunctions import MatlabFmincon
import nlopt
import ... | |
# util/_concurrency_py3k.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
import asyncio
import sys
from typing import Any
from typing import Calla... | |
import logging
from statistics import pstdev, mean
from time import perf_counter
from types import MethodType
import math
import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID, LedgerState
from plenum.common.perf_util import get_memory_usage, timeit
from plenum.test.delayers import cr_delay
from stp_cor... | |
import os
import shutil
import tempfile
from collections import namedtuple
import numpy as np
import pandas as pd
import pytest
import tensorflow as tf
from ludwig.constants import PROC_COLUMN, NAME
from ludwig.data.dataset_synthesizer import build_synthetic_dataset
from ludwig.data.preprocessing import preprocess_fo... | |
# 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... | |
"""Definitions for DSMR Reader sensors added to MQTT."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Callable, Final
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntityDescription,
)
from homeassistan... | |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.contrib.auth import get_user_model
from model_... | |
# 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 agreed to in writing, ... | |
# Copyright (C) 2018-2019 SignalFx, Inc. All rights reserved.
# Copyright (C) 2020 Splunk, Inc. All rights reserved.
import functools
from .metadata import MetricMetadata
import pyformance.registry
import re
import time
from pyformance.registry import (clear, count_calls, dump_metrics, # noqa
... | |
import pytest
import mock
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
PreprintFactory,
AuthUserFactory,
PreprintProviderFactory,
)
from website.util import permissions as osf_permissions
from reviews.permissions import GroupHelper
from api_tests.reviews.mixins.filt... | |
"""SCons.Tool.mwcc
Tool-specific initialization for the Metrowerks CodeWarrior compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,... | |
# This file is part of beets.
# Copyright 2015, 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 the rights to use, copy, ... | |
try:
import psyco
psyco.full()
except ImportError: pass
__doc__ = """
The present module Generative Linear Gaussian Models (GLGM) implements in Python programming language
the following models based mainly on references nr.1 (see References below):
x(t+1) = Ax(t) + w(t) = Ax(t) + w0, w0 = N(0, Q)... | |
import numpy as np
import utilities as b_utils
import initialization as b_init
# get filename and filepath for naming of corresponding files
[cf_path, cf_name] = b_utils.seperate_path_and_filename(__file__)
###############################################################################
####################### C O ... | |
#!/usr/bin/env python
# coding=utf-8
#
# Copyright 2015 Arn-O. See the LICENSE file at the top-level directory of this
# distribution and at
# https://github.com/Arn-O/py-kodi-remote-controller/blob/master/LICENSE.
'''
Kodi remote controller based on HTTP/TCP transport, JSON and using the (cmd) interface.
'''
import ... | |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | |
"""
coding: utf-8
Vanishing Gradients
We will demonstrate the difference between using sigmoid and ReLU nonlinearities in a simple
neural network with two hidden layers. This notebook is built off of a minimal net demo done
by Andrej Karpathy for CS 231n, which you can check out here:
http://c... | |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
import os
import socket
import json
import docker
import time
import re
import traceback
from threading import Thread
from colorama import Fore, Style
from toolset.utils.output_helper import log
from toolset.utils.database_helper import test_database
from psutil import virtual_memory
# total memory limit allocated f... | |
'''
@author: Frank
'''
import readline
import os
import sys
import shlex
import hashlib
import optparse
import termcolor
import pydoc
import time
import urllib3
import zstacklib.utils.log as log
#comment out next line to print detail zstack cli http command to screen.
log.configure_log('/var/log/zstack/zstack-cli', l... | |
# Copyright 2017 The Sonnet 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 applicable l... | |
#!/usr/bin/python2.7
# Copyright 2011 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 requi... | |
import logging
import base64
import json
import re
from django.core.urlresolvers import resolve
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, REDIRECT_FIELD_NAME, logout
from django.utils.datastructures import MultiValueDictKeyError
from django.utils.six.moves... | |
# 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... | |
#!/usr/bin/env python
"""Unit tests for ctags.py"""
import os
import sys
import tempfile
import codecs
from subprocess import CalledProcessError
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
try:
import sublime
if int(sublime.version()) > 3000:
from . impo... | |
import maya.cmds as cmds
import tempfile
import base64
import os
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
import maya.OpenMayaUI as OpenMayaUI
import PySide2.QtCore as QtCore
import PySide2.QtGui as QtGui
import PySide2.QtWidgets as QtWidgets
import shiboken2
import mtoa.ui.arnoldmenu as arnoldm... | |
# coding: utf-8
# pylint: disable = invalid-name, W0105, C0301
from __future__ import absolute_import
import collections
from operator import gt, lt
from .compat import range_
class EarlyStopException(Exception):
"""Exception of early stopping.
Parameters
----------
best_iteration : int
The ... | |
# coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team.
#
# 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 a... | |
# 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 ... | |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 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.
"""Presubmit script validating field trial configs.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presu... | |
#!/usr/bin/python -tt
'''
File: hg_decoder.py
Date: January 8, 2015
Author: Avneesh Saluja (avneesh@cs.cmu.edu)
Based on compute_hg.py code in spectral-scfg package
Description: modified version of bottom-up parser
where we use a variant of CKY+, leveraging a trie
data structure of the grammar to come up with a hyper... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.