





import unittest

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






						def UpperCAmelCase_			( self : int		)							->      Tuple:







							"""simple docstring"""


							snake_case_						:     Optional[int]     =		[10, 20, 30, 40, 50, 60]
							snake_case_						:     Tuple     =		[2, 4, 6, 8, 10, 12]
							snake_case_						:     Any     =		100
							self.assertEqual(kp.calc_profit(_A						,				_A						,				_A		)						,				210		)






						def UpperCAmelCase_			( self : List[str]		)							->      str:







							"""simple docstring"""


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






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







							"""simple docstring"""


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






						def UpperCAmelCase_			( self : List[str]		)							->      Union[str, Any]:







							"""simple docstring"""


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






						def UpperCAmelCase_			( self : Any		)							->      Union[str, Any]:







							"""simple docstring"""


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






						def UpperCAmelCase_			( self : str		)							->      Any:







							"""simple docstring"""


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


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












from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_SCREAMING_SNAKE_CASE 		=						{
    """configuration_informer""": [
        """INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """InformerConfig""",
    ],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_SCREAMING_SNAKE_CASE 		=						[
						    """INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """InformerForPrediction""",
						    """InformerModel""",
						    """InformerPreTrainedModel""",
						]


if TYPE_CHECKING:
						from .configuration_informer import INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, InformerConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_informer import (
												    INFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
												    InformerForPrediction,
												    InformerModel,
												    InformerPreTrainedModel,
												)

else:
						import sys

						_SCREAMING_SNAKE_CASE 		=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

