def _run_lambda_function(event, context, app, config):  # pragma: no cover
    """Run the function. This is the default when no plugins (such as wsgi)
    define an alternative run function."""
    args = event.get('args', [])
    kwargs = event.get('kwargs', {})

    # first attempt to invoke the function passing the lambda event and context
    try:
        ret = app(*args, event=event, context=context, **kwargs)
    except TypeError:
        # try again without passing the event and context
        ret = app(*args, **kwargs)
    return ret