def _save_config(filename, config):
 try:
  with open(filename, 'w') as fdesc:
   fdesc.write(json.dumps(config, indent=4, sort_keys=True))
 except (IOError, TypeError) as error:
  _LOGGER.error('Saving configuration file failed: %s', error)
  return False
 return True

def _save_config ( filename , config ) : try : with open ( filename , 'w' ) as fdesc : fdesc . write ( json . dumps ( config , indent = 4 , sort_keys = True ) ) except ( IOError , TypeError ) as error : _LOGGER . error ( 'Saving configuration file failed: %s' , error ) return False return True
save configuration .