# Path: mididings/overload.py
# def call(args, kwargs, funcs, name=None):
#     def __init__(self, name, docstring):
#     def add(self, f):
#     def __call__(self, *args, **kwargs):
# def _register_overload(f, docstring):
# def mark(f, docstring=None):
#     def call_overload(*args, **kwargs):
#     def __init__(self, *partial_args):
#     def __call__(self, f):
#         def call_overload(*args, **kwargs):
# class _Overload(object):
# class partial(object):
# 
# Path: mididings/arguments.py
# class accept(object):
# class _constraint(object):
# class _any(_constraint):
# class _type_constraint(_constraint):
# class _value_constraint(_constraint):
# class nullable(_constraint):
# class sequenceof(_constraint):
# class tupleof(_constraint):
# class mappingof(_constraint):
# class flatten(_constraint):
# class each(_constraint):
# class either(_constraint):
# class transform(_constraint):
# class condition(_constraint):
# class reduce_bitmask(_constraint):
#     def __init__(self, *constraints, **kwargs):
#     def __call__(self, f):
#     def wrapper(self, f, *args, **kwargs):
# def _apply_constraint(constraint, arg, func_name, arg_name):
# def _make_constraint(c):
#     def __call__(self, arg):
#     def __init__(self, types, multiple=False):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, values):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, *what):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, fromwhat, towhat):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what, return_type=None):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, *requirements):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, *alternatives):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, function):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, function):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what):
#     def __call__(self, arg):
# def _function_repr(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):


from mididings import overload
from mididings import arguments
from mididings import misc
import inspect
import sys
import decorator
    """
    unit = f(*args, **kwargs)

    # store the unit's name, the function object, and the value of
    # each argument
    unit._name = f.name if isinstance(f, overload._Overload) else f.__name__
    unit._function = f
    unit._args = args

    return unit


def accept(*constraints, **kwargs):
    """
    @arguments.accept() and @unitrepr.store composed into a single decorator
    for convenience.
    """
    def composed(f):
        return arguments.accept(*constraints, **kwargs) (store(f))
    return composed



def unit_to_string(unit):
    # can't do anything for units that didn't go through @store (or @accept)
    assert hasattr(unit, '_name')

    argnames = misc.getargspec(unit._function)[0]

    args = [

# Path: mididings/overload.py
# def call(args, kwargs, funcs, name=None):
#     def __init__(self, name, docstring):
#     def add(self, f):
#     def __call__(self, *args, **kwargs):
# def _register_overload(f, docstring):
# def mark(f, docstring=None):
#     def call_overload(*args, **kwargs):
#     def __init__(self, *partial_args):
#     def __call__(self, f):
#         def call_overload(*args, **kwargs):
# class _Overload(object):
# class partial(object):
# 
# Path: mididings/arguments.py
# class accept(object):
# class _constraint(object):
# class _any(_constraint):
# class _type_constraint(_constraint):
# class _value_constraint(_constraint):
# class nullable(_constraint):
# class sequenceof(_constraint):
# class tupleof(_constraint):
# class mappingof(_constraint):
# class flatten(_constraint):
# class each(_constraint):
# class either(_constraint):
# class transform(_constraint):
# class condition(_constraint):
# class reduce_bitmask(_constraint):
#     def __init__(self, *constraints, **kwargs):
#     def __call__(self, f):
#     def wrapper(self, f, *args, **kwargs):
# def _apply_constraint(constraint, arg, func_name, arg_name):
# def _make_constraint(c):
#     def __call__(self, arg):
#     def __init__(self, types, multiple=False):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, values):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, *what):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, fromwhat, towhat):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what, return_type=None):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, *requirements):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, *alternatives):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, function):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, function):
#     def __call__(self, arg):
#     def __repr__(self):
#     def __init__(self, what):
#     def __call__(self, arg):
# def _function_repr(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/unitrepr.py
from mididings import overload
from mididings import arguments
from mididings import misc
import inspect
import sys
import decorator

    """
    unit = f(*args, **kwargs)

    # store the unit's name, the function object, and the value of
    # each argument
    unit._name = f.name if isinstance(f, overload._Overload) else f.__name__
    unit._function = f
    unit._args = args

    return unit


def accept(*constraints, **kwargs):
    """
    @arguments.accept() and @unitrepr.store composed into a single decorator
    for convenience.
    """
    def composed(f):
        return arguments.accept(*constraints, **kwargs) (store(f))
    return composed



def unit_to_string(unit):
    # can't do anything for units that didn't go through @store (or @accept)
    assert hasattr(unit, '_name')

    argnames = misc.getargspec(unit._function)[0]

    args = [

        misc.bytestring(a) if isinstance(a, bytearray) else a