#NEWLINE# def runs_once( func ) : #NEWLINE# #INDENT# '\n    Decorator preventing wrapped function from running more than once.\n\n    By keeping internal state, this decorator allows you to mark a function\n    such that it will only run once per Python interpreter session, which in\n    typical use means "once per invocation of the ``fab`` program".\n\n    Any function wrapped with this decorator will silently fail to execute the\n    2nd, 3rd, ..., Nth time it is called, and will return the value of the\n    original run.\n    \n    .. note:: ``runs_once`` does not work with parallel task execution.\n    ' #NEWLINE# @ wraps ( func ) #NEWLINE# def decorated( * args , **kwargs ) : #NEWLINE# #INDENT# if ( not hasattr ( decorated , 'return_value' ) ) : #NEWLINE# #INDENT# decorated . return_value = func ( * args , ** kwargs ) #NEWLINE# #UNINDENT# return decorated . return_value #NEWLINE# #UNINDENT# decorated = _wrap_as_new ( func , decorated ) #NEWLINE# return serial ( decorated )