def METHOD_NAME(func):
    """
    Decorator to check user and serial at the beginning of a function
    The wrapper will check the parameters user and serial and verify that
    not both parameters are None. Otherwise it will throw an exception
    ParameterError.
    """
    @functools.wraps(func)
    def user_or_serial_wrapper(*args, **kwds):
        # If there is no user and serial keyword parameter and if
        # there is no normal argument, we do not have enough information
        serial = kwds.get("serial")
        user = kwds.get("user")
        # We have no serial! The serial would be the first arg
        if (serial is None and (len(args) == 0 or args[0] is None) and
                (user is None or (user is not None and user.is_empty()))):
            # We either have an empty User object or None
            raise ParameterError(ParameterError.USER_OR_SERIAL)
        if serial:
            check_serial_valid(serial)
        f_result = func(*args, **kwds)
        return f_result
    return user_or_serial_wrapper