

def set_up_output_directory(self, args):
    if args.output_directory:
        settings.output_directory = self.output_directory
    self.logger.debug('Using output directory: {}'.format(settings.output_directory))
    if os.path.exists(settings.output_directory):
        if args.force:
            self.logger.info('Removing existing output directory.')
            shutil.rmtree(settings.output_directory)
        else:
            self.logger.error('Output directory {} exists.'.format(settings.output_directory))
            self.logger.error('Please specify another location, or use -f option to overwrite.\n')
            sys.exit(1)
    self.logger.info('Creating output directory.')
    os.makedirs(settings.output_directory)
    os.makedirs(settings.meta_directory)

dataset/ETHPy150Open ARM-software/workload-automation/wlauto/commands/run.py RunCommand.set_up_output_directory/VarMisuse@23/30 `args`->`self`