<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _remove_code(site):
 """ Delete project files @type site: Site """

    def handle_error(function, path, excinfo):
        click.secho('Failed to remove path ({em}): {p}'.format(em=excinfo.message, p=path), err=True, fg='red')

    if os.path.exists(site.root):
        shutil.rmtree(site.root, onerror=handle_error)