




import doctest
import logging
import os
import unittest
from pathlib import Path
from typing import List, Union

import transformers
from transformers.testing_utils import require_tf, require_torch, slow


__lowerCAmelCase	:       Optional[Any]     =	logging.getLogger()




@unittest.skip("""Temporarily disable the doc tests."""     )
@require_torch
@require_tf
@slow
class 					snake_case__							(unittest.TestCase     ):
				"""simple docstring"""



				def 							__UpperCAmelCase							(   self       :  Optional[Any]      ,   __lowerCamelCase       :  Path      ,   __lowerCamelCase       :  Union[str, None] = None      ,   __lowerCamelCase       :  Union[List[str], None] = None      ,   __lowerCamelCase       :  Union[str, List[str], None] = None      ,   __lowerCamelCase       :  bool = True      ,   )      ->  int:
							a					=    [file for file in os.listdir(__lowerCamelCase							) if os.path.isfile(os.path.join(__lowerCamelCase      ,   __lowerCamelCase							)							)]

							if identifier is not None:
										a					=    [file for file in files if identifier in file]

							if n_identifier is not None:
										if isinstance(__lowerCamelCase      ,   __lowerCamelCase							):
													for n_ in n_identifier:
																a					=    [file for file in files if n_ not in file]
										else:
													a					=    [file for file in files if n_identifier not in file]

							a					=    ignore_files or []
							ignore_files.append("__init__.py"							)
							a					=    [file for file in files if file not in ignore_files]

							for file in files:
										# Open all files
										print("Testing"      ,   __lowerCamelCase							)

										if only_modules:
													a					=    file.split("."							)[0]
													try:
																a					=    getattr(__lowerCamelCase      ,   __lowerCamelCase							)
																a					=    doctest.DocTestSuite(__lowerCamelCase							)
																a					=    unittest.TextTestRunner().run(__lowerCamelCase							)
																self.assertIs(len(result.failures							)      ,   0							)
													except AttributeError:
																logger.info(f"""{module_identifier} is not a module."""							)
										else:
													a					=    doctest.testfile(str(".." / directory / file							)      ,   optionflags=doctest.ELLIPSIS							)
													self.assertIs(result.failed      ,   0							)





				def 							__UpperCAmelCase							(   self       :  List[str]							)      ->  str:
							a					=    Path("src/transformers"							)
							a					=    "modeling"
							a					=    [
							    "modeling_ctrl.py",
							    "modeling_tf_ctrl.py",
							]
							self.analyze_directory(__lowerCamelCase      ,   identifier=__lowerCamelCase      ,   ignore_files=__lowerCamelCase							)





				def 							__UpperCAmelCase							(   self       :  Tuple							)      ->  Any:
							a					=    Path("src/transformers"							)
							a					=    "tokenization"
							self.analyze_directory(__lowerCamelCase      ,   identifier=__lowerCamelCase							)





				def 							__UpperCAmelCase							(   self       :  Union[str, Any]							)      ->  Any:
							a					=    Path("src/transformers"							)
							a					=    "configuration"
							self.analyze_directory(__lowerCamelCase      ,   identifier=__lowerCamelCase							)





				def 							__UpperCAmelCase							(   self       :  Tuple							)      ->  Optional[Any]:
							a					=    Path("src/transformers"							)
							a					=    ["configuration", "modeling", "tokenization"]
							self.analyze_directory(__lowerCamelCase      ,   n_identifier=__lowerCamelCase							)





				def 							__UpperCAmelCase							(   self       :  List[str]							)      ->  List[Any]:
							a					=    Path("docs/source"							)
							a					=    ["favicon.ico"]
							self.analyze_directory(__lowerCamelCase      ,   ignore_files=__lowerCamelCase      ,   only_modules=__lowerCamelCase							)












from typing import TYPE_CHECKING

from ....utils import _LazyModule


__lowerCAmelCase	:       int     =	{'tokenization_tapex': ['TapexTokenizer']}


if TYPE_CHECKING:
		from .tokenization_tapex import TapexTokenizer


else:
		import sys

		__lowerCAmelCase	:       Tuple     =	_LazyModule(__name__, globals()['__file__'], _import_structure)






