<s> import os <EOL> import time <EOL> from datetime import datetime <EOL> from celery import Celery <EOL> celery = Celery ( "<STR_LIT>" , broker = "<STR_LIT>" ) <EOL> celery . conf . CELERY_RESULT_BACKEND = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> @ celery . task <EOL> def add ( x , y ) : <EOL> return int ( x ) + int ( y ) <EOL> @ celery . task <EOL> def sleep ( seconds ) : <EOL> time . sleep ( float ( seconds ) ) <EOL> return seconds <EOL> @ celery . task <EOL> def echo ( msg , timestamp = False ) : <EOL> return "<STR_LIT>" % ( datetime . now ( ) , msg ) if timestamp else msg <EOL> @ celery . task <EOL> def error ( msg ) : <EOL> raise Exception ( msg ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> celery . start ( ) </s>
