gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import sys
import os
import math
import shutil
resultDir = os.environ.get('RESULTS')
if resultDir == None :
print ("WARNING! $RESULTS not set! Attempt to write results will fail!\n")
# Expecting input botConc, topConc, rateConstFull, sysSize, analInterval, numStepsEquilib, numStepsSnapshot, numStepsAnal, numSteps... | |
# Copyright 2017 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... | |
"""
Driver classes for cisco devices.
- IOS - driver for cisco IOS operating system
"""
import logging
from nocexec.drivers.base import NOCExecDriver
from nocexec.exception import SSHClientError, TelnetClientError, \
NOCExecError, SSHClientExecuteCmdError, TelnetClientExecuteCmdError
LOG = logging.getLogger('... | |
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Tests for merge accounts operation.
"""
__author__ = 'andy@emailscrubbed.com (Andy Kimball)'
import mock
from copy import deepcopy
from viewfinder.backend.base import message, util
from viewfinder.backend.db.activity import Activity
from viewfinder.backend.db... | |
"""
Filename: plot_interhemispheric_heat_difference_timeseries.py
Author: Damien Irving, irving.damien@gmail.com
Description: Plot ensemble interhemispheric difference timeseries
"""
# Import general Python modules
import sys, os, pdb, re
import argparse
import numpy
import iris
from iris.experimental.equ... | |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Ontology Engineering Group
http://www.oeg-upm.net/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Ontology Engineering Group.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | |
## @file
# This file is used to parse and evaluate expression in directive or PCD value.
#
# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this d... | |
# all the imports
from flask import Flask, session, g, redirect, url_for, abort, \
render_template, flash
import os
from flask import jsonify, request
from faker import Factory
from twilio.access_token import AccessToken, IpMessagingGrant
from flask_mail import Message, Mail
from twilio.rest import TwilioRestClien... | |
"""Allow users to set and activate scenes."""
from __future__ import annotations
import logging
from typing import Any, NamedTuple
import voluptuous as vol
from homeassistant import config as conf_util
from homeassistant.components.light import ATTR_TRANSITION
from homeassistant.components.scene import DOMAIN as SCE... | |
import datetime
from flask import (
abort,
Blueprint,
jsonify,
make_response,
redirect,
render_template,
request,
session,
url_for,
)
from pyre_extensions import none_throws
from werkzeug.wrappers import Response
from backend.common.auth import (
create_session_cookie,
curr... | |
import os
import re
import sys
import json
import time
import cutil
import urllib
import logging
import requests
from PIL import Image # pip install pillow
from io import BytesIO
from parsel import Selector
from bs4 import BeautifulSoup
from web_wrapper.selenium_utils import SeleniumHTTPError
logger = logging.getLogg... | |
# Weighted Constraint Satisfaction Problems -- MPE inference on MLNs
#
# (C) 2012 by Daniel Nyga (nyga@cs.tum.edu)
#
# 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, inclu... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... | |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# @author: Li Li (lili@bnl.g... | |
from decimal import Decimal
import pytest
import saleor.payment.gateway as gateway
from saleor.payment import ChargeStatus, TransactionKind
from saleor.payment.interface import GatewayResponse
from saleor.payment.utils import create_payment_information
RAW_RESPONSE = {"test": "abcdefgheijklmn"}
PROCESS_PAYMENT_RESPO... | |
#!/usr/bin/env python3
import ssl
import socket
from time import sleep
MODE_COMMAND = 0
MODE_DATA = 1
DEBUG_HEXDUMP = 0b0001
DEBUG_COMMAND = 0b0010
DEBUG_PROTOCOL = 0b0100
DEBUG_ALL = 0b1111
RECOVER_TIME = 1
_FRAME_COUNT = 15
_HIGHEST_BIT = 0x7F
_FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.' for x i... | |
"""
As we store content databases in separate SQLite files per channel, we need dynamic database connection routing.
This file contains a decorator/context manager, `using_content_database`, that allows a specific content
database to be specified for a block of code, as follows:
with using_content_database("naland... | |
"""The module provides functions to pack and unpack petlib Bn, EcGroup, and EcPt
strucures.
Example:
>>> # Define a custom class, encoder and decoder
>>> class CustomType:
... def __eq__(self, other):
... return isinstance(other, CustomType)
>>>
>>> def enc_custom(obj):
... ... | |
# -*- coding: utf-8 -*-
"""
formlayout
==========
Module creating Qt form dialogs/layouts to edit various type of parameters
formlayout License Agreement (MIT License)
------------------------------------------
Copyright (c) 2009 Pierre Raybaut
Permission is hereby granted, free of charge, to any person
obtaining ... | |
# -*- coding: utf-8 -*-
# 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 agr... | |
from __future__ import division
from builtins import zip
from past.utils import old_div
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MaxNLocator
import threeML.plugins.SpectrumLike
import threeML.plugins.PhotometryLike
from threeML.io.plotting.cmap_cycle import cmap_intervals
from t... | |
"""
@name: Modules/Families/UPB/UPB_Pim.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2011-2020 by D. Brian Kimmel
@license: MIT License
@note: Created on Mar 27, 2011
@summary: This module is for communicating with UPB controllers.
/srv/backup/home/briank/svn/smartho... | |
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
import os
import os.path
import tempfile
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../')
# Import Salt libs
import salt.loader
import salt.config... | |
# Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
r"""
Source: `pytorch imagenet example <https://github.com/pytorch/examples/blob/master/i... | |
import random
from .. import common
from .. import term
VERSION = '0.0.1'
# Constants for the current possession.
HOME = 0
AWAY = 1
# Constants for the possible plays.
PLAY_30 = 1
PLAY_15 = 2
PLAY_LAYUP = 3
PLAY_SET = 4
# Constants for the possible defenses.
DEFENSE_PRESS = 1
DEFENSE_MAN_TO_MAN = 2
DE... | |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | |
# Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# 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, ... | |
import argparse
import unittest
from unittest import mock
from mopidy import commands
class ConfigOverrideTypeTest(unittest.TestCase):
def test_valid_override(self):
expected = ("section", "key", "value")
assert expected == commands.config_override_type("section/key=value")
assert expecte... | |
import logging
import os
import stat
import sys
_logger = logging.getLogger(__name__)
_root = None
_current_folder = None
class _Folder(object):
def __init__(self, folder_id, parent, name):
self.folder_id = folder_id
self.parent = parent
self.name = name
self.sub_folders = []
... | |
def reconstruct_chain(bestfitloc='posteriorpdf.fits', outfile='chain_reconstructed.pkl'):
"""
Reconstruct an unflattened chain from bestfitloc.
If this works, it would be better than saving unflattened chain in an additional pickle file, since this occupies much less space.
From posterior, mus' are a... | |
#!/usr/bin/env python3
# This file contains a command line client that can be used to access the API.
import sys
import os
import json
from optparse import OptionParser
import re
import importlib
sys.path.append(os.path.realpath('modules'))
client_module = importlib.import_module('RestApiClient')
# This is to modif... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# 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... | |
# This module allows you to collect network stats. These values that are collected from
#
# /proc/net/netstat
import sys
import re
import time
import copy
import string
PARAMS = {}
METRICS = {
'time': 0,
'data': {}
}
stats_files = ["/proc/net/netstat", "/proc/net/snmp"]
LAST_METRICS = copy.deepcopy(METRICS... | |
"""
lsh.py
Algorithms based on 'Mining of Massive Datasets'
http://infolab.stanford.edu/~ullman/mmds/ch3.pdf - Section 3.4
"""
from collections import defaultdict
import multiprocessing as mp
import random
import pyhash
import Levenshtein
from jsonleveldb import JsonLevelDB
from .unionfind import UnionFind
class S... | |
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing... | |
"""Support for DoorBird devices."""
import logging
from urllib.error import HTTPError
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
CONF_DEVICES,
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_TOKEN,
CONF_USERNAME,
)
import ho... | |
#!/usr/bin/python
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test the archive_lib module."""
from __future__ import print_function
import logging
import os
import sys
sys.path.insert(0, o... | |
# 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 (t... | |
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.gui.DirectGui import *
from direct.showbase import PythonUtil
from direct.task import Task
from pandac.PandaModules import *
import DisplaySettingsDialog
import ShtikerPage
from otp.speedchat import SCColorScheme
from otp.speedchat import SCSt... | |
import mock
import pytest
from olympia import amo
from olympia.amo.tests import TestCase, req_factory_factory
from olympia.addons.models import Addon, AddonUser
from olympia.users.models import UserProfile
from .acl import (action_allowed, check_addon_ownership, check_ownership,
check_addons_reviewe... | |
"""SmartApp functionality to receive cloud-push notifications."""
import asyncio
import functools
import logging
import secrets
from urllib.parse import urlparse
from uuid import uuid4
from aiohttp import web
from pysmartapp import Dispatcher, SmartAppManager
from pysmartapp.const import SETTINGS_APP_ID
from pysmartth... | |
# Requires python3
import re
import sqlite3
import subprocess
import shutil
import os
import codecs
import datetime
import sys
class TskDbDiff(object):
"""Compares two TSK/Autospy SQLite databases.
Attributes:
gold_artifacts:
autopsy_artifacts:
gold_attributes:
autopsy_attribu... | |
"""The tests for the Cast Media player platform."""
# pylint: disable=protected-access
import json
from typing import Optional
from uuid import UUID
import attr
import pytest
from homeassistant.components import tts
from homeassistant.components.cast import media_player as cast
from homeassistant.components.cast.medi... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
import os.path
import collections
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.abinit.pseudos import *
_test_dir = os.pat... | |
# -*- coding: utf-8 -*-
"""
bofhirdev
FILE: application
Created: 11/5/15 10:50 PM
"""
# from PIL import Image
from braces.views import MessageMixin
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_requ... | |
#!/usr/bin/env python
from __future__ import division
import copy
import imp
import os
import traceback
from optparse import OptionParser
import cv2
import rospy
from cv_bridge import CvBridge
from cv_bridge import CvBridgeError
from sensor_msgs.msg import Image
from multi_tracker.msg import DeltaVid
# for basler ... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Zhijiang Yao, Jie Dong and Dongsheng Cao
# All rights reserved.
# This file is part of the PyBioMed.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the PyBioMed source tree.
"""
#####... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# ---------------------------------------------------------------... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/eoyilmaz/Documents/development/oyProjectManager/oyProjectManager/ui/version_replacer.ui'
#
# Created: Sat Oct 20 20:42:57 2012
# by: pyside-uic 0.2.13 running on PySide 1.1.1
#
# WARNING! All changes made in this file will be lost... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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... | |
import math
import warnings
import numpy as np
import pandas as pd
from .utils import _gca, is_classifier, is_regressor
class ModelXRay(object):
"""This class executes a model over a broad range of modified data points to analyze aspects of its performance.
For each point in the data set, and for every featu... | |
#
# Test script for the curses module
#
# This script doesn't actually display anything very coherent. but it
# does call every method and function.
#
# Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
# getmouse(), ungetmouse(), init_color()
#
import curses, sys, tempfile
# Optionally test cur... | |
"""Makes .caffemodel files readable for sklearn-theano"""
# Authors: Michael Eickenberg
# Kyle Kastner
# Erfan Noury
# Li Yao
# License: BSD 3 Clause
from __future__ import print_function
import os
import numpy as np
from collections import OrderedDict
import theano.tensor as T
from ...datase... | |
# -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
# vim: set shiftwidth=4 softtabstop=4 expandtab:
"""Support for reading meta-data and data NetCDF files, primarily
time-series data.
2014 Copyright University Corporation for Atmospheric Research
This file is part of the "django-ncharts" pa... | |
#!/usr/bin/python
# copyright 2014 Huawei Technologies Co. 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 applic... | |
"""Let's Encrypt CLI."""
# TODO: Sanity check all input. Be sure to avoid shell code etc...
import argparse
import atexit
import functools
import logging
import logging.handlers
import os
import pkg_resources
import sys
import time
import traceback
import configargparse
import configobj
import OpenSSL
import zope.com... | |
#
# CORE
# Copyright (c)2010-2014 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
utility.py: defines miscellaneous utility services.
'''
import os
from core.service import CoreService, addservice
from core.misc.ipaddr import... | |
<<<<<<< HEAD
<<<<<<< HEAD
from ctypes import *
from ctypes.test import need_symbol
import unittest
import sys
class Test(unittest.TestCase):
def test_array2pointer(self):
array = (c_int * 3)(42, 17, 2)
# casting an array to a pointer works.
ptr = cast(array, POINTER(c_int))
self.a... | |
from __future__ import absolute_import
from __future__ import print_function
from contextlib import contextmanager
from typing import (cast, Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping,
Optional, Set, Sized, Tuple, Union, IO, Text)
from django.core import signing
from django.c... | |
from pytest import raises
from graphql_relay.connection.arrayconnection import (
connectionFromArray, cursorForObjectInConnection)
letters = ['A', 'B', 'C', 'D', 'E']
def test_returns_all_elements_without_filters():
c = connectionFromArray(letters, {})
expected = {
'edges': [
{
... | |
import operator
import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
Series,
)
import pandas._testing as tm
from pandas.tests.apply.common import frame_transform_kernels
from pandas.tests.frame.common import zip_frames
def unpack_obj(obj, klass, axis):
"""
Helper to ensur... | |
import numpy as np
import tensorflow as tf
from collections import OrderedDict, defaultdict
from bgan_util import AttributeDict
#### Bayesian DCGAN
from dcgan_ops import *
class BDCGAN(object):
def __init__(self, x_dim, z_dim, dataset_size, batch_size=64, gf_dim=64, df_dim=64,
prior_std=1.0, J... | |
import os
from MuseParse.tests.testUsingXML.xmlSet import xmlSet, parsePiece
from MuseParse.classes.ObjectHierarchy.TreeClasses.PartNode import PartNode
from MuseParse.classes.ObjectHierarchy.TreeClasses.MeasureNode import MeasureNode
from MuseParse.classes.ObjectHierarchy.TreeClasses.NoteNode import NoteNode
from Mus... | |
import codecs
import copy
from decimal import Decimal
from django.apps.registry import Apps
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.utils import six
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_table = "DROP TABLE %(table)s"
sql_create_inline_fk = ... | |
import collections
import itertools
import datetime
from rdflib.namespace import NamespaceManager
from rdflib import Variable, BNode, Graph, ConjunctiveGraph, URIRef, Literal
from rdflib.term import Node
from parserutils import CompValue
import rdflib.plugins.sparql
from rdflib.plugins.sparql.compat import Mapping, ... | |
# 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 ... | |
# -*- test-case-name: twisted.test.test_failure -*-
# See also test suite twisted.test.test_pbfailure
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Asynchronous-friendly error mechanism.
See L{Failure}.
"""
# System Imports
import sys
import linecache
import inspect
import opcode
from... | |
"""
This file is a wrapper around figleaf and will start/stop coverage as
needed. It also includes a method for generating the HTML reports.
"""
import os
import random
import figleaf
import pickle
from glob import glob
from gppylib import gplog
from gppylib.commands.base import Command, LOCAL, REMOTE, ExecutionConte... | |
#!/usr/bin/python
#
# azure_api.py - an Azure plugin for Vcycle
#
# Andrew McNab, University of Manchester.
# Luis Villazon Esteban, CERN.
# Copyright (c) 2013-5. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
#... | |
# 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 ... | |
import errno
import glob
import shutil
import subprocess
import os.path
def join(*paths):
"""Like os.path.join but doesn't treat absolute RHS specially"""
return os.path.normpath("/".join(paths))
def relative(src, dest):
""" Return a relative path from src to dest.
>>> relative("/usr/bin", "/tmp/foo/... | |
""" """
# Standard library modules.
import unittest
import logging
import pickle
# Third party modules.
# Local modules.
from pyhmsa.spec.condition.detector import \
(PulseHeightAnalyser, WindowLayer, Window,
_Detector, DetectorCamera, DetectorSpectrometer,
DetectorSpectrometerCL, DetectorSpectrometerW... | |
# Authors: Chris Holdgraf <choldgraf@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from mne import io, pick_types
from mne.fixes import einsum
from mne.utils import requires_version, requires_sk... | |
from collections import namedtuple
import pytest
from carto.datasets import DatasetManager
from carto.sql import SQLClient, BatchSQLClient, CopySQLClient
from carto.exceptions import CartoRateLimitException
from pandas import DataFrame
from geopandas import GeoDataFrame
from cartoframes.auth import Credentials
from ... | |
"""
Provides functionality to group entities.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import asyncio
import logging
import os
import voluptuous as vol
from homeassistant import config as conf_util, core as ha
from homeassistant.const... | |
"""
.. iterations.py
This module implements a number of :term:`iterator` building blocks,
inspired by Python's built-in module `itertools`_.
.. _itertools: http://docs.python.org/2/library/itertools.html
"""
## Framework
import itertools as it
import operator as op
## Infinity
inf = float('inf')
################... | |
# Copyright 2018 Google. 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 agree... | |
# coding: utf-8
from __future__ import absolute_import
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model
class Occurrence(Model):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit t... | |
import datetime
import logging
from pprint import pprint as pp
import pymongo
import pytest
from scout.constants import VERBS_MAP
logger = logging.getLogger(__name__)
def test_create_event(adapter, institute_obj, case_obj, user_obj):
## GIVEN a database without any events
assert sum(1 for i in adapter.eve... | |
#
#
#
# SDL_Pi_WeatherRack.py - Raspberry Pi Python Library for SwitchDoc Labs WeatherRack.
#
# SparkFun Weather Station Meters
# Argent Data Systems
# Created by SwitchDoc Labs February 13, 2015
# Released into the public domain.
# Version 1.3 - remove 300ms Bounce
# Version 2.0 - Update for WeatherPiArdui... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
"""
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
import datetime
import os
import sys
import time
from decimal import Decimal
# Oracle takes client-side character set encoding from the environment.
os.environ['NLS_LANG'] = '.UTF8'
# This prevents unicode from getting... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | |
from direct.showbase.InputStateGlobal import inputState
from direct.task.Task import Task
from panda3d.core import *
from . import GravityWalker
BattleStrafe = 0
def ToggleStrafe():
global BattleStrafe
BattleStrafe = not BattleStrafe
def SetStrafe(status):
global BattleStrafe
BattleStrafe = status
... | |
from contextlib import contextmanager
import datetime
from functools import partial
import inspect
import re
from nose.tools import ( # noqa
assert_almost_equal,
assert_almost_equals,
assert_dict_contains_subset,
assert_false,
assert_greater,
assert_greater_equal,
assert_in,
assert_is,... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2015, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
... | |
#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | |
from __future__ import division, print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from os import path
from colorsys import hsv_to_rgb, rgb_to_hsv
from collections import OrderedDict
from random import shuffle
import numpy
from pysces.PyscesModelMap import ModelMap
from pys... | |
"""This module contains data related to countries and is used for geo mapping"""
countries = [
{
"name": "Angola",
"area": 1246700,
"cioc": "ANG",
"cca2": "AO",
"capital": "Luanda",
"lat": -12.5,
"lng": 18.5,
"cca3": "AGO"
},
{
"name":... | |
from PyQt5.QtCore import *
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QMessageBox
from Business.ParameterActions import set_parameter, set_parameter_name, delete_parameters
from Data.Parameters import *
from GUI.init import formula_from_locale, formula_to_locale, gui_scale
__author__ = 'mamj'
col_hea... | |
import sys
import re
import textwrap
import pytest
from doctest import OutputChecker, ELLIPSIS
from tests.lib.local_repos import local_checkout, local_repo
distribute_re = re.compile('^distribute==[0-9.]+\n', re.MULTILINE)
def _check_output(result, expected):
checker = OutputChecker()
actual = str(result)
... | |
"""Provide functionality to interact with Cast devices on the network."""
import asyncio
import logging
import threading
from typing import Optional, Tuple
import attr
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_play... | |
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.db import transaction
from django.utils import timezone
from django.conf import settings
import django
import os
import logging
import sys
from datetime import datetime, timedelta
from compat import atom... | |
"""Plotting functions for visualizing distributions."""
from __future__ import division
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
from six import string_types
try:
import statsmodels.nonparametric.api as smnp
_has_st... | |
# Copyright (C) 2007, One Laptop Per Child
#
# 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 Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.