def substrings_present(data, snippets, exclude=False):
    """Return True if all the strings in `snippets` are found in `data`.
    If `exclude` is True, instead return True if none of the strings
    in `snippets` are found.

    """
    results = (snip.encode("utf-8") in data for snip in snippets)
    if exclude:
        results = (not val for val in results)
    return all(results)