



'''simple docstring'''





class       UpperCAmelCase__:

   '''simple docstring'''




   def __init__(						self  :			int			,				lowerCAmelCase  :			Any)	->				Union[str, Any]:




         """simple docstring"""

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


   def 			UpperCAmelCase		(						self  :			str			,				lowerCAmelCase  :			Dict			,				lowerCAmelCase  :			Any)	->				List[str]:




         """simple docstring"""

         lowercase__     =  self.get_parent(lowercase__)
         lowercase__     =  self.get_parent(lowercase__)

         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]
               lowercase__     =  0
               lowercase__     =  dst_parent
               if self.ranks[dst_parent] == self.ranks[src_parent]:
                     self.ranks[dst_parent] += 1
               lowercase__     =  self.set_counts[dst_parent]
         else:
               self.set_counts[src_parent] += self.set_counts[dst_parent]
               lowercase__     =  0
               lowercase__     =  src_parent
               lowercase__     =  self.set_counts[src_parent]

         lowercase__     =  max(self.max_set			,				lowercase__)
         return True



   def 			UpperCAmelCase		(						self  :			Tuple			,				lowerCAmelCase  :			Union[str, Any])	->				Union[str, Any]:




         """simple docstring"""

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





import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin



class       UpperCAmelCase__(							unittest.TestCase     ,							lowerCamelCase	):

   '''simple docstring'''




   def 			UpperCAmelCase		(						self  :			List[str])	->				Any:




         """simple docstring"""

         lowercase__     =  load_tool('text-classification')
         self.tool.setup()
         lowercase__     =  load_tool('text-classification'			,				remote=lowerCAmelCase)


   def 			UpperCAmelCase		(						self  :			Any)	->				Tuple:




         """simple docstring"""

         lowercase__     =  self.tool('That\'s quite cool'			,				['positive', 'negative'])
         self.assertEqual(lowerCAmelCase			,				'positive')


   def 			UpperCAmelCase		(						self  :			int)	->				Optional[int]:




         """simple docstring"""

         lowercase__     =  self.remote_tool('That\'s quite cool'			,				['positive', 'negative'])
         self.assertEqual(lowerCAmelCase			,				'positive')


   def 			UpperCAmelCase		(						self  :			Optional[Any])	->				Union[str, Any]:




         """simple docstring"""

         lowercase__     =  self.tool(text='That\'s quite cool'			,				labels=['positive', 'negative'])
         self.assertEqual(lowerCAmelCase			,				'positive')



   def 			UpperCAmelCase		(						self  :			Any)	->				Any:




         """simple docstring"""

         lowercase__     =  self.remote_tool(text='That\'s quite cool'			,				labels=['positive', 'negative'])
         self.assertEqual(lowerCAmelCase			,				'positive')
