def METHOD_NAME(self):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    location = ("127.0.0.1", 9050)
    try:
        s.connect(location)
        s.close()
        return True
    except Exception as e:
        logger.exception(e)
        return False