def apply_substitutions(contents, subs):
    """Apply the provided set of `subs` to `contents`, replacing any occurrences of each KEY with each VALUE.

    Args:
        contents: Contents of the file which we should replace within.
        subs: Map of substitutions to apply.
    
    Returns:
        Rendered file result after applying the substitutions."""

    return contents.format(**subs)