def set(self, key, response):
        key = self._clean_key(key)
        path = os.path.join(self.cache_dir, key)

        with open(path, 'wb') as f:
            status_str = 'status: {0}\n'.format(response.status_code)
            f.write(status_str.encode('utf8'))
            encoding_str = 'encoding: {0}\n'.format(response.encoding)
            f.write(encoding_str.encode('utf8'))
            for h, v in response.headers.items():
                # header: value\n
                f.write(h.encode('utf8'))
                f.write(b': ')
                f.write(v.encode('utf8'))
                f.write(b'\n')
            # one blank line
            f.write(b'\n')
            f.write(response.content)
If no L{Action} is specified, and the current execution context has no
dataset/ETHPy150Open jamesturk/scrapelib/scrapelib/cache.py/FileCache.set--crossover with--dataset/ETHPy150Open ClusterHQ/eliot/eliot/tests/test_message.py/MessageTests.test_missingAction