<s> import logging <EOL> import os <EOL> import sys <EOL> logging . basicConfig ( level = logging . ERROR ) <EOL> self_dir = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> top_dir = os . path . abspath ( <EOL> os . path . join ( self_dir , os . pardir , os . pardir , os . pardir ) ) <EOL> example_dir = os . path . abspath ( os . path . join ( self_dir , os . pardir ) ) <EOL> sys . path . insert ( <NUM_LIT:0> , top_dir ) <EOL> sys . path . insert ( <NUM_LIT:0> , example_dir ) <EOL> import taskflow . engines <EOL> from taskflow import states <EOL> import example_utils <EOL> FINISHED_STATES = ( states . SUCCESS , states . FAILURE , states . REVERTED ) <EOL> def resume ( flowdetail , backend ) : <EOL> print ( '<STR_LIT>' % ( flowdetail . name , flowdetail . uuid ) ) <EOL> engine = taskflow . engines . load_from_detail ( flow_detail = flowdetail , <EOL> backend = backend ) <EOL> engine . run ( ) <EOL> def main ( ) : <EOL> with example_utils . get_backend ( ) as backend : <EOL> logbooks = list ( backend . get_connection ( ) . get_logbooks ( ) ) <EOL> for lb in logbooks : <EOL> for fd in lb : <EOL> if fd . state not in FINISHED_STATES : <EOL> resume ( fd , backend ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
