# Path: auxlib/compat.py
# def isiterable(obj):
# 
# Path: auxlib/decorators.py
# def memoizedproperty(func):
#     """
#     Decorator to cause a method to cache it's results in self for each
#     combination of inputs and return the cached result on subsequent calls.
#     Does not support named arguments or arg values that are not hashable.
# 
#     >>> class Foo (object):
#     ...   _x = 1
#     ...   @memoizedproperty
#     ...   def foo(self):
#     ...     self._x += 1
#     ...     print('updating and returning {0}'.format(self._x))
#     ...     return self._x
#     ...
#     >>> foo1 = Foo()
#     >>> foo2 = Foo()
#     >>> foo1.foo
#     updating and returning 2
#     2
#     >>> foo1.foo
#     2
#     >>> foo2.foo
#     updating and returning 2
#     2
#     >>> foo1.foo
#     2
#     """
#     inner_attname = '__%s' % func.__name__
# 
#     def new_fget(self):
#         if not hasattr(self, '_cache_'):
#             self._cache_ = dict()
#         cache = self._cache_
#         if inner_attname not in cache:
#             cache[inner_attname] = func(self)
#         return cache[inner_attname]
# 
#     return property(new_fget)
# 
# Path: auxlib/exceptions.py
# class AuxlibError(object):
#     """Mixin to identify exceptions associated with the auxlib package."""


from collections import Mapping
from itertools import chain
from re import IGNORECASE, compile
from enum import Enum
from .compat import NoneType, integer_types, isiterable, iteritems, string_types, text_type
from .decorators import memoizedproperty
from .exceptions import AuxlibError
        return type(value)(typify(v, type_hint) for v in value)
    elif (isinstance(value, string_types)
          and isinstance(type_hint, type) and issubclass(type_hint, string_types)):
        # This block is necessary because if we fall through to typify(), we end up calling
        # .strip() on the str, when sometimes we want to preserve preceding and trailing
        # whitespace.
        return type_hint(value)
    else:
        return typify(value, type_hint)


def maybecall(value):
    return value() if callable(value) else value


def listify(val, return_type=tuple):
    """
    Examples:
        >>> listify('abc', return_type=list)
        ['abc']
        >>> listify(None)
        ()
        >>> listify(False)
        (False,)
        >>> listify(('a', 'b', 'c'), return_type=list)
        ['a', 'b', 'c']
    """
    # TODO: flatlistify((1, 2, 3), 4, (5, 6, 7))
    if val is None:
        return return_type()

# Path: auxlib/compat.py
# def isiterable(obj):
# 
# Path: auxlib/decorators.py
# def memoizedproperty(func):
#     """
#     Decorator to cause a method to cache it's results in self for each
#     combination of inputs and return the cached result on subsequent calls.
#     Does not support named arguments or arg values that are not hashable.
# 
#     >>> class Foo (object):
#     ...   _x = 1
#     ...   @memoizedproperty
#     ...   def foo(self):
#     ...     self._x += 1
#     ...     print('updating and returning {0}'.format(self._x))
#     ...     return self._x
#     ...
#     >>> foo1 = Foo()
#     >>> foo2 = Foo()
#     >>> foo1.foo
#     updating and returning 2
#     2
#     >>> foo1.foo
#     2
#     >>> foo2.foo
#     updating and returning 2
#     2
#     >>> foo1.foo
#     2
#     """
#     inner_attname = '__%s' % func.__name__
# 
#     def new_fget(self):
#         if not hasattr(self, '_cache_'):
#             self._cache_ = dict()
#         cache = self._cache_
#         if inner_attname not in cache:
#             cache[inner_attname] = func(self)
#         return cache[inner_attname]
# 
#     return property(new_fget)
# 
# Path: auxlib/exceptions.py
# class AuxlibError(object):
#     """Mixin to identify exceptions associated with the auxlib package."""


# Path: auxlib/type_coercion.py
from collections import Mapping
from itertools import chain
from re import IGNORECASE, compile
from enum import Enum
from .compat import NoneType, integer_types, isiterable, iteritems, string_types, text_type
from .decorators import memoizedproperty
from .exceptions import AuxlibError

        return type(value)(typify(v, type_hint) for v in value)
    elif (isinstance(value, string_types)
          and isinstance(type_hint, type) and issubclass(type_hint, string_types)):
        # This block is necessary because if we fall through to typify(), we end up calling
        # .strip() on the str, when sometimes we want to preserve preceding and trailing
        # whitespace.
        return type_hint(value)
    else:
        return typify(value, type_hint)


def maybecall(value):
    return value() if callable(value) else value


def listify(val, return_type=tuple):
    """
    Examples:
        >>> listify('abc', return_type=list)
        ['abc']
        >>> listify(None)
        ()
        >>> listify(False)
        (False,)
        >>> listify(('a', 'b', 'c'), return_type=list)
        ['a', 'b', 'c']
    """
    # TODO: flatlistify((1, 2, 3), 4, (5, 6, 7))
    if val is None:
        return return_type()

    elif isiterable(val):