# Path: src/astrodynamics/compat/contextlib.py
# class _SuppressExceptions:
#     def __init__(self, *exceptions):
#     def __enter__(self):
#     def __exit__(self, exctype, excinst, exctb):
# def _suppress(*exceptions):
# 
# Path: src/astrodynamics/compat/math.py
# def _isclose(a, b, rel_tol=1e-9, abs_tol=0.0):
# 
# Path: src/astrodynamics/utils/compat.py
# PY33 = sys.version_info >= (3, 3)


import errno
from contextlib import contextmanager
from astropy import units as u
from astropy.units import Unit, UnitBase
from ..compat.contextlib import suppress
from ..compat.math import isclose
from .compat import PY33
    elif binary:
        suffix = _size_suffixes['binary']
    else:
        suffix = _size_suffixes['decimal']

    base = 1024 if (gnu or binary) else 1000
    bytes = float(value)

    if bytes == 1 and not gnu:
        return '1 Byte'
    elif bytes < base and not gnu:
        return '%d Bytes' % bytes
    elif bytes < base and gnu:
        return '%dB' % bytes

    for i, s in enumerate(suffix):
        unit = base ** (i + 2)
        if bytes < unit and not gnu:
            return (format + ' %s') % ((base * bytes / unit), s)
        elif bytes < unit and gnu:
            return (format + '%s') % ((base * bytes / unit), s)
    if gnu:
        return (format + '%s') % ((base * bytes / unit), s)
    return (format + ' %s') % ((base * bytes / unit), s)


@contextmanager
def suppress_file_exists_error():
    """Compatibility function for catching FileExistsError on Python 2"""
    if PY33:

# Path: src/astrodynamics/compat/contextlib.py
# class _SuppressExceptions:
#     def __init__(self, *exceptions):
#     def __enter__(self):
#     def __exit__(self, exctype, excinst, exctb):
# def _suppress(*exceptions):
# 
# Path: src/astrodynamics/compat/math.py
# def _isclose(a, b, rel_tol=1e-9, abs_tol=0.0):
# 
# Path: src/astrodynamics/utils/compat.py
# PY33 = sys.version_info >= (3, 3)


# Path: src/astrodynamics/utils/helper.py
import errno
from contextlib import contextmanager
from astropy import units as u
from astropy.units import Unit, UnitBase
from ..compat.contextlib import suppress
from ..compat.math import isclose
from .compat import PY33

    elif binary:
        suffix = _size_suffixes['binary']
    else:
        suffix = _size_suffixes['decimal']

    base = 1024 if (gnu or binary) else 1000
    bytes = float(value)

    if bytes == 1 and not gnu:
        return '1 Byte'
    elif bytes < base and not gnu:
        return '%d Bytes' % bytes
    elif bytes < base and gnu:
        return '%dB' % bytes

    for i, s in enumerate(suffix):
        unit = base ** (i + 2)
        if bytes < unit and not gnu:
            return (format + ' %s') % ((base * bytes / unit), s)
        elif bytes < unit and gnu:
            return (format + '%s') % ((base * bytes / unit), s)
    if gnu:
        return (format + '%s') % ((base * bytes / unit), s)
    return (format + ' %s') % ((base * bytes / unit), s)


@contextmanager
def suppress_file_exists_error():
    """Compatibility function for catching FileExistsError on Python 2"""
    if PY33:

        with suppress(FileExistsError):  # noqa