def load_config(self, config_file):
        """Validates give file as settings file for BGPSpeaker.

        Load the configuration from file as settings module.
        """
        if not config_file or not isinstance(config_file, str):
            raise ApplicationException('Invalid configuration file.')

        # Check if file can be read
        try:
            return imp.load_source('settings', config_file)
        except Exception as e:
            raise ApplicationException(desc=str(e))
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/application.py/RyuBGPSpeaker.load_config/original