gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" 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 ...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
from __future__ import absolute_import, division, print_function import abc import collections import inspect import pprint import re import struct import six # TODO: properly segregate the GSS in its own data structure # rewrite this with the faster GSS modifications. # SPPF # Replace copying of stream data wit...
""" Module containing weather data classes and data structures. """ import json import xml.etree.ElementTree as ET from pyowm.webapi25.xsd.xmlnsconfig import ( WEATHER_XMLNS_PREFIX, WEATHER_XMLNS_URL) from pyowm.utils import timeformatutils, temputils, xmlutils class Weather(object): """ A class encapsul...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of commands, run ``$ invoke --list``. """ import os import sys import code import json import platform import subprocess import logging from time import sleep import invoke from invoke import Collect...
#!/usr/bin/env python __author__ = 'Dave Foster <dfoster@asascience.com>' from pyon.util.unit_test import PyonTestCase from pyon.util.int_test import IonIntegrationTestCase from pyon.net.transport import NameTrio, BaseTransport, AMQPTransport, TransportError, TopicTrie, LocalRouter, ComposableTransport, LocalTranspo...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Vers...
# -*- coding: utf-8 -*- """ Human Resource Management """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) s3db.hrm_vars() # ============================================================================= def ...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import pytest from pants.core.util_rules import config_files, source_files from pants.core.util_rules.external_tool import rules as external_tool_rules...
''' Assign stellar mass/magnitude to subhalos via abundance matching. Masses in log {M_sun}, luminosities in log {L_sun / h^2}, distances in {Mpc comoving}. ''' # system ----- #from __future__ import division import numpy as np from numpy import log10, Inf from scipy import integrate, interpolate, ndimage # local ---...
"""ANTLR3 exception hierarchy""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # 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 c...
from setup.linux.installer import Installer from benchmark import framework_test import os import json import subprocess import time import textwrap import pprint import csv import sys import logging import socket import glob from multiprocessing import Process from datetime import datetime class Benchmarker: ####...
# 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...
from datetime import datetime from freezegun import freeze_time from .case import ModelTestCase class GroupTestCase(ModelTestCase): def test_by_name(self): from pyvac.models import Group grp = Group.by_name(self.session, u'admin') self.assertIsInstance(grp, Group) self.assertEqua...
''' 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 ...
"""Provide common Z-Wave JS fixtures.""" import asyncio import copy import io import json from unittest.mock import AsyncMock, patch import pytest from zwave_js_server.event import Event from zwave_js_server.model.driver import Driver from zwave_js_server.model.node import Node from zwave_js_server.version import Vers...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from django.forms import ModelForm from django import forms from crispy_forms import layout from crispy_forms.layout import Layout, HTML from hs_core.forms import BaseFormHelper, Helper from hs_core.hydroshare import users from hs_modelinstance.models import ModelOutput, ExecutedBy from hs_modflow_modelinstance.model...
from unittest import TestCase import scipy.stats import numpy as np import statsmodels.api as sm from numpy.testing import assert_allclose, assert_equal, assert_almost_equal from patsy import dmatrices # pylint: disable=E0611 from statsmodels.regression.quantile_regression import QuantReg from .results_quantile_regres...
"""Routines for running the scheduler in simulation mode.""" import os.path import configparser import logging import numpy as np import astropy.coordinates as coord from astropy.time import Time import astropy.units as u from .TelescopeStateMachine import TelescopeStateMachine from .Scheduler import Scheduler from .Q...
# Copyright 2014 Josh Pieper, jjp@pobox.com. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
#!/usr/local/nzbconfig/env/bin/python import os import tempfile import shutil import subprocess import pwd import configobj import ConfigParser from pyextdirect.configuration import create_configuration, expose, LOAD, SUBMIT Base = create_configuration() SABNZBD = 'sabnzbd' NZBGET = 'nzbget' UNDEFINED = 'nochange' ...
""" @package mi.instrument.sunburst.sami2_pco2.pco2a.driver @file marine-integrations/mi/instrument/sunburst/sami2_pco2/pco2a/driver.py @author Christopher Wingard & Kevin Stiemke @brief Driver for the Sunburst Sensors, SAMI2-PCO2 (PCO2W) Release notes: Sunburst Sensors SAMI2-PCO2 pCO2 underwater sensor. Derive...
import cgi import os from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import users from google.appengine.ext import db from google.appengine.ext.webapp import template from tvdb_api import tvdb_api from tvdb_api import tvdb_ui t = tvdb_api.T...
''' Created on 07/05/2013 @author: jruiperezv ''' from __future__ import division import webapp2 import logging from viewer_code.profileviewer_models import UserProfile from viewer_code.profileviewer_models import ViewerUser from viewer_code.profileviewer_models import ViewerVideo from viewer_code.profileviewer_models...
from storytext.javaswttoolkit import describer as swtdescriber from storytext import guishared, gridformatter import util # Some unused imports to make sure classloader loads necessary classes from org.eclipse.draw2d import FigureCanvas #@UnusedImport from org.eclipse.draw2d.geometry import Rectangle #@UnusedImport im...
""" Sphinx plugin to run example scripts and create a gallery page. Lightly modified from the mpld3 project. """ from __future__ import division import os import os.path as op import re import glob import token import tokenize import shutil import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt R...
"""The build utils in python. This module provides the functions to transform schedule to LoweredFunc and compiled Module. """ from __future__ import absolute_import as _abs import warnings import types from ._ffi.node import NodeBase, register_node from . import api from . import _api_internal from . import tensor f...
"""Access Muonlab II hardware. Contents -------- :class:`MuonlabII` Access Muonlab II hardware. """ from array import array import random import time from pysparc.ftdi_chip import FtdiChip from pysparc.util import map_setting DESCRIPTION = "USB <-> Serial" LIFETIME_SCALE = 6.25 COINCIDENCE_TIMEDELTA_SCALE =...
# Copyright (c) 2012 Citrix Systems, 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 ...
# # (c) PySimiam Team 2014 # # Contact person: Tim Fuchs <typograph@elec.ru> # # The Qt interface for PC-controlled real robots # import sys sys.path.insert(0, './scripts') from PyQt4 import QtGui, QtCore import os from qt_renderer import QtRenderer from qt_paramwindow import ParamDock, DockManager from qt_courseradoc...
# 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...
from __future__ import unicode_literals import fnmatch import glob import io import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.files.temp import NamedTemporaryFile from django.core.management.base import ...
import logging import copy from rest_framework.decorators import api_view from rest_framework.response import Response from django.utils.translation import ugettext_lazy as _ from biz.instance.models import Instance from biz.floating.models import Floating from biz.account.models import Operation from .models import ...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import json import os import sys from builtins import next, object, open, str from collec...
import os import sys import string import math import mahotas import PIL import PIL.Image import numpy as np import scipy import scipy.io import cv2 import h5py import lxml import lxml.etree import glob import sqlite3 import colorsys tile_num_pixels_y = 512 tile_num_pixels_x = 512 generate_mem...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
import numpy from reikna.helpers import template_from, min_blocks import reikna.cluda.functions as functions from reikna.core import Computation, Parameter, Annotation, Transformation # Output = Input * Parameter def tr_scale(arr, coeff_t): return Transformation( [Parameter('o1', Annotation(arr, 'o')), ...
# -*- coding: utf-8 -*- ''' Logstash Logging Handler ======================== .. versionadded:: 0.17.0 This module provides some `Logstash`_ logging handlers. UDP Logging Handler ------------------- For versions of `Logstash`_ before 1.2.0: In the salt configuration file: .. c...
# -*- coding: utf-8 -*- from django.contrib import messages from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse, reverse_lazy from django.utils import timezone from django.utils.translation import gettext as _ from django.views.generic.base import RedirectView from django.views...
import multiprocessing from collections import OrderedDict import numpy as np from robosuite.environments.manipulation.single_arm_env import SingleArmEnv from robosuite.models.arenas import WipeArena from robosuite.models.tasks import ManipulationTask from robosuite.utils.observables import Observable, sensor # Defa...
import sys import six from .core import _validate_bool from .number import _validate_int _undefined = object() def _try_contextualize_exception(context): """ Attempts to re-raise a `TypeError` or `ValueError` with a description of the context. If the original error does not match the expected for...
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
# # # File: io_controller_class.py # # # # # import struct import bitstruct import os import sys import time import select import socket import json import redis import datetime from psoc_4m_base_class import PSOC_BASE_4M class Moisture_Controller(): def __init__(self,new_instrument, slave_id, ip, p...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
""" Various math utilities """ import math import statistics from typing import Callable, List, Tuple from praatio.utilities import errors def numToStr(inputNum: float) -> str: if isclose(inputNum, int(inputNum)): retVal = "%d" % inputNum else: retVal = "%s" % repr(inputNum) return retVa...
# 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...
# 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ application.py ~~~~~~~~~~~ Application configuration :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ import os import logging from logging.handlers import SMTPHandler, RotatingFileHandler from flask import Fla...
# Coypright 2019 IBM. All Rights Reserved. # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
import logging letter_dict = { u'A': [ ':think1::iii::iii::think2:', ':iii::nothing::nothing::iii:', ':iii::iii::iii::iii:', ':iii::nothing::nothing::iii:', ':ink::nothing::nothing::ink:', ':nothing::nothing::nothing::nothing:', ':nothing::nothing::nothing::nothing:'], u'B': [ ':iii::iii::iii::think2...
#!/usr/bin/python # coding=utf-8 from testCase import TestCase from falcon import HTTP_200, HTTP_201, HTTP_400, HTTP_401 from catcher import models class Clubs(TestCase): def testPost1(self): '''new club''' body = { "caldId": None, "name": "Black Eagles", "city": "Br...
from __future__ import unicode_literals import errno import gobject import logging import re import socket import threading import pykka from mopidy.utils import encoding logger = logging.getLogger(__name__) class ShouldRetrySocketCall(Exception): """Indicate that attempted socket call should be retried""" ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
import uuid def test_if_ucr_app_can_be_deployed_with_image_whiteout(dcos_api_session): """Marathon app deployment integration test using the Mesos Containerizer. This test verifies that a marathon ucr app can execute a docker image with whiteout files. Whiteouts are files with a special meaning for t...
# -*- coding: utf-8 -*- """Test object privileges The majority of other tests exclude access privileges. These explicitly request it. In addition, the roles 'user1' and 'user2' are created if they don't exist. """ from pyrseas.testutils import DatabaseToMapTestCase from pyrseas.testutils import InputMapToSqlTestCas...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
#!/usr/bin/env python3 '''A utility to update LLVM IR CHECK lines in C/C++ FileCheck test files. Example RUN lines in .c/.cc test files: // RUN: %clang -emit-llvm -S %s -o - -O2 | FileCheck %s // RUN: %clangxx -emit-llvm -S %s -o - -O2 | FileCheck -check-prefix=CHECK-A %s Usage: % utils/update_cc_test_checks.py --l...
""" .. module: lemur.plugins.lemur_digicert.plugin :platform: Unix :synopsis: This module is responsible for communicating with the DigiCert ' Advanced API. :license: Apache, see LICENSE for more details. DigiCert CertCentral (v2 API) Documentation https://www.digicert.com/services/v2/documenta...
# -*- coding: utf-8 -*- from __future__ import print_function import os import subprocess import sys import time # Import parameters from the setup file. sys.path.append('.') from setup import ( setup_dict, get_project_files, print_success_message, print_failure_message, _lint, _test, _test_all, CODE_DIR...
from stack import ArrayStack class BSTNode(object): def __init__(self, key, left=None, right=None, parent=None): self.key = key self.left = left self.right = right self.parent = parent if self.left: self.left.parent = self if self.right: self....
# -*- coding: utf-8 -*- from django.forms import Media, TextInput, CharField, Form, MultiWidget from django.template import Template, Context from django.test import TestCase, override_settings @override_settings( STATIC_URL=None, MEDIA_URL='http://media.example.com/media/', ) class FormsMediaTestCase(TestCas...
#!/usr/bin/env python import json import tensorflow.contrib.slim as slim import datetime import random import time import string import argparse import os import threading import logging from scipy import misc import tensorflow as tf import numpy as np import tensorflow.contrib.rnn as rnn_cell from tensorflow.python.fr...
# -*- coding: utf-8 -*- """ Budgetting module @author: Fran Boon """ module = "budget" if deployment_settings.has_module(module): # Settings resource = "setting" tablename = "%s_%s" % (module, resource) table = db.define_table(tablename, Field("audit_read", "boolean"), ...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
# 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 os import sys import salt.defaults.exitcodes import salt.log import salt.utils.parsers import salt.utils.stringutils from salt.exceptions import ( AuthenticationError, AuthorizationError, EauthAuthenticationError, LoaderError, SaltClientError, SaltInvocationError, SaltSystemExit, ) f...
from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.views import shortcut from django.contrib.sites.shortcuts import get_current_site from django.http import HttpRequest, Http404 from django.test import TestCase, override_settings from dja...
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla.org/MPL/ # # Softwa...
""" Unit tests for reverse URL lookups. """ from __future__ import unicode_literals import unittest from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist from django.core.urlresolvers import (reverse, reverse_lazy, resolve, get_callable, get_resolver...
# Copyright 2014 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Class for bitcoind node under test""" import contextlib import decimal import errno from enum import E...
from toee import * from utilities import * from ed import * from batch import * ################################################################### ### (18:55 20/04/06) A script written by Glen Wheeler (Ugignadl) for manipulating ToEE files. ### Requested by Cerulean the Blue from Co8. ## ### (13:05 22/04/06)...
#encoding:utf-8 """ Functions relating to plotting Fields. Field objects contain more information than Numpy ndarrays. For instance, information about grids is stored alongside the actual data defined on that grid. This information can be used to automatically choose figure axes and labels etc. This is done in the pl...
"""Support for Netatmo Smart thermostats.""" import logging from typing import List, Optional import voluptuous as vol from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, DEFAULT_MIN_TEMP, HVAC_MODE_AUTO,...
import gc import numpy as np from pandas import ( DatetimeIndex, Float64Index, Index, IntervalIndex, MultiIndex, RangeIndex, Series, date_range, ) from .pandas_vb_common import tm class SetOperations: params = ( ["datetime", "date_string", "int", "strings"], ["i...
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import pytest import numpy.testing as npt try: import pandas.testing as pdt except ImportError: import pandas.util.testing as pdt try: import statsmodels.regression.linear_model as smlm _no_statsmodels = Fa...
import sys import re import FlatCAMApp import abc import collections from PyQt4 import QtCore from contextlib import contextmanager class TclCommand(object): # FlatCAMApp app = None # logger log = None # array of all command aliases, to be able use old names for backward compatibility (add_pol...
# Copyright (c) 2019, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from ..._deps import _HAS_SCIPY, _HAS_SKLEARN from ...models import MLModel as _MLModel import coremltoo...
from __future__ import absolute_import import os import sys import socket from datetime import timedelta from django.core.exceptions import ImproperlyConfigured from unipath import Path def get_env_variable(var_name): """Get the environment variable or return exception.""" try: return os.environ[var_...
# Copyright (c) 2013 Alan McIntyre import urllib import hashlib import hmac import warnings from datetime import datetime import common class TradeAccountInfo(object): '''An instance of this class will be returned by a successful call to TradeAPI.getInfo.''' def __init__(self, info): funds ...
import unittest from whoosh import analysis, fields, formats, index, qparser, query, searching, scoring from whoosh.filedb.filestore import RamStorage from whoosh.query import * from whoosh.searching import Searcher from whoosh.scoring import FieldSorter class TestSearching(unittest.TestCase): def make_index(self...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2022, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 import pandas as pd import numpy as np #from exatomic.exa.util.utility import mkp from exatomic.exa.util.units import Length, Energy, Mass from exatomic.core import Atom from exatomi...
# 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 The TensorFlow Probability Authors. # Copyright 2019 OpenAI (http://openai.com). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 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 applicab...
# -*- coding: utf-8 -*- # Copyright 2017 IBM 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 requ...
'''Driver for the TSL2561 digital luminosity (light) sensors. Pick one up at http://www.adafruit.com/products/439 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Code ported from Adafruit Arduino library, comm...
"""Tests for clif.pybind11.cindex.extractor.""" from absl.testing import absltest from clif.protos import ast_pb2 from clif.pybind11.cindex import extractor def gen_func_proto(name, return_type=None, param_types=None): func_decl = ast_pb2.Decl() func_decl.decltype = ast_pb2.Decl.Type.FUNC func_decl.func.name.c...
#!/usr/bin/python # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import sys import idl_definitions from idl_types import IdlType, IdlUnionType...
import unittest2 as unittest from datetime import datetime import pytz from .. import time from ..error import TimeConstructionError # IMPORTANT -- note to self -- you CANNOT use tzinfo on datetime-- ever! -- just pytz.timezone.localize everything to be safe JAN_MICROS = 1325376000*1000**2 JAN_MILLIS = JAN_MICROS/100...
# -*- coding: utf-8 -*- import os import secrets from datetime import datetime from allauth.account.models import EmailAddress from django.conf import settings from django.forms.models import model_to_dict from django.utils.safestring import mark_safe from djtools.utils.mail import send_mail PROFESSIONAL_PROGRAMS =...
#!/usr/bin/python -u # # Copyright (c) 2015 Peter Ericson <pdericson@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVI...
""" SoftLayer.tests.CLI.modules.securitygroup_tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :license: MIT, see LICENSE for more details. """ import json import mock import SoftLayer from SoftLayer import testing class SecurityGroupTests(testing.TestCase): def set_up(self): self.network = SoftLay...
"""Implementation of sample attack.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from scipy.misc import imread from scipy.misc import imsave from nets import inception_v3, inception_v4, inception_resnet_v2, resnet_v2 fro...
# Copyright 2021 Google LLC. 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 a...