



'''simple docstring'''






class 							lowercase       :


 """simple docstring"""


 def __init__(							self  ,a_							)		->   Optional[Any]:
        _UpperCAmelCase  :						Tuple			     = set_counts
        _UpperCAmelCase  :						List[Any]			     = max(UpperCamelCase__							)
        _UpperCAmelCase  :						List[Any]			     = len(UpperCamelCase__							)
        _UpperCAmelCase  :						int			     = [1] * num_sets
        _UpperCAmelCase  :						Tuple			     = list(range(UpperCamelCase__							)							)







 def _snake_case (							self  ,a_  ,a_							)		->   Optional[int]:
        _UpperCAmelCase  :						List[str]			     = self.get_parent(UpperCamelCase__							)
        _UpperCAmelCase  :						Dict			     = self.get_parent(UpperCamelCase__							)

        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]
               _UpperCAmelCase  :						Dict			     = 0
               _UpperCAmelCase  :						List[str]			     = dst_parent
               if self.ranks[dst_parent] == self.ranks[src_parent]:
                      self.ranks[dst_parent] += 1
               _UpperCAmelCase  :						List[Any]			     = self.set_counts[dst_parent]
        else:
               self.set_counts[src_parent] += self.set_counts[dst_parent]
               _UpperCAmelCase  :						int			     = 0
               _UpperCAmelCase  :						List[Any]			     = src_parent
               _UpperCAmelCase  :						Dict			     = self.set_counts[src_parent]

        _UpperCAmelCase  :						List[str]			     = max(self.max_set  ,UpperCamelCase__							)
        return True







 def _snake_case (							self  ,a_							)		->   List[Any]:





        if self.parents[disj_set] == disj_set:
               return disj_set
        _UpperCAmelCase  :						List[str]			     = self.get_parent(self.parents[disj_set]							)
        return self.parents[disj_set]




import pytest

import datasets.config
from datasets.utils.info_utils import is_small_dataset
@pytest.mark.parametrize('''dataset_size'''		,  [None, 400 * 2**20, 600 * 2**20]						)
@pytest.mark.parametrize('''input_in_memory_max_size'''		,  ['''default''', 0, 100 * 2**20, 900 * 2**20]						)
def       A	(    _lowercase		,  _lowercase		,  _lowercase						):
						if input_in_memory_max_size != "default":
												monkeypatch.setattr(datasets.config		,  '''IN_MEMORY_MAX_SIZE'''		,  _lowercase						)
						SCREAMING_SNAKE_CASE							:    Tuple							=							datasets.config.IN_MEMORY_MAX_SIZE
						if input_in_memory_max_size == "default":
												assert in_memory_max_size == 0
						else:
												assert in_memory_max_size == input_in_memory_max_size
						if dataset_size and in_memory_max_size:
												SCREAMING_SNAKE_CASE							:    str							=							dataset_size < in_memory_max_size
						else:
												SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							False
						SCREAMING_SNAKE_CASE							:    Any							=							is_small_dataset(_lowercase						)
						assert result == expected





