def normalize_extension(extension: str) ->str:
    """Ensures all extensions begin with a dot."""
    assert extension
    if extension and extension[0] != '.':
        extension = f'.{extension}'
    return extension.lower()
