code: 
  
  
  import os
  import unittest
  
  import pytest
  from parameterized import parameterized
  
  from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device
  
  
  # skipping in unittest tests
  
  UpperCamelCase__				       =			[(1,)]
  
  def   UpperCamelCase__   (    )						->							Tuple:
  
  
  
  
         '''simple docstring'''
  
  
  
  
  
  
         _lowercase					:				List[str]           =			bool(os.getenv('''RUN_SLOW'''    ,     0			)			)
         if run_slow:
                assert True
         else:
                assert False, "should have been skipped"
  
  def   UpperCamelCase__   (    )						->							str:
  
  
  
  
         '''simple docstring'''
  
  
  
  
  
  
         _lowercase					:				List[Any]           =			bool(os.getenv('''RUN_SLOW'''    ,     0			)			)
         if run_slow and torch_device == "cuda":
                assert True
         else:
                assert False, "should have been skipped"
  
  @require_torch
  class 						UpperCAmelCase__   (      unittest.TestCase		):
  
  
  
       '''simple docstring'''
  
  
  
  
       @slow
       @require_torch_gpu
       def   lowerCAmelCase_   ( self       :       List[str]		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              check_slow_torch_cuda()
  
  
  
  
       @require_torch_gpu
       @slow
       def   lowerCAmelCase_   ( self       :       Any		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              check_slow_torch_cuda()
  
  
  
  
       @parameterized.expand(UpperCamelCase		)
       @slow
       def   lowerCAmelCase_   ( self       :       Dict	,      UpperCamelCase       :       int=None		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              check_slow()
  
  
  
  
  @slow
  @require_torch_gpu
  def   UpperCamelCase__   (    )						->							Any:
  
  
  
  
         '''simple docstring'''
  
  
  
  
  
  
         check_slow_torch_cuda()
  
  @require_torch_gpu
  @slow
  def   UpperCamelCase__   (    )						->							Optional[int]:
  
  
  
  
         '''simple docstring'''
  
  
  
  
  
  
         check_slow_torch_cuda()
  
  @slow
  @pytest.mark.parametrize('''param'''    ,     [1]			)
  def   UpperCamelCase__   (    UpperCAmelCase_			)						->							List[str]:
  
  
  
  
         '''simple docstring'''
  
  
  
  
  
  
         check_slow()
  
  
  
  
  
  
  
  @pytest.mark.parametrize('''param'''    ,     [1]			)
  @slow
  def   UpperCamelCase__   (    UpperCAmelCase_			)						->							Union[str, Any]:
  
  
  
  
         '''simple docstring'''
  
  
  
  
  
  
         check_slow()
style_context: 
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available
  
  
  UpperCamelCase__				       =			{
      'configuration_realm': ['REALM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'RealmConfig'],
      'tokenization_realm': ['RealmTokenizer'],
  }
  
  try:
     if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
     pass
  else:
     UpperCamelCase__				       =			['RealmTokenizerFast']
  
  try:
     if not is_torch_available():
        raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
     pass
  else:
     UpperCamelCase__				       =			[
         'REALM_PRETRAINED_MODEL_ARCHIVE_LIST',
         'RealmEmbedder',
         'RealmForOpenQA',
         'RealmKnowledgeAugEncoder',
         'RealmPreTrainedModel',
         'RealmReader',
         'RealmScorer',
         'load_tf_weights_in_realm',
     ]
     UpperCamelCase__				       =			['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
  
     UpperCamelCase__				       =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)