




"""simple docstring"""






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


lowercase__     						=						logging.getLogger()






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






			'''simple docstring'''



			def 					A_    (  self  ,      lowercase  ,      lowercase = None  ,      lowercase = None  ,      lowercase = None  ,      lowercase = True  ,      ):
							_lowerCamelCase     :			Union[str, Any]    =    [file for file in os.listdir(lowercase  ) if os.path.isfile(os.path.join(lowercase  ,      lowercase  )  )]

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

							if n_identifier is not None:
											if isinstance(lowercase  ,      lowercase  ):
															for n_ in n_identifier:
																			_lowerCamelCase     :			str    =    [file for file in files if n_ not in file]
											else:
															_lowerCamelCase     :			Dict    =    [file for file in files if n_identifier not in file]

							_lowerCamelCase     :			str    =    ignore_files or []
							ignore_files.append('__init__.py'  )
							_lowerCamelCase     :			Union[str, Any]    =    [file for file in files if file not in ignore_files]

							for file in files:
											# Open all files
											print('Testing'  ,      lowercase  )

											if only_modules:
															_lowerCamelCase     :			List[str]    =    file.split('.'  )[0]
															try:
																			_lowerCamelCase     :			Tuple    =    getattr(lowercase  ,      lowercase  )
																			_lowerCamelCase     :			List[Any]    =    doctest.DocTestSuite(lowercase  )
																			_lowerCamelCase     :			Optional[int]    =    unittest.TextTestRunner().run(lowercase  )
																			self.assertIs(len(result.failures  )  ,      0  )
															except AttributeError:
																			logger.info(F'''{module_identifier} is not a module.'''  )
											else:
															_lowerCamelCase     :			Any    =    doctest.testfile(str('..' / directory / file  )  ,      optionflags=doctest.ELLIPSIS  )
															self.assertIs(result.failed  ,      0  )
			def 					A_    (  self  ):
							_lowerCamelCase     :			int    =    Path('src/transformers'  )
							_lowerCamelCase     :			List[Any]    =    'modeling'
							_lowerCamelCase     :			Dict    =    [
							    'modeling_ctrl.py',
							    'modeling_tf_ctrl.py',
							]
							self.analyze_directory(lowercase  ,      identifier=lowercase  ,      ignore_files=lowercase  )
			def 					A_    (  self  ):
							_lowerCamelCase     :			int    =    Path('src/transformers'  )
							_lowerCamelCase     :			Tuple    =    'tokenization'
							self.analyze_directory(lowercase  ,      identifier=lowercase  )
			def 					A_    (  self  ):
							_lowerCamelCase     :			Optional[Any]    =    Path('src/transformers'  )
							_lowerCamelCase     :			int    =    'configuration'
							self.analyze_directory(lowercase  ,      identifier=lowercase  )
			def 					A_    (  self  ):
							_lowerCamelCase     :			int    =    Path('src/transformers'  )
							_lowerCamelCase     :			Any    =    ['configuration', 'modeling', 'tokenization']
							self.analyze_directory(lowercase  ,      n_identifier=lowercase  )






			def 					A_    (  self  ):
							_lowerCamelCase     :			int    =    Path('docs/source'  )
							_lowerCamelCase     :			List[str]    =    ['favicon.ico']
							self.analyze_directory(lowercase  ,      ignore_files=lowercase  ,      only_modules=lowercase  )



def 							_UpperCAmelCase				(UpperCamelCase__     :  Optional[Any]				,							UpperCamelCase__     :  Union[str, Any]						):
       # "extended trapezoidal rule"
       # int(f) = dx/2 * (f1 + 2f2 + ... + fn)
       _A      :       int				    = (boundary[1] - boundary[0]) / steps
       _A      :       Any				    = boundary[0]
       _A      :       List[Any]				    = boundary[1]
       _A      :       str				    = make_points(UpperCamelCase__				,							UpperCamelCase__				,							UpperCamelCase__						)
       _A      :       str				    = 0.0
       y += (h / 2.0) * f(UpperCamelCase__						)
       for i in x_i:
              # print(i)
              y += h * f(UpperCamelCase__						)
       y += (h / 2.0) * f(UpperCamelCase__						)
       return y
def 							_UpperCAmelCase				(UpperCamelCase__     :  List[str]				,							UpperCamelCase__     :  Optional[int]				,							UpperCamelCase__     :  Any						):
       _A      :       Optional[int]				    = a + h
       while x < (b - h):
              yield x
              _A      :       Dict				    = x + h
def 							_UpperCAmelCase				(UpperCamelCase__     :  Optional[int]						):  # enter your function here
       _A      :       Any				    = (x - 0) * (x - 0)
       return y
def 							_UpperCAmelCase				():
       _A      :       Optional[Any]				    = 0.0  # Lower bound of integration
       _A      :       Optional[int]				    = 1.0  # Upper bound of integration
       _A      :       List[Any]				    = 10.0  # define number of steps or resolution
       _A      :       Any				    = [a, b]  # define boundary of integration
       _A      :       Tuple				    = method_a(UpperCamelCase__				,							UpperCamelCase__						)
       print(f"y = {y}"						)


if __name__ == "__main__":
    main()
