def module_of_callable(c):
    """Find name of module where callable is defined
    
    Arguments:
        c {Callable} -- Callable to inspect
    
    Returns:
        str -- Module name (as for x.__module__ attribute)
    """
    # Ordinal function defined with def or lambda:
    if type(c).__name__ == 'function':
        return c.__module__
    # Some callable, probably it's a class with __call_ method, so define module of declaration rather than a module of instantiation:
    return c.__class__.__module__