






class 				__A     :





				"""simple docstring"""







				def __init__( self							,  lowerCamelCase__    ):




									"""simple docstring"""

									__UpperCamelCase      :					str       		=set_counts
									__UpperCamelCase      :					Optional[Any]       		=max(lowerCamelCase__    )
									__UpperCamelCase      :					Dict       		=len(lowerCamelCase__    )
									__UpperCamelCase      :					Optional[Any]       		=[1] * num_sets
									__UpperCamelCase      :					Optional[Any]       		=list(range(lowerCamelCase__    )    )


				def       __lowercase							( self							,  lowerCamelCase__							,  lowerCamelCase__    ):




									"""simple docstring"""

									__UpperCamelCase      :					List[Any]       		=self.get_parent(lowerCamelCase__    )
									__UpperCamelCase      :					List[str]       		=self.get_parent(lowerCamelCase__    )

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

									__UpperCamelCase      :					Tuple       		=max(self.max_set							,  lowerCamelCase__    )
									return True







				def       __lowercase							( self							,  lowerCamelCase__    ):




									"""simple docstring"""

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






"""simple docstring"""

import numpy as np




def __lowercase			(							_a    ):
    return (2 / (1 + np.exp(-2 * vector    ))) - 1


if __name__ == "__main__":
     import doctest

     doctest.testmod()





