gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- # # ExTASY-0.2 documentation build configuration file, created by # sphinx-quickstart on Tue Jun 16 13:24:49 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
# # Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. # import argparse, os, ConfigParser, sys, re from pysandesh.sandesh_base import * from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from device_config import DeviceConfig import discoveryclient.client as client from sandesh_common.vns.ttypes impo...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2015 Rafael Santos (rstogo@outlook.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including wit...
# (C) 2020 Philippe PRADOS # -*- coding: utf-8 -*- # vim: set ts=4 sts=4 et tw=78 sw=4 si: import datetime import gc from datetime import time, date, datetime from iso8601 import iso8601 from hszinc import Grid, Uri, Ref, Coordinate, MARKER, XStr from hszinc.filter_ast import FilterUnary, FilterBinary, FilterPath, Fi...
#!/usr/bin/env python3 # Copyright 2019 IBM Corp. # # 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 requir...
# coding: utf-8 """ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from datetime import datetime from pprint import pformat from six import iterit...
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Create your views here. from django.contrib.auth.models import User from core.models import Device from django.contrib.auth import authenticate, logout, login from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from registration impo...
from itertools import chain from typing import Union, Optional, Tuple from hwt.doc_markers import internal from hwt.hdl.operatorDefs import OpDefinition from hwt.hdl.types.array import HArray from hwt.hdl.types.defs import BIT from hwt.hdl.types.hdlType import HdlType from hwt.hdl.types.struct import HStruct from hwt....
# Copyright 2020 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 interacting with the Skia Gold image diffing service.""" import logging import os import shutil import sys import tempfile import time CHROMIUM...
""" Support for Z-Wave. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zwave/ """ import logging import os.path import time from pprint import pprint import voluptuous as vol from homeassistant.helpers import discovery from homeassistant.const import ...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python3 """Topology components for FAUCET Mininet unit tests.""" from collections import namedtuple import os import socket import string import shutil import subprocess import time import netifaces # pylint: disable=too-many-arguments from mininet.log import output, warn from mininet.topo import Top...
''' Tests for fileinput module. Nick Mathewson ''' import io import os import sys import re import fileinput import collections import builtins import tempfile import unittest try: import bz2 except ImportError: bz2 = None try: import gzip except ImportError: gzip = None from io import BytesIO, String...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# 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 t...
from base import AbstractGateway, GatewayRequest, GatewayResponse import urllib from quix.pay.transaction import CreditCard class AimGateway(AbstractGateway): """ Interface to the Authorize.Net Advanced Integration Method (AIM) payment gateway. The authentication login and password corresponds t...
# Authors: # # Giorgio Patrini # # License: BSD 3 clause import warnings import numpy as np import numpy.linalg as la from scipy import sparse from distutils.version import LooseVersion from sklearn.utils import gen_batches from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing im...
# python3 # Copyright 2018 DeepMind Technologies Limited. 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 re...
# Copyright 2014 Cloudera 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...
# 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...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division import numpy as np import copy import inspect import types as python_types import warnings from .. import backend as K from .. import activations, initializations, regularizers, constraints from ..engine import InputSpec, ...
import logging import os import time from abc import ABC, abstractmethod from typing import Dict, List, Optional, Tuple, Type import redis from django.conf import settings from django.http import HttpRequest from zerver.lib.exceptions import RateLimited from zerver.lib.redis_utils import get_redis_client from zerver....
# refs.py -- For dealing with git refs # Copyright (C) 2008-2013 Jelmer Vernooij <jelmer@samba.org> # # This program 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; version 2 # of the License or (at your optio...
""" Composer Integration for Sublime Text 2 @author Nuno Franco da Costa <nuno@francodacosta.com> @license BSD - see LICENSE.md @link git@github.com:francodacosta/composer-sublime.git """ try: import sublime import sublime_plugin import functools import os import subprocess ...
# 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 # d...
from django import template from django.core.cache import cache from django.http import HttpRequest from django.test import TestCase from django.urls.exceptions import NoReverseMatch from django.utils.safestring import SafeString from wagtail.core.models import Page, Site from wagtail.core.templatetags.wagtailcore_tag...
import sys import threading import numpy as np from numpy import array, finfo, arange, eye, all, unique, ones, dot import numpy.random as random from numpy.testing import ( assert_array_almost_equal, assert_almost_equal, assert_equal, assert_array_equal, assert_, assert_allclose, assert_warns, ...
"""Support for Xiaomi Mi Air Quality Monitor (PM2.5).""" import logging from miio import AirQualityMonitor, Device, DeviceException import voluptuous as vol from homeassistant.components.air_quality import PLATFORM_SCHEMA, AirQualityEntity from homeassistant.const import CONF_HOST, CONF_NAME, CONF_TOKEN from homeassi...
# coding=utf-8 import logging import random import string import sys import unittest from time import time, sleep import apiritif import traceback import os import re from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver.common.by impor...
import argparse import os import pdb import subprocess import sys import warnings import taichi as ti def _test_cpp(): ti.reset() print("Running C++ tests...") ti_lib_dir = os.path.join(ti.__path__[0], '_lib', 'runtime') cpp_test_filename = 'taichi_cpp_tests' curr_dir = os.path.dirname(os.path.a...
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
#!/usr/bin/env python """ Setuptools bootstrapping installer. Maintained at https://github.com/pypa/setuptools/tree/bootstrap. Run this script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap imp...
# # Copyright (c) 2019, The OpenThread Authors. # 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 ...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import random import pytest from asv.step_detect import (solve_potts, solve_potts_autogamma, solve_potts_approx, ...
from django import http from django.conf.urls import include, patterns, url from django.core.urlresolvers import reverse from rest_framework.routers import SimpleRouter import mkt from lib.misc.urlconf_decorator import decorate from mkt.api.base import SubRouter from mkt.developers.api_payments import ( AddonPaym...
# -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
#!/usr/bin/env python # Copyright 2016 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...
#!/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 "Lic...
""" ODT2TXT ======= ODT2TXT convers files in Open Document Text format (ODT) into Markdown-formatted plain text. Writteby by [Yuri Takhteyev](http://www.freewisdom.org). Project website: http://www.freewisdom.org/projects/python-markdown/odt2txt.php Contact: yuri [at] freewisdom.org License: GPL 2 (http://www.gnu.o...
# Copyright 2015 Metaswitch Networks # # 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 w...
# Copyright 2012-2016 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 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...
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2014 Sean Vig # Copyright (c) 2014-2015 Tycho Andersen # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Soft...
# This module defines classes that represent coordinate translations, # rotations, and combinations of translation and rotation. # # Written by: Konrad Hinsen <hinsen@llb.saclay.cea.fr> # Contributions from Pierre Legrand <pierre.legrand@synchrotron-soleil.fr> # Last revision: 2004-10-19 # import TensorModule, Vector...
# # README: please install the library before use # : Require Libraries: # MQTT https://pypi.python.org/pypi/paho-mqtt # matplotlib http://matplotlib.org/ # It's easiler if you just install http://continuum.io/ # simplekml http://simplekml.readth...
# Copyright 2014-2017 Canonical Limited. # # This file is part of charms.reactive. # # charms.reactive is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 as # published by the Free Software Foundation. # # charm-helpers is distributed in the h...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 t...
""" Feedforward processing objects. Similar to MLP layers, but specialized for operation on design matrices rather than generic Spaces, and without a concept of parameters. """ # Standard library imports from __future__ import print_function import warnings # Third-party imports import theano from theano import tenso...
# PyVision License # # Copyright (c) 2006-2008 David S. Bolme # 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, thi...
description="""a module to compute "greedy" confidence intervals for several distributions""" #=================================================================================================== import numpy as np #=================================================================================================== # ...
from mock import MagicMock, patch import numpy as np from .. import DataCollection, Data, SubsetGroup from .. import subset from ..subset import SubsetState from ..subset_group import coerce_subset_groups from .test_state import clone class TestSubsetGroup(object): def setup_method(self, method): x = Da...
import json import pytz import redis from itertools import groupby from django.contrib import messages from django.conf import settings from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse from django.shortcuts import redirect from django.utils import timezone from django.utils.si...
# orm/dynamic.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Dynamic collection API. Dynamic collections act like Query() objects for read opera...
# Copyright 2016-2017 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 ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# I use the print function in this code, even though I don't in the book text, # so that you can run it as a regular script and still get the output. You only # get output without using print if you're using the interactive window. # Set this variable to your osgeopy-data directory so that the following # examples wi...
import re from typing import Optional import warnings import numpy as np from pandas.errors import AbstractMethodError from pandas.util._decorators import cache_readonly from pandas.core.dtypes.common import ( is_float, is_hashable, is_integer, is_iterator, is_list_like, is_number, ) from pan...
#!/usr/bin/env python """ Lasagne implementation of CIFAR-10 examples from "Deep Residual Learning for Image Recognition" (http://arxiv.org/abs/1512.03385) Check the accompanying files for pretrained models. The 32-layer network (n=5), achieves a validation error of 7.42%, while the 56-layer network (n=9) achieves e...
import textwrap from .bash import CommandBlock def begin(): script = CommandBlock() script += '#!/bin/bash' script += 'umask 0000' # as the script will be run as root, this ensures that after you can play around as normal user ;) script += '' return script def counter_increment(**settings): ...
import os from subprocess import call import unittest import semvertag DEVNULL = open(os.devnull, 'wb') class BaseSemVerTagTest(unittest.TestCase): def setUp(self): call("rm -Rf tmp".split()) call("mkdir -p tmp/repo-origin".split()) call("ls", cwd="tmp", stdout=D...
import numpy as np # Matrix and vector computation package import matplotlib.pyplot as plt # Plotting library # np.random.seed(1) from sklearn import datasets, cross_validation, metrics # data and evaluation utils from matplotlib.colors import colorConverter, ListedColormap # some plotting functions import itertools i...
#------------------------------------------------------------------------- # The Azure Batch Apps Python Client # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated docu...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_almost_equal, assert_equal, assert_, assert_allclose, assert_array_equal) from pytest import raises as assert_raises import scipy.signal.waveforms as waveforms # These chi...
#!/usr/bin/env python2 import uuid import os.path import bz2 import glob import logging import datetime import json import re import itertools # import peewee from peewee import * from playhouse.db_url import connect as db_url_connect from tqdm import tqdm # logging.basicConfig(level=logging.DEBUG) logger = logging....
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import unittest import thread import time import BaseHTTPServer from tempfile import mkdtemp import shutil from rdflib.term import URIRef from rdflib.namespace import RDF from rdflib.graph import Graph from rdflib.py3compat import b import rdflib.plugin class GraphTestCase(unittest.TestCase): store_name = 'defa...
# Copyright 2015 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...
#!/usr/local/lib/mailinabox/env/bin/python # Utilities for installing and selecting SSL certificates. import os, os.path, re, shutil, subprocess, tempfile from utils import shell, safe_domain_name, sort_domains import idna # SELECTING SSL CERTIFICATES FOR USE IN WEB def get_ssl_certificates(env): # Scan all of the...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and / or modify # it under the ter...
__author__ = 'greghines' from copy import deepcopy import numpy as np class BaseUserNode: def __init__(self,classList=None): #self.name = name self.subjectsViewed = [] self.classifications = [] if classList == None: self.numClasses = None self.confusion_matr...
""" Street Pong Build 18 2015 Leanna Pancoast, Spencer Barton, Justin Frye Pong Game View """ #===================================================== # Imports #===================================================== import time import pygame as pg import sys, argparse import Pong.PongGameModel as Model import Pong.Pon...
# Copyright 2018 www.privaz.io Valletech AB # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems # # 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/LI...
#!/usr/bin/env python # Copyright 2014 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. # Modified from go/bootstrap.py in Chromium infrastructure's repository to patch # out everything but the core toolchain. # # https://c...
#!/usr/bin/python # Copyright (c) 2009, Purdue University # 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 ...
from __future__ import unicode_literals import json import warnings from django import forms from django.conf import settings from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field, ) from django.core.exceptions import ObjectDoesNotExi...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright 2019 Fortinet, Inc. # # This program 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. # # This program is distributed in the...
# encoding: utf-8 __author__ = "Nils Tobias Schmidt" __email__ = "schmidt89 at informatik.uni-marburg.de" ''' Utility functions for mongodb. ''' from androlyze.log.Log import log from androlyze.model.script.ScriptUtil import dict2json from androlyze.storage import Util from gridfs.grid_file import GridOutCursor fro...
# 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
from django.views.generic.base import TemplateView from django.views.generic.edit import CreateView, FormView from KPS_app import models from datetime import datetime from KPS_app.forms import CityForm, CompanyForm, MailDeliveryForm,\ TransportDiscontinueForm from django.http.response import HttpResponseRedirect fr...
import warnings import os import nibabel as nb import numpy as np from ...utils.misc import package_check have_nipy = True try: package_check('nipy') except Exception, e: have_nipy = False else: import nipy.modalities.fmri.design_matrix as dm import nipy.labs.glm.glm as GLM if have_nipy: try: ...
#!/usr/bin/python import os from urlparse import urlparse import csv import pickle from collections import Counter class Reviewer: def __init__(self, first, last, email, url): self.first = first self.last = last self.email = email self.url = url self.num_words = 0 s...
# Copyright 2021 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 sys, cv2, bisect import numpy as np from datetime import datetime #=============================================================================== class Graph(): def __init__(self, img=None): self.V = 0 self.N = 0 self.seed = None self.node = {} self.img = img ...
# Copyright 2016 MongoDB, 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...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from gpu_tests import test_expectations from telemetry.page import page as page_module from telemetry.story import story_set class StubPlat...
# Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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 # ...
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright (C) 2013 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 the ...
#!/usr/bin/env python # # Copyright 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. """This is the test suite for a vtgate_client implementation. """ import struct from google.protobuf import text_format from vtdb import dbex...
# 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...
#!/usr/bin/python3 """Module / command line tool to handle the naming of OTRKEYs and AVIs""" import re import os import sys import logging from argparse import ArgumentParser logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) if sys.version_info.major < 3: def str(s): if isins...
# # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicen...
""" Simple utilities for sending messages via Vumi Go' HTTP API. """ import json import logging import pprint import uuid import requests from requests.exceptions import HTTPError from go_http.exceptions import UserOptedOutException class HttpApiSender(object): """ A helper for sending text messages and fi...
# # 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...
import uuid import traceback import os from copy import copy, deepcopy import datetime import appdaemon.utils as utils from appdaemon.appdaemon import AppDaemon class State: def __init__(self, ad: AppDaemon): self.AD = ad self.state = {"default": {}, "admin": {}, "rules": {}} self.logge...
""" Baseline methods for computing solutions that are guaranteed to (likely!) improve on a provided baseline policy. """ import raam from raam import robust from raam import crobust from raam import features from raam import examples import numpy as np debugoutput = True def solve_expectation(samples, discount, decs...