def entry_point(__func: Callable) -> Callable:
    """Execute function when module is run directly.

    Note:
        This allows fall through for importing modules that use it.

    Args:
        __func: Function to run
    """
    if __func.__module__ == '__main__':
        import sys
        sys.exit(__func())
    else:
        return __func
def entry_point ( __func : Callable ) -> Callable : if __func . __module__ == '__main__' : import sys sys . exit ( __func ( ) ) else : return __func
Execute function when module is run directly.

    Note:
        This allows fall through for importing modules that use it.

    Args:
        __func: Function to run