<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_gtapp(appname, dry_run, **kwargs):
 """Build an object that can run ScienceTools application Parameters appname : str Name of the application (e.g., gtbin) dry_run : bool Print command but do not run it kwargs : arguments used to invoke the application Returns `GtApp.GtApp` object that will run the application in question """

    pfiles_orig = _set_pfiles(dry_run, **kwargs)
    gtapp = GtApp.GtApp(appname)
    update_gtapp(gtapp, **kwargs)
    _reset_pfiles(pfiles_orig)
    return gtapp