from math import log

from scipy.constants import Boltzmann, physical_constants

lowerCAmelCase			:							List[Any]     =300  # TEMPERATURE (unit = K)







def 						A__  (					__A   , __A   , __A   , ):







    '''simple docstring'''

    if donor_conc <= 0:
        raise ValueError("""Donor concentration should be positive"""	)
    elif acceptor_conc <= 0:
        raise ValueError("""Acceptor concentration should be positive"""	)
    elif intrinsic_conc <= 0:
        raise ValueError("""Intrinsic concentration should be positive"""	)
    elif donor_conc <= intrinsic_conc:
        raise ValueError(
            """Donor concentration should be greater than intrinsic concentration"""	)
    elif acceptor_conc <= intrinsic_conc:
        raise ValueError(
            """Acceptor concentration should be greater than intrinsic concentration"""	)
    else:
        return (
            Boltzmann
            * T
            * log((donor_conc * acceptor_conc) / intrinsic_conc**2	)
            / physical_constants["electron volt"][0]
        )


if __name__ == "__main__":
  import doctest

  doctest.testmod()





import unittest

from transformers.utils.backbone_utils import (
    BackboneMixin,
    get_aligned_output_features_output_indices,
    verify_out_features_out_indices,
)




class 	__snake_case	( unittest.TestCase		):





      '''simple docstring'''






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


          """simple docstring"""


          _lowerCamelCase     :		Tuple 						=						["""a""", """b""", """c"""]

          # Defaults to last layer if both are None
          _lowerCamelCase						,							_lowerCamelCase     :		int 						=						get_aligned_output_features_output_indices(_UpperCamelCase    ,  _UpperCamelCase    ,  _UpperCamelCase)
          self.assertEqual(_UpperCamelCase    ,  ["""c"""])
          self.assertEqual(_UpperCamelCase    ,  [2])

          # Out indices set to match out features
          _lowerCamelCase						,							_lowerCamelCase     :		int 						=						get_aligned_output_features_output_indices(["""a""", """c"""]    ,  _UpperCamelCase    ,  _UpperCamelCase)
          self.assertEqual(_UpperCamelCase    ,  ["""a""", """c"""])
          self.assertEqual(_UpperCamelCase    ,  [0, 2])

          # Out features set to match out indices
          _lowerCamelCase						,							_lowerCamelCase     :		Tuple 						=						get_aligned_output_features_output_indices(_UpperCamelCase    ,  [0, 2]    ,  _UpperCamelCase)
          self.assertEqual(_UpperCamelCase    ,  ["""a""", """c"""])
          self.assertEqual(_UpperCamelCase    ,  [0, 2])

          # Out features selected from negative indices
          _lowerCamelCase						,							_lowerCamelCase     :		str 						=						get_aligned_output_features_output_indices(_UpperCamelCase    ,  [-3, -1]    ,  _UpperCamelCase)
          self.assertEqual(_UpperCamelCase    ,  ["""a""", """c"""])
          self.assertEqual(_UpperCamelCase    ,  [-3, -1])



      def 	_SCREAMING_SNAKE_CASE    (					self     :				int)				->int:


          """simple docstring"""


          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(["""a""", """b"""]    ,  (0, 1)    ,  _UpperCamelCase)

          # Out features must be a list
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(("""a""", """b""")    ,  (0, 1)    ,  ["""a""", """b"""])

          # Out features must be a subset of stage names
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(["""a""", """b"""]    ,  (0, 1)    ,  ["""a"""])

          # Out indices must be a list or tuple
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(_UpperCamelCase    ,  0    ,  ["""a""", """b"""])

          # Out indices must be a subset of stage names
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(_UpperCamelCase    ,  (0, 1)    ,  ["""a"""])

          # Out features and out indices must be the same length
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(["""a""", """b"""]    ,  (0,)    ,  ["""a""", """b""", """c"""])

          # Out features should match out indices
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(["""a""", """b"""]    ,  (0, 2)    ,  ["""a""", """b""", """c"""])

          # Out features and out indices should be in order
          with self.assertRaises(_UpperCamelCase):
              verify_out_features_out_indices(["""b""", """a"""]    ,  (0, 1)    ,  ["""a""", """b"""])

          # Check passes with valid inputs
          verify_out_features_out_indices(["""a""", """b""", """d"""]    ,  (0, 1, -1)    ,  ["""a""", """b""", """c""", """d"""])




      def 	_SCREAMING_SNAKE_CASE    (					self     :				int)				->List[Any]:


          """simple docstring"""


          _lowerCamelCase     :		int 						=						BackboneMixin()

          _lowerCamelCase     :		Union[str, Any] 						=						["""a""", """b""", """c"""]
          _lowerCamelCase     :		Tuple 						=						["""a""", """c"""]
          _lowerCamelCase     :		List[Any] 						=						[0, 2]

          # Check that the output features and indices are set correctly
          self.assertEqual(backbone.out_features    ,  ["""a""", """c"""])
          self.assertEqual(backbone.out_indices    ,  [0, 2])

          # Check out features and indices are updated correctly
          _lowerCamelCase     :		str 						=						["""a""", """b"""]
          self.assertEqual(backbone.out_features    ,  ["""a""", """b"""])
          self.assertEqual(backbone.out_indices    ,  [0, 1])

          _lowerCamelCase     :		Optional[int] 						=						[-3, -1]
          self.assertEqual(backbone.out_features    ,  ["""a""", """c"""])
          self.assertEqual(backbone.out_indices    ,  [-3, -1])




