


"""simple docstring"""


import math
import unittest

from transformers import BioGptConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
    import torch

    from transformers import (
        BioGptForCausalLM,
        BioGptForSequenceClassification,
        BioGptForTokenClassification,
        BioGptModel,
        BioGptTokenizer,
    )
    from transformers.models.biogpt.modeling_biogpt import BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST


class 			A__	:


     """simple docstring"""

     def __init__(	self:						str     ,		__a:						Dict     ,		__a:						Any=13     ,		__a:						Any=7     ,		__a:						List[str]=True     ,		__a:						Union[str, Any]=True     ,		__a:						int=False     ,		__a:						Optional[Any]=True     ,		__a:						Optional[Any]=99     ,		__a:						int=32     ,		__a:						Optional[Any]=5     ,		__a:						Dict=4     ,		__a:						List[Any]=37     ,		__a:						Any="gelu"     ,		__a:						Any=0.1     ,		__a:						Any=0.1     ,		__a:						Optional[Any]=512     ,		__a:						List[Any]=16     ,		__a:						List[str]=2     ,		__a:						List[str]=0.02     ,		__a:						int=3     ,		__a:						Dict=4     ,		__a:						Dict=None     ,		)->    List[str]:
           lowerCamelCase					:					Union[str, Any]        =	parent
           lowerCamelCase					:					str        =	batch_size
           lowerCamelCase					:					Tuple        =	seq_length
           lowerCamelCase					:					str        =	is_training
           lowerCamelCase					:					List[str]        =	use_input_mask
           lowerCamelCase					:					Tuple        =	use_token_type_ids
           lowerCamelCase					:					Optional[Any]        =	use_labels
           lowerCamelCase					:					List[Any]        =	vocab_size
           lowerCamelCase					:					str        =	hidden_size
           lowerCamelCase					:					List[str]        =	num_hidden_layers
           lowerCamelCase					:					Any        =	num_attention_heads
           lowerCamelCase					:					List[str]        =	intermediate_size
           lowerCamelCase					:					Union[str, Any]        =	hidden_act
           lowerCamelCase					:					Optional[int]        =	hidden_dropout_prob
           lowerCamelCase					:					Any        =	attention_probs_dropout_prob
           lowerCamelCase					:					List[Any]        =	max_position_embeddings
           lowerCamelCase					:					int        =	type_vocab_size
           lowerCamelCase					:					Union[str, Any]        =	type_sequence_label_size
           lowerCamelCase					:					Any        =	initializer_range
           lowerCamelCase					:					str        =	num_labels
           lowerCamelCase					:					int        =	num_choices
           lowerCamelCase					:					Optional[int]        =	scope

     def 		a__						(	self:						Dict	)->    Optional[int]:
           lowerCamelCase					:					int        =	ids_tensor([self.batch_size, self.seq_length]     ,		self.vocab_size	)

           lowerCamelCase					:					List[str]        =	None
           if self.use_input_mask:
                 lowerCamelCase					:					int        =	random_attention_mask([self.batch_size, self.seq_length]	)

           lowerCamelCase					:					Optional[int]        =	None
           if self.use_token_type_ids:
                 lowerCamelCase					:					List[str]        =	ids_tensor([self.batch_size, self.seq_length]     ,		self.type_vocab_size	)

           lowerCamelCase					:					int        =	None
           lowerCamelCase					:					int        =	None
           lowerCamelCase					:					Dict        =	None
           if self.use_labels:
                 lowerCamelCase					:					Tuple        =	ids_tensor([self.batch_size]     ,		self.type_sequence_label_size	)
                 lowerCamelCase					:					Optional[int]        =	ids_tensor([self.batch_size, self.seq_length]     ,		self.num_labels	)
                 lowerCamelCase					:					Union[str, Any]        =	ids_tensor([self.batch_size]     ,		self.num_choices	)

           lowerCamelCase					:					Any        =	self.get_config()

           return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels

     def 		a__						(	self:						Union[str, Any]	)->    Tuple:
           return BioGptConfig(
               vocab_size=self.vocab_size     ,		hidden_size=self.hidden_size     ,		num_hidden_layers=self.num_hidden_layers     ,		num_attention_heads=self.num_attention_heads     ,		intermediate_size=self.intermediate_size     ,		hidden_act=self.hidden_act     ,		hidden_dropout_prob=self.hidden_dropout_prob     ,		attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,		max_position_embeddings=self.max_position_embeddings     ,		type_vocab_size=self.type_vocab_size     ,		is_decoder=__a     ,		initializer_range=self.initializer_range     ,		)

     def 		a__						(	self:						Any     ,		__a:						List[str]     ,		__a:						Tuple     ,		__a:						Optional[Any]     ,		__a:						int     ,		__a:						str     ,		__a:						List[str]     ,		__a:						Optional[int]	)->    Union[str, Any]:
           lowerCamelCase					:					Tuple        =	BioGptModel(config=__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					Optional[Any]        =	model(__a     ,		attention_mask=__a	)
           lowerCamelCase					:					Any        =	model(__a	)
           self.parent.assertEqual(result.last_hidden_state.shape     ,		(self.batch_size, self.seq_length, self.hidden_size)	)

     def 		a__						(	self:						List[Any]     ,		__a:						List[str]     ,		__a:						str     ,		__a:						Union[str, Any]     ,		__a:						Optional[Any]     ,		__a:						Tuple     ,		__a:						Tuple     ,		__a:						Optional[int]     ,		__a:						Dict     ,		__a:						Union[str, Any]     ,		)->    int:
           lowerCamelCase					:					Dict        =	BioGptForCausalLM(config=__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					List[Any]        =	model(__a     ,		attention_mask=__a     ,		token_type_ids=__a     ,		labels=__a	)
           self.parent.assertEqual(result.logits.shape     ,		(self.batch_size, self.seq_length, self.vocab_size)	)

     def 		a__						(	self:						Tuple     ,		__a:						Optional[int]     ,		__a:						int     ,		__a:						List[Any]     ,		__a:						Tuple     ,		__a:						Tuple     ,		*__a:						Any	)->    Optional[Any]:
           lowerCamelCase					:					Optional[int]        =	BioGptModel(config=__a	)
           model.to(__a	)
           model.eval()

           # create attention mask
           lowerCamelCase					:					Dict        =	torch.ones(input_ids.shape     ,		dtype=torch.long     ,		device=__a	)
           lowerCamelCase					:					str        =	self.seq_length // 2
           lowerCamelCase					:					int        =	0

           # first forward pass
           lowerCamelCase     ,			lowerCamelCase					:					List[Any]        =	model(__a     ,		attention_mask=__a	).to_tuple()

           # create hypothetical next token and extent to next_input_ids
           lowerCamelCase					:					int        =	ids_tensor((self.batch_size, 1)     ,		config.vocab_size	)

           # change a random masked slice from input_ids
           lowerCamelCase					:					Any        =	ids_tensor((1,)     ,		__a	).item() + 1
           lowerCamelCase					:					int        =	ids_tensor((self.batch_size, 1)     ,		config.vocab_size	).squeeze(-1	)
           lowerCamelCase					:					Tuple        =	random_other_next_tokens

           # append to next input_ids and attn_mask
           lowerCamelCase					:					int        =	torch.cat([input_ids, next_tokens]     ,		dim=-1	)
           lowerCamelCase					:					int        =	torch.cat(
               [attn_mask, torch.ones((attn_mask.shape[0], 1)     ,		dtype=torch.long     ,		device=__a	)]     ,		dim=1     ,		)

           # get two different outputs
           lowerCamelCase					:					Union[str, Any]        =	model(__a     ,		attention_mask=__a	)["""last_hidden_state"""]
           lowerCamelCase					:					Tuple        =	model(__a     ,		past_key_values=__a     ,		attention_mask=__a	)["""last_hidden_state"""]

           # select random slice
           lowerCamelCase					:					Dict        =	ids_tensor((1,)     ,		output_from_past.shape[-1]	).item()
           lowerCamelCase					:					Dict        =	output_from_no_past[:, -1, random_slice_idx].detach()
           lowerCamelCase					:					Tuple        =	output_from_past[:, 0, random_slice_idx].detach()

           # test that outputs are equal for slice
           self.parent.assertTrue(torch.allclose(__a     ,		__a     ,		atol=1e-3	)	)

     def 		a__						(	self:						Union[str, Any]     ,		__a:						Optional[int]     ,		__a:						int     ,		__a:						Tuple     ,		__a:						List[str]     ,		__a:						Dict     ,		*__a:						int	)->    List[str]:
           lowerCamelCase					:					str        =	BioGptModel(config=__a	).to(__a	).eval()

           lowerCamelCase					:					Tuple        =	torch.ones(input_ids.shape     ,		dtype=torch.long     ,		device=__a	)

           # first forward pass
           lowerCamelCase					:					List[str]        =	model(__a     ,		attention_mask=__a     ,		use_cache=__a	)

           lowerCamelCase     ,			lowerCamelCase					:					Optional[Any]        =	outputs.to_tuple()

           # create hypothetical multiple next token and extent to next_input_ids
           lowerCamelCase					:					Dict        =	ids_tensor((self.batch_size, 3)     ,		config.vocab_size	)
           lowerCamelCase					:					Optional[int]        =	ids_tensor((self.batch_size, 3)     ,		2	)

           # append to next input_ids and
           lowerCamelCase					:					Tuple        =	torch.cat([input_ids, next_tokens]     ,		dim=-1	)
           lowerCamelCase					:					Tuple        =	torch.cat([attention_mask, next_attn_mask]     ,		dim=-1	)

           lowerCamelCase					:					int        =	model(__a     ,		attention_mask=__a	)["""last_hidden_state"""]
           lowerCamelCase					:					Optional[Any]        =	model(__a     ,		attention_mask=__a     ,		past_key_values=__a	)[
               """last_hidden_state"""
           ]

           # select random slice
           lowerCamelCase					:					Tuple        =	ids_tensor((1,)     ,		output_from_past.shape[-1]	).item()
           lowerCamelCase					:					List[Any]        =	output_from_no_past[:, -3:, random_slice_idx].detach()
           lowerCamelCase					:					List[Any]        =	output_from_past[:, :, random_slice_idx].detach()

           self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]	)

           # test that outputs are equal for slice
           self.parent.assertTrue(torch.allclose(__a     ,		__a     ,		atol=1e-3	)	)

     def 		a__						(	self:						Optional[Any]     ,		__a:						Dict     ,		__a:						Optional[int]     ,		__a:						List[Any]     ,		__a:						List[Any]     ,		__a:						Dict     ,		*__a:						List[str]     ,		__a:						Tuple=False	)->    Optional[int]:
           lowerCamelCase					:					Dict        =	BioGptForCausalLM(__a	)
           model.to(__a	)
           if gradient_checkpointing:
                 model.gradient_checkpointing_enable()

           lowerCamelCase					:					Optional[int]        =	model(__a     ,		labels=__a	)
           self.parent.assertEqual(result.loss.shape     ,		()	)
           self.parent.assertEqual(result.logits.shape     ,		(self.batch_size, self.seq_length, self.vocab_size)	)
           result.loss.backward()

     def 		a__						(	self:						Any     ,		__a:						int     ,		*__a:						Any	)->    str:
           lowerCamelCase					:					List[str]        =	BioGptModel(__a	)
           lowerCamelCase					:					Any        =	model.config.initializer_range / math.sqrt(2 * model.config.num_hidden_layers	)
           for key in model.state_dict().keys():
                 if "c_proj" in key and "weight" in key:
                       self.parent.assertLessEqual(abs(torch.std(model.state_dict()[key]	) - model_std	)     ,		0.0_01	)
                       self.parent.assertLessEqual(abs(torch.mean(model.state_dict()[key]	) - 0.0	)     ,		0.01	)

     def 		a__						(	self:						Dict     ,		__a:						Tuple     ,		__a:						Any     ,		__a:						Union[str, Any]     ,		__a:						Optional[Any]     ,		__a:						Optional[int]     ,		*__a:						Tuple	)->    int:
           lowerCamelCase					:					str        =	self.num_labels
           lowerCamelCase					:					str        =	BioGptForTokenClassification(__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					List[str]        =	model(__a     ,		attention_mask=__a     ,		token_type_ids=__a	)
           self.parent.assertEqual(result.logits.shape     ,		(self.batch_size, self.seq_length, self.num_labels)	)







     def 		a__						(	self:						Dict	)->    Any:
           lowerCamelCase					:					Optional[Any]        =	self.prepare_config_and_inputs()
           (
               (
               lowerCamelCase
           )     ,			(
               lowerCamelCase
           )     ,			(
               lowerCamelCase
           )     ,			(
               lowerCamelCase
           )     ,			(
               lowerCamelCase
           )     ,			(
               lowerCamelCase
           )     ,			(
               lowerCamelCase
           )     ,			
           )					:					int        =	config_and_inputs
           lowerCamelCase					:					List[str]        =	{"""input_ids""": input_ids, """attention_mask""": input_mask}
           return config, inputs_dict


@require_torch
class 			A__	(						__lowercase ,     __lowercase ,     __lowercase ,     unittest.TestCase):


     """simple docstring"""
     snake_case__	:					List[Any]													=(
         (BioGptModel, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification)
         if is_torch_available()
         else ()
     )
     snake_case__	:					Union[str, Any]													=(BioGptForCausalLM,) if is_torch_available() else ()
     snake_case__	:					Dict													=(
         {
             '''feature-extraction''': BioGptModel,
             '''text-classification''': BioGptForSequenceClassification,
             '''text-generation''': BioGptForCausalLM,
             '''token-classification''': BioGptForTokenClassification,
             '''zero-shot''': BioGptForSequenceClassification,
         }
         if is_torch_available()
         else {}
     )
     snake_case__	:					List[Any]													=False

     def 		a__						(	self:						Union[str, Any]	)->    Union[str, Any]:
           lowerCamelCase					:					Any        =	BioGptModelTester(self	)
           lowerCamelCase					:					List[Any]        =	ConfigTester(self     ,		config_class=__a     ,		hidden_size=37	)

     def 		a__						(	self:						int	)->    int:
           self.config_tester.run_common_tests()

     def 		a__						(	self:						Tuple	)->    Optional[int]:
           lowerCamelCase					:					Tuple        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*__a	)

     def 		a__						(	self:						Optional[Any]	)->    Optional[Any]:
           lowerCamelCase					:					Tuple        =	self.model_tester.prepare_config_and_inputs()
           for type in ["absolute", "relative_key", "relative_key_query"]:
                 lowerCamelCase					:					Optional[Any]        =	type
                 self.model_tester.create_and_check_model(*__a	)

     def 		a__						(	self:						Optional[int]	)->    str:
           lowerCamelCase					:					List[Any]        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_biogpt_model_attention_mask_past(*__a	)

     def 		a__						(	self:						Optional[int]	)->    int:
           lowerCamelCase					:					Dict        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_forward_and_backwards(*__a     ,		gradient_checkpointing=__a	)

     def 		a__						(	self:						Union[str, Any]	)->    List[Any]:
           lowerCamelCase					:					Optional[Any]        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_biogpt_model_past_large_inputs(*__a	)

     def 		a__						(	self:						Tuple	)->    str:
           lowerCamelCase					:					Optional[Any]        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_biogpt_weight_initialization(*__a	)

     def 		a__						(	self:						str	)->    Dict:
           lowerCamelCase					:					Tuple        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_biogpt_for_token_classification(*__a	)

     @slow
     def 		a__						(	self:						Optional[int]	)->    int:
           lowerCamelCase					:					Union[str, Any]        =	BioGptForCausalLM.from_pretrained("""microsoft/biogpt"""	)
           model.to(__a	)
           lowerCamelCase					:					Optional[Any]        =	BioGptTokenizer.from_pretrained("""microsoft/biogpt"""	)

           lowerCamelCase					:					Optional[int]        =	"""left"""

           # Define PAD Token = EOS Token = 50256
           lowerCamelCase					:					List[str]        =	tokenizer.eos_token
           lowerCamelCase					:					str        =	model.config.eos_token_id

           # use different length sentences to test batching
           lowerCamelCase					:					int        =	[
               """Hello, my dog is a little""",
               """Today, I""",
           ]

           lowerCamelCase					:					Union[str, Any]        =	tokenizer(__a     ,		return_tensors="""pt"""     ,		padding=__a	)
           lowerCamelCase					:					Any        =	inputs["""input_ids"""].to(__a	)

           lowerCamelCase					:					Any        =	model.generate(
               input_ids=__a     ,		attention_mask=inputs["""attention_mask"""].to(__a	)     ,		)

           lowerCamelCase					:					str        =	tokenizer(sentences[0]     ,		return_tensors="""pt"""	).input_ids.to(__a	)
           lowerCamelCase					:					List[Any]        =	model.generate(input_ids=__a	)

           lowerCamelCase					:					List[Any]        =	inputs_non_padded.shape[-1] - inputs["""attention_mask"""][-1].long().sum().cpu().item()
           lowerCamelCase					:					List[Any]        =	tokenizer(sentences[1]     ,		return_tensors="""pt"""	).input_ids.to(__a	)
           lowerCamelCase					:					Dict        =	model.generate(input_ids=__a     ,		max_length=model.config.max_length - num_paddings	)

           lowerCamelCase					:					List[Any]        =	tokenizer.batch_decode(__a     ,		skip_special_tokens=__a	)
           lowerCamelCase					:					List[Any]        =	tokenizer.decode(output_non_padded[0]     ,		skip_special_tokens=__a	)
           lowerCamelCase					:					List[str]        =	tokenizer.decode(output_padded[0]     ,		skip_special_tokens=__a	)

           lowerCamelCase					:					Optional[Any]        =	[
               """Hello, my dog is a little bit bigger than a little bit.""",
               """Today, I have a good idea of how to use the information""",
           ]
           self.assertListEqual(__a     ,		__a	)
           self.assertListEqual(__a     ,		[non_padded_sentence, padded_sentence]	)

     @slow
     def 		a__						(	self:						Dict	)->    Tuple:
           for model_name in BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCamelCase					:					Optional[Any]        =	BioGptModel.from_pretrained(__a	)
                 self.assertIsNotNone(__a	)

     def 		a__						(	self:						str	)->    str:
           lowerCamelCase     ,			lowerCamelCase					:					Optional[int]        =	self.model_tester.prepare_config_and_inputs_for_common()
           lowerCamelCase					:					List[str]        =	3
           lowerCamelCase					:					Dict        =	input_dict["""input_ids"""]
           lowerCamelCase					:					str        =	input_ids.ne(1	).to(__a	)
           lowerCamelCase					:					List[Any]        =	ids_tensor([self.model_tester.batch_size]     ,		self.model_tester.type_sequence_label_size	)
           lowerCamelCase					:					Tuple        =	BioGptForSequenceClassification(__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					List[str]        =	model(__a     ,		attention_mask=__a     ,		labels=__a	)
           self.assertEqual(result.logits.shape     ,		(self.model_tester.batch_size, self.model_tester.num_labels)	)







     def 		a__						(	self:						Tuple	)->    str:
           lowerCamelCase     ,			lowerCamelCase					:					Any        =	self.model_tester.prepare_config_and_inputs_for_common()
           lowerCamelCase					:					Dict        =	3
           lowerCamelCase					:					Optional[Any]        =	"""multi_label_classification"""
           lowerCamelCase					:					Optional[Any]        =	input_dict["""input_ids"""]
           lowerCamelCase					:					Any        =	input_ids.ne(1	).to(__a	)
           lowerCamelCase					:					Optional[Any]        =	ids_tensor(
               [self.model_tester.batch_size, config.num_labels]     ,		self.model_tester.type_sequence_label_size	).to(torch.float	)
           lowerCamelCase					:					List[Any]        =	BioGptForSequenceClassification(__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					Optional[int]        =	model(__a     ,		attention_mask=__a     ,		labels=__a	)
           self.assertEqual(result.logits.shape     ,		(self.model_tester.batch_size, self.model_tester.num_labels)	)


@require_torch
class 			A__	(						unittest.TestCase):


     """simple docstring"""

     @slow
     def 		a__						(	self:						str	)->    Tuple:
           lowerCamelCase					:					Dict        =	BioGptForCausalLM.from_pretrained("""microsoft/biogpt"""	)
           lowerCamelCase					:					List[str]        =	torch.tensor([[2, 4_805, 9, 656, 21]]	)
           lowerCamelCase					:					Optional[int]        =	model(__a	)[0]

           lowerCamelCase					:					int        =	42_384

           lowerCamelCase					:					Dict        =	torch.Size((1, 5, vocab_size)	)
           self.assertEqual(output.shape     ,		__a	)

           lowerCamelCase					:					int        =	torch.tensor(
               [[[-9.52_36, -9.89_18, 10.45_57], [-11.04_69, -9.64_23, 8.10_22], [-8.86_64, -7.88_26, 5.53_25]]]	)

           self.assertTrue(torch.allclose(output[:, :3, :3]     ,		__a     ,		atol=1e-4	)	)







     @slow
     def 		a__						(	self:						Union[str, Any]	)->    Dict:
           lowerCamelCase					:					str        =	BioGptTokenizer.from_pretrained("""microsoft/biogpt"""	)
           lowerCamelCase					:					int        =	BioGptForCausalLM.from_pretrained("""microsoft/biogpt"""	)
           model.to(__a	)

           torch.manual_seed(0	)
           lowerCamelCase					:					Dict        =	tokenizer("""COVID-19 is"""     ,		return_tensors="""pt"""	).to(__a	)
           lowerCamelCase					:					str        =	model.generate(
               **__a     ,		min_length=100     ,		max_length=1_024     ,		num_beams=5     ,		early_stopping=__a     ,		)
           lowerCamelCase					:					int        =	tokenizer.decode(output_ids[0]     ,		skip_special_tokens=__a	)

           lowerCamelCase					:					Dict        =	(
               """COVID-19 is a global pandemic caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the"""
               """ causative agent of coronavirus disease 2019 (COVID-19), which has spread to more than 200 countries and"""
               """ territories, including the United States (US), Canada, Australia, New Zealand, the United Kingdom (UK),"""
               """ and the United States of America (USA), as of March 11, 2020, with more than 800,000 confirmed cases and"""
               """ more than 800,000 deaths."""
           )
           self.assertEqual(__a     ,		__a	)








"""simple docstring"""


import unittest

from knapsack import greedy_knapsack as kp


class 			A__	(						unittest.TestCase):


     """simple docstring"""

     def 		a__						(	self:						Optional[int]	)->    Union[str, Any]:
           lowerCamelCase					:					Tuple        =	[10, 20, 30, 40, 50, 60]
           lowerCamelCase					:					Union[str, Any]        =	[2, 4, 6, 8, 10, 12]
           lowerCamelCase					:					Union[str, Any]        =	100
           self.assertEqual(kp.calc_profit(__a     ,		__a     ,		__a	)     ,		210	)

     def 		a__						(	self:						str	)->    str:
           self.assertRaisesRegex(__a     ,		"""max_weight must greater than zero."""	)

     def 		a__						(	self:						str	)->    List[Any]:
           self.assertRaisesRegex(__a     ,		"""Weight can not be negative."""	)

     def 		a__						(	self:						Any	)->    Dict:
           self.assertRaisesRegex(__a     ,		"""Profit can not be negative."""	)

     def 		a__						(	self:						Optional[Any]	)->    List[Any]:
           self.assertRaisesRegex(__a     ,		"""max_weight must greater than zero."""	)







     def 		a__						(	self:						Optional[Any]	)->    Tuple:
           self.assertRaisesRegex(
               __a     ,		"""The length of profit and weight must be same."""	)


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




