code: def write_file(self):
          '''save config to local file'''
          if self.config:
              try:
                  with open(self.config_file, 'w') as file:
                      json.dump(self.config, file)
              except IOError as error:
                  print('Error:', error)
                  returf write_file(self):
          '''save config to local file'''
          if self.config:
              try:
                  with open(self.config_file, 'w') as file:
                      json.dump(self.config, file)
              except IOError as error:
                  print('Error:', error)
                  return
docs: save config to local file