




'''simple docstring'''


import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin





class  __lowercase    (	unittest.TestCase							,				__magic_name__			):







   def 		UpperCamelCase__      (						self   )					->     List[Any]:
     __a								=       load_tool('text-classification'   )
     self.tool.setup()
     __a								=       load_tool('text-classification'   ,				remote=UpperCamelCase   )







   def 		UpperCamelCase__      (						self   )					->     Any:
     __a								=       self.tool('That\'s quite cool'   ,				['positive', 'negative']   )
     self.assertEqual(UpperCamelCase   ,				'positive'   )







   def 		UpperCamelCase__      (						self   )					->     Optional[int]:
     __a								=       self.remote_tool('That\'s quite cool'   ,				['positive', 'negative']   )
     self.assertEqual(UpperCamelCase   ,				'positive'   )







   def 		UpperCamelCase__      (						self   )					->     int:
     __a								=       self.tool(text='That\'s quite cool'   ,				labels=['positive', 'negative']   )
     self.assertEqual(UpperCamelCase   ,				'positive'   )







   def 		UpperCamelCase__      (						self   )					->     str:
     __a								=       self.remote_tool(text='That\'s quite cool'   ,				labels=['positive', 'negative']   )
     self.assertEqual(UpperCamelCase   ,				'positive'   )









'''simple docstring'''


class  __lowercase    :  # Public class to implement a graph







   def __init__(						self   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )					->     None:
     __a								=       row
     __a								=       col
     __a								=       graph







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )					->     bool:
     return (
         0 <= i < self.ROW
         and 0 <= j < self.COL
         and not visited[i][j]
         and self.graph[i][j]
     )







   def 		UpperCamelCase__      (						self   ,				UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )					->     None:
     # Checking all 8 elements surrounding nth element
     __a								=       [-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
     __a								=       [-1, 0, 1, -1, 1, -1, 0, 1]
     __a								=       True  # Make those cells visited
     for k in range(8   ):
       if self.is_safe(i + row_nbr[k]   ,				j + col_nbr[k]   ,				UpperCamelCase   ):
         self.diffs(i + row_nbr[k]   ,				j + col_nbr[k]   ,				UpperCamelCase   )







   def 		UpperCamelCase__      (						self   )					->     int:  # And finally, count all islands.
     __a								=       [[False for j in range(self.COL   )] for i in range(self.ROW   )]
     __a								=       0
     for i in range(self.ROW   ):
       for j in range(self.COL   ):
         if visited[i][j] is False and self.graph[i][j] == 1:
           self.diffs(UpperCamelCase   ,				UpperCamelCase   ,				UpperCamelCase   )
           count += 1
     return count



