





class 	UpperCamelCase_							:


							def __init__(				self     :int				,					__A     :list		) -> None:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   set_counts
									SCREAMING_SNAKE_CASE__								=   max(__A		)
									SCREAMING_SNAKE_CASE__								=   len(__A		)
									SCREAMING_SNAKE_CASE__								=   [1] * num_sets
									SCREAMING_SNAKE_CASE__								=   list(range(__A		)		)


							def   _snake_case	(				self     :Union[str, Any]				,					__A     :int				,					__A     :int		) -> bool:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=   self.get_parent(__A		)
									SCREAMING_SNAKE_CASE__								=   self.get_parent(__A		)

									if src_parent == dst_parent:
											return False

									if self.ranks[dst_parent] >= self.ranks[src_parent]:
											self.set_counts[dst_parent] += self.set_counts[src_parent]
											SCREAMING_SNAKE_CASE__								=   0
											SCREAMING_SNAKE_CASE__								=   dst_parent
											if self.ranks[dst_parent] == self.ranks[src_parent]:
													self.ranks[dst_parent] += 1
											SCREAMING_SNAKE_CASE__								=   self.set_counts[dst_parent]
									else:
											self.set_counts[src_parent] += self.set_counts[dst_parent]
											SCREAMING_SNAKE_CASE__								=   0
											SCREAMING_SNAKE_CASE__								=   src_parent
											SCREAMING_SNAKE_CASE__								=   self.set_counts[src_parent]

									SCREAMING_SNAKE_CASE__								=   max(self.max_set				,					__A		)
									return True


							def   _snake_case	(				self     :Union[str, Any]				,					__A     :int		) -> int:



									"""simple docstring"""



									if self.parents[disj_set] == disj_set:
											return disj_set
									SCREAMING_SNAKE_CASE__								=   self.get_parent(self.parents[disj_set]		)
									return self.parents[disj_set]



"""simple docstring"""

import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline


@pytest.mark.integration
def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT			):
  with pytest.raises(UpperCamelCase__			):
   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_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.CONNECTION_FAILS			):
  with pytest.raises(requests.exceptions.ConnectionError			):
   requests.request("""GET"""					, """https://huggingface.co"""			)


def lowerCAmelCase_   (					):






 """simple docstring"""







 with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1			):
  with pytest.raises(UpperCamelCase__			):
   http_head("""https://huggingface.co"""			)
