code: 
  
  
  
  
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available
  
  
  lowerCamelCase			:							int       ={
      '''configuration_realm''': ['''REALM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RealmConfig'''],
      '''tokenization_realm''': ['''RealmTokenizer'''],
  }
  
  try:
   if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   lowerCamelCase			:							Tuple       =['''RealmTokenizerFast''']
  
  try:
   if not is_torch_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   lowerCamelCase			:							Union[str, Any]       =[
       '''REALM_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''RealmEmbedder''',
       '''RealmForOpenQA''',
       '''RealmKnowledgeAugEncoder''',
       '''RealmPreTrainedModel''',
       '''RealmReader''',
       '''RealmScorer''',
       '''load_tf_weights_in_realm''',
   ]
   lowerCamelCase			:							Dict       =['''RealmRetriever''']
  
  
  if TYPE_CHECKING:
   from .configuration_realm import REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig
   from .tokenization_realm import RealmTokenizer
  
   try:
    if not is_tokenizers_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .tokenization_realm import RealmTokenizerFast
  
   try:
    if not is_torch_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_realm import (
        REALM_PRETRAINED_MODEL_ARCHIVE_LIST,
        RealmEmbedder,
        RealmForOpenQA,
        RealmKnowledgeAugEncoder,
        RealmPreTrainedModel,
        RealmReader,
        RealmScorer,
        load_tf_weights_in_realm,
    )
    from .retrieval_realm import RealmRetriever
  
  
  else:
   import sys
  
   lowerCamelCase			:							str       =_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
style_context: 
  
  
  
  
  
  
  from __future__ import annotations
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase    )				->			list[int]:
       if not list_of_ints:
            return []
  
       if min(__lowerCAmelCase    ) < 0:
            raise ValueError("All numbers must be positive"    )
  
       UpperCamelCase__    :     Dict        =						max(len(bin(__lowerCAmelCase    )[2:]    ) for x in list_of_ints    )
       return _msd_radix_sort(__lowerCAmelCase      ,					__lowerCAmelCase    )
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase      ,					__lowerCAmelCase    )				->			list[int]:
       if bit_position == 0 or len(__lowerCAmelCase    ) in [0, 1]:
            return list_of_ints
  
       UpperCamelCase__    :     Union[str, Any]        =						[]
       UpperCamelCase__    :     Dict        =						[]
       # Split numbers based on bit at bit_position from the right
       for number in list_of_ints:
            if (number >> (bit_position - 1)) & 1:
                 # number has a one at bit bit_position
                 ones.append(__lowerCAmelCase    )
            else:
                 # number has a zero at bit bit_position
                 zeros.append(__lowerCAmelCase    )
  
      # recursively split both lists further
       UpperCamelCase__    :     str        =						_msd_radix_sort(__lowerCAmelCase      ,					bit_position - 1    )
       UpperCamelCase__    :     Optional[Any]        =						_msd_radix_sort(__lowerCAmelCase      ,					bit_position - 1    )
  
       # recombine lists
       UpperCamelCase__    :     Optional[int]        =						zeros
       res.extend(__lowerCAmelCase    )
  
       return res
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase    )				->			Dict:
       UpperCamelCase__    :     Optional[int]        =						len(__lowerCAmelCase    )
       if not list_of_ints or length == 1:
            return
  
       if min(__lowerCAmelCase    ) < 0:
            raise ValueError("All numbers must be positive"    )
  
       UpperCamelCase__    :     int        =						max(len(bin(__lowerCAmelCase    )[2:]    ) for x in list_of_ints    )
       _msd_radix_sort_inplace(__lowerCAmelCase      ,					__lowerCAmelCase      ,					0      ,					__lowerCAmelCase    )
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase    )				->			List[str]:
       if bit_position == 0 or end_index - begin_index <= 1:
            return
  
       bit_position -= 1
  
       UpperCamelCase__    :     Any        =						begin_index
       UpperCamelCase__    :     List[str]        =						end_index - 1
       while i <= j:
            UpperCamelCase__    :     Tuple        =						False
            if not (list_of_ints[i] >> bit_position) & 1:
                 # found zero at the beginning
                 i += 1
                 UpperCamelCase__    :     Any        =						True
            if (list_of_ints[j] >> bit_position) & 1:
                 # found one at the end
                 j -= 1
                 UpperCamelCase__    :     Dict        =						True
  
            if changed:
                 continue
  
            UpperCamelCase__       ,  UpperCamelCase__    :     Any        =						list_of_ints[j], list_of_ints[i]
            j -= 1
            if j != i:
                 i += 1
  
       _msd_radix_sort_inplace(__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase    )
       _msd_radix_sort_inplace(__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase    )
  
  
  if __name__ == "__main__":
   import doctest
  
   doctest.testmod()