def METHOD_NAME(request):
    if not request.full_url in context.urlrequest_responses:
        raise urllib.error.URLError('Unknown URL')
    return closing(io.BytesIO(context.urlrequest_responses[request.full_url].encode('utf-8')))