gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# # 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 ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, parse_resolution, try_get, unified_timestamp, url_or_none, urljoin, ) class PeerTubeIE(InfoExtractor): _INSTANCES_RE = r'...
""" .. module:: CXData2.py :platform: Unix :synopsis: A class for coherent X-ray phasing data. .. moduleauthor:: David Vine <djvine@gmail.com> """ import scipy as sp import numpy as np import scipy.fftpack as spf import scipy.ndimage as spn from numpy.random import uniform from numpy import pad import os impo...
"""Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new preprocessing methods, etc... """ # from __future__ import absolute_import # from __future__ import print_function import numpy as np import re from scipy import linalg import scipy.nd...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): from sentry.utils.query import RangeQuerySetWrapper SavedSearch = orm['sentry...
# -*- coding: utf-8 -*- """This module declares Region Of Interest (ROI) types as extensions of pyqtgraph.ROI objects. Current ROI types are: * line * rectangle * freehand * rect_line Example: >>> roi = makeROI('line', [[10, 10], [20, 15]]) >>> roi.plot() >>> roi.copy() >>> win2 = open...
# 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 unde...
#!/usr/bin/env python """These flows are system-specific GRR cron flows.""" import bisect import time import logging from grr.lib import aff4 from grr.lib import data_store from grr.lib import export_utils from grr.lib import flow from grr.lib import hunts from grr.lib import rdfvalue from grr.lib import utils from...
#!/usr/bin/python # -*- coding:utf-8 -*- """ POS tagger for building a LSTM based POS tagging model. https://github.com/rockingdingo/deepnlp/tree/master/deepnlp/pos """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals ...
""" Utility functions related to concat """ import numpy as np import pandas._libs.tslib as tslib from pandas import compat from pandas.core.dtypes.common import ( is_categorical_dtype, is_sparse, is_datetimetz, is_datetime64_dtype, is_timedelta64_dtype, is_period_dtype, is_object_dtype, ...
from nose.tools import * # noqa import mock from boto.s3.connection import * # noqa from tests.base import OsfTestCase from tests.factories import UserFactory, ProjectFactory from framework.auth import Auth from website.addons.s3.model import AddonS3NodeSettings, AddonS3UserSettings, S3GuidFile class TestFileGuid...
# 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 req...
import re import math from itertools import chain from .component import Property import nineml.units as un from .population import Population from .projection import Projection from .selection import Selection from . import BaseULObject from nineml.exceptions import name_error from nineml.base import DocumentLevelObje...
# # This file is part of Gruvi. Gruvi is free software available under the # terms of the MIT license. See the file "LICENSE" that was provided # together with this source file for the licensing terms. # # Copyright (c) 2012-2014 the Gruvi authors. See the file "AUTHORS" for a # complete list. from __future__ import a...
import operator from collections import defaultdict from itertools import chain from itertools import repeat from urllib.parse import urlunparse from toolz import partition_all import postgresql import polymr.storage from polymr.record import Record from polymr.storage import loads from polymr.storage import dumps fr...
#!/usr/bin/env python3 # Copyright (c) 2017-2019 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...
####################################################### ## Browser ## Abstracts querying and scraping web pages, and parsing APIs. ####################################################### import re from stewbot.components.modules import mechanize from stewbot.components.modules import simplejson from stewbot.components....
# Copyright 2018 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 common import * # NOQA from cattle import ApiError import yaml def _get_agent_for_container(context, container): agent = None for map in container.hosts()[0].instanceHostMaps(): try: c = map.instance() except Exception: continue if c.agentId is not None: ...
# 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 2015 IBM Corp. # # All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.core.mail import send_mail from django.db import models from django.db.models.manager import EmptyManager from django.utils.crypto import get_random_string from django.utils.http import urlquote from django.util...
# 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 module is a pure python implementation of Tree SHAP. It is primarily for illustration since it is slower than the 'tree' module which uses a compiled C++ implmentation. """ import numpy as np #import numba from .explainer import Explainer # class TreeExplainer(Explainer): # def __init__(self, model, **kwa...
""" Processes the command line args. """ # emacs shortcuts in raw_input, doesn't work on Windows try: import readline except ImportError: pass # relative import import database as db import lib.prettytable as prettytable #import from standard library import tempfile import re import subprocess import textwrap impo...
"""Mongodb implementations of relationship queries.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=protected-access # Access to protected methods allo...
# Cloudeebus # # Copyright 2012 Intel 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 applicable law or agre...
# # 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 # ...
from __future__ import absolute_import import sys import os import time import signal import traceback import logging import inspect import socket import cwbot.util.DebugThreading as threading from cwbot.util.DebugThreading import _reset_traceback from cwbot.processArgv import processArgv from cwbot.sys.BotSystem impor...
""" Test cases for the Comparisons class over the Chart elements """ import numpy as np from holoviews import Dimension, Curve, Bars, Histogram, Scatter, Points, VectorField from holoviews.element.comparison import ComparisonTestCase class CurveComparisonTest(ComparisonTestCase): def setUp(self): "Varia...
# 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, print_function, unicode_literals import fnmatch import itertools import os import sys from builtins import object, range, ...
import datetime import json from decimal import Decimal from boto.mturk.connection import MTurkConnection, MTurkRequestError from boto.mturk.price import Price from boto.mturk.qualification import (NumberHitsApprovedRequirement, PercentAssignmentsApprovedRequirement, ...
#!/usr/bin/env python ## ## See COPYING file distributed along with the ncanda-data-integration package ## for the copyright and license terms ## """ Post GitHub Issues ------------------ Take the stdout and stderr passed to the catch_output_email and create an issue on GitHub that uses a tag corresponding to the s...
from __future__ import absolute_import from traits.testing.unittest_tools import UnittestTools, unittest from ..action import Action from ..action_item import ActionItem from ..action_manager import ActionManager from ..group import Group class TestActionItem(unittest.TestCase, UnittestTools): def setUp(self):...
#========================================================================== # imViewer-Simple.py # # An example program that opens uncompressed DICOM images and # converts them via numPy and PIL to be viewed in wxWidgets GUI # apps. The conversion is currently: # # pydicom->NumPy->PIL->wxPython.Image->wxPython.B...
# Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud 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. You may obtain # a copy of the License at # # http://www.apach...
""" Definitions of the GA4GH protocol types. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import datetime import json import inspect from sys import modules import google.protobuf.json_format as json_format import google.protobuf.message as message ...
""" -> Blackjack Statistics Simulator 1.0 -> J Joddy Zavala Z -> Enero 2017 (retomando) -> Python 3.6 En esta version solo se simularan rondas de juego para obtener estadisticas que muestren la eficiencia de seguir estrategias predefinidas Descubrimientos: *Todos las referenci...
"""account.py: Implementation of class AbstractTwitterAccountCommand and its subclasses. """ from argparse import FileType from . import AbstractTwitterCommand, call_decorator from ..parsers import (filter_args, parser_include_entities, parser_skip_status) # POST account/...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import contextlib import json import logging import os import random import sys import tempfile import unittest from io import StringIO from t...
# Copyright 2017 IBM Corp # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
import os import urllib.request from abc import ABCMeta from luigi import Task, Parameter, WrapperTask, LocalTarget from collections import OrderedDict from lib.logger import get_logger from lib.timespan import get_timespan from tasks.base_tasks import RepoFileUnzipTask, TableTask, TempTableTask, MetaWrapper from ta...
import sys import os import time import subprocess import ppybot_config as config import re import xunitparser from os import listdir from os.path import isfile, join from optparse import OptionParser # encapsulate a running pybot process class Pybot(): pid = None process = None started = False ...
#!/usr/bin/env python3 # 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...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The nealcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP 9 soft forks. Connect to a single node. regtest lock-in with 108/144 block signalling activa...
"""SCons.Tool.gcc Tool-specific initialization for MinGW (http://www.mingw.org/) There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby gr...
""" Integration testing for the binary streaming protocol. This is for the backend, as opposed to the frontend binary protocol. """ import os import os.path import socket import subprocess import sys import tempfile import time import random import struct try: import pytest except ImportError: print >> sys.std...
# Copyright 2018 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/python # -*- coding: utf-8 -*- """ Helper function for parsing arguments from the command line or a config file. These may be used in the calling script to simplify parsing arguments , but is not called by the library. """ __all__ = ['parse_args','add_options'] __author__ = """\n""".join(['Vikas Kawadi...
# c: 14.04.2008, r: 14.04.2008 from sfepy import data_dir from sfepy.fem.periodic import * filename_mesh = data_dir + '/meshes/2d/square_unit_tri.mesh' material_2 = { 'name' : 'm', 'values' : {'K' : [[3.0, 0.1], [0.3, 1.0]]}, } field_1 = { 'name' : 'pressure', 'dtype' : 'real', 'shape' : (1,), ...
""" Utilities -- common functions and classes, used variously by other Omgifol modules. """ from fnmatch import fnmatchcase as wccmp from struct import pack, unpack, calcsize from copy import copy, deepcopy _pack = pack _unpack = unpack class OrderedDict: """A dict-like container that remembers in wh...
# 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...
import copy from mygrations.formats.mysql.definitions.database import Database from mygrations.formats.mysql.mygrations.operations.alter_table import AlterTable from mygrations.formats.mysql.mygrations.operations.add_constraint import AddConstraint from mygrations.formats.mysql.mygrations.operations.remove_table impor...
#!/usr/bin/env python3 # Copyright (c) 2014-2019 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 importmulti RPC. Test importmulti by generating keys on node0, importing the scriptPubKeys an...
# 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 Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ Optimizer classes defined here are light wrappers over the corresponding optimizers sourced from :mod:`jax.example_libraries.optimizers` with an interface that is better suited for working with NumPyro inference algorithms. """ fr...
#!/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...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import difflib import json import logging import re import random from bs4.element import Tag from flexget.utils.soup import get_soup...
# 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...
#!/usr/bin/python #test_GA.py """ The reference D&L is "Geomertric Algebra for Physicists" by Doran and Lasenby """ import sys try: import numpy disabled = False except ImportError: #py.test will not execute any tests now disabled = True if not disabled: sys.path.append('../') from sympy.gal...
""" Container for the layout. (Containers can contain other containers or user interface controls.) """ from __future__ import unicode_literals from six import with_metaclass from abc import ABCMeta, abstractmethod from pygments.token import Token from .screen import Point, WritePosition from .dimension import Layout...
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requi...
import sys from ...vendor.Qt import QtWidgets, QtCore from ... import io, schema, api, style from .. import lib as parentlib from . import widget from .dialogs import TasksCreateDialog, AssetCreateDialog from .model import TasksModel module = sys.modules[__name__] module.window = None class Window(QtWidgets.QDialo...
# 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 """ Calculate output results dictionary. """ from collections import OrderedDict as odict import numpy as np import yaml import numpy.lib.recfunctions as recfuncs import astropy.coordinates from astropy.coordinates import SkyCoord import astropy.units as u import ugali.analysis.source import u...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
""" Based on numpy's approach to exposing compiler features via a config header. Unfortunately that file is not exposed, so re-implement the portions we need. """ import os import sys import textwrap from distutils.command.config import config as Config from typing import List OPTIONAL_FUNCTION_ATTRIBUTES = [ ("HA...
from datetime import datetime, timedelta from io import StringIO import itertools import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, Series, Timestamp, compat, date_range, option_context, ) import pandas._testing as tm from pandas.core.arrays ...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
#!/usr/bin/python # Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. import os imp...
# Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import json import os import sys import time import six import common BLINK_TOOLS_DIR = os.path.join(common.SRC_DIR, 'third_party', 'blink',...
import json from django.db import transaction from django.shortcuts import get_object_or_404 from hashids import Hashids from rest_framework import mixins, status from rest_framework.decorators import detail_route, list_route from rest_framework.response import Response from rest_framework.viewsets import GenericViewS...
# # Copyright (c) 1996-2005, SR Research Ltd., All Rights Reserved # # # For use by SR Research licencees only. Redistribution and use in source # and binary forms, with or without modification, are NOT permitted. # # # # Redistributions in binary form must reproduce the above copyright # notice, this list of condition...
""" Copyright 2016 Deepgram 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 distri...
# -*- coding: utf-8 -*- import copy import marshal import struct import threading import time import traceback from .._compat import ( PY2, exists, copyreg, implements_bool, iterkeys, itervalues, iteritems, long ) from .._globals import THREAD_LOCAL from .serializers import serializers class cachedprop(objec...
# 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 # Copyright 2012 - 2013 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-...
# -*- coding: utf-8 -*- import mock import pytest import unittest from nose.tools import * # noqa from tests.base import OsfTestCase, get_default_metaschema from osf_tests.factories import ExternalAccountFactory, ProjectFactory, UserFactory from framework.auth import Auth from addons.bitbucket.exceptions import No...
__author__ = 'jdaniel' import copy import random import itertools import operator import math import struct import os import sys import json from collections import defaultdict class AlgorithmBase(object): def __init__(self, objective_function): """ Base Algorithm class which contains utility fun...
# Copyright (c) 2015, Nordic Semiconductor # 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 ...
# ======================================================================================== # # Description: # # Emulates execution of VM code. # # Attribution: # # Code by www.jk-quantized.com # # Redistribution and use of this code in source and binary forms must retain # the above attribution notice and th...
# -*- coding: utf-8 -*- import pandas import copy _pd2hc_kind = { "bar": "column", "barh": "bar", "area": "area", "line": "line", "pie": "pie" } def pd2hc_kind(kind): if kind not in _pd2hc_kind: raise ValueError("%(kind)s plots are not yet supported" % locals()) return _pd2hc_ki...
#!/bin/python # -*- coding: utf-8 -*- # # This file implements a class that applies changes to the annotation of the TiGer corpus. # Note that the conversion only works with version 2.1 of the TiGer corpus, release August 2007. # # author: Wolfgang Seeker # 19/12/2012 # import bs4 import fileinput class TigerXMLForm...
# -*- coding: utf-8 -*- import numpy as np import pytest import pandas as pd from pandas import Categorical, CategoricalIndex, Index, PeriodIndex, Series import pandas.core.common as com from pandas.tests.arrays.categorical.common import TestCategorical import pandas.util.testing as tm class TestCategoricalIndexing...
""" Custom Field classes that extend marshmallow Field class. All fields from marshmallow has been imported here to allow the user import them from the flask-io. """ from marshmallow import fields from marshmallow.fields import * from .validate import Complexity, Length __all__ = [ 'DelimitedList', 'Enum',...
import pytz import pytest import dateutil import warnings import numpy as np from datetime import timedelta from itertools import product import pandas as pd import pandas._libs.tslib as tslib import pandas.util.testing as tm from pandas.errors import PerformanceWarning from pandas.core.indexes.datetimes import cdate_...
#!/usr/bin/env python """To automate batch functions provided by EUtils (http://www.ncbi..nih.gov/entrez/eutils) search and fetch for sets of sequence information """ from urllib import urlopen, urlretrieve from xml.dom.minidom import parseString from xml.etree.ElementTree import parse from cogent.db.util im...
import csv import json import os import sys from copy import copy from inflection import * from helpers import * class StateIndicators(object): def __init__(self, basepath, config): self.basepath = basepath self.config = config def to_dict(self): return self.import_emergency_care(self....
'''tzinfo timezone information for Antarctica/Palmer.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Palmer(DstTzInfo): '''Antarctica/Palmer timezone definition. See datetime.tzinfo for details''' zone = 'Antarctica/Palm...
# 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 ap...
from environment import Environment from model import QNetwork import tensorflow as tf import numpy as np import random import time import sys import os from threading import Thread, Lock from collections import deque flags = tf.app.flags flags.DEFINE_string('experiment', 'dqn_breakout', 'Name of...
from collections import OrderedDict from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponseForbidden, JsonResponse, HttpResponse, HttpResponseBadRequest from django.shortcuts import render, get_object_or_404 from django.template import loader f...
# # Copyright 2014 Red Hat, 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 2 of the License, or # (at your option) any later version. # # This program is distributed in th...
from __future__ import print_function import logging import threading import re import struct from six.moves.queue import Queue from voltron.api import * from voltron.plugin import * from voltron.dbg import * try: import gdb HAVE_GDB = True except ImportError: HAVE_GDB = False log = logging.getLogger('d...
# Copyright (c) 2010-2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
"""Read records from normal file and compressed file""" import zlib import gzip import re from hanzo.warctools.archive_detect import is_gzip_file, guess_record_type def open_record_stream(record_class=None, filename=None, file_handle=None, mode="rb+", gzip="auto", offset=None, length=None): ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Visual Studio Code settings synchronizer - Synchronize vscode settings and extensions with your dotfiles directory. """ import argparse import os import os.path as path import sys import subprocess import shutil from codecs import open from typing import List VSCODE...
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. import mocker import mock import zmq from twisted.application import service from twisted.internet import defer from twisted.trial import unittest from piped import log, processing, dependencies, util from piped_zmq impo...
import numpy as np import scipy.sparse as sp import pytest from re import escape from sklearn.utils._testing import assert_array_equal from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import assert_raises from sklearn.utils._testing import assert_warns from sklearn.utils._testing imp...
import theano.tensor as T from .base import Layer from ..utils import as_tuple from theano.tensor.signal import downsample __all__ = [ "MaxPool1DLayer", "MaxPool2DLayer", "Pool2DLayer", "FeaturePoolLayer", "FeatureWTALayer", "GlobalPoolLayer", ] def pool_output_length(input_length, pool_si...