<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_to_matching_blacklist(session, term):
 """Add term to the matching blacklist. This function adds a `term` to the matching blacklist. The term to add cannot have a `None` or empty value, on this case an `ValueError` will be raised. :param session: database session :param term: term, word or value to blacklist :return: a new entry in the blacklist :raises ValueError: raised when `term` is `None` or an empty string """

    if term is None:
        raise ValueError("'term' to blacklist cannot be None")
    if term == '':
        raise ValueError("'term' to blacklist cannot be an empty string")

    mb = MatchingBlacklist(excluded=term)
    session.add(mb)

    return mb