gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from .ctx_base import StandardBaseContext
import math
import cmath
import math2
import function_docs
from .libmp import mpf_bernoulli, to_float, int_types
import libmp
class FPContext(StandardBaseContext):
"""
Context for fast low-precision arithmetic (53-bit precision, giving at most
about 15-digit acc... | |
# -*- coding: 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 field 'Model.hidden'
db.add_column('blogs_model', 'hidden',
self.gf('django.d... | |
# Tests some corner cases with isinstance() and issubclass(). While these
# tests use new style classes and properties, they actually do whitebox
# testing of error conditions uncovered when using extension types.
import unittest
from test import support
import sys
class TestIsInstanceExceptions(unittest.TestCase... | |
''' A set of standard sources, filters, sorters and sinks
'''
import random
import datetime
from track_manager import tlib
import json
class Annotator(object):
''' Annotates the tracks in a stream with external information
:param source: the source of tracks
:param type: the type of annotation (sp... | |
from interfaces import Interface
from logicgates import And, Xor, Or
from components import Split, Power, MultiPower
from primitives import Cathode
from flipflops import JKFlipFlop
from mixins import InputAMixin, InputBMixin, InputCMixin, InputOperatorMixin, OutputSumMixin, OutputCarryMixin, InputAEightBitMixin, InputB... | |
from datetime import date, datetime
import numpy as np
import pandas
import pytest
import astropy.time
from astropy.time import Time
import sunpy.time as time
from sunpy.time import is_time_equal, parse_time
LANDING = Time('1966-02-03', format='isot')
def test_parse_time_24():
dt = parse_time("2010-10-10T24:0... | |
"""Test-runner for wxPython's unit test suite.
TODO: document all functionality"""
import os, sys
import unittest
import time
import wx
from optparse import OptionParser
# ----------------- Helper Functions / Classes ---------------------
# TODO: maybe change some variable names?
# TODO: maybe put this function as ... | |
# Copyright (c) 2010 Aldo Cortesi
# Copyright (c) 2010, 2014 dequis
# Copyright (c) 2012 Randall Ma
# Copyright (c) 2012-2014 Tycho Andersen
# Copyright (c) 2012 Craig Barnes
# Copyright (c) 2013 horsik
# Copyright (c) 2013 Tao Sauvage
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# o... | |
# Copyright (C) 2009, Hyves (Startphone Ltd.)
#
# This module is part of the Concurrence Framework and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""This module implements the stackless API on top of py.magic greenlet API
This way it is possible to run concurrence appli... | |
#!/usr/bin/env python
r"""Compute SSP/PCA projections for ECG artifacts.
You can do for example:
$ mne compute_proj_ecg -i sample_audvis_raw.fif -c "MEG 1531" \
--l-freq 1 --h-freq 100 \
--rej-grad 3000 --rej-mag 4000 --rej-eeg 100
"""
from __future__ import print_functio... | |
#
# 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
# ... | |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# ... | |
# 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... | |
#!/usr/bin/env python
"""Multithreaded interactive interpreter with GTK and Matplotlib support.
WARNING:
As of 2010/06/25, this is not working, at least on Linux.
I have disabled it as a runnable script. - EF
Usage:
pyint-gtk.py -> starts shell with gtk thread running separately
pyint-gtk.py -pylab [filename]... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
# various utility functions for manipulating vector GIS data
#
# David J. Lampert ([email protected])
#
# last updated 08/07/2015
#
# contains the merge_shapes function that takes the name of an input polygon
# shapefile and then merges the shapes together using the combine_shapes method
# using a "trace" of the out... | |
# coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# 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
#
#... | |
"""
Data API for Assembly entities. This API provides methods for retrieving
summary information such as GC content, total length, external source information
as well as methods for retrieving individual contig sequences and gathering contig lengths and contig GC.
"""
# Stdlib
import abc
import requests
import re
imp... | |
import logging
from ray.rllib.agents import with_common_config
from ray.rllib.agents.ppo.ppo_tf_policy import PPOTFPolicy
from ray.rllib.agents.trainer_template import build_trainer
from ray.rllib.optimizers import SyncSamplesOptimizer, \
LocalMultiGPUOptimizer, TorchDistributedDataParallelOptimizer
from ray.rllib... | |
import warnings
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from ._core import (
VectorPlotter,
)
from .utils import (
locator_to_legend_entries,
adjust_legend_subtitles,
_default_color,
_deprecate_ci,
)
from ._statistics import EstimateAggregator
from .axisgrid imp... | |
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__author__ = "d01"
__email__ = "[email protected]"
__copyright__ = "Copyright (C) 2015-16, Florian JUNG"
__license__ = "MIT"
__version__ = "0.1.0... | |
import tempfile
from datetime import date
from nose.tools import eq_
from inferno.bin.run import _get_options
from inferno.bin.run import _get_settings
def assert_dicts_equal(d1, d2):
for item in d1.items():
eq_(item[1], d2[item[0]])
for item in d2.items():
eq_(item[1], d1[item[0]])
class... | |
import os
import scipy.io
import numpy as np
class ConnectomeInjury(object):
def __init__(self,
base_filename=os.path.join('data', 'base.mat'), # Base connectome filename.
n_injuries=2, # How many injuries to have (currently only works for 2).
signature_seed=3... | |
"""
@file
@brief A function to download the content of a url.
"""
import os
from datetime import datetime
import socket
import gzip
import warnings
import hashlib
import urllib.error as urllib_error
import urllib.request as urllib_request
import http.client as http_client
try:
from http.client import InvalidURL
exc... | |
# 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 ... | |
# Dynamic Time Warping
# J Eisenmann
# ACCAD
# December 2012
from math import sqrt
from Vector import *
class DTW:
def __init__( self, X, Y, subsequence=False, penalty=[0,5], maxPathLength=99999.0 ):
self.X = list(X)
self.Y = list(Y)
self.subsequence = subsequence
self.penalty = p... | |
#! /usr/bin/env python
__version__ = '$Revision: 1.1 $'
import os.path
import re
import string
import sys
from xml.sax.saxutils import quoteattr
bang_join = "!".join
null_join = "".join
REPLACEMENTS = [
# Hackish way to deal with macros replaced with simple text
(re.compile(r"\\ABC\b"), "ABC"),
(re.co... | |
# 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
# "Licens... | |
# 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... | |
# -*- coding: utf-8 -*-
# Python
import datetime
import urllib2
import re
from urllib2 import URLError, HTTPError
from xml.dom import minidom
from lxml import etree
from pymongo.errors import OperationFailure
from pymongo.code import Code
# Django
from mongodb import *
from sgrstats.static import *
# Celery
from cel... | |
# -*- 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... | |
import numpy as np
import piece_valid_moves
from datetime import datetime
startTime = datetime.now()
# function to understand the position
error_count=0
def position_converter(position):
x=ord(position[0])-97
y=56-ord(position[1])
return((8*y)+x)
space_count=0
target_pos=0
num_index=1
# Initialising the 12*64 vect... | |
from django.core.mail.backends.base import BaseEmailBackend
from django_ses import settings
from boto.regioninfo import RegionInfo
from boto.ses import SESConnection
from datetime import datetime, timedelta
from time import sleep
# When changing this, remember to change it in setup.py
VERSION = (0, "6", 0)
__versio... | |
# :coding: utf-8
import collections
from sphinx import addnodes
import docutils.parsers.rst.directives
from .base import BaseDirective
from .rst_generator import (
get_rst_attribute_elements,
get_rst_method_elements
)
def _parse_members(argument):
"""Convert the :members: options to class directive.""... | |
# overall python packages
import glob
import h5py
import os
import time
import numpy as n
import sys
# specific functions
from scipy.stats import norm
from scipy.integrate import quad
from scipy.interpolate import interp1d
# dedicated packages
#import ClusterScalingRelations
#cl = ClusterScalingRelations.ClusterScali... | |
# -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
from argparse import ArgumentParser
import django
from django.core import checks
from django.core.... | |
"""HTML5 Push Messaging notification service."""
import datetime
from functools import partial
import json
import logging
import time
import uuid
from aiohttp.hdrs import AUTHORIZATION
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant.components import websocket_api
from homea... | |
"""JSON Tree Library
"""
import collections
import datetime
import json
import json.scanner
import re
import sys
__version__ = (0,5,1)
__version_string__ = '.'.join(str(x) for x in __version__)
__author__ = 'Doug Napoleone'
__email__ = '[email protected]'
if sys.version_info.major > 2 :
basestr... | |
"""
Abstract base class for 1-D plots which only use one axis
"""
from __future__ import absolute_import
# Standard library imports
from numpy import argsort, asarray
# Enthought library imports
from traits.api import (Any, Bool, Enum, Instance, Property, cached_property,
on_trait_change)
# ... | |
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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 n... | |
# 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... | |
from sympy import Symbol, symbols, hypersimp, factorial, binomial, \
collect, Function, powsimp, separate, sin, exp, Rational, fraction, \
simplify, trigsimp, cos, tan, cot, log, ratsimp, Matrix, pi, integrate, \
solve, nsimplify, GoldenRatio, sqrt, E, I, sympify, atan, Derivative, \
S, ... | |
# from __future__ import unicode_literals
# Character ranges of letters
letters = 'a-zA-Z' # \u00c0-\u00d6\u00d8-\u00f6\u00f8-\u0103\u0106\u0107\
# \u010c-\u010f\u0112-\u0115\u011a-\u012d\u0131\u0141\u0142\u0147\u0148\
# \u0150-\u0153\u0158-\u0161\u0164\u0165\u016e-\u0171\u017d\u017e\
# \u0391-\u03a1\u03a3-\u03a9\u03... | |
"""
G R A D I E N T - E N H A N C E D N E U R A L N E T W O R K S (G E N N)
Author: Steven H. Berguin <[email protected]>
This package is distributed under New BSD license.
"""
import numpy as np
import matplotlib.gridspec as gridspec
from smt.utils.neural_net.data import random_mini_batches
from s... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 appli... | |
'''
GPIB adapter
PROLOGIX GPIB-USB CONTROLLER
REV 6.4.1
http://prologix.biz/getfile?attachment_id=2
'''
from uvscada.aserial import ASerial
import serial
class Timeout(Exception):
pass
class ShortRead(Exception):
pass
'''
*********************************
GPIB
*********************************
In Controlle... | |
### BEGIN LICENSE ###
### Use of the triage tools and related source code is subject to the terms
### of the license below.
###
### ------------------------------------------------------------------------
### Copyright (C) 2011 Carnegie Mellon University. All Rights Reserved.
### Portions Copyright 2013 BlackBerry Ltd.... | |
#!/usr/bin/env python
import csv
import gzip
import json
import logging
import os
import re
import shutil
import socket
import sys
import tempfile
from collections import defaultdict
from datetime import datetime
from operator import attrgetter
import boto3
REGION_NAMES = {
"US East (N. Virginia)": "us-east-1",
... | |
from datetime import timedelta
from datetime import datetime
from collections import defaultdict
import requests
import os
import urllib
import logging
import arrow
from impactstoryanalytics.widgets.widget import Widget
from impactstoryanalytics.lib import mixpanel_export
import uservoice
logger = logging.getLogger("... | |
#!/usr/bin/env python
"""Quick hack of 'modern' OpenGL example using pysdl2 and pyopengl
Implementation of:
http://www.learnopengl.com/#!Getting-started/Hello-Triangle
Compare to
https://github.com/neutralord/pyopengl-experiments/blob/master/red_book_samples/uniform.py
https://github.com/neutralord/pyopengl-experimen... | |
# -*- coding: utf-8 -*-
from base64 import b64encode
from hashlib import sha1
import os
import socket
import ssl
from ws4py import WS_KEY, WS_VERSION
from ws4py.exc import HandshakeError
from ws4py.websocket import WebSocket
from ws4py.compat import urlsplit
__all__ = ['WebSocketBaseClient']
class WebSocketBaseClien... | |
"""
Virtual gateway for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import asyncio
import collections
import itertools
import logging
import os
import traceback
from homeassistant.components.system_log import LogEnt... | |
import pygame,random,sys,os
from pygame.locals import *
pygame.init()
# speed of the game
FPS=13.0
fpsClock=pygame.time.Clock()
scr_width = 610
scr_height = 480
screen = pygame.display.set_mode((scr_width,scr_height))
# initial state of the snake
n_blocks = 5
n_blocks1 = 5
origin = [50,50]
origin1 = [scr_width-50,5... | |
#
# 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... | |
"""
SMlib.plugins
=================
Here, 'plugins' are widgets designed specifically for SM
These plugins inherit the following classes
(SMderPluginMixin & SMPluginWidget)
"""
from PyQt4.QtGui import (QDockWidget, QWidget, QShortcut, QCursor, QKeySequence, QMainWindow, QApplication)
from PyQt4.QtCore import SIGNAL, Q... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 appli... | |
# -*- coding: utf-8 -*-
"""
Unit tests for the conversion module.
:copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`.
:license: Modified BSD, see LICENSE.txt for details.
"""
import unittest
import neo
import numpy as np
import quantities as pq
from numpy.testing import (assert_array_almost_... | |
# -*- coding: utf-8 -*-
# imageio is distributed under the terms of the (new) BSD License.
"""
Definition of the Request object, which acts as a kind of bridge between
what the user wants and what the plugins can.
"""
import os
from io import BytesIO
import zipfile
import tempfile
import shutil
import enum
import war... | |
# pylint: disable=E1101,F0401
from ..external.qt.QtCore import (QAbstractItemModel, QModelIndex,
QObject, Qt, QTimer, Signal)
from ..external.qt.QtGui import (QFont, QTreeView, QItemSelectionModel,
QAbstractItemView, QStyledItemDelegate)
from .qtutil i... | |
# coding: utf-8
from __future__ import unicode_literals
import hashlib
import hmac
import itertools
import json
import re
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_iso8601,
sanitized_Request,
)
class VikiBaseIE(InfoExt... | |
# Copyright: See the LICENSE file.
import datetime
import decimal
import unittest
import warnings
from unittest import mock
from factory import fuzzy, random
from . import utils
class FuzzyAttributeTestCase(unittest.TestCase):
def test_simple_call(self):
d = fuzzy.FuzzyAttribute(lambda: 10)
r... | |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
from __future__ import absolute_import
import sys
import os
import getpass as gp
import yaml
if "win32" in sys.platform:
import colorama
colorama.init()
import re
import tempfile
import subprocess
import codecs
import unicodedata
... | |
#! /usr/bin/env python
# Last Change: Mon Aug 20 08:00 PM 2007 J
from __future__ import division, print_function, absolute_import
import re
import itertools
import datetime
from functools import partial
import numpy as np
from scipy.lib.six import next
"""A module to read arff files."""
__all__ = ['MetaData', 'loa... | |
import mimetypes
import os
import random
import time
from email import Charset, Encoders
from email.generator import Generator
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils import formatdate, getaddr... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | |
# Copyright 2014 Cisco 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
#
# Unless requir... | |
from os import path
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from frozendict import frozendict
# noinspection PyProtectedMember
from vms.models.base import _JsonPickleModel, _StatusModel, _VmDiskModel, _ScheduleModel
from vms.models.dc impo... | |
"""Configuration file parser.
A setup file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
The option values can contain format strings which refer to other values in
the same section, or values in a special [DEFAULT] sect... | |
import time
import json
import numpy as np
__author__ = "Chang Gao, Liyan Chen"
__copyright__ = "Copyright (c) 2017 Malmactor"
__license__ = "MIT"
class spos:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
class pos:
def __init__(self, x, y, z):
self.x = float... | |
from django.test import TestCase
from unittest2 import skipIf
from django.db import connection
import json
from sqlshare_rest.util.db import get_backend
from sqlshare_rest.test import missing_url
from django.test.utils import override_settings
from django.test.client import Client
from django.core.urlresolvers import r... | |
# python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
import django_includes
from qurkexp.estimation.models import *
run_defs = {
'complete_test_vars_change10': { # and change1,...
'dataset': 'shape_blue_.1',
'vals_to_estimate': ["blue", "green"],
'num_batches': 5,
'batch_size': 10,
'display_style': 'tile',
'assignment... | |
import lasagne
import numpy as np
import theano
import theano.tensor as T
from sklearn import metrics
import layers
import params
import util
class NodeClassificationDCNN(object):
"""A DCNN model for node classification.
This is a shallow model.
(K, X) -> DCNN -> Dense -> Out
"""
def __init__(... | |
# pylint:disable=no-member
import pickle
import logging
from collections import defaultdict
import networkx
from ...protos import cfg_pb2, primitives_pb2
from ...serializable import Serializable
from ...utils.enums_conv import cfg_jumpkind_to_pb, cfg_jumpkind_from_pb
from ...errors import AngrCFGError
from .cfg_node ... | |
'''
Commander Keen 1-3 support for Tiled
2014 <[email protected]>
http://imgur.com/9qaOUWy
'''
import os
import os.path
from tiled import *
from tiled.qt import *
from keenlib.ted15 import load
from keenlib.ted15 import save
class KeenVorticons(Plugin):
@classmethod
def nameFilter(cls):
re... | |
import numpy as np
from warnings import warn
from faps.calculate_geno_probs import calculate_geno_probs
class genotypeArray(object):
"""
Genotype information about a sample of individuals, the identity of any known
relatives, and metadata about the dataset.
Currently only SNP data are supported. Data ... | |
# vim: set fileencoding=utf-8
from collections import defaultdict
import re
import inflection
try:
key = ('(?i)(p)erson$', '\\1eople')
del inflection.PLURALS[inflection.PLURALS.index(key)]
except ValueError:
pass
from regparser.layer import def_finders
from regparser.layer.scope_finder import ScopeFinder... | |
# Copyright (C) 2015 Pure Storage, 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 la... | |
"""
Testing for Support Vector Machine module (sklearn.svm)
TODO: remove hard coded numerical results when possible
"""
import numpy as np
import itertools
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from numpy.testing import assert_almost_equal
from numpy.testing import asse... | |
#MIT License
#Copyright (c) 2017 Tim Wentzlau
# 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: utf8 -*-
import mock
import os
import random
import string
import unittest
from .utils import placebo_session
from zappa.cli import ZappaCLI
from zappa.handler import LambdaHandler
from zappa.utilities import (add_event_source, remove_event_source)
from zappa.core import Zappa
def random_string(length... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | |
# 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... | |
#
# (c) Christian Sommerfeldt OEien
# All rights reserved
import pygame
import sys, code, re
from exceptions import Exception
from traceback import format_exc
from numbers import Complex
from functools import wraps
WHITE = 255, 255, 255
GRAY = 50, 50, 50
BLACK = 0, 0, 0
RED = 255, 0, 0
GREEN = 0, 255, 0
B... | |
#!/usr/bin/python
import json
import argparse
import sys
import os
import siphash
import time
import binascii
from random import randrange
pusher_cfg = {}
intf_to_port_number = {}
port_number_to_mac = {}
# Utility function to read from configuration file the VLL to create
def read_conf_file():
global pusher_cfg... | |
import torch
from torch.nn.parameter import Parameter
from torch.autograd import Variable, Function
import torch.nn as nn
import numpy as np
def _norm(x, dim, p=2):
"""Computes the norm over all dimensions except dim"""
if p == -1:
func = lambda x, dim: x.max(dim=dim)[0] - x.min(dim=dim)[0]
elif p... | |
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtCore, QtGui
from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject
import pyqtgraph.functions as fn
from .Terminal import *
from pyqtgraph.pgcollections import OrderedDict
from pyqtgraph.debug import *
import numpy as np
from .eq import *
def strDict(d):
... | |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# 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... | |
# Classes for scrAPI Harvesters
from __future__ import unicode_literals
import abc
import json
import logging
from datetime import timedelta, date
import six
from furl import furl
from lxml import etree
from scrapi import registry
from scrapi import settings
from scrapi.base.schemas import OAISCHEMA
from scrapi.lint... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
import numpy as np
import pandas as pd
from bokeh.models import ColumnDataSource
from ..plotting import figure
from ..plotting_helpers import _get_select_tool
def cross(start, facets):
"""Creates a unique combination of provided facets.
A cross product of an initial set of starting facets with a new set of
... | |
import py
from rpython.rlib.jit import JitDriver, hint, set_param, dont_look_inside,\
elidable
from rpython.rlib.objectmodel import compute_hash
from rpython.jit.metainterp.warmspot import ll_meta_interp, get_stats
from rpython.jit.metainterp.test.support import LLJitMixin
from rpython.jit.codewriter.policy import... | |
import numpy
from einops import rearrange, parse_shape, reduce
from tests import collect_test_backends
from tests.test_ops import imp_op_backends
def test_rearrange_examples():
def test1(x):
# transpose
y = rearrange(x, 'b c h w -> b h w c')
assert y.shape == (10, 30, 40, 20)
retu... | |
#!/usr/bin/env python
# -*- encoding: utf8 -*-
"""
Central interfaces for ``Pyadjoint``.
:copyright:
Lion Krischer ([email protected]), 2015
:license:
BSD 3-Clause ("BSD New" or "BSD Simplified")
"""
from __future__ import (absolute_import, division, print_function,
uni... | |
#
# 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 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | |
# orm/strategies.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related MapperOp... | |
import itertools
import unittest
import uuid
from mock import MagicMock
from hazelcast.protocol.codec import sql_execute_codec, sql_close_codec, sql_fetch_codec
from hazelcast.protocol.client_message import _OUTBOUND_MESSAGE_MESSAGE_TYPE_OFFSET
from hazelcast.serialization import LE_INT
from hazelcast.sql import (
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.