def remove(self, recursive=True, ignore_error=True):
try:<EOL><INDENT>if recursive or self._cleanup == '<STR_LIT>':<EOL><INDENT>shutil.rmtree(self.path)<EOL><DEDENT>else:<EOL><INDENT>os.rmdir(self.path)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>if not ignore_error:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>
Remove the directory.