




"""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 lowerCAmelCase__      :






			'''simple docstring'''



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

							_lowerCamelCase	:     int       =       None
							if self.use_input_mask:
											_lowerCamelCase	:     Optional[int]       =       random_attention_mask([self.batch_size, self.seq_length]    )

							_lowerCamelCase	:     Dict       =       None
							if self.use_token_type_ids:
											_lowerCamelCase	:     List[str]       =       ids_tensor([self.batch_size, self.seq_length]    , self.type_vocab_size    )

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

							_lowerCamelCase	:     Dict       =       self.get_config()

							return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
			def    A_       (    self    ):
							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=__UpperCamelCase    , initializer_range=self.initializer_range    , )
			def    A_       (    self    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    ):
							_lowerCamelCase	:     List[Any]       =       BioGptModel(config=__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							model.eval()
							_lowerCamelCase	:     int       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    )
							_lowerCamelCase	:     str       =       model(__UpperCamelCase    )
							self.parent.assertEqual(result.last_hidden_state.shape    , (self.batch_size, self.seq_length, self.hidden_size)    )
			def    A_       (    self    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , ):
							_lowerCamelCase	:     Optional[Any]       =       BioGptForCausalLM(config=__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							model.eval()
							_lowerCamelCase	:     Optional[Any]       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    , token_type_ids=__UpperCamelCase    , labels=__UpperCamelCase    )
							self.parent.assertEqual(result.logits.shape    , (self.batch_size, self.seq_length, self.vocab_size)    )
			def    A_       (    self    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , *lowercase    ):
							_lowerCamelCase	:     List[Any]       =       BioGptModel(config=__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							model.eval()

							# create attention mask
							_lowerCamelCase	:     Optional[int]       =       torch.ones(input_ids.shape    , dtype=torch.long    , device=__UpperCamelCase    )
							_lowerCamelCase	:     Optional[int]       =       self.seq_length // 2
							_lowerCamelCase	:     Union[str, Any]       =       0

							# first forward pass
							_lowerCamelCase,					_lowerCamelCase	:     Dict       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    ).to_tuple()

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

							# change a random masked slice from input_ids
							_lowerCamelCase	:     Optional[Any]       =       ids_tensor((1,)    , __UpperCamelCase    ).item() + 1
							_lowerCamelCase	:     List[Any]       =       ids_tensor((self.batch_size, 1)    , config.vocab_size    ).squeeze(-1    )
							_lowerCamelCase	:     Union[str, Any]       =       random_other_next_tokens

							# append to next input_ids and attn_mask
							_lowerCamelCase	:     Any       =       torch.cat([input_ids, next_tokens]    , dim=-1    )
							_lowerCamelCase	:     str       =       torch.cat(
							    [attn_mask, torch.ones((attn_mask.shape[0], 1)    , dtype=torch.long    , device=__UpperCamelCase    )]    , dim=1    , )

							# get two different outputs
							_lowerCamelCase	:     str       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    )['last_hidden_state']
							_lowerCamelCase	:     Dict       =       model(__UpperCamelCase    , past_key_values=__UpperCamelCase    , attention_mask=__UpperCamelCase    )['last_hidden_state']

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

							# test that outputs are equal for slice
							self.parent.assertTrue(torch.allclose(__UpperCamelCase    , __UpperCamelCase    , atol=1E-3    )    )
			def    A_       (    self    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , *lowercase    ):
							_lowerCamelCase	:     str       =       BioGptModel(config=__UpperCamelCase    ).to(__UpperCamelCase    ).eval()

							_lowerCamelCase	:     List[Any]       =       torch.ones(input_ids.shape    , dtype=torch.long    , device=__UpperCamelCase    )

							# first forward pass
							_lowerCamelCase	:     Optional[int]       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    , use_cache=__UpperCamelCase    )

							_lowerCamelCase,					_lowerCamelCase	:     int       =       outputs.to_tuple()

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

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

							_lowerCamelCase	:     str       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    )['last_hidden_state']
							_lowerCamelCase	:     List[str]       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    , past_key_values=__UpperCamelCase    )[
							    'last_hidden_state'
							]

							# select random slice
							_lowerCamelCase	:     str       =       ids_tensor((1,)    , output_from_past.shape[-1]    ).item()
							_lowerCamelCase	:     List[str]       =       output_from_no_past[:, -3:, random_slice_idx].detach()
							_lowerCamelCase	:     str       =       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(__UpperCamelCase    , __UpperCamelCase    , atol=1E-3    )    )
			def    A_       (    self    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , *lowercase    , lowercase=False    ):
							_lowerCamelCase	:     List[str]       =       BioGptForCausalLM(__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							if gradient_checkpointing:
											model.gradient_checkpointing_enable()

							_lowerCamelCase	:     Any       =       model(__UpperCamelCase    , labels=__UpperCamelCase    )
							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    , lowercase    , *lowercase    ):
							_lowerCamelCase	:     Optional[Any]       =       BioGptModel(__UpperCamelCase    )
							_lowerCamelCase	:     str       =       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    , lowercase    , lowercase    , lowercase    , lowercase    , lowercase    , *lowercase    ):
							_lowerCamelCase	:     Any       =       self.num_labels
							_lowerCamelCase	:     Optional[Any]       =       BioGptForTokenClassification(__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							model.eval()
							_lowerCamelCase	:     Union[str, Any]       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    , token_type_ids=__UpperCamelCase    )
							self.parent.assertEqual(result.logits.shape    , (self.batch_size, self.seq_length, self.num_labels)    )






			def    A_       (    self    ):
							_lowerCamelCase	:     Optional[Any]       =       self.prepare_config_and_inputs()
							(
							    (
							    _lowerCamelCase						
							),					(
							    _lowerCamelCase						
							),					(
							    _lowerCamelCase						
							),					(
							    _lowerCamelCase						
							),					(
							    _lowerCamelCase						
							),					(
							    _lowerCamelCase						
							),					(
							    _lowerCamelCase						
							),											
							)	:     Union[str, Any]       =       config_and_inputs
							_lowerCamelCase	:     int       =       {'input_ids': input_ids, 'attention_mask': input_mask}
							return config, inputs_dict






@require_torch
class lowerCAmelCase__      (	_a,      _a,      _a,      unittest.TestCase		):






			'''simple docstring'''



			lowerCamelCase__ =     (
			    (BioGptModel, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification)
			    if is_torch_available()
			    else ()
			)
			lowerCamelCase__ =     (BioGptForCausalLM,) if is_torch_available() else ()
			lowerCamelCase__ =     (
			    {
			        '''feature-extraction''': BioGptModel,
			        '''text-classification''': BioGptForSequenceClassification,
			        '''text-generation''': BioGptForCausalLM,
			        '''token-classification''': BioGptForTokenClassification,
			        '''zero-shot''': BioGptForSequenceClassification,
			    }
			    if is_torch_available()
			    else {}
			)
			lowerCamelCase__ =     False
			def    A_       (    self    ):
							_lowerCamelCase	:     List[Any]       =       BioGptModelTester(self    )
							_lowerCamelCase	:     str       =       ConfigTester(self    , config_class=__UpperCamelCase    , hidden_size=37    )
			def    A_       (    self    ):
							self.config_tester.run_common_tests()
			def    A_       (    self    ):
							_lowerCamelCase	:     List[str]       =       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_model(*__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase	:     Any       =       self.model_tester.prepare_config_and_inputs()
							for type in ["absolute", "relative_key", "relative_key_query"]:
											_lowerCamelCase	:     int       =       type
											self.model_tester.create_and_check_model(*__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase	:     Tuple       =       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_biogpt_model_attention_mask_past(*__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase	:     Optional[Any]       =       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_forward_and_backwards(*__UpperCamelCase    , gradient_checkpointing=__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase	:     Union[str, Any]       =       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_biogpt_model_past_large_inputs(*__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase	:     int       =       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_biogpt_weight_initialization(*__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase	:     Optional[int]       =       self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_biogpt_for_token_classification(*__UpperCamelCase    )
			@slow
			def    A_       (    self    ):
							_lowerCamelCase	:     Optional[int]       =       BioGptForCausalLM.from_pretrained('microsoft/biogpt'    )
							model.to(__UpperCamelCase    )
							_lowerCamelCase	:     Any       =       BioGptTokenizer.from_pretrained('microsoft/biogpt'    )

							_lowerCamelCase	:     Tuple       =       'left'

							# Define PAD Token = EOS Token = 50256
							_lowerCamelCase	:     Tuple       =       tokenizer.eos_token
							_lowerCamelCase	:     Any       =       model.config.eos_token_id

							# use different length sentences to test batching
							_lowerCamelCase	:     List[str]       =       [
							    'Hello, my dog is a little',
							    'Today, I',
							]

							_lowerCamelCase	:     List[Any]       =       tokenizer(__UpperCamelCase    , return_tensors='pt'    , padding=__UpperCamelCase    )
							_lowerCamelCase	:     Optional[int]       =       inputs['input_ids'].to(__UpperCamelCase    )

							_lowerCamelCase	:     Optional[Any]       =       model.generate(
							    input_ids=__UpperCamelCase    , attention_mask=inputs['attention_mask'].to(__UpperCamelCase    )    , )

							_lowerCamelCase	:     List[str]       =       tokenizer(sentences[0]    , return_tensors='pt'    ).input_ids.to(__UpperCamelCase    )
							_lowerCamelCase	:     Optional[Any]       =       model.generate(input_ids=__UpperCamelCase    )

							_lowerCamelCase	:     Optional[int]       =       inputs_non_padded.shape[-1] - inputs['attention_mask'][-1].long().sum().cpu().item()
							_lowerCamelCase	:     int       =       tokenizer(sentences[1]    , return_tensors='pt'    ).input_ids.to(__UpperCamelCase    )
							_lowerCamelCase	:     List[Any]       =       model.generate(input_ids=__UpperCamelCase    , max_length=model.config.max_length - num_paddings    )

							_lowerCamelCase	:     Union[str, Any]       =       tokenizer.batch_decode(__UpperCamelCase    , skip_special_tokens=__UpperCamelCase    )
							_lowerCamelCase	:     List[str]       =       tokenizer.decode(output_non_padded[0]    , skip_special_tokens=__UpperCamelCase    )
							_lowerCamelCase	:     List[Any]       =       tokenizer.decode(output_padded[0]    , skip_special_tokens=__UpperCamelCase    )

							_lowerCamelCase	:     Tuple       =       [
							    '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(__UpperCamelCase    , __UpperCamelCase    )
							self.assertListEqual(__UpperCamelCase    , [non_padded_sentence, padded_sentence]    )
			@slow
			def    A_       (    self    ):
							for model_name in BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											_lowerCamelCase	:     Optional[int]       =       BioGptModel.from_pretrained(__UpperCamelCase    )
											self.assertIsNotNone(__UpperCamelCase    )
			def    A_       (    self    ):
							_lowerCamelCase,					_lowerCamelCase	:     Any       =       self.model_tester.prepare_config_and_inputs_for_common()
							_lowerCamelCase	:     Optional[Any]       =       3
							_lowerCamelCase	:     Optional[int]       =       input_dict['input_ids']
							_lowerCamelCase	:     Optional[int]       =       input_ids.ne(1    ).to(__UpperCamelCase    )
							_lowerCamelCase	:     Optional[Any]       =       ids_tensor([self.model_tester.batch_size]    , self.model_tester.type_sequence_label_size    )
							_lowerCamelCase	:     List[Any]       =       BioGptForSequenceClassification(__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							model.eval()
							_lowerCamelCase	:     List[str]       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    , labels=__UpperCamelCase    )
							self.assertEqual(result.logits.shape    , (self.model_tester.batch_size, self.model_tester.num_labels)    )






			def    A_       (    self    ):
							_lowerCamelCase,					_lowerCamelCase	:     Dict       =       self.model_tester.prepare_config_and_inputs_for_common()
							_lowerCamelCase	:     List[str]       =       3
							_lowerCamelCase	:     Optional[Any]       =       'multi_label_classification'
							_lowerCamelCase	:     List[Any]       =       input_dict['input_ids']
							_lowerCamelCase	:     str       =       input_ids.ne(1    ).to(__UpperCamelCase    )
							_lowerCamelCase	:     Any       =       ids_tensor(
							    [self.model_tester.batch_size, config.num_labels]    , self.model_tester.type_sequence_label_size    ).to(torch.float    )
							_lowerCamelCase	:     Optional[int]       =       BioGptForSequenceClassification(__UpperCamelCase    )
							model.to(__UpperCamelCase    )
							model.eval()
							_lowerCamelCase	:     List[str]       =       model(__UpperCamelCase    , attention_mask=__UpperCamelCase    , labels=__UpperCamelCase    )
							self.assertEqual(result.logits.shape    , (self.model_tester.batch_size, self.model_tester.num_labels)    )






@require_torch
class lowerCAmelCase__      (	unittest.TestCase		):






			'''simple docstring'''



			@slow
			def    A_       (    self    ):
							_lowerCamelCase	:     Union[str, Any]       =       BioGptForCausalLM.from_pretrained('microsoft/biogpt'    )
							_lowerCamelCase	:     List[Any]       =       torch.tensor([[2, 4805, 9, 656, 21]]    )
							_lowerCamelCase	:     Optional[Any]       =       model(__UpperCamelCase    )[0]

							_lowerCamelCase	:     Tuple       =       42384

							_lowerCamelCase	:     Tuple       =       torch.Size((1, 5, vocab_size)    )
							self.assertEqual(output.shape    , __UpperCamelCase    )

							_lowerCamelCase	:     List[Any]       =       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]    , __UpperCamelCase    , atol=1E-4    )    )






			@slow
			def    A_       (    self    ):
							_lowerCamelCase	:     Dict       =       BioGptTokenizer.from_pretrained('microsoft/biogpt'    )
							_lowerCamelCase	:     Any       =       BioGptForCausalLM.from_pretrained('microsoft/biogpt'    )
							model.to(__UpperCamelCase    )

							torch.manual_seed(0    )
							_lowerCamelCase	:     Tuple       =       tokenizer('COVID-19 is'    , return_tensors='pt'    ).to(__UpperCamelCase    )
							_lowerCamelCase	:     int       =       model.generate(
							    **__UpperCamelCase    , min_length=100    , max_length=1024    , num_beams=5    , early_stopping=__UpperCamelCase    , )
							_lowerCamelCase	:     Optional[Any]       =       tokenizer.decode(output_ids[0]    , skip_special_tokens=__UpperCamelCase    )

							_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(__UpperCamelCase    , __UpperCamelCase    )

from __future__ import annotations




def 	UpperCamelCase__  (     SCREAMING_SNAKE_CASE_	:	float		,   SCREAMING_SNAKE_CASE_	:	float		,   SCREAMING_SNAKE_CASE_	:	float		,   )  ->     tuple:
						if (electron_conc, hole_conc, intrinsic_conc).count(0       ) != 1:
												raise ValueError("""You cannot supply more or less than 2 values"""       )
						elif electron_conc < 0:
												raise ValueError("""Electron concentration cannot be negative in a semiconductor"""       )
						elif hole_conc < 0:
												raise ValueError("""Hole concentration cannot be negative in a semiconductor"""       )
						elif intrinsic_conc < 0:
												raise ValueError(
												    """Intrinsic concentration cannot be negative in a semiconductor"""       )
						elif electron_conc == 0:
												return (
												    "electron_conc",
												    intrinsic_conc**2 / hole_conc,
												)
						elif hole_conc == 0:
												return (
												    "hole_conc",
												    intrinsic_conc**2 / electron_conc,
												)
						elif intrinsic_conc == 0:
												return (
												    "intrinsic_conc",
												    (electron_conc * hole_conc) ** 0.5,
												)
						else:
												return (-1, -1)


if __name__ == "__main__":
		import doctest

		doctest.testmod()