human
Complete this python program:
def get_example_test(tested_func, msg, results, privmsg, admin, owner, repeat, use_regexp, ignore=[]):
assistant
#Here is the Python program you requested.

    """Get a function that calls tested_func with fake wrapper and trigger.
    Args:
    tested_func - A sopel callable that accepts SopelWrapper and Trigger.
    msg - Message that is supposed to trigger the command.
    results - Expected output from the callable.
    privmsg - If true, make the message appear to have sent in a private
    message to the bot. If false, make it appear to have come from a
    channel.
    admin - If true, make the message appear to have come from an admin.
    owner - If true, make the message appear to have come from an owner.
    repeat - How many times to repeat the test. Usefull for tests that
    return random stuff.
    use_regexp = Bool. If true, results is in regexp format.
    ignore - List of strings to ignore.
    """
    def test():
        bot = MockSopel(u'NickName', admin=admin, owner=owner)
        match = None
        if hasattr(tested_func, u'commands'):
            for command in tested_func.commands:
                regexp = sopel.tools.get_command_regexp(u'.', command)
                match = regexp.match(msg)
                if match:
                    break
        assert match, u'Example    did    not    match    any    command.'
        sender = (bot.nick if privmsg else u'#channel')
        hostmask = (u'%s!%s@%s    ' % (bot.nick, u'UserName', u'example.com'))
        full_message = u':{}    PRIVMSG    {}    :{}'.format(hostmask, sender, msg)
        pretrigger = sopel.trigger.PreTrigger(bot.nick, full_message)
        trigger = sopel.trigger.Trigger(bot.config, pretrigger, match)
        module = sys.modules[tested_func.__module__]
        if hasattr(module, u'setup'):
            module.setup(bot)
        def isnt_ignored(value):
            u"Return    True    if    value    doesn't    match    any    re    in    ignore    list."
            for ignored_line in ignore:
                if re.match(ignored_line, value):
                    return False
            return True
        for _i in range(repeat):
            wrapper = MockSopelWrapper(bot, trigger)
            tested_func(wrapper, trigger)
            wrapper.output = list(filter(isnt_ignored, wrapper.output))
            assert (len(wrapper.output) == len(results))
            for (result, output) in zip(results, wrapper.output):
                if (type(output) is bytes):
                    output = output.decode(u'utf-8')
                if use_regexp:
                    if (not re.match(result, output)):
                        assert (result == output)
                else:
                    assert (result == output)
    return test