def select_template(template_name_list):
 not_found = []
 for template_name in template_name_list:
  try:
   return get_template(template_name)
  except TemplateDoesNotExist as e:
   if (e.args[0] not in not_found):
    not_found.append(e.args[0])
   continue
 raise TemplateDoesNotExist(', '.join(not_found))

def select_template ( template_name_list ) : not_found = [ ] for template_name in template_name_list : try : return get_template ( template_name ) except TemplateDoesNotExist as e : if ( e . args [ 0 ] not in not_found ) : not_found . append ( e . args [ 0 ] ) continue raise TemplateDoesNotExist ( ', ' . join ( not_found ) )
try to load one of the given templates .