


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


class 	_a							(      nn.Module      ):
							_lowercase     :      int
							_lowercase     :      jnp.dtype  				=			jnp.floataa

							def 				lowerCamelCase_			(							self:     Any							)      ->       Any:





									"""simple docstring"""







									lowercase__						=				nn.Conv(
									    self.out_channels   ,						kernel_size=(3, 3)   ,						strides=(1, 1)   ,						padding=((1, 1), (1, 1))   ,						dtype=self.dtype   ,						)


							def __call__(							self:     Dict   ,						UpperCamelCase_:     int							)      ->       Union[str, Any]:





									"""simple docstring"""







									lowercase__					,		lowercase__					,		lowercase__					,		lowercase__						=				hidden_states.shape
									lowercase__						=				jax.image.resize(
									    UpperCamelCase_   ,						shape=(batch, height * 2, width * 2, channels)   ,						method='''nearest'''   ,						)
									lowercase__						=				self.conv(UpperCamelCase_							)
									return hidden_states


class 	_a							(      nn.Module      ):
							_lowercase     :      int
							_lowercase     :      jnp.dtype  				=			jnp.floataa

							def 				lowerCamelCase_			(							self:     Optional[int]							)      ->       Optional[Any]:





									"""simple docstring"""







									lowercase__						=				nn.Conv(
									    self.out_channels   ,						kernel_size=(3, 3)   ,						strides=(2, 2)   ,						padding=((1, 1), (1, 1))   ,						dtype=self.dtype   ,						)


							def __call__(							self:     Optional[Any]   ,						UpperCamelCase_:     Any							)      ->       Any:





									"""simple docstring"""







									lowercase__						=				self.conv(UpperCamelCase_							)
									return hidden_states


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

							def 				lowerCamelCase_			(							self:     Optional[Any]							)      ->       Union[str, Any]:





									"""simple docstring"""







									lowercase__						=				self.in_channels if self.out_channels is None else self.out_channels

									lowercase__						=				nn.GroupNorm(num_groups=32   ,						epsilon=1E-5							)
									lowercase__						=				nn.Conv(
									    UpperCamelCase_   ,						kernel_size=(3, 3)   ,						strides=(1, 1)   ,						padding=((1, 1), (1, 1))   ,						dtype=self.dtype   ,						)

									lowercase__						=				nn.Dense(UpperCamelCase_   ,						dtype=self.dtype							)

									lowercase__						=				nn.GroupNorm(num_groups=32   ,						epsilon=1E-5							)
									lowercase__						=				nn.Dropout(self.dropout_prob							)
									lowercase__						=				nn.Conv(
									    UpperCamelCase_   ,						kernel_size=(3, 3)   ,						strides=(1, 1)   ,						padding=((1, 1), (1, 1))   ,						dtype=self.dtype   ,						)

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

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


							def __call__(							self:     str   ,						UpperCamelCase_:     List[Any]   ,						UpperCamelCase_:     List[Any]   ,						UpperCamelCase_:     Optional[Any]=True							)      ->       Optional[Any]:





									"""simple docstring"""







									lowercase__						=				hidden_states
									lowercase__						=				self.norma(UpperCamelCase_							)
									lowercase__						=				nn.swish(UpperCamelCase_							)
									lowercase__						=				self.conva(UpperCamelCase_							)

									lowercase__						=				self.time_emb_proj(nn.swish(UpperCamelCase_							)							)
									lowercase__						=				jnp.expand_dims(jnp.expand_dims(UpperCamelCase_   ,						1							)   ,						1							)
									lowercase__						=				hidden_states + temb

									lowercase__						=				self.norma(UpperCamelCase_							)
									lowercase__						=				nn.swish(UpperCamelCase_							)
									lowercase__						=				self.dropout(UpperCamelCase_   ,						UpperCamelCase_							)
									lowercase__						=				self.conva(UpperCamelCase_							)

									if self.conv_shortcut is not None:
											lowercase__						=				self.conv_shortcut(UpperCamelCase_							)

									return hidden_states + residual






def       _a			(				SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE					):


		"""simple docstring"""




		return base * power(SCREAMING_SNAKE_CASE						,    (exponent - 1)					) if exponent else 1


if __name__ == "__main__":
			print('Raise base to the power of exponent using recursion...')
			lowerCAmelCase	=							int(input('Enter the base: ').strip())
			lowerCAmelCase	=							int(input('Enter the exponent: ').strip())
			lowerCAmelCase	=							power(base, abs(exponent))
			if exponent < 0:  # power() does not properly deal w/ negative exponents
						lowerCAmelCase	=							1 / result
			print(f"""{base} to the power of {exponent} is {result}""")


