gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import json
import unittest
import mock
from custom_resource import BaseHandler, Defer, Failed, Responder, Success
class TestCase(unittest.TestCase):
def setUp(self):
self.upload_response_data_mock = mock.patch.object(Responder, "_upload_response_data")
self.upload_response_data_mock.start()
... | |
""" Contains functions used to write specific server packets to byte streams """
import packetHelper
import dataTypes
import userHelper
import glob
import userRanks
import packetIDs
import slotStatuses
import matchModModes
import random
""" Login errors packets
(userID packets derivates) """
def loginFailed():
return... | |
from __future__ import print_function
import argparse
import codecs
import json
import shutil
import time
from os import listdir
from os import makedirs
from os.path import isfile, join
from entity2vec.node2vec import Node2Vec
from entity2vec.sparql import Sparql
####################################################... | |
# Copyright (c) 2014 OpenStack Foundation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
from distutils.command.config import config
from scipy import ndimage
from collections import Counter
from showattendtell.core.vggnet import Vgg19
from showattendtell.core.utils import *
from showattendtell.core import utils
import tensorflow as tf
import numpy as np
import pandas as pd
import hickle
import os
import ... | |
"""The tests for the automation component."""
import unittest
from blumate.bootstrap import _setup_component
import blumate.components.automation as automation
from blumate.const import ATTR_ENTITY_ID
from tests.common import get_test_home_assistant
class TestAutomation(unittest.TestCase):
"""Test the event aut... | |
# 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 agreed to in... | |
# -*- test-case-name: twisted.test.test_compat -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Compatibility module to provide backwards compatibility for useful Python
features.
This is mainly for use of internal Twisted code. We encourage you to use
the latest version of Python di... | |
#!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | |
# -*- coding: utf-8 -*-
# Copyright 2006 - 2012 Philipp Wollermann
#
# 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... | |
# Copyright (c) 2014 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/LICENSE-2.0
#
# Unless re... | |
from __future__ import unicode_literals
import datetime
from django.apps import apps
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, management
from django.core.urlresolvers import rever... | |
#!/usr/bin/env python
# Copyright 2016 DIANA-HEP
#
# 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... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import mock
from typing import Any, Union, Mapping, Callable
from zerver.lib.actions import (
do_create_user,
get_service_bot_events,
)
from zerver.lib.test_classes import ZulipTestCase
from zerver.models impo... | |
################################################################################
# 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... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Cisco Systems, Inc.
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use... | |
#!/usr/bin/env python
#
# Electrum - lightweight Fujicoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 with... | |
from datetime import (
datetime,
timedelta,
)
from io import StringIO
import warnings
import numpy as np
import pytest
from pandas import (
Categorical,
DataFrame,
MultiIndex,
NaT,
PeriodIndex,
Series,
Timestamp,
date_range,
option_context,
period_range,
)
import pandas... | |
# Built-in modules #
import sqlite3
from itertools import islice
# Internal modules #
from color import Color
from autopaths import FilePath
from cache import property_cached
################################################################################
def convert_to_sql(source, dest, keys, values, sql_field_types... | |
#!/usr/bin/python
# ck_setup.py - checks the veyepar setup - reports what features are ready.
from process import process
from main.models import Show, Location, Client
from django.conf import settings
from django.template.defaultfilters import slugify
import pw
import rax_uploader
import archive_uploader
import... | |
from __future__ import with_statement
import random
from collections import deque
import pytest
from whoosh import fields, query
from whoosh.compat import u, izip, xrange, permutations
from whoosh.util.numeric import length_to_byte, byte_to_length
from whoosh.util.testing import TempIndex
def check_multi():
try... | |
"""
MRS.analysis
------------
Analysis functions for analysis of MRS data. These include a variety of
functions that can be called independently, or through the interface provided
in :mod:`MRS.api`.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import nitime as nt
i... | |
# Copyright 2016 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... | |
from __future__ import absolute_import, division, print_function
import csv
import itertools as it
import os
import datashape
from dynd import nd
from .. import py2help
from .data_descriptor import DDesc, Capabilities
from .dynd_data_descriptor import DyND_DDesc
def open_file(path, mode, has_header):
"""Return... | |
# Copyright 2018 Mycroft AI 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 writin... | |
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
import json
import logging
from tabpy.tabpy_server.management.util import write_state_config
from threading import Lock
from time import time
logger = logging.getLogger(__name__)
# State File Config Section N... | |
from __future__ import unicode_literals
import ctypes
import json
import random
import threading
from binascii import a2b_hex, b2a_hex
from io import BytesIO
from unittest import skipUnless
from django.contrib.gis import gdal
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import (
HAS_G... | |
from django.db import models
# Create your models here.
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import RichTextField, StreamField
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel, StreamFieldPanel, FieldRowPanel
from wagtail.wagtailimages.edit_... | |
# Copyright 2013 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 json
import unittest
from telemetry.core.timeline import trace_event_importer
import telemetry.core.timeline.counter as tracing_counter
import teleme... | |
# 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... | |
from datetime import datetime
from flask import current_app
from flask.ext.login import login_user, current_user, logout_user
from flaskbb.forum.models import Category, Forum, Topic, Post, ForumsRead, \
TopicsRead, Report
from flaskbb.user.models import User
from flaskbb.utils.settings import flaskbb_config
def... | |
# Copyright 2020 The Cirq Developers
#
# 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 ... | |
# Copyright 2009 Shikhar Bhushan
#
# 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 writin... | |
from __future__ import print_function
import functools
import json
import logging
import os
import sys
import runpy
from insights.client import InsightsClient
from insights.client.config import InsightsConfig
from insights.client.constants import InsightsConstants as constants
from insights.client.support import Insig... | |
import json
from django.test import TestCase, RequestFactory
from django.contrib.auth.models import Group
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.exceptions import PermissionDenied
from hs_core import hydroshare
from hs_core.views import unshare_resource_wit... | |
from datetime import datetime
import warnings
import numpy as np
import pytest
from pandas.core.dtypes.generic import ABCDateOffset
import pandas as pd
from pandas import (
DatetimeIndex, Index, PeriodIndex, Series, Timestamp, bdate_range,
date_range)
from pandas.tests.test_base import Ops
import pandas.util... | |
import asyncio
import json
import os
import re
import time
import traceback
import concurrent.futures
from urllib.parse import urlparse
import feedparser
from aiohttp import web
import ssl
import bcrypt
import uuid
from jinja2 import Environment, FileSystemLoader, select_autoescape
import appdaemon.dashboard as addash... | |
# provides wrapper objects for specific device types
import logging
import urllib2
import time
import arp
import clients
import iplug
# TODO set setErrorStateOnServer(msg) appropriately
################################################################################
# wrapper base class for device types
class Devic... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
# Copyright (c) 2013 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 ... | |
# Copyright 2020 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... | |
#!/usr/bin/env python
# Copyright 2016, Google 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 copyright
# notice, this list o... | |
from asyncio import Future, CancelledError, TimeoutError, sleep, gather
from .consts import MAX_ASYNC_WHILE
from .access import (
get_event_loop, LOGGER, ensure_future, create_future
)
def return_false():
return False
def chain_future(future, callback=None, errback=None, next=None):
'''Chain a :class:`... | |
# 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... | |
#
# Copyright (c) 2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 mu... | |
#!flask/bin/python
import json
import os
import sys
import requests
from hashlib import md5
from logbook import Logger
from catalyst.utils.remote_utils import BACKTEST_PATH, STATUS_PATH, POST, \
GET, EXCEPTION_LOG, convert_date, prepare_args, handle_status, \
is_valid_uuid
from catalyst.exchange.utils.exchang... | |
#!/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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | |
"""
Test refinement of beam, detector and crystal orientation parameters using
generated reflection positions from ideal geometry, repeating tests with both a
single panel detector, and a geometrically identical 3x3 panel detector,
ensuring the results are the same.
"""
from __future__ import annotations
from collec... | |
# 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... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module contains classes and functions to standardize access to
configuration files for Astropy and affiliated packages.
.. note::
The configuration system makes use of the 'configobj' package, which stores
configuration in a text format li... | |
# Dataviews.py
#
# Copyright 2019 OSIsoft, 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... | |
# Copyright 2013 Donald Stufft and individual contributors
#
# 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 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
from __future__ import unicode_literals
import errno
import os
import socket
import time
from .common import FileDownloader
from ..compat import (
compat_urllib_request,
compat_urllib_error,
)
from ..utils import (
ContentTooShortError,
encodeFilename,
sanitize_open,
)
class HttpFD(FileDownloade... | |
# 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 or agreed to in writing, soft... | |
import copy
from datetime import datetime, timedelta
from django.db import connection
from collections import OrderedDict
import json
import re
from django.conf import settings as settings
from django.db.models import Q
from django.db.models.sql import Query
from django.db import DEFAULT_DB_ALIAS
from website.models im... | |
# 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... | |
import logging
from django.core.exceptions import ValidationError
from django.db import models
try:
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
except ImportError:
from django.db.models.fields.related import (
ReverseSingleRelatedObjectDescriptor as ForwardManyTo... | |
from pandac.PandaModules import Point3
from direct.distributed.ClockDelta import globalClockDelta
from direct.fsm import ClassicFSM, State
from direct.task import Task
from toontown.minigame import DistributedMinigameAI
from toontown.minigame import MinigameGlobals
from toontown.minigame import IceGameGlobals
from toon... | |
from freezegun import freeze_time
import pytest
from McAfee_ESM_v2 import *
from McAfee_ESM_v2 import McAfeeESMClient
list_test_filtering_incidents = [
{'id': 3},
{'id': 1},
{'id': 5},
{'id': 4},
{'id': 0},
{'id': 2}
]
data_test_filtering_incidents = [
(
(
0, 0
)... | |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.unitary_equipment import AirLoopHvacUnitarySystem
log = logging.getLogger(__name__)
class TestAirLoopHvacUnitarySystem(unittest.TestCase):
def setUp(self):
self.fd,... | |
# -*- coding: utf-8 -*-
'''
Salt interface to ZFS commands
:codeauthor: Nitin Madhok <[email protected]>
'''
from __future__ import absolute_import
# Import Python libs
import logging
# Import Salt libs
import salt.utils
import salt.modules.cmdmod
import salt.utils.decorators as decorators
from salt.utils.odict i... | |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
# Copyright 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... | |
"""
MODULE : basic_blocks
Purpose : * Class used to represent a basic block. Will be an array of instructions.
* All required algorithms such as register allocation etc. will be a part of this
class
Import Acronym : BB
"""
# List of Imports Begin
import debug as DEBUG
import instr3ac as INS... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
# Copyright 2020 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.
import collections
import logging
import os
import select
import threading
"""Zmake multiprocessing utility module.
This module is used to aid in zmake's... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
"""Utilities for collecting objects based on "is" comparison."""
# 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://w... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Country'
db.create_table('location_country', (
('id', self.gf('django.db.models.... | |
import calendar
import datetime
import logging
import os
import environ
import pytest
from aiohttp import web
from rororo.logger import default_logging_dict
from rororo.settings import (
BaseSettings,
from_env,
immutable_settings,
inject_settings,
is_setting_key,
setup_locale,
setup_loggin... | |
import logging
import numpy as np
from typing import List, Type
import ray
from ray.rllib.agents import with_common_config
from ray.rllib.agents.mbmpo.mbmpo_torch_policy import MBMPOTorchPolicy
from ray.rllib.agents.mbmpo.model_ensemble import DynamicsEnsembleCustomModel
from ray.rllib.agents.mbmpo.utils import calcul... | |
""" Test functions for fftpack.basic module
"""
from __future__ import division, absolute_import, print_function
from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble
from numpy.random import rand
import numpy as np
from concurrent import futures
import os
import scipy.fftpack
import numpy.fft
try:
... | |
"""Resource pools."""
__all__ = [
'ProcessActorPool',
'TimeoutPool',
]
import array
import collections
import contextlib
import dataclasses
import functools
import heapq
import inspect
import itertools
import logging
import multiprocessing
import multiprocessing.connection
import multiprocessing.reduction
imp... | |
# Copyright 2018 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 -*-
"""
Created on Mon Mar 02 18:20:40 2015
@author: Konstantin
"""
from scipy import optimize
import numpy as np
import configparser, os, csv
from fabric.api import env, execute, task, get
import cuisine
import vm_control
import pandas
import operator
import pickle
import scipy.stats as stats
... | |
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest # noqa
from six import b as b_
from webtest import TestApp
from pecan import expose, make_app
from pecan.secure import secure, unlocked, SecureController
from pecan.tests import PecanTestCase
try:
set()
except:
... | |
"""
LogParser class
"""
import re
from datetime import datetime
class LogParser(object):
""" Handles parsing of all logs from the Mobile API.
Attributes:
parser_info: info required by the parser that is specific to each OS
"""
parser_info = {
'Android': {
'logLineRegex':... | |
# MIT License
# Copyright (c) 2016 Stefan Zapf, Christopher Kraushaar
# 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, ... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import pandas.compat as compat
import pandas.core.common as com
import pandas.util.testing as tm
from pandas import (Series, Index, DatetimeIndex, Timedel... | |
import Queue
import time
import os.path
from cStringIO import StringIO
import email.utils
import mock
import netlib.utils
from netlib import odict
from netlib.http.semantics import CONTENT_MISSING, HDR_FORM_URLENCODED, HDR_FORM_MULTIPART
from libmproxy import filt, protocol, controller, utils, tnetstring, flow
from l... | |
## @file
# This file is used to define common string related functions used in parsing process
#
# Copyright (c) 2007 - 2008, 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 ... | |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
"""Adapted from Nematode: https://github.com/demelin/nematode """
# TODO: Add an attention visualization component - very important (~easy)
""" Layer implementations. """
import sys
import numpy as np
import tensorflow as tf
from tensorflow.python.ops.init_ops import glorot_uniform_initializer
# ModuleNotFoundError... | |
#!/usr/bin/env python
"""
Filter the event file and the exposure map, divide by CCD, then run xtdac on each CCD
"""
import argparse
import glob
import os
import sys
import shutil
import astropy.io.fits as pyfits
from XtDac.ChandraUtils import find_files
from XtDac.ChandraUtils import logging_system
from XtDac.Chand... | |
"""Support for interface with a Gree climate systems."""
import logging
from typing import List
from greeclimate.device import (
FanSpeed,
HorizontalSwing,
Mode,
TemperatureUnits,
VerticalSwing,
)
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.cons... | |
"""Test the Broadlink config flow."""
import errno
import socket
import broadlink.exceptions as blke
import pytest
from homeassistant import config_entries
from homeassistant.components.broadlink.const import DOMAIN
from . import get_device
from tests.async_mock import call, patch
@pytest.fixture(autouse=True)
de... | |
# Copyright (c) 2016 Uber Technologies, 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, publ... | |
"""Generated API Documentation sample using
doc_writer_sample.py."""
doc = {
"@context": {
"ApiDocumentation": "hydra:ApiDocumentation",
"description": "hydra:description",
"domain": {
"@id": "rdfs:domain",
"@type": "@id"
},
"expects": {
... | |
"""
Tests for the model-based activation workflow.
"""
import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import override_settings, TestCase
from registration.forms import Registratio... | |
"""
Provide pre-made queries on top of the recorder component.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/history/
"""
import asyncio
from collections import defaultdict
from datetime import timedelta
from itertools import groupby
import voluptuous ... | |
"""
Tests for smoothing and estimation of unobserved states and disturbances
- Predicted states: :math:`E(\alpha_t | Y_{t-1})`
- Filtered states: :math:`E(\alpha_t | Y_t)`
- Smoothed states: :math:`E(\alpha_t | Y_n)`
- Smoothed disturbances :math:`E(\varepsilon_t | Y_n), E(\eta_t | Y_n)`
Tested against R (FKF, Kalman... | |
# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint: skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import AviNestedResource... | |
#!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Run inference for pre-processed data with a trained model.
"""
import ast
from collections import namedtuple
fr... | |
#!/usr/bin/env python
#
# backend for serial IO for POSIX compatible systems, like Linux, OSX
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2001-2020 Chris Liechti <[email protected]>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# parts based on code from Grant B. Edwards <grante@visi.... | |
"""Wrapper for Xxf86vm
Generated with:
tools/genwrappers.py xf86vmode
Do not modify this file.
"""
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xxf86vm')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
# Some builds of ctypes apparently do not have c_int6... | |
# -*- coding: utf-8 -*-
"""
test all other .agg behavior
"""
from __future__ import print_function
import pytest
from collections import OrderedDict
import datetime as dt
from functools import partial
import numpy as np
import pandas as pd
from pandas import (
date_range, DataFrame, Index, MultiIndex, PeriodI... | |
#!/usr/bin/env ambari-python-wrap
"""
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... | |
"""
Support for ISY994 binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.isy994/
"""
import asyncio
import logging
from datetime import timedelta
from typing import Callable # noqa
from homeassistant.core import callback
fro... | |
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.