
import flax.linen as nn
import jax
import jax.numpy as jnp


class     lowercase (		nn.Module       ):
		__lowercase	:	int
		__lowercase	:	jnp.dtype     					=    jnp.floataa



		def __UpperCamelCase			(			self	)  -> str:
				"""simple docstring"""
				UpperCamelCase          =					nn.Conv(
				    self.out_channels    ,				kernel_size=(3, 3)    ,				strides=(1, 1)    ,				padding=((1, 1), (1, 1))    ,				dtype=self.dtype    ,				)



		def __call__(			self    ,				A_	)  -> Tuple:
				"""simple docstring"""
				UpperCamelCase     ,  UpperCamelCase     ,  UpperCamelCase     ,  UpperCamelCase          =					hidden_states.shape
				UpperCamelCase          =					jax.image.resize(
				    A_    ,				shape=(batch, height * 2, width * 2, channels)    ,				method='nearest'    ,				)
				UpperCamelCase          =					self.conv(A_	)
				return hidden_states






class     lowercase (		nn.Module       ):
		__lowercase	:	int
		__lowercase	:	jnp.dtype     					=    jnp.floataa



		def __UpperCamelCase			(			self	)  -> Any:
				"""simple docstring"""
				UpperCamelCase          =					nn.Conv(
				    self.out_channels    ,				kernel_size=(3, 3)    ,				strides=(2, 2)    ,				padding=((1, 1), (1, 1))    ,				dtype=self.dtype    ,				)



		def __call__(			self    ,				A_	)  -> Dict:
				"""simple docstring"""
				UpperCamelCase          =					self.conv(A_	)
				return hidden_states






class     lowercase (		nn.Module       ):
		__lowercase	:	int
		__lowercase	:	int     					=    None
		__lowercase	:	float     					=    0.0
		__lowercase	:	bool     					=    None
		__lowercase	:	jnp.dtype     					=    jnp.floataa



		def __UpperCamelCase			(			self	)  -> int:
				"""simple docstring"""
				UpperCamelCase          =					self.in_channels if self.out_channels is None else self.out_channels

				UpperCamelCase          =					nn.GroupNorm(num_groups=32    ,				epsilon=1e-5	)
				UpperCamelCase          =					nn.Conv(
				    A_    ,				kernel_size=(3, 3)    ,				strides=(1, 1)    ,				padding=((1, 1), (1, 1))    ,				dtype=self.dtype    ,				)

				UpperCamelCase          =					nn.Dense(A_    ,				dtype=self.dtype	)

				UpperCamelCase          =					nn.GroupNorm(num_groups=32    ,				epsilon=1e-5	)
				UpperCamelCase          =					nn.Dropout(self.dropout_prob	)
				UpperCamelCase          =					nn.Conv(
				    A_    ,				kernel_size=(3, 3)    ,				strides=(1, 1)    ,				padding=((1, 1), (1, 1))    ,				dtype=self.dtype    ,				)

				UpperCamelCase          =					self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

				UpperCamelCase          =					None
				if use_nin_shortcut:
						UpperCamelCase          =					nn.Conv(
						    A_    ,				kernel_size=(1, 1)    ,				strides=(1, 1)    ,				padding='VALID'    ,				dtype=self.dtype    ,				)



		def __call__(			self    ,				A_    ,				A_    ,				A_=True	)  -> Tuple:
				"""simple docstring"""
				UpperCamelCase          =					hidden_states
				UpperCamelCase          =					self.norma(A_	)
				UpperCamelCase          =					nn.swish(A_	)
				UpperCamelCase          =					self.conva(A_	)

				UpperCamelCase          =					self.time_emb_proj(nn.swish(A_	)	)
				UpperCamelCase          =					jnp.expand_dims(jnp.expand_dims(A_    ,				1	)    ,				1	)
				UpperCamelCase          =					hidden_states + temb

				UpperCamelCase          =					self.norma(A_	)
				UpperCamelCase          =					nn.swish(A_	)
				UpperCamelCase          =					self.dropout(A_    ,				A_	)
				UpperCamelCase          =					self.conva(A_	)

				if self.conv_shortcut is not None:
						UpperCamelCase          =					self.conv_shortcut(A_	)

				return hidden_states + residual


from __future__ import annotations


def 				A	( lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)       ->  list:
		'''simple docstring'''

		UpperCamelCase          =					[]
		UpperCamelCase     ,  UpperCamelCase          =					input_list[low:mid], input_list[mid : high + 1]
		while left and right:
				result.append((left if left[0] <= right[0] else right).pop(0			)			)
		UpperCamelCase          =					result + left + right
		return input_list


def 				A	( lowercase			)       ->  list:
		'''simple docstring'''

		if len(lowercase			) <= 1:
				return input_list
		UpperCamelCase          =					list(lowercase			)

		# iteration for two-way merging
		UpperCamelCase          =					2
		while p <= len(lowercase			):
				# getting low, high and middle value for merge-sort of single list
				for i in range(0   ,	len(lowercase			)   ,	lowercase			):
						UpperCamelCase          =					i
						UpperCamelCase          =					i + p - 1
						UpperCamelCase          =					(low + high + 1) // 2
						UpperCamelCase          =					merge(lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)
				# final merge of last two parts
				if p * 2 >= len(lowercase			):
						UpperCamelCase          =					i
						UpperCamelCase          =					merge(lowercase   ,	0   ,	lowercase   ,	len(lowercase			) - 1			)
						break
				p *= 2

		return input_list


if __name__ == "__main__":
					_UpperCAmelCase :			Any              =	input("Enter numbers separated by a comma:\n").strip()
					if user_input == "":
										_UpperCAmelCase :			Optional[Any]              =	[]
					else:
										_UpperCAmelCase :			Any              =	[int(item.strip()) for item in user_input.split(",")]
					print(iter_merge_sort(unsorted))
