def short_cycle_task(*args, **kwargs):
 def decorator(f):
  f._short_cycle_task = True
  f._ticks_between_runs = kwargs.pop('ticks_between_runs', 0)
  return f
 if kwargs:
  return decorator
 else:
  return decorator(args[0])

def short_cycle_task ( * args , ** kwargs ) : def decorator ( f ) : f . _short_cycle_task = True f . _ticks_between_runs = kwargs . pop ( 'ticks_between_runs' , 0 ) return f if kwargs : return decorator else : return decorator ( args [ 0 ] )
decorator to indicate that a method is a periodic task .