






'''simple docstring'''

import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class     A    (      unittest.TestCase,   SCREAMING_SNAKE_CASE__						):






 """simple docstring"""





 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							load_tool("""text-classification""" )
       self.tool.setup()
       UpperCamelCase_				:   int					    =							load_tool("""text-classification"""			,     remote=__lowerCAmelCase )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[str]					    =							self.tool("""That's quite cool"""			,     ["""positive""", """negative"""] )
       self.assertEqual(__lowerCAmelCase			,     """positive""" )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Any					    =							self.remote_tool("""That's quite cool"""			,     ["""positive""", """negative"""] )
       self.assertEqual(__lowerCAmelCase			,     """positive""" )
 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   List[str]					    =							self.tool(text="""That's quite cool"""			,     labels=["""positive""", """negative"""] )
       self.assertEqual(__lowerCAmelCase			,     """positive""" )





 def   _UpperCAmelCase       (							self ):
       UpperCamelCase_				:   Tuple					    =							self.remote_tool(text="""That's quite cool"""			,     labels=["""positive""", """negative"""] )
       self.assertEqual(__lowerCAmelCase			,     """positive""" )














'''simple docstring'''

from datetime import datetime

import matplotlib.pyplot as plt
import torch



def 							snake_case					(     a_							: List[Any]	)       ->				Any:





      """simple docstring"""

      for param in module.parameters():
            UpperCamelCase_				:   Dict					    =							False



def 							snake_case					(     )       ->				List[str]:





      """simple docstring"""

      UpperCamelCase_				:   List[str]					    =							"""cuda""" if torch.cuda.is_available() else """cpu"""
      if torch.backends.mps.is_available() and torch.backends.mps.is_built():
            UpperCamelCase_				:   int					    =							"""mps"""
      if device == "mps":
            print(
                """WARNING: MPS currently doesn't seem to work, and messes up backpropagation without any visible torch"""
                """ errors. I recommend using CUDA on a colab notebook or CPU instead if you're facing inexplicable issues"""
                """ with generations."""	)
      return device



def 							snake_case					(     a_							: str	)       ->				Dict:





      """simple docstring"""

      UpperCamelCase_				:   Optional[int]					    =							plt.imshow(a_	)
      fig.axes.get_xaxis().set_visible(a_	)
      fig.axes.get_yaxis().set_visible(a_	)
      plt.show()



def 							snake_case					(     )       ->				Optional[Any]:





      """simple docstring"""

      UpperCamelCase_				:   Optional[Any]					    =							datetime.now()
      UpperCamelCase_				:   int					    =							current_time.strftime("""%H:%M:%S"""	)
      return timestamp






