
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


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





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







						'''simple docstring'''



						def        SCREAMING_SNAKE_CASE(			self							:int		,    lowerCAmelCase__							:Path		,    lowerCAmelCase__							:Union[str, None] = None		,    lowerCAmelCase__							:Union[List[str], None] = None		,    lowerCAmelCase__							:Union[str, List[str], None] = None		,    lowerCAmelCase__							:bool = True		,    )  ->Dict:
										lowercase         =      [file for file in os.listdir(lowerCAmelCase__     ) if os.path.isfile(os.path.join(lowerCAmelCase__		,    lowerCAmelCase__     )     )]

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

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

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

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

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





						def        SCREAMING_SNAKE_CASE(			self							:Optional[Any]     )  ->Optional[int]:
										lowercase         =      Path("src/transformers"     )
										lowercase         =      "modeling"
										lowercase         =      [
										    "modeling_ctrl.py",
										    "modeling_tf_ctrl.py",
										]
										self.analyze_directory(lowerCAmelCase__		,    identifier=lowerCAmelCase__		,    ignore_files=lowerCAmelCase__     )





						def        SCREAMING_SNAKE_CASE(			self							:List[Any]     )  ->Union[str, Any]:
										lowercase         =      Path("src/transformers"     )
										lowercase         =      "tokenization"
										self.analyze_directory(lowerCAmelCase__		,    identifier=lowerCAmelCase__     )





						def        SCREAMING_SNAKE_CASE(			self							:str     )  ->Dict:
										lowercase         =      Path("src/transformers"     )
										lowercase         =      "configuration"
										self.analyze_directory(lowerCAmelCase__		,    identifier=lowerCAmelCase__     )





						def        SCREAMING_SNAKE_CASE(			self							:List[Any]     )  ->int:
										lowercase         =      Path("src/transformers"     )
										lowercase         =      ["configuration", "modeling", "tokenization"]
										self.analyze_directory(lowerCAmelCase__		,    n_identifier=lowerCAmelCase__     )





						def        SCREAMING_SNAKE_CASE(			self							:Optional[Any]     )  ->Optional[int]:
										lowercase         =      Path("docs/source"     )
										lowercase         =      ["favicon.ico"]
										self.analyze_directory(lowerCAmelCase__		,    ignore_files=lowerCAmelCase__		,    only_modules=lowerCAmelCase__     )


# Function to print upper half of diamond (pyramid)

def  __snake_case							(	__magic_name__						):







				'''simple docstring'''


				for i in range(0		,    __magic_name__						):
								for _ in range(0		,    n - i - 1						):  # printing spaces
												print(" "		,    end=""						)
								for _ in range(0		,    i + 1						):  # printing stars
												print("* "		,    end=""						)
								print()

def  __snake_case							(	__magic_name__						):







				'''simple docstring'''


				for i in range(__magic_name__		,    0		,    -1						):
								for _ in range(__magic_name__		,    0		,    -1						):  # printing stars
												print("* "		,    end=""						)
								print()
								for _ in range(n - i + 1		,    0		,    -1						):  # printing spaces
												print(" "		,    end=""						)

def  __snake_case							(	__magic_name__						):







				'''simple docstring'''


				if n <= 0:
								print("       ...       ....        nothing printing :("						)
								return
				floyd(__magic_name__						)  # upper half
				reverse_floyd(__magic_name__						)  # lower half


if __name__ == "__main__":
						print(r"| /\ | |- |  |-  |--| |\  /| |-")
						print(r"|/  \| |- |_ |_  |__| | \/ | |_")
						_snake_case      :							Union[str, Any]     	=    1
						while K:
												_snake_case      :							Dict     	=    int(input("enter the number and , and see the magic : "))
												print()
												pretty_print(user_number)
												_snake_case      :							Tuple     	=    int(input("press 0 to exit... and 1 to continue..."))

						print("Good Bye...")
