def _filter_by_extension(bundle, extension):
    """Return only files with the given extension"""
    for chunk in bundle:
        if chunk['name'].endswith('.{0}'.format(extension)):
            yield chunk
