
'''simple docstring'''
import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin







class  __A				( unittest.TestCase    ,						_SCREAMING_SNAKE_CASE			):
 def 		lowercase_(   self			:    int       ):



   """simple docstring"""





   __A		:     List[str]												=		load_tool("""text-classification"""       )
   self.tool.setup()
   __A		:     Dict												=		load_tool("""text-classification"""				,   remote=lowerCamelCase       )
 def 		lowercase_(   self			:    Any       ):



   """simple docstring"""





   __A		:     Union[str, Any]												=		self.tool("""That's quite cool"""				,   ["""positive""", """negative"""]       )
   self.assertEqual(lowerCamelCase				,   """positive"""       )
 def 		lowercase_(   self			:    str       ):



   """simple docstring"""





   __A		:     Optional[Any]												=		self.remote_tool("""That's quite cool"""				,   ["""positive""", """negative"""]       )
   self.assertEqual(lowerCamelCase				,   """positive"""       )
 def 		lowercase_(   self			:    List[Any]       ):



   """simple docstring"""





   __A		:     List[Any]												=		self.tool(text="""That's quite cool"""				,   labels=["""positive""", """negative"""]       )
   self.assertEqual(lowerCamelCase				,   """positive"""       )






 def 		lowercase_(   self			:    Tuple       ):



   """simple docstring"""





   __A		:     Any												=		self.remote_tool(text="""That's quite cool"""				,   labels=["""positive""", """negative"""]       )
   self.assertEqual(lowerCamelCase				,   """positive"""       )





'''simple docstring'''
from collections.abc import Sequence







def        A_     (						__SCREAMING_SNAKE_CASE						:  Sequence[float]			,     __SCREAMING_SNAKE_CASE						:  bool = False )				->       float:





  """simple docstring"""

  if not arr:
    return 0

  __A		:     Any												=		0 if allow_empty_subarrays else float("""-inf""" )
  __A		:     List[Any]												=		0.0
  for num in arr:
    __A		:     Tuple												=		max(0 if allow_empty_subarrays else num			,     curr_sum + num )
    __A		:     Optional[int]												=		max(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )

  return max_sum


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

     testmod()

     A__   :		Any 		=[-2, 1, -3, 4, -1, 2, 1, -5, 4]
     print(F"{max_subarray_sum(nums) = }")



