





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

class 		UpperCamelCase__			(				nn.Module       ):



     '''simple docstring'''

     __snake_case   :     Union[str, Any]		     =      42
     __snake_case   :     Optional[int]		     =      jnp.floataa






     def     SCREAMING_SNAKE_CASE__  (							self						:   List[Any]	)					->		Union[str, Any]:




           '''simple docstring'''


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






     def __call__(							self						:   Union[str, Any]						,lowerCamelCase__						:   Optional[int]	)					->		Any:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						hidden_states.shape
           SCREAMING_SNAKE_CASE		=						jax.image.resize(
               a_						,shape=(batch, height * 2, width * 2, channels)						,method="""nearest"""						,)
           SCREAMING_SNAKE_CASE		=						self.conv(a_	)
           return hidden_states

class 		UpperCamelCase__			(				nn.Module       ):



     '''simple docstring'''

     __snake_case   :     List[Any]		     =      42
     __snake_case   :     Any		     =      jnp.floataa






     def     SCREAMING_SNAKE_CASE__  (							self						:   Dict	)					->		Optional[Any]:




           '''simple docstring'''


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






     def __call__(							self						:   Dict						,lowerCamelCase__						:   str	)					->		Dict:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						self.conv(a_	)
           return hidden_states

class 		UpperCamelCase__			(				nn.Module       ):



     '''simple docstring'''

     __snake_case   :     Optional[Any]		     =      42
     __snake_case   :     str		     =      None
     __snake_case   :     Union[str, Any]		     =      0.0
     __snake_case   :     List[Any]		     =      None
     __snake_case   :     Tuple		     =      jnp.floataa






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




           '''simple docstring'''


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

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

           SCREAMING_SNAKE_CASE		=						nn.Dense(a_						,dtype=self.dtype	)

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

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

           SCREAMING_SNAKE_CASE		=						None
           if use_nin_shortcut:
                 SCREAMING_SNAKE_CASE		=						nn.Conv(
                     a_						,kernel_size=(1, 1)						,strides=(1, 1)						,padding="""VALID"""						,dtype=self.dtype						,)






     def __call__(							self						:   Tuple						,lowerCamelCase__						:   Optional[int]						,lowerCamelCase__						:   str						,lowerCamelCase__						:   Optional[int]=True	)					->		Dict:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE		=						hidden_states
           SCREAMING_SNAKE_CASE		=						self.norma(a_	)
           SCREAMING_SNAKE_CASE		=						nn.swish(a_	)
           SCREAMING_SNAKE_CASE		=						self.conva(a_	)

           SCREAMING_SNAKE_CASE		=						self.time_emb_proj(nn.swish(a_	)	)
           SCREAMING_SNAKE_CASE		=						jnp.expand_dims(jnp.expand_dims(a_						,1	)						,1	)
           SCREAMING_SNAKE_CASE		=						hidden_states + temb

           SCREAMING_SNAKE_CASE		=						self.norma(a_	)
           SCREAMING_SNAKE_CASE		=						nn.swish(a_	)
           SCREAMING_SNAKE_CASE		=						self.dropout(a_						,a_	)
           SCREAMING_SNAKE_CASE		=						self.conva(a_	)

           if self.conv_shortcut is not None:
                 SCREAMING_SNAKE_CASE		=						self.conv_shortcut(a_	)

           return hidden_states + residual













from __future__ import annotations

import math



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       bool:


      '''simple docstring'''


      if 1 < number < 4:
            # 2 and 3 are primes
            return True
      elif number < 2 or number % 2 == 0 or number % 3 == 0:
            # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
            return False

      # All primes number are in format of 6k +/- 1
      for i in range(5			,						int(math.sqrt(_SCREAMING_SNAKE_CASE     ) + 1     )			,						6     ):
            if number % i == 0 or number % (i + 2) == 0:
                  return False
      return True



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       list[int]:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						str(_SCREAMING_SNAKE_CASE     )
      SCREAMING_SNAKE_CASE		=						[n]
      for i in range(1			,						len(_SCREAMING_SNAKE_CASE     )     ):
            list_nums.append(int(str_num[i:]     )     )
            list_nums.append(int(str_num[:-i]     )     )
      return list_nums



def        __lowercase       (				_SCREAMING_SNAKE_CASE     )			->       bool:


      '''simple docstring'''


      if len(str(_SCREAMING_SNAKE_CASE     )     ) > 3:
            if not is_prime(int(str(_SCREAMING_SNAKE_CASE     )[-3:]     )     ) or not is_prime(int(str(_SCREAMING_SNAKE_CASE     )[:3]     )     ):
                  return False
      return True



def        __lowercase       (				_SCREAMING_SNAKE_CASE = 11     )			->       list[int]:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE		=						[]
      SCREAMING_SNAKE_CASE		=						13
      while len(_SCREAMING_SNAKE_CASE     ) != count:
            if validate(_SCREAMING_SNAKE_CASE     ):
                  SCREAMING_SNAKE_CASE		=						list_truncated_nums(_SCREAMING_SNAKE_CASE     )
                  if all(is_prime(_SCREAMING_SNAKE_CASE     ) for i in list_nums     ):
                        list_truncated_primes.append(_SCREAMING_SNAKE_CASE     )
            num += 2
      return list_truncated_primes



def        __lowercase       (				)			->       int:


      '''simple docstring'''


      return sum(compute_truncated_primes(11     )     )


if __name__ == "__main__":
      print(F'''{sum(compute_truncated_primes(1_1)) = }''')


