コード例 #1
0
ファイル: __init__.py プロジェクト: nlevitt/warcprox
of the License, or (at 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
USA.
"""

from argparse import Namespace as _Namespace
from pkg_resources import get_distribution as _get_distribution
__version__ = _get_distribution('warcprox').version
try:
    import queue
except ImportError:
    import Queue as queue
import datetime

def digest_str(hash_obj, base32=False):
    import base64
    return hash_obj.name.encode('utf-8') + b':' + (
            base64.b32encode(hash_obj.digest()) if base32
            else hash_obj.hexdigest().encode('ascii'))

class Options(_Namespace):
    def __getattr__(self, name):
        try:
コード例 #2
0
ファイル: __init__.py プロジェクト: leonirlopes/warcprox
of the License, or (at 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
USA.
"""

from argparse import Namespace as _Namespace
from pkg_resources import get_distribution as _get_distribution
__version__ = _get_distribution('warcprox').version
try:
    import queue
except ImportError:
    import Queue as queue
import datetime


def digest_str(hash_obj, base32=False):
    import base64
    return hash_obj.name.encode('utf-8') + b':' + (base64.b32encode(
        hash_obj.digest()) if base32 else hash_obj.hexdigest().encode('ascii'))


class Options(_Namespace):
    def __getattr__(self, name):
コード例 #3
0
ファイル: __init__.py プロジェクト: michoel-lab/limix-legacy
from pkg_resources import DistributionNotFound as _DistributionNotFound
from pkg_resources import get_distribution as _get_distribution

from . import io

try:
    __version__ = _get_distribution('limix-legacy').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix_legacy').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main([
            '-q',
            '--doctest-modules',
            '--ignore=modules/dirIndirVD_commented_forDistrib.py',
            '--ignore=modules/social_data_HSmice_paper.py',
            '--ignore=deprecated/io/genotype_reader.py',
            '--ignore=deprecated/io/output_writer.py',
            '--ignore=deprecated/io/phenotype_reader.py',
            '--ignore=io/genotype_reader.py',
            '--ignore=io/output_writer.py',
            '--ignore=io/phenotype_reader.py',
        ])
コード例 #4
0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2017, James R. Barlow (https://github.com/jbarlow83/)

from pkg_resources import DistributionNotFound
from pkg_resources import get_distribution as _get_distribution

try:
    __version__ = _get_distribution(__package__).version
except DistributionNotFound:
    __version__ = "Not installed"

__all__ = ['__version__']
コード例 #5
0
ファイル: __init__.py プロジェクト: PMBio/limix
from .mtSet import MTSet
from .varDecomp import VarianceDecomposition

from pkg_resources import get_distribution as _get_distribution
from pkg_resources import DistributionNotFound as _DistributionNotFound

try:
    __version__ = _get_distribution('limix').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q'])
    finally:
        os.chdir(old_path)

    if return_code == 0:
        print("Congratulations. All tests have passed!")

    return return_code
コード例 #6
0
from __future__ import absolute_import as _absolute_import

import _cffi_backend

from pkg_resources import DistributionNotFound as _DistributionNotFound
from pkg_resources import get_distribution as _get_distribution

from . import cprob, ellf
from .api import get_include, get_lib

try:
    __version__ = _get_distribution('ncephes').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    import os
    p = __import__('ncephes').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q', '--doctest-modules'])
    finally:
        os.chdir(old_path)

    if return_code == 0:
        print("Congratulations. All tests have passed!")
コード例 #7
0
from pkg_resources import get_distribution as _get_distribution
from pkg_resources import DistributionNotFound as _DistributionNotFound

try:
    __version__ = _get_distribution('fscLVM').version
except _DistributionNotFound:
    __version__ = 'unknown'

from .utils import (initFA, load_hdf5, load_txt, preTrain, plotLoadings,
                    plotFactors, plotRelevance, saveFA, dumpFA)
from .core import (CSparseFA)
コード例 #8
0
ファイル: __init__.py プロジェクト: gatij10/Student-Feedback
from __future__ import absolute_import as _
from __future__ import unicode_literals as _

from pkg_resources import DistributionNotFound as _DistributionNotFound
from pkg_resources import get_distribution as _get_distribution

from .core import PickleByInit, SlotPickleMixin

try:
    __version__ = _get_distribution('pickle_mixin').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    r"""Tests this package.

    You will need `pytest` installed in order to use this function.
    """
    import os
    p = __import__('pickle_mixin').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q', '--doctest-modules'])
    finally:
        os.chdir(old_path)

    if return_code == 0:
コード例 #9
0
from ._algebra import *
from ._channels import *
from ._error_control_block import *
from ._error_control_convolutional import *
from ._finite_state_machine import *
from ._modulation import *
from ._pulses import *
from ._quantization import *
from ._sequences import *
from ._source_coding import *
from ._sources import *
from ._util import *

import inspect as _inspect
import sys as _sys
for _, _cls in _inspect.getmembers(_sys.modules[__name__], _inspect.isclass):
    if hasattr(_cls, '_process_docstring'):
        _cls._process_docstring()

from pkg_resources import get_distribution as _get_distribution
__version__ = _get_distribution('komm').version
コード例 #10
0
from __future__ import absolute_import as _absolute_import

from pkg_resources import get_distribution as _get_distribution
from pkg_resources import DistributionNotFound as _DistributionNotFound

try:
    __version__ = _get_distribution('limix_tool').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix_tool').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q'])
    finally:
        os.chdir(old_path)

    if return_code == 0:
        print("Congratulations. All tests have passed!")

    return return_code
コード例 #11
0
ファイル: __init__.py プロジェクト: limix/limix-core
r"""
******************
limix-core package
******************

A flexible and fast mixed model toolbox.

"""

from __future__ import absolute_import as _absolute_import

from pkg_resources import DistributionNotFound as _DistributionNotFound
from pkg_resources import get_distribution as _get_distribution

try:
    __version__ = _get_distribution('limix-core').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix_core').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q', '--doctest-modules'])
    finally:
        os.chdir(old_path)
コード例 #12
0
from brozzler.browser import Browser
from umbra.controller import AmqpBrowserController
from pkg_resources import get_distribution as _get_distribution
__version__ = _get_distribution('umbra').version
Umbra = AmqpBrowserController
コード例 #13
0
ファイル: metadata.py プロジェクト: ghaddarAbs/pikepdf
XmpContainer = namedtuple('XmpContainer', ['rdf_type', 'py_type', 'insert_fn'])

XMP_CONTAINERS = [
    XmpContainer('Bag', set, set.add),
    XmpContainer('Seq', list, list.append),
]

# These are the illegal characters in XML 1.0. (XML 1.1 is a bit more permissive,
# but we'll be strict to ensure wider compatibility.)
re_xml_illegal_chars = re.compile(
    r"(?u)[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]"
)

# Repeat this to avoid circular from top package's pikepdf.__version__
try:
    pikepdf_version = _get_distribution(__name__).version
except DistributionNotFound:
    pikepdf_version = "unknown version"


def encode_pdf_date(d: datetime) -> str:
    """Encode Python datetime object as PDF date string

    From Adobe pdfmark manual:
    (D:YYYYMMDDHHmmSSOHH'mm')
    D: is an optional prefix. YYYY is the year. All fields after the year are
    optional. MM is the month (01-12), DD is the day (01-31), HH is the
    hour (00-23), mm are the minutes (00-59), and SS are the seconds
    (00-59). The remainder of the string defines the relation of local
    time to GMT. O is either + for a positive difference (local time is
    later than GMT) or - (minus) for a negative difference. HH' is the
コード例 #14
0
from pkg_resources import get_distribution as _get_distribution
from pkg_resources import DistributionNotFound as _DistributionNotFound

try:
    __version__ = _get_distribution('slalom').version
except _DistributionNotFound:
    __version__ = 'unknown'

from .utils import (initFA, load_hdf5, load_txt, preTrain, plotLoadings,
                    plotFactors, plotRelevance, saveFA, dumpFA)
from .core import (CSparseFA)
コード例 #15
0
ファイル: __init__.py プロジェクト: cloudpipe/multyvac-fork
import os as _os
from pkg_resources import (
    get_distribution as _get_distribution,
    DistributionNotFound as _DistributionNotFound,
)

from .multyvac import (
    Multyvac,
    MultyvacError,
    RequestError,
)

# Automatically determine the version of the package
try:
    _dist = _get_distribution('multyvac')
    if not __file__.startswith(_os.path.join(_dist.location, 'multyvac')):
        # not installed, but there is another version that *is*
        raise _DistributionNotFound
except _DistributionNotFound:
    __version__ = 'Only available when installed with setup.py'
else:
    # FIXME: If there are two egg-info folders (an older version failed to
    # uninstall), then the older one is chosen, which is incorrect.
    __version__ = _dist.version

# Default Multyvac singleton
_multyvac = Multyvac()

on_multyvac = _multyvac.on_multyvac
send_log_to_support = _multyvac.send_log_to_support
コード例 #16
0
from __future__ import absolute_import as _absolute_import

from pkg_resources import DistributionNotFound as _DistributionNotFound
from pkg_resources import get_distribution as _get_distribution

from . import clusterrun
from .util import kill_group

try:
    __version__ = _get_distribution('limix_lsf').version
except (_DistributionNotFound, AttributeError):
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix_lsf').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q'])
    finally:
        os.chdir(old_path)

    if return_code == 0:
        print("Congratulations. All tests have passed!")

    return return_code
コード例 #17
0
ファイル: __init__.py プロジェクト: mhowison/unitable
# Re-exported imports
import pandas as pd
from numpy import nan, where
from re import sub

# Hidden imports
import builtins as _builtins
from inspect import stack as _stack
from keyword import iskeyword as _iskeyword
from pkg_resources import get_distribution as _get_distribution
from sys import stderr as _logfile

__version__ = _get_distribution("unitable").version

# Global data frame
_df = pd.DataFrame()

# Utility functions for manipulating caller's locals

_builtins = frozenset(dir(_builtins))

def _generate(name):
    """
    Generate a new variable in the caller's locals. Test if the variable name is valid.
    """
    _locals = _stack()[2][0].f_locals
    if _iskeyword(name):
        raise ValueError("cannot name variable '{}' because it is a Python keyword".format(name))
    if name in _builtins:
        raise ValueError("cannot name variable '{}' because it is a Python builtin".format(name))
    if name in _locals:
コード例 #18
0
ファイル: __init__.py プロジェクト: sourcery-ai-bot/idom
from .core.element import element, Element
from .core.events import event, Events
from .core.layout import Layout
from .core.vdom import vdom

from .widgets.input import Input
from .widgets.html import html
from .widgets.utils import Module, Import, hotswap, multiview
from .widgets.jupyter import JupyterDisplay
from .widgets.image import Image

from .tools import Var, html_to_vdom

try:
    __version__ = _get_distribution(__name__).version
except _DistributionNotFound:  # pragma: no cover
    # package is not installed
    __version__ = "0.0.0"

# try to automatically setup the dialect's import hook
try:
    import pyalect
    import tagged
    import htm
except ImportError:  # pragma: no cover
    pass
else:
    from . import dialect

    del pyalect
コード例 #19
0
def _setupLog():
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
    #'%(asctime)s:%(levelname)s: %(name)-15s; %(module)s %(message)s'
    _log.addHandler(handler)
    _log.setLevel(logging.DEBUG)


_setupLog()

# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release markers:
#   X.Y
#   X.Y.Z   # For bugfix releases
#
# Admissible pre-release markers:
#   X.YaN   # Alpha release
#   X.YbN   # Beta release
#   X.YrcN  # Release Candidate
#   X.Y     # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#
from pkg_resources import get_distribution as _get_distribution

__version__ = _get_distribution('scikit-sdr').version
コード例 #20
0
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.
"""

import logging
from pkg_resources import get_distribution as _get_distribution

__version__ = _get_distribution('brozzler').version


class ShutdownRequested(Exception):
    pass


class NothingToClaim(Exception):
    pass


class CrawlStopped(Exception):
    pass


class PageInterstitialShown(Exception):
コード例 #21
0
ファイル: __init__.py プロジェクト: BitBaron/brozzler
    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.
"""

import json as _json
import logging as _logging
import surt as _surt
from pkg_resources import get_distribution as _get_distribution

__version__ = _get_distribution('brozzler').version

class ShutdownRequested(Exception):
    pass

class NothingToClaim(Exception):
    pass

class CrawlJobStopped(Exception):
    pass

class ReachedLimit(Exception):
    def __init__(self, http_error=None, warcprox_meta=None, http_payload=None):
        if http_error:
            if "warcprox-meta" in http_error.headers:
                self.warcprox_meta = _json.loads(http_error.headers["warcprox-meta"])
コード例 #22
0
ファイル: __init__.py プロジェクト: horta/limix-exp
from __future__ import absolute_import as _absolute_import

from pkg_resources import get_distribution as _get_distribution
from pkg_resources import DistributionNotFound as _DistributionNotFound

from .task import TaskResult

try:
    __version__ = _get_distribution('limix_exp').version
except (_DistributionNotFound, AttributeError):
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix_exp').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q'])
    finally:
        os.chdir(old_path)

    if return_code == 0:
        print("Congratulations. All tests have passed!")

    return return_code

コード例 #23
0
from __future__ import absolute_import as _absolute_import

from . import lmm
from . import glmm
from . import cov
from . import lik
from . import mean
from . import link
from . import random

from pkg_resources import get_distribution as _get_distribution
from pkg_resources import DistributionNotFound as _DistributionNotFound

try:
    __version__ = _get_distribution('limix_inference').version
except _DistributionNotFound:
    __version__ = 'unknown'


def test():
    import os
    p = __import__('limix_inference').__path__[0]
    src_path = os.path.abspath(p)
    old_path = os.getcwd()
    os.chdir(src_path)

    try:
        return_code = __import__('pytest').main(['-q'])
    finally:
        os.chdir(old_path)