gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import nose.tools as nt import numpy.testing as npt import pandas.util.testing as pdt from numpy.testing.decorators import skipif from nose import SkipTest try: import statsmodels.regression.linear_model as smlm _n...
from django.contrib.auth.models import User, Group from django.test import TestCase from django.test.client import Client from object_permissions_m2m import * from object_permissions_m2m.registration import TestModel, TestModelChild, \ TestModelChildChild, UnknownPermissionException from object_permissions_m2m.vi...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json import frappe.utils from frappe.utils import cstr, flt, getdate, comma_and, cint from frappe import _ from frappe.model.utils ...
# -*- coding: utf-8 -*- import re from django.conf import settings from django.core import mail from django.http import HttpRequest from django.http import HttpResponse from django.middleware.clickjacking import XFrameOptionsMiddleware from django.middleware.common import CommonMiddleware from django.middleware.http ...
#!/usr/bin/python # (c) 2016, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, outfile): """given a database ID and GPLID, get the files""" from Betsy import...
# util.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sys try: Set = set except: import sets Set = sets.Set try: from cStringIO import StringIO...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Copyright 2017 Bracket Computing, 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. # A copy of the License is located at # # https://github.com/brkt/brkt-cli/blob/master/LICENSE # # or in the "license" file...
########################################################################## # # Copyright (c) 2008-2013, Image Engine Design 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: # # * Redis...
from __future__ import unicode_literals from .abc import ABCIE from .abc7news import Abc7NewsIE from .academicearth import AcademicEarthCourseIE from .addanime import AddAnimeIE from .adobetv import ( AdobeTVIE, AdobeTVVideoIE, ) from .adultswim import AdultSwimIE from .aftenposten import AftenpostenIE from .a...
# Django settings for test_project project. import os.path import django DEBUG = os.environ.get('DEBUG', False) TEMPLATE_DEBUG = DEBUG LOG_LEVEL = os.environ.get('DJANGO_LOG_LEVEL', 'INFO') PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) BASE_DIR = os.path.dirname(os.path.dirname(os.pat...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
"""CherryPy Benchmark Tool Usage: benchmark.py --null --notests --help --cpmodpy --modpython --ab=path --apache=path --null: use a null Request object (to bench the HTTP server only) --notests: start the server but do not run the tests; this allows you to check the te...
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager imp...
#!/usr/bin/env ccp4-python import copy import pickle import glob import logging import os import shutil import sys # Hack to make sure we can find the modules we need if __name__ == "__main__": root = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-2]) sys.path.insert(0, os.path.join(root, "scripts")) ...
# EXPERIMENTAL: all may be removed soon from gym.benchmarks import scoring from gym.benchmarks.registration import benchmark_spec, register_benchmark, registry, register_benchmark_view # imports used elsewhere register_benchmark( id='Atari200M', scorer=scoring.TotalReward(), name='Atari200M', view_gr...
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2017 Juan Cabral # 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 withou...
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2008 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # ...
# -*- coding: utf-8 -*- from gluon import current from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # ============================================================================= class S3MainMenu(default.S3MainMenu): """ Custom Applica...
#!/usr/bin/env python # # Protokollen - probe a bunch of hosts for their preferred URL # # -*- coding: utf-8 -*- # vim: ts=4 sts=4 sw=4 noexpandtab # from __future__ import absolute_import import sys import re import json # http://www.angryobjects.com/2011/10/15/http-with-python-pycurl-by-example/ # http://pycurl.sour...
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 r...
# -*- coding: utf-8 -*- import string from datetime import timedelta from django.conf import settings # set question's render parser ASK_CONTENT_DEFAULT_PARSER = ( ('rst', 'resturctured text'), ('markdown', 'markdown'), ('texttile', 'texttile'), ) ASK_CONTENT_PARSER = getattr(settings, 'ASK_CONTENT_DEFAUL...
from pyasn1.type import tag, namedtype, univ from pyasn1.codec.ber import encoder from pyasn1.compat.octets import ints2octs from pyasn1.error import PyAsn1Error from sys import version_info if version_info[0:2] < (2, 7) or \ version_info[0:2] in ( (3, 0), (3, 1) ): try: import unittest2 as unittest ...
#!/usr/bin/python # Copyright (c) 2011 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Software construction toolkit site_scons configuration. This module sets up SCons for use with this toolkit. This should cont...
import pytest from americano import parse, ParseError """ List of parameters to test. Follows the function signature: f(expression, expected, context={}) """ test_eval_parameters = [ # Literals ['\"\\"\"', '"'], ["\'\\'\'", "'"], ['"4"', '4'], ["'4'", '4'], ['"with space"', 'with space'], ...
# Copyright 2015 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 applicable law or agreed to in w...
# -*- coding: utf-8 -*- """ lantz.drivers.legacy.visa ~~~~~~~~~~~~~~~~~~~~~~~~~ Implements base classes for drivers that communicate with instruments using visalib. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from lantz import ...
# pylint:disable=too-many-lines, protected-access, redefined-outer-name, not-callable, # pylint:disable=no-member from __future__ import absolute_import, print_function import sys import os import traceback import signal as signalmodule # pylint:disable=undefined-all-variable __all__ = [ 'get_version', 'get_he...
""" Taken from sklearn.gaussian_process module and stripped out naked to the bare minimum """ from scipy import linalg as LA import scipy as sp from sklearn.utils import array2d from sklearn.gaussian_process import correlation_models import Cholesky MACHINE_EPSILON = sp.finfo(sp.double).eps def kernel(d, theta...
from __future__ import absolute_import # Project imports import mock import os import re import shutil import sys import time from datetime import datetime from datetime import timedelta from tempfile import gettempdir sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(...
""" httpauth modules defines functions to implement HTTP Digest Authentication (RFC 2617). This has full compliance with 'Digest' and 'Basic' authentication methods. In 'Digest' it supports both MD5 and MD5-sess algorithms. Usage: First use 'doAuth' to request the client authentication for a certain resource....
# Copyright 2008-2015 Nokia Solutions and 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...
"""A Python module for interacting with Slack's Web API.""" import copy import hashlib import hmac import io import json import logging import mimetypes import urllib import uuid import warnings from base64 import b64encode from http.client import HTTPResponse from ssl import SSLContext from typing import BinaryIO, Di...
"""Module to handle image quality calculations.""" # # iqcalc.py -- image quality calculations on FITS data # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import math import logging import threading import numpy as np try: import scipy.optimize as ...
import collections import gzip import numpy import os import pandas import pysam import cStringIO as StringIO import subprocess from grocsvs import step from grocsvs import utilities Readcloud = collections.namedtuple("Readcloud", "chrom start_pos end_pos bc num_reads obs_len hap") class CombineReadcloudsStep(step....
from .ast_builder import ast_builder from ..query_data_structures.constraint import Constraint from ..query_data_structures.element import Variable, Constant, Wildcard from ..query_data_structures.query import ConjunctiveQuery from ..query_data_structures.relation import RelationInQuery __author__ = 'caioseguin' # F...
import os from functools import partial from fabric.context_managers import cd from fabric.state import env from fabric.utils import indent, abort, warn from blues.application.project import git_repository_path from refabric.context_managers import sudo, silent from refabric.operations import run from refabric.utils ...
import ptypes, operator from ptypes import * from . import codestream, intofdata, dataofint ptypes.setbyteorder(ptypes.config.byteorder.bigendian) ### JFIF Markers class Marker(codestream.Marker): cache, table = {}, [ ('SOF0', b'\xff\xc0'), ('SOF1', b'\xff\xc1'), ('SOF2', b'\xff\xc2'), ...
# (c) 2017, XYSec Labs from orm_choices import choices_with_unknown as choices from orm_choices import choices as choices_without_unknown from ak_vendor.constants import ( RISK_ENUM_PASSED, RISK_ENUM_LOW, RISK_ENUM_MEDIUM, RISK_ENUM_HIGH, RISK_ENUM_CRITICAL, ) @choices class ProductEnum: cl...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import nipype.pipeline.engine as pe import nipype.interfaces.fsl as fsl import nipype.interfaces.freesurfer as fs import nipype.interfaces.meshfix as mf import nipype.interfaces.io as nio import nipype.in...
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ...
# 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 ...
""" Author: Armon Dadgar Start Date: April 7th, 2009 Description: This file provides a python interface to low-level system call on the Linux platform. It is designed to abstract away the C-level detail and provide a high-level method of doing common management tasks. """ import os # Provides some co...
""" Tests for lumpy.py. """ import os import tempfile from Bio import SeqIO from Bio.Alphabet import generic_dna from Bio.SeqFeature import FeatureLocation from Bio.SeqFeature import SeqFeature from django.conf import settings from django.test import TestCase import vcf from main.models import AlignmentGroup from ma...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/protobuf/master_service.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.prot...
# -*- coding: utf-8 -*- # # pietrack documentation build configuration file, created by # sphinx-quickstart on Wed Jul 29 18:10:32 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. # # ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from time import sleep from requests import Timeout from six import text_type, iteritems, string_types from six.moves import map from ...docker_api import HostConfig, NetworkingConfig, EndpointConfig from ...functional import resolve_valu...
#!/usr/bin/env python # Copyright 2012 NEC Corporation. # Based on ryu/openvswitch agents. # # Copyright 2012 Isaku Yamahata <yamahata at private email ne jp> # Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except...
# 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 b...
import numpy as np import pytest from sklearn.multioutput import MultiOutputRegressor from numpy.testing import assert_array_equal from numpy.testing import assert_equal from numpy.testing import assert_raises from skopt import gp_minimize from skopt import forest_minimize from skopt.benchmarks import bench1, bench1_...
# Copyright 2012 Red Hat, 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...
# -*- coding: utf-8 -*- import furl from rest_framework import status as http_status from future.moves.urllib.parse import urlencode import markupsafe from django.core.exceptions import ValidationError from django.utils import timezone from flask import request from addons.osfstorage.models import Region from framewo...
# ==================================================================== # 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 # -*- coding: utf-8 -*- """ Test Object Services -------------------- """ import unittest from bacpypes.debugging import bacpypes_debugging, ModuleLogger from bacpypes.errors import ExecutionError, InvalidParameterDatatype from bacpypes.primitivedata import CharacterString from bacpypes.constr...
#!/usr/bin/python # Copyright (C) 2015, WSID # 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, publ...
# 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...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2013 deanishe@deanishe.net. # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2013-11-01 # """workflow-build [options] <workflow-dir> Build Alfred Workflows. Compile contents of <workflow-dir> to a ZIP file (with extension `.alfred3workfl...
from __future__ import absolute_import import warnings from importlib import import_module from django import forms from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.sites.shortcuts import get_current_site from django.core import exceptions, validators from django.urls import reve...
# 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 ...
''' Evaluation code for the SICK dataset (SemEval 2014 Task 1) ''' import numpy as np import os.path from util import * from sklearn.metrics import mean_squared_error as mse from scipy.stats import pearsonr from scipy.stats import spearmanr from sklearn.utils import shuffle from utils.score import report_score from ker...
# http://inamidst.com/saxo/ # Created by Sean B. Palmer import html.entities import re import urllib.parse import urllib.request # NOTE: (?i) does work in byte instances _regex_charset = re.compile(b"(?i)<meta[^>]+charset=[\"']?([^\"'> \r\n\t]+)") _regex_entity = re.compile(r"&([^;\s]+);") _regex_key = re.compile(r'(...
from __future__ import absolute_import import numpy as np from keras import backend as K from keras import activations, initializations, regularizers from keras.engine import Layer, InputSpec from keras.layers import Recurrent from keras.layers import time_distributed_dense import memory as EM import head class NTM...
from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.contrib.contenttypes.models import ContentType from django.db import connection from django.db.models import Prefetch from django.db.models.query import get_prefetcher from django.test import TestCase, override_se...
from django.conf.urls import url from django.conf import settings from rest_framework.response import Response from rest_framework.reverse import reverse from rest_framework import routers from rest_framework.urlpatterns import format_suffix_patterns from rest_framework.views import APIView from onadata.apps.api.views...
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ TEST FILE 2 """ from zope.interface import implements, Interface, Attribute from twisted.python.reflect import namedAny from twisted.python import components from twisted.internet import defer from twisted.persisted import sob from...
from __future__ import print_function import enum import re import struct import sys import threading import time import serial from serial.tools.list_ports import comports from common import * def multichr(ords): if sys.version_info[0] >= 3: return bytes(ords) else: return ''.join(map(chr, ...
import re import json import hearthbreaker from hearthbreaker.cards.heroes import hero_from_name import hearthbreaker.constants from hearthbreaker.engine import Game, card_lookup, Deck import hearthbreaker.game_objects import hearthbreaker.cards import hearthbreaker.proxies from hearthbreaker.serialization.move import...
#!/usr/bin/env python2 """ obstartup ~~~~~~~~~ A user-friendly Openbox autostart.sh configurator. :copyright: Copyright 2010 David Gidwani. :license: BSD style, see LICENSE """ import sys try: import pygtk pygtk.require("2.0") except: pass try: import gtk import gobject except...
""" This file contains the automatic test generation logic that generates test cases with exactly one basic attribute containing a long string. It is used to test the overflow resistant capability of the other end. The main criteria for passing this set of test cases is that the other end does not crash. The minor cri...
""" Copyright 2017 Government of Canada - Public Services and Procurement Canada - buyandsell.gc.ca 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 Unles...
import os import time import datetime as dt import numpy as np from netCDF4 import Dataset from scipy.interpolate import interp1d import scipy.ndimage as ndimage from utils.c_wrapper import cvort, cvort4 from utils.utils import cfind_extrema, upscale_field from load_settings import settings import setup_logging C20_...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
# -*- coding: utf-8 -*- """ gspread.models ~~~~~~~~~~~~~~ This module contains common spreadsheets' models """ import re from collections import defaultdict from itertools import chain from xml.etree import ElementTree from xml.etree.ElementTree import Element, SubElement from .ns import _ns, _ns1, ATOM_NS, BATC...
import json import logging from lxml import etree from django.core.urlresolvers import reverse from django.db.models import Q from django_datatables_view.base_datatable_view import BaseDatatableView from core.models import PublishedRecords, Job, Record, IndexMappingFailure, JobValidation,\ CombineBackgroundTask f...
# 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...
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
import test_support class PossibleForwardDeclarationRuleTest(test_support.TestBase): def setUp(self): self.set_default_rules_selection(['PossibleForwardDeclarationRule']) self.set_default_error_id('possible forward declaration') self.set_default_error_severity('information') def assert...
__author__ = 'Ostico <ostico@gmail.com>' import unittest import os os.environ['DEBUG'] = "0" os.environ['DEBUG_VERBOSE'] = "0" # if os.path.realpath('../') not in sys.path: # sys.path.insert(0, os.path.realpath('../')) # # if os.path.realpath('.') not in sys.path: # sys.path.insert(0, os.path.realpath('.')) ...
#!/usr/bin/env python3 # 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 o...
""" homeassistant.components.light.hue ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support for Hue lights. """ import logging import socket from datetime import timedelta from urllib.parse import urlparse from homeassistant.loader import get_component import homeassistant.util as util from homeassistant.const import CONF_HOST,...
# Copyright (c) 2017, Dirk Hartmann # # 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, dist...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Big Switch Networks, 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....
"""Command line utilities""" from __future__ import absolute_import from .utils import _wrap_run_cmd, read_file, write_file from .status import str_status from . import JobScript, AsyncResult, __version__ import importlib import sys import os import logging import click DEFAULT_TEST_BODY = r''' echo "################...
#!/usr/bin/env python # coding: utf-8 import pandas as pd import numpy as np from scipy.io import loadmat from sys import exit from os.path import isfile import matplotlib.pyplot as plt import matplotlib.cm as cm import argparse from sklearn.preprocessing import PolynomialFeatures from sklearn import linear_model from...
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # 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 Lic...
from ..workspace import Block, Disconnected, Cancelled from twisted.internet import defer from twisted.python import log from octopus import data from octopus.constants import State from octopus.image.data import Image, DerivedImageProperty def variableName (name): split = name.split('::') if len(split) == 2: ...
from datetime import datetime from unittest import TestCase from unittest.mock import MagicMock from test.base import ClientBaseCase from linode_api4 import LongviewSubscription, LinodeClient, ApiError class LinodeClientGeneralTest(ClientBaseCase): """ Tests methods of the LinodeClient class that do not liv...
#!/usr/bin/env python #============================================================================== # Copyright 2013 Amazon.com, Inc. or its affiliates. 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...
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test REST interface # from test_framework.test_framework import BitcoinTestFramework from test_framework...
#!/usr/bin/env python3 # Copyright (c) 2014-2020 The Fujicoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fee estimation code.""" from decimal import Decimal import random from test_framework.messages i...
import random import numpy lane_num = 2 lane = [[], []] max_car_num = 10000 road_len = 1000 h = 6 p_b = 0.94 p_0 = 0.5 p_d = 0.1 v_max = [6, 10] gap = 7 p_car = 1 p_crash = 0 time_period = 200 class Car: car_cnt = 0 def __init__(self, v = 1, lane = 1): self.size = 1 if random.random() < ...
#!/usr/bin/env python """ Copyright (c) 2017 Alex Forencich 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, merg...
#!/usr/bin/env python from pytest import mark from translate.convert import html2po from translate.convert import po2html from translate.convert import test_convert from translate.misc import wStringIO class TestHTML2PO: def html2po(self, markup, includeuntagged=False, duplicatestyle="msgctxt", keepcomments=Fa...
"""The checks module contains two classes that are used to verify conda packages and recipes: CondaPackageCheck and CondaRecipeCheck. Each class contains specific checks that relate to validating packages and recipes. These checks start with the letter 'C', which is an abbreviation for 'conda'. Checks C1101 through C...
#!/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. import os import unittest from devil import devil_env from devil.android import device_errors from devil.android import md5sum with d...
# # Copyright 2016 The BigDL 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 ...
""" Provides functionality to interact with hvacs. For more details about this component, please refer to the documentation at https://home-assistant.io/components/hvac/ """ import logging import os from homeassistant.helpers.entity_component import EntityComponent from homeassistant.config import load_yaml_config_f...
"""Main module.""" import time as _time from math import log10 as _log10, floor as _floor import numpy as _np import matplotlib.pyplot as _plt import matplotlib.gridspec as _mpl_gs from siriuspy.devices import SOFB, RFGen, Tune, BunchbyBunch from pymodels import si as _si import pyaccel as _pyacc from ..utils import...