



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


UpperCamelCase__       :	Union[str, Any]    = logging.getLogger()






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


			'''simple docstring'''

			def UpperCamelCase__					(							self     : List[Any]							,     lowerCAmelCase__     : Path							,     lowerCAmelCase__     : Union[str, None] = None							,     lowerCAmelCase__     : Union[List[str], None] = None							,     lowerCAmelCase__     : Union[str, List[str], None] = None							,     lowerCAmelCase__     : bool = True							,     ):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE       :		Any           =		[file for file in os.listdir(lowerCAmelCase__						) if os.path.isfile(os.path.join(lowerCAmelCase__							,     lowerCAmelCase__						)						)]

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

					if n_identifier is not None:
							if isinstance(lowerCAmelCase__							,     lowerCAmelCase__						):
									for n_ in n_identifier:
											__SCREAMING_SNAKE_CASE       :		int           =		[file for file in files if n_ not in file]
							else:
									__SCREAMING_SNAKE_CASE       :		Tuple           =		[file for file in files if n_identifier not in file]

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

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

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

			def UpperCamelCase__					(							self     : Union[str, Any]						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE       :		Dict           =		Path("""src/transformers"""						)
					__SCREAMING_SNAKE_CASE       :		int           =		"""modeling"""
					__SCREAMING_SNAKE_CASE       :		Tuple           =		[
					    """modeling_ctrl.py""",
					    """modeling_tf_ctrl.py""",
					]
					self.analyze_directory(lowerCAmelCase__							,     identifier=lowerCAmelCase__							,     ignore_files=lowerCAmelCase__						)

			def UpperCamelCase__					(							self     : Any						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		Path("""src/transformers"""						)
					__SCREAMING_SNAKE_CASE       :		int           =		"""tokenization"""
					self.analyze_directory(lowerCAmelCase__							,     identifier=lowerCAmelCase__						)

			def UpperCamelCase__					(							self     : Optional[int]						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE       :		Any           =		Path("""src/transformers"""						)
					__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		"""configuration"""
					self.analyze_directory(lowerCAmelCase__							,     identifier=lowerCAmelCase__						)

			def UpperCamelCase__					(							self     : Dict						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE       :		Optional[int]           =		Path("""src/transformers"""						)
					__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		["""configuration""", """modeling""", """tokenization"""]
					self.analyze_directory(lowerCAmelCase__							,     n_identifier=lowerCAmelCase__						)



			def UpperCamelCase__					(							self     : Any						):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE       :		str           =		Path("""docs/source"""						)
					__SCREAMING_SNAKE_CASE       :		Dict           =		["""favicon.ico"""]
					self.analyze_directory(lowerCAmelCase__							,     ignore_files=lowerCAmelCase__							,     only_modules=lowerCAmelCase__						)




'''simple docstring'''




import warnings

from diffusers import StableDiffusionInpaintPipeline as StableDiffusionInpaintPipeline  # noqa F401


warnings.warn(
    '''The `inpainting.py` script is outdated. Please use directly `from diffusers import'''
    ''' StableDiffusionInpaintPipeline` instead.'''
)