MCPcopy Create free account
hub / github.com/InternScience/SciReason / check_internet

Function check_internet

opencompass/datasets/cibench.py:100–110  ·  view source on GitHub ↗

A tricky way to check internet.

()

Source from the content-addressed store, hash-verified

98
99
100def check_internet():
101 """A tricky way to check internet."""
102 import socket
103
104 import nltk
105 socket.setdefaulttimeout(10)
106 ret = nltk.download('stopwords', quiet=True)
107 socket.setdefaulttimeout(None)
108 if not ret:
109 raise ConnectionError('CIBench needs internet to get response. Please'
110 'check your internet and proxy.')
111
112
113@LOAD_DATASET.register_module()

Callers 1

loadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected