

def internet_on():
    import urllib2
    import socket
    socket.setdefaulttimeout(1)
    try:
        response = urllib2.urlopen('http://google.com')
       #x= response
        #print x
        #print 'asda'
        socket.setdefaulttimeout(10)
        return True
    except urllib2.URLError: pass
    return False

0a3ffdf347288b76661dbb1460fe1dfa28a7025e
<mask token>

def internet_on():
    import urllib2
    import socket
    socket.setdefaulttimeout(1)
    try:
        response = urllib2.urlopen('http://google.com')
        socket.setdefaulttimeout(10)
        return True
    except urllib2.URLError:
        pass
    return False



def internet_on():
    import urllib2
    import socket
    socket.setdefaulttimeout(1)
    try:
        response = urllib2.urlopen('http://google.com')
       #x= response
        #print x
        #print 'asda'
        socket.setdefaulttimeout(10)
        return True
    except urllib2.URLError: pass
    return False
