def arg_parse(self, args=None):
        """
        This function will parse the configuration file that was provided as a
        system argument into a dictionary.

        :return: a dictionary containing the parsed config file.
        """

        arg_vec = args if args else sys.argv

        # Parse arguments
        if len(arg_vec) < 3:
            print('WARNING: No configuration file.')

        # Initialize random seed
        random.seed(time.time())

        cfg_filename = arg_vec[2]
        if isinstance(cfg_filename, str):
            if os.path.isfile(cfg_filename):
                # Choose config parser
                if cfg_filename[-5:] == '.yaml':
                    with open(cfg_filename, 'r') as file:
                        cfg_parser = yaml.load(file, Loader=yaml.Loader)
                elif cfg_filename[-4:] == '.cfg':
                    cfg_parser = configparser.ConfigParser()
                    cfg_parser.read(cfg_filename)
                else:
                    raise ValueError('Unknown configuration file type: %s'
                                     % cfg_filename)
            else:
                raise FileNotFoundError('Configuration file %s not found'
                                        % cfg_filename)
        else:
            raise ValueError('Unacceptable value for configuration file name: '
                             '%s ' % cfg_filename)

        tests = 1
        dialogues = 10
        interaction_mode = 'simulation'
        num_agents = 1

        if cfg_parser:
            dialogues = int(cfg_parser['DIALOGUE']['num_dialogues'])

            if 'interaction_mode' in cfg_parser['GENERAL']:
                interaction_mode = cfg_parser['GENERAL']['interaction_mode']

                if 'agents' in cfg_parser['GENERAL']:
                    num_agents = int(cfg_parser['GENERAL']['agents'])

                elif interaction_mode == 'multi_agent':
                    print('WARNING! Multi-Agent interaction mode selected but '
                          'number of agents is undefined in config.')

            if 'initiative' in cfg_parser['DIALOGUE']:
                self.initiative = cfg_parser['DIALOGUE']['initiative']

        return {'cfg_parser': cfg_parser,
                'tests': tests,
                'dialogues': dialogues,
                'interaction_mode': interaction_mode,
                'num_agents': num_agents,
                'test_mode': False}

        This function will parse the configuration file that was provided as a
        system argument into a dictionary.

        :return: a dictionary containing the parsed config file.
        
plato/controller/sgui_controller.py