gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
import codecs
from collections import OrderedDict
from decimal import Decimal
import warnings
import agate
from babel.numbers import format_decimal
import six
from csvkit.cli import CSVKitUtility, parse_column_identifiers
NoneType = type(None)
OPERATIONS = OrderedDict([
('type', {
... | |
#! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean ... | |
import numpy
import theano
from theano import tensor
from blocks.bricks import Initializable
from blocks.bricks.recurrent import recurrent, BaseRecurrent
from blocks.bricks.base import lazy, application
from blocks.graph import ComputationGraph
from blocks_contrib.utils import diff_abs, l2_norm_cost
floatX = theano.c... | |
from __future__ import print_function
from collections import namedtuple
import contextlib
import itertools
import math
import sys
from numba.compiler import compile_isolated, Flags
from numba import jit, types
import numba.unittest_support as unittest
from numba import testing
from .support import TestCase, MemoryLe... | |
import logging
import os
import salt.modules.cmdmod as cmdmod
import salt.modules.pkg_resource as pkg_resource
import salt.modules.rpm_lowpkg as rpm
import salt.modules.yumpkg as yumpkg
import salt.utils.platform
from salt.exceptions import CommandExecutionError, SaltInvocationError
from tests.support.mock import Magi... | |
# 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... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | |
"""DHCPv4 options part4"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import misc
@pytest.mark.v4
@pytest.mark.options
@pytest.mark.subnet
def test_v4_options_malformed_values_pool():
misc.test_setup()
srv_control.config_srv_subnet('256.0.2.0/24', '256.0.2.1-256.0.2.10')... | |
# 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
# distribu... | |
from django.conf import settings
from django.core.files.storage import default_storage
from django.core.management.base import CommandError
from django.test.utils import override_settings
import mock
from daguerre.adjustments import Fit
from daguerre.management.commands._daguerre_clean import Command as Clean
from dag... | |
# winservice.py
from os.path import splitext, abspath
from sys import modules
import win32serviceutil
import win32service
import win32event
import win32api
class Service(win32serviceutil.ServiceFramework):
_svc_name_ = '_unNamed'
_svc_display_name_ = '_Service Template'
def __init__(self, *args):
win32serviceu... | |
from __future__ import division, absolute_import, print_function
__all__ = ['ravel_multi_index',
'unravel_index',
'mgrid',
'ogrid',
'r_', 'c_', 's_',
'index_exp', 'ix_',
'ndenumerate', 'ndindex',
'fill_diagonal', 'diag_indices', 'diag_indices... | |
import json
from corehq.apps.hqwebapp.templatetags.hq_shared_tags import toggle_enabled
from django_prbac.exceptions import PermissionDenied
from django_prbac.utils import ensure_request_has_privilege
from corehq import privileges
from corehq.apps.export.exceptions import BadExportConfiguration
from corehq.apps.reports... | |
#!/usr/bin/env python
import sys
#sys.path.insert(0, '/usr/local/lib/python2.7/dist-packages/bintrees')
import CacheStats
from bintrees import AVLTree
CACHE_ATIME = 0
CACHE_SIZE = 1
CACHE_OBJ_ID = 2
CACHE_NEXT_TIME = 3
class BeladyCache():
def __init__(self, cache_size, min_obj_size, max_obj_size):
... | |
import sys
import unittest
from mock import (
patch,
Mock,
)
from bind.zoneparser import ZoneParser
# from bind.zone import Zone
class TestZoneParser(unittest.TestCase):
ez = []
def setUp(self):
with open('contrib/tests/fixtures/db.orangebox.com') as f:
self.ez = f.readlines()
... | |
# 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... | |
"""
Bias Calibration
================
This simple script can be used to study the number of bias frames required to meet the VIS calibration requirements.
The following requirements related to the bias calibration has been taken from GDPRD.
R-GDP-CAL-052:
The contribution of the residuals of VIS bias subtraction to ... | |
# 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 ... | |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import json
import datetime
from jinja2.utils import urlize
from google.appengine.ext import db
from poker.firebase import send_firebase_message
__all__ = [
'Game',
'Participant',
'Story',
'Round',
'Estimate',
]
class Game(db.Model):
DECK_CHOICE... | |
import glob
import logging
import os
import re
import sys
from pprint import pprint, pformat
import uuid
import sloelib
class SloePluginOarstack(sloelib.SloeBasePlugIn):
EVENT_DATA = dict(
mays2011=dict(
year=2011,
capture_device="Canon XF100 camera",
capture_info="72... | |
#!/usr/bin/env python
# coding: utf-8
import datetime
import locale
import os
import sys
import re
import random
import struct
import traceback
import argparse
import subprocess as sp
import unicodedata
from os.path import dirname, join
from doge import wow
ROOT = join(dirname(__file__), 'static')
DEFAULT_DOGE = 'd... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | |
# -*- coding: utf-8 -*-
import feedparser
import tweepy
import time
from datetime import datetime
import random
from threading import Timer
from flask import current_app, flash
from flask.ext.login import current_user
from . import db
from . import infos_tweet
from .models import Feed, Article
# ------------------... | |
#!/usr/bin/env python
import os
import re
import yaml
import threading
import itertools
import sys
import rospy
import rospkg
import roslaunch
from launchtree_config import LaunchtreeConfig, LaunchtreeArg, LaunchtreeRemap, LaunchtreeParam, LaunchtreeRosparam
from launchtree_widget import LaunchtreeEntryItem, Launchtr... | |
# Copyright 2017,2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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-... | |
from typing import Iterable, Union
from abc import abstractmethod, ABCMeta
import re
import collections
class InvalidVersionError(ValueError):
pass
class Comparable(metaclass=ABCMeta):
@classmethod
@abstractmethod
def cmp(cls, v1: 'Comparable', v2: 'Comparable') -> int:
""" Compares two inst... | |
# 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... | |
# notify.py - email notifications for mercurial
#
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''hooks for sending email push notifications
This extension implements hook... | |
import suggestive.widget as widget
import suggestive.mstat as mstat
import suggestive.signals as signals
from suggestive.error import CommandError
from suggestive.mvc.base import View, Model, Controller, TrackModel
from suggestive.buffer import Buffer
from mpd import CommandError as MpdCommandError
from suggestive.acti... | |
"""
sentry.web.helpers
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
from django.conf import settings
from django.core.urlresolvers import reverse, r... | |
"""Implementation of restricted boltzmann machine
You need to be able to deal with different energy functions
This allows you to deal with real valued units.
TODO: monitor overfitting
"""
__author__ = "Mihaela Rosca"
__contact__ = "mihaela.c.rosca@gmail.com"
import numpy as np
from common import *
EXPENSIVE_CHECK... | |
from ..external.qt import (QDialog, QWidget,
QHBoxLayout, QVBoxLayout, QGridLayout,
QGroupBox, QLabel,
QCheckBox, QLineEdit,
QDialogButtonBox,
QIntValidator, QDoubleValidator,
QTimer,
app)
import argparse as ap
import sys
class ArgparseWindow(QDialog):
"""... | |
from basic_game.descriptors import Descriptor
from basic_game.directions import directions
from basic_game.language import list_prefix, normalize_input, get_noun, prepositions
from basic_game.objects import Container
from basic_game.writer import DEBUG, ConsoleWriter
from basic_game.verbs import BaseVerb
class BasicGa... | |
from campaignmanagement_example_helper import *
import json
# Common
def output_bing_ads_webfault_error(error):
if hasattr(error, 'ErrorCode'):
output_status_message("ErrorCode: {0}".format(error.ErrorCode))
if hasattr(error, 'Code'):
output_status_message("Code: {0}".format(error.Code))
i... | |
import logging
import shutil
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed, Http404
fro... | |
import logging
import pathlib
import sys
from typing import Any
from unittest import mock
import pytest
from freezegun import freeze_time
from looker_sdk.sdk.api31.models import DBConnection
from datahub.configuration.common import PipelineExecutionError
from datahub.ingestion.run.pipeline import Pipeline
from tests.... | |
#!/usr/local/bin/python
from sprint import sprint as print
import binascii
import copy
import filecmp
from io import open
import os
import re
import requests
import stat
import basics
import config
import useful
errors = []
# ----------------------------------------------------------------------------
def fix_fi... | |
"""Support for MQTT binary sensors."""
from datetime import timedelta
import functools
import logging
import voluptuous as vol
from homeassistant.components import binary_sensor
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
BinarySensorEntity,
)
from homeassistant.const import (
... | |
import string
# The given permutation tables
first_PCtable_String = "57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4"
second_PCtable_String = "14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,... | |
from typing import Callable, Text, Union, Optional, Dict, Any, List, Tuple
import os
import ujson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from django.shortcuts import redirect, render
from django.conf import settings
from six.moves import map
from zerver.... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# 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
#
# ... | |
"""
A minimal EWMH-aware OO layer over xpyb. This is NOT intended to be
complete - it only implements the subset of functionalty needed by qtile.
"""
from __future__ import print_function, division
import six
from xcffib.xproto import CW, WindowClass, EventMask
from xcffib.xfixes import SelectionEventMask
im... | |
import datetime
from django.test import TestCase
from haystack.indexes import *
from haystack.exceptions import SearchFieldError
from haystack.fields import CharField, FacetField
from haystack.sites import SearchSite, AlreadyRegistered, NotRegistered
from core.models import MockModel, AnotherMockModel
class MockNotAM... | |
# 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... | |
##
#UserInterface
#Description: This class renders the game board through pygame library method calls,
# and handles user input events.
#
##
import pygame, os, sys, time
from pygame.locals import *
from Building import Building
from Ant import UNIT_STATS
from Constants import *
from GameState import addCoords, subtra... | |
""" Defines the Legend, AbstractCompositeIconRenderer, and
CompositeIconRenderer classes.
"""
from __future__ import with_statement
from numpy import array, zeros_like
from enable.api import black_color_trait, white_color_trait
from enable.font_metrics_provider import font_metrics_provider
from kiva.trait_defs.kiva_... | |
import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import textwrap
from setuptools.extern import six
from setuptools.extern.six.moves import builtins, map
import pkg_resources
from distutils.errors import DistutilsError
from pkg_resources i... | |
#!/usr/bin/env python
"""System cron flows tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from future.builtins import range
from grr_response_core import config
from grr_response_core.lib import rdfvalue
from grr_response_c... | |
"""
This is a test/demo of the terrain system.
"""
from panda3d.core import *
loadPrcFile("TerrainConfig.prc")
from direct.showbase.ShowBase import ShowBase
from direct.showbase.DirectObject import DirectObject
import direct.directbase.DirectStart
from direct.filter.CommonFilters import CommonFilters
import math
fr... | |
# Copyright 2015 CloudByte 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 b... | |
from kgb import SpyAgency
from reviewboard.diffviewer.chunk_generator import DiffChunkGenerator
from reviewboard.scmtools.core import PRE_CREATION
from reviewboard.testing import TestCase
class DiffChunkGeneratorTests(SpyAgency, TestCase):
"""Unit tests for DiffChunkGenerator."""
fixtures = ['test_scmtools'... | |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015 BigML
#
# 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 b... | |
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import urlfetch
import re
import logging
import datetime
from google.appengine.api import memcache
from google.appengine.dist import use_library
use_library('django', '1.2')
from django.utils imp... | |
#!/usr/bin/python
# Copyright 2014 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 a... | |
import numpy as np
from scipy.stats import skew, kurtosis, shapiro, pearsonr, ansari, mood, levene, fligner, bartlett, mannwhitneyu
from scipy.spatial.distance import braycurtis, canberra, chebyshev, cityblock, correlation, cosine, euclidean, hamming, jaccard, kulsinski, matching, russellrao, sqeuclidean
from sklearn.p... | |
"""SCons.Job
This module defines the Serial and Parallel classes that execute tasks to
complete a build. The Jobs class provides a higher level interface to start,
stop, and wait on jobs.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted,... | |
from __future__ import unicode_literals
import datetime
import os
import djcelery
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from .utils import * # noqa
djcelery.setup_loader()
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file_... | |
# Copyright 2011 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... | |
from xdict.quote import get_quotes_pairs,get_lrquotes
from xdict.block import get_block_op_pairs
from xdict import escape
from xdict import fsm
import xdict.quote as quote
import xdict.block as block
import re
import efuntool.efuntool as eftl
def get_jdict_token_set(**kwargs):
'''
from xdict.jprint import... | |
#!/opt/conmon-agent/embedded/bin/python
"""
Datadog
www.datadoghq.com
----
Cloud-Scale Monitoring. Monitoring that tracks your dynamic infrastructure.
Licensed under Simplified BSD License (see LICENSE)
(C) Boxed Ice 2010 all rights reserved
(C) Datadog, Inc. 2010-2016 all rights reserved
"... | |
#
# Copyright (C) 2008 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 la... | |
import json
import os
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.shortcuts import render
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from unidecode import unidecode
from wagtail.admin.edit_handlers import FieldP... | |
# encoding: utf-8
# Copyright 2013 maker
# License
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TicketStatus'
db.create_table('service... | |
import unittest, struct
import os
import sys
from test import support
import math
from math import isinf, isnan, copysign, ldexp
import operator
import random, fractions
INF = float("inf")
NAN = float("nan")
have_getformat = hasattr(float, "__getformat__")
requires_getformat = unittest.skipUnless(have_getformat,
... | |
# Copyright 2017 The Oppia 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 ... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Migration(SchemaMigration):
depends_on = (
("containers", "0001_initial"),
)
def forwar... | |
import datetime
import logging
log = logging.getLogger(__name__)
class EventProcessor(object):
def __init__(self, cache):
self.cache = cache
def get_handler(self, event):
if event.domain != 'Shotgun':
log.info('skipping event; not in Shotgun domain')
return
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Edgewall Software
# Copyright (C) 2006-2011, Herbert Valerio Riedel <hvr@gnu.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | |
# Copyright 2020 DeepMind Technologies 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 ag... | |
#
# Copyright (c) 2008-2015 Citrix 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.0
#
# Unless required by applicable l... | |
from common_fixtures import * # NOQA
def test_host_deactivate(super_client, new_context):
host = new_context.host
agent = super_client.reload(host).agent()
assert host.state == 'active'
agent = super_client.wait_success(agent)
assert agent.state == 'active'
host = super_client.wait_success(... | |
import driver
import itertools
import math
import os.path
import json
import time
class Display(object):
def __init__(self, width=112, height=15):
self.width = width
self.height = height
self.buffer = [0] * height
for i in range(height):
self.buffer[i] = [0] * width;
... | |
# 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 ... | |
"""
Encapsulate the methodology to process a segment from the moves-api.
Builds rdf triples based on:
http://motools.sourceforge.net/event/event.html
"""
import logging
from rhobot.components.storage import StoragePayload
from move_bot.components.update_service.interval_handler import IntervalHandler
from move_bot.c... | |
""".. Ignore pydocstyle D400.
==================
Register Processes
==================
"""
import os
import re
import jsonschema
import yaml
from versionfield.utils import convert_version_string_to_int
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import... | |
import sys
import pywintypes
import win32api
import win32con
import win32netcon
import ntsecuritycon
import win32security
import win32net
import ctypes
import enum
import _winreg as winreg
import winsys
from winsys import accounts, registry, security
STUDENTS_GROUP = "OPEStudents"
import gluon.contrib.aes as AES
im... | |
# 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 ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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 = {
'status': ['preview'],
'supp... | |
from django.test import TestCase
from django.db import models
from .models import (Product, WarehouseEntry, ProductCategory, ExtremeWidget,
SaleInvoice, Employee, ProductRating, Property, PropertyOwner)
from .views import (index, rate_product, CategoryCreateView, ProductCreateView,
... | |
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_raises, \
assert_array_almost_equal, assert_
from scipy.signal import firwin, firwin2, kaiserord, freqz, remez
class TestFirwin(TestCase):
def check_response(self, h, expected_response, tol=.05):
N = len(h)
... | |
from ctypes import *
import time
import bacon
from bacon.core import lib
from bacon import native
from bacon import controller
from bacon import keyboard
from bacon import graphics
from bacon import mouse_input
from bacon import shader
from bacon import window
class Game(object):
'''Base class for all Bacon games... | |
"""Test the Google Maps Travel Time config flow."""
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.google_travel_time.const import (
ARRIVAL_TIME,
CONF_ARRIVAL_TIME,
CONF_AVOID,
CONF_DEPARTURE_TIME,
CONF_DESTINATION,
CONF_LANGUAGE,
CONF... | |
from __future__ import annotations
import importlib.util
import itertools
import os
import re
import shutil
from collections import defaultdict
from collections.abc import Iterator
from typing import IO, TYPE_CHECKING
import pytest
import numpy as np
import numpy.typing as npt
from numpy.typing.mypy_plugin import (
... | |
from django.db import models
from djforms.core.models import GENDER_CHOICES
from djforms.core.models import GenericChoice
from djforms.core.models import GenericContact
from djforms.core.models import SEMESTER_CHOICES
from localflavor.us.models import USStateField
from localflavor.us.us_states import STATE_CHOICES
E... | |
#! /usr/bin/env python
"""Contains various functions to perform useful queries of the
``acsql`` database.
The available queries are:
1. ``all_filenames``
2. ``filters_for_rootname(rootname)``
3. ``filter_distribution()``
4. ``rootnames_for_target(targname)``
5. ``filenames_for_calibration(calibra... | |
"""The LBFGS attack
"""
import numpy as np
import tensorflow as tf
from cleverhans.attacks.attack import Attack
from cleverhans.compat import reduce_sum, softmax_cross_entropy_with_logits
from cleverhans.model import CallableModelWrapper, Model, wrapper_warning
from cleverhans import utils
from cleverhans import util... | |
#!/usr/bin/env python
# --------------
# USER INSTRUCTIONS
#
# Now you will put everything together.
#
# First make sure that your sense and move functions
# work as expected for the test cases provided at the
# bottom of the previous two programming assignments.
# Once you are satisfied, copy your sense and move
# de... | |
"""Provide infrastructure to allow exploration of variations within populations.
Uses the gemini framework (https://github.com/arq5x/gemini) to build SQLite
database of variations for query and evaluation.
"""
import collections
import csv
import os
import toolz as tz
from bcbio import install, utils
from bcbio.dist... | |
"""Philips Hue lights platform tests."""
import asyncio
from collections import deque
import logging
from unittest.mock import Mock
import aiohue
from aiohue.lights import Lights
from aiohue.groups import Groups
import pytest
from homeassistant import config_entries
from homeassistant.components import hue
from homea... | |
#
# Proximate - Peer-to-peer social networking
#
# Copyright (c) 2008-2011 Nokia Corporation
#
# All rights reserved.
#
# This software is licensed under The Clear BSD license.
# See the LICENSE file for more details.
#
"""
Main window, root notebook, navigation history
"""
import gtk
import gobject
import pango
from o... | |
"""
A script to set a matrix for the cross version tests for MLflow Models / autologging integrations.
# How to run:
```
# ===== Include all items =====
python dev/set_matrix.py
# ===== Include only `ml-package-versions.yml` updates =====
REF_VERSIONS_YAML="https://raw.githubusercontent.com/mlflow/mlflow/master/ml... | |
from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db.models import F, Q, Avg, Count, Max, StdDev, Sum, Variance
from djan... | |
#!/usr/bin/env python3
# Python library for Adafruit RGB-backlit LCD plate for Raspberry Pi.
# Written by Adafruit Industries. MIT license.
# This is essentially a complete rewrite, but the calling syntax
# and constants are based on code from lrvick and LiquidCrystal.
# lrvic - https://github.com/lrvick/raspi-hd447... | |
#!/usr/bin/env python
#
# Copyright 2017 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 la... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
#!/usr/bin/env python2.6
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"Licens... | |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#
# PluginManager.py -- Simple class to manage plugins.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
import threading
import traceback
from ginga.gw import Widgets
from ginga.misc import Bunch, Callback
from ginga.util.six.moves import filte... | |
"""Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.