<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def load_cfg(self):
        '''loads our config object accessible via self.cfg'''
        if self.cfg_mode == 'json':
            with open(self.cfg_file) as opened_file:
                return json.load(opened_file)
        else:
            with open(self.cfg_file) as ymlfile:
                return yaml.safe_load(ymlfile)