# Path: oslo_utils/_i18n.py

# 
# Path: oslo_utils/encodeutils.py
# def safe_decode(text, incoming=None, errors='strict'):
# def safe_encode(text, incoming=None,
#                 encoding='utf-8', errors='strict'):
# def to_utf8(text):
# def exception_to_unicode(exc):


import collections.abc
import math
import re
import unicodedata
import urllib
import pyparsing as pp
from oslo_utils._i18n import _
from oslo_utils import encodeutils
        KB, KiB, MB, MiB, GB, GiB, TB, TiB

    The units supported for SI ::

        kb(it), Mb(it), Gb(it), Tb(it)
        kB, MB, GB, TB

    SI units are interpreted as power-of-ten (e.g. 1kb = 1000b).  Note
    that the SI unit system does not support capital letter 'K'

    IEC units are interpreted as power-of-two (e.g. 1MiB = 1MB =
    1024b)

    Mixed units interpret the "i" to mean IEC, and no "i" to mean SI
    (e.g. 1kb = 1000b, 1kib == 1024b).  Additionaly, mixed units
    interpret 'K' as power-of-ten.  This mode is not particuarly
    useful for new code, but can help with compatability for parsers
    such as GNU parted.

    :param text: String input for bytes size conversion.
    :param unit_system: Unit system for byte size conversion.
    :param return_int: If True, returns integer representation of text
                       in bytes. (default: decimal)
    :returns: Numerical representation of text in bytes.
    :raises ValueError: If text has an invalid value.

    """
    try:
        base, reg_ex = UNIT_SYSTEM_INFO[unit_system]
    except KeyError:

# Path: oslo_utils/_i18n.py

# 
# Path: oslo_utils/encodeutils.py
# def safe_decode(text, incoming=None, errors='strict'):
# def safe_encode(text, incoming=None,
#                 encoding='utf-8', errors='strict'):
# def to_utf8(text):
# def exception_to_unicode(exc):


# Path: oslo_utils/strutils.py
import collections.abc
import math
import re
import unicodedata
import urllib
import pyparsing as pp
from oslo_utils._i18n import _
from oslo_utils import encodeutils

        KB, KiB, MB, MiB, GB, GiB, TB, TiB

    The units supported for SI ::

        kb(it), Mb(it), Gb(it), Tb(it)
        kB, MB, GB, TB

    SI units are interpreted as power-of-ten (e.g. 1kb = 1000b).  Note
    that the SI unit system does not support capital letter 'K'

    IEC units are interpreted as power-of-two (e.g. 1MiB = 1MB =
    1024b)

    Mixed units interpret the "i" to mean IEC, and no "i" to mean SI
    (e.g. 1kb = 1000b, 1kib == 1024b).  Additionaly, mixed units
    interpret 'K' as power-of-ten.  This mode is not particuarly
    useful for new code, but can help with compatability for parsers
    such as GNU parted.

    :param text: String input for bytes size conversion.
    :param unit_system: Unit system for byte size conversion.
    :param return_int: If True, returns integer representation of text
                       in bytes. (default: decimal)
    :returns: Numerical representation of text in bytes.
    :raises ValueError: If text has an invalid value.

    """
    try:
        base, reg_ex = UNIT_SYSTEM_INFO[unit_system]
    except KeyError:

        msg = _('Invalid unit system: "%s"') % unit_system