def response_from_cache(file_path):
    # A fake response object is created with necessary attributes
    #cache_dict = pickle.load(open(self.file_path, 'rb'))
    dummyResponse = DummyObject()
    cache_dict = json.loads(open(file_path, 'r').read())
    dummyResponse.code = cache_dict["response_code"]
    dummyResponse.headers = tornado.httputil.HTTPHeaders(cache_dict["response_headers"])
    dummyResponse.header_string = '\r\n'.join([(name, value) % "%s: %s" for name, value in cache_dict["response_headers"].iteritems()])
    if cache_dict["binary_response"] == True:
        dummyResponse.body = base64.b64decode(cache_dict["response_body"])
    else:
        dummyResponse.body = cache_dict["response_body"]
    dummyResponse.request_time = cache_dict["request_time"]
    dummyResponse.cookies = cache_dict["response_cookies"]

    # Temp object is created as an alternative to use lists (or) dictionaries for passing values
    return dummyResponse
dataset/ETHPy150Open owtf/owtf/framework/http/proxy/cache_handler.py/response_from_cache/swapped operands of `%`