human
Complete this python program:
def getPage(url, contextFactory=None, response_transform=None, *args, **kwargs):
assistant
#Here is the Python code you requested.

    """Adapted version of twisted.web.client.getPage
    """
    def _clientfactory(url, *args, **kwargs):
        url = to_unicode(url)
        timeout = kwargs.pop('timeout', 0)
        f = client.ScrapyHTTPClientFactory(Request(url, *args, **kwargs), timeout=timeout)
        f.deferred.addCallback((response_transform or (lambda r: r.body)))
        return f
    from twisted.web.client import _makeGetterFactory
    return _makeGetterFactory(to_bytes(url), _clientfactory, contextFactory=contextFactory, *args, **kwargs).deferred