def get_from_settings(settings, prefix='cors.', **kwargs):
    """
    Get settings `dict` with keys starting with `prefix`
    :param settings: settings dictionary
    :type settings: dict
    :param prefix: key prefix
    :type prefix: str
    :param kwargs: override settings
    :type kwargs: dict
    :return: extracted settings dict
    :rtype: dict
    """
    options = {
        key[len(prefix):]: settings[key]
        for key in settings
        if key.startswith(prefix)
    }
    options.update(kwargs)
    return options