def execute_side_effect(side_effect=UNDEFINED, args=UNDEFINED, kwargs=UNDEFINED):
    """
    Executes a side effect if one is defined.

    :param side_effect: The side effect to execute
    :type side_effect: Mixed. If it's an exception it's raised. If it's callable it's called with teh parameters.
    :param tuple args: The arguments passed to the stubbed out method
    :param dict kwargs: The kwargs passed to the subbed out method.

    :rtype: mixed
    :returns: Whatever the passed side_effect returns
    :raises: Whatever error is defined as the side_effect
    """
    if args == UNDEFINED:
        args = tuple()
    if kwargs == UNDEFINED:
        kwargs = {}
    if isinstance(side_effect, (BaseException, Exception, StandardError)):
        raise side_effect
    elif hasattr(side_effect, '__call__'): # If it's callable...
        return side_effect(*args, **kwargs)
    else:
        raise Exception("Caliendo doesn't know what to do with your side effect. {0}".format(side_effect))