    def _load_commands(self, commands_path):
        # type: (str) -> None
        '''
        Loads commands from a configuration file.

        Args:
            commands_path (str): Path to commands file.
        '''
        with open(commands_path, 'r') as f:
            commands = yaml.safe_load(f)

            self.commands = {} # type: Dict[str, Any]
            for name, cmd in commands.items():
                new_cmd = DEFAULT_COMMAND.copy()
                new_cmd.update(cmd)

                try:
                    new_cmd['fn'] = getattr(bot_commands, format(cmd['fn']))
                except AttributeError as e:
                    raise SecurityBotException('Invalid function: {0}'.format(e))

                self.commands[name] = new_cmd
        logging.info('Loaded commands: {0}'.format(self.commands.keys()))
Loads commands from a configuration file.

Args:
commands_path (str): Path to commands file.
securitybot/bot.py