<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shutdown(self, exitcode=0):
 """Stops system stats, streaming handlers, and uploads files without output, used by wandb.monitor"""

        logger.info("shutting down system stats and metadata service")
        self._system_stats.shutdown()
        self._meta.shutdown()

        if self._cloud:
            logger.info("stopping streaming files and file change observer")
            self._stop_file_observer()
            self._end_file_syncing(exitcode)

        self._run.history.close()