gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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 unde... | |
import logging
from billy.scrape import Scraper, SourcedObject
logger = logging.getLogger('billy')
class BillScraper(Scraper):
scraper_type = 'bills'
def scrape(self, chamber, session):
"""
Grab all the bills for a given chamber and session. Must be
overridden by subclasses.
... | |
import logging
import os
import pytest
from cu2qu.ufo import CURVE_TYPE_LIB_KEY
from fontTools import designspaceLib
import ufo2ft
from ufo2ft.constants import (
COLOR_LAYER_MAPPING_KEY,
COLOR_LAYERS_KEY,
COLOR_PALETTES_KEY,
)
from ufo2ft.filters import FILTERS_KEY, loadFilterFromString
from ufo2ft.filter... | |
# -*- coding: utf-8 -*-
"""
License: BSD
(c) 2009 ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no)
"""
import datetime
from itertools import izip
import re
from types import GeneratorType
try:
import babel
except ImportError:
babel = None
import genshi
from trac.core import *
from trac.... | |
import argparse
import json
import os
import sys
import tarfile
from contextlib import ExitStack
from tempfile import TemporaryDirectory
from libtiff import TIFF
from omero.cli import cli_login
from omero.gateway import BlitzGateway # noqa
from omero.constants.namespaces import NSBULKANNOTATIONS # noqa
def warn(me... | |
# -*- encoding: utf8 -*-
from datetime import *
from decimal import Decimal
#from fastdec import mpd as Decimal
from cPickle import dumps, loads
#from sqlalchemy.dialects.postgresql.base import ARRAY
from stresstest import *
# ---
test_types = False
test_methods = True
test_pickle = False
test_orm = False
# ---
verb... | |
# -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import InvalidOrder
class cex (Exchange):
def describe(self):
return self.deep_extend(super(cex, self).describe(), {
'id': 'cex',
... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Copyright 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... | |
# -*- coding: utf-8 -*-
# pylint: disable=C0103
"""
k-means clustering.
"""
# Author: bertrand-l
# License: BSD
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from warnings import warn
from .metrics import lp_norm
from .predictor import BasePredictor
from .rand i... | |
from __future__ import absolute_import
import logging
from unittest import TestCase
import settings
import sys, traceback
reload(sys)
sys.setdefaultencoding("utf-8")
import os
from AppCompatProcessor import main
import tempfile
from shutil import copyfile
# Setup the logger
logger = logging.getLogger()
DB = None
cla... | |
#!/usr/bin/python
# Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
"""
This script is a configuration helper to select pip requirement files to install
and python and shell configuration scripts to execute based on provided config
directories paths arguments and the operating system platform. To ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A pedestrian version of The Cannon.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["CannonModel"]
import logging
import numpy as np
import scipy.optimize as op
from . import (model, utils)... | |
# 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... | |
#
# Original author is Sander Marechal <s.marechal@jejik.com>
# http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
#
# !!! This file is python 3.x compliant !!!
#
# Changes:#
# - Added code to demote daemon process to specified uid and gid
# - Added debug logging
# - Re-coded for python ... | |
"""
This file is for biased simulation for alanine dipeptide only, it is used as the test for
more general file biased_simulation_general.py, which could be easily extend to other new
systems.
"""
from ANN_simulation import *
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys i... | |
# 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
# distribute... | |
"""Functions for generating interesting polynomials, e.g. for benchmarking. """
from sympy.core import Add, Mul, Symbol, Rational, sympify, Dummy, symbols
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.core.singleton import S
from sympy.polys.polytools import Poly, PurePoly
from sympy.polys.poly... | |
'''tzinfo timezone information for Asia/Ulan_Bator.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Ulan_Bator(DstTzInfo):
'''Asia/Ulan_Bator timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Ulan_Bator... | |
import functools
from dateutil.parser import parse as parse_date
from django.utils import timezone
from modularodm import (
fields,
Q,
)
from modularodm.exceptions import NoResultsFound
from modularodm.validators import MaxLengthValidator
from framework.auth import Auth
from framework.exceptions import Permis... | |
#!/usr/bin/env python
# Copyright (c) 2006-2008, David Allouche, Jp Calderone, Itamar Shtull-Trauring,
# Johan Dahlin, Olivier Grisel <olivier.grisel@ensta.org>
#
# Send maintenance requests needing new pypi packages to:
# Peter Waller <p@pwaller.net>
# https://github.com/pwaller/pyprof2calltree
#
# See CONTRIBUTOR... | |
"""The tests for the generic_thermostat."""
import datetime
from os import path
import pytest
import pytz
import voluptuous as vol
from homeassistant import config as hass_config
from homeassistant.components import input_boolean, switch
from homeassistant.components.climate.const import (
ATTR_PRESET_MODE,
D... | |
# -*- coding: utf-8 -*-
#
# 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 "L... | |
"""Dataset preprocessing."""
import builtins
from typing import List, Optional, Text
import bisect
import collections
import dataclasses
import enum
import re
import fire
import gast as ast
import numpy as np
from python_graphs import control_flow
from python_graphs import instruction as instruction_module
from cor... | |
from unittest import TestCase
import filters as f
from filters.test import BaseFilterTestCase
from iota import Address, Bundle, Iota, AsyncIota, Tag, Transaction, TryteString
from iota.adapter import MockAdapter, async_return
from iota.commands.extended.get_transfers import GetTransfersCommand, \
GetTransfersRequest... | |
# 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... | |
# Lint as: python2, python3
# 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
#
... | |
#---------------------------------------------------------------------------
# Copyright 2013-2019 The Open Source Electronic Health Record Alliance
#
# 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 Licen... | |
import unittest
import os, time
import OpTestConfiguration
from common.OpTestSystem import OpSystemState
from common.OpTestInstallUtil import InstallUtil
"""
THE PLAN:
- assert physical presence
- clears any existing keys
- gets the machine in a known state without secureboot
- enroll a set of PK, KEK, db
... | |
# 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, ... | |
"""The base entity class and any non-player classes derived from it.
Defines all the objects in the game.
"""
import random as rand
import sys
import pyglet
from geometry.shape import Shape
from geometry.vector import Vector
from utils import WINDOW_WIDTH, WINDOW_HEIGHT, wrap_angle, rand_direction
class Entity(obje... | |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpResponse
from django.http import HttpResponseBadRequest
from django.http import HttpResponseForbidden
from django.http import HttpResponseRedirect
from django.template.response import TemplateResponse
from django.urls import reverse
fr... | |
# -*- coding: utf-8 -*-
import os
#import get_colours
import breaking_levels
import theme_mapping
import mapping_utility
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from matplotlib_scalebar.scalebar import ScaleBar
#import matplotlib.patches as mpatche... | |
import unittest
from unittest import expectedFailure, skip
import colourettu
class Test_Colour(unittest.TestCase):
def test_default_colour(self):
"""Default colour is white"""
colour1 = colourettu.Colour()
self.assertEqual(colour1._r, 255)
self.assertEqual(colour1._g, 255)
... | |
#
# This file is part of snmpsim software.
#
# Copyright (c) 2010-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/snmpsim/license.html
#
# SNMP Agent Simulator
#
import json
import os
import re
import tempfile
import time
import uuid
from functools import wraps
from pyasn1.type import univ
from p... | |
from __future__ import absolute_import, division, print_function
import itertools
import math
from glob import glob
import heapq
from collections import Iterable, Iterator
from toolz import (merge, concat, frequencies, merge_with, take, curry, reduce,
join, reduceby, compose, second, valmap, count, map, partit... | |
__author__ = 'MBlaauw'
#import libraries
import os
import cv2
import numpy as np
from scipy.sparse import lil_matrix
from scipy.stats import expon
from sklearn.decomposition import RandomizedPCA
from sklearn import cross_validation
from sklearn import svm
from sklearn import metrics
from sklearn import preprocessing
... | |
# Copyright (c) 2008,2009 Citrix Systems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only. with the special
# exception on linking described in file LICENSE.
#
# T... | |
#!/usr/bin/env python
# $Id: NameMapper.py,v 1.11 2006/01/15 20:45:22 tavis_rudd Exp $
"""NameMapper Tests
Meta-Data
================================================================================
Author: Tavis Rudd <tavis@damnsimple.com>,
Version: $Revision: 1.11 $
Start Date: 2001/10/01
Last Revision Date: $Date: 2... | |
# -*- coding: utf-8 -*-
# flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# 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 licens... | |
from __future__ import unicode_literals
import warnings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import Prefetch
from django.db.models.query import get_prefetcher
from django.test import Test... | |
from datetime import datetime, timedelta
import numpy as np
import time
from GpsDataAnalyzer import utils
MEAN_DISTANCE_THRESHOLD = 100
def find_lineup(set1, set2):
"""
Optimized algorithm to find the approximate time offset between two GPS data sets.
This algorithm assigns the data set that starts late... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2018, Raffaele Salmaso <raffaele@salmaso.org>
# Copyright (c) 2012 Omoto Kenji
# Copyright (c) 2011 Sam Stephenson
# Copyright (c) 2011 Josh Peek
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation... | |
# 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... | |
"""Collection of helper methods.
All containing methods are legacy helpers that should not be used by new
components. Instead call the service directly.
"""
from homeassistant.components.climate import _LOGGER
from homeassistant.components.climate.const import (
ATTR_AUX_HEAT, ATTR_FAN_MODE, ATTR_HUMIDITY, ATTR_HV... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
######################################################################
# Copyright C 2015 Faurecia (China) Holding Co.,Ltd. #
# All rights reserved #
# Name: host.py
# Author: Canux canuxcheng@163.com ... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | |
## A script for extracting info about the patients used in the analysis
## Load necessary modules
from rpy2 import robjects as ro
import numpy as np
import os
ro.r('library(survival)')
##This call will only work if you are running python from the command line.
##If you are not running from the command line manually... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Thomas Scholtes
#
# 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 t... | |
from __future__ import absolute_import
import urwid
from netlib import http
from . import common, signals
def _mkhelp():
text = []
keys = [
("A", "accept all intercepted flows"),
("a", "accept this intercepted flow"),
("b", "save request/response body"),
("C", "clear flow list ... | |
import os
from tesserocr import PSM, PyTessBaseAPI
import cv2
import numpy as np
from PIL import Image
from typing import List, Optional
from constants import SIDES_DIR
from cv_helpers import contour_bounding_box_for_contour, extract_color, four_point_transform,\
get_center_for_contour, get_classifier_directories... | |
#!/usr/bin/env python
#
# 88 88 ad88 88 88
# 88 "" d8" "" "" ,d
# 88 88 88
# 88,dPPYba, 88 MM88MMM 8b,dPPYba, ,adPPYba, ,adPPYba, MM88MMM
# 88P' "8a 88 ... | |
"""
Task abstract class
A Task is a unit of work, it has associated source code and
a product (a persistent object such as a table in a database),
it has a name and lives in a DAG
[WIP] On subclassing Tasks
Implementation details:
* params (dict), upstream (Param object)
* params vs constructor parameters
* params ... | |
"""
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Big Switch Networks, 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... | |
##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | |
from __future__ import division
import copy
import unittest
import numpy
import six
from chainer import iterators
from chainer import serializer
from chainer import testing
class DummySerializer(serializer.Serializer):
def __init__(self, target):
super(DummySerializer, self).__init__()
self.tar... | |
# Copyright 2012 OpenStack LLC.
# 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... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.... | |
# 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... | |
<<<<<<< HEAD
<<<<<<< HEAD
"""Tests for lock.py"""
import unittest
from unittest import mock
import re
import asyncio
from asyncio import test_utils
STR_RGX_REPR = (
r'^<(?P<class>.*?) object at (?P<address>.*?)'
r'\[(?P<extras>'
r'(set|unset|locked|unlocked)(,value:\d)?(,waiters:\d+)?'
r')\]>\Z'
)
R... | |
# 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 ... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Ckluster Technologies
# All Rights Reserved.
#
# This software is subject to the provision stipulated in
# http://www.ckluster.com/OPEN_LICENSE.txt.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLU... | |
"""Support for PlayStation 4 consoles."""
import logging
import asyncio
import pyps4_homeassistant.ps4 as pyps4
from pyps4_homeassistant.errors import NotReady
from homeassistant.core import callback
from homeassistant.components.media_player import (
ENTITY_IMAGE_URL, MediaPlayerDevice)
from homeassistant.compon... | |
"""
Copyright 2015 Paul T. Grogan, Massachusetts Institute of Technology
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... | |
import json
from copy import deepcopy
from .controller_test_case import ControllerTestCase
class PostsControllerTestCase(ControllerTestCase):
def default_post_json(self, post_id=1, author_id=1):
return {
'data': {
'id': str(post_id),
'type': 'post',
... | |
# -*- coding: utf-8 -*-
"""
sources.py ---
Copyright (C) 2017, Midraal
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, either version 3 of the License, or
(at your option) any... | |
"""
Manage the information in the hosts file
"""
import errno
import logging
import os
import salt.utils.files
import salt.utils.odict as odict
import salt.utils.stringutils
log = logging.getLogger(__name__)
# pylint: disable=C0103
def __get_hosts_filename():
"""
Return the path to the appropriate hosts f... | |
import requests
from bs4 import BeautifulSoup
import sys
import numpy as np
# then add this function lower down
from memory_profiler import profile
import pandas as pd
from sortedcontainers import SortedDict
import datetime
import bs4
# TODO
# http://www.meilleursagents.com/immobilier/recherche/?item_types%5B%5D=3696... | |
# -*- coding: utf-8 -*-
"""Top-level display functions for displaying object in different formats.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. ... | |
# 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... | |
import os # os.path.isfile()
import re
from PresentationObject import PresentationObject
from font import font # lineBreak()
from qt import *
from qtcanvas import *
true = success = 1
false = failure = 0
class img( PresentationObject ):
"""
<img> is used to draw an image.
<p>
<b>Properties:</b>
<ul>
<li... | |
# Copyright 2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from botocore.exceptions import ClientError
import boto3
import click
import json
from c7n.credentials import assumed_session
from c7n.utils import get_retry, dumps, chunks
from concurrent.futures ... | |
"""
Django settings for voteswap project.
Generated by 'django-admin startproject' using Django 1.9.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
from voteswa... | |
from flask import request
from flask_restplus import Namespace, Resource, fields as rest_fields
from cerebralcortex.apiserver import CC
from cerebralcortex.kernel.datatypes.datapoint import DataPoint
from cerebralcortex.kernel.datatypes.datastream import Stream
api = Namespace('stream', description='Data and annotati... | |
## @file
# This file is used to define common static strings used by INF/DEC/DSC files
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under ... | |
# 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 ... | |
# Copyright 2009-2015 MongoDB, 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 writin... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
# TODO: implement destructive version of BatchedInvOp
# TODO: implement optimization to replace batched_inv{destructive=False} with batched_inv{destructive=True} if applicable.
import numpy as np
import theano
import theano.tensor as T
import theano.sandbox.cuda as cuda
from theano.misc.pycuda_utils import to_gpua... | |
# Copyright (c) 2013, Preferred Infrastructure, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this l... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 except in compli... | |
import collections
import math
import cv2
import scipy.weave
import numpy as np
import time
import os
import random
class Atan(object):
@classmethod
def fwd(cls, x):
return np.arctan(x)
@classmethod
def derivative(cls, x):
return 1./ (1 + x ** 2.)
class Tanh(object):
@classmethod
... | |
# -*- coding: utf-8 -*-
# pylint: disable=star-args, too-many-arguments, fixme
""" This module contains classes for handling DIDL-Lite metadata.
This is the XML schema used by Sonos for carrying metadata representing many
items such as tracks, playlists, composers, albums etc.
"""
# It tries to follow the class h... | |
# Copyright 2011 Nicholas Bray
#
# 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 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# 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/l... | |
# 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... | |
from nose.tools import *
from unittest import TestCase
from datetime import datetime, timedelta
from stats.stat_collector_factory import StatCollectorFactory
from stats.stat_collector_factory import StatConfigurationInvalidException
from stats.results_stat_collector import ResultsStatCollector
from files.file_package... | |
"""
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Provides an xUnit ResultsFormatter for integrating the LLDB
test suite with the Jenkins xUnit aggregator and other xUnit-co... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | |
import os
import sys
import unittest
from flask import Flask, request
from app import generator
try:
import kvm_player
except ImportError:
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import kvm_player
@unittest.skipIf(os.getenv("KVM_ISO", None) is None, "TestKVMBasicISO... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Rackspace US, 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/LI... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcplife Trace the lifespan of TCP sessions and summarize.
# For Linux, uses BCC, BPF. Embedded C.
#
# USAGE: tcplife [-h] [-C] [-S] [-p PID] [interval [count]]
#
# This uses the sock:inet_sock_set_state tracepoint if it exists (added to
# Li... | |
#Graphics Manager
# The class that manages the drawing of all objects in the game.
import random
import pygame
import environment
# Colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
WING_YELLOW = pygame.image.load('img/colorwings/wing yellow.png')
WING_GREY = ... | |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
from torchvision import datasets, transforms
class Net(nn.Module):
def __init__(self):
super(Net, self).__init_... | |
PBPTonscreenText = 0.2
RPdirectFrame = (1.75, 1, 0.75)
RPtrackLabels = 0.05
RPmeritBarLabels = 0.165
RPskipScale = 0.2
RPskipPos = (0, -.28)
RPmeritLabelPosX = 0.55
RPmeritBarsPosX = 0.825
BBbattleInputTimeout = 20.0
FCPtextFrame = 0.08
DHQInamePath = 0.9
DHQInamePathPos = (-4, 0, 0)
DHQIscorePathPos = (-4.6, 0, 0)
DHQ... | |
"""Provides a command-line interface for running experiments."""
# Copyright (c) 2011-2013 Mick Thomure
# All rights reserved.
#
# Please see the file LICENSE.txt in this distribution for usage terms.
try:
import matplotlib
matplotlib.use("cairo") # workaround old scipy bug
except ImportError:
pass
import cPi... | |
# Copyright 2008-2013 Yousef Ourabi
# 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.