gt
stringclasses
1 value
context
stringlengths
2.49k
119k
"""Support for Yamaha MusicCast Receivers.""" import logging import socket import pymusiccast import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPOR...
# !/usr/bin/env python """ 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"...
#!/usr/bin/python3 import json import re import subprocess from typing import Dict import psycopg2 import requests import libvirt PW_FILE = '/mnt/cephfs/admin/postgresql.pass' def db_conn(dbname): pw = open(PW_FILE).read().strip() return psycopg2.connect(dbname=dbname, user='postgres', host='192.168.46.31'...
#!/usr/bin/env python3 import curses import time import math from collections import namedtuple import shm # TODO: # - efficiency improvements # - make code prettier # - make a better control helm layout, using the fancy new features? class StyledString(str): """ Just like a regular string, but with the...
# 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 # encoding: utf-8 """ api.py Created by Thomas Mangin on 2012-12-30. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ import os import socket import time from exabgp.bgp.message import Message from exabgp.bgp.message import IN class APIOptions (dict): def receive_parsed (self,va...
import logging import string import operator from collections import deque from decimal import Decimal logger = logging.getLogger(__name__) is_digit = lambda ch: ch and ch in string.digits TOKEN_NUM = 0 TOKEN_OP = 1 TOKEN_LPAR = 2 TOKEN_RPAR = 3 TOKEN_IDEN = 4 TOKEN_COMMA = 5 class Node(object): def value(s...
#!/usr/bin/env python2 import sys import os import json import errno import subprocess import yum class yumoter: def __init__(self, configFile, repobasepath): self.urlbasepath = "http://yumoter.gnmedia.net" self.repobasepath = repobasepath self.changedRepos = [] self.reloadConfig(...
# 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/env python3 # Copyright (c) 2020 The Fujicoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Test addr relay """ from test_framework.messages import ( CAddress, NODE_NETWORK, NODE_WITNES...
#!/usr/bin/env python import datetime import os import re from urllib import unquote from django.conf import settings from django.db.models import Count from django.http import HttpResponse from django.shortcuts import render_to_response from django.utils.timezone import now from livesettings import config_value fro...
#!/usr/bin/env python """ptagtool.py - tool to tag images with points""" # File: ptagtool.py # Author: Doron Tal import sys import os from tkinter import Frame, N, S, E, W, Canvas, Scrollbar, Listbox,\ HORIZONTAL, VERTICAL, SINGLE, END, NW, SCROLL, UNITS from tkinter.font import Font from math import sqrt from P...
# Copyright 2014 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...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (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 PyObjCTools.TestSupport import * from Foundation import * try: unicode except NameError: unicode = str class TestNSFileManagerHelper (NSObject): def fileManager_shouldProceedAfterError_(self, a, b): return 1 def fileManager_willProcessPath_(self, a, b): pass def fileManager_shouldCopyItemAtP...
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints Based on Udacity Building a Scalable App complete Solution Code created by wesc on 2014 apr 21 Author: Yongkie Wiyogo date: 2015-10-10 """ from datetime import datetime import endpoints fr...
""" ******************************************************************************** * Name: forms.py * Author: Nathan Swain * Created On: 2014 * Copyright: (c) Brigham Young University 2014 * License: BSD 2-Clause ******************************************************************************** """ from django import f...
# Copyright 2015-present Barefoot 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/LICENSE-2.0 # # Unless required by applicable law or agr...
from collections import namedtuple from shapely.geometry import Point from tilequeue.tile import reproject_lnglat_to_mercator Feature = namedtuple('Feature', 'fid shape properties') # turns a dict mapping keys to values, either of which might be unicode, # into a dict mapping only utf-8 encoded values (if they're s...
import os generator_data_str_format = '{bus}\t{Pg}\t{Qg}\t{Qmax}\t{Qmin}\t{Vg}\t{mBase}\t{status}\t{Pmax}\t{Pmin}\t{Pc1}\t{Pc2}\t{Qc1min}\t{Qc1max}\t{Qc2min}\t{Qc2max}\t{ramp_agc}\t{ramp_10}\t{ramp_30}\t{ramp_q}\t{apf}'.format current_directory = os.path.realpath(os.path.dirname(__file__)) def int_else_float_excep...
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud...
import json from django.contrib.auth.decorators import user_passes_test from django.http import HttpResponse from django.shortcuts import render_to_response from django.template.loader import render_to_string from django.template import RequestContext from crits.core.user_tools import user_can_view_data from crits.re...
""" DB2 database specific implementations of changeset classes. """ import logging from ibm_db_sa import base from sqlalchemy.schema import (AddConstraint, CreateIndex, DropConstraint) from sqlalchemy.schema import (Index, ...
''' reverseadmin ============ Module that makes django admin handle OneToOneFields in a better way. A common use case for one-to-one relationships is to "embed" a model inside another one. For example, a Person may have multiple foreign keys pointing to an Address entity, one home address, one business address and so...
################################################################################ # The Neural Network (NN) based Speech Synthesis System # https://github.com/CSTR-Edinburgh/merlin # # Centre for Speech Technology Research # University of Edinburgh, UK # ...
import os import regex as re import math import inspect import sqlalchemy as sa from ibis.client import Database from ibis.compat import maketrans, functools from ibis.sql.sqlite.compiler import SQLiteDialect import ibis.sql.alchemy as alch import ibis.common as com class SQLiteTable(alch.AlchemyTable): pass ...
# Copyright (c) 2010-2018 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
from __future__ import absolute_import, division, unicode_literals from pip.vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None ...
""" ==================================================================== K-means clustering and vector quantization (:mod:`scipy.cluster.vq`) ==================================================================== Provides routines for k-means clustering, generating code books from k-means models, and quantizing vectors ...
# Copyright 2018, The TensorFlow Federated 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 applicable law o...
# Emitter expects events obeying the following grammar: # stream ::= STREAM-START document* STREAM-END # document ::= DOCUMENT-START node DOCUMENT-END # node ::= SCALAR | sequence | mapping # sequence ::= SEQUENCE-START node* SEQUENCE-END # mapping ::= MAPPING-START (node node)* MAPPING-END __all__ = ['Emitter', 'Emi...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'ParsedQuestion' db.create_table(u'raw_parsedquestion', ( ...
import os import boto.swf import json import importlib import time import arrow import glob import re import requests from collections import namedtuple import activity import boto.s3 from boto.s3.connection import S3Connection import provider.simpleDB as dblib import provider.article as articlelib import provider.s...
#retriever """Retriever script for Breeding Bird Survey 50 stop data """ import os import urllib import zipfile from decimal import Decimal from retriever.lib.templates import Script from retriever.lib.models import Table, Cleanup, no_cleanup, correct_invalid_value VERSION = '0.5' class main(Script): def __ini...
#!/usr/bin/env python # https://code.google.com/p/bones7456/source/browse/trunk/SimpleHTTPServerWithUpload.py # https://github.com/tualatrix/tools/blob/master/SimpleHTTPServerWithUpload.py """Simple HTTP Server With Upload. This module builds on BaseHTTPServer by implementing the standard GET and HEAD requests in a fa...
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file ac...
#!/usr/bin/python2.4 # Copyright 2009 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Command output builder for SCons.""" import os import signal import subprocess import sys import threading import time import ...
# Copyright (c) 2015 Scott Christensen # # This file is part of condorpy # # condorpy is free software: you can redistribute it and/or modify it under # the terms of the BSD 2-Clause License. A copy of the BSD 2-Clause License # should have been distributed with this file. import os import re import uuid import subpro...
#!/usr/bin/env python3 # Copyright 2019 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import asyncio import unittest from unittest.mock import MagicMock from syncer import sync from wdom.document import get_document from wdom.node import DocumentFragment, Text from wdom.web_node import WdomElement from wdom.util import suppress_loggin...
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Daniel Strohmeier <daniel.strohmeier@gmail.com> # # License: Simplified BSD import numpy as np from scipy import linalg, signal from ..source_estimate import (SourceEstimate, VolSourceEstimate, _BaseSourceE...
# -*- coding: utf-8 -*- """ Django settings for silent_mentors project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this:...
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
"""Class to manage the entities for a single platform.""" from __future__ import annotations import asyncio from collections.abc import Callable, Coroutine, Iterable from contextvars import ContextVar from datetime import datetime, timedelta from logging import Logger, getLogger from types import ModuleType from typin...
#!/usr/bin/env python3 # # """@package dg_stability Investigate stability of various DG methods and plot the stability regions. """ __author__ = 'Marc T. Henry de Frahan' __copyright__ = "Copyright (C) 2016, Regents of the University of Michigan" __license__ = "GPL" __email__ = "marchdf@umich.edu" __status__ = "Devel...
import json from django import http from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404, render from django.views.decorators.csrf import csrf_exempt import commonware.log from rest_framework.decorators import (authentication_c...
# -*- coding: utf-8 -*- import datetime from flask import current_app from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileAllowed, FileRequired from flask_security import current_user from wtforms import Form as NoCSRFForm from wtforms.fields import ( TextField, IntegerField, DateField, Tex...
import unittest from datetime import datetime from rx.observable import Observable from rx.testing import TestScheduler, ReactiveTest, is_prime from rx.disposables import SerialDisposable on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest....
#!/usr/bin/env python import os, sys import ctypes import tables import numpy as np import numpy.random as npr libfastann = ctypes.CDLL('libfastann.so') try: libfastcluster = ctypes.CDLL('libfastcluster.so') except OSError, e: libfastcluster = ctypes.CDLL('./libfastcluster.so') def get_suffix(dtype): re...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can b # found in the LICENSE file. """Enumerates the BoringSSL source in src/ and generates two gypi files: boringssl.gypi and boringssl_tests.gypi.""" import os import subprocess import sys...
# Version 0.3.5 # 2005/11/26 # Copyright Michael Foord 2004 & 2005 # cgiutils.py # Functions and constants useful for working with CGIs # http://www.voidspace.org.uk/python/modules.shtml # Released subject to the BSD License # Please see http://www.voidspace.org.uk/python/license.shtml # For information about bugfi...
# -*- coding: utf-8 -*- import subprocess import zipfile import re import os from Tkinter import * import tkFileDialog from PIL import ImageTk, Image run_script_path = "../strato-run-and-compare.sh" save_file = ".FlinkTesterSave" def show_jar_classes(jar_file): """prints out .class files from jar_file""" ...
# Copyright 2017 J. Keaveney # 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, sof...
from __future__ import print_function, division #import matplotlib import logging from sys import stdout # matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt from neuralnilm import (Net, RealApplianceSource) from neuralnilm.source import (standardise, discretize...
import mock from oslo.config import cfg import testtools import webtest from quantum.api import extensions from quantum.api.v2 import attributes from quantum.common import config from quantum.common import exceptions from quantum import context from quantum.db import api as db from quantum import manager from quantum....
#!/usr/bin/env python # # Copyright (c) 2001 Vivake Gupta (v@omniscia.org). All rights reserved. # # 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 2 of the # License, or (at yo...
"""Check that required Docker images are available.""" import re from pipes import quote from ansible.module_utils import six from openshift_checks import OpenShiftCheck from openshift_checks.mixins import DockerHostMixin NODE_IMAGE_SUFFIXES = ["haproxy-router", "docker-registry", "deployer", "pod"] DEPLOYMENT_IMAGE...
# -*- coding: utf-8 -*- import os import re import sys import urllib if sys.version_info[0] >= 3: from urllib.request import urlretrieve, urlopen #from urllib.request import urlopen else: from urllib import urlretrieve, urlopen # third-party modules import imgurpython as imgur # local imports import settin...
# 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...
""" Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (ht...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
# Copyright (c) 2018 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 appli...
import operator, random, six from twisted.trial.unittest import TestCase from axiom.iaxiom import IComparison, IColumn from axiom.store import Store, ItemQuery, MultipleItemQuery from axiom.item import Item, Placeholder from axiom import errors from axiom.attributes import ( reference, text, bytes, integer, AND...
#!/usr/bin/env python import os import struct import sys from fnmatch import fnmatch from optparse import OptionParser _Python_path = sys.executable # this Python binary _Coverage = 'python-coverage' _Src_dir = 'pympler' _Verbose = 1 try: from subprocess import call as _call ##from distutils.spa...
# coding: utf-8 from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.core.urlresolvers import ( NoReverseMatch, Resolver404, get_script_prefix, resolve ) from django.db.models import Manager from django.db.models.query import QuerySet from ...
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Line class which lets you build your Line charts just passing the arguments to the Chart class and calling the proper functions. """ # ----------------------------------------------------------------...
#!/opt/anaconda2/bin/python # -*- coding: utf-8 -*- """ ################################################################################ # # Copyright (c) 2015 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # ####################################################################...
# -*- coding: utf-8 -*- """Pibooth configuration. """ import io import ast import os import os.path as osp import itertools from collections import OrderedDict as odict from pibooth.utils import LOGGER, open_text_editor from pibooth import language try: from configparser import ConfigParser except ImportError: ...
# Copyright 2013 Quanta Research Cambridge, 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 appli...
import asyncio import urllib.parse import xml.dom.minidom from collections.abc import AsyncIterable from tempfile import TemporaryFile from typing import Any import requests from bs4 import BeautifulSoup from booru_toolkit import errors from booru_toolkit.plugin.base import PluginBase, Post, Safety from booru_toolkit...
# coding=utf-8 # # # 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 writi...
#!/usr/bin/env python # # 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 # "...
import urllib import urlparse from django import template from django.conf import settings from django.contrib import comments from django.contrib.comments.models import CommentFlag from django.contrib.comments.templatetags.comments import (BaseCommentNode, CommentFormNode, CommentListNode, RenderCommentFormNode,...
__author__ = 'tonycastronova' import unittest from ODM2PythonAPI.src.api.ODMconnection import dbconnection from ODM2PythonAPI.src.api.ODM2.services.readService import ReadODM2 from ODM2PythonAPI.src.api.ODM2.services.createService import CreateODM2 from ODM2PythonAPI.src.api.ODM2.services.updateService import UpdateO...
from __future__ import unicode_literals from django.contrib.auth.models import Group import json __all__ = ( "Flow" ) """ Workflow.py utilise a .json file per each form flow linked to the app_type category on the application. The json config contains a list of routes (also maybe called steps). All routes st...
from urllib.request import urlopen from html.parser import HTMLParser from urllib import parse import re import os import http import DataBase import string try: from itertools import imap except ImportError: imap=map class Parser(HTMLParser): def __init__(self): HTMLParser.__init__(self) ...
""" Tools related to reading time series data using GDAL / rasterio """ from functools import partial import logging import os import numpy as np import pandas as pd import rasterio import xarray as xr logger = logging.getLogger(__name__) def parse_dataset_file(input_file, date_format, column_dtype=None): """ R...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import csv import yaml import click import logging from multiprocessing import Pool from formencode import validators from datetime import datetime as dt from datetime import timedelta import time from pitchpx.mlbam_util import MlbamUtil, MlbAmExceptio...
from itertools import product import numpy as np import pytest from pandas import DataFrame, Index, MultiIndex, Series, concat, date_range import pandas.core.common as com from pandas.util import testing as tm @pytest.fixture def four_level_index_dataframe(): arr = np.array([[-0.5109, -2.3358, -0.4645, 0.05076,...
# Copyright (c) 2013 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. Author(s): George Paulos This script tests minimum payload base case of the RackHD API 2.0 OS bootstrap workflows using proxy method. This routine runs OS bootstrap jobs simultaneously on multiple nodes. For 11 tests to run, 11 nodes are required ...
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013--, biocore development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------...
from pandac.PandaModules import * from DirectGlobals import * from DirectUtil import * import math class LineNodePath(NodePath): def __init__(self, parent = None, name = None, thickness = 1.0, colorVec = VBase4(1)): # Initialize the superclass NodePath.__init__(self) if ...
import collections from six import string_types import ipywidgets as widgets from traitlets import Unicode, Int, List, observe, HasTraits, Float import gmaps.geotraitlets as geotraitlets import gmaps.bounds as bounds from .maps import DEFAULT_CENTER __all__ = ["Symbol", "Marker", "Markers", "marker_layer", "symbol...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'AhorroPregunta' db.create_table(u'indicador16_ahorropregu...
''' Kivy framework ============== Kivy is an open source library for developing multi-touch applications. It is completely cross-platform (Linux/OSX/Win) and released under the terms of the MIT License. It comes with native support for many multi-touch input devices, a growing library of multi-touch aware widgets and...
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import time import winsound import re from random import randint import visa import pymeasure #keithley beep: #self.write(f'beeper.beep({duration}, {frequency})') #time of full note in ms class Beeper(object): """ Defines a class to provide a convienient way to play notes on a beeperfunction. Beeper get...
""" Data type conversions Copyright (c) 2010-2012 Mika Eloranta See LICENSE for details. """ # TODO: pg_size_pretty() style output formatting, e.g. 1024 -> 1k import os import re import codecs import json import socket import sys import uuid if sys.version_info[0] >= 3: unicode = str # pylint: disable=W0622 ...
# Copyright 2015 Metaswitch Networks # # 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 w...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
# Copyright 2022 The T5X 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 applicable law or agreed to in writ...
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.lines import Line2D import matplotlib.ticker as tck from dic.experiment import Experiment def generate_plots(sigma_g, sigma_t, experiment, polar=False, areaplot=True, SNR=False, report=False, ...
# 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...
"""Support for Amcrest IP cameras.""" from __future__ import annotations import asyncio from collections.abc import Callable from datetime import timedelta from functools import partial import logging from typing import TYPE_CHECKING, Any from aiohttp import web from amcrest import AmcrestError from haffmpeg.camera i...
import os import time import numpy as np import tensorflow as tf from a_nice_mc.utils.bootstrap import Buffer from a_nice_mc.utils.logger import create_logger from a_nice_mc.utils.nice import TrainingOperator, InferenceOperator from a_nice_mc.utils.hmc import HamiltonianMonteCarloSampler as HmcSampler class Trainer(...
import pickle import pytest import sys from collections import defaultdict from unittest.mock import Mock, patch from kombu import Connection, Consumer, Producer, Exchange, Queue from kombu.exceptions import MessageStateError from kombu.utils import json from kombu.utils.functional import ChannelPromise from t.mock...
from __future__ import division from builtins import object import pytest import numpy as np import pickle from sporco.fista import cbpdn import sporco.linalg as sl class TestSet01(object): def setup_method(self, method): np.random.seed(12345) def test_01(self): N = 16 Nd = 5 ...
# # Author: Miroslav Ondra <ondra@faster.cz> # Based on tridonic.py from https://github.com/sde1000/python-dali # Author: Stephen Early # Author-email: steve@assorted.org.uk # License: LGPL3+ # from __future__ import print_function from __future__ import unicode_literals from dali.command import from_frame from dali...