<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_config(self, access_token):
 """ Write credentials to the config file """

        self.config.add_section('exist')

        # TODO: config is reading 'None' as string during authorization, so clearing this out
        # if no id or secret is set - need to fix this later
        if self.client_id:
            self.config.set('exist', 'client_id', self.client_id)
        else:
            self.config.set('exist', 'client_id', '')

        if self.client_secret:
            self.config.set('exist', 'client_secret', self.client_secret)
        else:
            self.config.set('exist', 'client_secret', '')

        self.config.set('exist', 'access_token', access_token)

        with open(self.config_file, 'w') as cfg:
            self.config.write(cfg)
        print('Credentials written to %s' % self.config_file)