def get_response(url, proxies=None):
    try:
        if proxies:
            if url.startswith('http:') and 'http' in proxies:
                prox = proxies['http']
                if prox.startswith('socks'):
                    session.proxies = proxies
                    r = session.get(url)
                else:  # http proxy
                    r = requests.get(url, proxies = proxies)
            elif url.startswith('https:') and 'https' in proxies:
                prox = proxies['https']
                if prox.startswith('socks'):
                    session.proxies = proxies
                    r = session.get(url)
                else:
                    r = requests.get(url, proxies = proxies)
            else:  # ohter types of requests, e.g., ftp
                r = requests.get(url, proxies = proxies)

        else:  # without proxy
            r = requests.get(url)
    except __HOLE__:
        logger.error('Url is invalid: %s' % url)
        return
    except requests.exceptions.ConnectionError:
        logger.error("Error connecting to %s" % url)
        return

    if r.status_code != 200:
        logger.error('Status code is %d on %s' % (r.status_code, url))
        return

    return r.content
dataset/ETHPy150Open numb3r3/crawler-python/crawler/core/base.py/get_response