



def 	_lowerCAmelCase (    A__    ,	A__    ,	A__=False						):

      if isinstance(A__    ,	A__						) and isinstance(A__    ,	A__						):
            lowercase__  =	len(set_a.intersection(A__						)						)

            if alternative_union:
                  lowercase__  =	len(A__						) + len(A__						)
            else:
                  lowercase__  =	len(set_a.union(A__						)						)

            return intersection / union

      if isinstance(A__    ,	(list, tuple)						) and isinstance(A__    ,	(list, tuple)						):
            lowercase__  =	[element for element in set_a if element in set_b]

            if alternative_union:
                  lowercase__  =	len(A__						) + len(A__						)
                  return len(A__						) / union
            else:
                  lowercase__  =	set_a + [element for element in set_b if element not in set_a]
                  return len(A__						) / len(A__						)

            return len(A__						) / len(A__						)
      return None


if __name__ == "__main__":
       a__   :					Dict 						=      {"a", "b", "c", "d", "e"}
       a__   :					List[Any] 						=      {"c", "d", "e", "f", "h", "i"}
       print(jaccard_similarity(set_a, set_b))





import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline

@pytest.mark.integration
def 	_lowerCAmelCase (    ):
      with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT						):
            with pytest.raises(A__						):
                  requests.request('GET'    ,	'https://huggingface.co'						)
            with pytest.raises(requests.exceptions.ConnectTimeout						):
                  requests.request('GET'    ,	'https://huggingface.co'    ,	timeout=1.0						)

@pytest.mark.integration
def 	_lowerCAmelCase (    ):
      with offline(OfflineSimulationMode.CONNECTION_FAILS						):
            with pytest.raises(requests.exceptions.ConnectionError						):
                  requests.request('GET'    ,	'https://huggingface.co'						)

def 	_lowerCAmelCase (    ):
      with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1						):
            with pytest.raises(A__						):
                  http_head('https://huggingface.co'						)
