'''simple docstring'''






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




class    a (       nn.Module				):



  """simple docstring"""
  __lowerCAmelCase				      =					42
  __lowerCAmelCase				      =					jnp.floataa







  def    lowercase_  (							self					):

    '''simple docstring'''







    __UpperCAmelCase:					List[Any]		= nn.Conv(
        self.out_channels   ,    kernel_size=(3, 3)   ,    strides=(1, 1)   ,    padding=((1, 1), (1, 1))   ,    dtype=self.dtype   ,    )







  def __call__(							self   ,    snake_case_					):

    '''simple docstring'''







    __UpperCAmelCase, __UpperCAmelCase, __UpperCAmelCase, __UpperCAmelCase:					Optional[Any]		= hidden_states.shape
    __UpperCAmelCase:					Optional[Any]		= jax.image.resize(
        snake_case_   ,    shape=(batch, height * 2, width * 2, channels)   ,    method="""nearest"""   ,    )
    __UpperCAmelCase:					int		= self.conv(snake_case_					)
    return hidden_states




class    a (       nn.Module				):



  """simple docstring"""
  __lowerCAmelCase				      =					42
  __lowerCAmelCase				      =					jnp.floataa







  def    lowercase_  (							self					):

    '''simple docstring'''







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







  def __call__(							self   ,    snake_case_					):

    '''simple docstring'''







    __UpperCAmelCase:					str		= self.conv(snake_case_					)
    return hidden_states




class    a (       nn.Module				):



  """simple docstring"""
  __lowerCAmelCase				      =					42
  __lowerCAmelCase				      =					None
  __lowerCAmelCase				      =					0.0
  __lowerCAmelCase				      =					None
  __lowerCAmelCase				      =					jnp.floataa







  def    lowercase_  (							self					):

    '''simple docstring'''







    __UpperCAmelCase:					Dict		= self.in_channels if self.out_channels is None else self.out_channels

    __UpperCAmelCase:					List[str]		= nn.GroupNorm(num_groups=32   ,    epsilon=1e-5					)
    __UpperCAmelCase:					Any		= nn.Conv(
        snake_case_   ,    kernel_size=(3, 3)   ,    strides=(1, 1)   ,    padding=((1, 1), (1, 1))   ,    dtype=self.dtype   ,    )

    __UpperCAmelCase:					Any		= nn.Dense(snake_case_   ,    dtype=self.dtype					)

    __UpperCAmelCase:					List[str]		= nn.GroupNorm(num_groups=32   ,    epsilon=1e-5					)
    __UpperCAmelCase:					Dict		= nn.Dropout(self.dropout_prob					)
    __UpperCAmelCase:					Union[str, Any]		= nn.Conv(
        snake_case_   ,    kernel_size=(3, 3)   ,    strides=(1, 1)   ,    padding=((1, 1), (1, 1))   ,    dtype=self.dtype   ,    )

    __UpperCAmelCase:					Optional[Any]		= self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

    __UpperCAmelCase:					Any		= None
    if use_nin_shortcut:
      __UpperCAmelCase:					Optional[int]		= nn.Conv(
          snake_case_   ,    kernel_size=(1, 1)   ,    strides=(1, 1)   ,    padding="""VALID"""   ,    dtype=self.dtype   ,    )







  def __call__(							self   ,    snake_case_   ,    snake_case_   ,    snake_case_=True					):

    '''simple docstring'''







    __UpperCAmelCase:					List[Any]		= hidden_states
    __UpperCAmelCase:					List[Any]		= self.norma(snake_case_					)
    __UpperCAmelCase:					Dict		= nn.swish(snake_case_					)
    __UpperCAmelCase:					Optional[int]		= self.conva(snake_case_					)

    __UpperCAmelCase:					Optional[int]		= self.time_emb_proj(nn.swish(snake_case_					)					)
    __UpperCAmelCase:					Dict		= jnp.expand_dims(jnp.expand_dims(snake_case_   ,    1					)   ,    1					)
    __UpperCAmelCase:					List[str]		= hidden_states + temb

    __UpperCAmelCase:					Any		= self.norma(snake_case_					)
    __UpperCAmelCase:					int		= nn.swish(snake_case_					)
    __UpperCAmelCase:					List[str]		= self.dropout(snake_case_   ,    snake_case_					)
    __UpperCAmelCase:					List[str]		= self.conva(snake_case_					)

    if self.conv_shortcut is not None:
      __UpperCAmelCase:					Dict		= self.conv_shortcut(snake_case_					)

    return hidden_states + residual
'''simple docstring'''






from __future__ import annotations

SCREAMING_SNAKE_CASE_	   =			10






def  UpperCamelCase__					(					_lowercase    :				list[int]     )							->	list[int]:
  __UpperCAmelCase:					Union[str, Any]		= 1
  __UpperCAmelCase:					Optional[Any]		= max(_lowercase     )
  while placement <= max_digit:
    # declare and initialize empty buckets
    __UpperCAmelCase:					list[list]		= [[] for _ in range(_lowercase     )]
    # split list_of_ints between the buckets
    for i in list_of_ints:
      __UpperCAmelCase:					Optional[Any]		= int((i / placement) % RADIX     )
      buckets[tmp].append(_lowercase     )
    # put each buckets' contents into list_of_ints
    __UpperCAmelCase:					Optional[int]		= 0
    for b in range(_lowercase     ):
      for i in buckets[b]:
        __UpperCAmelCase:					str		= i
        a += 1
        # move to next
    placement *= RADIX
  return list_of_ints


if __name__ == "__main__":
    import doctest

    doctest.testmod()