gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# # 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 # ...
# # 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 copy import json import logging import os import subprocess import uuid import pytest import retrying import test_helpers from dcos_test_utils import marathon, recordio __maintainer__ = 'Gilbert88' __contact__ = 'core-team@mesosphere.io' # Creates and yields the initial ATTACH_CONTAINER_INPUT message, then...
# 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...
"""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object """ # ...
# # Copyright 2015 Geoff MacGill # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# Copyright 2019 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
from ..osid import query_inspectors as osid_query_inspectors class ObjectiveQueryInspector(osid_query_inspectors.OsidObjectQueryInspector, osid_query_inspectors.OsidFederateableQueryInspector): """This is the query inspector for examining objective queries.""" def get_assessment_id_terms(self): """G...
# Copyright 2014 VMware, 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 a...
import re EOF = -1 COMMA = ',' SEMICOLON = ';' LINE_REF_SEPARATORS = (COMMA, SEMICOLON) default_range_info = dict(left_ref=None, left_offset=None, left_search_offsets=[], separator=None, right_ref=None, ...
# 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...
# Copyright 2014, Quixey 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...
import logging import json import asyncio from . import jobs logger = logging.getLogger(__name__) async def start_master(host="", port=48484, *, loop=None): """ Starts a new HighFive master at the given host and port, and returns it. """ loop = loop if loop is not None else asyncio.get_event_loop(...
from django.apps import apps import logging from future.moves.urllib.parse import urljoin import random import requests from framework.exceptions import HTTPError from framework.celery_tasks import app as celery_app from framework.postcommit_tasks.handlers import enqueue_postcommit_task, get_task_from_postcommit_queu...
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from textwrap import dedent import sys from flexmock import flexmock import pytest import atomic_reactor.utils.koji as koji_util from atomi...
""" Test cases for the L{xmantissa.webadmin} module. """ from twisted.trial.unittest import TestCase from nevow.athena import LivePage from nevow.context import WovenContext from nevow.testutil import FakeRequest from nevow.loaders import stan from nevow.tags import html, head, body, directive from nevow.inevow imp...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from future.utils import native import base64 import glob import logging import pkg_resources import os import re import sys import time import warnings from flexget import plu...
# 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 ag...
import os import subprocess DRY_RUN = False SQUELCH_STDERR = True ECHO_CALLS = False def br_call(args, dry_run=DRY_RUN, echo=ECHO_CALLS): if dry_run or echo: print('BRCALL: ' + ' '.join(args)) if dry_run: return 0 if SQUELCH_STDERR: return subprocess.call(args, stdout=open('/dev/...
# 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. from core import perf_benchmark from benchmarks import silk_flags from benchmarks import webgl_expectations from measurements import smoothness from telemet...
from __future__ import unicode_literals import boto.rds import boto.vpc from boto.exception import BotoServerError import sure # noqa from moto import mock_ec2, mock_rds from tests.helpers import disable_on_py3 @disable_on_py3() @mock_rds def test_create_database(): conn = boto.rds.connect_to_region("us-west-2...
# Copyright 2019 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 functools import partial from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from drivers.drivers_base import BaseSeleniumBrowser, DriverChoices, BaseRequests class SeleniumPhantom(BaseSeleniumBrowser): ''' ''' def __init__(self): '''...
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ from __future__ import unicode_literals from collections import namedtuple...
# Thanks to Zhao Yu for converting the .ipynb notebook to # this simplified Python script that I edited a little. # Note that the dataset must be already downloaded for this script to work, do: # $ cd data/ # $ python download_dataset.py import tensorflow as tf import numpy as np import matplotlib import mat...
from .. import exception import token class TokenStream: """Provides a stream abstraction for tokens in the BASIC language.""" def __init__(self, buffer): """Initializes based on a string to tokenize.""" self.buffer = buffer self.offset = 0 # current offset within the buffer ...
from itertools import chain import warnings from django.core.exceptions import FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import RawSQL, Ref, Random, ColIndexRef from django.db.models.query_utils import select_related_descend, QueryWrapper from django.db.models.sql.c...
from corehq.apps.reports.datatables import DataTablesHeader from corehq.apps.reports.graph_models import MultiBarChart, Axis from corehq.apps.reports.sqlreport import calculate_total_row, TableDataFormat, DataFormatter from dimagi.utils.decorators.memoized import memoized from corehq.apps.reports.standard import Datesp...
""" Tests for space utilities. """ import itertools import warnings import numpy as np import theano from theano import tensor # Can't use nose.tools.assert_raises, only introduced in python 2.7. Use # numpy.testing.assert_raises instead from pylearn2.space import (SimplyTypedSpace, Vector...
import operator import warnings import numpy as np import pytest import pandas as pd from pandas import Categorical, DataFrame, Series, date_range from pandas.tests.arrays.categorical.common import TestCategorical import pandas.util.testing as tm class TestCategoricalOpsWithFactor(TestCategorical): def test_ca...
#!/usr/bin/env python """Configuration parameters for the client.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from grr_response_core.lib import config_lib from grr_response_core.lib.rdfvalues import crypto as rdf_crypto # General Client options. c...
#!/usr/bin/env python import glob import logging import os import re import simplejson as json import struct import threading import couchstore import couchbaseConstants import pump from cbcollections import defaultdict from cbqueue import PumpQueue SFD_SCHEME = "couchstore-files://" SFD_VBUCKETS = 1024 SFD_REV_MET...
# Copyright 2019 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import logging import requests from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.db import transaction from django.urls import reverse as django_reverse from django.utils.translation import activat...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Module implementing the main loop and the telegram API.""" import enum import datetime from functools import partial import logging import logging.handlers from queue import Queue import random import os from signal import signal, SIGINT, SIGTERM, SIGABRT import sys i...
''' ''' # 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");...
# -*- coding: utf-8 -*- from functools import wraps from io import BytesIO import datetime as dt import gzip import json from flask import Blueprint, current_app, jsonify, request from doorman.database import db from doorman.extensions import log_tee from doorman.models import ( Node, Tag, DistributedQueryTas...
# # tests import logging import sys import csv import StringIO import operator from datetime import datetime from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse from django.db.models import Q fro...
#!/usr/bin/env python3 """ s3-sign.srv.py Originally by: Mark Feltner (https://github.com/FineUploader/server-examples/tree/master/python/flask-fine-uploader-s3) Server-side S3 upload example for Fine Uploader Features: * Upload to S3 * Delete from S3 * Sign Policy documents (simple uploads) and REST requests (chunke...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import re import boto3 import botocore from botocore.exceptions import ClientError from dependencies_resolver.config.configuration import \ REGEX_MULTIPART_UPLOAD_PATTERN from dependencies_resol...
""" Created on 22 Jul 2016 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ import struct import time from scs_host.bus.i2c import I2C from scs_host.lock.lock import Lock # -------------------------------------------------------------------------------------------------------------------- class ADS1...
import unittest import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from ParamSklear...
# 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...
import copy import gettext import re import django from django.conf import settings from django.utils.functional import lazy from django.utils.importlib import import_module from django.utils.translation import (trans_real as django_trans, ugettext as django_ugettext, ...
import pytest import sys import time from tlz import first import threading from distributed.compatibility import WINDOWS from distributed import metrics from distributed.profile import ( process, merge, create, call_stack, identifier, watch, llprocess, ll_get_stack, plot_data, ) ...
import datetime import time import query from connect import * class MTModel(object): def __init__(self, id=None, *args, **kwargs): self.className = self.__class__.__name__.lower() def save(self): """ Commit the model's data to the database. The query will be constructed as ...
from __future__ import division, absolute_import, print_function import numpy as np try: from scipy.spatial import (cKDTree, KDTree, SphericalVoronoi, distance, ConvexHull, Voronoi) except ImportError: pass from .common import Benchmark class Build(Benchmark): params = [ [(3,10000,1000), (8...
#!/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 import unittest import string import commands import re import os import time import cPickle import testbase import browser_model, fc g_comp = fc.Compiler() g_comp.add_func_path("../formulas") g_comp.add_path("../maps", fc.FormulaTypes.GRADIENT) g_comp.load_formula_file("gf4d.frm") g_comp.loa...
# 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...
# 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 the...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Fourth Paradigm Development, Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
from datetime import datetime from django.contrib.auth.models import User from django.contrib.auth.tokens import default_token_generator from django.core import mail from django.utils.http import int_to_base36 from django.conf import settings from mock import Mock, patch from nose.tools import eq_ from pyquery import...
"""Network device management. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import io import logging import os import enum import six from treadmill import subproc _LOGGER = logging.getLogger(__...
""" File : controller.py Date : April, 2017 Author : eugene liyai Desc : Controller file processes request from the api endpoints """ # ============================================================================ # necessary imports # ==================================================================...
from hashlib import new from sys import exc_info try: from bson import ObjectId from pymongo import MongoClient from pymongo.errors import ServerSelectionTimeoutError, DuplicateKeyError except: pass class MongoDBClient: def __init__(self, aHostAndPort, aServerSelectionTimeoutMS=1000): sel...
# coding: UTF-8 """ Copyright (c) 2008-2010 Marian Tietz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditi...
#!/usr/bin/env python import os import re import sys from textwrap import dedent import tarfile from conda.fetch import download # e.g., "======== addCols ====================================" re_header = re.compile(r'^=+\s+(?P<program>\w+)\s+=+$') # e.g.,# "addCols - Sum columns in a text file." re_summary = re....
# 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 logging from ...
#!/usr/bin/python ''' parallel_GPLVM.py Main script to run, implements parallel inference for GPLVM for SGE (Sun Grid Engine), Hadoop (Map Reduce framework), and a local parallel implementation. Arguments: -i, --input Folder containing files to be processed. One file will be processed per node. Files assumed to be...
import sys import math import paramiko import util_uploader class GetBSDData(): def __init__(self, ip, SSH_PORT, TIMEOUT, usr, pwd, USE_KEY_FILE, KEY_FILE, \ GET_SERIAL_INFO, GET_HARDWARE_INFO, GET_OS_DETAILS, \ GET_CPU_INFO, GET_MEMORY_INFO, IGNORE_DOMAIN, UPLOAD_IPV6, D...
# 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 the Li...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
from bson import Code import datetime from django.conf import settings from crits.core.mongo_tools import mongo_connector from crits.emails.email import Email from crits.samples.yarahit import YaraHit from crits.targets.target import Target from crits.targets.division import Division def generate_yara_hits(): ""...
# Copyright 2019 ARM Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
import os import re import sys import time import fcntl import socket import select import signal import subprocess import paramiko import weakref from contextlib import contextmanager from unix.processes import Processes as _Processes from unix.path import Path as _Path, escape from unix.remote import Remote as _Remot...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# coding=utf-8 """ sqldiff.py - Prints the (approximated) difference between models and database TODO: - better support for relations - better support for constraints (mainly postgresql?) - support for table spaces with postgresql - when a table is not managed (meta.managed==False) then only do a one-way sqldif...
# 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...
import pygame import time import socket # Define some colors BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) sendData = True TCP_IP = "192.168.0.10" TCP_PORT = 5005 # This is a simple class that will help us print to the screen # It has nothing to do with the joysticks, just outputing the # information. cla...
# -*- coding: utf-8 -*- """Test cluster store.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os import os.path as op import numpy as np from numpy.testing import assert_array_equal a...
""" Provides functionality to interact with lights. For more details about this component, please refer to the documentation at https://home-assistant.io/components/light/ """ import logging import os import csv from homeassistant.components import ( group, discovery, wemo, wink, isy994, zwave, insteon_hub, mysen...
import xarray as xr import numpy as np from numpy.testing import assert_allclose from xyzpy.gen.case_runner import ( case_runner, case_runner_to_ds, case_runner_to_df, find_missing_cases, ) from . import ( foo3_scalar, foo3_float_bool, foo2_array, foo2_array_array, foo2_zarray1_zarr...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2010 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/LICE...
# Copyright (c) 2014 Rackspace, 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 wr...
# Copyright 2016 Battelle Energy Alliance, 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...
"""Support for Xiaomi Philips Lights.""" import asyncio import datetime from datetime import timedelta from functools import partial import logging from math import ceil from miio import Ceil, DeviceException, PhilipsBulb, PhilipsEyecare, PhilipsMoonlight from miio.gateway.gateway import ( GATEWAY_MODEL_AC_V1, ...
#!/usr/bin/env python3 from collections import defaultdict from urllib.request import Request, urlopen from urllib.error import URLError from os.path import join from functools import * from poe_utils import * from sys import exit class PoEItemData(): # User Variables __attribute_list = ['str', 'dex', 'int', 'str/in...
# 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 # distribu...
# 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...
""" South's fake ORM; lets you not have to write SQL inside migrations. Roughly emulates the real Django ORM, to a point. """ import inspect import datetime from django.db import models from django.db.models.loading import cache from django.core.exceptions import ImproperlyConfigured from south.db import db from sou...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import datetime from frappe import _ import frappe import frappe.database import frappe.utils from frappe.utils import cint import frappe.utils.user from frappe import conf from ...
from comperio.main.tools import render from comperio.main.tools import MessageManager from comperio.settings import SITE_URL from comperio.accounts.models import cUser, cGroup from django.contrib.auth import login, authenticate, logout from django.contrib.auth.models import User, ContentType from comperio.accounts.form...
# Copyright 2014, Ansible, Inc. # Luke Sneeringer <lsneeringer@ansible.com> # # 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 requi...
import pygame import os from Game.Framework.Scene import * from Game.Framework.Vector import * class Cereal: box_32 = pygame.image.load(os.path.join('Assets', 'cereal32.png')) def __init__(self, position, id): self.__size = 32 self.image = Cereal.box_32 self.rect = pygame.Rect((posit...
""" A Printer which converts an expression into its LaTeX equivalent. """ from sympy.core import S, C, Add from sympy.core.function import _coeff_isneg from printer import Printer from conventions import split_super_sub from sympy.simplify import fraction import sympy.mpmath.libmp as mlib from sympy.mpmath.libmp impo...
import numpy as np import skimage.feature import sys from VideoReader import * from scipy.ndimage.filters import convolve from scipy.io import loadmat import cv import cv2 def findLanesConvolution(img, origSize=(960,1280), lastCols=[None, None], lastLine=[None,None,None,None], P=np.eye(3), responseOnlyNearLastCols=Fa...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os from itertools import product from fractions import Fraction from abc import ABCMeta, abstractmethod from collections.abc import Sequence import numpy as np import warnings import re from monty.serial...
# 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...
# Jaikrishna # Karan Nayan # John Cole # Initial Date: June 24, 2013 # Last Updated: Nov 4, 2013 # http://www.dexterindustries.com/ # # These files have been made available online through a Creative Commons Attribution-ShareAlike 3.0 license. # (http://creativecommons.org/licenses/by-sa/3.0/) # # Ported from Matthew R...
import os import shutil import tempfile from mock import patch from mock import Mock, MagicMock from zope.interface import implements from twisted.trial import unittest from twisted.test import proto_helpers from twisted.internet import defer, error, task, tcp from twisted.internet.endpoints import TCP4ServerEndpoin...
from __future__ import absolute_import, division, print_function import locale import re import os import sys import stat import subprocess from glob import glob from os.path import (basename, dirname, join, splitext, isdir, isfile, exists, islink, realpath, relpath) try: from os import readli...
"""Support for Synology NAS Sensors.""" from datetime import timedelta import logging from SynologyDSM import SynologyDSM import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_API_VERSION, CONF_DISKS, CONF_HOST, ...
import json import requests import re from collections import namedtuple from base64 import b64encode from urllib.parse import quote, quote_plus from enum import Enum from contextlib import closing from time import time from math import floor class CouchDBException(Exception): def __init__(self, response): ...
# 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 ...
# import transaction # import datetime from pyramid.httpexceptions import HTTPFound # from pyramid.renderers import get_renderer from ..models import ( StoredQuery, ) # import json from ..lib import query_f, filter_funcs from .. import config def table(request): request.do_not_log = True # the_user = ...
#!/usr/bin/env python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import mar...
"""The tests for the MQTT lock platform.""" from unittest.mock import patch import pytest from homeassistant.components.lock import ( DOMAIN as LOCK_DOMAIN, SERVICE_LOCK, SERVICE_OPEN, SERVICE_UNLOCK, STATE_LOCKED, STATE_UNLOCKED, SUPPORT_OPEN, ) from homeassistant.components.mqtt.lock imp...
# -*- coding: utf-8 -*- import time import datetime import mock from factory import SubFactory from factory.fuzzy import FuzzyDateTime, FuzzyAttribute, FuzzyChoice from mock import patch, Mock import factory import pytz from factory.django import DjangoModelFactory from django.utils import timezone from django.db.uti...