# Path: patmat/mimic.py
# def Mimic(*args, **kwargs):
#     """Lazy programmer's stuff.
# 
#     Automatically determines the correct mimic instances from definition.
#     """
#     if kwargs:
#         if args:
#             raise ValueError('Attribute matching should not take a sequence.')
#         for k, v in kwargs.items():
#             kwargs[k] = Mimic(v)
#         return Attr(**kwargs)
#     if len(args) > 1:
#         return Seq(args)
#     value = args[0]
#     if isinstance(value, type):
#         return Type(value)
#     if isinstance(value, list):
#         return List(Mimic(v) for v in value)
#     if isinstance(value, tuple):
#         return Tuple(Mimic(v) for v in value)
#     if isinstance(value, dict):
#         return Dict({Mimic(k): Mimic(v) for k, v in value.items()})
#     if callable(value):
#         return Pred(value)
#     return value


    from itertools import zip_longest
    from itertools import izip_longest as zip_longest
from patmat.mimic import Mimic
        if len(value_list) == 1:
            return value_list[0]
        return value_list


class FunctionNotMatched(Exception):
    """Function is unmatched.  """


class _DotDict(dict):
    def __init__(self, dictionary, **kwargs):
        dictionary = dict(dictionary, **kwargs)
        super(_DotDict, self).__init__(dictionary)
        self.__dict__.update(dictionary)


class Dispatcher(object):
    def __init__(self):
        self.func_map = {}

    def __call__(self, func):
        arg_defaults = func.__defaults__ or tuple()
        arg_names = func.__code__.co_varnames[1:]
        if len(arg_names) != len(arg_defaults):
            raise SyntaxError('Each argument must have a default value.')
        if not arg_names:  # no arguments
            return func
        arg_sig = {k: v for k, v in zip(arg_names, arg_defaults)}
        func_name = func.__code__.co_name
        func_list = self.func_map.setdefault(func_name, [])

# Path: patmat/mimic.py
# def Mimic(*args, **kwargs):
#     """Lazy programmer's stuff.
# 
#     Automatically determines the correct mimic instances from definition.
#     """
#     if kwargs:
#         if args:
#             raise ValueError('Attribute matching should not take a sequence.')
#         for k, v in kwargs.items():
#             kwargs[k] = Mimic(v)
#         return Attr(**kwargs)
#     if len(args) > 1:
#         return Seq(args)
#     value = args[0]
#     if isinstance(value, type):
#         return Type(value)
#     if isinstance(value, list):
#         return List(Mimic(v) for v in value)
#     if isinstance(value, tuple):
#         return Tuple(Mimic(v) for v in value)
#     if isinstance(value, dict):
#         return Dict({Mimic(k): Mimic(v) for k, v in value.items()})
#     if callable(value):
#         return Pred(value)
#     return value


# Path: patmat/match.py
    from itertools import zip_longest
    from itertools import izip_longest as zip_longest
from patmat.mimic import Mimic

        if len(value_list) == 1:
            return value_list[0]
        return value_list


class FunctionNotMatched(Exception):
    """Function is unmatched.  """


class _DotDict(dict):
    def __init__(self, dictionary, **kwargs):
        dictionary = dict(dictionary, **kwargs)
        super(_DotDict, self).__init__(dictionary)
        self.__dict__.update(dictionary)


class Dispatcher(object):
    def __init__(self):
        self.func_map = {}

    def __call__(self, func):
        arg_defaults = func.__defaults__ or tuple()
        arg_names = func.__code__.co_varnames[1:]
        if len(arg_names) != len(arg_defaults):
            raise SyntaxError('Each argument must have a default value.')
        if not arg_names:  # no arguments
            return func
        arg_sig = {k: v for k, v in zip(arg_names, arg_defaults)}
        func_name = func.__code__.co_name
        func_list = self.func_map.setdefault(func_name, [])

        func_list.append((func, Mimic(arg_sig)))