gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" Tests for the implementation of feature sign search. """ __authors__ = "David Warde-Farley" __copyright__ = "Copyright 2010-2011, Universite de Montreal" __credits__ = ["David Warde-Farley"] __license__ = "3-clause BSD" __maintainer__ = "David Warde-Farley" __email__ = "wardefar@iro" import numpy as np from pylea...
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. from gevent import sleep from iris.constants import EMAIL_SUPPORT, IM_SUPPORT from smtplib import SMTP from email.mime.multipart import MIMEMultipart from email...
from datetime import date import os import shutil import tempfile from unittest import TestCase from regparser.history.delays import FRDelay from regparser.notice import xml as notice_xml from regparser.test_utils.xml_builder import XMLBuilder import settings class NoticeXMLLocalCopiesTests(TestCase): """Tests s...
# SFTP storage backend for Django. # Author: Brent Tubbs <brent.tubbs@gmail.com> # License: MIT # # Modeled on the FTP storage by Rafal Jonca <jonca.rafal@gmail.com> import getpass import io import os import posixpath import stat from datetime import datetime from urllib.parse import urljoin import paramiko from djan...
"""Unit test for network_service - Treadmill Network configuration service """ import os import shutil import subprocess import tempfile import unittest import mock import treadmill from treadmill.services import network_service class NetworkServiceTest(unittest.TestCase): """Unit tests for the network service...
"""Support for covers which integrate with other components.""" import logging import voluptuous as vol from homeassistant.components.cover import ( ATTR_POSITION, ATTR_TILT_POSITION, DEVICE_CLASSES_SCHEMA, ENTITY_ID_FORMAT, PLATFORM_SCHEMA, SUPPORT_CLOSE, SUPPORT_CLOSE_TILT, SUPPORT_O...
# Copyright 2010 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
import asyncio import unittest import json import base64 from . import RPC from . import protocol try: spawn = asyncio.ensure_future except: spawn = asyncio.async class WaitGroup(object): def __init__(self, loop): self.loop = loop self.total = [] self.pending = [] def add(sel...
#!/usr/bin/env python3 # -*- encoding:utf-8 -*- """ gh_lists.py MILESTONE Functions for Github API requests. """ import os import re import sys import json import collections import argparse import datetime import time from urllib.request import urlopen, Request, HTTPError Issue = collections.namedtuple('Issue', ('...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
############################################################################### # WrapperPotential.py: Super-class for wrapper potentials ############################################################################### from .Potential import Potential, _isNonAxi, _dim from .planarPotential import planarPotential from ...
import os import tempfile import shutil from nose.tools import eq_ from dingus import Dingus from dingus import patch from build_pack_utils import utils from common.dingus_extension import patches class TestComposer(object): def __init__(self): self.extension_module = utils.load_extension('extensions/com...
#!/usr/bin/env python # ############################################################################## ### NZBGET POST-PROCESSING SCRIPT ### # Converts files and passes them to Sonarr for further processing. # # NOTE: This script requires Python to be installed on your system. ...
from zinc_request_processor import ZincRequestProcessor, ZincError from format_price import format_price from getpass import getpass import sys import os import json import re from subprocess import call import urllib import urllib2 WELCOME_BANNER = """ ____ ____ __ |_ ...
from unittest import TestCase import tempfile import os from wifi import Cell from wifi.scheme import extract_schemes, Scheme from wifi.exceptions import ConnectionError NETWORK_INTERFACES_FILE = """ # This file describes the network interfaces available on your system # and how to activate them. For more informatio...
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# -*- coding: utf-8 -*- """ pygments.lexers.agile ~~~~~~~~~~~~~~~~~~~~~ Lexers for agile 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, ExtendedRegexLexer, \ Le...
# Copyright (c) 2013 - 2021 Robin Malburn # See the file license.txt for copying permission. import sublime # type: ignore from unittesting import DeferrableTestCase # type: ignore from os import path from typing import List, Tuple, Dict, Generator try: from lib import settings, entities except ImportError: ...
# pylint: disable=no-self-use,unused-variable,expression-not-assigned from unittest.mock import Mock, patch import log import pytest from expecter import expect from gitman import cli from gitman.common import _Config from gitman.exceptions import ScriptFailure, UncommittedChanges class TestMain: """Unit tests...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2014 Mellanox Technologies, 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 t...
# Copyright 2020 Google # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
'''py.test fixtures for Pyramid. http://pyramid.readthedocs.org/en/latest/narr/testing.html ''' import tempfile import pkg_resources import pytest from pytest import fixture from snovault.tests.testappfixtures import _app_settings as sno_settings tempfile.tempdir = '/tmp' pytest_plugins = [ 'encoded.tests.fi...
"""Test for views creation and link to html pages.""" from pyramid import testing from pyramid_learning_journal.models import ( Entry, get_tm_session, ) from pyramid_learning_journal.models.meta import Base from pyramid_learning_journal.views.default import ( list_view, create_view, detail_view, ...
#!/usr/bin/env python # A part of pdfrw (pdfrw.googlecode.com) # Copyright (C) 2006-2009 Patrick Maupin, Austin, Texas # MIT license -- See LICENSE.txt for details ''' The PdfWriter class writes an entire PDF file out to disk. The writing process is not at all optimized or organized. An instance of the PdfWriter cl...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import binascii import ipaddress import os import pytest import six fr...
# Expressionparse v0.1 -- Create syntax trees for mathematical expressions # # Copyright (C) 2013, Peter Beard <peter.b.beard@gmail.com> # # This file is part of Expressionparse. # # Expressionparse is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
""" Base classes used for the generation of code based on the model objects. """ from ..model.base import (SqlString, SqlSet) from ..model.schema import (View, Table, Constraint, NamedConstraint, SqlConstraint, LanguageConstraint, ValueTypeValue, ColumnarSchemaObject) from .base import (SchemaScriptGenerator) impo...
""" The :mod:`jedi.api.classes` module contains the return classes of the API. These classes are the much bigger part of the whole API, because they contain the interesting information about completion and goto operations. """ import re from parso.cache import parser_cache from parso.python.tree import search_ancestor...
#!/usr/bin/env python # Line too long - pylint: disable=C0301 # Invalid name - pylint: disable=C0103 """ gpstandbywatch.py Copyright (c) EMC/Greenplum Inc 2011. All Rights Reserved. Check actual contents and process state of syncmaster in order to properly return accurate information back to gpinitstandby...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Cisco 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...
import boto3 import json import re import collections import datetime import pytz from params import Params USERS_FOLDER = 'users/' STATE_FOLDER = 'state/' def getStateFilename(basename, ext, ord=None): name = ''.join((STATE_FOLDER, basename.lower(), '.', ext)) if ord is not None: name = ''.join((n...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from datetime import datetime import io import logging import os import re from urllib3.util.retry import Retry from urllib3.exceptions import MaxRetryError from celery.utils.log import get_task_logger import requests fro...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os from telemetry import decorators from telemetry.core import exceptions from telemetry.core import forwarders from telemetry.core im...
import db import Queue import urllib2 import logging import multiprocessing import binascii import uuid import traceback import datetime import shapely.wkt import shapely.geometry from sqlalchemy import func, select, text from cStringIO import StringIO BASIS_TRANSLATION = { 'HumanObservation': 'Human observation',...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from p...
SwCDR DEFINITIONS IMPLICIT TAGS ::= BEGIN EXPORTS SwCDR; SwCDR ::= CHOICE { origSvcCallRecord [0] OrigSvcCallRecord, termSvcCallRecord [1] TermSvcCallRecord } --OrigSvcCallRecord ::= SET OrigSvcCallRecord ::= SEQUENCE { callCorrelationId [0] INTEGER , chargingIndicator [1] ChargingIndicator, ...
# Copyright 2014 Andrey Danin # Copyright 2014 Wallarm, 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...
from contextlib import contextmanager import mock import platform import pytest import time import unittest2 from uuid import uuid4 from pykafka import KafkaClient from pykafka.simpleconsumer import OwnedPartition, OffsetType from pykafka.test.utils import get_cluster, stop_cluster from pykafka.utils.compat import ran...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Kevin Brebanov <https://github.com/kbrebanov> # Based on pacman (Afterburn <http://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>) # and apt (Matthew Williams <matthew@flowroute.com>) modules. # # GNU General Public License v3.0+ (see COPYING or ...
# # Pyrex Top Level # import os, re, sys if sys.version_info[:2] < (2, 3): print >>sys.stderr, "Sorry, Pyrex requires Python 2.3 or later" sys.exit(1) import os from time import time import Builtin import Code import Errors import Parsing import Version from Errors import PyrexError, CompileError, error fro...
# Copyright (c) 2016-2021, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
# ext/declarative/clsregistry.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """Routines to handle the string class registry used by declarative. ...
# 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...
from pycalphad import Database, variables as v from pycalphad.plot.binary.compsets import BinaryCompset, CompsetPair from pycalphad.plot.binary.map import map_binary from pycalphad.plot.binary.zpf_boundary_sets import TwoPhaseRegion, ZPFBoundarySets from pycalphad.tests.datasets import * ALFE_DBF = Database(ALFE_TDB) ...
#!/usr/bin/env ambari-python-wrap """ 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...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import cgi import os...
# Copyright 2015 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. """Produces configured shell abstractions. This module knows how to produce a configured shell abstraction based on shell_config.ShellConfig. """ import os...
from __future__ import absolute_import import re from functools import partial from typing import Any, Callable, Text from django.http import HttpRequest, HttpResponse from zerver.lib.actions import check_send_message from zerver.lib.response import json_success from zerver.models import Client, UserProfile from zerver...
import flask from flask import Flask, render_template, request import json import time app = Flask(__name__) form_post_count = 0 # Ensure application exceptions are raised. app.debug = True class AppError(Exception): pass @app.route("/") def hello(): resp = flask.make_response("""Hello world! <a href="wi...
import collections import enum import functools from datetime import datetime import discord from discord.ext import commands from more_itertools import one from ..utils import db, time from ..utils.examples import static_example from ..utils.formats import multi_replace from ..utils.misc import nice_time, ordinal ...
# -*- coding: utf-8 -*- import re import struct import msgpack from threading import Lock import tarantool def unpack_long_long(value): return struct.unpack("<q", value)[0] def unpack_long(value): return struct.unpack("<l", value)[0] class Task(object): """ Tarantool queue task wrapper. .. w...
# 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...
#!/usr/bin/env python """ @package coverage_model.parameter_expressions @file coverage_model/parameter_expressions.py @author Christopher Mueller @brief Classes for holding expressions evaluated against parameters """ from ooi.logging import log import numpy as np import numexpr as ne import os from numbers import N...
import os import random import re import shutil import tempfile import threading import time from cassandra import ConsistencyLevel from cassandra.concurrent import execute_concurrent_with_args from ccmlib.node import NodeError from assertions import assert_almost_equal, assert_not_running, assert_one from dtest impo...
""" Test functions for linalg module """ from __future__ import division, absolute_import, print_function import os import sys import itertools import traceback import numpy as np from numpy import array, single, double, csingle, cdouble, dot, identity from numpy import multiply, atleast_2d, inf, asarray, matrix fro...
# -*- coding: utf-8 -*- """ Created on Thu Nov 19 12:32:51 2015 @author: paulinkenbrandt """ from __future__ import absolute_import, division, print_function, unicode_literals import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.cm as cm from scipy.stats import linregress imp...
# 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 -*- 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...
# yellowbrick.bestfit # Uses Scikit-Learn to compute a best fit function, then draws it in the plot. # # Author: Benjamin Bengfort # Created: Sun Jun 26 17:27:08 2016 -0400 # # Copyright (C) 2016 The sckit-yb developers # For license information, see LICENSE.txt # # ID: bestfit.py [56236f3] benjamin@bengfort.com $ ...
''' Author: Tobi and Gundram ''' from __future__ import print_function import tensorflow as tf from tensorflow.python.ops import ctc_ops as ctc from tensorflow.python.ops import rnn_cell from tensorflow.python.ops.rnn import bidirectional_rnn from util.LoaderUtil import read_image_list, get_list_vals from random impo...
# 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...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: encoder.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.protobuf import reflection as _refle...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import asyncio import os import traceback from functools import partial from inspect import isawaitable from multiprocessing import Process from signal import ( SIGTERM, SIGINT, signal as signal_func, Signals ) from socket import ( socket, SOL_SOCKET, SO_REUSEADDR, ) from time import time from ...
# 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 # not use this file except in compliance with the...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# -*- coding: utf-8 -*- from collections import OrderedDict import six from fixtures_mongoengine import FixturesMongoengineException from fixtures_mongoengine.fixture import Fixture, get_fixture_class, BaseFixture """ Metaclass idea and parts of code taken from https://github.com/croach/Flask-Fixtures """ TEST_SETU...
#!/usr/bin/env python # # svndumpfilter_tests.py: testing the 'svndumpfilter' tool. # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. # # ==================================================================== # Licensed to the Apache Software Foundation (ASF) u...
#!/usr/bin/env python3 """ Periscope API for the masses """ import os from dateutil.parser import parse as dt_parse class BroadcastDownloadInfo: """Contains information about the broadcast's download but not about the broadcast itself""" def __init__(self): self.dl_info = dict() self.dl_info...
# orm/interfaces.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines some key bas...
# Copyright (C) 2004 Anthony Baxter from xshtoom.rtp.formats import PT_PCMU, PT_GSM, PT_SPEEX, PT_DVI4, PT_RAW from xshtoom.rtp.formats import PT_PCMA, PT_ILBC from xshtoom.rtp.formats import PT_CN, PT_xCN from xshtoom.avail import codecs from xshtoom.audio import aufile, playout from zope.interface import Interface, i...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
# -*- coding: latin-1 -*- "HTML Renderer for FPDF.py" __author__ = "Mariano Reingart <reingart@gmail.com>" __copyright__ = "Copyright (C) 2010 Mariano Reingart" __license__ = "LGPL 3.0" # Inspired by tuto5.py and several examples from fpdf.org, html2fpdf, etc. from fpdf import FPDF from HTMLParser import HTMLParser...
#!/usr/bin/env python import numpy as np import collections import logging numStrips = 8 numLEDperStrip = 64 # no. of LEDs per strip numLEDs = numStrips * numLEDperStrip #np.random.seed(137) learning_rate = 1e-9 # add comments here about what are good vals decay_rate = 1 - 1e-9 # how much history ...
from __future__ import unicode_literals, absolute_import import os import six import base64 import json import time import uuid import requests from ..utils import utils AUTH_TYPES = ('registry_rubber', 'basic') # TODO: update to support new docker configuration file path. class Auth(object): def __init__(sel...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
#!/usr/bin/env python # -*- mode: python -*- # $Id: re_tests.py 275 1999-02-15 14:54:13Z hugunin $ # Re test suite and benchmark suite v1.5 # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just s...
from __future__ import print_function import numpy as np import sys import os import re import glob import time from zipfile import ZipFile from PIL import Image from core import Cache from core import scipy_diffev #from core import diffev_function_motmaster as diffev_function from core import notification from core im...
"""Parsing utilities for Wikipedia database dumps.""" from __future__ import print_function from os.path import basename from bz2 import BZ2File from collections import Counter, namedtuple import gzip from HTMLParser import HTMLParser from itertools import chain import logging import re import xml.etree.ElementTree a...
import unittest import os try: import cPickle as pickle except ImportError: import pickle as pickle import skrf as rf import numpy as npy from numpy.random import rand from nose.tools import nottest from nose.plugins.skip import SkipTest from skrf.calibration import OnePort, PHN, SDDL, TRL, SOLT, UnknownThru,...
import shutil import tempfile import time from ethereum import spv import ethereum import ethereum.db as db import ethereum.opcodes as opcodes import ethereum.abi as abi from ethereum.slogging import LogRecorder, configure_logging, set_level from ethereum.utils import to_string from ethereum.config import Env from ethe...
from pypy.rlib.parsing.ebnfparse import parse_ebnf, make_parse_function from pypy.rlib.parsing.tree import RPythonVisitor import py from ripe import compiler, ripedir from ripe.objects import W_Integer grammar = py.path.local(ripedir).join("grammar.txt").read("rt") regexs, rules, ToAST = parse_ebnf(grammar) _parse = ...
from collections import Counter import gym import numpy as np import os import random import time import unittest import ray from ray.rllib.agents.pg import PGTrainer from ray.rllib.agents.a3c import A2CTrainer from ray.rllib.env.vector_env import VectorEnv from ray.rllib.evaluation.rollout_worker import RolloutWorker...
# 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...
import numpy import chainer from chainer.backends import cuda from chainer.backends import intel64 from chainer import function_node import chainer.functions from chainer.functions.math import floor as _floor from chainer import utils from chainer.utils import type_check from chainer import variable def _convert_val...
import pytest from django.conf import settings from django.core.management import call_command import amo import amo.tests from addons.management.commands import approve_addons from devhub.models import AddonLog from editors.models import ReviewerScore # Where to monkeypatch "lib.crypto.tasks.sign_addons" so it's c...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 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 the pruning code. WARNING: This test uses 4GB of disk space. This test takes 30 mins or more (up ...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# coding: utf-8 # 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 Licens...
#!/usr/bin/env python # # Copyright 2007 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...
from unittest import TestCase, main import eventlet from eventlet import Queue from eventlet import pools from eventlet.support import six class IntPool(pools.Pool): def create(self): self.current_integer = getattr(self, 'current_integer', 0) + 1 return self.current_integer class TestIntPool(Te...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GTKPhotoInfo.py # # Copyright 2010-2015 Jose Riguera Lopez <jriguera@gmail.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...
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_text f...
#!/usr/bin/env python # ## Licensed to the .NET Foundation under one or more agreements. ## The .NET Foundation licenses this file to you under the MIT license. ## See the LICENSE file in the project root for more information. # ## # Title :lst_creator.py # # Script to create a working list file from the ...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyrigh...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...