gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''PyVows' main entry point. Contains code for command-line I/O,
running tests, and the almighty `if __name__ == '__main__': main()`.
'''
# pyVows testing engine
# https://github.com/heynemann/pyvows
# Licensed under the MIT license:
# http://www.opensource.org/licenses... | |
#===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | |
"""The tests for the manual Alarm Control Panel component."""
from datetime import timedelta
import unittest
from unittest.mock import patch
from homeassistant.setup import setup_component
from homeassistant.const import (
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_... | |
# 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 applica... | |
# Low-color themes should ONLY use the standard foreground and background
# colours listed here:
#
# http://urwid.org/manual/displayattributes.html
#
class Palette:
_fields = [
'background',
'title',
# Status bar & heading
'heading', 'heading_key', 'heading_inactive',
# H... | |
# coding: utf8
# Author: Rodrigo Bistolfi
# Date: 03/2013
""" Test cases for Nikola ReST extensions.
A base class ReSTExtensionTestCase provides the tests basic behaivor.
Subclasses must override the "sample" class attribute with the ReST markup.
The sample will be rendered as HTML using publish_parts() by setUp().
O... | |
# -*- coding: utf-8 -*-
#
# Copyright 2013 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/licenses/LICENS... | |
import base64
import os
import re
import socket
import urllib2
from tempfile import NamedTemporaryFile
from cStringIO import StringIO
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TransactionTestCase
from django.test.client import Client
from django_digest.test i... | |
#!/usr/bin/env python
"""
@package ion.services.mi.test.test_basic
@file ion/services/mi/test/test_basic.py
@author Carlos Rueda
@brief Some unit tests for R2 instrument driver base classes.
This file defines subclasses of core classes mainly to supply required
definitions and then tests functionality in the base clas... | |
from pydel.pydel_exceptions import (AuthenticationError, UnexpectedResponseCodeException, InvalidPostException,
NoPydelInstanceException, UnauthorizedDeletionException, UnauthenticatedException)
from pydel import colors, utils
import requests
import time
DEFAULT_USER_AGENT_STRING = 'Jodel/65000 Dalvik/2.1.0 (... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright 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... | |
"""
By specifying the 'proxy' Meta attribute, model subclasses can specify that
they will take data directly from the table of their base class table rather
than using a new table of their own. This allows them to act as simple proxies,
providing a modified interface to the data from the base class.
"""
from django.db ... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | |
from __future__ import absolute_import
from operator import attrgetter
import sys
import os
import shlex
from six import StringIO
from mock import patch
from .testcases import DockerClientTestCase
from compose.cli.main import TopLevelCommand
from compose.cli.errors import UserError
from compose.project import NoSuchS... | |
""" Bunch is a subclass of dict with attribute-style access.
>>> b = Bunch()
>>> b.hello = 'world'
>>> b.hello
'world'
>>> b['hello'] += "!"
>>> b.hello
'world!'
>>> b.foo = Bunch(lol=True)
>>> b.foo.lol
True
>>> b.foo is b['foo']
True
It is safe to import *... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | |
import inspect
from django.utils.html import strip_tags
from django.utils.encoding import force_unicode
from fields import model_fields
from fields import model_meta_fields
def process_docstring(app, what, name, obj, options, lines):
# This causes import errors if left outside the function
from django.db imp... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
#!/usr/local/bin/python
'''Old, file-based code. My ability to care about this is severely limited.'''
import basics
import bfiles
import config
import useful
modnumlist = []
class SetFile(bfiles.ArgFile):
tablecols = ['prefix', 'cols', 'title', 'digits', 'label', 'style']
notcols = ['fulldesc', 'insetdes... | |
# *****************************************************************************
#
# Copyright (c) 2016, EPAM 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.apac... | |
# Copyright (c) 2014 Cloudbase Solutions SRL
# 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
#
# Unle... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | |
# 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, ... | |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
from weakref import ref
from matplotlib.externals import six
from datetime import datetime
import numpy as np
from numpy.testing.utils import (assert_array_equal, assert_approx_equal,
... | |
#!/usr/bin/env python2
'''
description: Convert directory with downloaded zipped KNMI ascii files to
netCDF format. Station information is obtained from a csv file.
Creation of the csv file and downloading of the KNMI data is
performed in another script (knmi_getdata.py).
aut... | |
#
# 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... | |
import sublime
from os.path import dirname, basename
from .core import packages_with_overrides, log
from .core import PackageListCollectionThread
###---------------------------------------------------------------------------
# When annotation is turned on in the resource browser, this is the annotation
# that is a... | |
from unittest import TestCase
from mock import ANY, Mock, call, mock_open, patch
from ceres import *
def fetch_mock_open_writes(open_mock):
handle = open_mock()
return ''.join([ c[0][0] for c in handle.write.call_args_list])
class ModuleFunctionsTest(TestCase):
@patch('ceres.isdir', new=Mock(return_value=Fals... | |
#!/usr/bin/env python
"""Test basic features of the core web.claims application.
Create Segments. Create Loops with Segments. Create Messages with Loops and
Segments.
"""
from __future__ import print_function
from django.test import TestCase
import os.path
from X12.parse import SegmentToken
from web.claims.models... | |
#!/usr/bin/env python
"""ug2html.py -- Creates HTML version of Robot Framework User Guide
Usage: ug2html.py [ cr(eate) | dist | zip ]
create .. Creates the user guide so that it has relative links to images,
library docs, etc. Mainly used to test how changes look in HTML.
dist .... Creates the user guide... | |
#
# 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... | |
import time
import unittest
import uuid
import datetime
import cassandra
import numpy as np
from hecuba import config
from hecuba.tools import discrete_token_ranges
from hecuba.storageobj import StorageObj
from storage.api import getByID
from hecuba.IStorage import build_remotely
from ..app.words import Words
class... | |
""" Function to convert raw modbus value """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import datetime
import json
from . import time_delta_json
def unit(raw_table, base_index):
""" Direct word value """
raw_value = raw_table[base_index]
... | |
#!/usr/bin/env python
#------------------------------------------------------------------------------
# Copyright 2015 Esri
# 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.apac... | |
import os
from collections import Counter
from contextlib import closing, contextmanager
import six
from exporters.default_retries import retry_long
from exporters.progress_callback import BotoDownloadProgress
from exporters.utils import CHUNK_SIZE, split_file, calculate_multipart_etag, get_bucket_name, \
... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
from django.test import TestCase
from django.test import Client
from django.urls import reverse
# Create your tests here.
class ResponseTestBrowse(TestCase):
def setUp(self):
print("Set uo [ Response Test ] : browse")
self.client = Client()
def test_browse(self):
print("+++++++++++++... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright 2013 Rackspace Hosting
#
# 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 ... | |
#! /usr/bin/env python
"""
A tiny run tracker
"""
from __future__ import print_function, division
from argparse import ArgumentParser
from contextlib import contextmanager
from datetime import datetime, timedelta
import json
import os
import sqlite3
LOCATION = os.path.expanduser('~/.runt')
DATABASE = os.path.join(LO... | |
'''
Created on March 3, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from devices.siren.siren import SirenDevice
# For the LinkHigh siren, send all 3 parameters simultaneously:
# ppc.alarmWarn = sound id ... | |
import bson
from copy_state_db import CopyStateDB
import gevent
from faster_ordered_dict import FasterOrderedDict
from gevent.pool import Pool
import pymongo
from pymongo.errors import DuplicateKeyError
from pymongo.read_preferences import ReadPreference
from pymongo.cursor import CursorType
import time
import utils
fr... | |
#
# Copyright 2016 The BigDL 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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
#
# ... | |
from __future__ import absolute_import
from ..base import BaseObj, FieldMeta
from ...utils import deref
from ...io import SwaggerRequest, SwaggerResponse
from ...primitives import Array
import six
import copy
class BaseObj_v2_0(BaseObj):
__swagger_version__ = '2.0'
class XMLObject(BaseObj_v2_0):
""" XML Obj... | |
'''correlation plots
Author: Josef Perktold
License: BSD-3
example for usage with different options in
statsmodels\sandbox\examples\thirdparty\ex_ratereturn.py
'''
import numpy as np
from . import utils
def plot_corr(dcorr, xnames=None, ynames=None, title=None, normcolor=False,
ax=None, cmap='RdYlBu... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | |
'''Test case for MongoDB database backend
'''
import unittest
from lighty.db import fields, models, backend
backend.manager.connect('default')
class User(models.Model):
name = fields.CharField()
age = fields.IntegerField()
created = fields.DateField(auto_now_add=True)
changed = fields.DateTimeField(... | |
from autobahn.twisted import websocket
import logging
import numpy as np
import threading
import time
from twisted.python import failure
from twisted.internet import defer, endpoints
import twisted.internet.error
from universe import utils
from universe.twisty import reactor
from universe.rewarder import connection_t... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy import units as u
# list of pairs (target unit/physical type, input unit)
x_inputs = [(u.arcsec, u.deg), ('angle', u.deg),
(u.kpc/u.Myr, u.km/u.s), ('speed', u.km/u.s),
([u.arcse... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
import sys
import codecs
from collections import namedtuple
import random
import bisect
from distutils.version import StrictVersion
try:
import ujson as json
except:
import json
from rdbtools.parser import RdbCallback
from rdbtools.encodehelpers import bytes_to_unicode
from heapq import heappush, nlargest, he... | |
# Licensed under a 3-clause BSD style license - see LICENSES
from copy import deepcopy
from os.path import dirname, join
import numpy as np
import pytest
from astropy.table import Table
from numpy.random import RandomState
from numpy.testing import assert_allclose
import sncosmo
try:
import iminuit
HAS_IMI... | |
#!/usr/bin/env python
# Copyright (c) 2015, Robot Control and Pattern Recognition Group,
# Institute of Control and Computation Engineering
# Warsaw University of Technology
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | |
# Imports
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.views import generic
import requests
from rest_framework import viewsets
#import pandas as pd
#import numpy as np
import ma... | |
"""Unit tests for the application"""
import io
import os
import sys
import unittest
import colorful
from prettytable import PrettyTable
from src.dojo import Dojo
from src.helpers import get_residents, remove_person, find_room, find_person
class TestSpaceAllocator(unittest.TestCase):
""" Tests"""
def setUp... | |
from functools import wraps
from flask import \
render_template, redirect, url_for, \
abort, flash, request, current_app, \
make_response
from flask_login import \
login_required, current_user, \
login_user, logout_user
from sqlalchemy.orm import lazyload
from datetime import date, datetime, timed... | |
# byteplay - Python bytecode assembler/disassembler.
# Copyright (C) 2006-2010 Noam Yorav-Raphael
# Homepage: http://code.google.com/p/byteplay
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Found... | |
# 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... | |
"""The ``lxml.isoschematron`` package implements ISO Schematron support on top
of the pure-xslt 'skeleton' implementation.
"""
import sys
import os.path
from lxml import etree as _etree # due to validator __init__ signature
# some compat stuff, borrowed from lxml.html
try:
bytes = __builtins__["bytes"]
except (K... | |
import logging
import sys
from contextlib import contextmanager
from sqlalchemy import MetaData, Table, Column, String, literal_column,\
PrimaryKeyConstraint
from sqlalchemy.engine.strategies import MockEngineStrategy
from sqlalchemy.engine import url as sqla_url
from sqlalchemy.engine import Connection
from ..ut... | |
#!/usr/bin/env python3
"""
enable_mount_voluems - Creator and Configurator of MOUNT volumes
Features:
1. Create GP2 SSD volumes for each private agent
2. Attaches volumes to each private agent
3. Formats volumes and configures fstab entires
4. Configures Mesos Agent and relaunches instances for changes to take effect.... | |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved
# Python
from __future__ import absolute_import
import os
import unittest2 as unittest
# Django
import django
from django.core.urlresolvers import reverse
# AWX
from awx.main.models import * # noqa
from awx.main.tests.job_base import BaseJobTestMixin
import ya... | |
from __future__ import unicode_literals
from datetime import date
from django import forms
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import (
HORIZONTAL, VERTICAL, ModelAdmin, TabularInline,
)
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.widge... | |
# Copyright 2013: Mirantis 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... | |
# Copyright 2020-2021 Efabless 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 agreed ... | |
"""Utilities for managing the fiscal calendar."""
import calendar
import contextlib
import datetime
from typing import Iterator, Optional, Union, cast
__author__ = "Adam J. Stewart"
__version__ = "0.4.0"
# Number of months in each quarter
MONTHS_PER_QUARTER = 12 // 4
MIN_QUARTER = 1
MAX_QUARTER = 4
# These global ... | |
"""
An implementation of the Open Spherical Camera API proposed here:
https://developers.google.com/streetview/open-spherical-camera/reference
There is minimal error checking, and likely a few places where the expected
workflow isn't adhered to but this should get you started if you're using
Python and a camera that s... | |
from __future__ import print_function, division
from functools import wraps
from sympy.core import S, Symbol, sympify, Tuple, Integer, Basic, Expr
from sympy.core.decorators import call_highest_priority
from sympy.core.sympify import SympifyError, sympify
from sympy.functions import conjugate, adjoint
from sympy.matr... | |
"""Test queues inspection SB APIs."""
from __future__ import print_function
import unittest2
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestQueues(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUn... | |
import os
import time
import random
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.operations.vm_... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
"""Support for exposing a templated binary sensor."""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.binary_sensor import (
BinarySensorDevice, ENTITY_ID_FORMAT, PLATFORM_SCHEMA,
DEVICE_CLASSES_SCHEMA)
from homeassistant.const import (
ATTR_FR... | |
#---------------------------------------------------------------------------
# Copyright 2013 The Open Source Electronic Health Record Agent
#
# 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
#
... | |
# 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 applica... | |
"""
This module provides functions to convert
NetworkX graphs to and from other formats.
The preferred way of converting data to a NetworkX graph
is through the graph constuctor. The constructor calls
the to_networkx_graph() function which attempts to guess the
input type and convert it automatically.
Examples
---... | |
#!/usr/bin/env python
# encoding: utf-8
"""Azkaban test module."""
from azkaban import *
from ConfigParser import RawConfigParser
from nose.tools import eq_, ok_, raises, nottest
from nose.plugins.skip import SkipTest
from os.path import relpath, abspath
from time import sleep, time
class TestFlatten(object):
de... | |
# Copyright 2015 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 logging
import re
import time
from pylib import flag_changer
from pylib.base import base_test_result
from pylib.base import test_run
from pylib.const... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
"""
SMILE Encode
"""
import re
import sys
import struct
import decimal
import copy
import logging
import json
import json.encoder
from pysmile.constants import *
from pysmile import util
log = logging.getLogger()
if not log.handlers:
log.addHandler(logging.NullHandler())
__author__ = 'Jonat... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright (c) 2015 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... | |
"""The tests for Nest device triggers."""
from google_nest_sdm.device import Device
from google_nest_sdm.event import EventMessage
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.components.device_auto... | |
# Import dependencies
import os, logging, json, math
from datasource import TrainingInstance as tri
import numpy as np
from utils import feature_extractor as fe
import pickle
import random
def generate_label_sequences(labels, n_instances, l_range=(1, 30),
print_every=100):
'''
Gene... | |
# Author: Jacob Schofield <[email protected]>
# Copyright (c) 2017 HelpSocial, Inc.
# See LICENSE for details
try:
import ujson as json
except ImportError:
import json
from requests import Request, Session
from sseclient import SSEClient
from threading import Thread
from time import sleep, time
from .auth... | |
# Copyright 2015 Daniel Neve
#
# 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, ... | |
"""
Qt techs management dialog
"""
import logging
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QListWidgetItem
from PyQt5.QtGui import QPixmap
from PyQt5.QtGui import QBrush
from PyQt5.QtGui import QColor
from PIL.ImageQt import ImageQt
import qt_techs
import saves
def new_tech_slot(tech_asset):... | |
# 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 -*-
from PyQt4 import QtGui, QtCore
from acq4.analysis.AnalysisModule import AnalysisModule
from collections import OrderedDict
import acq4.pyqtgraph as pg
from acq4.util.metaarray import MetaArray
import numpy as np
class ImageAnalysis(AnalysisModule):
def __init__(self, host):
Analysi... | |
# Zulip's OpenAPI-based API documentation system is documented at
# https://zulip.readthedocs.io/en/latest/documentation/api.html
#
# This file defines the special Markdown extension that is used to
# render the code examples, example responses, etc. that appear in
# Zulip's public API documentation.
import inspect
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com [email protected]
import functools
from pyvows import Vows, expect
from thumbor.filt... | |
import json
import os
import shutil
import boto3
import pandas as pd
import pytest
from featuretools.demo import load_mock_customer
from featuretools.entityset import EntitySet, deserialize, serialize
from featuretools.tests import integration_data
from featuretools.variable_types.variable import (
Categorical,
... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | |
'''
Created on June 28, 2016
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
import utilities
import intelligence.index
import importlib
# This is the maximum number of elements we'll average over for RSSI and LQI... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.