
"""simple docstring"""




def 							a__ (				lowerCAmelCase	:       str		):
     UpperCAmelCase__							: Optional[int] 							=						set()
     # To detect a back edge, keep track of vertices currently in the recursion stack
     UpperCAmelCase__							: str 							=						set()
     return any(
         node not in visited and depth_first_search(_lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase		)
         for node in graph		)



def 							a__ (				lowerCAmelCase	:       Union[str, Any]       ,    lowerCAmelCase	:       int       ,    lowerCAmelCase	:       Tuple       ,    lowerCAmelCase	:       Tuple		):
     visited.add(_lowerCAmelCase		)
     rec_stk.add(_lowerCAmelCase		)

     for node in graph[vertex]:
          if node not in visited:
               if depth_first_search(_lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase		):
                    return True
          elif node in rec_stk:
               return True

    # The node needs to be removed from recursion stack before function ends
     rec_stk.remove(_lowerCAmelCase		)
     return False


if __name__ == "__main__":
    from doctest import testmod

    testmod()





"""simple docstring"""




import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin







class   _lowercase						(       unittest.TestCase	,   lowerCAmelCase_				):


     '''simple docstring'''





     def  lowerCAmelCase__       (      self  )->					Dict:
          UpperCAmelCase__							: Optional[Any] 							=						load_tool("text-classification"  )
          self.tool.setup()
          UpperCAmelCase__							: List[str] 							=						load_tool("text-classification" ,			remote=__UpperCamelCase  )



     def  lowerCAmelCase__       (      self  )->					Union[str, Any]:
          UpperCAmelCase__							: Dict 							=						self.tool("That's quite cool" ,			["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



     def  lowerCAmelCase__       (      self  )->					str:
          UpperCAmelCase__							: List[Any] 							=						self.remote_tool("That's quite cool" ,			["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



     def  lowerCAmelCase__       (      self  )->					Optional[int]:
          UpperCAmelCase__							: Any 							=						self.tool(text="That's quite cool" ,			labels=["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



     def  lowerCAmelCase__       (      self  )->					str:
          UpperCAmelCase__							: str 							=						self.remote_tool(text="That's quite cool" ,			labels=["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



