


import unittest
from dataclasses import dataclass
from typing import Optional

from transformers.utils import ModelOutput





@dataclass
class 					snake_case   (   lowercase      ):





  """simple docstring"""




  _lowerCamelCase		   =  42
  _lowerCamelCase		   =  None
  _lowerCamelCase		   =  None





class 					snake_case   (   unittest.TestCase      ):





  """simple docstring"""




  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest(a=30					)
   self.assertEqual(x.a      ,  30					)
   self.assertIsNone(x.b					)
   self.assertIsNone(x.c					)
   with self.assertRaises(__A					):
    lowerCamelCase_								=  x.d






  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest(a=30      ,  b=10					)
   self.assertEqual(x[0]      ,  30					)
   self.assertEqual(x[1]      ,  10					)
   self.assertEqual(x[:2]      ,  (30, 10)					)
   self.assertEqual(x[:]      ,  (30, 10)					)

   lowerCamelCase_								=  ModelOutputTest(a=30      ,  c=10					)
   self.assertEqual(x[0]      ,  30					)
   self.assertEqual(x[1]      ,  10					)
   self.assertEqual(x[:2]      ,  (30, 10)					)
   self.assertEqual(x[:]      ,  (30, 10)					)






  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest(a=30      ,  b=10					)
   self.assertEqual(x["a"]      ,  30					)
   self.assertEqual(x["b"]      ,  10					)
   with self.assertRaises(__A					):
    lowerCamelCase_								=  x["c"]

   lowerCamelCase_								=  ModelOutputTest(a=30      ,  c=10					)
   self.assertEqual(x["a"]      ,  30					)
   self.assertEqual(x["c"]      ,  10					)
   with self.assertRaises(__A					):
    lowerCamelCase_								=  x["b"]






  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest(a=30					)
   self.assertEqual(list(x.keys()					)      ,  ["a"]					)
   self.assertEqual(list(x.values()					)      ,  [30]					)
   self.assertEqual(list(x.items()					)      ,  [("a", 30)]					)
   self.assertEqual(list(__A					)      ,  ["a"]					)

   lowerCamelCase_								=  ModelOutputTest(a=30      ,  b=10					)
   self.assertEqual(list(x.keys()					)      ,  ["a", "b"]					)
   self.assertEqual(list(x.values()					)      ,  [30, 10]					)
   self.assertEqual(list(x.items()					)      ,  [("a", 30), ("b", 10)]					)
   self.assertEqual(list(__A					)      ,  ["a", "b"]					)

   lowerCamelCase_								=  ModelOutputTest(a=30      ,  c=10					)
   self.assertEqual(list(x.keys()					)      ,  ["a", "c"]					)
   self.assertEqual(list(x.values()					)      ,  [30, 10]					)
   self.assertEqual(list(x.items()					)      ,  [("a", 30), ("c", 10)]					)
   self.assertEqual(list(__A					)      ,  ["a", "c"]					)

   with self.assertRaises(__A					):
    lowerCamelCase_								=  x.update({"d": 20}					)
   with self.assertRaises(__A					):
    del x["a"]
   with self.assertRaises(__A					):
    lowerCamelCase_								=  x.pop("a"					)
   with self.assertRaises(__A					):
    lowerCamelCase_								=  x.setdefault("d"      ,  32					)






  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest(a=30					)
   lowerCamelCase_								=  10
   self.assertEqual(x.a      ,  10					)
   self.assertEqual(x["a"]      ,  10					)






  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest(a=30					)
   lowerCamelCase_								=  10
   self.assertEqual(x.a      ,  10					)
   self.assertEqual(x["a"]      ,  10					)






  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest({"a": 30, "b": 10}					)
   self.assertEqual(list(x.keys()					)      ,  ["a", "b"]					)
   self.assertEqual(x.a      ,  30					)
   self.assertEqual(x.b      ,  10					)







  def   snake_case		(   self					):







   """simple docstring"""
   lowerCamelCase_								=  ModelOutputTest([("a", 30), ("b", 10)]					)
   self.assertEqual(list(x.keys()					)      ,  ["a", "b"]					)
   self.assertEqual(x.a      ,  30					)
   self.assertEqual(x.b      ,  10					)

   with self.assertRaises(__A					):
    lowerCamelCase_								=  ModelOutputTest([("a", 30), (10, 10)]					)

   lowerCamelCase_								=  ModelOutputTest(a=(30, 30)					)
   self.assertEqual(list(x.keys()					)      ,  ["a"]					)
   self.assertEqual(x.a      ,  (30, 30)					)







'''simple docstring'''

def __snake_case (				UpperCAmelCase_						:						float		):
 return -num if num < 0 else num





def __snake_case (				UpperCAmelCase_						:						list[int]		):
 if len(UpperCAmelCase_		) == 0:
  raise ValueError("abs_min() arg is an empty sequence"		)
 lowerCamelCase_								=  x[0]
 for i in x:
  if abs_val(UpperCAmelCase_		) < abs_val(UpperCAmelCase_		):
   lowerCamelCase_								=  i
 return j





def __snake_case (				UpperCAmelCase_						:						list[int]		):
 if len(UpperCAmelCase_		) == 0:
  raise ValueError("abs_max() arg is an empty sequence"		)
 lowerCamelCase_								=  x[0]
 for i in x:
  if abs(UpperCAmelCase_		) > abs(UpperCAmelCase_		):
   lowerCamelCase_								=  i
 return j





def __snake_case (				UpperCAmelCase_						:						list[int]		):
 if len(UpperCAmelCase_		) == 0:
  raise ValueError("abs_max_sort() arg is an empty sequence"		)
 return sorted(UpperCAmelCase_ ,    key=UpperCAmelCase_		)[-1]





def __snake_case (				):
 assert abs_val(0		) == 0
 assert abs_val(34		) == 34
 assert abs_val(-100000000000		) == 100000000000

 lowerCamelCase_								=  [-3, -1, 2, -11]
 assert abs_max(UpperCAmelCase_		) == -11
 assert abs_max_sort(UpperCAmelCase_		) == -11
 assert abs_min(UpperCAmelCase_		) == -1


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     test_abs_val()
     print(abs_val(-34))  # --> 34



