gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'nxtWin7_h900.ui'
#
# Created: Sat Jul 5 16:58:40 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | |
"""Test the Z-Wave JS init module."""
from copy import deepcopy
from unittest.mock import call, patch
import pytest
from zwave_js_server.exceptions import BaseZwaveJSServerError, InvalidServerVersion
from zwave_js_server.model.node import Node
from homeassistant.components.hassio.handler import HassioAPIError
from ho... | |
# urlpath.py
# 0.1.0
# 2005/08/20
# Functions that handle url paths.
# Part of Pythonutils
# http://www.voidspace.org.uk/python/pythonutils.html
# Copyright Michael Foord, 2004 & 2005.
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# For information about bugfixe... | |
"""
******
Layout
******
Node positioning algorithms for graph drawing.
The default scales and centering for these layouts are
typically squares with side [0, 1] or [0, scale].
The two circular layout routines (circular_layout and
shell_layout) have size [-1, 1] or [-scale, scale].
"""
# Authors: Aric Hagberg <aric.h... | |
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}}-{{last_name}}',
'{{last_name}}, {{last_name}} and {{last_name}}',
)
company_suffixes = ('Inc', 'and Sons', 'LLC', 'Group', 'PLC', 'Ltd')
... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
'''
Developer Navdeep Ghai
Email [email protected]
'''
import frappe
from frappe import _, msgprint
from frappe.utils import cint, cstr, flt
from bcommerce.utils.api import get_connection, get_last_sync_id, get_queue_status
from bcommerce.utils i... | |
from typing import Callable, Dict, Type
from contextlib import contextmanager
import os
import logging
import shutil
import tempfile
from filelock import FileLock
import ray
from ray import tune
from ray.tune.resources import Resources
from ray.tune.utils.trainable import TrainableUtil
from ray.tune.result import RE... | |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectUD import DistributedObjectUD
class DistributedToonUD(DistributedObjectUD):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedToonUD")
def setDNAString(self, todo0):
pass
def setGM(self, tod... | |
# 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 agreed to in writing, ... | |
import argparse
import cProfile
import multiprocessing as mp
import os
import pstats
import time
import gym
import IPython
import numpy as np
from keras.layers import Dense
from keras.models import Input, Model, Sequential, clone_model, load_model
from keras.optimizers import Adam
from context import core
from core.st... | |
# Copyright 2012-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
# pyOCD debugger
# Copyright (c) 2019-2020 Arm Limited
# Copyright (c) 2021 Chris Reed
# SPDX-License-Identifier: Apache-2.0
#
# 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... | |
from __future__ import unicode_literals
import mock
import unittest
import pytest
import pytz
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from nose.tools import * # noqa
from addons.osfstorage.models import OsfStorageFile, OsfStorageFileNode, OsfStorageFolder
from osf.exc... | |
from __future__ import absolute_import
import logging
import six
from collections import defaultdict
from datetime import timedelta
from uuid import uuid4
from django.db import IntegrityError, transaction
from django.utils import timezone
from rest_framework import serializers
from rest_framework.exceptions import ... | |
# Copyright 2014 Cisco Systems, 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 requir... | |
#!/usr/bin/env python
#
# Copyright 2010 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... | |
#########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | |
import sys, re, inspect, operator
import logging
from util import emit, name2label, plural, singular, glob_intersection
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import sqlalchemy
from sqlalchemy import MetaData
from sqlalchemy.ext.declarative import declarative_base... | |
#
# 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... | |
import tensorflow as tf
from six.moves import cPickle
# Loading net skeleton with parameters name and shapes.
with open("./util/net_skeleton.ckpt", "rb") as f:
net_skeleton = cPickle.load(f)
# The DeepLab-LargeFOV model can be represented as follows:
## input -> [conv-relu](dilation=1, channels=64) x 2 -> [max_po... | |
"""
@package mi.dataset.driver.PARAD_K.STC_IMODEM.test.test_driver
@file marine-integrations/mi/dataset/driver/PARAD_K/STC_IMODEM/driver.py
@author Mike Nicoletti
@brief Test cases for PARAD_K_STC_IMODEM driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/dsa/test_driver
$ bin/ds... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Must satisfy the signature
# [t,X,D,P] = sim_function(T,X0,D0,P0,I0);
import numpy as np
from scipy.integrate import ode
import matplotlib.pyplot as plt
import utils as U
import copyreg as cr
import types
PLOT = False
def _pickle_method(m):
"""_pickle_method
Req... | |
#------------------------------------------------------------------
#
# ElectroPi EXPLORER
#
# - A way for folks to turn WAV's into control codes.
#
# To use this script, record a ~0.5 second sample of your remote's
# control code at 22050 Hz in your DAW of choice. Then, export the
# recording as a mono, 16-bit WAV fil... | |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Copyright 2016-present Facebook. All Rights Reserved.
#
# revmap: trivial hg hash - linelog rev bidirectional map
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import bisect
import io
im... | |
"""The tests for the Logger component."""
from collections import defaultdict
import logging
from unittest.mock import Mock, patch
import pytest
from homeassistant.components import logger
from homeassistant.components.logger import LOGSEVERITY
from homeassistant.setup import async_setup_component
HASS_NS = "unused.... | |
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import (
callable, unittest2, inPy3k, is_instance, next
)
import copy
import pickle
import sys
import mock
from mock import (
call, DEFAULT, pat... | |
#
# Copyright 2012 Sonya Huang
#
# 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 python3
from __future__ import print_function
from cffi import FFI
import time
ffi = FFI()
ffi.cdef("""
typedef uint64_t counter_t;
typedef struct {
counter_t packets;
counter_t bytes;
} vlib_counter_t;
typedef enum {
STAT_DIR_TYPE_ILLEGAL = 0,
STAT_DIR_TYPE_SCALAR_INDEX,
STAT_DIR_TYPE_COUNT... | |
# Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# 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
#
# THI... | |
from cab.abm.agent import CabAgent
from cab.util.rng import get_RNG
__author__ = 'Michael Wagner'
__version__ = '1.0'
class HiveAgent(CabAgent):
def __init__(self, x, y, gc):
super().__init__(x, y, gc)
self.id = "hive"
self.max_ants = gc.MAX_ANTS
self.food = 0
self.color ... | |
# -*- coding: utf-8 -*-
"""Maraschino auto updater."""
# Original code by Mikie (https://github.com/Mikie-Ghost/)
import maraschino
from maraschino import RUNDIR, logger, DATA_DIR
import urllib2, tarfile, os, shutil, platform, subprocess, re
from flask import json
# define master repo as user and branch in github rep... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Mellanox Technologies, Ltd
#
# 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
#
#... | |
import pyglet
def loadBoat1():
return {
'texture': pyglet.image.load('boat1tex.png').get_texture(),
'vertices': (
(0, -9.3916, 0.726013),
(0, -0.658051, -0.372787),
(2.15999, -5.97165, 0.726013),
(1.5168, -1.10376, -0.164337),
(2.71582, -3.53603, 1.10835),
(2.15999, -5.97165, 0.726013),
(2.1... | |
import asyncio
import json
from collections import namedtuple
from . import hdrs
from .helpers import PY_35, PY_352, Timeout, call_later, create_future
from .http import (WS_CLOSED_MESSAGE, WS_CLOSING_MESSAGE, HttpProcessingError,
WebSocketError, WebSocketReader,
WSMessage, WSMsgT... | |
import datetime
import json
import unittest
from enum import Enum
from rdr_service.model.bq_base import BQField, BQFieldModeEnum, BQFieldTypeEnum, BQRecord, BQRecordField, BQSchema, \
BQTable
from rdr_service.model.bq_questionnaires import BQPDRTheBasicsSchema
from tests.test_data import data_path
from tests.helpe... | |
import sys
import re
from datetime import datetime
from functools import wraps
from django.conf import settings
from django.db import models
from django.db.models.sql import aggregates as sqlaggregates
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql import aggregates as sqlaggregates
f... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | |
import sys
import unittest
import numpy
import pytest
import cupy
from cupy import testing
from cupy._core import _accelerator
# Note that numpy.bincount does not support uint64 on 64-bit environment
# as it casts an input array to intp.
# And it does not support uint32, int64 and uint64 on 32-bit environment.
_all... | |
from django import template
from django.conf import settings
from django.core import urlresolvers
from django.utils.safestring import mark_safe
from l10n.l10n_settings import get_l10n_setting
from product.models import Category
from satchmo_utils.numbers import trunc_decimal
from satchmo_utils.json import json_encode
f... | |
# -*- coding: utf-8 -*-
from six import text_type
from zerver.lib.test_classes import WebhookTestCase
class TaigaHookTests(WebhookTestCase):
STREAM_NAME = 'taiga'
TOPIC = "subject"
URL_TEMPLATE = u"/api/v1/external/taiga?stream={stream}&api_key={api_key}&topic={topic}"
FIXTURE_DIR_NAME = 'taiga'
d... | |
import os
import shutil
import hashlib
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.conf import settings
from tagging.utils import edit_string_for_tags
from djangopeople.djangopeople.models import Dj... | |
"""
flickr.py
Copyright 2004-2006 James Clarke <[email protected]>
Portions Copyright 2007-2008 Joshua Henderson <[email protected]>
Portions Copyright 2015 Jeroen Arnoldus <[email protected]>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED I... | |
# tictactoevariation.py
# author: Vivi Huang
from random import randrange
import math
# global constants
num_square=16
O="O"
X="X"
EMPTY=" "
TIE="TIE"
callnum=18
lastcall=""
def ask_yes_no(question):
"""Ask a yes or no question."""
response = None
while response not in ("y", "n"):
response = inpu... | |
# Copyright (c) 2019 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 app... | |
"""
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
import json
import warnings
from contextlib import suppress
from typing import Generator, Tuple
from urllib.parse impo... | |
""" Basic functions for manipulating 2d arrays
"""
from __future__ import division, absolute_import, print_function
from numpy.core.numeric import (
asanyarray, arange, zeros, greater_equal, multiply, ones, asarray,
where, int8, int16, int32, int64, empty, promote_types, diagonal,
)
from numpy.core import... | |
import queue
grids = []
################################################################################
grids.append('''\
OOOOOOOOOOOO
OOO O
OO O
OO X O
O # # O
O O
O O
O # # O
OO X OO
OOX OO
OO X OOO
OOOOOOOOOOOO''')
grids.append('''\
OOOOOOOOOOOO
OO... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
import pytest
from snowflake.sqlalchemy import (
AWSBucket,
AzureContainer,
CopyFormatter,
CopyIntoStorage,
CSVFormatter,
ExternalStage,
JSONFormatter,
PARQUETFormatte... | |
# 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... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | |
# -*- coding:utf-8 -*-
"""
pygcm.request
~~~~~~~~~~~~~
Request related modules.
"""
import json
from collections import Iterable
from pygcm.exceptions import GCMException
from pygcm.compat import urllib2, urlencode, basestring
from pygcm.base_config import SENDER_URL, DEFAULT_ENCODING
# HTTP request c... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
author_match_filter.py -- find the authors in VIVO, and match them to authors
in the source. This is used to match the pubs to an author.
There are two inputs:
- authors in VIVO keyed by name parts.
- authors in the source keyed by name parts.
There are ... | |
from pyscriptic import settings, submit
class ContainerType(object):
"""
Lists information about a particular container type, such as a 96-well
plate.
Attributes
----------
title : str
wells : int
Number of wells in the container. Wells can be referenced using either
a 1-... | |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <[email protected]>
# License: http://pyasn1.sf.net/license.html
#
import sys
from pyasn1.type import tag, tagmap
from pyasn1 import error
__all__ = ['NamedType', 'OptionalNamedType', 'DefaultedNamedType', 'NamedTypes']
class NamedTy... | |
#
# Copyright 2017 Ipsen Pharma. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2011 Daniel Bates ([email protected]). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... | |
import pytest
import os
import ipaddress
from scapy.all import rdpcap, IP, IPv6, TCP, UDP
from .test_utils import ExampleTest
class TestPcapSplitter(ExampleTest):
pytestmark = [pytest.mark.pcapsplitter, pytest.mark.no_network]
def test_split_by_file_size(self, tmpdir):
args = {
"-f": os.... | |
# 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 under t... | |
from rest_framework import status
from rest_framework.reverse import reverse
from .base import BaseTest
class PaymentMethodsViewTest(BaseTest):
maxDiff = None
def test_introspection_authenticated(self):
self.login(is_staff=True)
url = reverse("api-checkout-payment-methods")
resp = sel... | |
# Copyright 2010 Google Inc.
#
# 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, publish, dis-
# trib... | |
import itertools
import os
import textwrap
import pytest
from tests.lib import pyversion # noqa: F401
from tests.lib import PipTestEnvironment, ResolverVariant, TestData, assert_all_changes
from tests.lib.local_repos import local_checkout
from tests.lib.path import Path
from tests.lib.wheel import make_wheel
@pyte... | |
#! /usr/bin/env python2
# Copyright (c) 2011 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementati... | |
"""Test environment for client library tests.
This module has functions for creating keyspaces, tablets for the client
library test.
"""
#!/usr/bin/env python
# coding: utf-8
import hashlib
import random
import struct
import threading
import time
import traceback
import unittest
import environment
import tablet
impo... | |
# 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 ... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
from __future__ import division
import math, fractions, itertools, functools
from conformal_blocks.lie import SimpleLieAlgebra, TypeALieAlgebra, TypeBLieAlgebra, TypeCLieAlgebra, _Root
try:
import sage.all as sage
def Fraction(x,y):
try:
return sage.Rational((x, y))
except TypeError:... | |
# -*- coding: utf-8 -*-
import httplib as http
import unittest
from django.utils import timezone
from github3.repos.branch import Branch
from nose.tools import * # flake8: noqa
from json import dumps
import mock
import pytest
from framework.auth import Auth
from framework.exceptions import HTTPError
from addons.base... | |
from __future__ import absolute_import, division, print_function
import pytest
pymysql = pytest.importorskip('pymysql')
from datashape import var, DataShape, Record
import itertools
from odo.backends.csv import CSV
from odo import resource, odo
import sqlalchemy
import sqlalchemy as sa
import os
import sys
import cs... | |
"""
This pipeline is used to report the results for the ALL modality.
"""
import os
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
#sns.set(style='ticks', palette='Set2')
current_palette = sns.color_palette()
from scipy import interp
from sklearn.ext... | |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from textwrap import dedent
import pytest
from pants.backend.codegen.protobuf.python import additional_fields
from pants.backend.codegen.protobuf.pyth... | |
"""The tests for the MQTT JSON light platform.
Configuration with RGB, brightness, color temp, effect, white value and XY:
light:
platform: mqtt_json
name: mqtt_json_light_1
state_topic: "home/rgb1"
command_topic: "home/rgb1/set"
brightness: true
color_temp: true
effect: true
rgb: true
white_value: ... | |
import os
import re
import sys
import time
import logging
import telegram
import yaml
import threading
from urllib.error import URLError
from lytebot import config, config_dir
from lytebot.errors import CommandError
class LyteBot:
paths = {
'ignored': os.path.join(config_dir, 'ignored.yml'),
'disa... | |
from dateutil import parser
from django.test import TransactionTestCase
from django.contrib.auth.models import Group
from django.core.files.uploadedfile import UploadedFile
from django.core.exceptions import ValidationError
from django.http import HttpRequest
from hs_core.hydroshare import resource
from hs_core impor... | |
import asyncio
from importlib import import_module
from unittest.mock import patch
import pytest
from asgiref.sync import sync_to_async
from channels.testing import WebsocketCommunicator
from django.conf import settings
from django.contrib.auth import BACKEND_SESSION_KEY, HASH_SESSION_KEY, SESSION_KEY
from openslides... | |
# Copyright 2013 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... | |
# -*- coding: utf-8 -*-
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
import bleach
from flask import current_app, request, url_for
from flask_lo... | |
# 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
#
# ... | |
# Copyright 2012-2015 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" fil... | |
# Copyright 2011 James McCauley
# Copyright 2008 (C) Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
"""The tests for the MQTT binary sensor platform."""
from datetime import datetime, timedelta
import json
from unittest.mock import ANY, patch
from homeassistant.components import binary_sensor, mqtt
from homeassistant.components.mqtt.discovery import async_start
from homeassistant.const import (
EVENT_STATE_CHAN... | |
"""Model module."""
from __future__ import unicode_literals
from .utils import tostr
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.db.models import F
from django.dispatch import receiver
from django.db.models.signals ... | |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <[email protected]>
#
# 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
... | |
"""An object-local variable management scheme."""
# 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/l... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Piston Cloud Computing, 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://ww... | |
"""Utility functions for copying files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
__all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2",
"copytree","move","rmtree","... | |
#!/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... | |
"""
:codeauthor: Gareth J. Greenaway ([email protected])
"""
import logging
import os
import pytest
import salt.defaults.exitcodes
from saltfactories.exceptions import FactoryNotStarted
from saltfactories.utils import random_string
from tests.support.helpers import PRE_PYTEST_SKIP_REASON
log = logging.getLogger(... | |
# -*- 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... | |
"""
homeassistant.components.media_player.chromecast
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to interact with Cast devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cast/
"""
import loggin... | |
# Copyright 2008-2010 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Multiple sequence alignment input/output as alignment objects.
The Bio.AlignIO interface... | |
# Copyright 2015, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | |
# coding: utf-8
"""
MasterMind Service Manager
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint... | |
from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet, inlineformset_factory, modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from django.test import TestCase
from .models imp... | |
import os
import os.path as op
import re
import warnings
import numpy as np
import pytest
from mne import read_evokeds, Epochs, create_info
from mne.io import read_raw_fif, RawArray
from mne.utils import (warn, set_log_level, set_log_file, filter_out_warnings,
verbose, _get_call_line, use_log_l... | |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# 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 numpy as np
import argparse
import re
import collections
readid_re = re.compile('seq.(\d+)([ab]?)')
class ChromosomeAlnCounter:
"""Accumulates counts of aligments by chromosome."""
def __init__(self):
"""Create a new ChromosomeAlnCounter, with no arguments."""
self.mapping = {}
... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.logging_v2.proto import (
logging_config_pb2 as google_dot_cloud_dot_logging__v2_dot_proto_dot_logging__config__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class ConfigServic... | |
import os
import weakref
from ufoLib import UFOReader, UFOLibError
from defcon.objects.base import BaseObject
pngSignature = "\x89PNG\r\n\x1a\n"
class DataSet(BaseObject):
"""
This object manages all contents of the data directory in the font.
**This object posts the following notifications:**
===... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.