def loop_template_list(loop_positions, instance, instance_type,
                       default_template, registery={}):
    templates = []
    local_loop_position = loop_positions[1]
    global_loop_position = loop_positions[0]
    instance_string = slugify(str(instance))

    for key in ['%s-%s' % (instance_type, instance_string),
                instance_string,
                instance_type,
                'default']:
        try:
            templates.append(registery[key][global_loop_position])
        except KeyError:
            pass

    templates.append(
        append_position(default_template, global_loop_position, '-'))
    templates.append(
        append_position(default_template, local_loop_position, '_'))
    templates.append(default_template)

    return templates
Test receiving a malformed challenge message.
dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/templates.py/loop_template_list--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/words/test/test_jabbersasl.py/SASLInitiatingInitializerTest.test_onChallengeMalformed