import inspect


def function_exists(module, function):
    """
    Check Python module for specificed function.

    :param module: Python module
    :type module: ``types.ModuleType.``

    :param function: Name of the Python function
    :type ``str``

    :return: ``bool``
    """
    return hasattr(module, function) and any(
        function in f for f, _ in inspect.getmembers(
            module, inspect.isroutine))