def prepare_call(callable_, globals_):
    """
    Unwrap method decorators applied to ``callable_`` and
    tell whether the resulting object requires the ``self``
    argument to be called.
    
    Dereferences ``@staticmethod`` and ``@classmethod`` decorators
    and returns a flag telling whether explicit ``self`` argument
    is required. This method may be used when preparing class
    definitions (e.g. decorating methods) as well as at runtime.
    
    Parameters
    ----------
    callable_ : callable
        Reference to a function or method object or wrapper.
    globals_ : dict
        The dictionary of the module defining the target callable,
        or the local dictionary for the scope in which the target callable's
        container is defined. If the container has not yet been defined
        (e.g. when processing a decorator) this mapping should also contain
        its future qualified name mapped to the ``object`` type value.

    Returns
    -------
    callable
        Dereferenced callable object.
    boolean
        A flag telling whether explicit ``self`` argument must
        be on the argument list.

    Raises
    ------
    TypeError
        If the argument is not callable or has unknown type.

    """

    bindable = None
    if not callable(callable_) and hasattr(callable_, '__func__'):
        if isinstance(callable_, staticmethod):
            bindable = False
        callable_ = callable_.__func__
    if not callable(callable_):
        raise TypeError('Argument of type %s is not callable' % type(callable_).__name__)
    if hasattr(callable_, '__self__'):
        bindable = False
    if bindable is None:
        prefix = callable_.__qualname__[:-len(callable_.__name__)]
        if prefix:
            assert '.' == prefix[-1]
            prefix = prefix[:-1]
            try:
                bindable = isinstance(eval(prefix, globals_), type)
            except:
                bindable = False
        else:
            bindable = False
    return callable_, bindable