How to use the future.standard_library function in future

To help you get started, we’ve selected a few future examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mri-monitoring / Mri-app / tests / process / __init__.py View on Github external
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
__author__ = 'nharada'
github chainer / chainerrl / examples / gym / train_reinforce_gym.py View on Github external
This script is an example of training a REINFORCE agent against OpenAI Gym
envs. Both discrete and continuous action spaces are supported.

To solve CartPole-v0, run:
    python train_reinforce_gym.py

To solve InvertedPendulum-v1, run:
    python train_reinforce_gym.py --env InvertedPendulum-v1
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import *  # NOQA
from future import standard_library
standard_library.install_aliases()  # NOQA
import argparse
import os

import chainer
import gym
import gym.spaces
import numpy as np

import chainerrl
from chainerrl import experiments
from chainerrl import misc


def main():
    import logging
github IGITUGraz / live-plotter / liveplotter / plotrecorder.py View on Github external
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with live-plotter.  If not, see .
#
# For more information see: https://github.com/anandtrex/live-plotter

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library

standard_library.install_aliases()
from builtins import object

import logging
import pickle

import zmq

from liveplotter import PORT, SENTINEL

rlogger = logging.getLogger('liveplotter.plotrecorder')


class PlotRecorder(object):
    """
    This is a ZMQ publisher
github cctbx / cctbx_project / mmtbx / regression / tst_mtz2map.py View on Github external
from __future__ import division
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
from libtbx.test_utils import Exception_expected
from libtbx.utils import null_out, Sorry
from io import StringIO
import os.path

def exercise () :
  from mmtbx.regression.make_fake_anomalous_data import generate_cd_cl_inputs
  from mmtbx.command_line import mtz2map
  import mmtbx.utils
  from iotbx import file_reader
  from scitbx.array_family import flex
  mtz_file, pdb_file = generate_cd_cl_inputs(file_base = "tst_mmtbx_mtz2map")
  pdb_in = file_reader.any_file(pdb_file)
  hierarchy = pdb_in.file_object.hierarchy
  xrs = pdb_in.file_object.xray_structure_simple()
github google / rekall / rekall-core / rekall / plugins / windows / taskmods.py View on Github external
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

# pylint: disable=protected-access

from future import standard_library
standard_library.install_aliases()
from rekall import testlib
from rekall_lib import utils

from rekall.plugins.common import memmap
from rekall.plugins.windows import common


class WinPsList(common.WinProcessFilter):
    """List processes for windows."""

    __name = "pslist"

    eprocess = None

    table_header = [
        dict(type="_EPROCESS", name="_EPROCESS"),
github Autodesk / molecular-design-toolkit / moldesign / molecules / coord_arrays.py View on Github external
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()

# Copyright 2017 Autodesk 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 or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This module contains python "descriptors" (nothing to do with chemoinformatic "descriptors") that
github ilastik / lazyflow / lazyflow / utility / io_util / tiledVolume.py View on Github external
from future import standard_library
standard_library.install_aliases()

from builtins import zip
from builtins import object
import sys
import os
import numpy
import vigra
from functools import partial
from io import BytesIO

## Instead of importing requests and PIL here, 
## use late imports (below) so people who don't use TiledVolume don't have to have them

# New dependency: requests is way more convenient than urllib or httplib
#import requests
github Mri-monitoring / Mri-app / Mri / event / __init__.py View on Github external
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from .BaseEvent import BaseEvent
from .TrainingEvent import TrainingEvent
github odlgroup / odl / RL / geometry / geometry.py View on Github external
(at your option) any later version.

RL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with RL.  If not, see .
"""

from __future__ import print_function, unicode_literals, division
from __future__ import absolute_import
from builtins import object
from future import standard_library
standard_library.install_aliases()

from scipy.linalg import norm


class Geometry(object):

    def __init__(self, source, sample, detector, *args, **kwargs):

        self._source = source
        self._sample = sample
        self._detector = detector

    @property
    def source(self):
        return self._source
github remg427 / misp42splunk / misp42splunk / bin / packages / aob_py2 / cloudconnectlib / splunktacollectorlib / config.py View on Github external
"""UCC Config Module
This is for load/save configuration in UCC server or TA.
The load/save action is based on specified schema.
"""

from __future__ import absolute_import

from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from builtins import object
import json
import logging
import traceback
import time
import six

from ..splunktalib.rest import splunkd_request, code_to_msg
from ..splunktalib.common import util as sc_util

from .common import log as stulog
from .common import UCCException
from urllib.parse import quote