gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import datetime import json from django.core.urlresolvers import reverse from rest_framework.test import APITestCase from . import helpers from kolibri.core.auth.models import Classroom from kolibri.c...
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
#! /usr/bin/env python """ couchbasekit.schema ~~~~~~~~~~~~~~~~~~~ :website: http://github.com/kirpit/couchbasekit :copyright: Copyright 2013, Roy Enjoy <kirpit *at* gmail.com>, see AUTHORS.txt. :license: MIT, see LICENSE.txt for details. """ from abc import ABCMeta import datetime from dateutil.parser import parse fr...
# Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import shutil import unittest import numpy as np from pymatgen.core.structure import Structure from pymatgen.io.cif import CifFile, CifParser from pymatgen.io.feff.inputs import Atoms, Header, Potential, Tags from...
#!/usr/bin/env python import rospy import cv2 import numpy as np import os import pylab as pl import sys from sensor_msgs.msg import CompressedImage from aidu_elevator.msg import Button from images import convert from pymongo import MongoClient from sklearn.linear_model import LogisticRegression, SGDClassifier from sk...
import sys, os, re import biana try: from biana import * except: sys.exit(10) """ NetworkAnalysis 2017 Joaquim Aguirre-Plans Structural Bioinformatics Laboratory Universitat Pompeu Fabra """ def generate_network(targets_list, targets_type_id, radius, taxid, translation_file, translation_type_id, nod...
""" test with the .transform """ import numpy as np import pytest from pandas._libs import groupby from pandas.compat import StringIO from pandas.core.dtypes.common import ensure_platform_int, is_timedelta64_dtype import pandas as pd from pandas import DataFrame, MultiIndex, Series, Timestamp, concat, date_range fr...
from dbmanager import * from apicontrol import * from extras import * from joblib import Parallel,delayed from ui import QCoreApplication #TODO:Reviews,Image def first_load(): if not os.path.isfile("test.db"): SQLHandler().resetdb() def add_folder(mov_dir): addressfiles = [os.path.join(root) #a...
#!/usr/bin/env python """A wrapper script around clang-format, suitable for linting multiple files and to use for continuous integration. Taken from https://github.com/Sarcasm/run-clang-format This is an alternative API for the clang-format command line. It runs over multiple files and directories in parallel. A diff...
from functools import wraps from random import * from flask import render_template, flash, redirect, request, url_for, make_response from sqlalchemy import desc from sqlalchemy.exc import * from vuln_corp import app from vuln_corp import utils from vuln_corp.choices import ISSUE_ASSIGNEES from vuln_corp.forms import ...
# Copyright 2020 Mark Taylor # # 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, ...
# Copyright 2016 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# System libs import os import argparse from distutils.version import LooseVersion from multiprocessing import Queue, Process # Numerical libs import numpy as np import math import torch import torch.nn as nn from scipy.io import loadmat # Our libs from config import cfg from dataset import ValDataset from models impor...
# 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 ...
#!/usr/bin/python3 from netsnmp._api import get_async from async_devtypes import SNMP_DEVTYPES #import cx_Oracle import zmq import redis, hiredis import logging, logging.handlers import random, sys, threading, time import multiprocessing as mp # Python 2 support try: import queue except: import Queue as queue...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Copyright (c) 2012 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. """Class for running instrumentation tests on a single device.""" import collections import logging import os import re import time from devil.android ...
''' File: pinm.py Description: Class definition History: Date Programmer SAR# - Description ---------- ---------- ---------------------------- Author: w. x. chan 29Apr2016 - Created ''' ''' ''' import numpy as np import autoD as ad import sys from matplotlib import pyplot from matplotlib.widge...
#=============================================================================== # OMDb API Search Script - Module - dispdat #------------------------------------------------------------------------------- # Version: 0.1.3 # Updated: 03-11-2013 # Author: Alex C. # License: MIT #-----------------------------------------...
# Copyright 2015-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 of conditions and ...
import os.path import logging as log from types import StringType, LongType, IntType, ListType, DictType ints = (LongType, IntType) strings = (StringType,unicode) from re import compile from sha import sha from hashlib import md5 import logging logging.basicConfig(level=logging.DEBUG) log = logging.getLogger(__name__...
# Copyright 2014-2017 The Meson development team # 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...
""" 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 __future__ import absolute_import import os import pytest import tarfile import zipfile from atomic_reactor.constants import PLUGIN_EX...
import numpy as n from .afg import AFG_channel, Arb def sync(length, amp=16382): s = n.zeros((length,), dtype=n.uint16) s[1::2] = 1 return s * amp def zigzagify(A): """reshape a 2d array to have alternate rows going backward""" A[1::2] = A[1::2][:,::-1] def pairify(a): """ return an array th...
""" Support for Nest devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/nest/ """ import logging import socket import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helpers import discovery from homeassi...
import numpy as nm from sfepy.linalg import dot_sequences, insert_strided_axis from sfepy.terms.terms import Term, terms class DivGradTerm(Term): r""" Diffusion term. :Definition: .. math:: \int_{\Omega} \nu\ \nabla \ul{v} : \nabla \ul{u} \mbox{ , } \int_{\Omega} \nu\ \nabla \ul{u} :...
from django.db import models from django.contrib.auth.models import User """ class DataCatalog(models.Model): objects = DataCatalogManager() # handles natural keys name = models.CharField(max_length=200, unique=True) manager = models.ForeignKey("Scientist",related_name="managed_datacatalogs",null=True,blank=True) ...
import os from dateutil.parser import parse from boto.s3.connection import S3Connection, Key from boto.s3.connection import OrdinaryCallingFormat from boto.s3.cors import CORSConfiguration from boto.exception import S3ResponseError from hurry.filesize import size, alternative #Note: (from boto docs) this function ...
#!/usr/bin/env python # coding=utf-8 """ An OPF `<dc:...>` metadatum. This class can be used for both EPUB 2 and EPUB 3 DC metadata. """ from yael.jsonable import JSONAble from yael.namespace import Namespace from yael.opfmetadatum import OPFMetadatum import yael.util __author__ = "Alberto Pettarin" __copyright__ =...
"""Support for Radio Thermostat wifi-enabled home thermostats.""" import logging from socket import timeout import radiotherm import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate.const import ( CURRENT_HVAC_COOL, CURRENT_HVA...
# u-msgpack-python v2.4.1 - v at sergeev.io # https://github.com/vsergeev/u-msgpack-python # # u-msgpack-python is a lightweight MessagePack serializer and deserializer # module, compatible with both Python 2 and 3, as well CPython and PyPy # implementations of Python. u-msgpack-python is fully compliant with the # lat...
import re import time from random import getrandbits import globus_sdk from tests.framework import (TransferClientTestCase, get_user_data, GO_EP1_ID, GO_EP2_ID, DEFAULT_TASK_WAIT_TIMEOUT, DEFAULT_TASK_WAIT_POLLING_INTERVAL) from gl...
# -*- coding: utf-8 -*- """ Created on Thu Jan 12 17:53:32 2017 @author: sakurai """ from __future__ import print_function from collections import OrderedDict import os import numpy try: from PIL import Image available = True except ImportError as e: available = False _import_error = e from chainer....
#!/usr/bin/env python """Client actions related to administrating the client and its configuration.""" import os import platform import socket import time import psutil import logging from grr.client import actions from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib import stats class Echo(...
from __future__ import unicode_literals import os import base64 import datetime import hashlib import copy import itertools import codecs import six from bisect import insort from moto.core import BaseBackend from moto.core.utils import iso_8601_datetime_with_milliseconds, rfc_1123_datetime from .exceptions import Buc...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Unit test for the HardwareThread class. # # Copyright (c) 2015 carlosperate https://github.com/carlosperate/ # # Licensed under The MIT License (MIT), a copy can be found in the LICENSE file # from __future__ import unicode_literals, absolute_import import io import ti...
#!/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 import pw import rax_uploader import archive_uploader import steve.richardapi import os import xml.etree.Elemen...
# 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...
"""Debugger Tests""" import sys import pytest try: from StringIO import StringIO except ImportError: from io import StringIO # NOQA from circuits import Debugger from circuits.core import Event, Component class test(Event): """test Event""" class App(Component): def test(self, raiseException=...
# Copyright 2017 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, ...
#!/usr/bin/env python # # 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 # "L...
# Copyright DataStax, 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, softwa...
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
from datetime import date,timedelta from dateutil.parser import parse from igf_data.igfdb.baseadaptor import BaseAdaptor from igf_data.utils.seqrunutils import get_seqrun_date_from_igf_id from igf_data.utils.gviz_utils import convert_to_gviz_json_for_display from igf_data.igfdb.igfTables import Base, Project,Sample,Exp...
from csv import DictReader from datetime import datetime, timedelta from collections import defaultdict import cPickle as pickle from math import exp, log, sqrt import random, gc from util import read_dump, write_dump, cache, read_tsv, convert_ts, data, next_row, get_category import argparse, ast, re, json def filter_...
# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, absolute_import import sys import os import json import click import hashlib import cProfile import StringIO import pstats import frappe import frappe.utils from frappe.utils ...
""" Make a "broken" horizontal bar plot, i.e. one with gaps, of run times. (c) 2015 Massachusetts Institute of Technology """ import numpy import pprint import matplotlib matplotlib.use('GTKAgg') import matplotlib.pyplot as plt label_fontsize = 11 labels = ['Disk Reset', # 'Power On', ...
# # 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...
from bugle.models import Blast from bugle.search import query_to_q_object from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.paginator import Paginator, EmptyPage from django.core.urlresolvers import reverse...
import base64 import os import re import subprocess from itertools import takewhile from django.utils.encoding import smart_str try: from staticfiles import finders except ImportError: from django.contrib.staticfiles import finders # noqa from pipeline.conf import settings from pipeline.utils import to_clas...
""" Provides the ApiConnection class """ import copy import functools import io import json import os import random import threading import time import urllib3 import uuid import requests from .dat_jank import post_to_get from .exceptions import ApiError from .exceptions import ApiAuthError, ApiConnectionError, ApiTi...
# -*- coding: utf-8 -*- import contextlib import copy import datetime import json import threading import elasticsearch import mock import pytest from elasticsearch.exceptions import ElasticsearchException from elastalert.enhancements import BaseEnhancement from elastalert.kibana import dashboard_temp from elastalert...
#@PydevCodeAnalysisIgnore __author__ = 'Daan Wierstra, daan@idsia.ch' from scipy import zeros, tanh from module import Module from pybrain.structure.parametercontainer import ParameterContainer from pybrain.tools.functions import sigmoid, sigmoidPrime, tanhPrime class LSTMRTRLBlock(Module, ParameterContainer): ...
"""Assistant for Generating Trees with Attention and GIST Data Description: data: type: dict content: {surface_form: [<path>, <path>, ...], ...} path: type: dict content: {'dtree': tree_features, 'attach_points': at...
# Copyright (c) Ralph Meijer. # See LICENSE for details. """ Tests for L{wokkel.component}. """ from __future__ import division, absolute_import from zope.interface.verify import verifyObject from twisted.internet.base import BaseConnector from twisted.internet.error import ConnectionRefusedError from twisted.inter...
""" Functions for manipulating metadata """ import pandocfilters import shlex from . import const from . import info from . import util from . import error def update_metadata(old, new): """ return `old` updated with `new` metadata """ # 1. Update with values in 'metadata' field try: old.update(get...
from ..Qt import QtGui, QtCore from ..python2_3 import asUnicode import numpy as np from ..Point import Point from .. import debug as debug import weakref from .. import functions as fn from .. import getConfigOption from .GraphicsWidget import GraphicsWidget __all__ = ['AxisItem'] class AxisItem(GraphicsWidget): ...
# 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...
import urlparse from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.http import urlsafe_base64_decode from django.utils.translat...
# 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...
try: from unittest2 import TestCase from mock import Mock, patch except ImportError: from unittest import TestCase from mock import Mock, patch import datetime from botocore.exceptions import ClientError from dateutil.tz import tzutc from cfn_sphere.aws.cfn import CloudFormation from cfn_sphere.aws.c...
# # # Copyright (C) 2006, 2007, 2008 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of con...
"""Collection of convenient functions Functions: adjust_lon_range -- Express longitude values in desired 360 degree interval apply_land_ocean_mask -- Apply a land or ocean mask from an sftlf (land surface fraction) file apply_lon_filter -- Set values outside of specified longitude range to zero broad...
from optparse import OptionParser import os import glob import numpy as np from collections import defaultdict from ..util import dirs from ..util import file_handling as fh from ..export import html def main(): usage = "%prog project JLDA_output_dir html_output_dir" parser = OptionParser(usage=usage) ...
from collections import OrderedDict from xml.etree import ElementTree as ET import openmc from openmc.clean_xml import sort_xml_elements, clean_xml_indentation from openmc.checkvalue import check_type def reset_auto_ids(): """Reset counters for all auto-generated IDs""" openmc.reset_auto_material_id() op...
#!/usr/local/bin/python3 -u """ SentientHome Application - based on Cement framework. Author: Oliver Ratzesberger <https://github.com/fxstein> Copyright: Copyright (C) 2017 Oliver Ratzesberger License: Apache License, Version 2.0 """ # Make sure we have access to SentientHome commons import os import platform...
#!/usr/bin/env python """This tool builds or repacks the client binaries. This handles invocations for the build across the supported platforms including handling Visual Studio, pyinstaller and other packaging mechanisms. """ import os import platform import sys # pylint: disable=unused-import from grr.client impor...
"""Console script entry point for AutoNetkit""" import os import random import time import sys import traceback from datetime import datetime import autonetkit.ank_json as ank_json import autonetkit.ank_messaging as ank_messaging import autonetkit.config as config import autonetkit.log as log import autonetkit.render...
import copy import logging import collections import synapse.exc as s_exc import synapse.common as s_common import synapse.lib.chop as s_chop import synapse.lib.time as s_time import synapse.lib.layer as s_layer import synapse.lib.stormtypes as s_stormtypes logger = logging.getLogger(__name__) class Node: ''' ...
# Many scipy.stats functions support `axis` and `nan_policy` parameters. # When the two are combined, it can be tricky to get all the behavior just # right. This file contains a suite of common tests for scipy.stats functions # that support `axis` and `nan_policy` and additional tests for some associated # functions in...
# Copyright 2016 Quora, 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, so...
""" Django settings for the admin project. """ import os from urlparse import urlparse from website import settings as osf_settings from django.contrib import messages from api.base.settings import * # noqa # TODO ALL SETTINGS FROM API WILL BE IMPORTED AND WILL NEED TO BE OVERRRIDEN # TODO THIS IS A STEP TOWARD INTEG...
"""Repository support for Bazaar.""" from __future__ import unicode_literals import os import dateutil.parser from django.utils import six from django.utils.encoding import force_text from django.utils.timezone import utc from reviewboard.scmtools.core import SCMClient, SCMTool, HEAD, PRE_CREATION from reviewboard....
import unittest import unittest.mock import io import re from g1.bases import datetimes from g1.operations.cores import alerts class ConfigTest(unittest.TestCase): def test_destination_slack(self): with self.assertRaisesRegex(AssertionError, r'expect true'): alerts.Config.SlackDestination()...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple peak fitting utility with Lmfit ====================================== Current fitting backend: Lmfit_ .. _Lmfit: https://lmfit.github.io/lmfit-py/ """ #: BASE import numpy as np from matplotlib.pyplot import cm #: LMFIT IMPORTS from lmfit.models import Cons...
import os import environ # PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) # PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) # BASE_DIR = PACKAGE_ROOT # PROJECT_ROOT = environ.Path(__file__) - 2 ROOT_DIR = environ.Path(__file__) - 4 APP_DIR = ROOT_DIR.path('src') PROJECT_R...
# 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 (c) 2017, John Skinner import abc import numpy as np import logging import database.entity import core.image import core.sequence_type import core.image_source import util.database_helpers as dh import core.image_entity class ImageCollection(core.image_source.ImageSource, database.entity.Entity, metaclass...
import logging import multiprocessing import multiprocessing.pool import os.path as osp import shutil import uuid from smqtk.algorithms.relevancy_index import get_relevancy_index_impls from smqtk.representation import DescriptorElementFactory from smqtk.representation.descriptor_element.local_elements import Descripto...
""" Orbivo S20. """ import binascii import struct import logging import socket import threading import time _LOGGER = logging.getLogger(__name__) # S20 UDP port PORT = 10000 # UDP best-effort. RETRIES = 3 TIMEOUT = 1.0 DISCOVERY_TIMEOUT = 1.0 # Timeout after which to renew device subscriptions SUBSCRIPTION_TIMEOUT...
import matplotlib.pyplot as plt from matplotlib import dates import numpy as np import os import sys from pprint import pprint from datetime import datetime from datetime import timedelta import copy import calendar import mysql.connector timezone = -8 #database connection cnx = mysql.connector.connect(user='root', p...
################################################################################ # Copyright (c) 2017-2021, National Research Foundation (SARAO) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the License at # # ...
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np import time # from system_model_dif import SystemModel_dif from system_model import SystemModel # from system_model_wrong import SystemModel_wrong from game_ac_network import GameACLSTMNetwork from constants import GAMMA from constants import LOCAL_T_MA...
from collections import defaultdict from django.template.base import ( Library, Node, TemplateSyntaxError, TextNode, Variable, token_kwargs, ) from django.utils import six from django.utils.safestring import mark_safe register = Library() BLOCK_CONTEXT_KEY = 'block_context' class ExtendsError(Exception): p...
""" Support for Honeywell Round Connected and Honeywell Evohome thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.honeywell/ """ import logging import socket import datetime import requests import voluptuous as vol from homeassistant....
# Copyright (c) 2015 Infoblox 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 require...
import string import random from django import forms from django.conf import settings from django.contrib.auth import forms as auth_forms from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.models import get_current_site from django.core.exceptions import ValidationError from django.util...
# Copyright (c) 2012 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 django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from django.core import paginator from django.test import TestCase, override_settings from django.urls import reverse from wagtail.admin.tests.pages.timestamps import local_datetime from wagtail.core imp...
"""Support for Template alarm control panels.""" import logging import voluptuous as vol from homeassistant.components.alarm_control_panel import ( ENTITY_ID_FORMAT, FORMAT_NUMBER, PLATFORM_SCHEMA, AlarmControlPanelEntity, ) from homeassistant.components.alarm_control_panel.const import ( SUPPORT_...
from __future__ import unicode_literals import csv import io import json import logging import math import os from collections import OrderedDict from django.core.cache import cache from django.http import Http404 from django.http import HttpResponse from django.http.response import FileResponse from django.template....
#--------------------------------------------------------------------------- # Copyright 2012 The Open Source Electronic Health Record Agent # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
"""Support for performing TensorFlow classification on images.""" import io import logging import os import sys from PIL import Image, ImageDraw import numpy as np import voluptuous as vol from homeassistant.components.image_processing import ( CONF_CONFIDENCE, CONF_ENTITY_ID, CONF_NAME, CONF_SOURCE, ...
# 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...
from sqlalchemy.testing import eq_, assert_raises, \ assert_raises_message from sqlalchemy.testing.util import gc_collect from sqlalchemy.testing import pickleable from sqlalchemy.util import pickle import inspect from sqlalchemy.orm import create_session, sessionmaker, attributes, \ make_transient, make_transi...
"""auxlib module provides several useful low-level functions as number thresholding or a couple of linear algebra operations""" import numpy as np _epsilon = 0.0001 def to_colour_1(x): """Convert number to float in range [0,1] Parameters ---------- x : convertible to float number that will ...
from __future__ import absolute_import from __future__ import division from .. import backend as K from .. import activations from .. import initializers from .. import regularizers from .. import constraints from keras.engine import Layer from keras.engine import InputSpec from keras.objectives import categorical_cro...
import warnings from ..base import BaseEstimator, TransformerMixin from ..utils import check_array from ..utils.testing import assert_allclose_dense_sparse from ..externals.six import string_types def _identity(X): """The identity function. """ return X class FunctionTransformer(BaseEstimator, Transfor...
# 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 datetime import django from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from django.db import connection, models qn = connection.ops.quote_name from taggit.models import TagBase, GenericTaggedItemBase, ItemBase from .settings import CATEGORY_CHO...