# Path: mididings/misc.py
# def flatten(arg):
# def issequence(seq, accept_string=False):
# def issequenceof(seq, t):
# def islambda(f):
# def getargspec(f):
#     def __init__(self, replacement=None):
#     def wrapper(self, f, *args, **kwargs):
#     def __call__(self, f):
#     def __new__(cls, value, name):
#     def __init__(self, value, name):
#     def __getnewargs__(self):
#     def __repr__(self):
#     def __str__(self):
#     def __or__(self, other):
#     def __invert__(self):
# def prune_globals(g):
# def sequence_to_hex(data):
#     def __init__(self, data):
#     def __repr__(self):
# def get_terminal_size():
# class deprecated(object):
# class NamedFlag(int):
# class NamedBitMask(NamedFlag):
# class bytestring(object):


from mididings import misc
import inspect
import collections
import types
import functools
import decorator
    """
    A decorator that applies type checks and other constraints to the
    arguments of the decorated function.

    Constraints must be given in the order of the function's positional
    arguments, one constraint per argument. If the function accepts
    variable arguments, one additional constraint must be specified, and
    will be applied to each of those arguments.

    If the optional keyword argument add_varargs is True, the decorated
    function will accept variable arguments, which are combined with the
    last regular positional argument into a single tuple. This tuple is
    then passed to the original function as a single argument.

    The kwargs dictionary, itself passed as an optional keyword argument,
    maps keyword arguments to the corresponding constraints. None can be
    used as a key in this dictionary to specify constraints for keyword
    arguments with any name.
    """
    def __init__(self, *constraints, **kwargs):
        self.add_varargs = (kwargs['add_varargs']
                            if 'add_varargs' in kwargs else False)
        kwargs_constraints = kwargs['kwargs'] if 'kwargs' in kwargs else {}

        # build all constraints
        self.constraints = [_make_constraint(c) for c in constraints]
        self.kwargs_constraints = dict((k, _make_constraint(v))
                                        for k, v in kwargs_constraints.items())

    def __call__(self, f):

# Path: mididings/misc.py
# def flatten(arg):
# def issequence(seq, accept_string=False):
# def issequenceof(seq, t):
# def islambda(f):
# def getargspec(f):
#     def __init__(self, replacement=None):
#     def wrapper(self, f, *args, **kwargs):
#     def __call__(self, f):
#     def __new__(cls, value, name):
#     def __init__(self, value, name):
#     def __getnewargs__(self):
#     def __repr__(self):
#     def __str__(self):
#     def __or__(self, other):
#     def __invert__(self):
# def prune_globals(g):
# def sequence_to_hex(data):
#     def __init__(self, data):
#     def __repr__(self):
# def get_terminal_size():
# class deprecated(object):
# class NamedFlag(int):
# class NamedBitMask(NamedFlag):
# class bytestring(object):


# Path: mididings/arguments.py
from mididings import misc
import inspect
import collections
import types
import functools
import decorator

    """
    A decorator that applies type checks and other constraints to the
    arguments of the decorated function.

    Constraints must be given in the order of the function's positional
    arguments, one constraint per argument. If the function accepts
    variable arguments, one additional constraint must be specified, and
    will be applied to each of those arguments.

    If the optional keyword argument add_varargs is True, the decorated
    function will accept variable arguments, which are combined with the
    last regular positional argument into a single tuple. This tuple is
    then passed to the original function as a single argument.

    The kwargs dictionary, itself passed as an optional keyword argument,
    maps keyword arguments to the corresponding constraints. None can be
    used as a key in this dictionary to specify constraints for keyword
    arguments with any name.
    """
    def __init__(self, *constraints, **kwargs):
        self.add_varargs = (kwargs['add_varargs']
                            if 'add_varargs' in kwargs else False)
        kwargs_constraints = kwargs['kwargs'] if 'kwargs' in kwargs else {}

        # build all constraints
        self.constraints = [_make_constraint(c) for c in constraints]
        self.kwargs_constraints = dict((k, _make_constraint(v))
                                        for k, v in kwargs_constraints.items())

    def __call__(self, f):

        argspec = misc.getargspec(f)