






import unittest

from knapsack import greedy_knapsack as kp
class        SCREAMING_SNAKE_CASE     (unittest.TestCase   ):


   def  SCREAMING_SNAKE_CASE_							(					self    :       Dict )->     Tuple:





     """simple docstring"""







     lowercase__			    =						[10, 20, 30, 40, 50, 60]
     lowercase__			    =						[2, 4, 6, 8, 10, 12]
     lowercase__			    =						100
     self.assertEqual(kp.calc_profit(a_    ,  a_    ,  a_ )    ,  210 )


   def  SCREAMING_SNAKE_CASE_							(					self    :       List[str] )->     Any:





     """simple docstring"""







     self.assertRaisesRegex(a_    ,  'max_weight must greater than zero.' )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Optional[int] )->     int:





     """simple docstring"""







     self.assertRaisesRegex(a_    ,  'Weight can not be negative.' )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Any )->     Optional[Any]:





     """simple docstring"""







     self.assertRaisesRegex(a_    ,  'Profit can not be negative.' )


   def  SCREAMING_SNAKE_CASE_							(					self    :       List[str] )->     Tuple:





     """simple docstring"""







     self.assertRaisesRegex(a_    ,  'max_weight must greater than zero.' )


   def  SCREAMING_SNAKE_CASE_							(					self    :       Optional[int] )->     Union[str, Any]:





     """simple docstring"""







     self.assertRaisesRegex(
         a_    ,  'The length of profit and weight must be same.' )


if __name__ == "__main__":
      unittest.main()









def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     bool:
  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise ValueError('Input series is not valid, valid series - [2, 4, 6]'	)
  if len(_SCREAMING_SNAKE_CASE	) == 0:
    raise ValueError('Input list must be a non empty list'	)
  if len(_SCREAMING_SNAKE_CASE	) == 1:
    return True
  lowercase__			    =						series[1] - series[0]
  for index in range(len(_SCREAMING_SNAKE_CASE	) - 1	):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     float:
  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise ValueError('Input series is not valid, valid series - [2, 4, 6]'	)
  if len(_SCREAMING_SNAKE_CASE	) == 0:
    raise ValueError('Input list must be a non empty list'	)
  lowercase__			    =						0
  for val in series:
    answer += val
  return answer / len(_SCREAMING_SNAKE_CASE	)


if __name__ == "__main__":
      import doctest

      doctest.testmod()


