#NEWLINE# def manual_run( turn_into_run = True , store_meta_data = True , clean_up = True ) : #NEWLINE# #INDENT# 'Can be used to decorate a function as a manual run function.\n\n    This can be helpful if you want the run functionality without using an environment.\n\n    :param turn_into_run:\n\n        If the trajectory should become a `single run` with more specialized functionality\n        during a single run.\n\n    :param store_meta_data:\n\n        If meta-data like runtime should be automatically stored\n\n    :param clean_up:\n\n        If all data added during the single run should be removed, only works\n        if ``turn_into_run=True``.\n\n    ' #NEWLINE# def wrapper( func ) : #NEWLINE# #INDENT# @ functools . wraps ( func ) #NEWLINE# def new_func( traj , * args , **kwargs ) : #NEWLINE# #INDENT# do_wrap = ( not traj . _run_by_environment ) #NEWLINE# if do_wrap : #NEWLINE# #INDENT# traj . f_start_run ( turn_into_run = turn_into_run ) #NEWLINE# #UNINDENT# result = func ( traj , * args , ** kwargs ) #NEWLINE# if do_wrap : #NEWLINE# #INDENT# traj . f_finalize_run ( store_meta_data = store_meta_data , clean_up = clean_up ) #NEWLINE# #UNINDENT# return result #NEWLINE# #UNINDENT# return new_func #NEWLINE# #UNINDENT# return wrapper