





"""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


lowerCAmelCase_			=							logging.getLogger()



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






							def 							__A (   self    ,  a__    ,  a__ = None    ,  a__ = None    ,  a__ = None    ,  a__ = True    ,  ):
														_UpperCAmelCase     =     [file for file in os.listdir(a__     ) if os.path.isfile(os.path.join(a__    ,  a__     )     )]

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

														if n_identifier is not None:
																					if isinstance(a__    ,  a__     ):
																												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'    ,  a__     )

																					if only_modules:
																												_UpperCAmelCase     =     file.split('.'     )[0]
																												try:
																																			_UpperCAmelCase     =     getattr(a__    ,  a__     )
																																			_UpperCAmelCase     =     doctest.DocTestSuite(a__     )
																																			_UpperCAmelCase     =     unittest.TextTestRunner().run(a__     )
																																			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 							__A (   self     ):
														_UpperCAmelCase     =     Path('src/transformers'     )
														_UpperCAmelCase     =     'modeling'
														_UpperCAmelCase     =     [
														    'modeling_ctrl.py',
														    'modeling_tf_ctrl.py',
														]
														self.analyze_directory(a__    ,  identifier=a__    ,  ignore_files=a__     )






							def 							__A (   self     ):
														_UpperCAmelCase     =     Path('src/transformers'     )
														_UpperCAmelCase     =     'tokenization'
														self.analyze_directory(a__    ,  identifier=a__     )






							def 							__A (   self     ):
														_UpperCAmelCase     =     Path('src/transformers'     )
														_UpperCAmelCase     =     'configuration'
														self.analyze_directory(a__    ,  identifier=a__     )






							def 							__A (   self     ):
														_UpperCAmelCase     =     Path('src/transformers'     )
														_UpperCAmelCase     =     ['configuration', 'modeling', 'tokenization']
														self.analyze_directory(a__    ,  n_identifier=a__     )






							def 							__A (   self     ):
														_UpperCAmelCase     =     Path('docs/source'     )
														_UpperCAmelCase     =     ['favicon.ico']
														self.analyze_directory(a__    ,  ignore_files=a__    ,  only_modules=a__     )













"""simple docstring"""






def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return number | (1 << position)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return number & ~(1 << position)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return number ^ (1 << position)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       bool:






       """simple docstring"""




       return ((number >> position) & 1) == 1

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return int((number & (1 << position)) != 0							)


if __name__ == "__main__":
    import doctest

    doctest.testmod()






