<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _retrieve(self, config_file=None):
 """Retrives credentials from a file. Defaults to the user config directory"""

        with open(config_file or _DEFAULT_PATH, 'r') as f:
            creds = json.load(f)
        self._key = creds.get('key')
        self._base_url = creds.get('base_url')
        self._username = creds.get('username')