# Path: mom/_compat.py
#   INT_MAX = sys.maxsize
#   INT_MAX = sys.maxint
# INT64_MAX = (1 << 63) - 1
# INT32_MAX = (1 << 31) - 1
# INT16_MAX = (1 << 15) - 1
# UINT128_MAX = (1 << 128) - 1    # 340282366920938463463374607431768211455L
# UINT64_MAX = 0xffffffffffffffff  # ((1 << 64) - 1)
# UINT32_MAX = 0xffffffff  # ((1 << 32) - 1)
# UINT16_MAX = 0xffff  # ((1 << 16) - 1)
# UINT8_MAX = 0xff
#   MACHINE_WORD_SIZE = 64
#   UINT_MAX = UINT64_MAX
#   MACHINE_WORD_SIZE = 32
#   UINT_MAX = UINT32_MAX
#   MACHINE_WORD_SIZE = 64
#   UINT_MAX = UINT64_MAX
#   LONG_TYPE = long
#   LONG_TYPE = int
#   INT_TYPE = long
#   INTEGER_TYPES = (int, long)
#   INT_TYPE = int
#   INTEGER_TYPES = (int,)
#   BYTES_TYPE = bytes
#   BYTES_TYPE = str
#   UNICODE_TYPE = unicode
#   BASESTRING_TYPE = basestring
#   HAVE_PYTHON3 = False
#   UNICODE_TYPE = str
#   BASESTRING_TYPE = (str, bytes)
#   HAVE_PYTHON3 = True
# ZERO_BYTE = byte_literal("\x00")
# EMPTY_BYTE = byte_literal("")
# EQUAL_BYTE = byte_literal("=")
# PLUS_BYTE = byte_literal("+")
# HYPHEN_BYTE = byte_literal("-")
# FORWARD_SLASH_BYTE = byte_literal("/")
# UNDERSCORE_BYTE = byte_literal("_")
# DIGIT_ZERO_BYTE = byte_literal("0")
# HAVE_LITTLE_ENDIAN = bool(struct.pack("h", 1) == "\x01\x00")
#   def byte_ord(byte_):
#   def byte_ord(byte_):
#   def byte_literal(literal):
#   def byte_literal(literal):
#   def dict_each(func, iterable):
#   def dict_each(func, iterable):
#   def next(iterator, default=throw):
#   def generate_random_bytes(count):
#     def generate_random_bytes(count):
#       def generate_random_bytes(count):
#       def generate_random_bytes(_):
# def get_word_alignment(num, force_arch=64,
#                        _machine_word_size=MACHINE_WORD_SIZE):
#   class Throw(object):
# 
# Path: mom/builtins.py
# def byte(number):
# def bytes_leading(raw_bytes, needle=_compat.ZERO_BYTE):
# def bytes_trailing(raw_bytes, needle=_compat.ZERO_BYTE):
# def bin(number, prefix="0b"):
# def hex(number, prefix="0x"):
# def is_sequence(obj):
# def is_unicode(obj):
# def is_bytes(obj):
# def is_bytes_or_unicode(obj):
# def is_integer(obj):
# def integer_byte_length(number):
# def integer_byte_size(number):
# def integer_bit_length(number):
# def integer_bit_size(number):
# def integer_bit_count(number):
# def is_even(num):
# def is_odd(num):
# def is_positive(num):
# def is_negative(num):
# 
# Path: mom/string.py
# ASCII_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
# ASCII_LOWERCASE = "abcdefghijklmnopqrstuvwxyz"
# ASCII_LETTERS = ASCII_LOWERCASE + ASCII_UPPERCASE
# DIGITS = "0123456789"
# PUNCTUATION = """!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"""
# PRINTABLE = """0123456789abcdefghijklmnopqrstuvwxyz\
# ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c"""
# WHITESPACE = "\t\n\x0b\x0c\r "


  import psyco
import array
import struct
from mom import _compat
from mom import builtins
from mom import string

b = builtins.b
ZERO_BYTE = _compat.ZERO_BYTE
UINT128_MAX = _compat.UINT128_MAX
UINT32_MAX = _compat.UINT32_MAX
EMPTY_BYTE = _compat.EMPTY_BYTE

EXCLAMATION_CHUNK = b("!!!!!")
ZERO_GROUP_CHAR = b("z")

# Use this if you want the base85 codec to encode/decode including
# ASCII85 prefixes/suffixes.
ASCII85_PREFIX = b("<~")
ASCII85_SUFFIX = b("~>")

# ASCII85 characters.
ASCII85_BYTES = array.array("B", [(num + 33) for num in builtins.range(85)])

# I've left this approach in here to warn you to NOT use it.
# This results in a massive amount of calls to byte_ord inside
# tight loops. Don't use the array. Use the dictionary. It
# removes the need to convert to ords at runtime.
# ASCII85_ORDS = array.array("B", [255] * 128)
# for ordinal, _byte in enumerate(ASCII85_BYTES):
#   ASCII85_ORDS[_byte] = ordinal


# http://tools.ietf.org/html/rfc1924
RFC1924_BYTES = array.array("B", (string.DIGITS +
                                  string.ASCII_UPPERCASE +

# Path: mom/_compat.py
#   INT_MAX = sys.maxsize
#   INT_MAX = sys.maxint
# INT64_MAX = (1 << 63) - 1
# INT32_MAX = (1 << 31) - 1
# INT16_MAX = (1 << 15) - 1
# UINT128_MAX = (1 << 128) - 1    # 340282366920938463463374607431768211455L
# UINT64_MAX = 0xffffffffffffffff  # ((1 << 64) - 1)
# UINT32_MAX = 0xffffffff  # ((1 << 32) - 1)
# UINT16_MAX = 0xffff  # ((1 << 16) - 1)
# UINT8_MAX = 0xff
#   MACHINE_WORD_SIZE = 64
#   UINT_MAX = UINT64_MAX
#   MACHINE_WORD_SIZE = 32
#   UINT_MAX = UINT32_MAX
#   MACHINE_WORD_SIZE = 64
#   UINT_MAX = UINT64_MAX
#   LONG_TYPE = long
#   LONG_TYPE = int
#   INT_TYPE = long
#   INTEGER_TYPES = (int, long)
#   INT_TYPE = int
#   INTEGER_TYPES = (int,)
#   BYTES_TYPE = bytes
#   BYTES_TYPE = str
#   UNICODE_TYPE = unicode
#   BASESTRING_TYPE = basestring
#   HAVE_PYTHON3 = False
#   UNICODE_TYPE = str
#   BASESTRING_TYPE = (str, bytes)
#   HAVE_PYTHON3 = True
# ZERO_BYTE = byte_literal("\x00")
# EMPTY_BYTE = byte_literal("")
# EQUAL_BYTE = byte_literal("=")
# PLUS_BYTE = byte_literal("+")
# HYPHEN_BYTE = byte_literal("-")
# FORWARD_SLASH_BYTE = byte_literal("/")
# UNDERSCORE_BYTE = byte_literal("_")
# DIGIT_ZERO_BYTE = byte_literal("0")
# HAVE_LITTLE_ENDIAN = bool(struct.pack("h", 1) == "\x01\x00")
#   def byte_ord(byte_):
#   def byte_ord(byte_):
#   def byte_literal(literal):
#   def byte_literal(literal):
#   def dict_each(func, iterable):
#   def dict_each(func, iterable):
#   def next(iterator, default=throw):
#   def generate_random_bytes(count):
#     def generate_random_bytes(count):
#       def generate_random_bytes(count):
#       def generate_random_bytes(_):
# def get_word_alignment(num, force_arch=64,
#                        _machine_word_size=MACHINE_WORD_SIZE):
#   class Throw(object):
# 
# Path: mom/builtins.py
# def byte(number):
# def bytes_leading(raw_bytes, needle=_compat.ZERO_BYTE):
# def bytes_trailing(raw_bytes, needle=_compat.ZERO_BYTE):
# def bin(number, prefix="0b"):
# def hex(number, prefix="0x"):
# def is_sequence(obj):
# def is_unicode(obj):
# def is_bytes(obj):
# def is_bytes_or_unicode(obj):
# def is_integer(obj):
# def integer_byte_length(number):
# def integer_byte_size(number):
# def integer_bit_length(number):
# def integer_bit_size(number):
# def integer_bit_count(number):
# def is_even(num):
# def is_odd(num):
# def is_positive(num):
# def is_negative(num):
# 
# Path: mom/string.py
# ASCII_UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
# ASCII_LOWERCASE = "abcdefghijklmnopqrstuvwxyz"
# ASCII_LETTERS = ASCII_LOWERCASE + ASCII_UPPERCASE
# DIGITS = "0123456789"
# PUNCTUATION = """!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"""
# PRINTABLE = """0123456789abcdefghijklmnopqrstuvwxyz\
# ABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c"""
# WHITESPACE = "\t\n\x0b\x0c\r "


# Path: mom/codec/base85.py
  import psyco
import array
import struct
from mom import _compat
from mom import builtins
from mom import string


b = builtins.b
ZERO_BYTE = _compat.ZERO_BYTE
UINT128_MAX = _compat.UINT128_MAX
UINT32_MAX = _compat.UINT32_MAX
EMPTY_BYTE = _compat.EMPTY_BYTE

EXCLAMATION_CHUNK = b("!!!!!")
ZERO_GROUP_CHAR = b("z")

# Use this if you want the base85 codec to encode/decode including
# ASCII85 prefixes/suffixes.
ASCII85_PREFIX = b("<~")
ASCII85_SUFFIX = b("~>")

# ASCII85 characters.
ASCII85_BYTES = array.array("B", [(num + 33) for num in builtins.range(85)])

# I've left this approach in here to warn you to NOT use it.
# This results in a massive amount of calls to byte_ord inside
# tight loops. Don't use the array. Use the dictionary. It
# removes the need to convert to ords at runtime.
# ASCII85_ORDS = array.array("B", [255] * 128)
# for ordinal, _byte in enumerate(ASCII85_BYTES):
#   ASCII85_ORDS[_byte] = ordinal


# http://tools.ietf.org/html/rfc1924
RFC1924_BYTES = array.array("B", (string.DIGITS +
                                  string.ASCII_UPPERCASE +

                                  string.ASCII_LOWERCASE +