gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena # License: BSD 3 clause import numpy as np from .base import SelectorMixin from ..base import TransformerMixin, BaseEstimator, clone from ..externals import six from ..utils import safe_mask, check_array, deprecated from ..utils.validation import chec...
import lasagne import lasagne.layers import theano import theano.tensor as T import numpy as np import params class DCNNLayer(lasagne.layers.MergeLayer): """A node-level DCNN layer. This class contains the (symbolic) Lasagne internals for a node-level DCNN layer. This class should be used in conjunctio...
""" sphinx.locale ~~~~~~~~~~~~~ Locale utilities. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import gettext import locale import warnings from collections import UserString, defaultdict from gettext import NullTranslations from sp...
#!/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 "License")...
""" pghoard - compressor threads Copyright (c) 2016 Ohmu Ltd See LICENSE for details """ from io import BytesIO from pghoard import config, wal from pghoard.common import write_json_file from pghoard.rohmu import rohmufile from queue import Empty from tempfile import NamedTemporaryFile from threading import Thread imp...
# -*- coding: utf-8 -*- # -*- test-case-name: go.api.go_api.tests.test_go_api -*- """JSON RPC API for Vumi Go front-end and others.""" import itertools from twisted.application.internet import StreamServerEndpointService from twisted.internet.defer import inlineCallbacks, DeferredList from txjsonrpc.jsonrpc import ...
""" Support for Z-Wave climate devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.zwave/ """ # Because we do not compile openzwave on CI # pylint: disable=import-error import logging from homeassistant.components.climate import DOMAIN from h...
import evdev import re import rospy import threading from .constants import MIRROR_ACTIVITY_TYPE from .constants import MIRROR_TOUCH_CONFIG_KEY from lg_common.helpers import route_touch_to_viewports from lg_common.managed_window import ManagedWindow from lg_msg_defs.msg import RoutedEvdevEvents from lg_msg_defs.srv im...
has_gevent = True use_gevent = False try: import gevent def enable_gevent(): global use_gevent use_gevent = True def _disable_gevent(): # for testing global use_gevent use_gevent = False def is_gevent_enabled(): global use_gevent return use_gevent exce...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, ) from osf.utils import permissions @pytest.fixture() def user(): return AuthUserFactory() @pytest.mark.django_db @pytest.mark.enable_quickfiles_creat...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # # 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/LICEN...
# 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...
# coding=utf-8 """ oauthlib.oauth2.rfc6749.errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error used both by OAuth 2 clients and providers to represent the spec defined error responses for all four core grant types. """ from __future__ import unicode_literals import json from oauthlib.common import add_params_to_uri, urlenc...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/figures.py """This includes some demos of platypus for use in the API proposal""" __version__=''' $Id: figures.py 3959 2012-09-27 14:39:39Z ro...
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn import datasets from sklearn.covariance import empirical_covariance, EmpiricalCovariance, \ ...
# Copyright (c) 2012 NetApp, Inc. All rights reserved. # Copyright (c) 2014 Navneet Singh. All rights reserved. # Copyright (c) 2014 Bob Callaway. 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 ...
from collections import defaultdict import json import logging import os.path from heathskin import utils CARD_DATABASE_JSON_PATH = "data/AllSets.json" logger = logging.getLogger() class CardDatabase(object): _db_cache = {} @classmethod def get_database(cls, db_path=CARD_DATABASE_JSON_PATH): i...
# 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...
#!/usr/bin/python # (C) 2014 Chip Black # Available under the MIT License; see the LICENSE file import curses import yaml import time import os, sys f = open('dino-jack.yml') script = yaml.load(f) f.close() class Player: def __init__(self, name): self.name = name self.score = 0 def display_video(...
"""Support for HomematicIP Cloud devices.""" import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_NAME from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as...
#! /usr/bin/python2 # # Copyright 2016 the V8 project 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 argparse import collections import re import subprocess import sys __DESCRIPTION = """ Processes a perf.data sample file a...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
# # ChainDb.py - Bitcoin blockchain database # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import string import cStringIO import leveldb import io import os import time from decimal import Decimal from Cache import Cach...
from __future__ import unicode_literals from django.db import models from .base import CalAccessBaseModel class CvrRegistrationCd(CalAccessBaseModel): """ Cover page information for the lobbying registration forms below. F601 -- Lobbying Firm Registration Statement F602 -- Lobbying Firm Activ...
''' module containing constants used by qc reporting tools ''' from formatting_templates import ( RNA_MAPPING_FORMATTING, RNA_REPLICATION_FORMATTING ) # GENERIC LIMIT_ALL_JSON = '&limit=all&format=json' REPORT_TYPES = [ 'histone_qc', 'histone_mapping', 'tf_mapping', 'tf_qc', 'rna_mapping...
# -*- coding: utf-8 -*- ''' SPACK package manager ''' from __future__ import absolute_import # Import python libs import copy import logging # Import salt libs import salt.utils from salt.exceptions import CommandExecutionError, MinionError log = logging.getLogger(__name__) def spack_directory(): """ Specializ...
# File: CeConfigs.py ; This file is part of Twister. # version: 3.003 # Copyright (C) 2012-2014 , Luxoft # Authors: # Andrei Costachi <acostachi@luxoft.com> # Cristi Constantin <crconstantin@luxoft.com> # Mihai Dobre <mihdobre@luxoft.com> # Licensed under the Apache License, Version 2.0 (the "License"); #...
# -*- coding: utf-8 -*- # 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 l...
import os import tempfile import shutil from datetime import date from django.contrib.auth.models import Group from django.test import TestCase from django.core.exceptions import PermissionDenied from django.core.files.uploadedfile import UploadedFile from hs_core import hydroshare from hs_core.models import GenericR...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cherrypy import htpc import urllib2 import base64 from json import loads, dumps import logging from cherrypy.lib.auth2 import require from htpc.helpers import fix_basepath, striphttp class Transmission(object): # Transmission Session ID sessionId = '' ...
""" Primitive image processing functions for the hugs pipeline. """ from __future__ import division, print_function import os import numpy as np import lsst.afw.detection as afwDet from .utils import pixscale from . import utils from . import sextractor from .morphology import Morphology import sep from scipy import ...
# -*- coding: utf-8 -*- """ tipfy.sessions ============== Lightweight sessions support for tipfy. Includes sessions using secure cookies and supports flash messages. For App Engine's datastore and memcache based sessions, see tipfy.appengine.sessions. :copyright: 2011 by tipfy.org. :licens...
# Copyright (c) 2010-2012 OpenStack, 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 ...
#!/usr/bin/env python """ Generic python script. """ __author__ = "Alex Drlica-Wagner" import numpy as np import pylab as plt import datetime as dt import dateutil.parser from dateutil.parser import parse as dparse import fitsio import scipy.stats from collections import OrderedDict as odict import obztak.delve from o...
from rest_framework.serializers import ( CharField, ModelSerializer, SerializerMethodField, SlugField, ) from forum.models import( Category, ForumSettings, SubForum, Thread, ) from posts.api.serializers import PostListSerializer from posts.models import Post class ThreadCreateSeriali...
####################################################### # Copyright (c) 2015, ArrayFire # All rights reserved. # # This file is distributed under 3-clause BSD license. # The complete license agreement can be obtained at: # http://arrayfire.com/licenses/BSD-3-Clause ######################################################...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from caffe2.proto import caffe2_pb2 import caffe2.python.optimizer as optimizer from caffe2.python.optimizer import ( build_sgd, build_multi_precision_sgd, build_ftrl, build_gftrl, build_wngrad, build_ad...
from datetime import date from django import template from django.conf import settings from django.utils import translation from demo.models import PersonPage, BlogPage, EventPage, CoursePage, \ Advert, Page, StandardPage, StandardIndexPage, FormPage register = template.Library() # settings value @register.assi...
""" The IRAF plugin implements a remote control interface for the Ginga FITS viewer from an IRAF session. In particular it supports the use of the IRAF 'display' and 'imexamine' commands. Instructions for use: Set the environment variable IMTDEV appropriately, e.g. $ export IMTDEV=inet:45005 (or) $ ...
# coding: utf-8 # from unittest import TestCase from mock import patch, MagicMock from django.test import TestCase from django.conf import settings from django.template import Template, Context from lxml import html as lhtml from _mysql_exceptions import OperationalError from physical.models import Instance from physi...
''' This module sets up a scheme for validating that arbitrary Python objects are correctly typed. It is totally decoupled from Django, composable, easily wrapped, and easily extended. A validator takes two parameters--var_name and val--and returns an error if val is not the correct type. The var_name parameter is u...
import test_helper import unittest import json from etvnet_service import EtvnetService from config import Config class EtvnetServiceTest(unittest.TestCase): def setUp(self): config = Config("../etvnet.config") self.service = EtvnetService(config) def test_channels(self): result = s...
import spotipy import os import spotipy.util as util from http.server import HTTPServer, BaseHTTPRequestHandler from threading import Thread from random import shuffle import requests # os.environ["SPOTIPY_CLIENT_ID"] = "" # os.environ["SPOTIPY_CLIENT_SECRET"] = "" # os.environ["USER"] = "" # os.environ["PLAYLISTS"] =...
# 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 (c) 2011-2013, Image Engine Design Inc. All rights reserved. # Copyright (c) 2011-2012, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
#!/usr/bin/env python import sys import optparse import logging from glue import __version__ def parse(argv): """ Parse argument list, check validity :param argv: Arguments passed to program *Returns* A tuple of options, position arguments """ usage = """usage: %prog [options] [FILE FILE......
#!/usr/bin/env python3 from cereal import car from panda import Panda from common.params import Params from selfdrive.config import Conversions as CV from selfdrive.car.hyundai.values import CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, Buttons, CarControllerParams from selfdrive.car.hyundai.radar_interface import R...
# -*- coding: utf-8 -*- """ pygments.lexers.math ~~~~~~~~~~~~~~~~~~~~ Lexers for math languages. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, include, \ combine...
import math import constants class Simulator(object): def __init__ (self): self.bemfa = 0.0 self.bemfb = 0.0 self.va = 0.0 self.vb = 0.0 self.kp = constants.KP_EST_RPM self.ki = constants.KI_EST_RPM self.ls = 0.035 self.rs = 1.05 self.esta = ...
import msgpack import json import pickle import os.path from Queue import PriorityQueue import re import doench_score import azimuth.model_comparison import numpy as np import pandas as pd import csv from intervaltree import IntervalTree from multiprocessing import Process import os import time start_time = time.time(...
import datetime import json import logging from decimal import * # App Engine platform from google.appengine.api import mail, memcache, datastore_errors, taskqueue from google.appengine.ext import ndb, blobstore, deferred # Search from google.appengine.api import search import GlobalUtilities as tools _CONTACT_SEAR...
""" Python driver for python kernels Calls the kernel with a vector of $q$ values for a single parameter set. Polydispersity is supported by looping over different parameter sets and summing the results. The interface to :class:`PyModel` matches those for :class:`.kernelcl.GpuModel` and :class:`.kerneldll.DllModel`. ...
#!/usr/bin/env python3 from __future__ import print_function from collections import defaultdict from os import listdir from os.path import abspath, basename, dirname, isdir, isfile, join, realpath, relpath, splitext import re from subprocess import Popen, PIPE import sys # Runs the tests. REPO_DIR = dirname(dirname...
"""Utilities shared by tests.""" import asyncio import contextlib import gc import inspect import ipaddress import os import socket import sys from abc import ABC, abstractmethod from types import TracebackType from typing import ( TYPE_CHECKING, Any, Callable, Iterator, List, Optional, Typ...
#!/usr/bin/env python3 # # Copyright (c) 2016 Roberto Riggio # # 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 applicabl...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
import datetime import mock from django.contrib.auth import get_user_model from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from gcm.gcm import GCMNotRegisteredException from pushy.models import ( PushNotification, Device, get_filtered_dev...
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
import time import eventlet import subprocess from oslo.config import cfg from oslo.utils import units from nova import exception from nova.compute import power_state from nova.openstack.common import log as logging from nova.virt.jacket.vcloud import constants from nova.virt.jacket.vcloud.vcloud import exceptions fro...
"""The main model for all the views in pdsspect""" import os import warnings import numpy as np from astropy import units as astro_units from ginga.util.dp import masktorgb from planetaryimage import PDS3Image from ginga.BaseImage import BaseImage from ginga import colors as ginga_colors from ginga.canvas.types.image ...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
from __future__ import unicode_literals import base64 import boto import boto3 import sure # noqa from boto.exception import BotoServerError from botocore.exceptions import ClientError from moto import mock_iam, mock_iam_deprecated from moto.iam.models import aws_managed_policies from nose.tools import assert_raises,...
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2006, Frank Scholz <coherence@beebits.net> import os from twisted.internet import reactor from twisted.python import filepath, util from nevow import athena, inevow, loaders, tags, static from twisted.web import server, res...
import unittest from unittest.mock import Mock, PropertyMock, patch from Firefly.const import EVENT_ACTION_ANY, EVENT_ACTION_ON, EVENT_TYPE_BROADCAST, STATE from Firefly.helpers.automation import Automation from Firefly.helpers.events import Event # TODO(zpriddy): These should be in const file LABEL_TRIGGERS = 'trigg...
import re from collections import namedtuple from django.utils.translation import ugettext_lazy as _ # Add-on and File statuses. STATUS_NULL = 0 # No review type chosen yet, add-on is incomplete. STATUS_AWAITING_REVIEW = 1 # File waiting for review. STATUS_PENDING = 2 # Personas (lightweight themes) waiting for r...
# Copyright 2015 IBM Corp. # Copyright 2017 AT&T Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
"""Helper classes for building queries. Helper classes and fucntions for building queries. """ import itertools import pprint import time class DBRow(object): """An object with an attr for every column returned by a query.""" def __init__(self, column_names=None, row_tuple=None, **overrides): """Init DBRow...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Licensed under 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack, LLC # Copyright 2013 Mirantis, 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 # ...
from __future__ import print_function import glob,sys,os from collections import Counter import math import itertools import numpy import dresher_LSA as d """This script is adapted from dresherClean_run in order to address fully iterated efficient trees. next tasks: verify that novel outputs of total trees are viab...
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP # # 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 limi...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # mlpy documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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 # autoge...
"""Tests for the Elgato Key Light config flow.""" import aiohttp from homeassistant import data_entry_flow from homeassistant.components.elgato import config_flow from homeassistant.components.elgato.const import CONF_SERIAL_NUMBER from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF from homeassistan...
# # randpool.py : Cryptographically strong random number generation # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # war...
# 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 2014 Huawei Technologies Co. Ltd # # 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...
""" Multiple choice ortho3d records """ import base64 from dlkit.abstract_osid.id.primitives import Id as ABCId from dlkit.abstract_osid.transport.objects import DataInputStream as ABCDataInputStream from dlkit.abstract_osid.osid.errors import InvalidArgument, IllegalState from dlkit.primordium.id.primitives import I...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, unicode_literals) """ ================= Metabolic Systems ================= :Authors: Moritz Emanuel Beber Nikolaus Sonnenschein :Date: 2011-04-07 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: ...
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. """A viewer for the timeline objects.""" import functools import urllib from grr.gui import renderers from grr.gui.plugins import fileview from grr.lib import aff4 from grr.lib import rdfvalue from grr.lib import utils class TimelineViewRendere...
""" test (de)armoring of PGP blocks """ import pytest import glob import os from datetime import datetime from pgpy.constants import HashAlgorithm from pgpy.constants import PubKeyAlgorithm from pgpy.constants import SignatureType from pgpy.pgp import PGPKey from pgpy.pgp import PGPMessage from pgpy.pgp import PGPSig...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# Copyright 2020 Google Research. 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...
""" This is a decoder of ABS-D date from Mode-S receiver. The inputs of most functions are the Hexdecial strings. Created by : Junzi Sun (TU Delft) Date : March 2015 """ import math MODES_CHECKSUM_TABLE = [ 0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178, 0x2c38...
import logging import socket from datetime import timedelta from django.conf import settings from django.contrib.auth import logout from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response fr...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import json import functools import itertools import resource import contextlib import time import sys import lupa from PyQt4.QtNetwork import QNetworkRequest from splash.browser_tab import JsError from splash.lua_runner import ( BaseS...
""" Base class for objects that live in both Python and JS. This basically implements the syncing of properties and events. Developer info: Events are transparently handled accross the language barrier. Both sides keep each-other informed for what events there are registered handlers, and only those events are "synch...
# # 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...
from subprocess import Popen, PIPE, STDOUT import subprocess import select import socket import os import ddapp from ddapp.simpletimer import SimpleTimer import numpy as np def startMatlab(): return subprocess.Popen(['matlab', '-nodisplay', '-nosplash'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=s...
############################################################################### ## fs.py ## 9te [angband.ornl.gov] ## Wed Jan 12 10:37:50 2011 ############################################################################### ## Copyright (C) 2008 Oak Ridge National Laboratory, UT-Battelle, 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, software # d...
import abc import logging import os import shutil from typing import Optional, Text, Tuple, TYPE_CHECKING import rasa.shared.utils.common import rasa.utils.common if TYPE_CHECKING: from azure.storage.blob import ContainerClient logger = logging.getLogger(__name__) def get_persistor(name: Text) -> Optional["Per...
# coding: utf-8 # python imports import re # django imports from django import template from django.contrib.contenttypes.models import ContentType from django.utils.formats import get_format from django.utils.safestring import mark_safe from django.db import models from django.contrib import admin from django.conf im...
#!/usr/bin/python -u # Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
import logging import json import requests import time from collections import namedtuple try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from .exceptions import ConnectionError, TimeoutError, PacketError from .transports import _get_response, _negotiate_transport, TRANSPORTS...
# Copyright 2021 The Kubeflow 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 applicable law or agreed to in...
"""Configuration management setup Some terminology: - name As written in config files. - value Value associated with a name - key Name combined with it's section (section.name) - variant A single word describing where the configuration key-value pair came from """ import locale import logging import os from ...
import unittest from libsaas import port from libsaas.services import stripe from libsaas.executors import test_executor from libsaas.services.base import MethodNotSupported class StripeTestCase(unittest.TestCase): def setUp(self): self.executor = test_executor.use() self.executor.set_response(b...
import unittest import StringIO import operator from packetsexample import PacketsExample from prers import TopN class TestTopN(unittest.TestCase): def reinit(self, n1=3, n2=3): self.__stringbuffer1 = StringIO.StringIO() self.__stringbuffer2 = StringIO.StringIO() self.__p1 = TopN(self.__...