


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


__UpperCamelCase     		=							logging.getLogger()







@unittest.skip('Temporarily disable the doc tests.'   )
@require_torch
@require_tf
@slow
class 							lowerCamelCase__						(				unittest.TestCase   ):






			"""simple docstring"""






			def 					snake_case__					(				self   ,    snake_case   ,    snake_case = None   ,    snake_case = None   ,    snake_case = None   ,    snake_case = True   ,    ):

						'''simple docstring'''


						UpperCamelCase__       =							[file for file in os.listdir(snake_case  ) if os.path.isfile(os.path.join(snake_case   ,    snake_case  )  )]

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

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

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

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

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




			def 					snake_case__					(				self  ):

						'''simple docstring'''


						UpperCamelCase__       =							Path("src/transformers"  )
						UpperCamelCase__       =							"modeling"
						UpperCamelCase__       =							[
						    "modeling_ctrl.py",
						    "modeling_tf_ctrl.py",
						]
						self.analyze_directory(snake_case   ,    identifier=snake_case   ,    ignore_files=snake_case  )




			def 					snake_case__					(				self  ):

						'''simple docstring'''


						UpperCamelCase__       =							Path("src/transformers"  )
						UpperCamelCase__       =							"tokenization"
						self.analyze_directory(snake_case   ,    identifier=snake_case  )




			def 					snake_case__					(				self  ):

						'''simple docstring'''


						UpperCamelCase__       =							Path("src/transformers"  )
						UpperCamelCase__       =							"configuration"
						self.analyze_directory(snake_case   ,    identifier=snake_case  )




			def 					snake_case__					(				self  ):

						'''simple docstring'''


						UpperCamelCase__       =							Path("src/transformers"  )
						UpperCamelCase__       =							["configuration", "modeling", "tokenization"]
						self.analyze_directory(snake_case   ,    n_identifier=snake_case  )







			def 					snake_case__					(				self  ):

						'''simple docstring'''


						UpperCamelCase__       =							Path("docs/source"  )
						UpperCamelCase__       =							["favicon.ico"]
						self.analyze_directory(snake_case   ,    ignore_files=snake_case   ,    only_modules=snake_case  )






import numpy as np
def 							UpperCamelCase_(					_A :np.array	)->		np.array:
			return 1 / (1 + np.exp(-vector	))


if __name__ == "__main__":
						import doctest

						doctest.testmod()


