code: def _prepare_temp_dir(self):
      
      shell_call(['rm', '-rf', os.path.join(self._temp_dir, '*')])
      # NOTE: we do not create self._extracted_submission_dir
      # this is intentional because self._tmp_extracted_dir or it's subdir
      # will be renames into self._extracted_submission_dir
      os.mkdir(self._tmp_extracted_dir)
      os.mkdir(self._sample_input_dir)
      os.mkdir(self._sample_output_dir)
      # make output dir world writable
      shell_call(['chmod', 'a+rwX', '-R', self._sample_output_dir])
docs: Cleans up and prepare temporary directory.