gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""Test the python_script component."""
import logging
from unittest.mock import mock_open, patch
from homeassistant.components.python_script import DOMAIN, FOLDER, execute
from homeassistant.helpers.service import async_get_all_descriptions
from homeassistant.setup import async_setup_component
from tests.common impo... | |
# -*- coding: utf-8 -*-
from random import randint
from datetime import date
from lettuce import *
from rapidsms.contrib.locations.models import *
from django.template.defaultfilters import slugify
from survey.features.page_objects.households import NewHouseholdPage, HouseholdsListPage, HouseholdDetailsPage, EditHou... | |
"""The test for the threshold sensor platform."""
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, STATE_UNKNOWN, TEMP_CELSIUS
from homeassistant.setup import async_setup_component
async def test_sensor_upper(hass):
"""Test if source is above threshold."""
config = {
"binary_sensor": {
... | |
#!/usr/bin/env python
"""
Copyright (c) 2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... | |
# Copyright 2012 Nicira, 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 agr... | |
from __future__ import absolute_import, unicode_literals
import mock
from oauthlib.oauth2.rfc6749.tokens import *
from ...unittest import TestCase
class TokenTest(TestCase):
# MAC without body/payload or extension
mac_plain = {
'token': 'h480djs93hd8',
'uri': 'http://example.com/resource/1... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2013 NTT 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... | |
# -*- coding: utf-8 -*-
"""User models."""
from flask import current_app, url_for
from flask_babel import gettext
from flask_login import UserMixin
from fulfil_client.model import BooleanType, ModelType, One2ManyType, StringType
from itsdangerous import TimestampSigner, URLSafeSerializer
from shop.extensions import fu... | |
'''
Created on Sep 18, 2013
@author: timmahrt
Given two lists of tuples of the form [(value, time), (value, time)], morph
can iteratively transform the values in one list to the values in the other
while maintaining the times in the first list.
Both time scales are placed on a relative scale. This assumes that the ... | |
#
# Copyright 2011 Red Hat, 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... | |
"""Word completion for IPython.
This module is a fork of the rlcompleter module in the Python standard
library. The original enhancements made to rlcompleter have been sent
upstream and were accepted as of Python 2.3, but we need a lot more
functionality specific to IPython, so this module will continue to live as an... | |
#-*- coding: utf8
'''
This module contains the mixture of odes used for each
infectivity model. The classes here defined are used for
fitting the Phoenix-R model.
'''
from __future__ import division, print_function
from numpy.linalg import LinAlgError
from phoenix import ode
from phoenix.peak_finder import find_peak... | |
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import array, poly1d
from scipy.interpolate import interp1d
from scipy.special import beta
# The following code was used to generate the Pade coefficients for the
# Tukey Lambda variance function. Version 0.17 of mpmath w... | |
import json
import sys
import requests
from requests.auth import HTTPBasicAuth
class ConfigEngine:
"""
Processes the configuration file to find what the promotion gates are and
the information necessary to grab the test data
"""
def required_config_error(self, required_item):
"""
P... | |
from django.shortcuts import redirect
from finance.models import Transaction, Person
from django.shortcuts import render, render_to_response
from django.contrib.admin.views.decorators import staff_member_required
from django.template.context import RequestContext
from finance.forms import CSVInputForm, MemberTestForm
i... | |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
# Copyright 2011 Justin Santa Barbara
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Kiwi Markup
This script implements the mark-up for the Kiwi system (essentially a
static website generator). It expects to be given a list of text lines
which it converts to the equivalent HTML format.
Because this is the first part of a larger system it is not really
... | |
from __future__ import absolute_import, unicode_literals
import urlparse
from mopidy.internal import deprecation
from mopidy.mpd import exceptions, protocol, translator
@protocol.commands.add('add')
def add(context, uri):
"""
*musicpd.org, current playlist section:*
``add {URI}``
Adds the ... | |
# 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 ... | |
# -*- coding: utf-8 -*-
#
# nova documentation build configuration file, created by
# sphinx-quickstart on Sat May 1 15:17:47 2010.
#
# This file is execfile()d with the current directory set to
# its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | |
import email.utils
import email.encoders
import logging
import mimetypes
import imghdr
from contextlib import closing
from cStringIO import StringIO
from os import path
from email.mime import audio
from flanker.utils import is_pure_ascii
from flanker.mime import bounce
from flanker.mime.message import headers, charse... | |
# Copyright 2014 Red Hat, Inc.
#
# Author: Rich Megginson <rmeggins@redhat.com>
#
# 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 ... | |
# Copyright 2013 Tom Ruette
#
# 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 i... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Contains WithSimilarityScore mixin.
This defines a procedure of getting "similar" objects which have similar
relationships.
"""
from sqlalchemy import and_
from sqlalchemy import case
from sqlalchemy im... | |
import functools
from itertools import imap
import urecord
from relations.tuple import Tuple
__all__ = ['Relation', 'RelationalError', 'UndefinedFields',
'NotUnionCompatible']
class RelationalError(Exception):
"""An undefined or invalid operation was attempted."""
pass
class UndefinedFields(R... | |
"""
pygments.lexers._sourcemod_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names of SourceMod functions.
It is able to re-generate itself.
Do not edit the FUNCTIONS list by hand.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see ... | |
#!/usr/bin/env python -W ignore::DeprecationWarning
'''
KPCA based feature engineering for MNIST handwritten digits classification with
combination of kernels in each layers
Author : Akhil P M
Kernel used : Arc-cosine Kernel, Gaussian Kernel, Polynomial kernel
'''
import kernel
from settings import *
from umkl_new i... | |
#!/usr/bin/python3
#
# Copyright (c) 2015, VSHN AG, info@vshn.ch
# Licensed under "BSD 3-Clause". See LICENSE file.
#
# Authors:
# - Andre Keller <andre.keller@vshn.ch>
#
"""
MikroTik Router OS Python API
"""
import binascii
import hashlib
import logging
LOG = logging.getLogger(__name__)
class ApiError(Exception... | |
"""Support for Apple HomeKit."""
import asyncio
import ipaddress
import logging
import os
from aiohttp import web
from pyhap.const import STANDALONE_AID
import voluptuous as vol
from homeassistant.components import zeroconf
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_BATTERY_CHARGING,
DE... | |
# -*- coding: utf-8 -*-
from django.views.generic import TemplateView, FormView, ListView
from django.views.generic.edit import ProcessFormView, FormMixin
from django import forms
#from django.http import HttpResponseRedirect, HttpResponse
#from django.core.context_processors import csrf
#from django.template.context ... | |
"""Provides access to stored IDLE configuration information.
Refer to the comments at the beginning of config-main.def for a description of
the available configuration files and the design implemented to update user
configuration information. In particular, user configuration choices which
duplicate the defaults will... | |
# Copyright 2014 Red Hat 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... | |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Classes related to transfection worklist generation
(robot worklist generations).
AAB, Sept 2011
"""
from thelma.tools.semiconstants import PIPETTING_SPECS_... | |
'''
Created on Nov 17, 2015
@author: cphurley
'''
import logging
import os
import re
import random
import json
import time
import webapp2
import jinja2
from google.appengine.ext import ndb
from lib.mtg.setutil import SetUtil
from lib.db.user import User
from lib.db.draft import Draft
from lib.db.drafter import Draft... | |
# 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... | |
## 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)')
import re
##This call will only work if you are running python from the command line.
##If you are not running from the command line... | |
# -*- coding: utf-8 -*-
import os
import pytest
import pandas as pd
import numpy as np
import scipy
from lifelines import (
NelsonAalenFitter,
KaplanMeierFitter,
CoxPHFitter,
CoxTimeVaryingFitter,
AalenAdditiveFitter,
WeibullFitter,
LogNormalFitter,
LogLogisticFitter,
WeibullAFTFitt... | |
import numpy as np
import os
import pickle
import pandas as pd
from scipy.io import loadmat
from pylearn2.format.target_format import OneHotFormatter
from scipy.signal import butter, filtfilt
from sklearn import preprocessing
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix, DefaultViewConverter
cla... | |
import calendar
import math
import re
from datetime import datetime, timedelta, date
import pandas as pd
import pytz
from catalyst.exchange.exchange_errors import InvalidHistoryFrequencyError, \
InvalidHistoryFrequencyAlias
def get_date_from_ms(ms):
"""
The date from the number of miliseconds from the e... | |
"""
Support for Nest thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.nest/
"""
import logging
import voluptuous as vol
from homeassistant.components.nest import (
DATA_NEST, SIGNAL_NEST_UPDATE, DOMAIN as NEST_DOMAIN)
from homeas... | |
# Copyright 2014 Citrix Systems
#
# 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 agr... | |
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
def setup():
global args, workdir
programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget']
if args.kvm:
programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
elif args.docker:
dockers = ['docker.io',... | |
import logging
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import rcParams
import scipy.stats
from scipy.special import gamma
import datetime
from pathlib import Path
rcParams.update({'figure.autolayout': True})
# Set a larger default size for plots
... | |
#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Tests the robustness and resiliency of vtworkers."""
from collections import namedtuple
import urllib
import urllib2
import logging
import... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from sys import argv
import random
import re
import nltk
import operator
from nltk.corpus import cmudict
from nltk.probability import LidstoneProbDist
script, book = argv
e = cmudict.entries()
d = cmudict.dict()
banned_end_words = ['the', 'a', 'an', 'at', 'been', 'in', 'of', 'to', 'by', 'my',
'to... | |
# Copyright 2012 NEC 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 applicable law or ag... | |
import unittest
from django.test import TestCase
from django.http import HttpRequest
from django.core.urlresolvers import reverse
from django.test import TestCase
import settings
try:
import json
except ImportError:
import simplejson as json
def print_resp(resp):
if not resp.content:
return
tr... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# A notifier leech invaders internet.
# Copyright (c) 2011, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | |
"""JSON implementations of repository searches."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected methods allowed ... | |
#!/usr/bin/env python
import codecs
import fnmatch
import os
import subprocess
import sys
import tarfile
import unicodedata
import pandas
import progressbar
from sox import Transformer
from tensorflow.python.platform import gfile
from deepspeech_training.util.downloader import maybe_download
SAMPLE_RATE = 16000
de... | |
import asyncio
import time
from typing import Any, Dict, Optional
from . import constants as c
from .exceptions import EventError
from .utils import http_post
def _get_options(data):
"""
Return a dict of parsed message options.
"""
raw_options = data.get('options', {})
options: Dict[str, Any] = ... | |
"""
Field classes.
"""
import datetime
import os
import re
import time
import urlparse
import warnings
from decimal import Decimal, DecimalException
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.core.exceptions import ValidationError
from django.core import ... | |
"""Standalone Authenticator."""
import argparse
import collections
import logging
import socket
import threading
import OpenSSL
import six
import zope.interface
from acme import challenges
from acme import standalone as acme_standalone
from letsencrypt import errors
from letsencrypt import interfaces
from letsencry... | |
"""User related views."""
from django.contrib.auth.decorators import login_required
from django.views.generic import View, ListView, DetailView, CreateView, RedirectView
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect, JsonResponse
from core.forms import RegisterUserFor... | |
"""Utilities for building response surface approximations."""
import numpy as np
import logging
from scipy.optimize import fminbound
from scipy.misc import comb
from misc import process_inputs, process_inputs_outputs
import pdb
class ResponseSurface():
"""
An abstract class for response surfaces.
:cvar in... | |
import os
import csv
import requests
from datetime import datetime
import simplejson as json
import platform
import base64
import ohmysportsfeedspy
from ohmysportsfeedspy.v1_0 import API_v1_0
# API class for dealing with v2.1 of the API
class API_v2_1(API_v1_0):
# Constructor
def __init__(self, verbose, sto... | |
#!/usr/bin/env python
import sys
class DynamicMulticastFullTrialRecord(object):
def __init__(self, packet_loss, avg_num_flows, avg_max_link_mbps, avg_avg_link_mbps, avg_traffic_conc, avg_link_mbps_std_dev, avg_flow_tracker_response_time,
avg_flow_tracker_network_time, avg_flow_tracker_processing_time, ... | |
# 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 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... | |
from abc import ABCMeta, abstractmethod
from HTMLParser import HTMLParser
import re
import urllib2
from RaceResults import RaceInfo, RaceResult, StructuredRaceResults, UnstructuredTextRaceResults
TEXT_RESULT_DIV_CLASS = "racetextresults"
MTEC_BASE_URL = "http://www.mtecresults.com"
MTEC_AJAX_URL = MTEC_BASE_URL + "... | |
#!/usr/bin/env python
#===============================================================================
# Copyright 2017 Geoscience Australia
#
# 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... | |
import collections
import logging
from abc import ABCMeta, abstractmethod
import six as six
from couchdbkit import ResourceNotFound
from dimagi.utils.decorators.memoized import memoized
from couchforms import const
DEFAULT_PARENT_IDENTIFIER = 'parent'
class AbstractXFormInstance(object):
# @property
# de... | |
#
# Widgets.py -- wrapped Qt widgets and convenience functions
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.qtw.QtHelp import QtGui, QtCore, QTextCursor,... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
from ..errors import InvalidVersion
from ..utils import check_resource, minimum_version
from ..utils import version_lt
from .. import utils
class NetworkApiMixin(object):
@minimum_version('1.21')
def networks(self, names=None, ids=None, filters=None):
"""
List networks. Similar to the ``docker... | |
# 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... | |
import numpy as np
def _make_index(prob,size):
"""
Returns a boolean index for given probabilities.
Notes
---------
prob = [.75,.25] means that there is a 75% chance of the first column
being True and a 25% chance of the second column being True. The
columns are mutually exclusive.
"""... | |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | |
# Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import logging
import platform
import subprocess
os.environ["PYTHONUNBUFFERED"] = "y"
PY2 = sys.version_info[0] == 2
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(ZULIP_PATH)
from scripts.lib.... | |
# Copyright (c) 2012 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 code
import cpp_util
from model import Platforms
from schema_util import CapitalizeFirstLetter
from schema_util import JsFunctionNameToClassName
... | |
"""The tests for the Async Media player helper functions."""
import asyncio
import unittest
import homeassistant.components.media_player as mp
from homeassistant.const import (
STATE_IDLE,
STATE_OFF,
STATE_ON,
STATE_PAUSED,
STATE_PLAYING,
)
from tests.common import get_test_home_assistant
class ... | |
__author__ = 'sei'
import socket
import time
import sys
import multiprocessing
class Controller(object):
def __init__(self, ip=None, port=None, coordinate_mapping = None, z_correction_angle = None):
self.is_initialized = False
received = None
self._lock = multiprocessing.Lock()
sel... | |
#!/usr/bin/env python
import os
import re
import sys
import json
import logging
import itertools
from optparse import OptionParser
__doc__ = """
Script to create LCA for contigs from seperate Protein and rRNA (feature) LCAs.
Features mapped to contigs based on ID prefix:
feature ID = PREFIX_start_stop_stand
c... | |
import pygame
import math
import serial
import RPi.GPIO as GPIO
from numpy import matrix, nan_to_num
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
SERIAL_MARKER = 128
VECTOR_MOTORS_IDNT = 0
UP_DOWN_MOTOR_IDNT = 2
LIGHT_TOGGLE_IDNT = 5
CLAW_OPEN_CLOSE_IDNT = 4
CLAW_SPIN_IDNT = 3
CLAW_OPEN_CLOSE_GPIO_P... | |
'''
A suite of common exponential family distributions.
'''
import numpy as np
import scipy.sparse as sps
from scipy.special import psi, polygamma, gammaln, gammasgn
from copy import deepcopy
from utils import pretty_str, safe_exp, safe_sq
import csv
def get_node(name):
if name == 'bernoulli' or name == 'b':
... | |
import warnings
from collections import namedtuple
from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
from django.utils.datastructures import OrderedSet
from django.utils.depreca... | |
import pygame
import time
import pyaudio
import analyse
import numpy
import wave
import sys
from RPi import GPIO
from array import array
from pygame.locals import *
pygame.mixer.pre_init(44100, -16, 1, 1024)
pygame.init()
recorded_note = []
KEY_C = 12
KEY_D = 16
KEY_E = 18
KEY_F = 19
KEY_G = 21
KEY_H = 22
KEY_I = 23... | |
###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## 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
##
## h... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Smoke tests for gclient.py.
Shell out 'gclient' and run basic conformance tests.
This test assumes GClientSmokeBase.URL_BASE i... | |
"""
The code for generating the site.
"""
import os
from random import randrange
from twisted.logger import Logger
from twisted.web import resource, static
from twisted.web.util import redirectTo
from jinja2 import Environment, FileSystemLoader, select_autoescape
from .resources import Assets, render_file
from .sessio... | |
# -*- coding: utf-8 -*-
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
import json
import cgi
from django.contrib.auth.models import User, Group
from django.co... | |
# Backport of selectors.py from Python 3.5+ to support Python < 3.4
# Also has the behavior specified in PEP 475 which is to retry syscalls
# in the case of an EINTR error. This module is required because selectors34
# does not follow this behavior and instead returns that no dile descriptor
# events have occurred rath... | |
from rpy2.robjects.packages import importr
import os
import numpy as np
from scipy.stats import norm as ndist
from selection.covtest import reduced_covtest, covtest
from selection.affine import constraints, gibbs_test
from selection.forward_step import forward_stepwise
n, p, sigma = 50, 80, 1.0
from multi_forward_step... | |
import datetime
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import models
from django.db.models.fields.related import ForeignObject
from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
from django.utils import translation
from .models import (
Arti... | |
###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... | |
# 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... | |
from __future__ import unicode_literals
import re
from django import forms
from django.contrib.auth.forms import (
AuthenticationForm, PasswordChangeForm, PasswordResetForm,
ReadOnlyPasswordHashField, ReadOnlyPasswordHashWidget, SetPasswordForm,
UserChangeForm, UserCreationForm,
)
from django.contrib.auth... | |
from decimal import Decimal as D
import sys
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.importlib import import_module
from django.test.utils import override_settings
from oscar.test.factories import (
create_product, create_voucher, create_offer)
from oscar.tes... | |
# Copyright 2015 Tesora 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 a... | |
#!/usr/bin/env python
import atexit
import contextlib
import errno
import platform
import re
import shutil
import ssl
import subprocess
import sys
import tarfile
import tempfile
import urllib2
import os
import zipfile
from config import is_verbose_mode, PLATFORM
from env_util import get_vs_env
BOTO_DIR = os.path.abs... | |
"""Manages Git."""
from __future__ import unicode_literals
import os
from dvc.utils.compat import str, open
from dvc.utils import fix_env
from dvc.scm.base import (
Base,
SCMError,
FileNotInRepoError,
FileNotInTargetSubdirError,
)
from dvc.scm.git.tree import GitTree
import dvc.logger as logger
cla... | |
'''Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from threading import... | |
# coding=utf-8
from __future__ import unicode_literals
import os
import re
import warnings
from codecs import BOM_UTF8
from warnings import catch_warnings
from tempfile import NamedTemporaryFile
import pytest
import six
import configobj as co
from configobj import ConfigObj, flatten_errors, ReloadError, DuplicateErr... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.