


"""simple docstring"""






import heapq
import sys

import numpy as np

UpperCamelCase__				:str			   =	tuple[int, int]






class      A:

		"""simple docstring"""





		def __init__( self   )      ->	Tuple:

					"""simple docstring"""



					_UpperCamelCase					:Optional[int]					     =	[]
					_UpperCamelCase					:Optional[Any]					     =	set()
		def   _UpperCamelCase( self   )      ->	str:

					"""simple docstring"""



					if not self.empty():
								return self.elements[0][0]
					else:
								return float('''inf'''   )
		def   _UpperCamelCase( self   )      ->	List[Any]:

					"""simple docstring"""



					return len(self.elements   ) == 0
		def   _UpperCamelCase( self					,				SCREAMING_SNAKE_CASE__					,				SCREAMING_SNAKE_CASE__   )      ->	str:

					"""simple docstring"""



					if item not in self.set:
								heapq.heappush(self.elements					,				(priority, item)   )
								self.set.add(SCREAMING_SNAKE_CASE__   )
					else:
								# update
								# print("update", item)
								_UpperCamelCase					:Optional[Any]					     =	[]
								((_UpperCamelCase)     ,      (_UpperCamelCase))					:Tuple					     =	heapq.heappop(self.elements   )
								while x != item:
											temp.append((pri, x)   )
											((_UpperCamelCase)     ,      (_UpperCamelCase))					:Any					     =	heapq.heappop(self.elements   )
								temp.append((priority, item)   )
								for pro, xxx in temp:
											heapq.heappush(self.elements					,				(pro, xxx)   )
		def   _UpperCamelCase( self					,				SCREAMING_SNAKE_CASE__   )      ->	List[str]:

					"""simple docstring"""



					if item in self.set:
								self.set.remove(SCREAMING_SNAKE_CASE__   )
								_UpperCamelCase					:int					     =	[]
								((_UpperCamelCase)     ,      (_UpperCamelCase))					:Optional[Any]					     =	heapq.heappop(self.elements   )
								while x != item:
											temp.append((pro, x)   )
											((_UpperCamelCase)     ,      (_UpperCamelCase))					:Optional[Any]					     =	heapq.heappop(self.elements   )
								for prito, yyy in temp:
											heapq.heappush(self.elements					,				(prito, yyy)   )
		def   _UpperCamelCase( self   )      ->	Optional[int]:

					"""simple docstring"""



					return self.elements[0][1]





		def   _UpperCamelCase( self   )      ->	Any:

					"""simple docstring"""



					((_UpperCamelCase)     ,      (_UpperCamelCase))					:Tuple					     =	heapq.heappop(self.elements   )
					self.set.remove(SCREAMING_SNAKE_CASE__   )
					return (priority, item)





def 				A_       ( snake_case__       ,					snake_case__		)					->  Any:
			# euclidean distance
			_UpperCamelCase					:Union[str, Any]					     =	np.array(snake_case__		)
			_UpperCamelCase					:Tuple					     =	np.array(snake_case__		)
			return np.linalg.norm(a - b		)





def 				A_       ( snake_case__       ,					snake_case__		)					->  List[str]:
			# integer division by time variable
			return consistent_heuristic(snake_case__       ,					snake_case__		) // t





def 				A_       ( snake_case__       ,					snake_case__		)					->  List[str]:
			# manhattan distance
			return abs(p[0] - goal[0]		) + abs(p[1] - goal[1]		)





def 				A_       ( snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__		)					->  List[Any]:
			_UpperCamelCase					:Tuple					     =	g_function[start] + Wa * heuristics[i](snake_case__       ,					snake_case__		)
			return ans





def 				A_       ( snake_case__       ,					snake_case__       ,					snake_case__		)					->  Tuple:
			_UpperCamelCase					:Union[str, Any]					     =	np.chararray((n, n)		)
			for i in range(snake_case__		):
						for j in range(snake_case__		):
									_UpperCamelCase					:List[Any]					     =	'''*'''

			for i in range(snake_case__		):
						for j in range(snake_case__		):
									if (j, (n - 1) - i) in blocks:
												_UpperCamelCase					:Any					     =	'''#'''

			_UpperCamelCase					:Tuple					     =	'''-'''
			_UpperCamelCase					:Dict					     =	back_pointer[goal]
			while x != start:
						((_UpperCamelCase)     ,      (_UpperCamelCase))					:Tuple					     =	x
						# print(x)
						_UpperCamelCase					:Any					     =	'''-'''
						_UpperCamelCase					:Optional[int]					     =	back_pointer[x]
			_UpperCamelCase					:Tuple					     =	'''-'''

			for i in range(snake_case__		):
						for j in range(snake_case__		):
									if (i, j) == (0, n - 1):
												print(grid[i][j]       ,					end=''' '''		)
												print('''<-- End position'''       ,					end=''' '''		)
									else:
												print(grid[i][j]       ,					end=''' '''		)
						print()
			print('''^'''		)
			print('''Start position'''		)
			print()
			print('''# is an obstacle'''		)
			print('''- is the path taken by algorithm'''		)
			print('''PATH TAKEN BY THE ALGORITHM IS:-'''		)
			_UpperCamelCase					:int					     =	back_pointer[goal]
			while x != start:
						print(snake_case__       ,					end=''' '''		)
						_UpperCamelCase					:Optional[int]					     =	back_pointer[x]
			print(snake_case__		)
			sys.exit()





def 				A_       ( snake_case__		)					->  Dict:
			if p[0] < 0 or p[0] > n - 1:
						return False
			if p[1] < 0 or p[1] > n - 1:
						return False
			return True





def 				A_       ( snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					)					->  str:
			for itera in range(snake_case__		):
						open_list[itera].remove_element(snake_case__		)
			# print("s", s)
			# print("j", j)
			((_UpperCamelCase)     ,      (_UpperCamelCase))					:Optional[Any]					     =	s
			_UpperCamelCase					:List[Any]					     =	(x - 1, y)
			_UpperCamelCase					:Optional[int]					     =	(x + 1, y)
			_UpperCamelCase					:List[Any]					     =	(x, y + 1)
			_UpperCamelCase					:List[Any]					     =	(x, y - 1)

			for neighbours in [left, right, up, down]:
						if neighbours not in blocks:
									if valid(snake_case__		) and neighbours not in visited:
												# print("neighbour", neighbours)
												visited.add(snake_case__		)
												_UpperCamelCase					:str					     =	-1
												_UpperCamelCase					:str					     =	float('''inf'''		)

									if valid(snake_case__		) and g_function[neighbours] > g_function[s] + 1:
												_UpperCamelCase					:str					     =	g_function[s] + 1
												_UpperCamelCase					:Optional[int]					     =	s
												if neighbours not in close_list_anchor:
															open_list[0].put(snake_case__       ,					key(snake_case__       ,					0       ,					snake_case__       ,					snake_case__		)		)
															if neighbours not in close_list_inad:
																		for var in range(1       ,					snake_case__		):
																					if key(snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__		) <= Wa * key(
																					    snake_case__       ,					0       ,					snake_case__       ,					snake_case__		):
																								open_list[j].put(
																								    snake_case__       ,					key(snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__		)		)





def 				A_       ( )					->  Dict:
			_UpperCamelCase					:Tuple					     =	[]
			for x in range(1       ,					5		):
						for y in range(1       ,					6		):
									some_list.append((x, y)		)

			for x in range(15       ,					20		):
						some_list.append((x, 17)		)

			for x in range(10       ,					19		):
						for y in range(1       ,					15		):
									some_list.append((x, y)		)

    # L block
			for x in range(1       ,					4		):
						for y in range(12       ,					19		):
									some_list.append((x, y)		)
			for x in range(3       ,					13		):
						for y in range(16       ,					19		):
									some_list.append((x, y)		)
			return some_list


UpperCamelCase__				:int			   =	{0: consistent_heuristic, 1: heuristic_a, 2: heuristic_a}

UpperCamelCase__				:Any			   =	[
    (0, 1),
    (1, 1),
    (2, 1),
    (3, 1),
    (4, 1),
    (5, 1),
    (6, 1),
    (7, 1),
    (8, 1),
    (9, 1),
    (10, 1),
    (11, 1),
    (12, 1),
    (13, 1),
    (14, 1),
    (15, 1),
    (16, 1),
    (17, 1),
    (18, 1),
    (19, 1),
]
UpperCamelCase__				:Union[str, Any]			   =	make_common_ground()


UpperCamelCase__				:int			   =	blocks_blk
# hyper parameters
UpperCamelCase__				:Union[str, Any]			   =	1
UpperCamelCase__				:Optional[int]			   =	1
UpperCamelCase__				:Any			   =	20
UpperCamelCase__				:List[Any]			   =	3  # one consistent and two other inconsistent

# start and end destination
UpperCamelCase__				:Tuple			   =	(0, 0)
UpperCamelCase__				:int			   =	(n - 1, n - 1)

UpperCamelCase__				:Union[str, Any]			   =	1





def 				A_       ( snake_case__       ,					snake_case__       ,					snake_case__		)					->  Optional[Any]:
			_UpperCamelCase					:List[str]					     =	{start: 0, goal: float('''inf'''		)}
			_UpperCamelCase					:Tuple					     =	{start: -1, goal: -1}
			_UpperCamelCase					:List[str]					     =	[]
			_UpperCamelCase					:Tuple					     =	set()

			for i in range(snake_case__		):
						open_list.append(PriorityQueue()		)
						open_list[i].put(snake_case__       ,					key(snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__		)		)

			_UpperCamelCase					:list[int]					     =	[]
			_UpperCamelCase					:list[int]					     =	[]
			while open_list[0].minkey() < float('''inf'''		):
						for i in range(1       ,					snake_case__		):
									# print(open_list[0].minkey(), open_list[i].minkey())
									if open_list[i].minkey() <= Wa * open_list[0].minkey():
												global t
												t += 1
												if g_function[goal] <= open_list[i].minkey():
															if g_function[goal] < float('''inf'''		):
																		do_something(snake_case__       ,					snake_case__       ,					snake_case__		)
												else:
															_UpperCamelCase     ,      _UpperCamelCase					:List[Any]					     =	open_list[i].top_show()
															visited.add(snake_case__		)
															expand_state(
															    snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					)
															close_list_inad.append(snake_case__		)
									else:
												if g_function[goal] <= open_list[0].minkey():
															if g_function[goal] < float('''inf'''		):
																		do_something(snake_case__       ,					snake_case__       ,					snake_case__		)
												else:
															_UpperCamelCase					:Optional[int]					     =	open_list[0].top_show()
															visited.add(snake_case__		)
															expand_state(
															    snake_case__       ,					0       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					snake_case__       ,					)
															close_list_anchor.append(snake_case__		)
			print('''No path found to goal'''		)
			print()
			for i in range(n - 1       ,					-1       ,					-1		):
						for j in range(snake_case__		):
									if (j, i) in blocks:
												print('''#'''       ,					end=''' '''		)
									elif (j, i) in back_pointer:
												if (j, i) == (n - 1, n - 1):
															print('''*'''       ,					end=''' '''		)
												else:
															print('''-'''       ,					end=''' '''		)
									else:
												print('''*'''       ,					end=''' '''		)
									if (j, i) == (n - 1, n - 1):
												print('''<-- End position'''       ,					end=''' '''		)
						print()
			print('''^'''		)
			print('''Start position'''		)
			print()
			print('''# is an obstacle'''		)
			print('''- is the path taken by algorithm'''		)


if __name__ == "__main__":
					multi_a_star(start, goal, n_heuristic)





"""simple docstring"""






import unittest

import numpy as np

from transformers.testing_utils import require_flax, require_tf, require_torch
from transformers.utils import (
    expand_dims,
    flatten_dict,
    is_flax_available,
    is_tf_available,
    is_torch_available,
    reshape,
    squeeze,
    transpose,
)


if is_flax_available():
					import jax.numpy as jnp

if is_tf_available():
					import tensorflow as tf

if is_torch_available():
					import torch






class      A(  unittest.TestCase		):

		"""simple docstring"""





		def   _UpperCamelCase( self   )      ->	int:

					"""simple docstring"""



					_UpperCamelCase					:List[str]					     =	{
					    '''task_specific_params''': {
					        '''summarization''': {'''length_penalty''': 1.0, '''max_length''': 1_28, '''min_length''': 12, '''num_beams''': 4},
					        '''summarization_cnn''': {'''length_penalty''': 2.0, '''max_length''': 1_42, '''min_length''': 56, '''num_beams''': 4},
					        '''summarization_xsum''': {'''length_penalty''': 1.0, '''max_length''': 62, '''min_length''': 11, '''num_beams''': 6},
					    }
					}
					_UpperCamelCase					:Union[str, Any]					     =	{
					    '''task_specific_params.summarization.length_penalty''': 1.0,
					    '''task_specific_params.summarization.max_length''': 1_28,
					    '''task_specific_params.summarization.min_length''': 12,
					    '''task_specific_params.summarization.num_beams''': 4,
					    '''task_specific_params.summarization_cnn.length_penalty''': 2.0,
					    '''task_specific_params.summarization_cnn.max_length''': 1_42,
					    '''task_specific_params.summarization_cnn.min_length''': 56,
					    '''task_specific_params.summarization_cnn.num_beams''': 4,
					    '''task_specific_params.summarization_xsum.length_penalty''': 1.0,
					    '''task_specific_params.summarization_xsum.max_length''': 62,
					    '''task_specific_params.summarization_xsum.min_length''': 11,
					    '''task_specific_params.summarization_xsum.num_beams''': 6,
					}

					self.assertEqual(flatten_dict(SCREAMING_SNAKE_CASE__   )					,				SCREAMING_SNAKE_CASE__   )
		def   _UpperCamelCase( self   )      ->	Any:

					"""simple docstring"""



					_UpperCamelCase					:Optional[int]					     =	np.random.randn(3					,				4   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__   )					,				x.transpose()   )   )

					_UpperCamelCase					:Tuple					     =	np.random.randn(3					,				4					,				5   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   )					,				x.transpose((1, 2, 0)   )   )   )
		@require_torch
		def   _UpperCamelCase( self   )      ->	str:

					"""simple docstring"""



					_UpperCamelCase					:Union[str, Any]					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:Any					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__   )					,				transpose(SCREAMING_SNAKE_CASE__   ).numpy()   )   )

					_UpperCamelCase					:int					     =	np.random.randn(3					,				4					,				5   )
					_UpperCamelCase					:Any					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   )					,				transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   ).numpy()   )   )
		@require_tf
		def   _UpperCamelCase( self   )      ->	Dict:

					"""simple docstring"""



					_UpperCamelCase					:Dict					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:List[str]					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__   )					,				transpose(SCREAMING_SNAKE_CASE__   ).numpy()   )   )

					_UpperCamelCase					:int					     =	np.random.randn(3					,				4					,				5   )
					_UpperCamelCase					:Dict					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   )					,				transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   ).numpy()   )   )
		@require_flax
		def   _UpperCamelCase( self   )      ->	str:

					"""simple docstring"""



					_UpperCamelCase					:int					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:Optional[Any]					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__   )					,				np.asarray(transpose(SCREAMING_SNAKE_CASE__   )   )   )   )

					_UpperCamelCase					:Dict					     =	np.random.randn(3					,				4					,				5   )
					_UpperCamelCase					:Dict					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   )					,				np.asarray(transpose(SCREAMING_SNAKE_CASE__					,				axes=(1, 2, 0)   )   )   )   )
		def   _UpperCamelCase( self   )      ->	int:

					"""simple docstring"""



					_UpperCamelCase					:int					     =	np.random.randn(3					,				4   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   )					,				np.reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   )   )   )

					_UpperCamelCase					:Dict					     =	np.random.randn(3					,				4					,				5   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   )					,				np.reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   )   )   )
		@require_torch
		def   _UpperCamelCase( self   )      ->	int:

					"""simple docstring"""



					_UpperCamelCase					:Union[str, Any]					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:Optional[Any]					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   )					,				reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   ).numpy()   )   )

					_UpperCamelCase					:str					     =	np.random.randn(3					,				4					,				5   )
					_UpperCamelCase					:str					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   )					,				reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   ).numpy()   )   )
		@require_tf
		def   _UpperCamelCase( self   )      ->	Tuple:

					"""simple docstring"""



					_UpperCamelCase					:Optional[int]					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:Dict					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   )					,				reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   ).numpy()   )   )

					_UpperCamelCase					:Union[str, Any]					     =	np.random.randn(3					,				4					,				5   )
					_UpperCamelCase					:Optional[int]					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   )					,				reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   ).numpy()   )   )
		@require_flax
		def   _UpperCamelCase( self   )      ->	int:

					"""simple docstring"""



					_UpperCamelCase					:List[str]					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:str					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   )					,				np.asarray(reshape(SCREAMING_SNAKE_CASE__					,				(4, 3)   )   )   )   )

					_UpperCamelCase					:Dict					     =	np.random.randn(3					,				4					,				5   )
					_UpperCamelCase					:Union[str, Any]					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   )					,				np.asarray(reshape(SCREAMING_SNAKE_CASE__					,				(12, 5)   )   )   )   )
		def   _UpperCamelCase( self   )      ->	int:

					"""simple docstring"""



					_UpperCamelCase					:Dict					     =	np.random.randn(1					,				3					,				4   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__   )					,				np.squeeze(SCREAMING_SNAKE_CASE__   )   )   )

					_UpperCamelCase					:List[Any]					     =	np.random.randn(1					,				4					,				1					,				5   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   )					,				np.squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   )   )   )
		@require_torch
		def   _UpperCamelCase( self   )      ->	Union[str, Any]:

					"""simple docstring"""



					_UpperCamelCase					:str					     =	np.random.randn(1					,				3					,				4   )
					_UpperCamelCase					:Any					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__   )					,				squeeze(SCREAMING_SNAKE_CASE__   ).numpy()   )   )

					_UpperCamelCase					:List[str]					     =	np.random.randn(1					,				4					,				1					,				5   )
					_UpperCamelCase					:List[Any]					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   )					,				squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   ).numpy()   )   )
		@require_tf
		def   _UpperCamelCase( self   )      ->	int:

					"""simple docstring"""



					_UpperCamelCase					:str					     =	np.random.randn(1					,				3					,				4   )
					_UpperCamelCase					:str					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__   )					,				squeeze(SCREAMING_SNAKE_CASE__   ).numpy()   )   )

					_UpperCamelCase					:str					     =	np.random.randn(1					,				4					,				1					,				5   )
					_UpperCamelCase					:str					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   )					,				squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   ).numpy()   )   )
		@require_flax
		def   _UpperCamelCase( self   )      ->	Optional[Any]:

					"""simple docstring"""



					_UpperCamelCase					:Union[str, Any]					     =	np.random.randn(1					,				3					,				4   )
					_UpperCamelCase					:Optional[Any]					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__   )					,				np.asarray(squeeze(SCREAMING_SNAKE_CASE__   )   )   )   )

					_UpperCamelCase					:Dict					     =	np.random.randn(1					,				4					,				1					,				5   )
					_UpperCamelCase					:int					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   )					,				np.asarray(squeeze(SCREAMING_SNAKE_CASE__					,				axis=2   )   )   )   )
		def   _UpperCamelCase( self   )      ->	Tuple:

					"""simple docstring"""



					_UpperCamelCase					:Dict					     =	np.random.randn(3					,				4   )
					self.assertTrue(np.allclose(expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   )					,				np.expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   )   )   )
		@require_torch
		def   _UpperCamelCase( self   )      ->	Tuple:

					"""simple docstring"""



					_UpperCamelCase					:List[str]					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:Union[str, Any]					     =	torch.tensor(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   )					,				expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   ).numpy()   )   )
		@require_tf
		def   _UpperCamelCase( self   )      ->	Optional[int]:

					"""simple docstring"""



					_UpperCamelCase					:str					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:int					     =	tf.constant(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   )					,				expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   ).numpy()   )   )





		@require_flax
		def   _UpperCamelCase( self   )      ->	List[Any]:

					"""simple docstring"""



					_UpperCamelCase					:Tuple					     =	np.random.randn(3					,				4   )
					_UpperCamelCase					:str					     =	jnp.array(SCREAMING_SNAKE_CASE__   )
					self.assertTrue(np.allclose(expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   )					,				np.asarray(expand_dims(SCREAMING_SNAKE_CASE__					,				axis=1   )   )   )   )

