






'''simple docstring'''

import unittest

from transformers import AutoConfig, AutoTokenizer, BertConfig, TensorType, is_flax_available
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER, require_flax, slow


if is_flax_available():
						import jax

						from transformers.models.auto.modeling_flax_auto import FlaxAutoModel
						from transformers.models.bert.modeling_flax_bert import FlaxBertModel
						from transformers.models.roberta.modeling_flax_roberta import FlaxRobertaModel






@require_flax
class 							__magic_name__     (	unittest.TestCase				):







	"""simple docstring"""



	@slow
	def        lowerCamelCase__		(							self       )						->  str:
							for model_name in ["bert-base-cased", "bert-large-uncased"]:
													with self.subTest(_lowercase       ):
																			lowercase_      :   Optional[Any]        =			AutoConfig.from_pretrained(_lowercase       )
																			self.assertIsNotNone(_lowercase       )
																			self.assertIsInstance(_lowercase  ,      _lowercase       )

																			lowercase_      :   int        =			FlaxAutoModel.from_pretrained(_lowercase       )
																			self.assertIsNotNone(_lowercase       )
																			self.assertIsInstance(_lowercase  ,      _lowercase       )
	@slow
	def        lowerCamelCase__		(							self       )						->  Optional[int]:
							for model_name in ["roberta-base", "roberta-large"]:
													with self.subTest(_lowercase       ):
																			lowercase_      :   List[str]        =			AutoConfig.from_pretrained(_lowercase       )
																			self.assertIsNotNone(_lowercase       )
																			self.assertIsInstance(_lowercase  ,      _lowercase       )

																			lowercase_      :   Optional[Any]        =			FlaxAutoModel.from_pretrained(_lowercase       )
																			self.assertIsNotNone(_lowercase       )
																			self.assertIsInstance(_lowercase  ,      _lowercase       )
	@slow
	def        lowerCamelCase__		(							self       )						->  Tuple:
							for model_name in ["bert-base-cased", "bert-large-uncased"]:
													lowercase_      :   List[Any]        =			AutoTokenizer.from_pretrained(_lowercase       )
													lowercase_      :   Dict        =			FlaxBertModel.from_pretrained(_lowercase       )
													lowercase_      :   int        =			tokenizer('Do you support jax jitted function?'  ,      return_tensors=TensorType.JAX       )

													@jax.jit
													def eval(**_lowercase       ):
																			return model(**_lowercase       )

													eval(**_lowercase       ).block_until_ready()
	@slow
	def        lowerCamelCase__		(							self       )						->  Optional[Any]:
							for model_name in ["roberta-base", "roberta-large"]:
													lowercase_      :   Union[str, Any]        =			AutoTokenizer.from_pretrained(_lowercase       )
													lowercase_      :   Optional[int]        =			FlaxRobertaModel.from_pretrained(_lowercase       )
													lowercase_      :   int        =			tokenizer('Do you support jax jitted function?'  ,      return_tensors=TensorType.JAX       )

													@jax.jit
													def eval(**_lowercase       ):
																			return model(**_lowercase       )

													eval(**_lowercase       ).block_until_ready()
	def        lowerCamelCase__		(							self       )						->  Tuple:
							with self.assertRaisesRegex(
							    _lowercase  ,      'bert-base is not a local folder and is not a valid model identifier'       ):
													lowercase_      :   List[Any]        =			FlaxAutoModel.from_pretrained('bert-base'       )
	def        lowerCamelCase__		(							self       )						->  int:
							with self.assertRaisesRegex(
							    _lowercase  ,      r'aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)'       ):
													lowercase_      :   Union[str, Any]        =			FlaxAutoModel.from_pretrained(_lowercase  ,      revision='aaaaaa'       )
	def        lowerCamelCase__		(							self       )						->  str:
							with self.assertRaisesRegex(
							    _lowercase  ,      'hf-internal-testing/config-no-model does not appear to have a file named flax_model.msgpack'  ,      ):
													lowercase_      :   Union[str, Any]        =			FlaxAutoModel.from_pretrained('hf-internal-testing/config-no-model'       )







	def        lowerCamelCase__		(							self       )						->  Optional[int]:
							with self.assertRaisesRegex(_lowercase  ,      'Use `from_pt=True` to load this model'       ):
													lowercase_      :   Optional[Any]        =			FlaxAutoModel.from_pretrained('hf-internal-testing/tiny-bert-pt-only'       )








'''simple docstring'''

from __future__ import annotations






def 	_UpperCAmelCase    (  a		:	int = 4							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   Tuple        =			abs(a							) or 4
						return [[1 + x + y * row_size for x in range(a							)] for y in range(a							)]






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						return reverse_row(transpose(a							)							)
						# OR.. transpose(reverse_column(matrix))






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						return reverse_row(reverse_column(a							)							)
						# OR.. reverse_column(reverse_row(matrix))






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						return reverse_column(transpose(a							)							)
						# OR.. transpose(reverse_row(matrix))






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   Any        =			[list(a							) for x in zip(*a							)]
						return matrix






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   List[str]        =			matrix[::-1]
						return matrix






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			list[list[int]]:





						"""simple docstring"""
						lowercase_      :   str        =			[x[::-1] for x in matrix]
						return matrix






def 	_UpperCAmelCase    (  a		:	list[list[int]]							)			->			None:





						"""simple docstring"""
						for i in matrix:
												print(*a							)


if __name__ == "__main__":
						A:      Dict  				=				make_matrix()
						print("\norigin:\n")
						print_matrix(matrix)
						print("\nrotate 90 counterclockwise:\n")
						print_matrix(rotate_aa(matrix))

						A:      List[Any]  				=				make_matrix()
						print("\norigin:\n")
						print_matrix(matrix)
						print("\nrotate 180:\n")
						print_matrix(rotate_aaa(matrix))

						A:      List[str]  				=				make_matrix()
						print("\norigin:\n")
						print_matrix(matrix)
						print("\nrotate 270 counterclockwise:\n")
						print_matrix(rotate_aaa(matrix))
