code
stringlengths
1
199k
""" Diagnostic Record Read/Write ------------------------------ These need to be tied into a the current server context or linked to the appropriate data """ import struct from pymodbus3.constants import ModbusStatus, ModbusPlusOperation from pymodbus3.pdu import ModbusRequest from pymodbus3.pdu import ModbusResponse f...
import logging from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse, NoReverseMatch from django.contrib.sites.models import Site, get_current_site from django.core.exceptions import ObjectDoesNotExist from django.db.models import get_model from oscar.core.loading import get_class fr...
import io import random import string import struct import unittest from ipaddress import ip_address from ipv6 import ( ICMPv6Header, UDPHeader, IPv6Header, IPv6PacketFactory, UDPDatagram, UDPDatagramFactory, ICMPv6Factory, HopByHopFactory, MPLOptionFactory, ICMPv6, HopByHopO...
from setuptools import setup setup( name='edtf-validate', version='2.0.0', author='Mark Phillips', author_email='mark.phillips@unt.edu', packages=['edtf_validate'], url='https://github.com/unt-libraries/edtf-validate', license='BSD', entry_points={ 'console_scripts': ['edtf-valid...
''' Minimal directed graph replacement for networkx.DiGraph This has the sole advantage of being a standalone file that doesn't bring any dependency with it. ''' class DiGraph(object): def __init__(self): # adjacency[i][j] = True means j is a successor of i self._adjacency = {} self._edges =...
from __future__ import absolute_import __all__ = ["PluginConfigMixin"] import six from collections import OrderedDict from django import forms from rest_framework import serializers from sentry.exceptions import PluginError from sentry.utils.forms import form_to_config from .providers import ProviderMixin from .validat...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("wagtailsearch", "0001_initial"), ] operations = [ migrations.AlterModelOptions( name="editorspick", options={"ordering": ("sort_order",), "verbose_name": "Editor's Pick"...
"""Base class for mixture models.""" from __future__ import print_function import warnings from abc import ABCMeta, abstractmethod from time import time import numpy as np from .. import cluster from ..base import BaseEstimator from ..base import DensityMixin from ..externals import six from ..exceptions import Converg...
""" tests.test_cache ~~~~~~~~~~~~~~~~ Provides unit tests. """ import time import random import nose.tools as nt from mezmorize import Cache, function_namespace from mezmorize.utils import HAS_MEMCACHE, HAS_REDIS, get_cache_config from mezmorize.backends import ( SimpleCache, FileSystemCache, RedisCache...
"""A calliope command that calls a help function.""" from googlecloudsdk.calliope import base from googlecloudsdk.calliope import cli from googlecloudsdk.calliope import exceptions as c_exc from googlecloudsdk.core import log from googlecloudsdk.core import metrics @base.ReleaseTracks(base.ReleaseTrack.GA) class Help(b...
import os import sys import threading from optparse import OptionParser from hydeengine import Generator, Initializer, Server PROG_ROOT = os.path.dirname(os.path.abspath( __file__ )) def main(argv): parser = OptionParser(usage="%prog [-f] [-q]", version="%prog 0.3b") parser.add_option("-s", "--sitepath", ...
import six from ..language import visitor_meta from ..type.definition import (GraphQLInputObjectType, GraphQLList, get_named_type, get_nullable_type, is_composite_type) from .get_field_def import get_field_def from .type_from_ast import type_from_ast def pop...
import sys,time,serial from Tkinter import * from select import * NROWS = 25 NCOLS = 80 def key(event): # # key press event handles # key = event.char #print 'send',ord(key) if (ord(key) == 13): key = chr(10) ser.write(key) def quit(): # # clean up and quit # sys.exit() def idle(p...
import operator from flask_resty import ( ColumnFilter, Filtering, GenericModelView, NoOpAuthentication, NoOpAuthorization, PagePagination, Sorting, ) from . import models, schemas class AuthorViewBase(GenericModelView): model = models.Author schema = schemas.AuthorSchema() authe...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that the Delete() Action works. """ import sys import os.path import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """ Execute(Delete('f1')) Execute(Delete('d2')) Execute(Delete('symlinks/filelink')) Execute(Delete('symlinks/brok...
from flask import Flask from mysqlconnection import MySQLConnector app = Flask(__name__) mysql = MySQLConnector(app, 'mydb') print mysql.query_db("SELECT * FROM user") app.run(debug=True)
import sys, os from oebakery import die, err, warn, info, debug import oelite.meta class OElitePackage: def __init__(self, id, name, type, arch, recipe): self.id = id self.name = name self.type = type self.arch = arch self.recipe = recipe layer_priority = recipe.meta....
from re import compile, escape, IGNORECASE from ..scraper import _BasicScraper from ..util import tagre from ..helpers import indirectStarter class WapsiSquare(_BasicScraper): url = 'http://wapsisquare.com/' rurl = escape(url) stripUrl = url + 'comic/%s/' firstStripUrl = stripUrl % '09092001' imageS...
from acq4.pyqtgraph.metaarray import *
import numpy as np import mbuild as mb class AmorphousSilica(mb.Compound): """ """ def __init__(self, surface_roughness=1.0): super(AmorphousSilica, self).__init__() if surface_roughness == 1.0: # TODO: description of how this surface was generated/citation mb.load('amorp...
from __future__ import absolute_import import copy import re import os import urwid from netlib import odict from netlib.http import user_agents from . import common, signals from .. import utils, filt, script FOOTER = [ ('heading_key', "enter"), ":edit ", ('heading_key', "q"), ":back ", ] FOOTER_EDITING = [ ...
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) exce...
import os RT_USING_LCD_TYPE = 'PNL_T35' ARCH = 'arm' CPU = 's3c24x0' TextBase = '0x30000000' CROSS_TOOL = 'gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' elif CROSS_TOOL == 'keil': ...
import unit_lib import VS plist=VS.musicAddList('factory.m3u') VS.musicPlayList(plist) (room1, room2, bar, weap) = unit_lib.MakeUnit ()
''' Implement openssl compatible AES-256 CBC mode encryption/decryption. This module provides encrypt() and decrypt() functions that are compatible with the openssl algorithms. This is basically a python encoding of my C++ work on the Cipher class using the Crypto.Cipher.AES class. URL: http://projects.joelinoff.com/ci...
"""Test for Impact Function.""" from copy import deepcopy import getpass from socket import gethostname import unittest import json import os import logging from os.path import join, isfile from os import listdir from safe.definitions.fields import ( exposure_type_field, female_ratio_field, female_count_fie...
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 unique constraint on 'OTM1ModelRelic', fields ['instance', 'otm1_model_id', 'otm2_model_name'] db.create_unique(u'otm1_migrato...
from time import mktime, strptime import re from module.plugins.Account import Account class EuroshareEu(Account): __name__ = "EuroshareEu" __type__ = "account" __version__ = "0.02" __description__ = """Euroshare.eu account plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg"...
int() int() int(str) . str.. a(0):. if 1: 1 elif(3): a = 3 else: a = '' a def func(): if 1: 1 elif(3): a = 3 else: a = '' #? int() str() return a func() for a in [1,2]: #? int() a for a1 in 1,"": #? int() str() a1 for a3, b3 in (1,""), (1,""), (1,"...
from optparse import make_option from os.path import sep as dirsep import deluge.common as common import deluge.component as component import deluge.ui.console.colors as colors from deluge.ui.client import client from deluge.ui.console.main import BaseCommand from deluge.ui.console.modes import format_utils strwidth = ...
''' Class(es) responsible for delivering X3D content displaying animation of data from STOQS databases. ''' import logging import math import numpy as np import os import time import traceback from collections import namedtuple from datetime import datetime from itertools import zip_longest from loaders import X3DPLATF...
"""Compute the wavelength calibration of a particular spectrum.""" from __future__ import division from __future__ import print_function import argparse from astropy.io import fits import numpy as np import os from scipy import ndimage import sys from .arccalibration import arccalibration from .arccalibration import fi...
""" Test the `ipalib/plugins/hbacrule.py` module. """ from nose.tools import raises, assert_raises # pylint: disable=E0611 from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test, assert_attr_equal from ipalib import api from ipalib import errors class test_hbac(XMLRPC_test): """ Test the `hbacrule` plugin. ...
"""Parser for xrecords.""" import urllib from xml.etree.ElementTree import ElementTree URL_TEMPLATE = 'http://innopac.library.drexel.edu/xrecord=%s' def get_record(record_id, url_template=URL_TEMPLATE): xrecord = urllib.urlopen(url_template % record_id) tree = ElementTree() tree.parse(xrecord) def join_...
""" Class that collects utilities used in Accounting and Monitoring systems """ from DIRAC.Core.Utilities import Time class DBUtils(object): def __init__(self, db, setup): self._acDB = db self._setup = setup def _retrieveBucketedData(self, typeName, st...
""" Manipulating data tables (taking slices, etc) """ from __future__ import print_function from collections import defaultdict, namedtuple import itertools import numpy as np import scipy.sparse from .edu import FAKE_ROOT_ID from .util import concat_l UNRELATED = "UNRELATED" "distinguished value for unrelated relation...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0005_auto_20170802_1428'), ] operations = [ migrations.AlterField( model_name='casalegislativa', name='codigo', ...
""" MagPy RCS input filter for MagPy Written by Richard Mandl Short description... """ from __future__ import print_function from magpy.stream import * def GetINIData(relatedtofilename): # add here methods whcih you need to analyze RCS data pass def isRCS(filename): """ Checks whether a file an RCS data...
import re from django.conf.urls import patterns, url from analytics_data_api.v0.views import problems as views PROBLEM_URLS = [ ('answer_distribution', views.ProblemResponseAnswerDistributionView, 'answer_distribution'), ('grade_distribution', views.GradeDistributionView, 'grade_distribution'), ] urlpatterns = ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contacts', '0021_auto_20150727_0727'), ] operations = [ migrations.AlterField( model_name='contactgroup', name='name', ...
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh.""" from import_shims.warn import warn_deprecated_import warn_deprecated_import('debug.management.commands.dump_xml_courses', 'lms.djangoapps.debug.management.commands.dump_xml_courses') from lms.djangoapps.debug.management.commands.dump_xml...
""" Enrollment operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. """ import json import logging from datetime import datetime import pytz from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=import...
from spack import * class RImpute(RPackage): """Imputation for microarray data (currently KNN only).""" homepage = "https://www.bioconductor.org/packages/impute/" url = "https://git.bioconductor.org/packages/impute" version('1.50.1', git='https://git.bioconductor.org/packages/impute', commit='31d1c...
from spack import * class LmSensors(MakefilePackage): """The lm-sensors package provides user-space support for the hardware monitoring drivers in Linux. """ homepage = "https://github.com/groeck/lm-sensors/" url = "https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz" maintainers = ['G-Ragghi...
from spack import * class PyProgressbar2(PythonPackage): """A progress bar for Python 2 and Python 3""" homepage = "https://github.com/WoLpH/python-progressbar" pypi = "progressbar2/progressbar2-3.50.1.tar.gz" version('3.55.0', sha256='86835d1f1a9317ab41aeb1da5e4184975e2306586839d66daf63067c102f8f04') ...
"""xml parsing routines Flumotion deals with two basic kinds of XML: config and registry. They correspond to data and schema, more or less. This file defines some base parsing routines shared between both kinds of XML. """ import os from xml.dom import minidom, Node from xml.parsers import expat from flumotion.common i...
"""Wrapper for eventfd(2) system call.""" import logging import os import ctypes from ctypes import ( c_int, c_uint, ) from ctypes.util import find_library import enum _LOGGER = logging.getLogger(__name__) _LIBC_PATH = find_library('c') _LIBC = ctypes.CDLL(_LIBC_PATH, use_errno=True) if getattr(_LIBC, 'eventfd'...
from __future__ import absolute_import from __future__ import print_function from functools import wraps from django.core.cache import cache as djcache from django.core.cache import caches from django.conf import settings from django.db.models import Q from django.core.cache.backends.base import BaseCache from typing i...
import datetime from cinder import exception as exc FAKE_UUID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' FAKE_UUIDS = {} def stub_volume(id, **kwargs): volume = { 'id': id, 'user_id': 'fakeuser', 'project_id': 'fakeproject', 'host': 'fakehost', 'size': 1, 'availability_...
import copy import math import time from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LW from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp.dataontap.client import client_base LOG = logging.getLogger(__name_...
"""Stack tracer for multi-threaded applications. Usage: import stacktracer stacktracer.start_trace("trace.html",interval=5,auto=True) # Set auto flag to always update file! .... stacktracer.stop_trace() """ from datetime import datetime, timezone import sys import threading import traceback from pygments import highlig...
import jwt import httplib as http import mock from nose.tools import * # noqa from modularodm import Q from tests.base import OsfTestCase from tests import factories from framework.exceptions import HTTPError from website import settings from website.models import Node, Sanction, Embargo, RegistrationApproval, Retract...
from __future__ import print_function import unittest from functools import partial import contextlib import numpy as np import paddle import paddle.fluid.core as core import paddle.fluid as fluid import paddle.fluid.framework as framework import paddle.fluid.optimizer as optimizer import paddle.fluid.regularizer as re...
import copy import six from oslo_config import cfg from six.moves import http_client from st2api.controllers.resource import ResourceController from st2api.controllers.v1 import execution_views from st2common.constants import action as action_constants from st2common.exceptions import db as db_exceptions from st2common...
import re import socket import binascii from impacket.smbconnection import * from impacket import nmb from impacket import ntlm from impacket.structure import pack from impacket.dcerpc import dcerpc, dcerpc_v4 class DCERPCStringBinding: parser = re.compile(r'(?:([a-fA-F0-9-]{8}(?:-[a-fA-F0-9-]{4}){3}-[a-fA-F0-9-]{1...
import json import logging from flask import current_app, Flask, redirect, request, session, url_for import httplib2 from oauth2client.contrib.flask_util import UserOAuth2 oauth2 = UserOAuth2() def create_app(config, debug=False, testing=False, config_overrides=None): app = Flask(__name__) app.config.from_objec...
""" 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 use this ...
import os import shutil import logging import operator import copy import yaml from .tools_supported import ToolsSupported from .tools.tool import get_tool_template from .util import merge_recursive, PartialFormatter, FILES_EXTENSIONS, VALID_EXTENSIONS, FILE_MAP, OUTPUT_TYPES, SOURCE_KEYS, fix_paths logger = logging.ge...
from collections import namedtuple import re try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse, urlunparse from twitter.twitter_utils import enf_type EndpointRateLimit = namedtuple('EndpointRateLimit', ['limit', 'remaining', 'reset']) Resourc...
from __future__ import absolute_import from __future__ import unicode_literals import json import logging import six from docker.utils import split_command from docker.utils.ports import split_port from .cli.errors import UserError from .config.serialize import denormalize_config from .network import get_network_defs_f...
""" @package mi.dataset.parser.test.test_sio_eng_sio_mule @file marine-integrations/mi/dataset/parser/test/test_sio_eng_sio_mule.py @author Mike Nicoletti @brief Test code for a sio_eng_sio_mule data parser """ from nose.plugins.attrib import attr import os from mi.core.exceptions import SampleException, UnexpectedData...
from django.test import TransactionTestCase from onadata.libs.serializers.attachment_serializer import get_path class TestAttachmentSerializer(TransactionTestCase): def setUp(self): """ self.data is a json represenatation of an xform """ self.data = { "name": "photo_in_gr...
"""Restricted Boltzmann Machine """ import time import numpy as np import scipy.sparse as sp from ..base import BaseEstimator from ..base import TransformerMixin from ..externals.six.moves import xrange from ..utils import atleast2d_or_csr, check_arrays from ..utils import check_random_state from ..utils import gen_eve...
""" Displays a world map with locations plotted on top. Locations are expected to be tuples of latitude, longitude where West and South are expressed as negative values. - Mousewheel up and down zooms the plot in and out. - Pressing "z" brings up the Zoom Box, and you can click-drag a rectangular region to zoom. ...
from __future__ import generators import logging _logger = logging.getLogger(__name__) import os from urlparse import urljoin, urldefrag from urllib import pathname2url from rdflib.term import URIRef, Variable, _XSD_PFX class Namespace(URIRef): @property def title(self): return URIRef(self + 'title') ...
import sys from collections.abc import Mapping, Iterable from ctypes import c_int, c_int32, c_double, c_char_p, POINTER from weakref import WeakValueDictionary import numpy as np from ..exceptions import AllocationError, InvalidIDError from . import _dll from .core import _FortranObjectWithID from .error import _error_...
from __future__ import print_function from .TimecourseAnalyzer import TimecourseAnalyzer
import os from buildslave.commands import base from buildslave import runprocess class SlaveShellCommand(base.Command): def start(self): args = self.args # args['workdir'] is relative to Builder directory, and is required. assert args['workdir'] is not None workdir = os.path.join(sel...
page = """ <div id="top_bin"><div id="top_content" class="width960"> <a class = "email_link" href="http://mail.google.com" style="color: red;">Gmail</a> <div class="udacity float-left"> <a href="http://udacity.com">Udacity</a> </div> </div> """ repl = ['...
"""Automatically-generated blanket testing for the MediaFile metadata layer. """ from __future__ import division, absolute_import, print_function import os import shutil import datetime import time import unittest from six import assertCountEqual from test import _common from beets.mediafile import MediaFile, Image, \ ...
""" CNN for sentence modeling described in paper: A Convolutional Neural Network for Modeling Sentence """ import sys, os, time import pdb import math, random import numpy as np import theano import theano.tensor as T from util import (load_data, dump_params) from logreg import LogisticRegression class WordEmbeddingLay...
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006...
from __future__ import unicode_literals from django.db import models, migrations def populate_add_doi_date(apps, schema_editor): Collection = apps.get_model("statmaps", "Collection") for collection in Collection.objects.exclude(DOI__isnull=True).exclude(private=True): collection.doi_add_date = collectio...
import logging import os from panda.tasks.base import Task from django.conf import settings from django.template import Context from livesettings import config_value from client.utils import get_total_disk_space, get_free_disk_space from panda.utils.mail import send_mail from panda.utils.notifications import get_email_...
"""Helper functions to handle pagination of API responses """ from __future__ import unicode_literals from urllib import urlencode from urlparse import parse_qs, urlsplit, urlunsplit def _modify_query(url, key, value): scheme, netloc, path, query, fragment = urlsplit(url) query = parse_qs(query) if value is...
from PyQt5 import QtCore, QtGui, QtWidgets class Ui_TagsCompatibilityOptionsPage(object): def setupUi(self, TagsCompatibilityOptionsPage): TagsCompatibilityOptionsPage.setObjectName("TagsCompatibilityOptionsPage") TagsCompatibilityOptionsPage.resize(539, 705) self.vboxlayout = QtWidgets.QVBo...
""" Utilities useful to client control files that test KVM. """ from autotest.client import utils from autotest.client.shared import error def get_kvm_arch(): """ Determines the kvm architecture kernel module that should be loaded. @return: "kvm_amd", "kvm_intel", or raise TestError exception """ ar...
import socket, thread, sys, signal, getpass import proxy_client, www_client, monitor_upstream, ntlm_procs class AuthProxyServer: #-------------------------------------------------------------- def __init__(self, config): self.config = config self.MyHost = '' self.ListenPort = self.config...
"""Reporting of anonymized CourseBuilder usage statistics: welcome page.""" __author__ = [ 'Michael Gainer (mgainer@google.com)', ] import jinja2 from common import jinja_utils from modules.admin import admin from modules.usage_reporting import config from modules.usage_reporting import messaging from modules.usage...
"""Real-time atomspheric shader Utilizes the shader noise functions requires pyglet 1.1+ and ctypes """ import os import math import pyglet from pyglet.gl import * import ctypes from noise.shader_noise import ShaderNoiseTexture, shader_noise_glsl from noise import shader vert_shader = shader.VertexShader('vertex', ''' ...
from mitmproxy.models import decoded from plugins.extension.plugin import PluginTemplate """ Description: This program is a core for wifi-pumpkin.py. file which includes functionality plugins for Pumpkin-Proxy. Copyright: Copyright (C) 2015-2016 Marcos Nesster P0cl4bs Team This program is free software:...
from ilastik.plugins import ObjectFeaturesPlugin import ilastik.applets.objectExtraction.opObjectExtraction import vigra import numpy as np from lazyflow.request import Request, RequestPool import logging logger = logging.getLogger(__name__) def cleanup_value(val, nObjects): """ensure that the value is a numpy arra...
DOCUMENTATION = """ --- module: vyos_config version_added: "2.2" author: "Peter Sprygada (@privateip)" short_description: Manage VyOS configuration on remote device description: - This module provides configuration file management of VyOS devices. It provides arguments for managing both the configuration fil...
from . import utils from . import destructors libczmq_destructors = destructors.lib class Zcertstore(object): """ work with CURVE security certificate stores """ def __init__(self, location): """ Create a new certificate store from a disk directory, loading and indexing all certi...
from spack import * class PyYt(PythonPackage): """Volumetric Data Analysis yt is a python package for analyzing and visualizing volumetric, multi-resolution data from astrophysical simulations, radio telescopes, and a burgeoning interdisciplinary community. """ homepage = "https:...
from __future__ import print_function import argparse import copy import datetime import getpass import locale import os import sys import time from novaclient import exceptions from novaclient.openstack.common import strutils from novaclient.openstack.common import timeutils from novaclient.openstack.common import uui...
__author__ = 'Brian Wickman' from .scanf import ScanfParser, ScanfResult def basic_scanf(fmt_string, value_string): """ Given format string, parse value string and return list of extracted variables. Does not support named variables. See ScanfParser class for variable description. """ so = ScanfParse...
import os import StringIO from oslo.config import cfg from nova.virt.libvirt import utils as libvirt_utils CONF = cfg.CONF CONF.import_opt('instances_path', 'nova.compute.manager') files = {'console.log': True} disk_sizes = {} disk_backing_files = {} disk_type = "qcow2" def get_iscsi_initiator(): return "fake.initi...
from CTFd.models import Users from CTFd.utils import set_config from tests.helpers import ( create_ctfd, destroy_ctfd, login_as_user, register_user, simulate_user_activity, ) def test_api_user_place_hidden_if_scores_hidden(): """/api/v1/users/me should not reveal user place if scores aren't visi...
"""Keras data preprocessing utils for image data.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.keras._impl.keras.preprocessing.image import apply_transform from tensorflow.python.keras._impl.keras.preprocessing.image import array_...
"""The sms component.""" import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_DEVICE from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from .const import DOMAIN, SMS_GATEWAY from .gateway im...
def child1_name(): return __name__
"""Tests for tensorflow.ops.check_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import numpy as np from tensorflow.core.protobuf import config_pb2 from tensorflow.core.protobuf import rewriter_config_pb2 from tensorflow.python.client imp...
from keystone.common import logging from keystone import auth from keystone import exception from keystone import identity METHOD_NAME = 'password' LOG = logging.getLogger(__name__) class UserAuthInfo(object): def __init__(self, context, auth_payload): self.identity_api = identity.Manager() self.con...
"""Web socket API for Zigbee Home Automation devices.""" import asyncio import collections from collections.abc import Mapping import logging from typing import Any import voluptuous as vol from zigpy.types.named import EUI64 import zigpy.zdo.types as zdo_types from homeassistant.components import websocket_api from ho...
import os import unittest from swift_build_support.which import which class WhichTestCase(unittest.TestCase): def test_when_cmd_not_found_returns_none(self): self.assertIsNone(which('a-tool-that-doesnt-exist')) def test_when_cmd_found_returns_path(self): self.assertEquals(os.path.split(which('ls...
"""The tests for the Geofency device tracker platform.""" from unittest.mock import patch, Mock import pytest from homeassistant import data_entry_flow from homeassistant.components import zone from homeassistant.components.geofency import CONF_MOBILE_BEACONS, DOMAIN from homeassistant.const import ( HTTP_OK, H...
import angr from angr.sim_type import SimTypeString, SimTypeInt, SimTypeFd class open(angr.SimProcedure): #pylint:disable=W0622 #pylint:disable=arguments-differ def run(self, p_addr, flags): self.argument_types = {0: self.ty_ptr(SimTypeString()), 1: SimTypeInt(32, True)} ...
import os import unittest from indra.preassembler import Preassembler, render_stmt_graph, \ flatten_evidence, flatten_stmts from indra.sources import reach from indra.statements import * from indra.ontology.bio import bio_ontology try: from indra_world.ontology import load_world_ontology world_ontology = lo...
"""HTML character entity references.""" name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin capital letter A with circumflex, U+00C2 ISOlat1 'Agrav...