def fake_urlopen(stash_client, url):
    """
    A stub urlopen() implementation that load json responses from
    the filesystem.
    """
    # Map path from url to a file
    parsed_url = urlparse(url)
    resource_file = os.path.normpath(
        (os.path.dirname(os.path.abspath(__file__)), parsed_url.path) % '%s/resources/%s.json')
    # Must return Response
    resp = Response()
    resp.status_code = 200
    resp.json = lambda: json.loads(open(resource_file, mode='rb').read().decode('utf-8'))
    return resp
dataset/ETHPy150Open RisingOak/stashy/tests/test_pullrequests.py/fake_urlopen/swapped operands of `%`