def METHOD_NAME(self, fo=None):
    if fo is None:
        if self.etag == self.file_etag:
            logger.debug("Discover file up to date.")
            return
        self.mtime = None
    with (fo or open(self.path, 'w')) as fo:
        fo.METHOD_NAME(self.json.decode('utf-8'))
    if self.mtime is None:  # if not sys.stdout.
        logger.debug("Wrote discover.json with ETag %s.", self.etag)
        self.mtime = os.stat(self.path).st_mtime
        self.file_etag = self.etag