# 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
        self.towhat = _make_constraint(towhat)

    def __call__(self, arg):
        if not isinstance(arg, dict):
            raise TypeError("not a dictionary")
        try:
            keys = (self.fromwhat(key) for key in arg.keys())
        except (TypeError, ValueError) as ex:
            raise type(ex)("illegal key in dictionary: %s" % str(ex))
        try:
            values = (self.towhat(value) for value in arg.values())
        except (TypeError, ValueError) as ex:
            raise type(ex)("illegal value in dictionary: %s" % str(ex))
        return dict(zip(keys, values))

    def __repr__(self):
        return repr({self.fromwhat: self.towhat})


class flatten(_constraint):
    """
    Flattens all arguments into a single list, and applies a constraint to
    each element in that list.
    """
    def __init__(self, what, return_type=None):
        self.what = _make_constraint(what)
        self.return_type = return_type

    def __call__(self, arg):
        try:

# 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

        self.towhat = _make_constraint(towhat)

    def __call__(self, arg):
        if not isinstance(arg, dict):
            raise TypeError("not a dictionary")
        try:
            keys = (self.fromwhat(key) for key in arg.keys())
        except (TypeError, ValueError) as ex:
            raise type(ex)("illegal key in dictionary: %s" % str(ex))
        try:
            values = (self.towhat(value) for value in arg.values())
        except (TypeError, ValueError) as ex:
            raise type(ex)("illegal value in dictionary: %s" % str(ex))
        return dict(zip(keys, values))

    def __repr__(self):
        return repr({self.fromwhat: self.towhat})


class flatten(_constraint):
    """
    Flattens all arguments into a single list, and applies a constraint to
    each element in that list.
    """
    def __init__(self, what, return_type=None):
        self.what = _make_constraint(what)
        self.return_type = return_type

    def __call__(self, arg):
        try:

            r = [self.what(value) for value in misc.flatten(arg)]