


import unittest

from knapsack import greedy_knapsack as kp


class   a__	(						unittest.TestCase    ):

       def 						UpperCAmelCase(   self      :     List[str]    ):
            a_    :     List[str]										=    [1_0, 2_0, 3_0, 4_0, 5_0, 6_0]
            a_    :     Union[str, Any]										=    [2, 4, 6, 8, 1_0, 1_2]
            a_    :     int										=    1_0_0
            self.assertEqual(kp.calc_profit(lowerCamelCase_      ,							lowerCamelCase_      ,							lowerCamelCase_    )      ,							2_1_0    )

       def 						UpperCAmelCase(   self      :     Any    ):
            self.assertRaisesRegex(lowerCamelCase_      ,							"""max_weight must greater than zero."""    )

       def 						UpperCAmelCase(   self      :     List[str]    ):
            self.assertRaisesRegex(lowerCamelCase_      ,							"""Weight can not be negative."""    )

       def 						UpperCAmelCase(   self      :     Optional[int]    ):
            self.assertRaisesRegex(lowerCamelCase_      ,							"""Profit can not be negative."""    )

       def 						UpperCAmelCase(   self      :     str    ):
            self.assertRaisesRegex(lowerCamelCase_      ,							"""max_weight must greater than zero."""    )

       def 						UpperCAmelCase(   self      :     str    ):
            self.assertRaisesRegex(
                lowerCamelCase_      ,							"""The length of profit and weight must be same."""    )


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







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__lowerCamelCase        =     {
    '''configuration_altclip''': [
        '''ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''AltCLIPConfig''',
        '''AltCLIPTextConfig''',
        '''AltCLIPVisionConfig''',
    ],
    '''processing_altclip''': ['''AltCLIPProcessor'''],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase        =     [
           '''ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''AltCLIPPreTrainedModel''',
           '''AltCLIPModel''',
           '''AltCLIPTextModel''',
           '''AltCLIPVisionModel''',
       ]


if TYPE_CHECKING:
       from .configuration_altclip import (
           ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
           AltCLIPConfig,
           AltCLIPTextConfig,
           AltCLIPVisionConfig,
       )
       from .processing_altclip import AltCLIPProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_altclip import (
                  ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                  AltCLIPModel,
                  AltCLIPPreTrainedModel,
                  AltCLIPTextModel,
                  AltCLIPVisionModel,
              )


else:
       import sys

       __lowerCamelCase        =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



