<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _setup_dir(self, base_dir):
 """ Creates stats directory for storing stat files. `base_dir` Base directory. """

        stats_dir = self._sdir(base_dir)

        if not os.path.isdir(stats_dir):
            try:
                os.mkdir(stats_dir)
            except OSError:
                raise errors.DirectorySetupFail()