gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging.handlers
import sqlalchemy as tsa
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import MetaData
from sqlalchemy import or_
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import util
from sqlalchemy.sql import util... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/math/reduce.py
# Module with some useful utilities for reducing some math objects
# =============================================================================
__version__ = "... | |
from django.db.models import signals
from datetime import datetime, timedelta, date
import reversion
from collections import namedtuple
from difflib import SequenceMatcher
from django.contrib.contenttypes.models import ContentType
# convenience methods for reversion-backed models
class VersionManagerHelperException... | |
"""Support for Almond."""
import asyncio
from datetime import timedelta
import logging
import time
from typing import Optional
from aiohttp import ClientError, ClientSession
import async_timeout
from pyalmond import AbstractAlmondWebAuth, AlmondLocalAuth, WebAlmondAPI
import voluptuous as vol
from homeassistant impor... | |
"""
Test the "snabb lwaftr config" subcommand. Does not need NIC names because
it uses the "bench" subcommand.
"""
import json
import os
from signal import SIGTERM
import socket
from subprocess import PIPE, Popen
import time
import unittest
import re
import random
import string
from test_env import BENCHDATA_DIR, DAT... | |
# Copyright (c) 2013 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.
import copy
import fnmatch
import logging
import os
from pylib import android_commands
from pylib import cmd_helper
from pylib import constants
from pyl... | |
import numpy as np
from PySide import QtGui, QtCore
import sharppy.sharptab as tab
from sharppy.sharptab.profile import Profile, create_profile
from sharppy.sharptab.constants import *
from PySide.QtGui import *
from PySide.QtCore import *
__all__ = ['backgroundHodo', 'plotHodo']
class backgroundHodo(QtGui.QFrame):
... | |
"""
Common statistics library
"""
# python libs
from math import ceil
from math import exp
from math import floor
from math import log
from math import pi
from math import sqrt
from itertools import izip
import cmath
import random
# rasmus libs
from rasmus import util
from rasmus import tablelib
def logprod(ls... | |
import os
import yaml
import json
import re
import requests
import logging
import socket
from datetime import datetime
import teuthology
from .config import config
from .job_status import get_status, set_status
report_exceptions = (requests.exceptions.RequestException, socket.error)
def init_logging():
"""
... | |
from __future__ import unicode_literals
import warnings
from mopidy.core import PlaybackState
from mopidy.mpd import exceptions, protocol
@protocol.commands.add('consume', state=protocol.BOOL)
def consume(context, state):
"""
*musicpd.org, playback section:*
``consume {STATE}``
Sets consum... | |
#===============================================================================
# The OTBot: The Old Trailers Bot
#-------------------------------------------------------------------------------
# Version: 0.1.0
# Updated: 14-05-2014
# Author: Alex Crawford
# License: MIT
#=============================================... | |
"""The Shelly integration."""
import asyncio
from datetime import timedelta
import logging
import aioshelly
import async_timeout
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_DEVICE_ID,
CONF_HOST,
CONF_PASSWORD,
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,... | |
# 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... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | |
"""
server side redis listener.
- logging
- exception handling
"""
import os
import sys
import json
import toml
import msgpack
import requests
import redis
import threading
import time
import etcd
import gevent
from gevent.pool import Pool
from gevent import monkey
monkey.patch_all()
conf_fn = os.sep.join(... | |
import json
import uuid
from unittest import TestCase
from plugIt.bridge.bridge import Bridge
class TestPlugIt(TestCase):
def setUp(self):
self.plugIt = Bridge('http://0.0.0.0/')
_self = self
def _do_query(url, method='GET', query_string=None, body=None, files=None, additional_headers... | |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
"""Tractor Purge - avoid running out of diskspace!
More info: https://github.com/fredrikaverpil/tractor-purge
"""
import sys
import os
import subprocess
import re
import shutil
import logging
from optparse import OptionParser
import time
import glob
####################################
# Option parser and constants
... | |
# 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 ... | |
from test.support import verbose, run_unittest
import re
from re import Scanner
import sys, traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
# what you're doing. Some of these tests were carefuly modeled to
# cover most of the co... | |
import time
import warnings
import numpy as np
import tensorflow as tf
from stable_baselines.common import tf_util, OffPolicyRLModel, SetVerbosity, TensorboardWriter
from stable_baselines.common.vec_env import VecEnv
from stable_baselines.common.math_util import safe_mean, unscale_action, scale_action
from stable_bas... | |
"""
Low-level helpers for the SecureTransport bindings.
These are Python functions that are not directly related to the high-level APIs
but are necessary to get them to work. They include a whole bunch of low-level
CoreFoundation messing about and memory management. The concerns in this module
are almost entirely abou... | |
import ptypes
from ptypes import *
from . import umtypes, mmtypes
from .datatypes import *
class SIZE_T64(ULONGLONG): pass
class RTL_CRITICAL_SECTION(pstruct.type, versioned):
_fields_ = [
(PVOID, 'DebugInfo'),
(LONG, 'LockCount'),
(LONG, 'RecursionCount'),
(PVOID, 'OwningThread')... | |
from flask import Flask
from flask import g
from flask import jsonify
from flask import redirect
from flask import render_template
from flask import render_template_string
from flask import request
from flask import send_from_directory
from flask import url_for
from flask.ext.babel import Babel
from flask.ext.mail impo... | |
import datetime
import random
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.hashcompat import sha_constructor
from django.utils.translation impor... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################
#### author: wukai ####
#### License: MIT ####
#### v1.0 ####
##############################
import copy
__all__ = ["QS", "T", "F", "E"]
class Error(Exception):
pass
def quote(name):
return "`%s`"... | |
from datetime import datetime
from dateutil import rrule
from osgeo import gdal, ogr
import numpy as np
start, end = datetime(2000, 1, 1), datetime(2013, 12, 31)
sWin, eWin = datetime(start.year, 11, 1), datetime(end.year, 3, 30)
sMon, eMon = datetime(start.year, 6, 1), datetime(start.year, 10, 1)
shp_filename = 'C:\... | |
#!/usr/bin/env python2.6
"""Classes and functions for UnofficialDDNSnix.
https://github.com/Robpol86/UnofficialDDNSnix
"""
from __future__ import division
from __future__ import print_function
import StringIO
import functools
import logging
import logging.handlers
import os
import re
import sys
import yaml
import yaml... | |
import copy
from haystack.exceptions import AlreadyRegistered, NotRegistered, SearchFieldError
class SearchSite(object):
"""
Encapsulates all the indexes that should be available.
This allows you to register indexes on models you don't control (reusable
apps, django.contrib, etc.) as well as cust... | |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to store, generate, and manipulate material interfaces.
"""
from itertools import chain, combinations, product
from typing import Dict, List, Tuple, Optional
import numpy as np
from scipy.clus... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright 2011 Cloudscaling Group, 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 applicabl... | |
# coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | |
from dateutil.parser import parse as parse_date
import pytest
from future.moves.urllib.parse import urlparse
from api.base.settings.defaults import API_BASE
from api.nodes.serializers import NodeSerializer
from api.sparse.serializers import SparseNodeSerializer, SparseRegistrationSerializer
from api.registrations.seri... | |
from app import app, mdb
from flask import request, json
from config import *
import os
import datetime, time
def connect_database():
"""Returns a connection to database"""
try:
con = mdb.connect(os.environ.get('SQL_DATABASE_URI'), SQL_DATABASE_USER, \
SQL_DATABASE_PASS, SQL_DATA... | |
"""
Stochastic Gradient Descent.
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import time
import logging
import theano
import th... | |
from base64 import b64decode
import copy
import importlib
from django.contrib.auth import (get_user_model, authenticate)
from django.core.files.base import ContentFile
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from rest_framework import serializers
from ... | |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Routines and classes for working with Portage overlays and ebuilds."""
import collections
import filecmp
import fileinput
import glob
import loggi... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cisco 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.org/licenses/LICENSE-2... | |
import os, sys
sys.path.append(os.getcwd())
import time
import numpy as np
import tensorflow as tf
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv2d
import tflib.ops.batchnorm
import tflib.ops.deconv2d
import tflib.save_images
import tflib.cifar10
import tflib.inception_score
import tflib.plot
# D... | |
import sys
if sys.hexversion >= 0x02050000:
import xml.etree.ElementTree as ET
else:
import elementtree.ElementTree as ET
import socket
import vdebug.log
import base64
import time
import string
""" Response objects for the DBGP module."""
class Response:
"""Contains response data from a command made to th... | |
'''Splitter
======
.. versionadded:: 1.5.0
.. image:: images/splitter.jpg
:align: right
The :class:`Splitter` is a widget that helps you re-size it's child
widget/layout by letting you re-size it via dragging the boundary or
double tapping the boundary. This widget is similar to the
:class:`~kivy.uix.scrollview.... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | |
# 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 ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Jack River'
from random import shuffle, randint
from itertools import cycle
CARD_2_VALUE = 13
CARD_A_VALUE = 12
class Card():
SUITS = ['Spades', 'Hearts', 'Diamonds', 'Clubs']
VALUES = range(3, 14) # value 12 = 'A' | value 13 = '2'
def __ini... | |
"""
Control the OpenBSD packet filter (PF).
:codeauthor: Jasper Lievisse Adriaanse <j@jasper.la>
.. versionadded:: 2019.2.0
"""
import logging
import re
import salt.utils.path
from salt.exceptions import CommandExecutionError, SaltInvocationError
log = logging.getLogger(__name__)
def __virtual__():
"""
... | |
#9DOF.py
# script to adquire data from a I2C 9DOF
#
# Oriol Sanchez, 9/19/2013
#
# Changelog:
# V0 9/17/2013
#
# Readme:
#
# Instructions: - execute phyton 9DOF.py from the shell inside the arm
# - visualize the data in the shell or retreive it after
# - from the txt file created by the script
#
im... | |
__author__ = 'CwT'
from idaapi import *
from idautils import *
from idc import *
import struct
global baseAddr
def writefile(file, addr, len):
for i in range(len):
one = getByte(addr+i)
file.write(struct.pack("B", one))
def getDword(addr):
return Dword(addr)
def getByte(addr):
return By... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import sys
from collections import OrderedDict
import opt_einsum
from pyro.distributions.score_parts import ScoreParts
from pyro.distributions.util import scale_and_mask
from pyro.ops.packed import pack
from pyro.poutine.util imp... | |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | |
# -*- coding: utf-8 -*-
"""
cpsdirector.application
=======================
ConPaaS director: application support.
:copyright: (C) 2013 by Contrail Consortium.
"""
from flask import Blueprint
from flask import jsonify, request, g
import simplejson
import ConfigParser
from netaddr import IPNetwork
... | |
# helpers.py
from pyparsing.core import *
from pyparsing.util import _bslash, _flatten, _escapeRegexRangeChars
#
# global helpers
#
def delimitedList(expr, delim=",", combine=False):
"""Helper to define a delimited list of expressions - the delimiter
defaults to ','. By default, the list elements and delimite... | |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Run Regression Test Suite
This module calls down into individual test cases via subprocess. It will
... | |
#!/usr/bin/env python
from __future__ import print_function
__author__ = "Matija Amidzic <matija.amidzic@sartura.hr>"
__copyright__ = "Copyright 2018, Deutsche Telekom AG"
__license__ = "BSD 3-Clause"
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | |
# Copyright 2000-2007 Michael Hudson-Doyle <micahel@gmail.com>
# Bob Ippolito
# Maciek Fijalkowski
#
# All Rights Reserved
#
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted wi... | |
#!/usr/bin/env python
import os
import sys
import os.path
from gimpfu import *
from math import pow, sqrt, floor
from gimpcolor import RGB
def euclidean_distance(point_one, point_two):
""" Calculates the euclidean distance.
Args:
point_one (tuple)
point_two (tuple)
Retur... | |
# -*- coding: utf-8 -*-
"""SQLite parser plugin for Mozilla Firefox history database files."""
from __future__ import unicode_literals
from dfdatetime import posix_time as dfdatetime_posix_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.p... | |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from future.utils import with_metaclass
__all__ = ('autoclass', 'ensureclass')
from .jnius import (... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | |
from __future__ import absolute_import
import blinker
from collections import deque
from functools import wraps, partial
from threading import local
import sys
from .compat import reraise, iteritems, is_nextable
def noop(*_, **dummy):
pass
class StopIterationWithValue(StopIteration):
value = None
def _... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2014 Romain Dorgueil
#
# 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... | |
################################################################################
# The Sandbox Libraries (Python) Test Suite 0 (Dependencies) #
# #
# Copyright (C) 2004-2009, 2011-2013 LIU Yu, pineapple.liu@gmail.com ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module implements the base CCDData class."""
import numpy as np
from .compat import NDDataArray
from .nduncertainty import StdDevUncertainty, NDUncertainty
from ..io import fits, registry
from .. import units as u
from .. import log
from ..wcs im... | |
# 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... | |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... | |
import base64
import json
import os
import threading
import queue
import uuid
from multiprocessing.managers import AcquirerProxy, BaseManager, BaseProxy, DictProxy, public_methods
from .utils import isomorphic_encode
class StashManager(BaseManager):
shared_data = {}
lock = threading.Lock()
def _get_shared... | |
"""
Component that will help set the ffmpeg component.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ffmpeg/
"""
import asyncio
import logging
import os
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import ... | |
import subprocess
import sys
import threading
from time import sleep
import os, signal
class Controller():
"""
Gets input from a controller recognized by xboxdrv.
Parameters
----------
return_values: list, optional
Values to return from the controller. use get_input_names()
to get the names of these values.
... | |
# -*- coding: utf-8 -*-
"""
xkbgroup.core
~~~~~~~~~~~~~
This module implements the XKeyboard API.
Classes:
* XKeyboard: the main class.
Exceptions:
* X11Error: raised for errors on X server issues.
:copyright: (c) 2016 by Nguyen Duc My.
:license: MIT, see LICENSE for more detail... | |
import json
from django.forms import ModelForm
from django import forms
from django.forms.models import model_to_dict
from crispy_forms.layout import Layout, HTML
from crispy_forms.bootstrap import Field
from hs_core.forms import BaseFormHelper
from .models import Site, Variable, Method, ProcessingLevel, TimeSeriesR... | |
#!/usr/bin/env python
# Module : SysTrayIcon.py
# Synopsis : Windows System tray icon.
# Programmer : Simon Brunning - simon@brunningonline.net
# Date : 11 April 2005
# Notes : Based on (i.e. ripped off from) Mark Hammond's
# win32gui_taskbar.py and win32gui_menu.py demos from PyWin32
... | |
# Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, request, make_response, render_template, send_file, jsonify, abort
from werkzeug import secure_filename
from werkzeug.exceptions import RequestEntityTooLarge
from flask_wtf.csrf import CsrfProtect
import datetime
import hashlib
import os
from time i... | |
# -*- coding: utf-8 -*-
# ----- for creating dataset -----
from sklearn.datasets import load_digits
from sklearn.cross_validation import train_test_split
# ----- general import -----
import pandas as pd
import numpy as np
# ----- stacking library -----
from stacking.base import FOLDER_NAME, PATH, INPUT_PATH, TEMP_PA... | |
from django.shortcuts import render, redirect
from django.template import loader, RequestContext
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login as au... | |
# Copyright (C) 2016 The Android Open Source Project
#
# 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 ... | |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated']... | |
# Copyright 2018 ARM Limited
#
# 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 writin... | |
# coding: utf-8
from .base import ObjectifyModel
from ..base import ObjectifyObject
class ObjectifyList(ObjectifyModel):
"""
The instantiated ObjectifyObject class we want to use in our list
"""
__slots__ = ('__list__','__my_list_object__')
__list_object__ = None
def __init__(self,l... | |
# -*- coding: utf-8 -*-
'''
Subversion SCM
'''
# Import python libs
import re
import shlex
import subprocess
# Import salt libs
from salt import utils, exceptions
from salt.modules import state_std
_INI_RE = re.compile(r"^([^:]+):\s+(\S.*)$", re.M)
def __virtual__():
'''
Only load if svn is installed
''... | |
# -*- coding: utf-8 -*-
"""
The following image extraction implementation was taken from an old
copy of Reddit's source code.
"""
__title__ = 'newspaper'
__author__ = 'Lucas Ou-Yang'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014, Lucas Ou-Yang'
import logging
import urllib
import StringIO
import math
from PIL i... | |
import functools
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
import canopy
from treeano.sandbox.nodes import batch_normalization as bn
fX = theano.config.floatX
@treeano.register_node("strided_downsample")
class StridedDownsampleNode(treeano.NodeImpl):
hy... | |
from __future__ import division, print_function, absolute_import
from scipy import stats
import numpy as np
from numpy.testing import assert_almost_equal, assert_, assert_raises, \
assert_array_almost_equal, assert_array_almost_equal_nulp
def test_kde_1d():
#some basic tests comparing to normal distribution
... | |
#
# 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... | |
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# IMPORTS ----------------------------------------------------------------------
import os
# ------------------------------------------------------------------------------
# MODULE INFORMATIONS ... | |
""" Test functions for fftpack.basic module
"""
import sys
from numpy.testing import *
from scipy.fftpack import ifft, fft, fftn, irfft, rfft
from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble
import numpy.fft
from numpy.random import rand
def random(size):
return rand(*size)
def direct_dft(... | |
#!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | |
# server.py -- Implementation of the server side git protocols
# Copyright (C) 2008 John Carr <john.carr@unrouted.co.uk>
#
# This program 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
# or (at your... | |
#!/usr/bin/env python3
# ----------------------------------------------------------------------
# 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 li... | |
import time
import random
import os
import re
import numpy as np
import pandas as pd
from sklearn import preprocessing
from keras.preprocessing import sequence
import keras.callbacks
#====================================================== DATA GENERATOR ==============================================================... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import json
from unittest import TestCase
from mock import Mock
from mock import patch
from pybutton.request import request
from pybutton.request import reque... | |
import sys
import traceback
import code
import renderer
class PPU():
def __init__(self, cpu):
self.cpu = cpu
self.renderer = renderer.Renderer(self)
self.memory = [0x00] * 0x4000
self.sprMemory = [0x00] * 0x100
self.nt = [0x00] * (256*240*2)
self.xlines = 256
... | |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | |
"""
Copyright 2015, Institute e-Austria, Timisoara, Romania
http://www.ieat.ro/
Developers:
* Gabriel Iuhasz, iuhasz.gabriel@info.uvt.ro
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:
ht... | |
# 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 ... | |
"""Test cases for traceback module"""
from collections import namedtuple
from io import StringIO
import linecache
import sys
import unittest
import re
from test import support
from test.support import TESTFN, Error, captured_output, unlink, cpython_only, ALWAYS_EQ
from test.support.script_helper import assert_python_o... | |
import re
from Queue import Queue
from math import ceil
from types import *
WHITESPACE = ['\n', '\t', ' ', '', u'\u3000']
# from helpers.constants import WHITESPACE
def splitKeepWhitespace(string):
"""
Splits the string on whitespace, while keeping the tokens on which the string was split.
Args:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.