@register.tag
def resetcycle(parser, token):
 args = token.split_contents()
 if (len(args) > 2):
  raise TemplateSyntaxError(('%r tag accepts at most one argument.' % args[0]))
 if (len(args) == 2):
  name = args[1]
  try:
   return ResetCycleNode(parser._named_cycle_nodes[name])
  except (AttributeError, KeyError):
   raise TemplateSyntaxError(("Named cycle '%s' does not exist." % name))
 try:
  return ResetCycleNode(parser._last_cycle_node)
 except AttributeError:
  raise TemplateSyntaxError('No cycles in template.')

@ register . tag def resetcycle ( parser , token ) : args = token . split_contents ( ) if ( len ( args ) > 2 ) : raise TemplateSyntaxError ( ( '%r tag accepts at most one argument.' % args [ 0 ] ) ) if ( len ( args ) == 2 ) : name = args [ 1 ] try : return ResetCycleNode ( parser . _named_cycle_nodes [ name ] ) except ( AttributeError , KeyError ) : raise TemplateSyntaxError ( ( "Named cycle '%s' does not exist." % name ) ) try : return ResetCycleNode ( parser . _last_cycle_node ) except AttributeError : raise TemplateSyntaxError ( 'No cycles in template.' )
resets a cycle tag .