# 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 functools
# -*- coding: utf-8 -*-
#
# mididings
#
# Copyright (C) 2008-2014  Dominic Sacré  <dominic.sacre@gmx.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#




def call(args, kwargs, funcs, name=None):
    """
    Search funcs for a function with parameters such that args and kwargs
    can be applied, and call the first suitable function that is found.
    """
    for f in funcs:
        n = len(args)

        # get argument names and the number of default arguments of 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/overload.py
from mididings import misc
import inspect
import functools

# -*- coding: utf-8 -*-
#
# mididings
#
# Copyright (C) 2008-2014  Dominic Sacré  <dominic.sacre@gmx.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#




def call(args, kwargs, funcs, name=None):
    """
    Search funcs for a function with parameters such that args and kwargs
    can be applied, and call the first suitable function that is found.
    """
    for f in funcs:
        n = len(args)

        # get argument names and the number of default arguments of f

        argspec = misc.getargspec(f)