<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def zinnia_loop_template(context, default_template):
 """ Return a selected template from his position within a loop and the filtering context. """

    matching, context_object = get_context_first_matching_object(
        context,
        ['category', 'tag', 'author', 'pattern',
         'year', 'month', 'week', 'day'])
    context_positions = get_context_loop_positions(context)

    templates = loop_template_list(
        context_positions, context_object, matching,
        default_template, ENTRY_LOOP_TEMPLATES)

    return select_template(templates)